@moonshot-ai/kimi-code 0.19.1 → 0.19.2
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 +1476 -789
- package/dist-web/assets/CodeBlockNode-DWqdMrZf.js +22 -0
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-C0rAlIZT.js → CodeBlockShell.vue_vue_type_style_index_0_lang-CP8vJ_jY.js} +1 -1
- package/dist-web/assets/{Tooltip-BGNN9cLC.js → Tooltip-DnT9F5O4.js} +1 -1
- package/dist-web/assets/arc-BTqlVy62.js +1 -0
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-CdJj5NzX.js → architectureDiagram-3BPJPVTR-DOs258PA.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-BM14SQiN.js → blockDiagram-GPEHLZMM-YpbL-evQ.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-FYQfQdwd.js → c4Diagram-AAUBKEIU-BQ0g7h08.js} +1 -1
- package/dist-web/assets/channel-C9wJxpza.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-V2R-DrVS.js → chunk-2J33WTMH-nYkFiTji.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-BabgZRBA.js → chunk-4BX2VUAB-CsmhqO62.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DkJmDlyu.js → chunk-55IACEB6-CUzTYEsP.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-CvIYC9nm.js → chunk-727SXJPM-BnqEbbXJ.js} +2 -2
- package/dist-web/assets/{chunk-AQP2D5EJ-uL8LYMfy.js → chunk-AQP2D5EJ-DtZARgEl.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-EcbDOlvH.js → chunk-FMBD7UC4-R7lWfBOs.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-C8Qo5Bp8.js → chunk-ND2GUHAM-CZaX1ZXe.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-DqF-jFth.js → chunk-QZHKN3VN-5MXrqfJe.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DqgKlhvP.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DqgKlhvP.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-BP-HoEg_.js → cose-bilkent-S5V4N54A-4f-2zAe6.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-BAqAth0y.js → dagre-BM42HDAG-B29IUQLO.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-CXLHAdSr.js → diagram-2AECGRRQ-BLG8l-kW.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-BoPiyK2f.js → diagram-5GNKFQAL-D49xpQ0V.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-B11ZVuuX.js → diagram-KO2AKTUF-CWBzbQ3X.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-B8fTjZXi.js → diagram-LMA3HP47-CAcmX_XH.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-DWzU9uYr.js → diagram-OG6HWLK6-BInwpJw8.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-4MqNXbsL.js → erDiagram-TEJ5UH35-Dckcr1cP.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-CCJIZLVz.js → flowDiagram-I6XJVG4X-CjWyYa_0.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-DNfMlT11.js → ganttDiagram-6RSMTGT7-B8-b8RY7.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-IBySLi3i.js → gitGraphDiagram-PVQCEYII-DF8nQ36i.js} +1 -1
- package/dist-web/assets/index-CKGltB1b.js +9 -0
- package/dist-web/assets/index-Cm9Q4xVi.js +3 -0
- package/dist-web/assets/index-DSjuug95.js +272 -0
- package/dist-web/assets/{index-CqOt95r5.js → index-Zbw78XRh.js} +1 -1
- package/dist-web/assets/index-sXB6HLvC.css +1 -0
- package/dist-web/assets/{index10-9hz8xOXN.js → index10-Dh4SYXXK.js} +2 -2
- package/dist-web/assets/index11-BIywvtHR.js +9 -0
- package/dist-web/assets/{index5-DYhhPUDp.js → index5-C_80WRqf.js} +1 -1
- package/dist-web/assets/{index6-DdsuTXIR.js → index6-kJ6dO27T.js} +1 -1
- package/dist-web/assets/{index7-CoWnZiYw.js → index7-Zg1vvU3j.js} +1 -1
- package/dist-web/assets/index8-Bqtk0wsj.js +2 -0
- package/dist-web/assets/{infoDiagram-5YYISTIA-BoRSkIVT.js → infoDiagram-5YYISTIA-m1Ft7ptD.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-oMuu2qq0.js → ishikawaDiagram-YF4QCWOH-Cqe15rN3.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-DeuffmUz.js → journeyDiagram-JHISSGLW-2vdQK870.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-DLxFUMop.js → kanban-definition-UN3LZRKU-DWcbYK3Y.js} +1 -1
- package/dist-web/assets/{linear-Lxe_18BZ.js → linear-DEB4_JxQ.js} +1 -1
- package/dist-web/assets/{mermaid.core-4YTQ-5V5.js → mermaid.core-Bo4PXwhd.js} +5 -5
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-Bb4Tm8kX.js → mindmap-definition-RKZ34NQL-xhnv3DGe.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-Bl8T3fZ7.js → pieDiagram-4H26LBE5-Kf-4wCvB.js} +2 -2
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-BoEFFDkb.js → quadrantDiagram-W4KKPZXB-CoEDvyN3.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-B-op7Gg7.js → requirementDiagram-4Y6WPE33-C02xoAKl.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DEMaMFQJ.js → sankeyDiagram-5OEKKPKP-Cta2--lY.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-B0FEdEjA.js → sequenceDiagram-3UESZ5HK-BGHuv-fJ.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-BbCmT6m3.js → stateDiagram-AJRCARHV-CvYSand1.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CvSckOje.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-DsuaxnT6.js → timeline-definition-PNZ67QCA-Puu2_su-.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-CC9doxKp.js → vennDiagram-CIIHVFJN-C5KnFfg1.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-DPCj1V1e.js → vue.runtime.esm-bundler-Cqjpm82Q.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-C1rlxzgy.js → wardley-L42UT6IY-B56jdDEk.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-gCZUj4SL.js → wardleyDiagram-YWT4CUSO-C5uByZfn.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-Bg1yj2-o.js → xychartDiagram-2RQKCTM6-NW-h6Ru2.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +4 -4
- package/dist-web/assets/CodeBlockNode-CEaJG3Ru.js +0 -22
- package/dist-web/assets/arc-DZU5jAun.js +0 -1
- package/dist-web/assets/channel-y98-FGX8.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DIygKdRl.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DIygKdRl.js +0 -1
- package/dist-web/assets/index-CiC6jpjA.js +0 -268
- package/dist-web/assets/index-Cp4cno62.css +0 -1
- package/dist-web/assets/index-D9E1vajk.js +0 -9
- package/dist-web/assets/index11-jpw4aORI.js +0 -9
- package/dist-web/assets/index8-nFDUP4kC.js +0 -2
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-DVIg4v2K.js +0 -1
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-KEf2LMH_.js","assets/katex-HP8lGamR.js","assets/CodeBlockNode-CEaJG3Ru.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-C0rAlIZT.js","assets/index8-nFDUP4kC.js","assets/index11-jpw4aORI.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function Af(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $t={},ql=[],$o=()=>{},Sw=()=>!1,jc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ef=e=>e.startsWith("onUpdate:"),tn=Object.assign,Vg=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},z3=Object.prototype.hasOwnProperty,zt=(e,t)=>z3.call(e,t),ct=Array.isArray,jl=e=>ha(e)==="[object Map]",rl=e=>ha(e)==="[object Set]",P0=e=>ha(e)==="[object Date]",V3=e=>ha(e)==="[object RegExp]",bt=e=>typeof e=="function",sn=e=>typeof e=="string",ro=e=>typeof e=="symbol",Vt=e=>e!==null&&typeof e=="object",Kg=e=>(Vt(e)||bt(e))&&bt(e.then)&&bt(e.catch),Cw=Object.prototype.toString,ha=e=>Cw.call(e),K3=e=>ha(e).slice(8,-1),If=e=>ha(e)==="[object Object]",$f=e=>sn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Qr=Af(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Nf=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},G3=/-\w/g,Kn=Nf(e=>e.replace(G3,t=>t.slice(1).toUpperCase())),Y3=/\B([A-Z])/g,Ds=Nf(e=>e.replace(Y3,"-$1").toLowerCase()),Lf=Nf(e=>e.charAt(0).toUpperCase()+e.slice(1)),ad=Nf(e=>e?`on${Lf(e)}`:""),os=(e,t)=>!Object.is(e,t),zl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},xw=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Of=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Md=e=>{const t=sn(e)?Number(e):NaN;return isNaN(t)?e:t};let R0;const Pf=()=>R0||(R0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),X3="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",Z3=Af(X3);function Dt(e){if(ct(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=sn(s)?tM(s):Dt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(sn(e)||Vt(e))return e}const Q3=/;(?![^(]*\))/g,J3=/:([^]+)/,eM=/\/\*[^]*?\*\//g;function tM(e){const t={};return e.replace(eM,"").split(Q3).forEach(n=>{if(n){const s=n.split(J3);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function $e(e){let t="";if(sn(e))t=e;else if(ct(e))for(let n=0;n<e.length;n++){const s=$e(e[n]);s&&(t+=s+" ")}else if(Vt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function xce(e){if(!e)return null;let{class:t,style:n}=e;return t&&!sn(t)&&(e.class=$e(t)),n&&(e.style=Dt(n)),e}const nM="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",sM=Af(nM);function Tw(e){return!!e||e===""}function oM(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=$i(e[s],t[s]);return n}function $i(e,t){if(e===t)return!0;let n=P0(e),s=P0(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=ro(e),s=ro(t),n||s)return e===t;if(n=ct(e),s=ct(t),n||s)return n&&s?oM(e,t):!1;if(n=Vt(e),s=Vt(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!$i(e[r],t[r]))return!1}}return String(e)===String(t)}function Rf(e,t){return e.findIndex(n=>$i(n,t))}const Mw=e=>!!(e&&e.__v_isRef===!0),N=e=>sn(e)?e:e==null?"":ct(e)||Vt(e)&&(e.toString===Cw||!bt(e.toString))?Mw(e)?N(e.value):JSON.stringify(e,Aw,2):String(e),Aw=(e,t)=>Mw(t)?Aw(e,t.value):jl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[_p(s,i)+" =>"]=o,n),{})}:rl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>_p(n))}:ro(t)?_p(t):Vt(t)&&!ct(t)&&!If(t)?String(t):t,_p=(e,t="")=>{var n;return ro(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function iM(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 Vn;class Ew{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&&Vn&&(Vn.active?(this.parent=Vn,this.index=(Vn.scopes||(Vn.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=Vn;try{return Vn=this,t()}finally{Vn=n}}}on(){++this._on===1&&(this.prevScope=Vn,Vn=this)}off(){if(this._on>0&&--this._on===0){if(Vn===this)Vn=this.prevScope;else{let t=Vn;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function rM(e){return new Ew(e)}function Gg(){return Vn}function Yg(e,t=!1){Vn&&Vn.cleanups.push(e)}let cn;const wp=new WeakSet;class Ad{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,Vn&&(Vn.active?Vn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,wp.has(this)&&(wp.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$w(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,D0(this),Nw(this);const t=cn,n=jo;cn=this,jo=!0;try{return this.fn()}finally{Lw(this),cn=t,jo=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Qg(t);this.deps=this.depsTail=void 0,D0(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?wp.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){$m(this)&&this.run()}get dirty(){return $m(this)}}let Iw=0,lc,ac;function $w(e,t=!1){if(e.flags|=8,t){e.next=ac,ac=e;return}e.next=lc,lc=e}function Xg(){Iw++}function Zg(){if(--Iw>0)return;if(ac){let t=ac;for(ac=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;lc;){let t=lc;for(lc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Nw(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Lw(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Qg(s),lM(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function $m(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ow(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ow(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Sc)||(e.globalVersion=Sc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!$m(e))))return;e.flags|=2;const t=e.dep,n=cn,s=jo;cn=e,jo=!0;try{Nw(e);const o=e.fn(e._value);(t.version===0||os(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{cn=n,jo=s,Lw(e),e.flags&=-3}}function Qg(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Qg(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function lM(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 Ad&&(e=e.effect.fn);const n=new Ad(e);t&&tn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function Mce(e){e.effect.stop()}let jo=!0;const Pw=[];function Ni(){Pw.push(jo),jo=!1}function Li(){const e=Pw.pop();jo=e===void 0?!0:e}function D0(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=cn;cn=void 0;try{t()}finally{cn=n}}}let Sc=0;class aM{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 Df{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(!cn||!jo||cn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==cn)n=this.activeLink=new aM(cn,this),cn.deps?(n.prevDep=cn.depsTail,cn.depsTail.nextDep=n,cn.depsTail=n):cn.deps=cn.depsTail=n,Rw(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=cn.depsTail,n.nextDep=void 0,cn.depsTail.nextDep=n,cn.depsTail=n,cn.deps===n&&(cn.deps=s)}return n}trigger(t){this.version++,Sc++,this.notify(t)}notify(t){Xg();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Zg()}}}function Rw(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Rw(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ed=new WeakMap,Jr=Symbol(""),Nm=Symbol(""),Cc=Symbol("");function ps(e,t,n){if(jo&&cn){let s=Ed.get(e);s||Ed.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Df),o.map=s,o.key=n),o.track()}}function Si(e,t,n,s,o,i){const r=Ed.get(e);if(!r){Sc++;return}const l=a=>{a&&a.trigger()};if(Xg(),t==="clear")r.forEach(l);else{const a=ct(e),c=a&&$f(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,h)=>{(h==="length"||h===Cc||!ro(h)&&h>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Cc)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Jr)),jl(e)&&l(r.get(Nm)));break;case"delete":a||(l(r.get(Jr)),jl(e)&&l(r.get(Nm)));break;case"set":jl(e)&&l(r.get(Jr));break}}Zg()}function cM(e,t){const n=Ed.get(e);return n&&n.get(t)}function Ml(e){const t=Rt(e);return t===e?t:(ps(t,"iterate",Cc),eo(e)?t:t.map(zo))}function Bf(e){return ps(e=Rt(e),"iterate",Cc),e}function oi(e,t){return Oi(e)?ra(cr(e)?zo(t):t):zo(t)}const uM={__proto__:null,[Symbol.iterator](){return Sp(this,Symbol.iterator,e=>oi(this,e))},concat(...e){return Ml(this).concat(...e.map(t=>ct(t)?Ml(t):t))},entries(){return Sp(this,"entries",e=>(e[1]=oi(this,e[1]),e))},every(e,t){return yi(this,"every",e,t,void 0,arguments)},filter(e,t){return yi(this,"filter",e,t,n=>n.map(s=>oi(this,s)),arguments)},find(e,t){return yi(this,"find",e,t,n=>oi(this,n),arguments)},findIndex(e,t){return yi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return yi(this,"findLast",e,t,n=>oi(this,n),arguments)},findLastIndex(e,t){return yi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return yi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Cp(this,"includes",e)},indexOf(...e){return Cp(this,"indexOf",e)},join(e){return Ml(this).join(e)},lastIndexOf(...e){return Cp(this,"lastIndexOf",e)},map(e,t){return yi(this,"map",e,t,void 0,arguments)},pop(){return Wa(this,"pop")},push(...e){return Wa(this,"push",e)},reduce(e,...t){return B0(this,"reduce",e,t)},reduceRight(e,...t){return B0(this,"reduceRight",e,t)},shift(){return Wa(this,"shift")},some(e,t){return yi(this,"some",e,t,void 0,arguments)},splice(...e){return Wa(this,"splice",e)},toReversed(){return Ml(this).toReversed()},toSorted(e){return Ml(this).toSorted(e)},toSpliced(...e){return Ml(this).toSpliced(...e)},unshift(...e){return Wa(this,"unshift",e)},values(){return Sp(this,"values",e=>oi(this,e))}};function Sp(e,t,n){const s=Bf(e),o=s[t]();return s!==e&&!eo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const dM=Array.prototype;function yi(e,t,n,s,o,i){const r=Bf(e),l=r!==e&&!eo(e),a=r[t];if(a!==dM[t]){const d=a.apply(e,i);return l?zo(d):d}let c=n;r!==e&&(l?c=function(d,h){return n.call(this,oi(e,d),h,e)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function B0(e,t,n,s){const o=Bf(e),i=o!==e&&!eo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=oi(e,c)),n.call(this,c,oi(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?oi(e,a):a}function Cp(e,t,n){const s=Rt(e);ps(s,"iterate",Cc);const o=s[t](...n);return(o===-1||o===!1)&&Wf(n[0])?(n[0]=Rt(n[0]),s[t](...n)):o}function Wa(e,t,n=[]){Ni(),Xg();const s=Rt(e)[t].apply(e,n);return Zg(),Li(),s}const fM=Af("__proto__,__v_isRef,__isVue"),Dw=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ro));function hM(e){ro(e)||(e=String(e));const t=Rt(this);return ps(t,"has",e),t.hasOwnProperty(e)}class Bw{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?jw:qw:i?Uw:Ww).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=ct(t);if(!o){let a;if(r&&(a=uM[n]))return a;if(n==="hasOwnProperty")return hM}const l=Reflect.get(t,n,Fn(t)?t:s);if((ro(n)?Dw.has(n):fM(n))||(o||ps(t,"get",n),i))return l;if(Fn(l)){const a=r&&$f(n)?l:l.value;return o&&Vt(a)?Id(a):a}return Vt(l)?o?Id(l):Qs(l):l}}class Fw extends Bw{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=ct(t)&&$f(n);if(!this._isShallow){const c=Oi(i);if(!eo(s)&&!Oi(s)&&(i=Rt(i),s=Rt(s)),!r&&Fn(i)&&!Fn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:zt(t,n),a=Reflect.set(t,n,s,Fn(t)?t:o);return t===Rt(o)&&(l?os(s,i)&&Si(t,"set",n,s):Si(t,"add",n,s)),a}deleteProperty(t,n){const s=zt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Si(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!ro(n)||!Dw.has(n))&&ps(t,"has",n),s}ownKeys(t){return ps(t,"iterate",ct(t)?"length":Jr),Reflect.ownKeys(t)}}class Hw extends Bw{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const pM=new Fw,mM=new Hw,gM=new Fw(!0),vM=new Hw(!0),Lm=e=>e,Eu=e=>Reflect.getPrototypeOf(e);function yM(e,t,n){return function(...s){const o=this.__v_raw,i=Rt(o),r=jl(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Lm:t?ra:zo;return!t&&ps(i,"iterate",a?Nm:Jr),tn(Object.create(c),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:l?[u(d[0]),u(d[1])]:u(d),done:h}}})}}function Iu(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function kM(e,t){const n={get(o){const i=this.__v_raw,r=Rt(i),l=Rt(o);e||(os(o,l)&&ps(r,"get",o),ps(r,"get",l));const{has:a}=Eu(r),c=t?Lm:e?ra:zo;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&ps(Rt(o),"iterate",Jr),o.size},has(o){const i=this.__v_raw,r=Rt(i),l=Rt(o);return e||(os(o,l)&&ps(r,"has",o),ps(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Rt(l),c=t?Lm:e?ra:zo;return!e&&ps(a,"iterate",Jr),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return tn(n,e?{add:Iu("add"),set:Iu("set"),delete:Iu("delete"),clear:Iu("clear")}:{add(o){const i=Rt(this),r=Eu(i),l=Rt(o),a=!t&&!eo(o)&&!Oi(o)?l:o;return r.has.call(i,a)||os(o,a)&&r.has.call(i,o)||os(l,a)&&r.has.call(i,l)||(i.add(a),Si(i,"add",a,a)),this},set(o,i){!t&&!eo(i)&&!Oi(i)&&(i=Rt(i));const r=Rt(this),{has:l,get:a}=Eu(r);let c=l.call(r,o);c||(o=Rt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?os(i,u)&&Si(r,"set",o,i):Si(r,"add",o,i),this},delete(o){const i=Rt(this),{has:r,get:l}=Eu(i);let a=r.call(i,o);a||(o=Rt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Si(i,"delete",o,void 0),c},clear(){const o=Rt(this),i=o.size!==0,r=o.clear();return i&&Si(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=yM(o,e,t)}),n}function Ff(e,t){const n=kM(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(zt(n,o)&&o in s?n:s,o,i)}const bM={get:Ff(!1,!1)},_M={get:Ff(!1,!0)},wM={get:Ff(!0,!1)},SM={get:Ff(!0,!0)},Ww=new WeakMap,Uw=new WeakMap,qw=new WeakMap,jw=new WeakMap;function CM(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Qs(e){return Oi(e)?e:Hf(e,!1,pM,bM,Ww)}function xM(e){return Hf(e,!1,gM,_M,Uw)}function Id(e){return Hf(e,!0,mM,wM,qw)}function Ace(e){return Hf(e,!0,vM,SM,jw)}function Hf(e,t,n,s,o){if(!Vt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=CM(K3(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function cr(e){return Oi(e)?cr(e.__v_raw):!!(e&&e.__v_isReactive)}function Oi(e){return!!(e&&e.__v_isReadonly)}function eo(e){return!!(e&&e.__v_isShallow)}function Wf(e){return e?!!e.__v_raw:!1}function Rt(e){const t=e&&e.__v_raw;return t?Rt(t):e}function rr(e){return!zt(e,"__v_skip")&&Object.isExtensible(e)&&xw(e,"__v_skip",!0),e}const zo=e=>Vt(e)?Qs(e):e,ra=e=>Vt(e)?Id(e):e;function Fn(e){return e?e.__v_isRef===!0:!1}function se(e){return zw(e,!1)}function ll(e){return zw(e,!0)}function zw(e,t){return Fn(e)?e:new TM(e,t)}class TM{constructor(t,n){this.dep=new Df,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Rt(t),this._value=n?t:zo(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||eo(t)||Oi(t);t=s?t:Rt(t),os(t,n)&&(this._rawValue=t,this._value=s?t:zo(t),this.dep.trigger())}}function Ece(e){e.dep&&e.dep.trigger()}function T(e){return Fn(e)?e.value:e}function Ice(e){return bt(e)?e():T(e)}const MM={get:(e,t,n)=>t==="__v_raw"?e:T(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Fn(o)&&!Fn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Vw(e){return cr(e)?e:new Proxy(e,MM)}class AM{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Df,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function EM(e){return new AM(e)}function $ce(e){const t=ct(e)?new Array(e.length):{};for(const n in e)t[n]=Kw(e,n);return t}class IM{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=ro(n)?n:String(n),this._raw=Rt(t);let o=!0,i=t;if(!ct(t)||ro(this._key)||!$f(this._key))do o=!Wf(i)||eo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=T(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Fn(this._raw[this._key])){const n=this._object[this._key];if(Fn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return cM(this._raw,this._key)}}class $M{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 Nce(e,t,n){return Fn(e)?e:bt(e)?new $M(e):Vt(e)&&arguments.length>1?Kw(e,t,n):se(e)}function Kw(e,t,n){return new IM(e,t,n)}class NM{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Df(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Sc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&cn!==this)return $w(this,!0),!0}get value(){const t=this.dep.track();return Ow(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function LM(e,t,n=!1){let s,o;return bt(e)?s=e:(s=e.get,o=e.set),new NM(s,o,n)}const Lce={GET:"get",HAS:"has",ITERATE:"iterate"},Oce={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},$u={},$d=new WeakMap;let tr;function Pce(){return tr}function OM(e,t=!1,n=tr){if(n){let s=$d.get(n);s||$d.set(n,s=[]),s.push(e)}}function PM(e,t,n=$t){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=g=>o?g:eo(g)||o===!1||o===0?Ci(g,1):Ci(g);let u,d,h,m,f=!1,y=!1;if(Fn(e)?(d=()=>e.value,f=eo(e)):cr(e)?(d=()=>c(e),f=!0):ct(e)?(y=!0,f=e.some(g=>cr(g)||eo(g)),d=()=>e.map(g=>{if(Fn(g))return g.value;if(cr(g))return c(g);if(bt(g))return a?a(g,2):g()})):bt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(h){Ni();try{h()}finally{Li()}}const g=tr;tr=u;try{return a?a(e,3,[m]):e(m)}finally{tr=g}}:d=$o,t&&o){const g=d,k=o===!0?1/0:o;d=()=>Ci(g(),k)}const S=Gg(),_=()=>{u.stop(),S&&S.active&&Vg(S.effects,u)};if(i&&t){const g=t;t=(...k)=>{g(...k),_()}}let b=y?new Array(e.length).fill($u):$u;const v=g=>{if(!(!(u.flags&1)||!u.dirty&&!g))if(t){const k=u.run();if(o||f||(y?k.some(($,A)=>os($,b[A])):os(k,b))){h&&h();const $=tr;tr=u;try{const A=[k,b===$u?void 0:y&&b[0]===$u?[]:b,m];b=k,a?a(t,3,A):t(...A)}finally{tr=$}}}else u.run()};return l&&l(v),u=new Ad(d),u.scheduler=r?()=>r(v,!1):v,m=g=>OM(g,!1,u),h=u.onStop=()=>{const g=$d.get(u);if(g){if(a)a(g,4);else for(const k of g)k();$d.delete(u)}},t?s?v(!0):b=u.run():r?r(v.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Ci(e,t=1/0,n){if(t<=0||!Vt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Fn(e))Ci(e.value,t,n);else if(ct(e))for(let s=0;s<e.length;s++)Ci(e[s],t,n);else if(rl(e)||jl(e))e.forEach(s=>{Ci(s,t,n)});else if(If(e)){for(const s in e)Ci(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ci(e[s],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const Gw=[];function RM(e){Gw.push(e)}function DM(){Gw.pop()}function Rce(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"},BM={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 zc(e,t,n,s){try{return s?e(...s):e()}catch(o){pa(o,t,n)}}function Lo(e,t,n,s){if(bt(e)){const o=zc(e,t,n,s);return o&&Kg(o)&&o.catch(i=>{pa(i,t,n)}),o}if(ct(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Lo(e[i],t,n,s));return o}}function pa(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||$t;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){Ni(),zc(i,null,10,[e,a,c]),Li();return}}FM(e,n,o,s,r)}function FM(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Cs=[];let ti=-1;const Vl=[];let nr=null,Rl=0;const Yw=Promise.resolve();let Nd=null;function gt(e){const t=Nd||Yw;return e?t.then(this?e.bind(this):e):t}function HM(e){let t=ti+1,n=Cs.length;for(;t<n;){const s=t+n>>>1,o=Cs[s],i=xc(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function Jg(e){if(!(e.flags&1)){const t=xc(e),n=Cs[Cs.length-1];!n||!(e.flags&2)&&t>=xc(n)?Cs.push(e):Cs.splice(HM(t),0,e),e.flags|=1,Xw()}}function Xw(){Nd||(Nd=Yw.then(Zw))}function Ld(e){ct(e)?Vl.push(...e):nr&&e.id===-1?nr.splice(Rl+1,0,e):e.flags&1||(Vl.push(e),e.flags|=1),Xw()}function F0(e,t,n=ti+1){for(;n<Cs.length;n++){const s=Cs[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Cs.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Od(e){if(Vl.length){const t=[...new Set(Vl)].sort((n,s)=>xc(n)-xc(s));if(Vl.length=0,nr){nr.push(...t);return}for(nr=t,Rl=0;Rl<nr.length;Rl++){const n=nr[Rl];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}nr=null,Rl=0}}const xc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Zw(e){try{for(ti=0;ti<Cs.length;ti++){const t=Cs[ti];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),zc(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ti<Cs.length;ti++){const t=Cs[ti];t&&(t.flags&=-2)}ti=-1,Cs.length=0,Od(),Nd=null,(Cs.length||Vl.length)&&Zw()}}let Dl,Nu=[];function Qw(e,t){var n,s;Dl=e,Dl?(Dl.enabled=!0,Nu.forEach(({event:o,args:i})=>Dl.emit(o,...i)),Nu=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{Qw(i,t)}),setTimeout(()=>{Dl||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Nu=[])},3e3)):Nu=[]}let ls=null,Uf=null;function Tc(e){const t=ls;return ls=e,Uf=e&&e.type.__scopeId||null,t}function Bce(e){Uf=e}function Fce(){Uf=null}const Hce=e=>xn;function xn(e,t=ls,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Fd(-1);const i=Tc(t);let r;try{r=e(...o)}finally{Tc(i),s._d&&Fd(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Lt(e,t){if(ls===null)return e;const n=Yc(ls),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=$t]=t[o];i&&(bt(i)&&(i={mounted:i,updated:i}),i.deep&&Ci(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function si(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(Ni(),Lo(a,n,8,[e.el,l,e,t]),Li())}}function pn(e,t){if(is){let n=is.provides;const s=is.parent&&is.parent.provides;s===n&&(n=is.provides=Object.create(s)),n[e]=t}}function Bt(e,t,n=!1){const s=ys();if(s||el){let o=el?el._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&bt(t)?t.call(s&&s.proxy):t}}function Wce(){return!!(ys()||el)}const WM=Symbol.for("v-scx"),UM=()=>Bt(WM);function qM(e,t){return Vc(e,null,t)}function Uce(e,t){return Vc(e,null,{flush:"post"})}function jM(e,t){return Vc(e,null,{flush:"sync"})}function Ve(e,t,n){return Vc(e,t,n)}function Vc(e,t,n=$t){const{immediate:s,deep:o,flush:i,once:r}=n,l=tn({},n),a=t&&s||!t&&i!=="post";let c;if(ol){if(i==="sync"){const m=UM();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!a){const m=()=>{};return m.stop=$o,m.resume=$o,m.pause=$o,m}}const u=is;l.call=(m,f,y)=>Lo(m,u,f,y);let d=!1;i==="post"?l.scheduler=m=>{Rn(m,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(m,f)=>{f?m():Jg(m)}),l.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,u&&(m.id=u.uid,m.i=u))};const h=PM(e,t,l);return ol&&(c?c.push(h):a&&h()),h}function zM(e,t,n){const s=this.proxy,o=sn(e)?e.includes(".")?Jw(s,e):()=>s[e]:e.bind(s,s);let i;bt(t)?i=t:(i=t.handler,n=t);const r=ma(this),l=Vc(o,i.bind(s),n);return r(),l}function Jw(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Ji=new WeakMap,e2=Symbol("_vte"),t2=e=>e.__isTeleport,zr=e=>e&&(e.disabled||e.disabled===""),VM=e=>e&&(e.defer||e.defer===""),H0=e=>typeof SVGElement<"u"&&e instanceof SVGElement,W0=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Om=(e,t)=>{const n=e&&e.to;return sn(n)?t?t(n):null:n},KM={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:h,o:{insert:m,querySelector:f,createText:y,createComment:S,parentNode:_}}=c,b=zr(t.props);let{dynamicChildren:v}=t;const g=(A,w,x)=>{A.shapeFlag&16&&u(A.children,w,x,o,i,r,l,a)},k=(A=t)=>{const w=zr(A.props),x=A.target=Om(A.props,f),I=Pm(x,A,y,m);x&&(r!=="svg"&&H0(x)?r="svg":r!=="mathml"&&W0(x)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(x),w||(g(A,x,I),Za(A,!1)))},$=A=>{const w=()=>{if(Ji.get(A)===w){if(Ji.delete(A),zr(A.props)){const x=_(A.el)||n;g(A,x,A.anchor),Za(A,!0)}k(A)}};Ji.set(A,w),Rn(w,i)};if(e==null){const A=t.el=y(""),w=t.anchor=y("");if(m(A,n,s),m(w,n,s),VM(t.props)||i&&i.pendingBranch){$(t);return}b&&(g(t,n,w),Za(t,!0)),k()}else{t.el=e.el;const A=t.anchor=e.anchor,w=Ji.get(e);if(w){w.flags|=8,Ji.delete(e),$(t);return}t.targetStart=e.targetStart;const x=t.target=e.target,I=t.targetAnchor=e.targetAnchor,L=zr(e.props),O=L?n:x,P=L?A:I;if(r==="svg"||H0(x)?r="svg":(r==="mathml"||W0(x))&&(r="mathml"),v?(h(e.dynamicChildren,v,O,o,i,r,l),c1(e,t,!0)):a||d(e,t,O,P,o,i,r,l,!1),b)L?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Lu(t,n,A,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const B=t.target=Om(t.props,f);B&&Lu(t,B,null,c,0)}else L&&Lu(t,x,I,c,1);Za(t,b)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:h}=e,m=i||!zr(h),f=Ji.get(e);if(f&&(f.flags|=8,Ji.delete(e)),d&&(o(c),o(u)),i&&o(a),!f&&r&16)for(let y=0;y<l.length;y++){const S=l[y];s(S,t,n,m,!!S.dynamicChildren)}},move:Lu,hydrate:GM};function Lu(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!Ji.has(e)&&(!d||zr(u))&&a&16)for(let h=0;h<c.length;h++)o(c[h],t,n,2);d&&s(l,t,n)}function GM(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function h(S,_){let b=_;for(;b;){if(b&&b.nodeType===8){if(b.data==="teleport start anchor")t.targetStart=b;else if(b.data==="teleport anchor"){t.targetAnchor=b,S._lpa=t.targetAnchor&&r(t.targetAnchor);break}}b=r(b)}}function m(S,_){_.anchor=d(r(S),_,l(S),n,s,o,i)}const f=t.target=Om(t.props,a),y=zr(t.props);if(f){const S=f._lpa||f.firstChild;t.shapeFlag&16&&(y?(m(e,t),h(f,S),t.targetAnchor||Pm(f,t,u,c,l(e)===f?e:null)):(t.anchor=r(e),h(f,S),t.targetAnchor||Pm(f,t,u,c),d(S&&r(S),t,f,n,s,o,i))),Za(t,y)}else y&&t.shapeFlag&16&&(m(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const qce=KM;function Za(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Pm(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[e2]=r,e&&(s(i,e,o),s(r,e,o)),r}const Co=Symbol("_leaveCb"),Ua=Symbol("_enterCb");function n2(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ln(()=>{e.isMounted=!0}),lo(()=>{e.isUnmounting=!0}),e}const ko=[Function,Array],s2={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ko,onEnter:ko,onAfterEnter:ko,onEnterCancelled:ko,onBeforeLeave:ko,onLeave:ko,onAfterLeave:ko,onLeaveCancelled:ko,onBeforeAppear:ko,onAppear:ko,onAfterAppear:ko,onAppearCancelled:ko},o2=e=>{const t=e.subTree;return t.component?o2(t.component):t},YM={name:"BaseTransition",props:s2,setup(e,{slots:t}){const n=ys(),s=n2();return()=>{const o=t.default&&e1(t.default(),!0),i=o&&o.length?i2(o):n.subTree?ce():void 0;if(!i)return;const r=Rt(e),{mode:l}=r;if(s.isLeaving)return xp(i);const a=U0(i);if(!a)return xp(i);let c=Mc(a,r,s,n,d=>c=d);a.type!==Dn&&pr(a,c);let u=n.subTree&&U0(n.subTree);if(u&&u.type!==Dn&&!Wo(u,a)&&o2(n).type!==Dn){let d=Mc(u,r,s,n);if(pr(u,d),l==="out-in"&&a.type!==Dn)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},xp(i);l==="in-out"&&a.type!==Dn?d.delayLeave=(h,m,f)=>{const y=r2(s,u);y[String(u.key)]=u,h[Co]=()=>{m(),h[Co]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function i2(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Dn){t=n;break}}return t}const XM=YM;function r2(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Mc(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:m,onAfterLeave:f,onLeaveCancelled:y,onBeforeAppear:S,onAppear:_,onAfterAppear:b,onAppearCancelled:v}=t,g=String(e.key),k=r2(n,e),$=(x,I)=>{x&&Lo(x,s,9,I)},A=(x,I)=>{const L=I[1];$(x,I),ct(x)?x.every(O=>O.length<=1)&&L():x.length<=1&&L()},w={mode:r,persisted:l,beforeEnter(x){let I=a;if(!n.isMounted)if(i)I=S||a;else return;x[Co]&&x[Co](!0);const L=k[g];L&&Wo(e,L)&&L.el[Co]&&L.el[Co](),$(I,[x])},enter(x){if(k[g]===e)return;let I=c,L=u,O=d;if(!n.isMounted)if(i)I=_||c,L=b||u,O=v||d;else return;let P=!1;x[Ua]=R=>{P||(P=!0,R?$(O,[x]):$(L,[x]),w.delayedLeave&&w.delayedLeave(),x[Ua]=void 0)};const B=x[Ua].bind(null,!1);I?A(I,[x,B]):B()},leave(x,I){const L=String(e.key);if(x[Ua]&&x[Ua](!0),n.isUnmounting)return I();$(h,[x]);let O=!1;x[Co]=B=>{O||(O=!0,I(),B?$(y,[x]):$(f,[x]),x[Co]=void 0,k[L]===e&&delete k[L])};const P=x[Co].bind(null,!1);k[L]=e,m?A(m,[x,P]):P()},clone(x){const I=Mc(x,t,n,s,o);return o&&o(I),I}};return w}function xp(e){if(Kc(e))return e=Pi(e),e.children=null,e}function U0(e){if(!Kc(e))return t2(e.type)&&e.children?i2(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&&bt(n.default))return n.default()}}function pr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,pr(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 e1(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Le?(r.patchFlag&128&&o++,s=s.concat(e1(r.children,t,l))):(t||r.type!==Dn)&&s.push(l!=null?Pi(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Je(e,t){return bt(e)?tn({name:e.name},t,{setup:e}):e}function jce(){const e=ys();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function t1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function zce(e){const t=ys(),n=ll(null);if(t){const o=t.refs===$t?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function q0(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Pd=new WeakMap;function Kl(e,t,n,s,o=!1){if(ct(e)){e.forEach((y,S)=>Kl(y,t&&(ct(t)?t[S]:t),n,s,o));return}if(Ai(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Kl(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Yc(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===$t?l.refs={}:l.refs,d=l.setupState,h=Rt(d),m=d===$t?Sw:y=>q0(u,y)?!1:zt(h,y),f=(y,S)=>!(S&&q0(u,S));if(c!=null&&c!==a){if(j0(t),sn(c))u[c]=null,m(c)&&(d[c]=null);else if(Fn(c)){const y=t;f(c,y.k)&&(c.value=null),y.k&&(u[y.k]=null)}}if(bt(a))zc(a,l,12,[r,u]);else{const y=sn(a),S=Fn(a);if(y||S){const _=()=>{if(e.f){const b=y?m(a)?d[a]:u[a]:f()||!e.k?a.value:u[e.k];if(o)ct(b)&&Vg(b,i);else if(ct(b))b.includes(i)||b.push(i);else if(y)u[a]=[i],m(a)&&(d[a]=u[a]);else{const v=[i];f(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else y?(u[a]=r,m(a)&&(d[a]=r)):S&&(f(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const b=()=>{_(),Pd.delete(e)};b.id=-1,Pd.set(e,b),Rn(b,n)}else j0(e),_()}}}function j0(e){const t=Pd.get(e);t&&(t.flags|=8,Pd.delete(e))}let z0=!1;const Al=()=>{z0||(console.error("Hydration completed but contains mismatches."),z0=!0)},ZM=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",QM=e=>e.namespaceURI.includes("MathML"),Ou=e=>{if(e.nodeType===1){if(ZM(e))return"svg";if(QM(e))return"mathml"}},Hl=e=>e.nodeType===8;function JM(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,g)=>{if(!g.hasChildNodes()){n(null,v,g),Od(),g._vnode=v;return}d(g.firstChild,v,null,null,null),Od(),g._vnode=v},d=(v,g,k,$,A,w=!1)=>{w=w||!!g.dynamicChildren;const x=Hl(v)&&v.data==="[",I=()=>y(v,g,k,$,A,x),{type:L,ref:O,shapeFlag:P,patchFlag:B}=g;let R=v.nodeType;g.el=v,B===-2&&(w=!1,g.dynamicChildren=null);let W=null;switch(L){case ur:R!==3?g.children===""?(a(g.el=o(""),r(v),v),W=v):W=I():(v.data!==g.children&&(Al(),v.data=g.children),W=i(v));break;case Dn:b(v)?(W=i(v),_(g.el=v.content.firstChild,v,k)):R!==8||x?W=I():W=i(v);break;case Xl:if(x&&(v=i(v),R=v.nodeType),R===1||R===3){W=v;const V=!g.children.length;for(let z=0;z<g.staticCount;z++)V&&(g.children+=W.nodeType===1?W.outerHTML:W.data),z===g.staticCount-1&&(g.anchor=W),W=i(W);return x?i(W):W}else I();break;case Le:x?W=f(v,g,k,$,A,w):W=I();break;default:if(P&1)(R!==1||g.type.toLowerCase()!==v.tagName.toLowerCase())&&!b(v)?W=I():W=h(v,g,k,$,A,w);else if(P&6){g.slotScopeIds=A;const V=r(v);if(x?W=S(v):Hl(v)&&v.data==="teleport start"?W=S(v,v.data,"teleport end"):W=i(v),t(g,V,null,k,$,Ou(V),w),Ai(g)&&!g.type.__asyncResolved){let z;x?(z=kt(Le),z.anchor=W?W.previousSibling:V.lastChild):z=v.nodeType===3?vt(""):kt("div"),z.el=v,g.component.subTree=z}}else P&64?R!==8?W=I():W=g.type.hydrate(v,g,k,$,A,w,e,m):P&128&&(W=g.type.hydrate(v,g,k,$,Ou(r(v)),A,w,e,d))}return O!=null&&Kl(O,null,$,g),W},h=(v,g,k,$,A,w)=>{w=w||!!g.dynamicChildren;const{type:x,props:I,patchFlag:L,shapeFlag:O,dirs:P,transition:B}=g,R=x==="input"||x==="option";if(R||L!==-1){P&&si(g,null,k,"created");let W=!1;if(b(v)){W=x2(null,B)&&k&&k.vnode.props&&k.vnode.props.appear;const z=v.content.firstChild;if(W){const ie=z.getAttribute("class");ie&&(z.$cls=ie),B.beforeEnter(z)}_(z,v,k),g.el=v=z}if(O&16&&!(I&&(I.innerHTML||I.textContent))){let z=m(v.firstChild,g,v,k,$,A,w);for(z&&!Pu(v,1)&&Al();z;){const ie=z;z=z.nextSibling,l(ie)}}else if(O&8){let z=g.children;z[0]===`
|
|
15
|
-
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(z=z.slice(1));const{textContent:ie}=v;ie!==z&&ie!==z.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(Pu(v,0)||Al(),v.textContent=g.children)}if(I){if(R||!w||L&48){const z=v.tagName.includes("-");for(const ie in I)(R&&(ie.endsWith("value")||ie==="indeterminate")||jc(ie)&&!Qr(ie)||ie[0]==="."||z&&!Qr(ie))&&s(v,ie,null,I[ie],void 0,k)}else if(I.onClick)s(v,"onClick",null,I.onClick,void 0,k);else if(L&4&&cr(I.style))for(const z in I.style)I.style[z]}let V;(V=I&&I.onVnodeBeforeMount)&&Ps(V,k,g),P&&si(g,null,k,"beforeMount"),((V=I&&I.onVnodeMounted)||P||W)&&E2(()=>{V&&Ps(V,k,g),W&&B.enter(v),P&&si(g,null,k,"mounted")},$)}return v.nextSibling},m=(v,g,k,$,A,w,x)=>{x=x||!!g.dynamicChildren;const I=g.children,L=I.length;let O=!1;for(let P=0;P<L;P++){const B=x?I[P]:I[P]=Rs(I[P]),R=B.type===ur;v?(R&&!x&&P+1<L&&Rs(I[P+1]).type===ur&&(a(o(v.data.slice(B.children.length)),k,i(v)),v.data=B.children),v=d(v,B,$,A,w,x)):R&&!B.children?a(B.el=o(""),k):(O||(O=!0,Pu(k,1)||Al()),n(null,B,k,null,$,A,Ou(k),w))}return v},f=(v,g,k,$,A,w)=>{const{slotScopeIds:x}=g;x&&(A=A?A.concat(x):x);const I=r(v),L=m(i(v),g,I,k,$,A,w);return L&&Hl(L)&&L.data==="]"?i(g.anchor=L):(Al(),a(g.anchor=c("]"),I,L),L)},y=(v,g,k,$,A,w)=>{if(Pu(v.parentElement,1)||Al(),g.el=null,w){const L=S(v);for(;;){const O=i(v);if(O&&O!==L)l(O);else break}}const x=i(v),I=r(v);return l(v),n(null,g,I,x,k,$,Ou(I),A),k&&(k.vnode.el=g.el,zf(k,g.el)),x},S=(v,g="[",k="]")=>{let $=0;for(;v;)if(v=i(v),v&&Hl(v)&&(v.data===g&&$++,v.data===k)){if($===0)return i(v);$--}return v},_=(v,g,k)=>{const $=g.parentNode;$&&$.replaceChild(v,g);let A=k;for(;A;)A.vnode.el===g&&(A.vnode.el=A.subTree.el=v),A=A.parent},b=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const V0="data-allow-mismatch",eA={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Pu(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(V0);)e=e.parentElement;const n=e&&e.getAttribute(V0);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(eA[t])}}const tA=Pf().requestIdleCallback||(e=>setTimeout(e,1)),nA=Pf().cancelIdleCallback||(e=>clearTimeout(e)),Vce=(e=1e4)=>t=>{const n=tA(t,{timeout:e});return()=>nA(n)};function sA(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const Kce=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(sA(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.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)=>{sn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function oA(e,t){if(Hl(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Hl(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Ai=e=>!!e.type.__asyncLoader;function ii(e){bt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const h=()=>(d++,c=null,m()),m=()=>{let f;return c||(f=c=t().catch(y=>{if(y=y instanceof Error?y:new Error(String(y)),a)return new Promise((S,_)=>{a(y,()=>S(h()),()=>_(y),d+1)});throw y}).then(y=>f!==c&&c?c:(y&&(y.__esModule||y[Symbol.toStringTag]==="Module")&&(y=y.default),u=y,y)))};return Je({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(f,y,S){let _=!1;(y.bu||(y.bu=[])).push(()=>_=!0);const b=()=>{_||S()},v=i?()=>{const g=i(b,k=>oA(f,k));g&&(y.bum||(y.bum=[])).push(g)}:b;u?v():m().then(()=>!y.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const f=is;if(t1(f),u)return()=>Ru(u,f);const y=v=>{c=null,pa(v,f,13,!s)};if(l&&f.suspense||ol)return m().then(v=>()=>Ru(v,f)).catch(v=>(y(v),()=>s?kt(s,{error:v}):null));const S=se(!1),_=se(),b=se(!!o);return o&&setTimeout(()=>{b.value=!1},o),r!=null&&setTimeout(()=>{if(!S.value&&!_.value){const v=new Error(`Async component timed out after ${r}ms.`);y(v),_.value=v}},r),m().then(()=>{S.value=!0,f.parent&&Kc(f.parent.vnode)&&f.parent.update()}).catch(v=>{y(v),_.value=v}),()=>{if(S.value&&u)return Ru(u,f);if(_.value&&s)return kt(s,{error:_.value});if(n&&!b.value)return Ru(n,f)}}})}function Ru(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=kt(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Kc=e=>e.type.__isKeepAlive,iA={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=ys(),s=n.ctx;if(!s.renderer)return()=>{const b=t.default&&t.default();return b&&b.length===1?b[0]:b};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,h=d("div");s.activate=(b,v,g,k,$)=>{const A=b.component;c(b,v,g,0,l),a(A.vnode,b,v,g,A,l,k,b.slotScopeIds,$),Rn(()=>{A.isDeactivated=!1,A.a&&zl(A.a);const w=b.props&&b.props.onVnodeMounted;w&&Ps(w,A.parent,b)},l)},s.deactivate=b=>{const v=b.component;Dd(v.m),Dd(v.a),c(b,h,null,1,l),Rn(()=>{v.da&&zl(v.da);const g=b.props&&b.props.onVnodeUnmounted;g&&Ps(g,v.parent,b),v.isDeactivated=!0},l)};function m(b){Tp(b),u(b,n,l,!0)}function f(b){o.forEach((v,g)=>{const k=jm(Ai(v)?v.type.__asyncResolved||{}:v.type);k&&!b(k)&&y(g)})}function y(b){const v=o.get(b);v&&(!r||!Wo(v,r))?m(v):r&&Tp(r),o.delete(b),i.delete(b)}Ve(()=>[e.include,e.exclude],([b,v])=>{b&&f(g=>Qa(b,g)),v&&f(g=>!Qa(v,g))},{flush:"post",deep:!0});let S=null;const _=()=>{S!=null&&(Bd(n.subTree.type)?Rn(()=>{o.set(S,Du(n.subTree))},n.subTree.suspense):o.set(S,Du(n.subTree)))};return ln(_),n1(_),lo(()=>{o.forEach(b=>{const{subTree:v,suspense:g}=n,k=Du(v);if(b.type===k.type&&b.key===k.key){Tp(k);const $=k.component.da;$&&Rn($,g);return}m(b)})}),()=>{if(S=null,!t.default)return r=null;const b=t.default(),v=b[0];if(b.length>1)return r=null,b;if(!mr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let g=Du(v);if(g.type===Dn)return r=null,g;const k=g.type,$=jm(Ai(g)?g.type.__asyncResolved||{}:k),{include:A,exclude:w,max:x}=e;if(A&&(!$||!Qa(A,$))||w&&$&&Qa(w,$))return g.shapeFlag&=-257,r=g,v;const I=g.key==null?k:g.key,L=o.get(I);return g.el&&(g=Pi(g),v.shapeFlag&128&&(v.ssContent=g)),S=I,L?(g.el=L.el,g.component=L.component,g.transition&&pr(g,g.transition),g.shapeFlag|=512,i.delete(I),i.add(I)):(i.add(I),x&&i.size>parseInt(x,10)&&y(i.values().next().value)),g.shapeFlag|=256,r=g,Bd(v.type)?v:g}}},Xce=iA;function Qa(e,t){return ct(e)?e.some(n=>Qa(n,t)):sn(e)?e.split(",").includes(t):V3(e)?(e.lastIndex=0,e.test(t)):!1}function rA(e,t){l2(e,"a",t)}function lA(e,t){l2(e,"da",t)}function l2(e,t,n=is){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(qf(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Kc(o.parent.vnode)&&aA(s,t,n,o),o=o.parent}}function aA(e,t,n,s){const o=qf(t,e,s,!0);Ut(()=>{Vg(s[t],o)},n)}function Tp(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Du(e){return e.shapeFlag&128?e.ssContent:e}function qf(e,t,n=is,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Ni();const l=ma(n),a=Lo(t,n,e,r);return l(),Li(),a});return s?o.unshift(i):o.push(i),i}}const Di=e=>(t,n=is)=>{(!ol||e==="sp")&&qf(e,(...s)=>t(...s),n)},cA=Di("bm"),ln=Di("m"),a2=Di("bu"),n1=Di("u"),lo=Di("bum"),Ut=Di("um"),uA=Di("sp"),dA=Di("rtg"),fA=Di("rtc");function hA(e,t=is){qf("ec",e,t)}const s1="components",pA="directives";function mA(e,t){return o1(s1,e,!0,t)||e}const c2=Symbol.for("v-ndc");function ms(e){return sn(e)?o1(s1,e,!1)||e:e||c2}function Zce(e){return o1(pA,e)}function o1(e,t,n=!0,s=!1){const o=ls||is;if(o){const i=o.type;if(e===s1){const l=jm(i,!1);if(l&&(l===t||l===Kn(t)||l===Lf(Kn(t))))return i}const r=K0(o[e]||i[e],t)||K0(o.appContext[e],t);return!r&&s?i:r}}function K0(e,t){return e&&(e[t]||e[Kn(t)]||e[Lf(Kn(t))])}function Qe(e,t,n,s){let o;const i=n&&n[s],r=ct(e);if(r||sn(e)){const l=r&&cr(e);let a=!1,c=!1;l&&(a=!eo(e),c=Oi(e),e=Bf(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?ra(zo(e[u])):zo(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(Vt(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function Qce(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(ct(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Gl(e,t,n={},s,o){if(ls.ce||ls.parent&&Ai(ls.parent)&&ls.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),C(),je(Le,null,[kt("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),C();const r=i&&i1(i(n)),l=n.key||r&&r.key,a=je(Le,{key:(l&&!ro(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function i1(e){return e.some(t=>mr(t)?!(t.type===Dn||t.type===Le&&!i1(t.children)):!0)?e:null}function Jce(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:ad(s)]=e[s];return n}const Rm=e=>e?O2(e)?Yc(e):Rm(e.parent):null,cc=tn(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=>Rm(e.parent),$root:e=>Rm(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>r1(e),$forceUpdate:e=>e.f||(e.f=()=>{Jg(e.update)}),$nextTick:e=>e.n||(e.n=gt.bind(e.proxy)),$watch:e=>zM.bind(e)}),Mp=(e,t)=>e!==$t&&!e.__isScriptSetup&&zt(e,t),Dm={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const h=r[t];if(h!==void 0)switch(h){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Mp(s,t))return r[t]=1,s[t];if(o!==$t&&zt(o,t))return r[t]=2,o[t];if(zt(i,t))return r[t]=3,i[t];if(n!==$t&&zt(n,t))return r[t]=4,n[t];Bm&&(r[t]=0)}}const c=cc[t];let u,d;if(c)return t==="$attrs"&&ps(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==$t&&zt(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,zt(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Mp(o,t)?(o[t]=n,!0):s!==$t&&zt(s,t)?(s[t]=n,!0):zt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==$t&&l[0]!=="$"&&zt(e,l)||Mp(t,l)||zt(i,l)||zt(s,l)||zt(cc,l)||zt(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:zt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},gA=tn({},Dm,{get(e,t){if(t!==Symbol.unscopables)return Dm.get(e,t,e)},has(e,t){return t[0]!=="_"&&!Z3(t)}});function eue(){return null}function tue(){return null}function nue(e){}function sue(e){}function oue(){return null}function iue(){}function rue(e,t){return null}function lue(){return u2().slots}function Gc(){return u2().attrs}function u2(e){const t=ys();return t.setupContext||(t.setupContext=D2(t))}function Ac(e){return ct(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function aue(e,t){const n=Ac(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?ct(o)||bt(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function cue(e,t){return!e||!t?e||t:ct(e)&&ct(t)?e.concat(t):tn({},Ac(e),Ac(t))}function uue(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function due(e){const t=ys(),n=ol;let s=e();Ic(),n&&Zl(!1);const o=()=>{ma(t),n&&Zl(!0)},i=()=>{ys()!==t&&t.scope.off(),Ic(),n&&Zl(!1)};return Kg(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let Bm=!0;function vA(e){const t=r1(e),n=e.proxy,s=e.ctx;Bm=!1,t.beforeCreate&&G0(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:m,updated:f,activated:y,deactivated:S,beforeDestroy:_,beforeUnmount:b,destroyed:v,unmounted:g,render:k,renderTracked:$,renderTriggered:A,errorCaptured:w,serverPrefetch:x,expose:I,inheritAttrs:L,components:O,directives:P,filters:B}=t;if(c&&yA(c,s,null),r)for(const V in r){const z=r[V];bt(z)&&(s[V]=z.bind(n))}if(o){const V=o.call(n,n);Vt(V)&&(e.data=Qs(V))}if(Bm=!0,i)for(const V in i){const z=i[V],ie=bt(z)?z.bind(n,n):bt(z.get)?z.get.bind(n,n):$o,ae=!bt(z)&&bt(z.set)?z.set.bind(n):$o,re=j({get:ie,set:ae});Object.defineProperty(s,V,{enumerable:!0,configurable:!0,get:()=>re.value,set:Te=>re.value=Te})}if(l)for(const V in l)d2(l[V],s,n,V);if(a){const V=bt(a)?a.call(n):a;Reflect.ownKeys(V).forEach(z=>{pn(z,V[z])})}u&&G0(u,e,"c");function W(V,z){ct(z)?z.forEach(ie=>V(ie.bind(n))):z&&V(z.bind(n))}if(W(cA,d),W(ln,h),W(a2,m),W(n1,f),W(rA,y),W(lA,S),W(hA,w),W(fA,$),W(dA,A),W(lo,b),W(Ut,g),W(uA,x),ct(I))if(I.length){const V=e.exposed||(e.exposed={});I.forEach(z=>{Object.defineProperty(V,z,{get:()=>n[z],set:ie=>n[z]=ie,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===$o&&(e.render=k),L!=null&&(e.inheritAttrs=L),O&&(e.components=O),P&&(e.directives=P),x&&t1(e)}function yA(e,t,n=$o){ct(e)&&(e=Fm(e));for(const s in e){const o=e[s];let i;Vt(o)?"default"in o?i=Bt(o.from||s,o.default,!0):i=Bt(o.from||s):i=Bt(o),Fn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function G0(e,t,n){Lo(ct(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function d2(e,t,n,s){let o=s.includes(".")?Jw(n,s):()=>n[s];if(sn(e)){const i=t[e];bt(i)&&Ve(o,i)}else if(bt(e))Ve(o,e.bind(n));else if(Vt(e))if(ct(e))e.forEach(i=>d2(i,t,n,s));else{const i=bt(e.handler)?e.handler.bind(n):t[e.handler];bt(i)&&Ve(o,i,e)}}function r1(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>Rd(a,c,r,!0)),Rd(a,t,r)),Vt(t)&&i.set(t,a),a}function Rd(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Rd(e,i,n,!0),o&&o.forEach(r=>Rd(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=kA[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const kA={data:Y0,props:X0,emits:X0,methods:Ja,computed:Ja,beforeCreate:Ss,created:Ss,beforeMount:Ss,mounted:Ss,beforeUpdate:Ss,updated:Ss,beforeDestroy:Ss,beforeUnmount:Ss,destroyed:Ss,unmounted:Ss,activated:Ss,deactivated:Ss,errorCaptured:Ss,serverPrefetch:Ss,components:Ja,directives:Ja,watch:_A,provide:Y0,inject:bA};function Y0(e,t){return t?e?function(){return tn(bt(e)?e.call(this,this):e,bt(t)?t.call(this,this):t)}:t:e}function bA(e,t){return Ja(Fm(e),Fm(t))}function Fm(e){if(ct(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ss(e,t){return e?[...new Set([].concat(e,t))]:t}function Ja(e,t){return e?tn(Object.create(null),e,t):t}function X0(e,t){return e?ct(e)&&ct(t)?[...new Set([...e,...t])]:tn(Object.create(null),Ac(e),Ac(t??{})):t}function _A(e,t){if(!e)return t;if(!t)return e;const n=tn(Object.create(null),e);for(const s in t)n[s]=Ss(e[s],t[s]);return n}function f2(){return{app:null,config:{isNativeTag:Sw,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 wA=0;function SA(e,t){return function(s,o=null){bt(s)||(s=tn({},s)),o!=null&&!Vt(o)&&(o=null);const i=f2(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:wA++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:JA,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&bt(u.install)?(r.add(u),u.install(c,...d)):bt(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,h){if(!a){const m=c._ceVNode||kt(s,o);return m.appContext=i,h===!0?h="svg":h===!1&&(h=void 0),d&&t?t(m,u):e(m,u,h),a=!0,c._container=u,u.__vue_app__=c,Yc(m.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Lo(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=el;el=c;try{return u()}finally{el=d}}};return c}}let el=null;function fue(e,t,n=$t){const s=ys(),o=Kn(t),i=Ds(t),r=h2(e,o),l=EM((a,c)=>{let u,d=$t,h;return jM(()=>{const m=e[o];os(u,m)&&(u=m,c())}),{get(){return a(),n.get?n.get(u):u},set(m){const f=n.set?n.set(m):m;if(!os(f,u)&&!(d!==$t&&os(m,d)))return;const y=s.vnode.props;y&&(t in y||o in y||i in y)&&(`onUpdate:${t}`in y||`onUpdate:${o}`in y||`onUpdate:${i}`in y)||(u=m,c()),s.emit(`update:${t}`,f),os(m,f)&&os(m,d)&&!os(f,h)&&c(),d=m,h=f}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||$t:l,done:!1}:{done:!0}}}},l}const h2=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Kn(t)}Modifiers`]||e[`${Ds(t)}Modifiers`];function CA(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||$t;let o=n;const i=t.startsWith("update:"),r=i&&h2(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>sn(u)?u.trim():u)),r.number&&(o=n.map(Of)));let l,a=s[l=ad(t)]||s[l=ad(Kn(t))];!a&&i&&(a=s[l=ad(Ds(t))]),a&&Lo(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Lo(c,e,6,o)}}const xA=new WeakMap;function p2(e,t,n=!1){const s=n?xA:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!bt(e)){const a=c=>{const u=p2(c,t,!0);u&&(l=!0,tn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Vt(e)&&s.set(e,null),null):(ct(i)?i.forEach(a=>r[a]=null):tn(r,i),Vt(e)&&s.set(e,r),r)}function jf(e,t){return!e||!jc(t)?!1:(t=t.slice(2).replace(/Once$/,""),zt(e,t[0].toLowerCase()+t.slice(1))||zt(e,Ds(t))||zt(e,t))}function cd(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:h,setupState:m,ctx:f,inheritAttrs:y}=e,S=Tc(e);let _,b;try{if(n.shapeFlag&4){const g=o||s,k=g;_=Rs(c.call(k,g,u,d,m,h,f)),b=l}else{const g=t;_=Rs(g.length>1?g(d,{attrs:l,slots:r,emit:a}):g(d,null)),b=t.props?l:MA(l)}}catch(g){uc.length=0,pa(g,e,1),_=kt(Dn)}let v=_;if(b&&y!==!1){const g=Object.keys(b),{shapeFlag:k}=v;g.length&&k&7&&(i&&g.some(Ef)&&(b=AA(b,i)),v=Pi(v,b,!1,!0))}return n.dirs&&(v=Pi(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&pr(v,n.transition),_=v,Tc(S),_}function TA(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(mr(o)){if(o.type!==Dn||o.children==="v-if"){if(n)return;n=o}}else return}return n}const MA=e=>{let t;for(const n in e)(n==="class"||n==="style"||jc(n))&&((t||(t={}))[n]=e[n]);return t},AA=(e,t)=>{const n={};for(const s in e)(!Ef(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function EA(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Z0(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(m2(r,s,h)&&!jf(c,h))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?Z0(s,r,c):!0:!!r;return!1}function Z0(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(m2(t,e,i)&&!jf(n,i))return!0}return!1}function m2(e,t,n){const s=e[n],o=t[n];return n==="style"&&Vt(s)&&Vt(o)?!$i(s,o):s!==o}function zf({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const g2={},v2=()=>Object.create(g2),y2=e=>Object.getPrototypeOf(e)===g2;function IA(e,t,n,s=!1){const o={},i=v2();e.propsDefaults=Object.create(null),k2(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:xM(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function $A(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Rt(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(jf(e.emitsOptions,h))continue;const m=t[h];if(a)if(zt(i,h))m!==i[h]&&(i[h]=m,c=!0);else{const f=Kn(h);o[f]=Hm(a,l,f,m,e,!1)}else m!==i[h]&&(i[h]=m,c=!0)}}}else{k2(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!zt(t,d)&&((u=Ds(d))===d||!zt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=Hm(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!zt(t,d))&&(delete i[d],c=!0)}c&&Si(e.attrs,"set","")}function k2(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Qr(a))continue;const c=t[a];let u;o&&zt(o,u=Kn(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:jf(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Rt(n),c=l||$t;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Hm(o,a,d,c[d],e,!zt(c,d))}}return r}function Hm(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=zt(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&bt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=ma(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===Ds(n))&&(s=!0))}return s}const NA=new WeakMap;function b2(e,t,n=!1){const s=n?NA:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!bt(e)){const u=d=>{a=!0;const[h,m]=b2(d,t,!0);tn(r,h),m&&l.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Vt(e)&&s.set(e,ql),ql;if(ct(i))for(let u=0;u<i.length;u++){const d=Kn(i[u]);Q0(d)&&(r[d]=$t)}else if(i)for(const u in i){const d=Kn(u);if(Q0(d)){const h=i[u],m=r[d]=ct(h)||bt(h)?{type:h}:tn({},h),f=m.type;let y=!1,S=!0;if(ct(f))for(let _=0;_<f.length;++_){const b=f[_],v=bt(b)&&b.name;if(v==="Boolean"){y=!0;break}else v==="String"&&(S=!1)}else y=bt(f)&&f.name==="Boolean";m[0]=y,m[1]=S,(y||zt(m,"default"))&&l.push(d)}}const c=[r,l];return Vt(e)&&s.set(e,c),c}function Q0(e){return e[0]!=="$"&&!Qr(e)}const l1=e=>e==="_"||e==="_ctx"||e==="$stable",a1=e=>ct(e)?e.map(Rs):[Rs(e)],LA=(e,t,n)=>{if(t._n)return t;const s=xn((...o)=>a1(t(...o)),n);return s._c=!1,s},_2=(e,t,n)=>{const s=e._ctx;for(const o in e){if(l1(o))continue;const i=e[o];if(bt(i))t[o]=LA(o,i,s);else if(i!=null){const r=a1(i);t[o]=()=>r}}},w2=(e,t)=>{const n=a1(t);e.slots.default=()=>n},S2=(e,t,n)=>{for(const s in t)(n||!l1(s))&&(e[s]=t[s])},OA=(e,t,n)=>{const s=e.slots=v2();if(e.vnode.shapeFlag&32){const o=t._;o?(S2(s,t,n),n&&xw(s,"_",o,!0)):_2(t,s)}else t&&w2(e,t)},PA=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=$t;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:S2(o,t,n):(i=!t.$stable,_2(t,o)),r=t}else t&&(w2(e,t),r={default:1});if(i)for(const l in o)!l1(l)&&r[l]==null&&delete o[l]},Rn=E2;function RA(e){return C2(e)}function DA(e){return C2(e,JM)}function C2(e,t){const n=Pf();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:m=$o,insertStaticContent:f}=e,y=(D,X,oe,te=null,ue=null,U=null,q=void 0,J=null,de=!!X.dynamicChildren)=>{if(D===X)return;D&&!Wo(D,X)&&(te=be(D),Te(D,ue,U,!0),D=null),X.patchFlag===-2&&(de=!1,X.dynamicChildren=null);const{type:ge,ref:Me,shapeFlag:le}=X;switch(ge){case ur:S(D,X,oe,te);break;case Dn:_(D,X,oe,te);break;case Xl:D==null&&b(X,oe,te,q);break;case Le:O(D,X,oe,te,ue,U,q,J,de);break;default:le&1?k(D,X,oe,te,ue,U,q,J,de):le&6?P(D,X,oe,te,ue,U,q,J,de):(le&64||le&128)&&ge.process(D,X,oe,te,ue,U,q,J,de,K)}Me!=null&&ue?Kl(Me,D&&D.ref,U,X||D,!X):Me==null&&D&&D.ref!=null&&Kl(D.ref,null,U,D,!0)},S=(D,X,oe,te)=>{if(D==null)s(X.el=l(X.children),oe,te);else{const ue=X.el=D.el;X.children!==D.children&&c(ue,X.children)}},_=(D,X,oe,te)=>{D==null?s(X.el=a(X.children||""),oe,te):X.el=D.el},b=(D,X,oe,te)=>{[D.el,D.anchor]=f(D.children,X,oe,te,D.el,D.anchor)},v=({el:D,anchor:X},oe,te)=>{let ue;for(;D&&D!==X;)ue=h(D),s(D,oe,te),D=ue;s(X,oe,te)},g=({el:D,anchor:X})=>{let oe;for(;D&&D!==X;)oe=h(D),o(D),D=oe;o(X)},k=(D,X,oe,te,ue,U,q,J,de)=>{if(X.type==="svg"?q="svg":X.type==="math"&&(q="mathml"),D==null)$(X,oe,te,ue,U,q,J,de);else{const ge=D.el&&D.el._isVueCE?D.el:null;try{ge&&ge._beginPatch(),x(D,X,ue,U,q,J,de)}finally{ge&&ge._endPatch()}}},$=(D,X,oe,te,ue,U,q,J)=>{let de,ge;const{props:Me,shapeFlag:le,transition:_e,dirs:ze}=D;if(de=D.el=r(D.type,U,Me&&Me.is,Me),le&8?u(de,D.children):le&16&&w(D.children,de,null,te,ue,Ap(D,U),q,J),ze&&si(D,null,te,"created"),A(de,D,D.scopeId,q,te),Me){for(const ot in Me)ot!=="value"&&!Qr(ot)&&i(de,ot,null,Me[ot],U,te);"value"in Me&&i(de,"value",null,Me.value,U),(ge=Me.onVnodeBeforeMount)&&Ps(ge,te,D)}ze&&si(D,null,te,"beforeMount");const Xe=x2(ue,_e);Xe&&_e.beforeEnter(de),s(de,X,oe),((ge=Me&&Me.onVnodeMounted)||Xe||ze)&&Rn(()=>{try{ge&&Ps(ge,te,D),Xe&&_e.enter(de),ze&&si(D,null,te,"mounted")}finally{}},ue)},A=(D,X,oe,te,ue)=>{if(oe&&m(D,oe),te)for(let U=0;U<te.length;U++)m(D,te[U]);if(ue){let U=ue.subTree;if(X===U||Bd(U.type)&&(U.ssContent===X||U.ssFallback===X)){const q=ue.vnode;A(D,q,q.scopeId,q.slotScopeIds,ue.parent)}}},w=(D,X,oe,te,ue,U,q,J,de=0)=>{for(let ge=de;ge<D.length;ge++){const Me=D[ge]=J?wi(D[ge]):Rs(D[ge]);y(null,Me,X,oe,te,ue,U,q,J)}},x=(D,X,oe,te,ue,U,q)=>{const J=X.el=D.el;let{patchFlag:de,dynamicChildren:ge,dirs:Me}=X;de|=D.patchFlag&16;const le=D.props||$t,_e=X.props||$t;let ze;if(oe&&Dr(oe,!1),(ze=_e.onVnodeBeforeUpdate)&&Ps(ze,oe,X,D),Me&&si(X,D,oe,"beforeUpdate"),oe&&Dr(oe,!0),(le.innerHTML&&_e.innerHTML==null||le.textContent&&_e.textContent==null)&&u(J,""),ge?I(D.dynamicChildren,ge,J,oe,te,Ap(X,ue),U):q||z(D,X,J,null,oe,te,Ap(X,ue),U,!1),de>0){if(de&16)L(J,le,_e,oe,ue);else if(de&2&&le.class!==_e.class&&i(J,"class",null,_e.class,ue),de&4&&i(J,"style",le.style,_e.style,ue),de&8){const Xe=X.dynamicProps;for(let ot=0;ot<Xe.length;ot++){const Ye=Xe[ot],mt=le[Ye],It=_e[Ye];(It!==mt||Ye==="value")&&i(J,Ye,mt,It,ue,oe)}}de&1&&D.children!==X.children&&u(J,X.children)}else!q&&ge==null&&L(J,le,_e,oe,ue);((ze=_e.onVnodeUpdated)||Me)&&Rn(()=>{ze&&Ps(ze,oe,X,D),Me&&si(X,D,oe,"updated")},te)},I=(D,X,oe,te,ue,U,q)=>{for(let J=0;J<X.length;J++){const de=D[J],ge=X[J],Me=de.el&&(de.type===Le||!Wo(de,ge)||de.shapeFlag&198)?d(de.el):oe;y(de,ge,Me,null,te,ue,U,q,!0)}},L=(D,X,oe,te,ue)=>{if(X!==oe){if(X!==$t)for(const U in X)!Qr(U)&&!(U in oe)&&i(D,U,X[U],null,ue,te);for(const U in oe){if(Qr(U))continue;const q=oe[U],J=X[U];q!==J&&U!=="value"&&i(D,U,J,q,ue,te)}"value"in oe&&i(D,"value",X.value,oe.value,ue)}},O=(D,X,oe,te,ue,U,q,J,de)=>{const ge=X.el=D?D.el:l(""),Me=X.anchor=D?D.anchor:l("");let{patchFlag:le,dynamicChildren:_e,slotScopeIds:ze}=X;ze&&(J=J?J.concat(ze):ze),D==null?(s(ge,oe,te),s(Me,oe,te),w(X.children||[],oe,Me,ue,U,q,J,de)):le>0&&le&64&&_e&&D.dynamicChildren&&D.dynamicChildren.length===_e.length?(I(D.dynamicChildren,_e,oe,ue,U,q,J),(X.key!=null||ue&&X===ue.subTree)&&c1(D,X,!0)):z(D,X,oe,Me,ue,U,q,J,de)},P=(D,X,oe,te,ue,U,q,J,de)=>{X.slotScopeIds=J,D==null?X.shapeFlag&512?ue.ctx.activate(X,oe,te,q,de):B(X,oe,te,ue,U,q,de):R(D,X,de)},B=(D,X,oe,te,ue,U,q)=>{const J=D.component=L2(D,te,ue);if(Kc(D)&&(J.ctx.renderer=K),P2(J,!1,q),J.asyncDep){if(ue&&ue.registerDep(J,W,q),!D.el){const de=J.subTree=kt(Dn);_(null,de,X,oe),D.placeholder=de.el}}else W(J,D,X,oe,ue,U,q)},R=(D,X,oe)=>{const te=X.component=D.component;if(EA(D,X,oe))if(te.asyncDep&&!te.asyncResolved){V(te,X,oe);return}else te.next=X,te.update();else X.el=D.el,te.vnode=X},W=(D,X,oe,te,ue,U,q)=>{const J=()=>{if(D.isMounted){let{next:le,bu:_e,u:ze,parent:Xe,vnode:ot}=D;{const Kt=T2(D);if(Kt){le&&(le.el=ot.el,V(D,le,q)),Kt.asyncDep.then(()=>{Rn(()=>{D.isUnmounted||ge()},ue)});return}}let Ye=le,mt;Dr(D,!1),le?(le.el=ot.el,V(D,le,q)):le=ot,_e&&zl(_e),(mt=le.props&&le.props.onVnodeBeforeUpdate)&&Ps(mt,Xe,le,ot),Dr(D,!0);const It=cd(D),Mt=D.subTree;D.subTree=It,y(Mt,It,d(Mt.el),be(Mt),D,ue,U),le.el=It.el,Ye===null&&zf(D,It.el),ze&&Rn(ze,ue),(mt=le.props&&le.props.onVnodeUpdated)&&Rn(()=>Ps(mt,Xe,le,ot),ue)}else{let le;const{el:_e,props:ze}=X,{bm:Xe,m:ot,parent:Ye,root:mt,type:It}=D,Mt=Ai(X);if(Dr(D,!1),Xe&&zl(Xe),!Mt&&(le=ze&&ze.onVnodeBeforeMount)&&Ps(le,Ye,X),Dr(D,!0),_e&&pe){const Kt=()=>{D.subTree=cd(D),pe(_e,D.subTree,D,ue,null)};Mt&&It.__asyncHydrate?It.__asyncHydrate(_e,D,Kt):Kt()}else{mt.ce&&mt.ce._hasShadowRoot()&&mt.ce._injectChildStyle(It,D.parent?D.parent.type:void 0);const Kt=D.subTree=cd(D);y(null,Kt,oe,te,D,ue,U),X.el=Kt.el}if(ot&&Rn(ot,ue),!Mt&&(le=ze&&ze.onVnodeMounted)){const Kt=X;Rn(()=>Ps(le,Ye,Kt),ue)}(X.shapeFlag&256||Ye&&Ai(Ye.vnode)&&Ye.vnode.shapeFlag&256)&&D.a&&Rn(D.a,ue),D.isMounted=!0,X=oe=te=null}};D.scope.on();const de=D.effect=new Ad(J);D.scope.off();const ge=D.update=de.run.bind(de),Me=D.job=de.runIfDirty.bind(de);Me.i=D,Me.id=D.uid,de.scheduler=()=>Jg(Me),Dr(D,!0),ge()},V=(D,X,oe)=>{X.component=D;const te=D.vnode.props;D.vnode=X,D.next=null,$A(D,X.props,te,oe),PA(D,X.children,oe),Ni(),F0(D),Li()},z=(D,X,oe,te,ue,U,q,J,de=!1)=>{const ge=D&&D.children,Me=D?D.shapeFlag:0,le=X.children,{patchFlag:_e,shapeFlag:ze}=X;if(_e>0){if(_e&128){ae(ge,le,oe,te,ue,U,q,J,de);return}else if(_e&256){ie(ge,le,oe,te,ue,U,q,J,de);return}}ze&8?(Me&16&&me(ge,ue,U),le!==ge&&u(oe,le)):Me&16?ze&16?ae(ge,le,oe,te,ue,U,q,J,de):me(ge,ue,U,!0):(Me&8&&u(oe,""),ze&16&&w(le,oe,te,ue,U,q,J,de))},ie=(D,X,oe,te,ue,U,q,J,de)=>{D=D||ql,X=X||ql;const ge=D.length,Me=X.length,le=Math.min(ge,Me);let _e;for(_e=0;_e<le;_e++){const ze=X[_e]=de?wi(X[_e]):Rs(X[_e]);y(D[_e],ze,oe,null,ue,U,q,J,de)}ge>Me?me(D,ue,U,!0,!1,le):w(X,oe,te,ue,U,q,J,de,le)},ae=(D,X,oe,te,ue,U,q,J,de)=>{let ge=0;const Me=X.length;let le=D.length-1,_e=Me-1;for(;ge<=le&&ge<=_e;){const ze=D[ge],Xe=X[ge]=de?wi(X[ge]):Rs(X[ge]);if(Wo(ze,Xe))y(ze,Xe,oe,null,ue,U,q,J,de);else break;ge++}for(;ge<=le&&ge<=_e;){const ze=D[le],Xe=X[_e]=de?wi(X[_e]):Rs(X[_e]);if(Wo(ze,Xe))y(ze,Xe,oe,null,ue,U,q,J,de);else break;le--,_e--}if(ge>le){if(ge<=_e){const ze=_e+1,Xe=ze<Me?X[ze].el:te;for(;ge<=_e;)y(null,X[ge]=de?wi(X[ge]):Rs(X[ge]),oe,Xe,ue,U,q,J,de),ge++}}else if(ge>_e)for(;ge<=le;)Te(D[ge],ue,U,!0),ge++;else{const ze=ge,Xe=ge,ot=new Map;for(ge=Xe;ge<=_e;ge++){const Ge=X[ge]=de?wi(X[ge]):Rs(X[ge]);Ge.key!=null&&ot.set(Ge.key,ge)}let Ye,mt=0;const It=_e-Xe+1;let Mt=!1,Kt=0;const fn=new Array(It);for(ge=0;ge<It;ge++)fn[ge]=0;for(ge=ze;ge<=le;ge++){const Ge=D[ge];if(mt>=It){Te(Ge,ue,U,!0);continue}let Pt;if(Ge.key!=null)Pt=ot.get(Ge.key);else for(Ye=Xe;Ye<=_e;Ye++)if(fn[Ye-Xe]===0&&Wo(Ge,X[Ye])){Pt=Ye;break}Pt===void 0?Te(Ge,ue,U,!0):(fn[Pt-Xe]=ge+1,Pt>=Kt?Kt=Pt:Mt=!0,y(Ge,X[Pt],oe,null,ue,U,q,J,de),mt++)}const un=Mt?BA(fn):ql;for(Ye=un.length-1,ge=It-1;ge>=0;ge--){const Ge=Xe+ge,Pt=X[Ge],Gn=X[Ge+1],_n=Ge+1<Me?Gn.el||M2(Gn):te;fn[ge]===0?y(null,Pt,oe,_n,ue,U,q,J,de):Mt&&(Ye<0||ge!==un[Ye]?re(Pt,oe,_n,2):Ye--)}}},re=(D,X,oe,te,ue=null)=>{const{el:U,type:q,transition:J,children:de,shapeFlag:ge}=D;if(ge&6){re(D.component.subTree,X,oe,te);return}if(ge&128){D.suspense.move(X,oe,te);return}if(ge&64){q.move(D,X,oe,K);return}if(q===Le){s(U,X,oe);for(let le=0;le<de.length;le++)re(de[le],X,oe,te);s(D.anchor,X,oe);return}if(q===Xl){v(D,X,oe);return}if(te!==2&&ge&1&&J)if(te===0)J.persisted&&!U[Co]?s(U,X,oe):(J.beforeEnter(U),s(U,X,oe),Rn(()=>J.enter(U),ue));else{const{leave:le,delayLeave:_e,afterLeave:ze}=J,Xe=()=>{D.ctx.isUnmounted?o(U):s(U,X,oe)},ot=()=>{const Ye=U._isLeaving||!!U[Co];U._isLeaving&&U[Co](!0),J.persisted&&!Ye?Xe():le(U,()=>{Xe(),ze&&ze()})};_e?_e(U,Xe,ot):ot()}else s(U,X,oe)},Te=(D,X,oe,te=!1,ue=!1)=>{const{type:U,props:q,ref:J,children:de,dynamicChildren:ge,shapeFlag:Me,patchFlag:le,dirs:_e,cacheIndex:ze,memo:Xe}=D;if(le===-2&&(ue=!1),J!=null&&(Ni(),Kl(J,null,oe,D,!0),Li()),ze!=null&&(X.renderCache[ze]=void 0),Me&256){X.ctx.deactivate(D);return}const ot=Me&1&&_e,Ye=!Ai(D);let mt;if(Ye&&(mt=q&&q.onVnodeBeforeUnmount)&&Ps(mt,X,D),Me&6)Ne(D.component,oe,te);else{if(Me&128){D.suspense.unmount(oe,te);return}ot&&si(D,null,X,"beforeUnmount"),Me&64?D.type.remove(D,X,oe,K,te):ge&&!ge.hasOnce&&(U!==Le||le>0&&le&64)?me(ge,X,oe,!1,!0):(U===Le&&le&384||!ue&&Me&16)&&me(de,X,oe),te&&Pe(D)}const It=Xe!=null&&ze==null;(Ye&&(mt=q&&q.onVnodeUnmounted)||ot||It)&&Rn(()=>{mt&&Ps(mt,X,D),ot&&si(D,null,X,"unmounted"),It&&(D.el=null)},oe)},Pe=D=>{const{type:X,el:oe,anchor:te,transition:ue}=D;if(X===Le){We(oe,te);return}if(X===Xl){g(D);return}const U=()=>{o(oe),ue&&!ue.persisted&&ue.afterLeave&&ue.afterLeave()};if(D.shapeFlag&1&&ue&&!ue.persisted){const{leave:q,delayLeave:J}=ue,de=()=>q(oe,U);J?J(D.el,U,de):de()}else U()},We=(D,X)=>{let oe;for(;D!==X;)oe=h(D),o(D),D=oe;o(X)},Ne=(D,X,oe)=>{const{bum:te,scope:ue,job:U,subTree:q,um:J,m:de,a:ge}=D;Dd(de),Dd(ge),te&&zl(te),ue.stop(),U&&(U.flags|=8,Te(q,D,X,oe)),J&&Rn(J,X),Rn(()=>{D.isUnmounted=!0},X)},me=(D,X,oe,te=!1,ue=!1,U=0)=>{for(let q=U;q<D.length;q++)Te(D[q],X,oe,te,ue)},be=D=>{if(D.shapeFlag&6)return be(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const X=h(D.anchor||D.el),oe=X&&X[e2];return oe?h(oe):X};let Se=!1;const fe=(D,X,oe)=>{let te;D==null?X._vnode&&(Te(X._vnode,null,null,!0),te=X._vnode.component):y(X._vnode||null,D,X,null,null,null,oe),X._vnode=D,Se||(Se=!0,F0(te),Od(),Se=!1)},K={p:y,um:Te,m:re,r:Pe,mt:B,mc:w,pc:z,pbc:I,n:be,o:e};let Z,pe;return t&&([Z,pe]=t(K)),{render:fe,hydrate:Z,createApp:SA(fe,Z)}}function Ap({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 Dr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function x2(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function c1(e,t,n=!1){const s=e.children,o=t.children;if(ct(s)&&ct(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=wi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&c1(r,l)),l.type===ur&&(l.patchFlag===-1&&(l=o[i]=wi(l)),l.el=r.el),l.type===Dn&&!l.el&&(l.el=r.el)}}function BA(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function T2(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:T2(t)}function Dd(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function M2(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?M2(t.subTree):null}const Bd=e=>e.__isSuspense;let Wm=0;const FA={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)HA(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}WA(e,t,n,s,o,r,l,a,c)}},hydrate:UA,normalize:qA},hue=FA;function Ec(e,t){const n=e.props&&e.props[t];bt(n)&&n()}function HA(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),h=e.suspense=A2(e,o,s,t,d,n,i,r,l,a);c(null,h.pendingBranch=e.ssContent,d,null,s,h,i,r),h.deps>0?(Ec(e,"onPending"),Ec(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),Yl(h,e.ssFallback)):h.resolve(!1,!0)}function WA(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const h=t.ssContent,m=t.ssFallback,{activeBranch:f,pendingBranch:y,isInFallback:S,isHydrating:_}=d;if(y)d.pendingBranch=h,Wo(y,h)?(a(y,h,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():S&&(_||(a(f,m,n,s,o,null,i,r,l),Yl(d,m)))):(d.pendingId=Wm++,_?(d.isHydrating=!1,d.activeBranch=y):c(y,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),S?(a(null,h,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(f,m,n,s,o,null,i,r,l),Yl(d,m))):f&&Wo(f,h)?(a(f,h,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,h,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(f&&Wo(f,h))a(f,h,n,s,o,d,i,r,l),Yl(d,h);else if(Ec(t,"onPending"),d.pendingBranch=h,h.shapeFlag&512?d.pendingId=h.component.suspenseId:d.pendingId=Wm++,a(null,h,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:b,pendingId:v}=d;b>0?setTimeout(()=>{d.pendingId===v&&d.fallback(m)},b):b===0&&d.fallback(m)}}function A2(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:h,um:m,n:f,o:{parentNode:y,remove:S}}=c;let _;const b=jA(e);b&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const v=e.props?Md(e.props.timeout):void 0,g=i,k={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:Wm++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve($=!1,A=!1){const{vnode:w,activeBranch:x,pendingBranch:I,pendingId:L,effects:O,parentComponent:P,container:B,isInFallback:R}=k;let W=!1;if(k.isHydrating)k.isHydrating=!1;else if(!$){W=x&&I.transition&&I.transition.mode==="out-in";let ie=!1;W&&(x.transition.afterLeave=()=>{L===k.pendingId&&(h(I,B,i===g&&!ie?f(x):i,0),Ld(O),R&&w.ssFallback&&(w.ssFallback.el=null))}),x&&!k.isFallbackMountPending&&(y(x.el)===B&&(i=f(x),ie=!0),m(x,P,k,!0),!W&&R&&w.ssFallback&&Rn(()=>w.ssFallback.el=null,k)),W||h(I,B,i,0)}k.isFallbackMountPending=!1,Yl(k,I),k.pendingBranch=null,k.isInFallback=!1;let V=k.parent,z=!1;for(;V;){if(V.pendingBranch){V.effects.push(...O),z=!0;break}V=V.parent}!z&&!W&&Ld(O),k.effects=[],b&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!A&&t.resolve()),Ec(w,"onResolve")},fallback($){if(!k.pendingBranch)return;const{vnode:A,activeBranch:w,parentComponent:x,container:I,namespace:L}=k;Ec(A,"onFallback");const O=f(w),P=()=>{k.isFallbackMountPending=!1,k.isInFallback&&(d(null,$,I,O,x,null,L,l,a),Yl(k,$))},B=$.transition&&$.transition.mode==="out-in";B&&(k.isFallbackMountPending=!0,w.transition.afterLeave=P),k.isInFallback=!0,m(w,x,null,!0),B||P()},move($,A,w){k.activeBranch&&h(k.activeBranch,$,A,w),k.container=$},next(){return k.activeBranch&&f(k.activeBranch)},registerDep($,A,w){const x=!!k.pendingBranch;x&&k.deps++;const I=$.vnode.el;$.asyncDep.catch(L=>{pa(L,$,0)}).then(L=>{if($.isUnmounted||k.isUnmounted||k.pendingId!==$.suspenseId)return;Ic(),$.asyncResolved=!0;const{vnode:O}=$;Um($,L,!1),I&&(O.el=I);const P=!I&&$.subTree.el;A($,O,y(I||$.subTree.el),I?null:f($.subTree),k,r,w),P&&(O.placeholder=null,S(P)),zf($,O.el),x&&--k.deps===0&&k.resolve()})},unmount($,A){k.isUnmounted=!0,k.activeBranch&&m(k.activeBranch,n,$,A),k.pendingBranch&&m(k.pendingBranch,n,$,A)}};return k}function UA(e,t,n,s,o,i,r,l,a){const c=t.suspense=A2(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function qA(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=J0(s?n.default:n),e.ssFallback=s?J0(n.fallback):kt(Dn)}function J0(e){let t;if(bt(e)){const n=sl&&e._c;n&&(e._d=!1,C()),e=e(),n&&(e._d=!0,t=gs,I2())}return ct(e)&&(e=TA(e)),e=Rs(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function E2(e,t){t&&t.pendingBranch?ct(e)?t.effects.push(...e):t.effects.push(e):Ld(e)}function Yl(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,zf(s,o))}function jA(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Le=Symbol.for("v-fgt"),ur=Symbol.for("v-txt"),Dn=Symbol.for("v-cmt"),Xl=Symbol.for("v-stc"),uc=[];let gs=null;function C(e=!1){uc.push(gs=e?null:[])}function I2(){uc.pop(),gs=uc[uc.length-1]||null}let sl=1;function Fd(e,t=!1){sl+=e,e<0&&gs&&t&&(gs.hasOnce=!0)}function $2(e){return e.dynamicChildren=sl>0?gs||ql:null,I2(),sl>0&&gs&&gs.push(e),e}function E(e,t,n,s,o,i){return $2(p(e,t,n,s,o,i,!0))}function je(e,t,n,s,o){return $2(kt(e,t,n,s,o,!0))}function mr(e){return e?e.__v_isVNode===!0:!1}function Wo(e,t){return e.type===t.type&&e.key===t.key}function pue(e){}const N2=({key:e})=>e??null,ud=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?sn(e)||Fn(e)||bt(e)?{i:ls,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,s=0,o=null,i=e===Le?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&N2(t),ref:t&&ud(t),scopeId:Uf,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:ls};return l?(u1(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=sn(n)?8:16),sl>0&&!r&&gs&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&gs.push(a),a}const kt=zA;function zA(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===c2)&&(e=Dn),mr(e)){const l=Pi(e,t,!0);return n&&u1(l,n),sl>0&&!i&&gs&&(l.shapeFlag&6?gs[gs.indexOf(e)]=l:gs.push(l)),l.patchFlag=-2,l}if(ZA(e)&&(e=e.__vccOpts),t){t=VA(t);let{class:l,style:a}=t;l&&!sn(l)&&(t.class=$e(l)),Vt(a)&&(Wf(a)&&!ct(a)&&(a=tn({},a)),t.style=Dt(a))}const r=sn(e)?1:Bd(e)?128:t2(e)?64:Vt(e)?4:bt(e)?2:0;return p(e,t,n,s,o,r,i,!0)}function VA(e){return e?Wf(e)||y2(e)?tn({},e):e:null}function Pi(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?en(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&N2(c),ref:t&&t.ref?n&&i?ct(i)?i.concat(ud(t)):[i,ud(t)]:ud(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!==Le?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&&Pi(e.ssContent),ssFallback:e.ssFallback&&Pi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&pr(u,a.clone(u)),u}function vt(e=" ",t=0){return kt(ur,null,e,t)}function gr(e,t){const n=kt(Xl,null,e);return n.staticCount=t,n}function ce(e="",t=!1){return t?(C(),je(Dn,null,e)):kt(Dn,null,e)}function Rs(e){return e==null||typeof e=="boolean"?kt(Dn):ct(e)?kt(Le,null,e.slice()):mr(e)?wi(e):kt(ur,null,String(e))}function wi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Pi(e)}function u1(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ct(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),u1(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!y2(t)?t._ctx=ls:o===3&&ls&&(ls.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else bt(t)?(t={default:t,_ctx:ls},n=32):(t=String(t),s&64?(n=16,t=[vt(t)]):n=8);e.children=t,e.shapeFlag|=n}function en(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=$e([t.class,s.class]));else if(o==="style")t.style=Dt([t.style,s.style]);else if(jc(o)){const i=t[o],r=s[o];r&&i!==r&&!(ct(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Ef(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function Ps(e,t,n,s=null){Lo(e,t,7,[n,s])}const KA=f2();let GA=0;function L2(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||KA,i={uid:GA++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ew(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:b2(s,o),emitsOptions:p2(s,o),emit:null,emitted:null,propsDefaults:$t,inheritAttrs:s.inheritAttrs,ctx:$t,data:$t,props:$t,attrs:$t,slots:$t,refs:$t,setupState:$t,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=CA.bind(null,i),e.ce&&e.ce(i),i}let is=null;const ys=()=>is||ls;let Hd,Zl;{const e=Pf(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};Hd=t("__VUE_INSTANCE_SETTERS__",n=>is=n),Zl=t("__VUE_SSR_SETTERS__",n=>ol=n)}const ma=e=>{const t=is;return Hd(e),e.scope.on(),()=>{e.scope.off(),Hd(t)}},Ic=()=>{is&&is.scope.off(),Hd(null)};function O2(e){return e.vnode.shapeFlag&4}let ol=!1;function P2(e,t=!1,n=!1){t&&Zl(t);const{props:s,children:o}=e.vnode,i=O2(e);IA(e,s,i,t),OA(e,o,n||t);const r=i?YA(e,t):void 0;return t&&Zl(!1),r}function YA(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Dm);const{setup:s}=n;if(s){Ni();const o=e.setupContext=s.length>1?D2(e):null,i=ma(e),r=zc(s,e,0,[e.props,o]),l=Kg(r);if(Li(),i(),(l||e.sp)&&!Ai(e)&&t1(e),l){if(r.then(Ic,Ic),t)return r.then(a=>{Um(e,a,t)}).catch(a=>{pa(a,e,0)});e.asyncDep=r}else Um(e,r,t)}else R2(e,t)}function Um(e,t,n){bt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Vt(t)&&(e.setupState=Vw(t)),R2(e,n)}let Wd,qm;function mue(e){Wd=e,qm=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,gA))}}const gue=()=>!Wd;function R2(e,t,n){const s=e.type;if(!e.render){if(!t&&Wd&&!s.render){const o=s.template||r1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=tn(tn({isCustomElement:i,delimiters:l},r),a);s.render=Wd(o,c)}}e.render=s.render||$o,qm&&qm(e)}{const o=ma(e);Ni();try{vA(e)}finally{Li(),o()}}}const XA={get(e,t){return ps(e,"get",""),e[t]}};function D2(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,XA),slots:e.slots,emit:e.emit,expose:t}}function Yc(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Vw(rr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in cc)return cc[n](e)},has(t,n){return n in t||n in cc}})):e.proxy}function jm(e,t=!0){return bt(e)?e.displayName||e.name:e.name||t&&e.__name}function ZA(e){return bt(e)&&"__vccOpts"in e}const j=(e,t)=>LM(e,t,ol);function Xt(e,t,n){try{Fd(-1);const s=arguments.length;return s===2?Vt(t)&&!ct(t)?mr(t)?kt(e,null,[t]):kt(e,t):kt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&mr(n)&&(n=[n]),kt(e,t,n))}finally{Fd(1)}}function vue(){}function yue(e,t,n,s){const o=n[s];if(o&&QA(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function QA(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(os(n[s],t[s]))return!1;return sl>0&&gs&&gs.push(e),!0}const JA="3.5.35",kue=$o,bue=BM,_ue=Dl,wue=Qw,e4={createComponentInstance:L2,setupComponent:P2,renderComponentRoot:cd,setCurrentRenderingInstance:Tc,isVNode:mr,normalizeVNode:Rs,getComponentPublicInstance:Yc,ensureValidVNode:i1,pushWarningContext:RM,popWarningContext:DM},Sue=e4,Cue=null,xue=null,Tue=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let zm;const ey=typeof window<"u"&&window.trustedTypes;if(ey)try{zm=ey.createPolicy("vue",{createHTML:e=>e})}catch{}const B2=zm?e=>zm.createHTML(e):e=>e,t4="http://www.w3.org/2000/svg",n4="http://www.w3.org/1998/Math/MathML",bi=typeof document<"u"?document:null,ty=bi&&bi.createElement("template"),s4={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?bi.createElementNS(t4,e):t==="mathml"?bi.createElementNS(n4,e):n?bi.createElement(e,{is:n}):bi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>bi.createTextNode(e),createComment:e=>bi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{ty.innerHTML=B2(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=ty.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ki="transition",qa="animation",la=Symbol("_vtc"),F2={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},H2=tn({},s2,F2),o4=e=>(e.displayName="Transition",e.props=H2,e),Ei=o4((e,{slots:t})=>Xt(XM,W2(e),t)),Br=(e,t=[])=>{ct(e)?e.forEach(n=>n(...t)):e&&e(...t)},ny=e=>e?ct(e)?e.some(t=>t.length>1):e.length>1:!1;function W2(e){const t={};for(const O in e)O in F2||(t[O]=e[O]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,f=i4(o),y=f&&f[0],S=f&&f[1],{onBeforeEnter:_,onEnter:b,onEnterCancelled:v,onLeave:g,onLeaveCancelled:k,onBeforeAppear:$=_,onAppear:A=b,onAppearCancelled:w=v}=t,x=(O,P,B,R)=>{O._enterCancelled=R,er(O,P?u:l),er(O,P?c:r),B&&B()},I=(O,P)=>{O._isLeaving=!1,er(O,d),er(O,m),er(O,h),P&&P()},L=O=>(P,B)=>{const R=O?A:b,W=()=>x(P,O,B);Br(R,[P,W]),sy(()=>{er(P,O?a:i),ei(P,O?u:l),ny(R)||oy(P,s,y,W)})};return tn(t,{onBeforeEnter(O){Br(_,[O]),ei(O,i),ei(O,r)},onBeforeAppear(O){Br($,[O]),ei(O,a),ei(O,c)},onEnter:L(!1),onAppear:L(!0),onLeave(O,P){O._isLeaving=!0;const B=()=>I(O,P);ei(O,d),O._enterCancelled?(ei(O,h),Vm(O)):(Vm(O),ei(O,h)),sy(()=>{O._isLeaving&&(er(O,d),ei(O,m),ny(g)||oy(O,s,S,B))}),Br(g,[O,B])},onEnterCancelled(O){x(O,!1,void 0,!0),Br(v,[O])},onAppearCancelled(O){x(O,!0,void 0,!0),Br(w,[O])},onLeaveCancelled(O){I(O),Br(k,[O])}})}function i4(e){if(e==null)return null;if(Vt(e))return[Ep(e.enter),Ep(e.leave)];{const t=Ep(e);return[t,t]}}function Ep(e){return Md(e)}function ei(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[la]||(e[la]=new Set)).add(t)}function er(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[la];n&&(n.delete(t),n.size||(e[la]=void 0))}function sy(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let r4=0;function oy(e,t,n,s){const o=e._endId=++r4,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=U2(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,h),i()},h=m=>{m.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,h)}function U2(e,t){const n=window.getComputedStyle(e),s=f=>(n[f]||"").split(", "),o=s(`${Ki}Delay`),i=s(`${Ki}Duration`),r=iy(o,i),l=s(`${qa}Delay`),a=s(`${qa}Duration`),c=iy(l,a);let u=null,d=0,h=0;t===Ki?r>0&&(u=Ki,d=r,h=i.length):t===qa?c>0&&(u=qa,d=c,h=a.length):(d=Math.max(r,c),u=d>0?r>c?Ki:qa:null,h=u?u===Ki?i.length:a.length:0);const m=u===Ki&&/\b(?:transform|all)(?:,|$)/.test(s(`${Ki}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:m}}function iy(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>ry(n)+ry(e[s])))}function ry(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Vm(e){return(e?e.ownerDocument:document).body.offsetHeight}function l4(e,t,n){const s=e[la];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ud=Symbol("_vod"),q2=Symbol("_vsh"),Uo={name:"show",beforeMount(e,{value:t},{transition:n}){e[Ud]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):ja(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),ja(e,!0),s.enter(e)):s.leave(e,()=>{ja(e,!1)}):ja(e,t))},beforeUnmount(e,{value:t}){ja(e,t)}};function ja(e,t){e.style.display=t?e[Ud]:"none",e[q2]=!t}function a4(){Uo.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const j2=Symbol("");function Mue(e){const t=ys();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>qd(i,o))},s=()=>{const o=e(t.proxy);t.ce?qd(t.ce,o):Km(t.subTree,o),n(o)};a2(()=>{Ld(s)}),ln(()=>{Ve(s,$o,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Ut(()=>o.disconnect())})}function Km(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Km(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)qd(e.el,t);else if(e.type===Le)e.children.forEach(n=>Km(n,t));else if(e.type===Xl){let{el:n,anchor:s}=e;for(;n&&(qd(n,t),n!==s);)n=n.nextSibling}}function qd(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=iM(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[j2]=s}}const c4=/(?:^|;)\s*display\s*:/;function u4(e,t,n){const s=e.style,o=sn(n);let i=!1;if(n&&!o){if(t)if(sn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&ec(s,l,"")}else for(const r in t)n[r]==null&&ec(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?f4(e,r,!sn(t)&&t?t[r]:void 0,l)||ec(s,r,l):ec(s,r,"")}}else if(o){if(t!==n){const r=s[j2];r&&(n+=";"+r),s.cssText=n,i=c4.test(n)}}else t&&e.removeAttribute("style");Ud in e&&(e[Ud]=i?s.display:"",e[q2]&&(s.display="none"))}const ly=/\s*!important$/;function ec(e,t,n){if(ct(n))n.forEach(s=>ec(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=d4(e,t);ly.test(n)?e.setProperty(Ds(s),n.replace(ly,""),"important"):e[s]=n}}const ay=["Webkit","Moz","ms"],Ip={};function d4(e,t){const n=Ip[t];if(n)return n;let s=Kn(t);if(s!=="filter"&&s in e)return Ip[t]=s;s=Lf(s);for(let o=0;o<ay.length;o++){const i=ay[o]+s;if(i in e)return Ip[t]=i}return t}function f4(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&sn(s)&&n===s}const cy="http://www.w3.org/1999/xlink";function uy(e,t,n,s,o,i=sM(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(cy,t.slice(6,t.length)):e.setAttributeNS(cy,t,n):n==null||i&&!Tw(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ro(n)?String(n):n)}function dy(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?B2(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=Tw(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function xi(e,t,n,s){e.addEventListener(t,n,s)}function h4(e,t,n,s){e.removeEventListener(t,n,s)}const fy=Symbol("_vei");function p4(e,t,n,s,o=null){const i=e[fy]||(e[fy]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=m4(t);if(s){const c=i[t]=y4(s,o);xi(e,l,c,a)}else r&&(h4(e,l,r,a),i[t]=void 0)}}const hy=/(?:Once|Passive|Capture)$/;function m4(e){let t;if(hy.test(e)){t={};let s;for(;s=e.match(hy);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ds(e.slice(2)),t]}let $p=0;const g4=Promise.resolve(),v4=()=>$p||(g4.then(()=>$p=0),$p=Date.now());function y4(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(ct(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&Lo(c,t,5,l)}}else Lo(o,t,5,[s])};return n.value=e,n.attached=v4(),n}const py=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,k4=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?l4(e,s,r):t==="style"?u4(e,n,s):jc(t)?Ef(t)||p4(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):b4(e,t,s,r))?(dy(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&uy(e,t,s,r,i,t!=="value")):e._isVueCE&&(_4(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!sn(s)))?dy(e,Kn(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),uy(e,t,s,r))};function b4(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&py(t)&&bt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return py(t)&&sn(n)?!1:t in e}function _4(e,t){const n=e._def.props;if(!n)return!1;const s=Kn(t);return Array.isArray(n)?n.some(o=>Kn(o)===s):Object.keys(n).some(o=>Kn(o)===s)}const my={};function w4(e,t,n){let s=Je(e,t);If(s)&&(s=tn({},s,t));class o extends d1{constructor(r){super(s,r,n)}}return o.def=s,o}const Aue=((e,t)=>w4(e,t,B4)),S4=typeof HTMLElement<"u"?HTMLElement:class{};class d1 extends S4{constructor(t,n={},s=Kd){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==Kd?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(tn({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof d1){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,gt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!ct(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Md(this._props[a])),(l||(l=Object.create(null)))[Kn(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)zt(this,s)||Object.defineProperty(this,s,{get:()=>T(n[s])})}_resolveProps(t){const{props:n}=t,s=ct(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(Kn))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):my;const o=Kn(t);n&&this._numberProps&&this._numberProps[o]&&(s=Md(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===my?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Ds(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ds(t),n+""):n||this.removeAttribute(Ds(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),D4(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=kt(this._def,tn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,If(r[0])?tn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),Ds(i)!==i&&o(Ds(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function C4(e){const t=ys(),n=t&&t.ce;return n||null}function Eue(){const e=C4();return e&&e.shadowRoot}function Iue(e="$style"){{const t=ys();if(!t)return $t;const n=t.type.__cssModules;if(!n)return $t;const s=n[e];return s||$t}}const z2=new WeakMap,V2=new WeakMap,jd=Symbol("_moveCb"),gy=Symbol("_enterCb"),x4=e=>(delete e.props.mode,e),T4=x4({name:"TransitionGroup",props:tn({},H2,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ys(),s=n2();let o,i;return n1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!I4(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(M4),o.forEach(A4);const l=o.filter(E4);Vm(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;ei(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[jd]=h=>{h&&h.target!==c||(!h||h.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[jd]=null,er(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Rt(e),l=W2(r);let a=r.tag||Le;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),pr(u,Mc(u,l,s,n)),z2.set(u,K2(u.el)))}i=t.default?e1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&pr(u,Mc(u,l,s,n))}return kt(a,null,i)}}}),$ue=T4;function M4(e){const t=e.el;t[jd]&&t[jd](),t[gy]&&t[gy]()}function A4(e){V2.set(e,K2(e.el))}function E4(e){const t=z2.get(e),n=V2.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function K2(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function I4(e,t,n){const s=e.cloneNode(),o=e[la];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=U2(s);return i.removeChild(s),r}const vr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ct(t)?n=>zl(t,n):t};function $4(e){e.target.composing=!0}function vy(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const No=Symbol("_assign");function yy(e,t,n){return t&&(e=e.trim()),n&&(e=Of(e)),e}const Tn={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[No]=vr(o);const i=s||o.props&&o.props.type==="number";xi(e,t?"change":"input",r=>{r.target.composing||e[No](yy(e.value,n,i))}),(n||i)&&xi(e,"change",()=>{e.value=yy(e.value,n,i)}),t||(xi(e,"compositionstart",$4),xi(e,"compositionend",vy),xi(e,"change",vy))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[No]=vr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Of(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},zd={deep:!0,created(e,t,n){e[No]=vr(n),xi(e,"change",()=>{const s=e._modelValue,o=aa(e),i=e.checked,r=e[No];if(ct(s)){const l=Rf(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(rl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(Y2(e,i))})},mounted:ky,beforeUpdate(e,t,n){e[No]=vr(n),ky(e,t,n)}};function ky(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(ct(t))o=Rf(t,s.props.value)>-1;else if(rl(t))o=t.has(s.props.value);else{if(t===n)return;o=$i(t,Y2(e,!0))}e.checked!==o&&(e.checked=o)}const G2={created(e,{value:t},n){e.checked=$i(t,n.props.value),e[No]=vr(n),xi(e,"change",()=>{e[No](aa(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[No]=vr(s),t!==n&&(e.checked=$i(t,s.props.value))}},Vd={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=rl(t);xi(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Of(aa(r)):aa(r));e[No](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,gt(()=>{e._assigning=!1})}),e[No]=vr(s)},mounted(e,{value:t}){by(e,t)},beforeUpdate(e,t,n){e[No]=vr(n)},updated(e,{value:t}){e._assigning||by(e,t)}};function by(e,t){const n=e.multiple,s=ct(t);if(!(n&&!s&&!rl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=aa(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Rf(t,l)>-1}else r.selected=t.has(l);else if($i(aa(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function aa(e){return"_value"in e?e._value:e.value}function Y2(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const N4={created(e,t,n){Bu(e,t,n,null,"created")},mounted(e,t,n){Bu(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Bu(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Bu(e,t,n,s,"updated")}};function X2(e,t){switch(e){case"SELECT":return Vd;case"TEXTAREA":return Tn;default:switch(t){case"checkbox":return zd;case"radio":return G2;default:return Tn}}}function Bu(e,t,n,s,o){const r=X2(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function L4(){Tn.getSSRProps=({value:e})=>({value:e}),G2.getSSRProps=({value:e},t)=>{if(t.props&&$i(t.props.value,e))return{checked:!0}},zd.getSSRProps=({value:e},t)=>{if(ct(e)){if(t.props&&Rf(e,t.props.value)>-1)return{checked:!0}}else if(rl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},N4.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=X2(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const O4=["ctrl","shift","alt","meta"],P4={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)=>O4.some(n=>e[`${n}Key`]&&!t.includes(n))},Ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=P4[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},R4={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Eo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=Ds(o.key);if(t.some(r=>r===i||R4[r]===i))return e(o)}))},Z2=tn({patchProp:k4},s4);let dc,_y=!1;function Q2(){return dc||(dc=RA(Z2))}function J2(){return dc=_y?dc:DA(Z2),_y=!0,dc}const D4=((...e)=>{Q2().render(...e)}),Nue=((...e)=>{J2().hydrate(...e)}),Kd=((...e)=>{const t=Q2().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=tS(s);if(!o)return;const i=t._component;!bt(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,eS(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),B4=((...e)=>{const t=J2().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=tS(s);if(o)return n(o,!0,eS(o))},t});function eS(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function tS(e){return sn(e)?document.querySelector(e):e}let wy=!1;const Lue=()=>{wy||(wy=!0,L4(),a4())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function F4(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Gd=typeof window<"u",wr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),H4=(e,t,n)=>W4({l:e,k:t,s:n}),W4=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Bn=e=>typeof e=="number"&&isFinite(e),nS=e=>h1(e)==="[object Date]",ca=e=>h1(e)==="[object RegExp]",Vf=e=>Nt(e)&&Object.keys(e).length===0,Hn=Object.assign,U4=Object.create,nn=(e=null)=>U4(e);let Sy;const Yr=()=>Sy||(Sy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:nn());function Cy(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function q4(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const j4=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,z4=/^(?:href|src|action|formaction)$/i;function f1(e){return j4.test(e)}function V4(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const h=e[l];if(c){h===c&&(c=null);continue}if(h==='"'||h==="'")c=h;else if(h==="(")a++;else if(h===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(s,i),n+=f1(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function xy(e,t){if(z4.test(e)&&f1(t))return"about:blank";const n=e.toLowerCase()==="style"?V4(t):t;return q4(n)}function K4(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${xy(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${xy(s,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,s,o)=>f1(o)?`${s}about:blank`:n),e}const G4=Object.prototype.hasOwnProperty;function Io(e,t){return G4.call(e,t)}const Cn=Array.isArray,mn=e=>typeof e=="function",rt=e=>typeof e=="string",Ht=e=>typeof e=="boolean",Wt=e=>e!==null&&typeof e=="object",Y4=e=>Wt(e)&&mn(e.then)&&mn(e.catch),sS=Object.prototype.toString,h1=e=>sS.call(e),Nt=e=>h1(e)==="[object Object]",X4=e=>e==null?"":Cn(e)||Nt(e)&&e.toString===sS?JSON.stringify(e,null,2):String(e);function p1(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Fu=e=>!Wt(e)||Cn(e);function dd(e,t){if(Fu(e)||Fu(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(Wt(s[i])&&!Wt(o[i])&&(o[i]=Array.isArray(s[i])?[]:nn()),Fu(o[i])||Fu(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function Z4(e,t,n){return{line:e,column:t,offset:n}}function Gm(e,t,n){return{start:e,end:t}}const Yt={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},Q4=17;function Kf(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function J4(e){throw e}const Qo=" ",eE="\r",us=`
|
|
29
|
-
`,tE="\u2028",nE="\u2029";function sE(e){const t=e;let n=0,s=1,o=1,i=0;const r=A=>t[A]===eE&&t[A+1]===us,l=A=>t[A]===us,a=A=>t[A]===nE,c=A=>t[A]===tE,u=A=>r(A)||l(A)||a(A)||c(A),d=()=>n,h=()=>s,m=()=>o,f=()=>i,y=A=>r(A)||a(A)||c(A)?us:t[A],S=()=>y(n),_=()=>y(n+i);function b(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function g(){n=0,s=1,o=1,i=0}function k(A=0){i=A}function $(){const A=n+i;for(;A!==n;)b();i=0}return{index:d,line:h,column:m,peekOffset:f,charAt:y,currentChar:S,currentPeek:_,next:b,peek:v,reset:g,resetPeek:k,skipToPeek:$}}const ki=void 0,oE=".",Ty="'",iE="tokenizer";function rE(e,t={}){const n=t.location!==!1,s=sE(e),o=()=>s.index(),i=()=>Z4(s.line(),s.column(),s.index()),r=i(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(U,q,J,...de){const ge=c();if(q.column+=J,q.offset+=J,u){const Me=n?Gm(ge.startLoc,q):null,le=Kf(U,Me,{domain:iE,args:de});u(le)}}function h(U,q,J){U.endLoc=i(),U.currentType=q;const de={type:q};return n&&(de.loc=Gm(U.startLoc,U.endLoc)),J!=null&&(de.value=J),de}const m=U=>h(U,13);function f(U,q){return U.currentChar()===q?(U.next(),q):(d(Yt.EXPECTED_TOKEN,i(),0,q),"")}function y(U){let q="";for(;U.currentPeek()===Qo||U.currentPeek()===us;)q+=U.currentPeek(),U.peek();return q}function S(U){const q=y(U);return U.skipToPeek(),q}function _(U){if(U===ki)return!1;const q=U.charCodeAt(0);return q>=97&&q<=122||q>=65&&q<=90||q===95}function b(U){if(U===ki)return!1;const q=U.charCodeAt(0);return q>=48&&q<=57}function v(U,q){const{currentType:J}=q;if(J!==2)return!1;y(U);const de=_(U.currentPeek());return U.resetPeek(),de}function g(U,q){const{currentType:J}=q;if(J!==2)return!1;y(U);const de=U.currentPeek()==="-"?U.peek():U.currentPeek(),ge=b(de);return U.resetPeek(),ge}function k(U,q){const{currentType:J}=q;if(J!==2)return!1;y(U);const de=U.currentPeek()===Ty;return U.resetPeek(),de}function $(U,q){const{currentType:J}=q;if(J!==7)return!1;y(U);const de=U.currentPeek()===".";return U.resetPeek(),de}function A(U,q){const{currentType:J}=q;if(J!==8)return!1;y(U);const de=_(U.currentPeek());return U.resetPeek(),de}function w(U,q){const{currentType:J}=q;if(!(J===7||J===11))return!1;y(U);const de=U.currentPeek()===":";return U.resetPeek(),de}function x(U,q){const{currentType:J}=q;if(J!==9)return!1;const de=()=>{const Me=U.currentPeek();return Me==="{"?_(U.peek()):Me==="@"||Me==="|"||Me===":"||Me==="."||Me===Qo||!Me?!1:Me===us?(U.peek(),de()):L(U,!1)},ge=de();return U.resetPeek(),ge}function I(U){y(U);const q=U.currentPeek()==="|";return U.resetPeek(),q}function L(U,q=!0){const J=(ge=!1,Me="")=>{const le=U.currentPeek();return le==="{"||le==="@"||!le?ge:le==="|"?!(Me===Qo||Me===us):le===Qo?(U.peek(),J(!0,Qo)):le===us?(U.peek(),J(!0,us)):!0},de=J();return q&&U.resetPeek(),de}function O(U,q){const J=U.currentChar();return J===ki?ki:q(J)?(U.next(),J):null}function P(U){const q=U.charCodeAt(0);return q>=97&&q<=122||q>=65&&q<=90||q>=48&&q<=57||q===95||q===36}function B(U){return O(U,P)}function R(U){const q=U.charCodeAt(0);return q>=97&&q<=122||q>=65&&q<=90||q>=48&&q<=57||q===95||q===36||q===45}function W(U){return O(U,R)}function V(U){const q=U.charCodeAt(0);return q>=48&&q<=57}function z(U){return O(U,V)}function ie(U){const q=U.charCodeAt(0);return q>=48&&q<=57||q>=65&&q<=70||q>=97&&q<=102}function ae(U){return O(U,ie)}function re(U){let q="",J="";for(;q=z(U);)J+=q;return J}function Te(U){let q="";for(;;){const J=U.currentChar();if(J==="\\"){const de=U.peek();de==="{"||de==="}"||de==="@"||de==="|"||de==="\\"?(q+=J+de,U.next(),U.next()):(U.resetPeek(),q+=J,U.next())}else{if(J==="{"||J==="}"||J==="@"||J==="|"||!J)break;if(J===Qo||J===us)if(L(U))q+=J,U.next();else{if(I(U))break;q+=J,U.next()}else q+=J,U.next()}}return q}function Pe(U){S(U);let q="",J="";for(;q=W(U);)J+=q;const de=U.currentChar();if(de&&de!=="}"&&de!==ki&&de!==Qo&&de!==us&&de!==" "){const ge=K(U);return d(Yt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,J+ge),J+ge}return U.currentChar()===ki&&d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),J}function We(U){S(U);let q="";return U.currentChar()==="-"?(U.next(),q+=`-${re(U)}`):q+=re(U),U.currentChar()===ki&&d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),q}function Ne(U){return U!==Ty&&U!==us}function me(U){S(U),f(U,"'");let q="",J="";for(;q=O(U,Ne);)q==="\\"?J+=be(U):J+=q;const de=U.currentChar();return de===us||de===ki?(d(Yt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),de===us&&(U.next(),f(U,"'")),J):(f(U,"'"),J)}function be(U){const q=U.currentChar();switch(q){case"\\":case"'":return U.next(),`\\${q}`;case"u":return Se(U,q,4);case"U":return Se(U,q,6);default:return d(Yt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,q),""}}function Se(U,q,J){f(U,q);let de="";for(let ge=0;ge<J;ge++){const Me=ae(U);if(!Me){d(Yt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${q}${de}${U.currentChar()}`);break}de+=Me}return`\\${q}${de}`}function fe(U){return U!=="{"&&U!=="}"&&U!==Qo&&U!==us}function K(U){S(U);let q="",J="";for(;q=O(U,fe);)J+=q;return J}function Z(U){let q="",J="";for(;q=B(U);)J+=q;return J}function pe(U){const q=J=>{const de=U.currentChar();return de==="{"||de==="@"||de==="|"||de==="("||de===")"||!de||de===Qo?J:(J+=de,U.next(),q(J))};return q("")}function D(U){S(U);const q=f(U,"|");return S(U),q}function X(U,q){let J=null;switch(U.currentChar()){case"{":return q.braceNest>=1&&d(Yt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),U.next(),J=h(q,2,"{"),S(U),q.braceNest++,J;case"}":return q.braceNest>0&&q.currentType===2&&d(Yt.EMPTY_PLACEHOLDER,i(),0),U.next(),J=h(q,3,"}"),q.braceNest--,q.braceNest>0&&S(U),q.inLinked&&q.braceNest===0&&(q.inLinked=!1),J;case"@":return q.braceNest>0&&d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),J=oe(U,q)||m(q),q.braceNest=0,J;default:{let ge=!0,Me=!0,le=!0;if(I(U))return q.braceNest>0&&d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),J=h(q,1,D(U)),q.braceNest=0,q.inLinked=!1,J;if(q.braceNest>0&&(q.currentType===4||q.currentType===5||q.currentType===6))return d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),q.braceNest=0,te(U,q);if(ge=v(U,q))return J=h(q,4,Pe(U)),S(U),J;if(Me=g(U,q))return J=h(q,5,We(U)),S(U),J;if(le=k(U,q))return J=h(q,6,me(U)),S(U),J;if(!ge&&!Me&&!le)return J=h(q,12,K(U)),d(Yt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,J.value),S(U),J;break}}return J}function oe(U,q){const{currentType:J}=q;let de=null;const ge=U.currentChar();switch((J===7||J===8||J===11||J===9)&&(ge===us||ge===Qo)&&d(Yt.INVALID_LINKED_FORMAT,i(),0),ge){case"@":return U.next(),de=h(q,7,"@"),q.inLinked=!0,de;case".":return S(U),U.next(),h(q,8,".");case":":return S(U),U.next(),h(q,9,":");default:return I(U)?(de=h(q,1,D(U)),q.braceNest=0,q.inLinked=!1,de):$(U,q)||w(U,q)?(S(U),oe(U,q)):A(U,q)?(S(U),h(q,11,Z(U))):x(U,q)?(S(U),ge==="{"?X(U,q)||de:h(q,10,pe(U))):(J===7&&d(Yt.INVALID_LINKED_FORMAT,i(),0),q.braceNest=0,q.inLinked=!1,te(U,q))}}function te(U,q){let J={type:13};if(q.braceNest>0)return X(U,q)||m(q);if(q.inLinked)return oe(U,q)||m(q);switch(U.currentChar()){case"{":return X(U,q)||m(q);case"}":return d(Yt.UNBALANCED_CLOSING_BRACE,i(),0),U.next(),h(q,3,"}");case"@":return oe(U,q)||m(q);default:{if(I(U))return J=h(q,1,D(U)),q.braceNest=0,q.inLinked=!1,J;if(L(U))return h(q,0,Te(U));break}}return J}function ue(){const{currentType:U,offset:q,startLoc:J,endLoc:de}=a;return a.lastType=U,a.lastOffset=q,a.lastStartLoc=J,a.lastEndLoc=de,a.offset=o(),a.startLoc=i(),s.currentChar()===ki?h(a,13):te(s,a)}return{nextToken:ue,currentOffset:o,currentPosition:i,context:c}}const lE="parser",aE=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,cE=/\\([\\@{}|])/g;function uE(e,t){return t}function dE(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function fE(e={}){const t=e.location!==!1,{onError:n}=e;function s(_,b,v,g,...k){const $=_.currentPosition();if($.offset+=g,$.column+=g,n){const A=t?Gm(v,$):null,w=Kf(b,A,{domain:lE,args:k});n(w)}}function o(_,b,v){const g={type:_};return t&&(g.start=b,g.end=b,g.loc={start:v,end:v}),g}function i(_,b,v,g){t&&(_.end=b,_.loc&&(_.loc.end=v))}function r(_,b){const v=_.context(),g=o(3,v.offset,v.startLoc);return g.value=b.replace(cE,uE),i(g,_.currentOffset(),_.currentPosition()),g}function l(_,b){const v=_.context(),{lastOffset:g,lastStartLoc:k}=v,$=o(5,g,k);return $.index=parseInt(b,10),_.nextToken(),i($,_.currentOffset(),_.currentPosition()),$}function a(_,b){const v=_.context(),{lastOffset:g,lastStartLoc:k}=v,$=o(4,g,k);return $.key=b,_.nextToken(),i($,_.currentOffset(),_.currentPosition()),$}function c(_,b){const v=_.context(),{lastOffset:g,lastStartLoc:k}=v,$=o(9,g,k);return $.value=b.replace(aE,dE),_.nextToken(),i($,_.currentOffset(),_.currentPosition()),$}function u(_){const b=_.nextToken(),v=_.context(),{lastOffset:g,lastStartLoc:k}=v,$=o(8,g,k);return b.type!==11?(s(_,Yt.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),$.value="",i($,g,k),{nextConsumeToken:b,node:$}):(b.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Jo(b)),$.value=b.value||"",i($,_.currentOffset(),_.currentPosition()),{node:$})}function d(_,b){const v=_.context(),g=o(7,v.offset,v.startLoc);return g.value=b,i(g,_.currentOffset(),_.currentPosition()),g}function h(_){const b=_.context(),v=o(6,b.offset,b.startLoc);let g=_.nextToken();if(g.type===8){const k=u(_);v.modifier=k.node,g=k.nextConsumeToken||_.nextToken()}switch(g.type!==9&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(g)),g=_.nextToken(),g.type===2&&(g=_.nextToken()),g.type){case 10:g.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(g)),v.key=d(_,g.value||"");break;case 4:g.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(g)),v.key=a(_,g.value||"");break;case 5:g.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(g)),v.key=l(_,g.value||"");break;case 6:g.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(g)),v.key=c(_,g.value||"");break;default:{s(_,Yt.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const k=_.context(),$=o(7,k.offset,k.startLoc);return $.value="",i($,k.offset,k.startLoc),v.key=$,i(v,k.offset,k.startLoc),{nextConsumeToken:g,node:v}}}return i(v,_.currentOffset(),_.currentPosition()),{node:v}}function m(_){const b=_.context(),v=b.currentType===1?_.currentOffset():b.offset,g=b.currentType===1?b.endLoc:b.startLoc,k=o(2,v,g);k.items=[];let $=null;do{const x=$||_.nextToken();switch($=null,x.type){case 0:x.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(x)),k.items.push(r(_,x.value||""));break;case 5:x.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(x)),k.items.push(l(_,x.value||""));break;case 4:x.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(x)),k.items.push(a(_,x.value||""));break;case 6:x.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Jo(x)),k.items.push(c(_,x.value||""));break;case 7:{const I=h(_);k.items.push(I.node),$=I.nextConsumeToken||null;break}}}while(b.currentType!==13&&b.currentType!==1);const A=b.currentType===1?b.lastOffset:_.currentOffset(),w=b.currentType===1?b.lastEndLoc:_.currentPosition();return i(k,A,w),k}function f(_,b,v,g){const k=_.context();let $=g.items.length===0;const A=o(1,b,v);A.cases=[],A.cases.push(g);do{const w=m(_);$||($=w.items.length===0),A.cases.push(w)}while(k.currentType!==13);return $&&s(_,Yt.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(A,_.currentOffset(),_.currentPosition()),A}function y(_){const b=_.context(),{offset:v,startLoc:g}=b,k=m(_);return b.currentType===13?k:f(_,v,g,k)}function S(_){const b=rE(_,Hn({},e)),v=b.context(),g=o(0,v.offset,v.startLoc);return t&&g.loc&&(g.loc.source=_),g.body=y(b),e.onCacheKey&&(g.cacheKey=e.onCacheKey(_)),v.currentType!==13&&s(b,Yt.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,_[v.offset]||""),i(g,b.currentOffset(),b.currentPosition()),g}return{parse:S}}function Jo(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function hE(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function My(e,t){for(let n=0;n<e.length;n++)m1(e[n],t)}function m1(e,t){switch(e.type){case 1:My(e.cases,t),t.helper("plural");break;case 2:My(e.items,t);break;case 6:{m1(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 pE(e,t={}){const n=hE(e);n.helper("normalize"),e.body&&m1(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function mE(e){const t=e.body;return t.type===2?Ay(t):t.cases.forEach(n=>Ay(n)),e}function Ay(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=p1(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function Bl(e){switch(e.t=e.type,e.type){case 0:{const t=e;Bl(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)Bl(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)Bl(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Bl(t.key),t.k=t.key,delete t.key,t.modifier&&(Bl(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 gE(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(y,S){r.code+=y}function c(y,S=!0){const _=S?s:"";a(o?_+" ".repeat(y):_)}function u(y=!0){const S=++r.indentLevel;y&&c(S)}function d(y=!0){const S=--r.indentLevel;y&&c(S)}function h(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:h,helper:y=>`_${y}`,needIndent:()=>r.needIndent}}function vE(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),ua(e,t.key),t.modifier?(e.push(", "),ua(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function yE(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(ua(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function kE(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(ua(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function bE(e,t){t.body?ua(e,t.body):e.push("null")}function ua(e,t){const{helper:n}=e;switch(t.type){case 0:bE(e,t);break;case 1:kE(e,t);break;case 2:yE(e,t);break;case 6:vE(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 _E=(e,t={})=>{const n=rt(t.mode)?t.mode:"normal",s=rt(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=gE(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${p1(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),ua(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 wE(e,t={}){const n=Hn({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=fE(n).parse(e);return s?(i&&mE(l),o&&Bl(l),{ast:l,code:""}):(pE(l,n),_E(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function SE(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Yr().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Yr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function ri(e){return Wt(e)&&g1(e)===0&&(Io(e,"b")||Io(e,"body"))}const oS=["b","body"];function CE(e){return Sr(e,oS)}const iS=["c","cases"];function xE(e){return Sr(e,iS,[])}const rS=["s","static"];function TE(e){return Sr(e,rS)}const lS=["i","items"];function ME(e){return Sr(e,lS,[])}const aS=["t","type"];function g1(e){return Sr(e,aS)}const cS=["v","value"];function Hu(e,t){const n=Sr(e,cS);if(n!=null)return n;throw $c(t)}const uS=["m","modifier"];function AE(e){return Sr(e,uS)}const dS=["k","key"];function EE(e){const t=Sr(e,dS);if(t)return t;throw $c(6)}function Sr(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(Io(e,o)&&e[o]!=null)return e[o]}return n}const fS=[...oS,...iS,...rS,...lS,...dS,...uS,...cS,...aS];function $c(e){return new Error(`unhandled node type: ${e}`)}function Np(e){return n=>IE(n,e)}function IE(e,t){const n=CE(t);if(n==null)throw $c(0);if(g1(n)===1){const i=xE(n);return e.plural(i.reduce((r,l)=>[...r,Ey(e,l)],[]))}else return Ey(e,n)}function Ey(e,t){const n=TE(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=ME(t).reduce((o,i)=>[...o,Ym(e,i)],[]);return e.normalize(s)}}function Ym(e,t){const n=g1(t);switch(n){case 3:return Hu(t,n);case 9:return Hu(t,n);case 4:{const s=t;if(Io(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(Io(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw $c(n)}case 5:{const s=t;if(Io(s,"i")&&Bn(s.i))return e.interpolate(e.list(s.i));if(Io(s,"index")&&Bn(s.index))return e.interpolate(e.list(s.index));throw $c(n)}case 6:{const s=t,o=AE(s),i=EE(s);return e.linked(Ym(e,i),o?Ym(e,o):void 0,e.type)}case 7:return Hu(t,n);case 8:return Hu(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const $E=e=>e;let Wu=nn();function NE(e,t={}){let n=!1;const s=t.onError||J4;return t.onError=o=>{n=!0,s(o)},{...wE(e,t),detectError:n}}function LE(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&rt(e)){Ht(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||$E)(e),o=Wu[s];if(o)return o;const{ast:i,detectError:r}=NE(e,{...t,location:!1,jit:!0}),l=Np(i);return r?l:Wu[s]=l}else{const n=e.cacheKey;if(n){const s=Wu[n];return s||(Wu[n]=Np(e))}else return Np(e)}}let Nc=null;function OE(e){Nc=e}function PE(e,t,n){Nc&&Nc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const RE=DE("function:translate");function DE(e){return t=>Nc&&Nc.emit(e,t)}const Ti={INVALID_ARGUMENT:Q4,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},BE=24;function Mi(e){return Kf(e,null,void 0)}function v1(e,t){return t.locale!=null?Iy(t.locale):Iy(e.locale)}let Lp;function Iy(e){if(rt(e))return e;if(mn(e)){if(e.resolvedOnce&&Lp!=null)return Lp;if(e.constructor.name==="Function"){const t=e();if(Y4(t))throw Mi(Ti.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Lp=t}else throw Mi(Ti.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Mi(Ti.NOT_SUPPORT_LOCALE_TYPE)}function FE(e,t,n){return[...new Set([n,...Cn(t)?t:Wt(t)?Object.keys(t):rt(t)?[t]:[n]])]}function Xm(e,t,n){const s=rt(n)?n:Lc,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;Cn(r);)r=$y(i,r,t);const l=Cn(t)||!Nt(t)?t:t.default?t.default:null;r=rt(l)?[l]:l,Cn(r)&&$y(i,r,!1),o.__localeChainCache.set(s,i)}return i}function $y(e,t,n){let s=!0;for(let o=0;o<t.length&&Ht(s);o++){const i=t[o];rt(i)&&(s=HE(e,t[o],n))}return s}function HE(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=WE(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function WE(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(Cn(n)||Nt(n))&&n[o]&&(s=n[o])}return s}const Cr=[];Cr[0]={w:[0],i:[3,0],"[":[4],o:[7]};Cr[1]={w:[1],".":[2],"[":[4],o:[7]};Cr[2]={w:[2],i:[3,0],0:[3,0]};Cr[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Cr[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Cr[5]={"'":[4,0],o:8,l:[5,0]};Cr[6]={'"':[4,0],o:8,l:[6,0]};const UE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function qE(e){return UE.test(e)}function jE(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 zE(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 VE(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:qE(t)?jE(t):"*"+t}function KE(e){const t=[];let n=-1,s=0,o=0,i,r,l,a,c,u,d;const h=[];h[0]=()=>{r===void 0?r=l:r+=l},h[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},h[2]=()=>{h[0](),o++},h[3]=()=>{if(o>0)o--,s=4,h[0]();else{if(o=0,r===void 0||(r=VE(r),r===!1))return!1;h[1]()}};function m(){const f=e[n+1];if(s===5&&f==="'"||s===6&&f==='"')return n++,l="\\"+f,h[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&m())){if(a=zE(i),d=Cr[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=h[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const Ny=new Map;function GE(e,t){return Wt(e)?e[t]:null}function YE(e,t){if(!Wt(e))return null;let n=Ny.get(t);if(n||(n=KE(t),n&&Ny.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(fS.includes(r)&&ri(o)||!Wt(o)||!Io(o,r))return null;const l=o[r];if(l===void 0||mn(o))return null;o=l,i++}return o}const XE="11.4.5",Gf=-1,Lc="en-US",Yd="",Ly=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function ZE(){return{upper:(e,t)=>t==="text"&&rt(e)?e.toUpperCase():t==="vnode"&&Wt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&rt(e)?e.toLowerCase():t==="vnode"&&Wt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&rt(e)?Ly(e):t==="vnode"&&Wt(e)&&"__v_isVNode"in e?Ly(e.children):e}}let hS;function QE(e){hS=e}let pS;function JE(e){pS=e}let mS;function e6(e){mS=e}let gS=null;const t6=e=>{gS=e},n6=()=>gS;let vS=null;const Oy=e=>{vS=e},s6=()=>vS;let Py=0;function o6(e={}){const t=mn(e.onWarn)?e.onWarn:F4,n=rt(e.version)?e.version:XE,s=rt(e.locale)||mn(e.locale)?e.locale:Lc,o=mn(s)?Lc:s,i=Cn(e.fallbackLocale)||Nt(e.fallbackLocale)||rt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Nt(e.messages)?e.messages:Op(o),l=Nt(e.datetimeFormats)?e.datetimeFormats:Op(o),a=Nt(e.numberFormats)?e.numberFormats:Op(o),c=Hn(nn(),e.modifiers,ZE()),u=e.pluralRules||nn(),d=mn(e.missing)?e.missing:null,h=Ht(e.missingWarn)||ca(e.missingWarn)?e.missingWarn:!0,m=Ht(e.fallbackWarn)||ca(e.fallbackWarn)?e.fallbackWarn:!0,f=!!e.fallbackFormat,y=!!e.unresolving,S=mn(e.postTranslation)?e.postTranslation:null,_=Nt(e.processor)?e.processor:null,b=Ht(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,g=mn(e.messageCompiler)?e.messageCompiler:hS,k=mn(e.messageResolver)?e.messageResolver:pS||GE,$=mn(e.localeFallbacker)?e.localeFallbacker:mS||FE,A=Wt(e.fallbackContext)?e.fallbackContext:void 0,w=e,x=Wt(w.__datetimeFormatters)?w.__datetimeFormatters:new Map,I=Wt(w.__numberFormatters)?w.__numberFormatters:new Map,L=Wt(w.__meta)?w.__meta:{};Py++;const O={version:n,cid:Py,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:h,fallbackWarn:m,fallbackFormat:f,unresolving:y,postTranslation:S,processor:_,warnHtmlMessage:b,escapeParameter:v,messageCompiler:g,messageResolver:k,localeFallbacker:$,fallbackContext:A,onWarn:t,__meta:L};return O.datetimeFormats=l,O.numberFormats=a,O.__datetimeFormatters=x,O.__numberFormatters=I,__INTLIFY_PROD_DEVTOOLS__&&PE(O,n,L),O}const Op=e=>({[e]:nn()});function y1(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return rt(l)?l:t}else return t}function za(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function i6(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function r6(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(i6(e,t[s]))return!0;return!1}function Ry(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!rt(t[0])&&!nS(t[0])&&!Bn(t[0]))return Yd;const[a,c,u,d]=Zm(...t),h=Ht(u.missingWarn)?u.missingWarn:e.missingWarn;Ht(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=v1(e,u),y=r(e,o,f);if(!rt(a)||a===""){const $=new Intl.DateTimeFormat(f.replace(/!/g,""),d);return m?$.formatToParts(c):$.format(c)}let S={},_,b=null;const v="datetime format";for(let $=0;$<y.length&&(_=y[$],S=n[_]||{},b=S[a],!Nt(b));$++)y1(e,a,_,h,v);if(!Nt(b)||!rt(_))return s?Gf:a;let g=`${_}__${a}`;Vf(d)||(g=`${g}__${JSON.stringify(d)}`);let k=l.get(g);return k||(k=new Intl.DateTimeFormat(_,Hn({},b,d)),l.set(g,k)),m?k.formatToParts(c):k.format(c)}const yS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Zm(...e){const[t,n,s,o]=e,i=nn();let r=nn(),l;if(rt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Mi(Ti.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw Mi(Ti.INVALID_ISO_DATE_ARGUMENT)}}else if(nS(t)){if(isNaN(t.getTime()))throw Mi(Ti.INVALID_DATE_ARGUMENT);l=t}else if(Bn(t))l=t;else throw Mi(Ti.INVALID_ARGUMENT);return rt(n)?i.key=n:Nt(n)&&Object.keys(n).forEach(a=>{yS.includes(a)?r[a]=n[a]:i[a]=n[a]}),rt(s)?i.locale=s:Nt(s)&&(r=s),Nt(o)&&(r=o),[i.key||"",l,i,r]}function Dy(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function By(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Bn(t[0]))return Yd;const[a,c,u,d]=Qm(...t),h=Ht(u.missingWarn)?u.missingWarn:e.missingWarn;Ht(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=v1(e,u),y=r(e,o,f);if(!rt(a)||a===""){const $=new Intl.NumberFormat(f.replace(/!/g,""),d);return m?$.formatToParts(c):$.format(c)}let S={},_,b=null;const v="number format";for(let $=0;$<y.length&&(_=y[$],S=n[_]||{},b=S[a],!Nt(b));$++)y1(e,a,_,h,v);if(!Nt(b)||!rt(_))return s?Gf:a;let g=`${_}__${a}`;Vf(d)||(g=`${g}__${JSON.stringify(d)}`);let k=l.get(g);return k||(k=new Intl.NumberFormat(_,Hn({},b,d)),l.set(g,k)),m?k.formatToParts(c):k.format(c)}const kS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Qm(...e){const[t,n,s,o]=e,i=nn();let r=nn();if(!Bn(t))throw Mi(Ti.INVALID_ARGUMENT);const l=t;return rt(n)?i.key=n:Nt(n)&&Object.keys(n).forEach(a=>{kS.includes(a)?r[a]=n[a]:i[a]=n[a]}),rt(s)?i.locale=s:Nt(s)&&(r=s),Nt(o)&&(r=o),[i.key||"",l,i,r]}function Fy(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const l6=e=>e,a6=e=>"",c6="text",u6=e=>e.length===0?"":p1(e),d6=X4;function Pp(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function f6(e){const t=Bn(e.pluralIndex)?e.pluralIndex:-1;return Bn(e.named?.count)?e.named.count:Bn(e.named?.n)?e.named.n:t}function h6(e={}){const t=e.locale,n=f6(e),s=rt(t)&&mn(e.pluralRules?.[t])?e.pluralRules[t]:Pp,o=s===Pp?void 0:Pp,i=_=>_[s(n,_.length,o)],r=e.list||[],l=_=>r[_],a=e.named||nn();Bn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=_=>a[_];function u(_,b){const v=mn(e.messages)?e.messages(_,!!b):Wt(e.messages)?e.messages[_]:!1;return v||(e.parent?e.parent.message(_):a6)}const d=_=>e.modifiers?e.modifiers[_]:l6,h=mn(e.processor?.normalize)?e.processor.normalize:u6,m=mn(e.processor?.interpolate)?e.processor.interpolate:d6,f=rt(e.processor?.type)?e.processor.type:c6,S={list:l,named:c,plural:i,linked:(_,...b)=>{const[v,g]=b;let k="text",$="";b.length===1?Wt(v)?($=v.modifier||$,k=v.type||k):rt(v)&&($=v||$):b.length===2&&(rt(v)&&($=v||$),rt(g)&&(k=g||k));const A=u(_,!0)(S),w=A===""||A===void 0?_:A,x=k==="vnode"&&Cn(w)&&$?w[0]:w;return $?d($)(x,k):x},message:u,type:f,interpolate:m,normalize:h,values:Hn(nn(),r,a)};return S}const Hy=()=>"",To=e=>mn(e);function Wy(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Jm(...t),u=Ht(c.missingWarn)?c.missingWarn:e.missingWarn,d=Ht(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,h=Ht(c.escapeParameter)?c.escapeParameter:e.escapeParameter,m=!!c.resolvedMessage,f=rt(c.default)||Ht(c.default)?Ht(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,y=n||f!=null&&(rt(f)||mn(f)),S=v1(e,c);h&&p6(c);let[_,b,v]=m?[a,S,l[S]||nn()]:bS(e,a,S,r,d,u),g=_,k=a;if(!m&&!(rt(g)||ri(g)||To(g))&&y&&(g=f,k=g),!m&&(!(rt(g)||ri(g)||To(g))||!rt(b)))return o?Gf:a;let $=!1;const A=()=>{$=!0},w=To(g)?g:_S(e,a,b,g,k,A);if($)return g;const x=v6(e,b,v,c),I=h6(x),L=m6(e,w,I);let O=s?s(L,a):L;if(h&&rt(O)&&(O=K4(O)),__INTLIFY_PROD_DEVTOOLS__){const P={timestamp:Date.now(),key:rt(a)?a:To(g)?g.key:"",locale:b||(To(g)?g.locale:""),format:rt(g)?g:To(g)?g.source:"",message:O};P.meta=Hn({},e.__meta,n6()||{}),RE(P)}return O}function p6(e){Cn(e.list)?e.list=e.list.map(t=>rt(t)?Cy(t):t):Wt(e.named)&&Object.keys(e.named).forEach(t=>{rt(e.named[t])&&(e.named[t]=Cy(e.named[t]))})}function bS(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=nn(),h,m=null;const f="translate";for(let y=0;y<u.length&&(h=u[y],d=r[h]||nn(),(m=a(d,t))===null&&(m=d[t]),!(rt(m)||ri(m)||To(m)));y++)if(!r6(h,u)){const S=y1(e,t,h,i,f);S!==t&&(m=S)}return[m,h,d]}function _S(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(To(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,g6(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function m6(e,t,n){return t(n)}function Jm(...e){const[t,n,s]=e,o=nn();if(!rt(t)&&!Bn(t)&&!To(t)&&!ri(t))throw Mi(Ti.INVALID_ARGUMENT);const i=Bn(t)?String(t):(To(t),t);return Bn(n)?o.plural=n:rt(n)?o.default=n:Nt(n)&&!Vf(n)?o.named=n:Cn(n)&&(o.list=n),Bn(s)?o.plural=s:rt(s)?o.default=s:Nt(s)&&Hn(o,s),[i,o]}function g6(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>H4(t,n,r)}}function v6(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,h={locale:t,modifiers:o,pluralRules:i,messages:(m,f)=>{let y=r(n,m);if(y==null&&(u||f)){const[S,,_]=bS(u||e,m,t,l,a,c);y=S??r(_,m)}if(rt(y)||ri(y)){let S=!1;const b=_S(e,m,t,y,m,()=>{S=!0});return S?Hy:b}else return To(y)?y:Hy}};return e.processor&&(h.processor=e.processor),s.list&&(h.list=s.list),s.named&&(h.named=s.named),Bn(s.plural)&&(h.pluralIndex=s.plural),h}SE();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const y6="11.4.5";function k6(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Yr().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Yr().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Yr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Yr().__INTLIFY_PROD_DEVTOOLS__=!1)}const xs={UNEXPECTED_RETURN_TYPE:BE,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 Bs(e,...t){return Kf(e,null,void 0)}const eg=wr("__translateVNode"),tg=wr("__datetimeParts"),ng=wr("__numberParts"),wS=wr("__setPluralRules"),SS=wr("__injectWithOption"),Wl=wr("__dispose");function Oc(e){if(!Wt(e)||ri(e))return e;for(const t in e)if(Io(e,t))if(!t.includes("."))Wt(e[t])&&Oc(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=nn()),!Wt(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(ri(o)?fS.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!ri(o)){const r=o[n[s]];Wt(r)&&Oc(r)}}return e}function k1(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Nt(n)?n:Cn(s)?nn():{[e]:nn()};if(Cn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||nn(),dd(c,r[a])):dd(c,r)}else rt(l)&&dd(JSON.parse(l),r)}),o==null&&i)for(const l in r)Io(r,l)&&Oc(r[l]);return r}function CS(e){return e.type}function xS(e,t,n){let s=Wt(t.messages)?t.messages:nn();"__i18nGlobal"in n&&(s=k1(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(Wt(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Wt(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Uy(e){return kt(ur,null,e,0)}function Pc(){return ys()}const qy="__INTLIFY_META__",jy=()=>[],b6=()=>!1;let zy=0;function Vy(e){return((t,n,s,o)=>e(n,s,Pc()||void 0,o))}const _6=()=>{const e=Pc();let t=null;return e&&(t=CS(e)[qy])?{[qy]:t}:null};function Xd(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=Gd?se:ll;let r=Ht(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:rt(e.locale)?e.locale:Lc),a=i(t&&r?t.fallbackLocale.value:rt(e.fallbackLocale)||Cn(e.fallbackLocale)||Nt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(k1(l.value,e)),u=i(Nt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Nt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let h=t?t.missingWarn:Ht(e.missingWarn)||ca(e.missingWarn)?e.missingWarn:!0,m=t?t.fallbackWarn:Ht(e.fallbackWarn)||ca(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:Ht(e.fallbackRoot)?e.fallbackRoot:!0,y=!!e.fallbackFormat,S=mn(e.missing)?e.missing:null,_=mn(e.missing)?Vy(e.missing):null,b=mn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:Ht(e.warnHtmlMessage)?e.warnHtmlMessage:!0,g=!!e.escapeParameter;const k=t?t.modifiers:Nt(e.modifiers)?e.modifiers:{};let $=e.pluralRules||t&&t.pluralRules,A;A=(()=>{s&&Oy(null);const le={version:y6,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:k,pluralRules:$,missing:_===null?void 0:_,missingWarn:h,fallbackWarn:m,fallbackFormat:y,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:v,escapeParameter:g,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};le.datetimeFormats=u.value,le.numberFormats=d.value,le.__datetimeFormatters=Nt(A)?A.__datetimeFormatters:void 0,le.__numberFormatters=Nt(A)?A.__numberFormatters:void 0;const _e=o6(le);return s&&Oy(_e),_e})(),za(A,l.value,a.value);function x(){return[l.value,a.value,c.value,u.value,d.value]}const I=j({get:()=>l.value,set:le=>{A.locale=le,l.value=le}}),L=j({get:()=>a.value,set:le=>{A.fallbackLocale=le,a.value=le,za(A,l.value,le)}}),O=j(()=>c.value),P=j(()=>u.value),B=j(()=>d.value);function R(){return mn(b)?b:null}function W(le){b=le,A.postTranslation=le}function V(){return S}function z(le){le!==null&&(_=Vy(le)),S=le,A.missing=_}const ie=(le,_e,ze,Xe,ot,Ye)=>{x();let mt;try{__INTLIFY_PROD_DEVTOOLS__,s||(A.fallbackContext=t?s6():void 0),mt=le(A)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(A.fallbackContext=void 0)}if(ze!=="translate exists"&&Bn(mt)&&mt===Gf||ze==="translate exists"&&!mt){const[It,Mt]=_e();return t&&f?Xe(t):ot(It)}else{if(Ye(mt))return mt;throw Bs(xs.UNEXPECTED_RETURN_TYPE)}};function ae(...le){return ie(_e=>Reflect.apply(Wy,null,[_e,...le]),()=>Jm(...le),"translate",_e=>Reflect.apply(_e.t,_e,[...le]),_e=>_e,_e=>rt(_e))}function re(...le){const[_e,ze,Xe]=le;if(Xe&&!Wt(Xe))throw Bs(xs.INVALID_ARGUMENT);return ae(_e,ze,Hn({resolvedMessage:!0},Xe||{}))}function Te(...le){return ie(_e=>Reflect.apply(Ry,null,[_e,...le]),()=>Zm(...le),"datetime format",_e=>Reflect.apply(_e.d,_e,[...le]),()=>Yd,_e=>rt(_e)||Cn(_e))}function Pe(...le){return ie(_e=>Reflect.apply(By,null,[_e,...le]),()=>Qm(...le),"number format",_e=>Reflect.apply(_e.n,_e,[...le]),()=>Yd,_e=>rt(_e)||Cn(_e))}function We(le){return le.map(_e=>rt(_e)||Bn(_e)||Ht(_e)?Uy(String(_e)):_e)}const me={normalize:We,interpolate:le=>le,type:"vnode"};function be(...le){return ie(_e=>{let ze;const Xe=_e;try{Xe.processor=me,ze=Reflect.apply(Wy,null,[Xe,...le])}finally{Xe.processor=null}return ze},()=>Jm(...le),"translate",_e=>_e[eg](...le),_e=>[Uy(_e)],_e=>Cn(_e))}function Se(...le){return ie(_e=>Reflect.apply(By,null,[_e,...le]),()=>Qm(...le),"number format",_e=>_e[ng](...le),jy,_e=>rt(_e)||Cn(_e))}function fe(...le){return ie(_e=>Reflect.apply(Ry,null,[_e,...le]),()=>Zm(...le),"datetime format",_e=>_e[tg](...le),jy,_e=>rt(_e)||Cn(_e))}function K(le){$=le,A.pluralRules=$}function Z(le,_e){return ie(()=>{if(!le)return!1;const ze=rt(_e)?_e:l.value,Xe=rt(_e)?[ze]:Xm(A,a.value,ze);for(let ot=0;ot<Xe.length;ot++){const Ye=X(Xe[ot]);let mt=A.messageResolver(Ye,le);if(mt===null&&(mt=Ye[le]),ri(mt)||To(mt)||rt(mt))return!0}return!1},()=>[le],"translate exists",ze=>Reflect.apply(ze.te,ze,[le,_e]),b6,ze=>Ht(ze))}function pe(le){let _e=null;const ze=Xm(A,a.value,l.value);for(let Xe=0;Xe<ze.length;Xe++){const ot=c.value[ze[Xe]]||{},Ye=A.messageResolver(ot,le);if(Ye!=null){_e=Ye;break}}return _e}function D(le){const _e=pe(le);return _e??(t?t.tm(le)||{}:{})}function X(le){return c.value[le]||{}}function oe(le,_e){if(o){const ze={[le]:_e};for(const Xe in ze)Io(ze,Xe)&&Oc(ze[Xe]);_e=ze[le]}c.value[le]=_e,A.messages=c.value}function te(le,_e){c.value[le]=c.value[le]||{};const ze={[le]:_e};if(o)for(const Xe in ze)Io(ze,Xe)&&Oc(ze[Xe]);_e=ze[le],dd(_e,c.value[le]),A.messages=c.value}function ue(le){return u.value[le]||{}}function U(le,_e){u.value[le]=_e,A.datetimeFormats=u.value,Dy(A,le,_e)}function q(le,_e){u.value[le]=Hn(u.value[le]||{},_e),A.datetimeFormats=u.value,Dy(A,le,_e)}function J(le){return d.value[le]||{}}function de(le,_e){d.value[le]=_e,A.numberFormats=d.value,Fy(A,le,_e)}function ge(le,_e){d.value[le]=Hn(d.value[le]||{},_e),A.numberFormats=d.value,Fy(A,le,_e)}zy++,t&&Gd&&(Ve(t.locale,le=>{r&&(l.value=le,A.locale=le,za(A,l.value,a.value))}),Ve(t.fallbackLocale,le=>{r&&(a.value=le,A.fallbackLocale=le,za(A,l.value,a.value))}));const Me={id:zy,locale:I,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(le){r=le,le&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,za(A,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:O,get modifiers(){return k},get pluralRules(){return $||{}},get isGlobal(){return s},get missingWarn(){return h},set missingWarn(le){h=le,A.missingWarn=h},get fallbackWarn(){return m},set fallbackWarn(le){m=le,A.fallbackWarn=m},get fallbackRoot(){return f},set fallbackRoot(le){f=le},get fallbackFormat(){return y},set fallbackFormat(le){y=le,A.fallbackFormat=y},get warnHtmlMessage(){return v},set warnHtmlMessage(le){v=le,A.warnHtmlMessage=le},get escapeParameter(){return g},set escapeParameter(le){g=le,A.escapeParameter=le},t:ae,getLocaleMessage:X,setLocaleMessage:oe,mergeLocaleMessage:te,getPostTranslationHandler:R,setPostTranslationHandler:W,getMissingHandler:V,setMissingHandler:z,[wS]:K};return Me.datetimeFormats=P,Me.numberFormats=B,Me.rt=re,Me.te=Z,Me.tm=D,Me.d=Te,Me.n=Pe,Me.getDateTimeFormat=ue,Me.setDateTimeFormat=U,Me.mergeDateTimeFormat=q,Me.getNumberFormat=J,Me.setNumberFormat=de,Me.mergeNumberFormat=ge,Me[SS]=n,Me[eg]=be,Me[tg]=fe,Me[ng]=Se,Me}function w6(e){const t=rt(e.locale)?e.locale:Lc,n=rt(e.fallbackLocale)||Cn(e.fallbackLocale)||Nt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=mn(e.missing)?e.missing:void 0,o=Ht(e.silentTranslationWarn)||ca(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Ht(e.silentFallbackWarn)||ca(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Ht(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Nt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=mn(e.postTranslation)?e.postTranslation:void 0,d=rt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,m=Ht(e.sync)?e.sync:!0;let f=e.messages;if(Nt(e.sharedMessages)){const k=e.sharedMessages;f=Object.keys(k).reduce((A,w)=>{const x=A[w]||(A[w]={});return Hn(x,k[w]),A},f||{})}const{__i18n:y,__root:S,__injectWithOption:_}=e,b=e.datetimeFormats,v=e.numberFormats,g=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:g,datetimeFormats:b,numberFormats:v,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:m,__i18n:y,__root:S,__injectWithOption:_}}function sg(e={}){const t=Xd(w6(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Ht(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Ht(o)?!o:o},get silentFallbackWarn(){return Ht(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Ht(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function S6(e,t,n){return{beforeCreate(){const s=Pc();if(!s)throw Bs(xs.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=Ky(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=sg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Ky(e,o);else{this.$i18n=sg({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&xS(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=Pc();if(!s)throw Bs(xs.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function Ky(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[wS](t.pluralizationRules||e.pluralizationRules);const n=k1(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const b1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function C6({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Le?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},nn())}function TS(){return Le}const x6=Je({name:"i18n-t",props:Hn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Bn(e)||!isNaN(e)}},b1),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||xt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=nn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=rt(e.plural)?+e.plural:e.plural);const u=C6(t,a);return o[eg](e.keypath,u,c)},r=Hn(nn(),s),l=rt(e.tag)||Wt(e.tag)?e.tag:TS();return Wt(l)?Xt(l,r,{default:i}):Xt(l,r,i())}}}),Gy=x6;function T6(e){return Cn(e)&&!rt(e[0])}function MS(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=nn();e.locale&&(c.locale=e.locale),rt(e.format)?c.key=e.format:Wt(e.format)&&(rt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((m,f)=>n.includes(f)?Hn(nn(),m,{[f]:e.format[f]}):m,nn()));const d=s(e.value,c,u);let h=[c.key];return Cn(d)?h=d.map((m,f)=>{const y=o[m.type],S=y?y({[m.type]:m.value,index:f,parts:d}):[m.value];return T6(S)&&(S[0].key=`${m.type}-${f}`),S}):rt(d)&&(h=[d]),h},l=Hn(nn(),i),a=rt(e.tag)||Wt(e.tag)?e.tag:TS();return Wt(a)?Xt(a,l,{default:r}):Xt(a,l,r())}}const M6=Je({name:"i18n-n",props:Hn({value:{type:Number,required:!0},format:{type:[String,Object]}},b1),setup(e,t){const n=e.i18n||xt({useScope:e.scope,__useComponent:!0});return MS(e,t,kS,(...s)=>n[ng](...s))}}),Yy=M6;function A6(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function E6(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Bs(xs.UNEXPECTED_ERROR);const c=A6(e,l.$),u=Xy(a);return[Reflect.apply(c.t,c,[...Zy(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Gd&&(r.__i18nWatcher=Ve(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Gd&&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=Xy(l);r.textContent=Reflect.apply(a.t,a,[...Zy(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Xy(e){if(rt(e))return{path:e};if(Nt(e)){if(!("path"in e))throw Bs(xs.REQUIRED_VALUE,"path");return e}else throw Bs(xs.INVALID_VALUE)}function Zy(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return rt(n)&&(r.locale=n),Bn(o)&&(r.plural=o),Bn(i)&&(r.plural=i),[t,l,r]}function I6(e,t,...n){const s=Nt(n[0])?n[0]:{};(Ht(s.globalInstall)?s.globalInstall:!0)&&([Gy.name,"I18nT"].forEach(i=>e.component(i,Gy)),[Yy.name,"I18nN"].forEach(i=>e.component(i,Yy)),[ek.name,"I18nD"].forEach(i=>e.component(i,ek))),e.directive("t",E6(t))}const $6=wr("global-vue-i18n");function N6(e={}){const t=__VUE_I18N_LEGACY_API__&&Ht(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Ht(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=L6(e,t),r=wr("");function l(d){return s.get(d)||null}function a(d,h){s.set(d,h)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...h){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Nt(h[0])){const y=h[0];u.__composerExtend=y.__composerExtend,u.__vueI18nExtend=y.__vueI18nExtend}let m=null;!t&&n&&(m=H6(d,u.global)),__VUE_I18N_FULL_INSTALL__&&I6(d,u,...h),__VUE_I18N_LEGACY_API__&&t&&d.mixin(S6(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{m&&m(),u.dispose(),f()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function xt(e={}){const t=Pc();if(t==null)throw Bs(xs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Bs(xs.NOT_INSTALLED);const n=O6(t),s=R6(n),o=CS(t),i=P6(e,o);if(i==="global")return xS(s,e,o),s;if(i==="parent"){let a=Qy(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Bs(xs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Hn({},e),u=Qy(n,t);c.__root=u||s;const d=Xd(c);return a.__composerExtend&&(d[Wl]=a.__composerExtend(d)),Gg()&&Yg(()=>{const m=d[Wl];m&&(m(),delete d[Wl])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Hn({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=Xd(a),r.__composerExtend&&(l[Wl]=r.__composerExtend(l)),B6(r,t,l),r.__setInstance(t,l)}return l}function L6(e,t){const n=rM(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>sg(e)):n.run(()=>Xd(e));if(s==null)throw Bs(xs.UNEXPECTED_ERROR);return[n,s]}function O6(e){const t=Bt(e.isCE?$6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Bs(e.isCE?xs.NOT_INSTALLED_WITH_PROVIDE:xs.UNEXPECTED_ERROR);return t}function P6(e,t){return Vf(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function R6(e){return e.mode==="composition"?e.global:e.global.__composer}function Qy(e,t,n=!1){let s=null;const o=t.root;let i=D6(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[SS]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function D6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function B6(e,t,n){ln(()=>{},t),Ut(()=>{const s=n;e.__deleteInstance(t);const o=s[Wl];o&&(o(),delete s[Wl])},t)}const F6=["locale","fallbackLocale","availableLocales"],Jy=["t","rt","d","n","tm","te"];function H6(e,t){const n=Object.create(null);return F6.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Bs(xs.UNEXPECTED_ERROR);const r=Fn(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,Jy.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Bs(xs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Jy.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const W6=Je({name:"i18n-d",props:Hn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},b1),setup(e,t){const n=e.i18n||xt({useScope:e.scope,__useComponent:!0});return MS(e,t,yS,(...s)=>n[tg](...s))}}),ek=W6;k6();QE(LE);JE(YE);e6(Xm);if(__INTLIFY_PROD_DEVTOOLS__){const e=Yr();e.__INTLIFY__=!0,OE(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const U6={class:"row"},q6={class:"lead","aria-hidden":"true"},j6={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},z6={key:1,class:"unread-dot"},V6={class:"archive-label"},K6={class:"left"},G6=["onKeydown"],Y6={class:"ts"},X6=["title"],Z6={class:"tag-text"},Q6=["title"],J6={class:"tag-text"},eI=["title"],tI={class:"tag-text"},nI=["title"],sI=Je({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=xt(),o=e,i=n,r=se(!1),l=se(null),a=se(null);function c(x){const I=x.target;a.value?.contains(I)||l.value?.contains(I)||d()}function u(x){x.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}Ut(()=>document.removeEventListener("mousedown",c));const h=se(!1),m=se(""),f=se(null);async function y(){d(),h.value=!0,m.value=o.session.title,await gt();try{f.value?.focus(),f.value?.select()}catch{}}function S(){const x=m.value.trim();x&&i("rename",o.session.id,x),h.value=!1}function _(){h.value=!1}const b=se(!1);function v(){navigator.clipboard.writeText(o.session.id).then(()=>{b.value=!0,setTimeout(()=>{b.value=!1},1200)}).catch(()=>{})}function g(){d(),i("fork",o.session.id)}const k=se(!1);function $(){d(),k.value=!0}function A(){i("archive",o.session.id),k.value=!1}function w(){k.value=!1}return t({closeMenu:d,cancelArchive:w}),(x,I)=>(C(),E("div",{class:$e(["se",{on:e.active}]),onClick:I[5]||(I[5]=L=>i("select",e.session.id))},[p("div",U6,[p("span",q6,[e.session.busy?(C(),E("svg",j6,[...I[6]||(I[6]=[p("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),p("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(C(),E("span",z6)):ce("",!0)]),k.value?(C(),E("div",{key:0,class:"archive-confirm",onClick:I[0]||(I[0]=Ze(()=>{},["stop"]))},[p("span",V6,N(T(s)("sidebar.archiveConfirm")),1),p("button",{class:"btn-confirm",onClick:Ze(A,["stop"])},N(T(s)("sidebar.confirm")),1),p("button",{class:"btn-cancel",onClick:Ze(w,["stop"])},N(T(s)("sidebar.cancel")),1)])):(C(),E(Le,{key:1},[p("div",K6,[h.value?Lt((C(),E("input",{key:0,ref_key:"renameInputRef",ref:f,"onUpdate:modelValue":I[1]||(I[1]=L=>m.value=L),class:"rename-input",onClick:I[2]||(I[2]=Ze(()=>{},["stop"])),onKeydown:[Eo(Ze(S,["stop"]),["enter"]),Eo(Ze(_,["stop"]),["esc"])],onBlur:S},null,40,G6)),[[Tn,m.value]]):(C(),E("span",{key:1,class:"t",onDblclick:Ze(y,["stop"])},N(e.session.title),33))]),p("span",Y6,N(e.session.time),1),!h.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(C(),E("span",{key:0,class:"tag tag-ask",title:T(s)("workspace.awaitingAnswerTitle")},[p("span",Z6,N(T(s)("workspace.awaitingAnswer")),1)],8,X6)):ce("",!0),!h.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(C(),E("span",{key:1,class:"tag tag-approve",title:T(s)("workspace.awaitingPermissionTitle")},[p("span",J6,N(T(s)("workspace.awaitingPermission")),1)],8,Q6)):ce("",!0),!h.value&&e.session.status==="aborted"?(C(),E("span",{key:2,class:"tag tag-aborted",title:T(s)("workspace.abortedTitle")},[p("span",tI,N(T(s)("workspace.aborted")),1)],8,eI)):ce("",!0),h.value?ce("",!0):(C(),E("button",{key:3,ref_key:"kebabRef",ref:l,class:$e(["kebab",{open:r.value}]),title:T(s)("sidebar.options"),onClick:I[3]||(I[3]=Ze(L=>u(L),["stop"]))},[...I[7]||(I[7]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,nI))],64))]),r.value?(C(),E("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:I[4]||(I[4]=Ze(()=>{},["stop"]))},[p("button",{class:"menu-item copy-id",onClick:Ze(v,["stop"])},N(b.value?"已复制 ✓":"复制 Session ID ⧉"),1),I[8]||(I[8]=p("div",{class:"menu-divider"},null,-1)),p("button",{class:"menu-item",onClick:Ze(y,["stop"])},N(T(s)("sidebar.rename")),1),p("button",{class:"menu-item",onClick:Ze(g,["stop"])},N(T(s)("sidebar.fork")),1),p("button",{class:"menu-item archive",onClick:Ze($,["stop"])},N(T(s)("sidebar.archive")),1)],512)):ce("",!0)],2))}}),_t=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},tk=_t(sI,[["__scopeId","data-v-490f8224"]]),oI={class:"side"},iI={class:"ch"},rI={class:"ch-brand"},lI=["title","aria-label"],aI=["title","aria-label"],cI={class:"search"},uI=["placeholder","aria-label","onKeydown"],dI=["title","aria-label"],fI={class:"btn-wrap"},hI={key:0,class:"sessions"},pI={key:1,class:"empty"},mI={key:1,class:"sessions"},gI={key:0,class:"empty"},vI=["onClick","onContextmenu"],yI={class:"gh-top"},kI={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},bI={key:0,class:"gh-name"},_I=["title","aria-label","aria-expanded","onClick"],wI=["title","aria-label","onClick"],SI=["title"],CI={class:"group-sessions"},xI=["onClick"],TI={key:1,class:"group-empty"},Rp=10,MI=Je({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","selectWorkspaces","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=se(""),r=j(()=>i.value.trim()),l=j(()=>r.value.length>0),a=j(()=>{const U=r.value.toLowerCase();return U?s.sessions.filter(q=>{const J=(q.title??"").toLowerCase(),de=(q.lastPrompt??"").toLowerCase();return J.includes(U)||de.includes(U)}):[]});function c(){i.value=""}function u(U){c(),g(U)}const d=se(new Set);function h(U){return d.value.has(U)}function m(U){const q=new Set(d.value);if(q.has(U)){q.delete(U);const J=new Set(f.value);J.delete(U),f.value=J}else q.add(U);d.value=q}const f=se(new Set);function y(U){return f.value.has(U)}function S(U){const q=new Set(f.value);q.has(U)?q.delete(U):q.add(U),f.value=q}function _(U,q,J){if(q||U.length<=Rp)return U;const de=U.slice(0,Rp);if(J&&!de.some(ge=>ge.id===J)){const ge=U.find(Me=>Me.id===J);ge&&(de[Rp-1]=ge)}return de}const b=se(new Set);function v(U,q){if(q.shiftKey){q.stopPropagation();const J=new Set(b.value);J.has(U)?J.delete(U):J.add(U),b.value=J,o("selectWorkspaces",Array.from(J));return}b.value=new Set,o("selectWorkspaces",[]),m(U)}function g(U){b.value=new Set,o("selectWorkspaces",[]),o("select",U)}const k=se(null),$=se(""),A=se(null);function w(U,q){k.value=U,$.value=q,gt().then(()=>A.value?.focus())}function x(){const U=k.value,q=$.value.trim();U&&q&&o("renameWorkspace",U,q),k.value=null}function I(){k.value=null}const L=se(!1),O=se(null),P=se({}),B=se(null);function R(U){B.value&&!B.value.contains(U.target)&&V()}function W(U,q){if(q.shiftKey){q.stopPropagation();const J=new Set(b.value);J.has(U.id)?J.delete(U.id):J.add(U.id),b.value=J,o("selectWorkspaces",Array.from(J));return}q.preventDefault(),q.stopPropagation(),O.value=U,P.value={top:`${q.clientY}px`,left:`${q.clientX}px`},L.value=!0,document.addEventListener("mousedown",R,!0)}function V(){L.value=!1,document.removeEventListener("mousedown",R,!0),O.value=null,Pe()}function z(){O.value&&navigator.clipboard.writeText(O.value.root),V()}function ie(){O.value&&w(O.value.id,O.value.name),V()}function ae(){const U=O.value;U&&We(U.id)&&(o("deleteWorkspace",U.id),V())}const re=se(null);let Te;function Pe(){clearTimeout(Te),re.value=null}function We(U){return re.value===U?(Pe(),!0):(clearTimeout(Te),re.value=U,Te=setTimeout(()=>{re.value=null},2500),!1)}const Ne=se(null),me=se(null),be=se({}),Se=se(null);function fe(U){const q=U.target;q.closest(".gh-more")||q.closest(".ws-menu")||Z()}async function K(U,q){if(Ne.value===U.id){Z();return}const J=q.currentTarget;me.value=U,Ne.value=U.id,document.addEventListener("mousedown",fe),document.addEventListener("scroll",Z,!0),window.addEventListener("resize",Z),await gt();const de=Se.value,ge=J.getBoundingClientRect(),Me=4,le=8,_e=de?.offsetHeight??0,ze=de?.offsetWidth??0;let Xe=ge.bottom+Me;Xe+_e>window.innerHeight-le&&(Xe=Math.max(le,ge.top-_e-Me));let ot=ge.right-ze;ot<le&&(ot=le),be.value={top:`${Math.round(Xe)}px`,left:`${Math.round(ot)}px`}}function Z(){Ne.value=null,me.value=null,Pe(),document.removeEventListener("mousedown",fe),document.removeEventListener("scroll",Z,!0),window.removeEventListener("resize",Z)}function pe(U){navigator.clipboard.writeText(U.root),Z()}function D(U){w(U.id,U.name),Z()}function X(U){We(U.id)&&(o("deleteWorkspace",U.id),Z())}lo(()=>{document.removeEventListener("mousedown",R,!0),document.removeEventListener("mousedown",fe),document.removeEventListener("scroll",Z,!0),window.removeEventListener("resize",Z),clearTimeout(Te)});const oe=se(null);let te;function ue(){const U=oe.value;U&&(U.classList.remove("blink-now"),U.getBoundingClientRect(),U.classList.add("blink-now"),clearTimeout(te),te=setTimeout(()=>U.classList.remove("blink-now"),300))}return(U,q)=>(C(),E("aside",oI,[p("div",{class:"col",style:Dt({width:e.colWidth+"px"})},[p("div",iI,[p("div",rI,[(C(),E("svg",{ref_key:"logoRef",ref:oe,class:"ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:ue},[...q[20]||(q[20]=[gr('<defs data-v-94a6163e><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-94a6163e><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-94a6163e></rect><g class="ch-eyes" fill="#000" data-v-94a6163e><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-94a6163e></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-94a6163e></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-94a6163e></rect>',2)])],512)),q[21]||(q[21]=p("span",{class:"ch-name"},"Kimi Code",-1))]),p("button",{type:"button",class:"collapse-btn",title:T(n)("sidebar.collapseSidebar"),"aria-label":T(n)("sidebar.collapseSidebar"),onClick:q[0]||(q[0]=Ze(J=>o("collapse"),["stop"]))},[...q[22]||(q[22]=[gr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-94a6163e><path d="M11 6h9" data-v-94a6163e></path><path d="M11 12h9" data-v-94a6163e></path><path d="M11 18h9" data-v-94a6163e></path><path d="M7 9l-3 3 3 3" data-v-94a6163e></path></svg>',1)])],8,lI),p("button",{type:"button",class:"settings-btn",title:T(n)("settings.title"),"aria-label":T(n)("settings.title"),onClick:q[1]||(q[1]=Ze(J=>o("openSettings"),["stop"]))},[...q[23]||(q[23]=[p("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("circle",{cx:"12",cy:"12",r:"3"}),p("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 15 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z"})],-1)])],8,aI)]),p("div",cI,[q[25]||(q[25]=p("svg",{class:"search-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("circle",{cx:"7",cy:"7",r:"5"}),p("path",{d:"M11 11l3 3"})],-1)),Lt(p("input",{"onUpdate:modelValue":q[2]||(q[2]=J=>i.value=J),class:"search-input",type:"text",placeholder:T(n)("sidebar.searchPlaceholder"),"aria-label":T(n)("sidebar.searchPlaceholder"),onKeydown:Eo(Ze(c,["stop"]),["esc"])},null,40,uI),[[Tn,i.value]]),l.value?(C(),E("button",{key:0,type:"button",class:"search-clear",title:T(n)("sidebar.searchClear"),"aria-label":T(n)("sidebar.searchClear"),onClick:Ze(c,["stop"])},[...q[24]||(q[24]=[p("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,dI)):ce("",!0)]),p("div",fI,[p("button",{class:"btn-new-chat",onClick:q[3]||(q[3]=Ze(J=>o("create"),["stop"]))},[q[26]||(q[26]=p("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),p("span",null,N(T(n)("sidebar.newChat")),1)]),ce("",!0)]),l.value?(C(),E("div",hI,[a.value.length>0?(C(!0),E(Le,{key:0},Qe(a.value,J=>(C(),je(tk,{key:J.id,session:J,active:J.id===e.activeId,"approval-count":e.pendingBySession[J.id]?.approvals??0,"question-count":e.pendingBySession[J.id]?.questions??0,unread:e.unreadBySession[J.id]??!1,onSelect:q[5]||(q[5]=de=>u(de)),onRename:q[6]||(q[6]=(de,ge)=>o("rename",de,ge)),onArchive:q[7]||(q[7]=de=>o("archive",de)),onFork:q[8]||(q[8]=de=>o("fork",de))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(C(),E("div",pI,N(T(n)("sidebar.searchNoResults")),1))])):(C(),E("div",mI,[e.groups.length===0?(C(),E("div",gI,N(T(n)("workspace.noWorkspace")),1)):(C(!0),E(Le,{key:1},Qe(e.groups,J=>(C(),E("div",{key:J.workspace.id,class:"group"},[p("div",{class:$e(["gh",{on:J.workspace.id===e.activeWorkspaceId,sel:b.value.has(J.workspace.id)}]),onClick:Ze(de=>v(J.workspace.id,de),["stop"]),onContextmenu:de=>W(J.workspace,de)},[p("div",yI,[(C(),E("svg",kI,[h(J.workspace.id)?(C(),E(Le,{key:0},[q[28]||(q[28]=p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),q[29]||(q[29]=p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),E(Le,{key:1},[q[30]||(q[30]=p("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),q[31]||(q[31]=p("path",{d:"M1 5.5h12"},null,-1))],64))])),k.value!==J.workspace.id?(C(),E("span",bI,N(J.workspace.name),1)):Lt((C(),E("input",{key:1,ref_for:!0,ref_key:"renameInputRef",ref:A,"onUpdate:modelValue":q[9]||(q[9]=de=>$.value=de),class:"gh-rename",type:"text",onKeydown:[Eo(x,["enter"]),Eo(I,["esc"])],onBlur:I,onClick:q[10]||(q[10]=Ze(()=>{},["stop"]))},null,544)),[[Tn,$.value]]),p("button",{type:"button",class:$e(["gh-more",{open:Ne.value===J.workspace.id}]),title:T(n)("sidebar.options"),"aria-label":T(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Ne.value===J.workspace.id,onClick:Ze(de=>K(J.workspace,de),["stop"])},[...q[32]||(q[32]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,_I),p("button",{type:"button",class:"gh-add",title:T(n)("workspace.newInGroup"),"aria-label":T(n)("workspace.newInGroup"),onClick:Ze(de=>o("createInWorkspace",J.workspace.id),["stop"])},[...q[33]||(q[33]=[p("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M8 3v10M3 8h10"})],-1)])],8,wI)]),p("div",{class:"gh-path",title:J.workspace.root},N(J.workspace.shortPath||J.workspace.root),9,SI)],42,vI),Lt(p("div",CI,[(C(!0),E(Le,null,Qe(_(J.sessions,y(J.workspace.id),e.activeId),de=>(C(),je(tk,{key:de.id,session:de,active:de.id===e.activeId,"approval-count":e.pendingBySession[de.id]?.approvals??0,"question-count":e.pendingBySession[de.id]?.questions??0,unread:e.unreadBySession[de.id]??!1,onSelect:q[11]||(q[11]=ge=>g(ge)),onRename:q[12]||(q[12]=(ge,Me)=>o("rename",ge,Me)),onArchive:q[13]||(q[13]=ge=>o("archive",ge)),onFork:q[14]||(q[14]=ge=>o("fork",ge))},null,8,["session","active","approval-count","question-count","unread"]))),128)),!y(J.workspace.id)&&_(J.sessions,!1,e.activeId).length<J.sessions.length?(C(),E("button",{key:0,class:"show-more",onClick:Ze(de=>S(J.workspace.id),["stop"])},N(T(n)("sidebar.showMore",{count:J.sessions.length-_(J.sessions,!1,e.activeId).length})),9,xI)):ce("",!0),J.sessions.length===0?(C(),E("div",TI,N(T(n)("sidebar.noSessions")),1)):ce("",!0)],512),[[Uo,!h(J.workspace.id)]])]))),128))]))],4),L.value?(C(),E("div",{key:0,ref_key:"ghMenuRef",ref:B,class:"gh-menu",style:Dt(P.value),onClick:q[15]||(q[15]=Ze(()=>{},["stop"]))},[p("button",{type:"button",class:"ghm-item",onClick:z},N(T(n)("sidebar.copyPath")),1),p("button",{type:"button",class:"ghm-item",onClick:ie},N(T(n)("sidebar.rename")),1),p("button",{type:"button",class:"ghm-item del",onClick:ae},N(O.value&&re.value===O.value.id?T(n)("sidebar.confirm"):T(n)("sidebar.removeWorkspace")),1)],4)):ce("",!0),Ne.value!==null&&me.value?(C(),E("div",{key:1,ref_key:"wsMenuRef",ref:Se,class:"ws-menu",style:Dt(be.value),onClick:q[19]||(q[19]=Ze(()=>{},["stop"]))},[p("button",{class:"ws-menu-item",onClick:q[16]||(q[16]=Ze(J=>pe(me.value),["stop"]))},N(T(n)("sidebar.copyPath")),1),q[34]||(q[34]=p("div",{class:"ws-menu-divider"},null,-1)),p("button",{class:"ws-menu-item",onClick:q[17]||(q[17]=Ze(J=>D(me.value),["stop"]))},N(T(n)("sidebar.rename")),1),q[35]||(q[35]=p("div",{class:"ws-menu-divider"},null,-1)),p("button",{class:"ws-menu-item del",onClick:q[18]||(q[18]=Ze(J=>X(me.value),["stop"]))},N(re.value===me.value.id?T(n)("sidebar.confirm"):T(n)("sidebar.removeWorkspace")),1)],4)):ce("",!0)]))}}),AI=_t(MI,[["__scopeId","data-v-94a6163e"]]),Ot={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",theme:"kimi-web.theme",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",betaToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align"};function nk(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function En(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function An(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Rc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function _1(){const e=En(Ot.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function w1(e){const n={..._1()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];An(Ot.unread,JSON.stringify(n))}function EI(e){try{const t=En(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function II(e,t){try{An(e,String(t))}catch{}}function $I(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(o,Math.max(s,Math.round(_))):n}const l=se(r(EI(t)??n)),a=se(!1);function c(_){const b=r(_);l.value=b,II(t,b)}let u=0,d=0,h=null,m=-1;function f(_){if(!a.value)return;const b=_.clientX-u;c(d+(i?-b:b))}function y(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),h){try{h.releasePointerCapture(m)}catch{}h.removeEventListener("pointermove",f),h.removeEventListener("pointerup",y),h.removeEventListener("pointercancel",y)}h=null,m=-1}}function S(_){_.preventDefault(),a.value=!0,u=_.clientX,d=l.value,h=_.currentTarget,m=_.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{h.setPointerCapture(m)}catch{}h.addEventListener("pointermove",f),h.addEventListener("pointerup",y),h.addEventListener("pointercancel",y)}return lo(y),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:S}}const NI=["aria-label"],LI=Je({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=xt(),{width:i,dragging:r,onPointerDown:l}=$I({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:n.max,reverse:n.reverse});return s("update:width",i.value),Ve(i,a=>s("update:width",a)),Ve(r,a=>s("update:dragging",a)),(a,c)=>(C(),E("div",{class:$e(["rh",{dragging:T(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??T(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>T(l)&&T(l)(...u))},[...c[1]||(c[1]=[p("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,NI))}}),sk=_t(LI,[["__scopeId","data-v-419b78b9"]]),OI={preview:"Preview"},PI={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",comingSoon:"Coming soon…"},RI={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",confirm:"Confirm",cancel:"Cancel",options:"Options",rename:"Rename",copyPath:"Copy path",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Show more ({count})",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchClear:"Clear search",searchNoResults:"No matching sessions"},DI={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},BI={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",confirm:"Confirm",cancel:"Cancel",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},FI={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",modelTooltip:"Click to switch model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionTooltip:"Click to cycle permission mode",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",modesTooltip:"Mode: Plan / Goal / Swarm",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},HI={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",steerNow:"Steer now ⌃S",steerTitle:"Inject into the running turn without waiting (Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking"},WI={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again"},UI={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",confirm:"Confirm",cancel:"Cancel",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},qI={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},jI={title:"New session",close:"Close (Esc)",cwdLabel:"Working directory",cwdPlaceholder:"Absolute path of the working directory, e.g. /Users/you/project",recentLabel:"Recent directories",titleFieldLabel:"Title",titleFieldPlaceholder:"Optional, named automatically if left blank",create:"Create",cancel:"Cancel",footerHint:"Enter to create · Esc to close"},zI={title:"Sessions",close:"Close",searchPlaceholder:"Search sessions by title…",noWorkspace:"No workspace",emptyNone:"No sessions yet",emptyNoMatch:"No matching sessions",footerHint:"↑↓ to navigate · Enter to switch · Esc to close",justNow:"just now"},VI={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback"},KI={title:"Question",step:"Q{current}/{total}",prev:"‹ Prev",next:"Next ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},GI={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",dockQueue:"Queue",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",todoTag:"todos",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",collapse:"Collapse",expand:"Expand"},YI={panelTitle:"Thinking",close:"Close"},XI={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"},ZI={},QI={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},JI={searching:"Searching…",noMatch:"No matches"},e$={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",contentType:"Content type",details:"Server details",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",status:"HTTP status",timeout:"Timeout"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},t$={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},sessions:{desc:"Browse & switch sessions"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},n$={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Plan",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"}},s$={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},o$={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},i$={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},r$={preview:"预览"},l$={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},a$={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",confirm:"确认",cancel:"取消",options:"选项",rename:"重命名",copyPath:"复制路径",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"展开更多 ({count})",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchClear:"清除搜索",searchNoResults:"没有匹配的会话"},c$={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},u$={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"确定撤销?",confirm:"确定",cancel:"取消",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},d$={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",modelTooltip:"点击切换模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionTooltip:"点击循环切换审批模式",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",modesTooltip:"模式:计划 / 目标 / Swarm",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},f$={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",steerNow:"立即插入 ⌃S",steerTitle:"不等当前回合结束,把消息直接插进正在运行的任务(Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},h$={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试"},p$={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",confirm:"确认",cancel:"取消",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},m$={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},g$={title:"新建会话",close:"关闭 (Esc)",cwdLabel:"工作目录",cwdPlaceholder:"工作目录绝对路径,如 /Users/you/project",recentLabel:"最近目录",titleFieldLabel:"标题",titleFieldPlaceholder:"可选,留空则自动命名",create:"新建",cancel:"取消",footerHint:"Enter 新建 · Esc 关闭"},v$={title:"会话",close:"关闭",searchPlaceholder:"按标题搜索会话…",noWorkspace:"无工作区",emptyNone:"暂无会话",emptyNoMatch:"没有匹配的会话",footerHint:"↑↓ 切换 · Enter 进入 · Esc 关闭",justNow:"刚刚"},y$={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈"},k$={title:"提问",step:"Q{current}/{total}",prev:"‹ 上一",next:"下一 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},b$={tag:"tasks",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",dockQueue:"队列",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",todoTag:"待办",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",collapse:"折叠",expand:"展开"},_$={panelTitle:"思考过程",close:"关闭"},w$={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},S$={},C$={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},x$={searching:"搜索中…",noMatch:"无匹配"},T$={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",contentType:"响应类型",details:"服务端详情",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",status:"HTTP 状态",timeout:"超时设置"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},M$={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},sessions:{desc:"浏览/切换会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},A$={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},E$={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},I$={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},$$={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},N$={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",themeLabel:"Theme",modernDesc:"Bubbles, conversational, softer.",kimiDesc:"Native look: calm, flat.",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},L$={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},O$={title:"Settings",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",permission:{manual:"Manual",auto:"Auto",yolo:"YOLO"},defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Telemetry",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},P$={title:"设置",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",permission:{manual:"手动",auto:"自动",yolo:"全自动"},defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"遥测",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},R$={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",confirmArchive:"Confirm archive?"},D$={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},B$={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"},F$={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},H$={en:{common:OI,app:PI,sidebar:RI,workspace:DI,conversation:BI,status:FI,composer:HI,login:WI,providers:UI,model:qI,newSession:jI,sessions:zI,approval:VI,question:KI,tasks:GI,thinking:YI,diff:XI,fileTree:ZI,filePreview:QI,mention:JI,warnings:e$,commands:t$,tools:n$,layout:s$,mobile:o$,theme:i$,onboarding:N$,settings:O$,header:R$,sideChat:B$},zh:{common:r$,app:l$,sidebar:a$,workspace:c$,conversation:u$,status:d$,composer:f$,login:h$,providers:p$,model:m$,newSession:g$,sessions:v$,approval:y$,question:k$,tasks:b$,thinking:_$,diff:w$,fileTree:S$,filePreview:C$,mention:x$,warnings:T$,commands:M$,tools:A$,layout:E$,mobile:I$,theme:$$,onboarding:L$,settings:P$,header:D$,sideChat:F$}},AS=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function W$(){const e=En(Ot.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Ln=N6({legacy:!1,locale:W$(),fallbackLocale:"en",messages:H$});function ES(e){Ln.global.locale.value=e,An(Ot.locale,e)}const Ql=Ln.global.t,U$={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"},q$={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function Xc(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return q$[t]??t}function ok(e){const t=U$[Xc(e)];return t?Ql(t):e}const j$='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="2.5" y="1.5" width="9" height="13" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7.5" x2="11" y2="7.5"/><line x1="5" y1="10" x2="10" y2="10"/></svg>',z$='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><polyline points="4,6 6.5,8 4,10"/><line x1="8" y1="10" x2="12" y2="10"/></svg>',ik='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 2.5l3 3-8 8H2.5v-3l8-8z"/><line x1="8.5" y1="4.5" x2="11.5" y2="7.5"/></svg>',V$='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M3 12V4.5L8 2l5 2.5V12H3z"/><line x1="6" y1="7" x2="10" y2="7"/><line x1="8" y1="5" x2="8" y2="9"/></svg>',rk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="6.5" cy="6.5" r="4"/><line x1="9.5" y1="9.5" x2="13.5" y2="13.5"/></svg>',K$='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5C3.5 2.5 3.5 5 3.5 6.5S2.5 8 2.5 8s1 0 1 1.5S3.5 13.5 5 13.5"/><path d="M11 2.5c1.5 0 1.5 2.5 1.5 4S13.5 8 13.5 8s-1 0-1 1.5.5 4-1.5 4"/><line x1="8" y1="6" x2="8" y2="10"/><line x1="6.3" y1="6.8" x2="9.7" y2="9.2"/><line x1="9.7" y1="6.8" x2="6.3" y2="9.2"/></svg>',G$='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',Y$='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6"/><path d="M8 2c-2 2-3 3.6-3 6s1 4 3 6"/><path d="M8 2c2 2 3 3.6 3 6s-1 4-3 6"/><line x1="2" y1="8" x2="14" y2="8"/></svg>',lk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><polyline points="2,4.5 3.5,6 5.5,3"/><polyline points="2,11 3.5,12.5 5.5,9.5"/><line x1="8" y1="4.5" x2="14" y2="4.5"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',X$='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 1L3 9h4l-1.5 6 5.5-8h-4l1.5-6z"/></svg>',Z$="";function Q$(e){switch(Xc(e)){case"read":return j$;case"bash":return z$;case"edit":return ik;case"multi_edit":return ik;case"write":return V$;case"grep":return rk;case"search":return rk;case"glob":return K$;case"ls":return G$;case"web_fetch":return Y$;case"todo":return lk;case"task":return lk;default:return(e??"").trim().toLowerCase().includes("skill")?X$:Z$}}const IS=80;function J$(e,t=IS){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function e5(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function t5(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 jt(e){return typeof e=="string"&&e.length>0?e:void 0}function Fr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function n5(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 Dp(e){return jt(e.path)??jt(e.file_path)??jt(e.filePath)??jt(e.filename)}const s5=64;function ak(e,t,n=!1){const s=(o,i=IS)=>n?o.trim():J$(o,i);try{const o=t5(t);if(!n&&e5(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(Xc(e)){case"read":{const r=Dp(o);if(!r)return i();const l=Fr(o.offset)??Fr(o.line_start)??Fr(o.start_line),a=Fr(o.limit)??Fr(o.length),c=Fr(o.line_end)??Fr(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=Dp(o);return r?s(`${r} ${Ql("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=Dp(o);return r?s(r):i()}case"bash":{const r=jt(o.command)??jt(o.cmd)??jt(o.script);return r?s(r,s5):i()}case"grep":case"search":{const r=jt(o.pattern)??jt(o.query)??jt(o.regex),l=jt(o.path)??jt(o.glob)??jt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=jt(o.pattern)??jt(o.glob)??jt(o.query),l=jt(o.path)??jt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):jt(o.path)?s(jt(o.path)):i()}case"ls":{const r=jt(o.path)??jt(o.dir)??jt(o.directory)??jt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=jt(o.url)??jt(o.uri);return r?s(n5(r)):i()}case"todo":case"task":{const r=jt(o.description)??jt(o.title)??jt(o.prompt)??jt(o.name)??jt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(Ql("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function o5(e){try{switch(Xc(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Ql("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return Ql("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Ql("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const i5=["title"],r5=["title"],l5=["src","alt"],a5=["src"],c5=["src"],u5={class:"car",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},d5=["points"],f5=["innerHTML"],h5={class:"a"},p5=["title"],m5={class:"rt"},g5={key:0,class:"chip"},v5={key:1,class:"spin",role:"status","aria-label":"running"},y5={key:3,class:"tm"},k5={key:0,class:"bb"},b5={key:0,class:"bb-summary"},_5={key:1,class:"bb-empty"},w5=Je({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>n.tool.status==="running"&&/^bash$/i.test(n.tool.name)),i=j(()=>!!n.tool.output&&n.tool.output.length>0),r=j(()=>i.value||o.value),l=se(n.tool.defaultExpanded===!0&&r.value);function a(){r.value&&(l.value=!l.value)}Ve(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const c=()=>n.tool.status==="error"?"✕":"✓",u=()=>ok(n.tool.name),d=()=>Q$(n.tool.name),h=()=>ak(n.tool.name,n.tool.arg),m=()=>ak(n.tool.name,n.tool.arg,!0),f=()=>o5({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status}),y=()=>n.tool.status==="error",S=j(()=>n.tool.status==="ok"?n.tool.media:void 0);function _(k){return k.split(/[\\/]+/).pop()||k}function b(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/1024/1024).toFixed(1)} MB`}const v=j(()=>{const k=S.value;if(!k)return"";const $=[k.path?_(k.path):ok(n.tool.name)];return k.mimeType&&$.push(k.mimeType),k.bytes!==void 0&&$.push(b(k.bytes)),k.dimensions&&$.push(k.dimensions),$.join(" · ")});function g(){const k=S.value;k?.kind==="image"&&s("openMedia",k)}return(k,$)=>S.value?(C(),E("div",{key:0,class:$e(["media-tool",{mob:e.mobile}])},[p("div",{class:"media-title",title:S.value.path||v.value},N(v.value),9,i5),S.value.kind==="image"?(C(),E("button",{key:0,type:"button",class:"media-image-button",title:S.value.path||v.value,onClick:g},[p("img",{class:"media-image",src:S.value.url,alt:S.value.path?_(S.value.path):v.value,loading:"lazy"},null,8,l5)],8,r5)):S.value.kind==="video"?(C(),E("video",{key:1,class:"media-video",src:S.value.url,controls:"",preload:"metadata"},null,8,a5)):(C(),E("audio",{key:2,class:"media-audio",src:S.value.url,controls:""},null,8,c5))],2)):(C(),E("div",{key:1,class:$e(["box",{open:l.value,err:y(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[p("div",{class:"bh",onClick:a},[(C(),E("svg",u5,[p("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,d5)])),d()?(C(),E("span",{key:0,class:"gl",innerHTML:d(),"aria-hidden":"true"},null,8,f5)):ce("",!0),p("span",h5,N(u()),1),l.value?ce("",!0):(C(),E("span",{key:1,class:"p",title:h()},N(h()),9,p5)),p("span",m5,[f()?(C(),E("span",g5,N(f()),1)):ce("",!0),e.tool.status==="running"?(C(),E("span",v5)):(C(),E("span",{key:2,class:$e(e.tool.status==="ok"?"ok":"er")},N(c()),3)),e.tool.timing&&e.tool.name!=="bash"?(C(),E("span",y5,N(e.tool.timing),1)):ce("",!0)])]),l.value?(C(),E("div",k5,[m()?(C(),E("div",b5,N(m()),1)):ce("",!0),i.value?ce("",!0):(C(),E("div",_5,"Waiting for output…")),(C(!0),E(Le,null,Qe(e.tool.output??[],(A,w)=>(C(),E("div",{key:w},N(A),1))),128))])):ce("",!0)],2))}}),Uu=_t(w5,[["__scopeId","data-v-62dadf8a"]]);var S5=Object.create,S1=Object.defineProperty,C5=Object.getOwnPropertyDescriptor,$S=Object.getOwnPropertyNames,x5=Object.getPrototypeOf,T5=Object.prototype.hasOwnProperty,NS=(e,t)=>function(){return t||(0,e[$S(e)[0]])((t={exports:{}}).exports,t),t.exports},LS=e=>{let t={};for(var n in e)S1(t,n,{get:e[n],enumerable:!0});return t},M5=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=$S(t),i=0,r=o.length,l;i<r;i++)l=o[i],!T5.call(e,l)&&l!==n&&S1(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=C5(t,l))||s.enumerable});return e},OS=(e,t,n)=>(n=e!=null?S5(x5(e)):{},M5(S1(n,"default",{value:e,enumerable:!0}),e));function A5(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function E5(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function I5(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function $5(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
39
|
-
`:`<hr class="footnotes-sep">
|
|
40
|
-
`)+`<section class="footnotes">
|
|
41
|
-
<ol class="footnotes-list">
|
|
42
|
-
`}function N5(){return`</ol>
|
|
43
|
-
</section>
|
|
44
|
-
`}function L5(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function O5(){return`</li>
|
|
45
|
-
`}function P5(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function R5(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=I5,e.renderer.rules.footnote_block_open=$5,e.renderer.rules.footnote_block_close=N5,e.renderer.rules.footnote_open=L5,e.renderer.rules.footnote_close=O5,e.renderer.rules.footnote_anchor=P5,e.renderer.rules.footnote_caption=E5,e.renderer.rules.footnote_anchor_name=A5;function s(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],h=l.eMarks[a];if(d+4>h||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let m;for(m=d+2;m<h;m++){if(l.src.charCodeAt(m)===32)return!1;if(l.src.charCodeAt(m)===93)break}if(m===d+2||m+1>=h||l.src.charCodeAt(++m)!==58)return!1;if(u)return!0;m++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const f=l.src.slice(d+2,m-2);l.env.footnotes.refs[`:${f}`]=-1;const y=new l.Token("footnote_reference_open","",1);y.meta={label:f},y.level=l.level++,l.tokens.push(y);const S=l.bMarks[a],_=l.tShift[a],b=l.sCount[a],v=l.parentType,g=m,k=l.sCount[a]+m-(l.bMarks[a]+l.tShift[a]);let $=k;for(;m<h;){const w=l.src.charCodeAt(m);if(n(w))w===9?$+=4-$%4:$++;else break;m++}l.tShift[a]=m-g,l.sCount[a]=$-k,l.bMarks[a]=g,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]=_,l.sCount[a]=b,l.bMarks[a]=S;const A=new l.Token("footnote_reference_close","",-1);return A.level=--l.level,l.tokens.push(A),!0}function o(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,h=t(l,u+1);if(h<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const m=l.env.footnotes.list.length,f=[];l.md.inline.parse(l.src.slice(d,h),l.md,l.env,f);const y=l.push("footnote_ref","",0);y.meta={id:m},l.env.footnotes.list[m]={content:l.src.slice(d,h),tokens:f}}return l.pos=h+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const h=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${h}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let m;l.env.footnotes.refs[`:${h}`]<0?(m=l.env.footnotes.list.length,l.env.footnotes.list[m]={label:h,count:0},l.env.footnotes.refs[`:${h}`]=m):m=l.env.footnotes.refs[`:${h}`];const f=l.env.footnotes.list[m].count;l.env.footnotes.list[m].count++;const y=l.push("footnote_ref","",0);y.meta={id:m,subId:f,label:h}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const h={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(f){return f.type==="footnote_reference_open"?(d=!0,c=[],u=f.meta.label,!1):f.type==="footnote_reference_close"?(d=!1,h[":"+u]=c,!1):(d&&c.push(f),!d)}),!l.env.footnotes.list))return;const m=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let f=0,y=m.length;f<y;f++){const S=new l.Token("footnote_open","",1);if(S.meta={id:f,label:m[f].label},l.tokens.push(S),m[f].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const g=new l.Token("inline","",0);g.children=m[f].tokens,g.content=m[f].content,a.push(g);const k=new l.Token("paragraph_close","p",-1);k.block=!0,a.push(k)}else m[f].label&&(a=h[`:${m[f].label}`]);a&&(l.tokens=l.tokens.concat(a));let _;l.tokens[l.tokens.length-1].type==="paragraph_close"?_=l.tokens.pop():_=null;const b=m[f].count>0?m[f].count:1;for(let v=0;v<b;v++){const g=new l.Token("footnote_anchor","",0);g.meta={id:f,subId:v,label:m[f].label},l.tokens.push(g)}_&&l.tokens.push(_),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function D5(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function B5(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const F5=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function H5(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(F5,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function W5(e){e.inline.ruler.after("emphasis","sub",H5)}const U5=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function q5(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(U5,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function j5(e){e.inline.ruler.after("emphasis","sup",q5)}var z5=NS({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(y,S){S=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},S),y.core.ruler.after("inline","github-task-lists",function(_){for(var b=_.tokens,v=0,g=2;g<b.length;g++)o(b,g)&&(i(b[g],v,S,_.Token),v+=1,n(b[g-2],"class",S.liClass),n(b[s(b,g-2)],"class",S.ulClass))})};function n(y,S,_){var b=y.attrIndex(S),v=[S,_];b<0?y.attrPush(v):y.attrs[b]=v}function s(y,S){for(var _=y[S].level-1,b=S-1;b>=0;b--)if(y[b].level===_)return b;return-1}function o(y,S){return d(y[S])&&h(y[S-1])&&m(y[S-2])&&f(y[S])}function i(y,S,_,b){var v=_.idPrefix+S;y.children[0].content=y.children[0].content.slice(3),y.children.unshift(l(v,b)),y.children.push(a(b)),y.children.unshift(r(y,v,_,b)),_.divWrap&&(y.children.unshift(c(_,b)),y.children.push(u(b)))}function r(y,S,_,b){var v=new b("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",S]],/^\[[xX]\][ \u00A0]/.test(y.content)===!0&&v.attrs.push(["checked","true"]),_.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(y,S){var _=new S("label_open","label",1);return _.attrs=[["for",y]],_}function a(y){return new y("label_close","label",-1)}function c(y,S){var _=new S("checkbox_open","div",0);return _.attrs=[["class",y.divClass]],_}function u(y){return new y("checkbox_close","div",-1)}function d(y){return y.type==="inline"}function h(y){return y.type==="paragraph_open"}function m(y){return y.type==="list_item_open"}function f(y){return/^\[[xX \u00A0]\][ \u00A0]/.test(y.content)}})}),V5=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))),K5=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),Bp;const G5=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]]),Y5=(Bp=String.fromCodePoint)!==null&&Bp!==void 0?Bp: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 X5(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=G5.get(e))!==null&&t!==void 0?t:e}var Qn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Qn||(Qn={}));const Z5=32;var lr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(lr||(lr={}));function og(e){return e>=Qn.ZERO&&e<=Qn.NINE}function Q5(e){return e>=Qn.UPPER_A&&e<=Qn.UPPER_F||e>=Qn.LOWER_A&&e<=Qn.LOWER_F}function J5(e){return e>=Qn.UPPER_A&&e<=Qn.UPPER_Z||e>=Qn.LOWER_A&&e<=Qn.LOWER_Z||og(e)}function eN(e){return e===Qn.EQUALS||J5(e)}var Zn;(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"})(Zn||(Zn={}));var or;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(or||(or={}));var tN=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Zn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=or.Strict}startEntity(e){this.decodeMode=e,this.state=Zn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Zn.EntityStart:return e.charCodeAt(t)===Qn.NUM?(this.state=Zn.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Zn.NamedEntity,this.stateNamedEntity(e,t));case Zn.NumericStart:return this.stateNumericStart(e,t);case Zn.NumericDecimal:return this.stateNumericDecimal(e,t);case Zn.NumericHex:return this.stateNumericHex(e,t);case Zn.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Z5)===Qn.LOWER_X?(this.state=Zn.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Zn.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(og(s)||Q5(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(og(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Qn.SEMI)this.consumed+=1;else if(this.decodeMode===or.Strict)return 0;return this.emitCodePoint(X5(this.result),this.consumed),this.errors&&(e!==Qn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&lr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=nN(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===or.Attribute&&(o===0||eN(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&lr.VALUE_LENGTH)>>14,o!==0){if(i===Qn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==or.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&lr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~lr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Zn.NamedEntity:return this.result!==0&&(this.decodeMode!==or.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Zn.NumericDecimal:return this.emitNumericEntity(0,2);case Zn.NumericHex:return this.emitNumericEntity(0,3);case Zn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Zn.EntityStart:return 0}}};function PS(e){let t="";const n=new tN(e,s=>t+=Y5(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function nN(e,t,n,s){const o=(t&lr.BRANCH_LENGTH)>>7,i=t&lr.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const sN=PS(V5);PS(K5);function C1(e,t=or.Legacy){return sN(e,t)}var oN=OS(z5());const ck={};function iN(e){let t=ck[e];if(t)return t;t=ck[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function Yf(e,t){typeof t!="string"&&(t=Yf.defaultChars);const n=iN(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}Yf.defaultChars=";/?:@&=+$,#";Yf.componentChars="";var ig=Yf;const uk={};function rN(e){let t=uk[e];if(t)return t;t=uk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Xf(e,t,n){typeof t!="string"&&(n=t,t=Xf.defaultChars),typeof n>"u"&&(n=!0);const s=rN(t);let o="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}Xf.defaultChars=";/?:@&=+$,-_.!~*'()#";Xf.componentChars="-_.!~*'()";var RS=Xf;function x1(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 Zd(){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 lN=/^([a-z0-9.+-]+:)/i,aN=/:[0-9]*$/,cN=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,uN=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
46
|
-
`," "]),dN=["'"].concat(uN),dk=["%","/","?",";","#"].concat(dN),fk=["/","?","#"],fN=255,hk=/^[+a-z0-9A-Z_-]{0,63}$/,hN=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pk={javascript:!0,"javascript:":!0},mk={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function pN(e,t){if(e&&e instanceof Zd)return e;const n=new Zd;return n.parse(e,t),n}Zd.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=cN.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=lN.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&pk[r])&&(i=i.substr(2),this.slashes=!0)),!pk[r]&&(o||r&&!mk[r])){let c=-1;for(let f=0;f<fk.length;f++)s=i.indexOf(fk[f]),s!==-1&&(c===-1||s<c)&&(c=s);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let f=0;f<dk.length;f++)s=i.indexOf(dk[f]),s!==-1&&(c===-1||s<c)&&(c=s);c===-1&&(c=i.length),i[c-1]===":"&&c--;const h=i.slice(0,c);i=i.slice(c),this.parseHost(h),this.hostname=this.hostname||"";const m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m){const f=this.hostname.split(/\./);for(let y=0,S=f.length;y<S;y++){const _=f[y];if(_&&!_.match(hk)){let b="";for(let v=0,g=_.length;v<g;v++)_.charCodeAt(v)>127?b+="x":b+=_[v];if(!b.match(hk)){const v=f.slice(0,y),g=f.slice(y+1),k=_.match(hN);k&&(v.push(k[1]),g.unshift(k[2])),g.length&&(i=g.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>fN&&(this.hostname=""),m&&(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),mk[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Zd.prototype.parseHost=function(e){let t=aN.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 T1=pN,DS=LS({decode:()=>ig,encode:()=>RS,format:()=>x1,parse:()=>T1}),BS=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,FS=/[\0-\x1F\x7F-\x9F]/,mN=/[\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]/,HS=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,gN=/[\$\+<->\^`\|~\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]/,WS=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,vN=LS({Any:()=>BS,Cc:()=>FS,Cf:()=>mN,P:()=>HS,S:()=>gN,Z:()=>WS}),yN=Object.defineProperty,US=e=>{let t={};for(var n in e)yN(t,n,{get:e[n],enumerable:!0});return t},kN=US({arrayReplaceAt:()=>TN,assign:()=>CN,countLines:()=>Sn,escapeHtml:()=>PN,escapeRE:()=>DN,fromCodePoint:()=>Bc,has:()=>SN,isMdAsciiPunct:()=>ef,isPunctChar:()=>Jd,isPunctCode:()=>rg,isSpace:()=>xN,isString:()=>_N,isValidEntityCode:()=>Qf,isWhiteSpace:()=>Dc,lib:()=>BN,mdurl:()=>DS,normalizeReference:()=>Zf,ucmicro:()=>Qd,unescapeAll:()=>Fc,unescapeMd:()=>IN});const Qd=vN;function bN(e){return Object.prototype.toString.call(e)}function _N(e){return bN(e)==="[object String]"}const wN=Object.prototype.hasOwnProperty;function SN(e,t){return wN.call(e,t)}function CN(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function xN(e){return e===9||e===32}function Dc(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 Jd(e){return Qd.P.test(e)||Qd.S.test(e)}const gk=new Map;function rg(e){if(ef(e))return!0;const t=gk.get(e);if(t!==void 0)return t;const n=Jd(String.fromCharCode(e));return gk.set(e,n),n}function ef(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 Zf(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function TN(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Qf(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 Bc(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 qS=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,MN=new RegExp(`${qS.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),AN=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function EN(e,t){if(t.charCodeAt(0)===35&&AN.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Qf(s)?Bc(s):e}const n=C1(e);return n!==e?n:e}function IN(e){return e.includes("\\")?e.replace(qS,"$1"):e}function Fc(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(MN,(t,n,s)=>n||EN(t,s))}const $N=/[&<>"]/,NN=/[&<>"]/g,LN={"&":"&","<":"<",">":">",'"':"""};function ON(e){return LN[e]}function PN(e){return $N.test(e)?e.replace(NN,ON):e}const RN=/[.?*+^$[\]\\(){}|-]/g;function DN(e){return e.replace(RN,"\\$&")}const BN={mdurl:DS,ucmicro:Qd};function Sn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
47
|
-
`,n+1))!==-1;)t++;return t}const FN=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,HN=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,WN=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,M1=["references","footnotes","abbreviations","abbr","abbrs"],A1=Symbol.for("markdown-it-ts.global-state"),E1=Object.prototype.hasOwnProperty;function vk(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function qo(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function dr(e){if(Array.isArray(e))return e.map(t=>dr(t));if(qo(e)){const t={};for(const n of Object.keys(e))t[n]=dr(e[n]);return t}return e}function tf(e){return Array.isArray(e)?e.map((t,n)=>String(n)):qo(e)?Object.keys(e):[]}function lg(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(!lg(e[n],t[n]))return!1;return!0}if(qo(e)||qo(t)){if(!qo(e)||!qo(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!E1.call(t,o)||!lg(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function jS(e,t){if(Array.isArray(e))return e[Number(t)];if(qo(e))return e[t]}function UN(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=dr(t[n]);return e}if(qo(e)&&qo(t)){for(const n of Object.keys(e))E1.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=dr(t[n]);return e}return dr(t)}function qN(e,t,n){const s=n.ownedKeys??[],o=e[t];if(qo(o)||Array.isArray(o)){const i=new Set(tf(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=dr(jS(n.value,r)):delete o[r];!n.existed&&tf(o).length===0&&delete e[t];return}n.existed?e[t]=dr(n.value):delete e[t]}function I1(e){const t=e[A1];return vk(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&vk(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function jN(e,t){Object.defineProperty(e,A1,{value:t,enumerable:!1,configurable:!0,writable:!0})}function ds(e){return e?FN.test(e)?"footnote-definition":HN.test(e)?"abbreviation-definition":WN.test(e)?"reference-definition":null:null}function Zc(e){return I1(e)?.reason??null}function Jl(e,t,n){if(Zc(e)&&Ri(e),!t)return n();$1(e,t);try{const s=n();return N1(e),s}catch(s){throw Ri(e),s}}function $1(e,t){try{Ri(e);const n={};for(const s of M1)n[s]=E1.call(e,s)?{existed:!0,value:dr(e[s])}:{existed:!1};jN(e,{reason:t,snapshot:n})}catch{}}function N1(e){const t=I1(e);if(t)for(const n of M1){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!qo(o)&&!Array.isArray(o))continue;const i=new Set(tf(s.existed?s.value:void 0));s.ownedKeys=tf(o).filter(r=>i.has(r)?!lg(o[r],jS(s.value,r)):!0)}}function Ri(e){const t=I1(e);if(t){for(const n of M1){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){qN(e,n,s);continue}s.existed?e[n]=UN(e[n],s.value):delete e[n]}delete e[A1]}}const ag=Symbol.for("markdown-it-ts.diagnostics");function Jf(e,t){if(e)try{const n=e[ag];if(n&&typeof n=="object")return n;if(!t)return;const s={};return Object.defineProperty(e,ag,{value:s,enumerable:!1,configurable:!0,writable:!0}),s}catch{return}}function _i(e){return Jf(e,!1)}function zN(e){if(e)try{delete e[ag]}catch{}}function Zs(e){zN(e)}function ss(e,t){const n=Jf(e,!0);n&&(n.strategy=t)}function Fp(e,t){const n=Jf(e,!0);n&&(n.chunk=t)}function zS(e,t){const n=Jf(e,!0);n&&(n.unbounded=t)}function VN(e){const t={};e=e||{},t.src_Any=BS.source,t.src_Cc=FS.source,t.src_Z=WS.source,t.src_P=HS.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 cg(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function eh(e){return Object.prototype.toString.call(e)}function KN(e){return eh(e)==="[object String]"}function GN(e){return eh(e)==="[object Object]"}function YN(e){return eh(e)==="[object RegExp]"}function yk(e){return eh(e)==="[object Function]"}function XN(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const VS={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ZN(e){return Object.keys(e||{}).reduce(function(t,n){return t||VS.hasOwnProperty(n)},!1)}const QN={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},JN="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]",e8="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function t8(e){e.__index__=-1,e.__text_cache__=""}function n8(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function kk(){return function(e,t){t.normalize(e)}}function nf(e){const t=e.re=VN(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(JN),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,GN(a)){YN(a.validate)?c.validate=n8(a.validate):yk(a.validate)?c.validate=a.validate:i(l,a),yk(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=kk();return}if(KN(a)){o.push(l);return}i(l,a)}),o.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:kk()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(XN).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"),t8(e)}function s8(e,t){const n=e.__index__,s=e.__last_index__,o=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=o,this.text=o,this.url=o}function ug(e,t){const n=new s8(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function ao(e,t){if(!(this instanceof ao))return new ao(e,t);t||ZN(e)&&(t=e,e={}),this.__opts__=cg({},VS,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=cg({},QN,e),this.__compiled__={},this.__tlds__=e8,this.__tlds_replaced__=!1,this.re={},nf(this)}ao.prototype.add=function(t,n){return this.__schemas__[t]=n,nf(this),this};ao.prototype.set=function(t){return this.__opts__=cg(this.__opts__,t),this};ao.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,o,i,r,l,a,c,u;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],a.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(r=s.index+s[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(r=o.index+o[1].length,l=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=l))),this.__index__>=0};ao.prototype.pretest=function(t){return this.re.pretest.test(t)};ao.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};ao.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(ug(this,s)),s=this.__last_index__);let o=s?t.slice(s):t;for(;this.test(o);)n.push(ug(this,s)),o=o.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};ao.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);return s?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s,ug(this,0)):null};ao.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),nf(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,nf(this),this)};ao.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ao.prototype.onCompile=function(){};var KS=ao,o8=NS({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,h=/[^\0-\x7F]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=35,S=Math.floor,_=String.fromCharCode;function b(R){throw new RangeError(f[R])}function v(R,W){const V=[];let z=R.length;for(;z--;)V[z]=W(R[z]);return V}function g(R,W){const V=R.split("@");let z="";V.length>1&&(z=V[0]+"@",R=V[1]),R=R.replace(m,".");const ie=v(R.split("."),W).join(".");return z+ie}function k(R){const W=[];let V=0;const z=R.length;for(;V<z;){const ie=R.charCodeAt(V++);if(ie>=55296&&ie<=56319&&V<z){const ae=R.charCodeAt(V++);(ae&64512)==56320?W.push(((ie&1023)<<10)+(ae&1023)+65536):(W.push(ie),V--)}else W.push(ie)}return W}const $=R=>String.fromCodePoint(...R),A=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},w=function(R,W){return R+22+75*(R<26)-((W!=0)<<5)},x=function(R,W,V){let z=0;for(R=V?S(R/700):R>>1,R+=S(R/W);R>y*26>>1;z+=36)R=S(R/y);return S(z+(y+1)*R/(R+38))},I=function(R){const W=[],V=R.length;let z=0,ie=128,ae=72,re=R.lastIndexOf("-");re<0&&(re=0);for(let Te=0;Te<re;++Te)R.charCodeAt(Te)>=128&&b("not-basic"),W.push(R.charCodeAt(Te));for(let Te=re>0?re+1:0;Te<V;){const Pe=z;for(let Ne=1,me=36;;me+=36){Te>=V&&b("invalid-input");const be=A(R.charCodeAt(Te++));be>=36&&b("invalid-input"),be>S((2147483647-z)/Ne)&&b("overflow"),z+=be*Ne;const Se=me<=ae?1:me>=ae+26?26:me-ae;if(be<Se)break;const fe=36-Se;Ne>S(2147483647/fe)&&b("overflow"),Ne*=fe}const We=W.length+1;ae=x(z-Pe,We,Pe==0),S(z/We)>2147483647-ie&&b("overflow"),ie+=S(z/We),z%=We,W.splice(z++,0,ie)}return String.fromCodePoint(...W)},L=function(R){const W=[];R=k(R);const V=R.length;let z=128,ie=0,ae=72;for(const Pe of R)Pe<128&&W.push(_(Pe));const re=W.length;let Te=re;for(re&&W.push("-");Te<V;){let Pe=2147483647;for(const Ne of R)Ne>=z&&Ne<Pe&&(Pe=Ne);const We=Te+1;Pe-z>S((2147483647-ie)/We)&&b("overflow"),ie+=(Pe-z)*We,z=Pe;for(const Ne of R)if(Ne<z&&++ie>2147483647&&b("overflow"),Ne===z){let me=ie;for(let be=36;;be+=36){const Se=be<=ae?1:be>=ae+26?26:be-ae;if(me<Se)break;const fe=me-Se,K=36-Se;W.push(_(w(Se+fe%K,0))),me=S(fe/K)}W.push(_(w(me,0))),ae=x(ie,We,Te===re),ie=0,++Te}++ie,++z}return W.join("")},B={version:"2.3.1",ucs2:{decode:k,encode:$},decode:I,encode:L,toASCII:function(R){return g(R,function(W){return h.test(W)?"xn--"+L(W):W})},toUnicode:function(R){return g(R,function(W){return d.test(W)?I(W.slice(4).toLowerCase()):W})}};t.exports=B})}),GS=OS(o8()),rs=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}};function L1(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=Fc(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=Fc(e.slice(t,o)),i.pos=o,i.ok=!0),i}var YS=L1;const fd=-2;function i8(e,t,n){let s=t+1;for(;s<n;){const o=e.charCodeAt(s);if(o===93)return s;if(o===92){s+=2;continue}if(o===96||o===60||o===33&&s+1<n&&e.charCodeAt(s+1)===91||o===91)return fd;s++}return-1}function O1(e,t,n){let s=1,o=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.__mdtsLinkLabelNoCloseFrom;if(typeof u=="number"&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.__mdtsLinkLabelNoCloseFrom=t+1,-1;const h=i8(l,t,a);if(h!==fd)return h;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let m=-1;return o&&(m=e.pos),e.pos=c,m}var sf=O1;function P1(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=Fc(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Fc(e.slice(t,i)),r}var XS=P1;function th(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 R1(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function r8(e,t,n){const s=th(e,t),o=[t,n];s<0?R1(e,o):e.attrs[s]=o}function l8(e,t){const n=th(e,t);return n>=0?e.attrs[n][1]:null}function a8(e,t,n){const s=th(e,t);s<0?R1(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var c8=US({attrGet:()=>l8,attrIndex:()=>th,attrJoin:()=>a8,attrPush:()=>R1,attrSet:()=>r8,parseLinkDestination:()=>L1,parseLinkLabel:()=>O1,parseLinkTitle:()=>P1});function u8(e){return e.includes("\r")||e.includes("\0")}function ZS(e){return typeof e=="string"?e:e.toString()}function d8(e){if(e.inlineMode){const t=new rs("inline","",0);t.content=ZS(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 f8=/^([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])?)*)$/,h8=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function p8(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(h8.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(f8.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 m8=p8;function g8(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let h=n.slice(s,c);h.includes(`
|
|
48
|
-
`)&&(h=h.replace(/\n/g," ")),h.length>2&&h.charCodeAt(0)===32&&h.charCodeAt(h.length-1)===32&&(h=h.slice(1,-1)),d.content=h}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var v8=g8;function bk(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=s-i[s]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let h=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(h=!0),!h){const m=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+m,i[c]=m,l.open=!1,d.end=r,d.close=!1,u=-1,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function y8(e){const t=e.tokens_meta,n=e.tokens_meta.length;bk(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&bk(t[s].delimiters)}var k8=y8;function b8(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function _k(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function _8(e){const t=e.tokens_meta,n=e.tokens_meta.length;_k(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&_k(e,t[s].delimiters)}const wk={tokenize:b8,postProcess:_8};function QS(e){return C1(e)}function D1(e){return e>=48&&e<=57}function w8(e){const t=e|32;return D1(e)||t>=97&&t<=102}function JS(e){const t=e|32;return t>=97&&t<=122}function S8(e){return JS(e)||D1(e)}function C8(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?w8(l):D1(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function x8(e,t,n){let s=t+1;if(s>=n||!JS(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&S8(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return QS(o)!==o?o:null}function T8(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=C8(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=Qf(i)?Bc(i):Bc(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=x8(e.src,n,s);if(o){const i=QS(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var M8=T8;const eC=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),dg=new Array(128),tC=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);dg[e]=`\\${t}`,tC[e]=eC[e]?t:dg[e]}function Sk(e,t,n){e.pending&&e.pushPending();const s=new rs("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function A8(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Sk(e,tC[i],dg[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return Sk(e,i<256&&eC[i]?r:l,l),e.pos=n+1,!0}var E8=A8;function I8(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var $8=I8;const nC=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,sC="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",N8=new RegExp(`^(?:${nC}|${sC}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),L8=new RegExp(`^(?:${nC}|${sC})`);function oC(e){return e===32||e===9||e===10||e===12||e===13}function O8(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||oC(t)}function P8(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(!oC(n))return!1}return!1}function R8(e){const t=e|32;return t>=97&&t<=122}function D8(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!R8(i))return!1;const r=o.slice(s).match(N8);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,O8(l)&&e.linkLevel++,P8(l)&&e.linkLevel--}return e.pos+=l.length,!0}var B8=D8;function F8(e,t){let n,s,o,i,r,l,a,c,u="";const d=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,f=sf(e,e.pos+1,!1);if(f<0)return!1;if(i=f+1,i<h&&e.src.charCodeAt(i)===40){for(i++;i<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=h)return!1;if(l=YS(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=XS(e.src,i,e.posMax),i<h&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=h||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<h&&e.src.charCodeAt(i)===91?(c=i+1,i=sf(e,i),i>=0?o=e.src.slice(c,i++):i=f+1):i=f+1,o||(o=e.src.slice(m,f)),r=e.env.references[Zf(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(m,f);const y=[];e.md.inline.parse(s,e.md,e.env,y);const S=e.push("image","img",0);S.attrs=[["src",u],["alt",""]],S.children=y,S.content=s,a&&S.attrs.push(["title",a])}return e.pos=i,e.posMax=h,!0}var H8=F8;function W8(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,h=e.pos+1,m=sf(e,e.pos,!0);if(m<0)return!1;let f=m+1;if(f<d&&e.src.charCodeAt(f)===40){for(c=!1,f++;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(f>=d)return!1;if(o=YS(e.src,f,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?f=o.pos:r="",a=f;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(o=XS(e.src,f,e.posMax),f<d&&a!==f&&o.ok)for(l=o.str,f=o.pos;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);}(f>=d||e.src.charCodeAt(f)!==41)&&(c=!0),f++}if(c){if(typeof e.env.references>"u")return!1;if(f<d&&e.src.charCodeAt(f)===91?(a=f+1,f=sf(e,f),f>=0?s=e.src.slice(a,f++):f=m+1):f=m+1,s||(s=e.src.slice(h,m)),i=e.env.references[Zf(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=h,e.posMax=m;const y=e.push("link_open","a",1),S=[["href",r]];y.attrs=S,l&&S.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=d,!0}var U8=W8;function iC(e){const t=e|32;return t>=97&&t<=122}function q8(e){return e>=48&&e<=57}function j8(e){return iC(e)||q8(e)||e===43||e===45||e===46}function z8(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&j8(e.charCodeAt(t));)t--;return t++,t>=e.length||!iC(e.charCodeAt(t))?null:e.slice(t)}function V8(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function K8(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=z8(e.pending);if(!o)return!1;const i=V8(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=l.length-o.length,!0}function G8(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var Y8=G8;function X8(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function Ck(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function Z8(e){const t=e.delimiters;Ck(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&Ck(e,n[s].delimiters)}const xk={tokenize:X8,postProcess:Z8};function Tk(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 Q8(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||Tk(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!Tk(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var J8=Q8;function B1(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function eL(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function tL(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 rC(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:B1(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function ea(e,t,n,s,o,i){const r=rC(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=tL(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=B1()}function nL(e){const t=rC(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=eL(o.samples)}return t.completedAt=B1(),t}var Mk=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},lC=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;maxNesting;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.maxNesting=t.options.maxNesting}pushPending(){const e=new rs("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 rs(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const s=new rs(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=Dc(l),u=Dc(a),d=rg(l),h=rg(a),m=!u&&(!h||c||d),f=!c&&(!d||u||h);return{can_open:m&&(t||!f||d),can_close:f&&(t||!m||h),length:r}}};lC.prototype.Token=rs;function sL(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 aC(e){for(let t=0;t<e.length;t++)if(sL(e.charCodeAt(t)))return!1;return!0}var oL=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Mk,this.ruler2=new Mk,this.ruler.push("text",J8),this.ruler.push("linkify",K8),this.ruler.push("newline",Y8),this.ruler.push("escape",E8),this.ruler.push("backticks",v8),this.ruler.push("strikethrough",xk.tokenize),this.ruler.push("emphasis",wk.tokenize),this.ruler.push("link",U8),this.ruler.push("image",H8),this.ruler.push("autolink",m8),this.ruler.push("html_inline",B8),this.ruler.push("entity",M8),this.ruler2.push("balance_pairs",k8),this.ruler2.push("strikethrough",xk.postProcess),this.ruler2.push("emphasis",wk.postProcess),this.ruler2.push("fragments_join",$8),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<s;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ea(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<s;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ea(e.env,"inline",o[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&aC(e)){const a=new rs("text","",0);a.content=e,s.push(a);return}const o=new lC(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ea(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function iL(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&aC(i.content)){const r=new rs("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const rL=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,lL=/[0-9a-z]/i;function aL(e){return/^<a[>\s]/i.test(e)}function cL(e){return/^<\/a\s*>/i.test(e)}function uL(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!rL.test(s)||!lL.test(o))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function dL(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(aL(l.content)&&i>0&&i--,cL(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(m=>uL(e.md.linkify,m));if(c.length===0)continue;const u=[];let d=l.level,h=0;c.length>0&&c[0].index===0&&r>0&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let m=0;m<c.length;m++){const f=c[m],y=e.md.normalizeLink(f.url);if(!e.md.validateLink(y))continue;let S=f.text;f.schema?f.schema==="mailto:"&&!/^mailto:/i.test(S)?S=e.md.normalizeLinkText(`mailto:${S}`).replace(/^mailto:/,""):S=e.md.normalizeLinkText(S):S=e.md.normalizeLinkText(`http://${S}`).replace(/^http:\/\//,"");const _=f.index;if(_>h){const k=new rs("text","",0);k.content=a.slice(h,_),k.level=d,u.push(k)}const b=new rs("link_open","a",1);b.attrs=[["href",y]],b.level=d++,b.markup="linkify",b.info="auto",u.push(b);const v=new rs("text","",0);v.content=S,v.level=d,u.push(v);const g=new rs("link_close","a",-1);g.level=--d,g.markup="linkify",g.info="auto",u.push(g),h=f.lastIndex}if(h!==0){if(h<a.length){const m=new rs("text","",0);m.content=a.slice(h),m.level=d,u.push(m)}o.splice(r,1,...u)}}}}const fL=/\r\n?|\n/g,hL=/\0/g;function pL(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(fL,`
|
|
49
|
-
`)),s&&(o=o.replace(hL,"�")),e.src=o}const cC=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,mL=/\((?:c|tm|r)\)/i,gL=/\((c|tm|r)\)/gi,vL={c:"©",r:"®",tm:"™"};function yL(e,t){return vL[t.toLowerCase()]}function kL(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(gL,yL)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function bL(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&cC.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function _L(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");mL.test(s)&&kL(n.children||[]),cC.test(s)&&bL(n.children||[])}}var wL=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(s=>s.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(s=>s.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const SL=/['"]/,Ak=/['"]/g,Ek="’";function qu(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function CL(e,t){let n;const s=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){Ak.lastIndex=c;const d=Ak.exec(a);if(!d)break;let h=!0,m=!0;c=d.index+1;const f=d[0]==="'";let y=32;if(d.index-1>=0)y=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){y=e[n].content.charCodeAt(e[n].content.length-1);break}let S=32;if(c<u)S=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){S=e[n].content.charCodeAt(0);break}const _=ef(y)||Jd(String.fromCharCode(y)),b=ef(S)||Jd(String.fromCharCode(S)),v=Dc(y),g=Dc(S);if(g?h=!1:b&&(v||_||(h=!1)),v?m=!1:_&&(g||b||(m=!1)),S===34&&d[0]==='"'&&y>=48&&y<=57&&(m=h=!1),h&&m&&(h=_,m=b),!h&&!m){f&&(r.content=qu(r.content,d.index,Ek));continue}if(m)for(n=s.length-1;n>=0;n--){let k=s[n];if(s[n].level<l)break;if(k.single===f&&s[n].level===l){k=s[n];let $,A;f?($=o[2]||"‘",A=o[3]||"’"):($=o[0]||"“",A=o[1]||"”"),r.content=qu(r.content,d.index,A),e[k.token].content=qu(e[k.token].content,k.pos,$),c+=A.length-1,k.token===i&&(c+=$.length-1),a=r.content,u=a.length,s.length=n;continue e}}h?s.push({token:i,pos:d.index,single:f,level:l}):m&&f&&(r.content=qu(r.content,d.index,Ek))}}}function xL(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!SL.test(s)||!n.children||CL(n.children,e)}}function TL(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const ML=/^(?:vbscript|javascript|file|data):/,AL=/^data:image\/(?:gif|png|jpeg|webp);/,uC=["http:","https:","mailto:"];function dC(e){const t=e.trim().toLowerCase();return ML.test(t)?AL.test(t):!0}function fC(e){const t=T1(e,!0);if(t.hostname&&(!t.protocol||uC.includes(t.protocol)))try{t.hostname=GS.default.toASCII(t.hostname)}catch{}return RS(x1(t))}function hC(e){const t=T1(e,!0);if(t.hostname&&(!t.protocol||uC.includes(t.protocol)))try{t.hostname=GS.default.toUnicode(t.hostname)}catch{}return ig(x1(t),`${ig.defaultChars}%`)}function EL(e){switch(e){case 9:case 32:return!0}return!1}function IL(e,t,n,s){const o=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const h=e.lineMax;if(a[t]-e.blkIndent>=4||o.charCodeAt(u)!==62)return!1;if(s)return!0;const m=[],f=[],y=[],S=[],_=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let v=!1,g;for(g=t;g<n;g++){const x=a[g]<e.blkIndent;if(u=i[g]+l[g],d=r[g],u>=d)break;if(o.charCodeAt(u++)===62&&!x){let L=a[g]+1,O,P;o.charCodeAt(u)===32?(u++,L++,P=!1,O=!0):o.charCodeAt(u)===9?(O=!0,(c[g]+L)%4===3?(u++,L++,P=!1):P=!0):O=!1;let B=L;for(m.push(i[g]),i[g]=u;u<d;){const R=o.charCodeAt(u);if(EL(R))R===9?B+=4-(B+c[g]+(P?1:0))%4:B++;else break;u++}v=u>=d,f.push(c[g]),c[g]=a[g]+1+(O?1:0),y.push(a[g]),a[g]=B-L,S.push(l[g]),l[g]=u-i[g];continue}if(v)break;let I=!1;for(let L=0,O=_.length;L<O;L++)if(_[L](e,g,n,!0)){I=!0;break}if(I){e.lineMax=g,e.blkIndent!==0&&(m.push(i[g]),f.push(c[g]),S.push(l[g]),y.push(a[g]),a[g]-=e.blkIndent);break}m.push(i[g]),f.push(c[g]),S.push(l[g]),y.push(a[g]),a[g]=-1}const k=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const A=[t,0];$.map=A,e.md.block.tokenize(e,t,g);const w=e.push("blockquote_close","blockquote",-1);w.markup=">",e.lineMax=h,e.parentType=b,A[1]=e.line;for(let x=0;x<S.length;x++)i[x+t]=m[x],l[x+t]=S[x],a[x+t]=y[x],c[x+t]=f[x];return e.blkIndent=k,!0}function $L(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
|
|
50
|
-
`,i.map=[t,e.line],!0}function NL(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,h=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<i)))){h=!0;break}a=e.sCount[t],e.line=d+(h?1:0);const m=e.push("fence","code",0);return m.info=u,m.content=e.getLines(t+1,d,a,!0),m.markup=c,m.map=[t,e.line],!0}const Ik=["","h1","h2","h3","h4","h5","h6"],$k=["","#","##","###","####","#####","######"];function Nk(e){switch(e){case 9:case 32:return!0}return!1}function LL(e,t,n,s){const o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!Nk(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const h=e.skipCharsBack(c,35,a);h>a&&Nk(o.charCodeAt(h-1))&&(c=h),e.line=t+1;const m=e.push("heading_open",Ik[d],1);m.markup=$k[d],m.map=[t,e.line];const f=e.push("inline","",0);f.content=o.slice(a,c).trim(),f.map=[t,e.line],f.children=[];const y=e.push("heading_close",Ik[d],-1);return y.markup=$k[d],!0}function OL(e){switch(e){case 9:case 32:return!0}return!1}function PL(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!OL(c))return!1;c===r&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const El=[[/^<(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(`${L8.source}\\s*$`),/^$/,!1]];function RL(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<El.length&&!El[l][0].test(r);l++);if(l===El.length)return!1;if(s)return El[l][2];let a=t+1;if(!El[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),El[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 DL(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function pC(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function mC(e,t,n){if(t>=n)return!1;const s=e.charCodeAt(t);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:DL(e,t,n)}const Lk=["","h1","h2"];function BL(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=pC(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let h=0,m,f=t+1;for(;f<n;f++){const g=i[f]+r[f],k=l[f];if(g>=k)break;if(a[f]-c>3)continue;if(a[f]>=c&&(m=o.charCodeAt(g),m===45||m===61)){let A=g+1,w=A;for(;A<k&&o.charCodeAt(A)===m;)A++;for(w=A;A<k;){const x=o.charCodeAt(A);if(x!==9&&x!==32)break;A++}if(A>=k){h=m===61?1:2;break}if(w-g>1)continue}if(a[f]<0||u&&!mC(o,g,k))continue;let $=!1;for(let A=0,w=s.length;A<w;A++)if(s[A](e,f,n,!0)){$=!0;break}if($)break}if(!h)return!1;let y;if(f===t+1){const g=i[t]+r[t];let k=l[t];for(;k>g;){const $=o.charCodeAt(k-1);if($!==9&&$!==32)break;k--}y=o.slice(g,k)}else y=e.getLines(t,f,c,!1).trim();e.line=f+1;const S=m===61?"=":"-",_=e.push("heading_open",Lk[h],1);_.markup=S,_.map=[t,e.line];const b=e.push("inline","",0);b.content=y,b.map=[t,e.line-1],b.children=[];const v=e.push("heading_close",Lk[h],-1);return v.markup=S,e.parentType=d,!0}function gC(e){switch(e){case 9:case 32:return!0}return!1}function Ok(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!gC(i.charCodeAt(l))?-1:l}function Pk(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!gC(c))?-1:a}function FL(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const HL=["0","1","2","3","4","5","6","7","8","9"];function WL(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function UL(e,t,n,s){let o,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,h;const m=e.src,f=e.bMarks,y=e.tShift,S=e.eMarks,_=e.sCount,b=e.bsCount,v=f[l]+y[l];if(v>=S[l])return!1;const g=m.charCodeAt(v);if(g>=48&&g<=57){if(h=Pk(e,l),h<0||(u=!0,r=v,d=FL(e,l,h),c&&d!==1))return!1}else if(g===42||g===45||g===43){if(h=Ok(e,l),h<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(h)>=S[l])return!1;if(s)return!0;const k=m.charCodeAt(h-1),$=String.fromCharCode(k);if(u){const O=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(O.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const A=[l,0];e.tokens[e.tokens.length-1].map=A,e.tokens[e.tokens.length-1].markup=$;let w=!1;const x=e.tokens.length-1,I=e.md.block.ruler.getRulesForState(e,"list"),L=e.parentType;for(e.parentType="list";l<n;){i=h,o=S[l];const O=_[l]+h-(f[l]+y[l]);let P=O;for(;i<o;){const We=m.charCodeAt(i);if(We===9)P+=4-(P+b[l])%4;else if(We===32)P++;else break;i++}const B=i;let R;B>=o?R=1:R=P-O,R>4&&(R=1);const W=O+R,V=e.push("list_item_open","li",1);V.markup=$;const z=[l,0];V.map=z,u&&(V.info=h-r-1===1?HL[m.charCodeAt(r)-48]:m.slice(r,h-1));const ie=e.tight,ae=e.tShift[l],re=e.sCount[l],Te=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=W,e.tight=!0,e.tShift[l]=B-f[l],e.sCount[l]=P,B>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||w)&&(a=!1),w=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Te,e.tShift[l]=ae,e.sCount[l]=re,e.tight=ie,e.push("list_item_close","li",-1).markup=$,l=e.line,z[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let Pe=!1;for(let We=0,Ne=I.length;We<Ne;We++)if(I[We](e,l,n,!0)){Pe=!0;break}if(Pe)break;if(u){if(h=Pk(e,l),h<0)break;r=f[l]+y[l]}else if(h=Ok(e,l),h<0)break;if(k!==m.charCodeAt(h-1))break}return u?e.push("ordered_list_close","ol",-1).markup=$:e.push("bullet_list_close","ul",-1).markup=$,A[1]=l,e.line=l,e.parentType=L,a&&WL(e,x),!0}function Rk(e){return e===9||e===32}function qL(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=pC(e);let h=t+1;for(e.parentType="paragraph";h<n&&!e.isEmpty(h);h++){if(c[h]-u>3||c[h]<0)continue;if(o==="list"&&c[h]>=u){const v=r[h]+l[h],g=a[h];if(v<g){const k=i.charCodeAt(v);if(k===42||k===45||k===43){if(v+1>=g||Rk(i.charCodeAt(v+1)))break}else if(k>=48&&k<=57&&v+1<g){let $=v+1;for(;;){if($>=g){$=-1;break}const A=i.charCodeAt($++);if(A>=48&&A<=57){if($-v>=10){$=-1;break}continue}if((A===41||A===46)&&($>=g||Rk(i.charCodeAt($))))break;$=-1;break}if($>=0)break}}}const S=r[h]+l[h],_=a[h];if(d&&!mC(i,S,_))continue;let b=!1;for(let v=0,g=s.length;v<g;v++)if(s[v](e,h,n,!0)){b=!0;break}if(b)break}const m=e.getLines(t,h,u,!1).trim();e.line=h;const f=e.push("paragraph_open","p",1);f.map=[t,e.line];const y=e.push("inline","",0);return y.content=m,y.map=[t,e.line],y.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function ju(e){switch(e){case 9:case 32:return!0}return!1}function jL(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(v){const g=e.lineMax;if(v>=g||e.isEmpty(v))return null;let k=!1;if(e.sCount[v]-e.blkIndent>3&&(k=!0),e.sCount[v]<0&&(k=!0),!k){const w=e.parentType;e.parentType="reference";let x=!1;for(let I=0,L=l.length;I<L;I++)if(l[I](e,v,g,!0)){x=!0;break}if(e.parentType=w,x)return null}const $=e.bMarks[v]+e.tShift[v],A=e.eMarks[v];return e.src.slice($,A+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const v=c.charCodeAt(o);if(v===91)return!1;if(v===93){u=o;break}else if(v===10){const g=a(r);g!==null&&(c+=g,i=c.length,r++)}else if(v===92&&(o++,o<i&&c.charCodeAt(o)===10)){const g=a(r);g!==null&&(c+=g,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const v=c.charCodeAt(o);if(v===10){const g=a(r);g!==null&&(c+=g,i=c.length,r++)}else if(!ju(v))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const h=e.md.normalizeLink(d.str);if(!e.md.validateLink(h))return!1;o=d.pos;const m=o,f=r,y=o;for(;o<i;o++){const v=c.charCodeAt(o);if(v===10){const g=a(r);g!==null&&(c+=g,i=c.length,r++)}else if(!ju(v))break}let S=e.md.helpers.parseLinkTitle(c,o,i);for(;S.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,S=e.md.helpers.parseLinkTitle(c,o,i,S)}let _;for(o<i&&y!==o&&S.ok?(_=S.str,o=S.pos):(_="",o=m,r=f);o<i&&ju(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&_)for(_="",o=m,r=f;o<i&&ju(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const b=Zf(c.slice(1,u));return b?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:_,href:h}),e.line=r),!0):!1}function Hp(e){switch(e){case 9:case 32:return!0}return!1}const zL=65536;function Wp(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function VL(e,t){for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function Dk(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function KL(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!Hp(l)||r===45&&Hp(l)||!VL(e,t))return!1;for(;i<e.eMarks[o];){const g=e.src.charCodeAt(i);if(g!==124&&g!==45&&g!==58&&!Hp(g))return!1;i++}let a=Wp(e,t+1),c=a.split("|");const u=[];for(let g=0;g<c.length;g++){const k=c[g].trim();if(!k){if(g===0||g===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(k))return!1;k.charCodeAt(k.length-1)===58?u.push(k.charCodeAt(0)===58?"center":"right"):k.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=Wp(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Dk(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(s)return!0;const h=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRulesForState(e,"blockquote"),f=e.push("table_open","table",1),y=[t,0];f.map=y;const S=e.push("thead_open","thead",1);S.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let g=0;g<c.length;g++){const k=e.push("th_open","th",1);u[g]&&(k.attrs=[["style",`text-align:${u[g]}`]]);const $=e.push("inline","",0);$.content=c[g].trim(),$.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let b,v=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let g=!1;for(let $=0,A=m.length;$<A;$++)if(m[$](e,o,n,!0)){g=!0;break}if(g||(a=Wp(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=Dk(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>zL))break;if(o===t+2){const $=e.push("tbody_open","tbody",1);$.map=b=[t+2,0]}const k=e.push("tr_open","tr",1);k.map=[o,o+1];for(let $=0;$<d;$++){const A=e.push("td_open","td",1);u[$]&&(A.attrs=[["style",`text-align:${u[$]}`]]);const w=e.push("inline","",0);w.content=c[$]?c[$].trim():"",w.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return b&&(e.push("tbody_close","tbody",-1),b[1]=o),e.push("table_close","table",-1),y[1]=o,e.parentType=h,e.line=o,!0}var GL=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return ea(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};function Bk(e){switch(e){case 9:case 32:return!0}return!1}var vC=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1;for(let c=0,u=o.length;c<u;c++){const d=o.charCodeAt(c);if(!a)if(Bk(d)){i++,d===9?r+=4-r%4:r++;continue}else a=!0;(d===10||c===u-1)&&(d!==10&&c++,this.bMarks.push(l),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),a=!1,i=0,r=0,l=c+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const o=new rs(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new rs(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let h=d;const m=s?this.eMarks[u]+1:this.eMarks[u];let f=0;const y=this.src,S=this.bsCount,_=this.tShift;for(;h<m&&f<n;){const b=y.charCodeAt(h);if(b===9||b===32)b===9?f+=4-(f+S[u])%4:f++;else if(h-d<_[u])f++;else break;h++}return f>n?new Array(f-n+1).join(" ")+y.slice(h,m):y.slice(h,m)}const o=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let h=0;const m=r[d];let f=m,y;for(d+1<t||s?y=l[d]+1:y=l[d];f<y&&h<n;){const S=i.charCodeAt(f);if(Bk(S))S===9?h+=4-(h+a[d])%4:h++;else if(f-m<c[d])h++;else break;f++}h>n?o[u]=new Array(h-n+1).join(" ")+i.slice(f,y):o[u]=i.slice(f,y)}return o.join("")}};vC.prototype.Token=rs;const zu=[["table",KL,["paragraph","reference"]],["code",$L],["fence",NL,["paragraph","reference","blockquote","list"]],["blockquote",IL,["paragraph","reference","blockquote","list"]],["hr",PL,["paragraph","reference","blockquote","list"]],["list",UL,["paragraph","reference","blockquote"]],["reference",jL],["html_block",RL,["paragraph","reference","blockquote"]],["heading",LL,["paragraph","reference","blockquote"]],["lheading",BL],["paragraph",qL]];var YL=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new GL;for(let e=0;e<zu.length;e++)this.ruler.push(zu[e][0],zu[e][1],{alt:(zu[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const m=e.line;let f=!1;for(let y=0;y<o;y++)if(f=s[y](e,u,n,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const h=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const m=e.line;let f=!1;for(let y=0;y<o;y++){const S=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();f=h[y].fn(e,u,n,!1);const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ea(e.env,"block",h[y].name,_-S,f,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,s){if(!e||e.length===0)return;const o=new vC(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},yC=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}};yC.prototype.Token=rs;const Fk=[["normalize",pL],["block",d8],["inline",iL],["linkify",dL],["replacements",_L],["smartquotes",xL],["text_join",TL]],XL={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},ZL={parseLinkLabel:O1,parseLinkDestination:L1,parseLinkTitle:P1};function QL(){return{...XL}}function JL(){return{...ZL}}var eO=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new YL,this.inline=new oL,this.ruler=new wL;for(let e=0;e<Fk.length;e++){const[t,n]=Fk[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:QL(),helpers:JL(),normalizeLink:fC,normalizeLinkText:hC,validateLink:dC,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new KS),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 yC(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ea(e.env,"core",t[n].name,o-s,!0,!1)}nL(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&u8(e))return this.parse(ZS(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const tO={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function of(e,t,n={},s){Zs(n);const o={...tO,...s||{}},i=ds(t);if(o.fallbackOnGlobalState!==!1&&i)return Fp(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Jl(n,i,()=>e.core.parse(t,n,e).tokens);let r=hd(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=iO(r,o.maxChunks)),pd(t,r))return Fp(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Jl(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return Fp(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),Jl(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),h=e.core.parse(d,n,e).tokens;l!==0&&h.length&&sO(h,l),oO(a,h),l+=u.lineCount}return a})}function hd(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(h){h<=r||(s.push({start:r,end:h,lineCount:l}),r=h,o=0,i=0,l=0)}for(let h=0;h<e.length;){let m=e.indexOf(`
|
|
51
|
-
`,h),f=m;m===-1?(m=e.length,f=e.length):f=m+1;const y=rO(e,h,m);if(t.fenceAware){let b=h;for(;b<m;){const g=e.charCodeAt(b);if(g===32||g===9)b++;else break}const v=e[b];if(v==="`"||v==="~"){let g=b;for(;g<m&&e[g]===v;)g++;const k=g-b;k>=3&&(u?u.marker===v&&k>=u.length&&(u=null):u={marker:v,length:k})}}const S=f-h;o+=S,i+=1,l+=1,y?(a=0,c=0):(a+=1,c+=S);const _=y;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(_)d(f);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=b||c>=v)&&d(f)}h=f}return n&&d(e.length),s}function pd(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!nO(e,t[o].end))return!0;return!1}function nO(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function sO(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function oO(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function iO(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),s+=l}return n}function rO(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const kC=4e6,bC=8e4,lO=1e4,aO=200,cO=1e4,uO=200;function _C(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function dO(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function Gi(e){return e.length===0?0:Sn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function fO(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function hO(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
52
|
-
`,s);o===-1&&(o=e.length);let i=s;for(;i<o;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function pO(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 fO(e,n+1,e.length-1)?!hO(e,t):!1}function mO(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??cO:e.options.fullChunkSizeChars??lO),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??uO:e.options.fullChunkSizeLines??aO);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var Qc=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=Gi(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=hd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(pd(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,Gi(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!pO(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Gi(this.pending)),null;const n=hd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Gi(this.pending)),null;const s=pd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Gi(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=hd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=pd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Gi(this.pending)}]:n;this.commitRanges(s,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:Gi(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Gi(this.pending);return mO(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Zc(e)&&Ri(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=ds(t);n&&($1(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&dO(r,a),this.options.retainTokens!==!1&&_C(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&N1(t),n}catch(s){throw this.markedGlobalStateReason&&(Ri(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){zS(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 gO(e,t,n={},s={}){Zs(n);const o=new Qc(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function vO(e,t,n={},s={}){Zs(n);const o=new Qc(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function yO(e,t,n,s={},o={}){Zs(s);const i=new Qc(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function kO(e,t,n,s={},o={}){Zs(s);const i=new Qc(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function wC(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??kC,o=e.options.autoUnboundedThresholdLines??bC;return t>=s||n>=o}function SC(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??kC))return"yes";const s=e.options.autoUnboundedThresholdLines??bC;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function fc(e,t,n={},s={}){Zs(n);const o=ds(t);if(Zc(n)&&Ri(n),s.fallbackOnGlobalState!==!1&&o)return zS(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:Sn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),Jl(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Qc(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){_C(i,l)}});if(o&&$1(n,o),r.feed(t),r.flushForce(n),o&&(N1(n),s.fallbackOnGlobalState===!1)){const l=_i(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const ta=(e,t,n)=>e<t?t:e>n?n:e;function CC(e){return e.experimental?{...e,...e.experimental}:e}const Hk=[{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"}],Wk=[{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 xC(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function bO(e,t=Math.max(0,e/40|0),n={}){const s=CC(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<Hk.length;l++){const a=Hk[l];if(e<=a.max){if(a.strategy!=="adaptive")return xC(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ta(Math.ceil(e/i),8e3,64e3),maxChunkLines:ta(Math.ceil(t/i),150,700),maxChunks:ta(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function Uk(e,t=Math.max(0,e/40|0),n={}){const s=CC(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<Wk.length;l++){const a=Wk[l];if(e<=a.max){if(a.strategy!=="adaptive")return xC(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ta(Math.ceil(e/i),8e3,64e3),maxChunkLines:ta(Math.ceil(t/i),150,700),maxChunks:ta(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var _O={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"]}}},wO={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},SO={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};const CO=/[&<>"]/,qk=/[&<>"]/g,xO=/&/g,TO=/[<>"]/g,MO={"&":"&","<":"<",">":">",'"':"""};function Up(e){return MO[e]||e}function dn(e){if(e.length===0)return"";if(e.length<32)return CO.test(e)?e.replace(qk,Up):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(xO,"&"):t?e.replace(qk,Up):e.replace(TO,Up)}const AO=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),EO=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function TC(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(AO,(t,n,s)=>{if(n)return n;if(EO.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return Qf(i)?Bc(i):"�"}const o=C1(t);return o!==t?o:t})}function nh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function md(e,t){if(nh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const jk=e=>nh(e)?e:Promise.resolve(e);function hc(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 dn(e)}}function yr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${hc(t[0])}="${dn(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${hc(o[0])}="${dn(o[1])}"`}return n}function MC(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function pc(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
53
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${dn(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
54
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${yr(r)}>${t}</code></pre>
|
|
55
|
-
`}return`<pre><code${yr(e.attrs)}>${t}</code></pre>
|
|
56
|
-
`}function rf(e){return!e.attrs||e.attrs.length===0?`<code>${dn(e.content)}</code>`:`<code${yr(e.attrs)}>${dn(e.content)}</code>`}function fg(e){const t=dn(e.content);return e.attrs?`<pre${yr(e.attrs)}><code>${t}</code></pre>
|
|
57
|
-
`:`<pre><code>${t}</code></pre>
|
|
58
|
-
`}function IO(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="${dn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${dn(n[0][1])}">`}return null}function zk(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${hc(t[0][0])}="${dn(t[0][1])}">`:t.length===2?`<a ${hc(t[0][0])}="${dn(t[0][1])}" ${hc(t[1][0])}="${dn(t[1][1])}">`:`<a${yr(t)}>`}function $O(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 Vk(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 lf(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+yr(n);return s===0&&t&&(i+=" /"),`${i}>`}const NO={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Vu=Object.prototype.hasOwnProperty,rn={code_inline(e,t){return rf(e[t])},code_block(e,t){return fg(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?TC(i.info).trim():"",{langName:l,langAttrs:a}=MC(r),c=n.highlight,u=dn(i.content);if(!c)return pc(i,u,r,l,n);const d=c(i.content,l,a);return nh(d)?d.then(h=>pc(i,h||u,r,l,n)):pc(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],lf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
59
|
-
`:`<br>
|
|
60
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
61
|
-
`:`<br>
|
|
62
|
-
`:`
|
|
63
|
-
`},text(e,t){return dn(e[t].content)},text_special(e,t){return dn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Kk(e,t,n){const s=e.info?TC(e.info).trim():"",{langName:o,langAttrs:i}=MC(s),r=t.highlight,l=dn(e.content);if(!r)return pc(e,l,s,o,t);const a=r(e.content,o,i);if(nh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return pc(e,a||l,s,o,t)}function Ku(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===rn.text)return l.content.length===0?"":dn(l.content);break;case"text_special":if(o.text_special===rn.text_special)return l.content.length===0?"":dn(l.content);break;case"softbreak":if(o.softbreak===rn.softbreak)return r;break;case"hardbreak":if(o.hardbreak===rn.hardbreak)return i;break;case"html_inline":if(o.html_inline===rn.html_inline)return l.content;break;case"code_inline":if(o.code_inline===rn.code_inline)return rf(l);break}const a=o[l.type];if(!a)return lf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:md(c,l.type)}var LO=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...rn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,h,m="",f="",y=!1,S="";for(let _=0;_<e.length;_++){const b=e[_],v=b.type,g=_>0&&e[_-1].hidden?`
|
|
64
|
-
`:"";if(v==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&_+3<e.length){const A=e[_+1],w=e[_+2],x=e[_+3];if(A.type==="paragraph_open"&&A.hidden&&w.type==="inline"&&x.type==="paragraph_close"&&x.hidden){S+=`${g}<li>${this.renderInlineTokens(w.children||[],s,o)}`,_+=3;continue}}if(_+2<e.length){const A=e[_+1],w=e[_+2];if(A.type==="inline"&&w.nesting===-1&&w.tag===b.tag&&!w.hidden){const x=IO(b,g);if(x!==null){S+=`${x+this.renderInlineTokens(A.children||[],s,o)}</${b.tag}>
|
|
65
|
-
`,_+=2;continue}}}if(v==="inline"){const A=b.children||[];if(A.length===1){y||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,h=i.code_inline,m=s.xhtmlOut?`<br />
|
|
66
|
-
`:`<br>
|
|
67
|
-
`,f=s.breaks?m:`
|
|
68
|
-
`,y=!0);const w=A[0];switch(w.type){case"text":if(l===rn.text){S+=dn(w.content);continue}break;case"text_special":if(a===rn.text_special){S+=dn(w.content);continue}break;case"softbreak":if(c===rn.softbreak){S+=f;continue}break;case"hardbreak":if(u===rn.hardbreak){S+=m;continue}break;case"html_inline":if(d===rn.html_inline){S+=w.content;continue}break;case"code_inline":if(h===rn.code_inline){S+=rf(w);continue}break}}S+=this.renderInlineTokens(A,s,o);continue}const k=i[v];if(!k){const A=b.attrs;if(!b.hidden){if(!A||A.length===0)switch(v){case"hr":S+=r?`<hr />
|
|
69
|
-
`:`<hr>
|
|
70
|
-
`;continue;case"heading_open":S+=`<${b.tag}>`;continue;case"heading_close":S+=`</${b.tag}>
|
|
71
|
-
`;continue;case"paragraph_open":S+=`${g}<p>`;continue;case"paragraph_close":S+=`</p>
|
|
72
|
-
`;continue;case"list_item_open":{const w=e[_+1];S+=g+(w&&(w.type==="inline"||w.hidden||w.nesting===-1&&w.tag==="li")?"<li>":`<li>
|
|
73
|
-
`);continue}case"list_item_close":S+=`</li>
|
|
74
|
-
`;continue;case"bullet_list_open":S+=`${g}<ul>
|
|
75
|
-
`;continue;case"bullet_list_close":S+=`</ul>
|
|
76
|
-
`;continue;case"blockquote_open":S+=g+(e[_+1]&&e[_+1].nesting===-1&&e[_+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
77
|
-
`);continue;case"blockquote_close":S+=`</blockquote>
|
|
78
|
-
`;continue;case"ordered_list_open":S+=`${g}<ol>
|
|
79
|
-
`;continue;case"ordered_list_close":S+=`</ol>
|
|
80
|
-
`;continue;case"table_open":S+=`${g}<table>
|
|
81
|
-
`;continue;case"table_close":S+=`</table>
|
|
82
|
-
`;continue;case"thead_open":S+=`${g}<thead>
|
|
83
|
-
`;continue;case"thead_close":S+=`</thead>
|
|
84
|
-
`;continue;case"tbody_open":S+=`${g}<tbody>
|
|
85
|
-
`;continue;case"tbody_close":S+=`</tbody>
|
|
86
|
-
`;continue;case"tr_open":S+=`${g}<tr>
|
|
87
|
-
`;continue;case"tr_close":S+=`</tr>
|
|
88
|
-
`;continue;case"td_open":S+=`${g}<td>`;continue;case"td_close":S+=`</td>
|
|
89
|
-
`;continue;case"th_open":S+=`${g}<th>`;continue;case"th_close":S+=`</th>
|
|
90
|
-
`;continue}else if(A.length===1){const w=A[0];if(v==="ordered_list_open"&&w[0]==="start"){S+=`${g}<ol start="${dn(w[1])}">
|
|
91
|
-
`;continue}if(v==="td_open"&&w[0]==="style"){S+=`${g}<td style="${dn(w[1])}">`;continue}if(v==="th_open"&&w[0]==="style"){S+=`${g}<th style="${dn(w[1])}">`;continue}}}S+=this.renderToken(e,_,s);continue}if(v==="code_block"&&k===rn.code_block){S+=fg(b);continue}if(v==="fence"&&k===rn.fence){S+=Kk(b,s);continue}if(v==="html_block"&&k===rn.html_block){S+=b.content;continue}const $=k(e,_,s,o,this);typeof $=="string"?S+=$:S+=md($,b.type)}return S}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await jk(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return yr(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const h=e[t+1];(h.type==="inline"||h.hidden||h.nesting===-1&&h.tag===r)&&(a=!1)}const c=o&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
92
|
-
`:"",u=a?`>
|
|
93
|
-
`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+yr(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const s=()=>(n||(n={...t}),n);if(Vu.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),Vu.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(Vu.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(Vu.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...NO,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===rn.code_block)return fg(t);if(i==="html_block"&&o.html_block===rn.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):lf(t,r.xhtmlOut===!0);if(i==="fence"&&a===rn.fence)return Kk(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:md(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,h=s.em_open,m=s.em_close,f=s.strong_open,y=s.strong_close,S=t.xhtmlOut===!0,_=S?`<br />
|
|
94
|
-
`:`<br>
|
|
95
|
-
`,b=t.breaks?_:`
|
|
96
|
-
`;if(e.length===1)return Ku(e,t,n,this,s,_,b);let v="";for(let g=0;g<e.length;g++){const k=e[g];if(k.type==="link_open"&&!u&&!d&&g+2<e.length){const w=e[g+1];if(e[g+2].type==="link_close"&&$O(w)){const x=`${zk(k)+Ku([w],t,n,this,s,_,b)}</a>`;if(r===rn.softbreak&&g+3<e.length&&e[g+3].type==="softbreak"){v+=x+b,g+=3;continue}v+=x,g+=2;continue}}if(k.type==="link_open"&&!u&&!d&&g+1<e.length&&e[g+1].type==="link_close"){v+=`${zk(k)}</a>`,g+=1;continue}if(k.type==="em_open"&&!h&&!m&&g+2<e.length){const w=e[g+1];if(e[g+2].type==="em_close"&&Vk(w)){v+=`<em>${Ku([w],t,n,this,s,_,b)}</em>`,g+=2;continue}}if(k.type==="strong_open"&&!f&&!y&&g+2<e.length){const w=e[g+1];if(e[g+2].type==="strong_close"&&Vk(w)){v+=`<strong>${Ku([w],t,n,this,s,_,b)}</strong>`,g+=2;continue}}switch(k.type){case"text":if(o===rn.text){const w=k.content.length===0?"":dn(k.content);if(a===rn.html_inline&&g+1<e.length&&e[g+1].type==="html_inline"){for(v+=w+e[++g].content;g+1<e.length&&e[g+1].type==="html_inline";)v+=e[++g].content;continue}v+=w;continue}break;case"text_special":if(i===rn.text_special){k.content.length!==0&&(v+=dn(k.content));continue}break;case"softbreak":if(r===rn.softbreak){v+=b;continue}break;case"hardbreak":if(l===rn.hardbreak){v+=_;continue}break;case"html_inline":if(a===rn.html_inline){for(v+=k.content;g+1<e.length&&e[g+1].type==="html_inline";)v+=e[++g].content;continue}break;case"code_inline":if(c===rn.code_inline){v+=rf(k);continue}break}const $=s[k.type];if(!$){v+=k.block?this.renderToken(e,g,t):lf(k,S);continue}const A=$(e,g,t,n,this);typeof A=="string"?v+=A:v+=md(A,k.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await jk(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
|
|
97
|
-
`;break}}return s}},OO=LO;const PO=[];function Gk(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var RO=class{core;cache=null;stats=Gk();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=Gk(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Zs(s??o?.env),!o||s&&s!==o.env){const O=s??{},P=!!n.__explicitStreamChunkFallbackSetting,B=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,R=!!n.options?.streamChunkedFallback,W=!P&&B,V=R||W,z=n.options?.streamChunkAdaptive!==!1,ie=n.options?.streamChunkTargetChunks??8,ae=n.options?.streamChunkSizeChars,re=n.options?.streamChunkSizeLines,Te=n.options?.streamChunkMaxChunks,Pe=!!n.__explicitStreamChunkConfig,We=n.options?.autoTuneChunks!==!1,Ne=n.options?.streamChunkFenceAware??!0,me=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,be=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let Se,fe=e.length>=me;if(!fe&&be!==void 0&&(Se=Sn(e),fe=Se>=be),fe){const Z=this.parseFullDocument(e,O,n,Se,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ss(O,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!_i(O)?.unbounded}),Z.tokens}else if(V){const Z=(U,q,J)=>U<q?q:U>J?J:U;Se===void 0&&(Se=Sn(e));const pe=We&&!Pe?Uk(e.length,Se,n.options):null,D=pe?.maxChunkChars??(z?Z(Math.ceil(e.length/ie),8e3,64e3):ae??1e4),X=pe?.maxChunkLines??(z?Z(Math.ceil(Se/ie),150,700):re??200),oe=pe?.maxChunks??(z?Z(Math.ceil(e.length/64e3),ie,32):Te),te=e.length>0&&e.charCodeAt(e.length-1)===10,ue=W&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&pe?.strategy!=="plain";if((R||ue)&&(e.length>=D*2||Se>=X*2)&&te){const U=of(n,e,O,{maxChunkChars:D,maxChunkLines:X,fenceAware:pe?.fenceAware??Ne,maxChunks:oe});return this.cache={src:e,tokens:U,env:O,lineCount:Se,lastSegment:void 0,globalStateReason:ds(e)},this.updateCacheLineCount(this.cache,Se),this.recordChunkedParseResult(O,R?"explicit-initial-large-doc":"default-initial-large-doc"),U}}const K=this.parseFullDocument(e,O,n,Se);return Se=K.lineCount,this.cache={src:e,tokens:K.tokens,env:O,lineCount:Se,lastSegment:void 0,globalStateReason:ds(e)},this.updateCacheLineCount(this.cache,Se),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ss(O,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!_i(O)?.unbounded}),K.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ss(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;let i=o.globalStateReason;i===void 0&&(i=ds(o.src),o.globalStateReason=i);const r=ds(e),l=i||r;if(l){const O=s??o.env;Ri(O);const P=this.parseFullDocument(e,O,n),B=P.tokens,R=P.lineCount;return this.cache={src:e,tokens:B,env:O,lineCount:R,lastSegment:void 0,globalStateReason:r},this.updateCacheLineCount(this.cache,R),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ss(O,{area:"stream",path:"stream-full",reason:`global-state:${l}`,unbounded:!!_i(O)?.unbounded}),B}const a=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<a&&e.length<a*1.5&&!e.startsWith(o.src)){const O=s??o.env,P=this.parseFullDocument(e,O,n),B=P.tokens,R=P.lineCount;return this.cache={src:e,tokens:B,env:O,lineCount:R,lastSegment:void 0,globalStateReason:ds(e)},this.updateCacheLineCount(this.cache,R),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ss(O,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!_i(O)?.unbounded}),B}const c=this.getAppendedSegment(o.src,e);if(c&&!this.shouldPreferTailReparseForAppend(o)){let z=function(Ne){const me=Ne.length;let be=0;for(;be<=me;){let Se=Ne.indexOf(`
|
|
98
|
-
`,be);Se===-1&&(Se=me);const fe=Se<me;let K=be,Z=0;for(;K<Se;){const pe=Ne.charCodeAt(K);if(pe===32){if(Z++,K++,Z>=4)return!0;continue}if(pe===9){if(Z+=4-Z%4,K++,Z>=4)return!0;continue}break}if(K<Se){const pe=Ne.charCodeAt(K);switch(pe){case 35:{let D=K;for(;D<Se&&Ne.charCodeAt(D)===35;)D++;const X=D-K;if(X>0&&X<=6){if(D<Se){const oe=Ne.charCodeAt(D);if(oe===32||oe===9||oe===13)return!0}else if(D===Se&&fe)return!0}break}case 62:{const D=K+1;if(D<Se){const X=Ne.charCodeAt(D);if(X===32||X===9||X===13)return!0}else if(D===Se&&fe)return!0;break}case 45:case 42:case 43:{const D=K+1;if(D<Se){const X=Ne.charCodeAt(D);if(X===32||X===9||X===13)return!0}else if(D===Se&&fe)return!0;break}case 96:case 126:{let D=K;for(;D<Se&&Ne.charCodeAt(D)===pe;)D++;if(D-K>=3)return!0;break}default:if(pe>=48&&pe<=57){let D=K+1;for(;D<Se;){const X=Ne.charCodeAt(D);if(X<48||X>57)break;D++}if(D<Se&&Ne.charCodeAt(D)===46){const X=D+1;if(X<Se){const oe=Ne.charCodeAt(X);if(oe===32||oe===9||oe===13)return!0}else if(X===Se&&fe)return!0}}break}}if(Se===me)break;be=Se+1}return!1};const O=o.lineCount??Sn(o.src);let P=3;c.length>5e3?P=8:c.length>1e3?P=6:c.length>200&&(P=4),P=Math.min(P,O);let B=null;const R=n.options?.streamContextParseStrategy??"chars",W=n.options?.streamContextParseMinChars??200,V=n.options?.streamContextParseMinLines??2;let ie=null;const ae=()=>(ie===null&&(ie=Sn(c)),ie),re=this.canDirectlyParseAppend(o),Te=re&&this.shouldUseUnboundedAppend(e,o,c);let Pe=!1;if(!re)switch(R){case"lines":Pe=ae()>=V;break;case"constructs":if(c.length>=W){Pe=!0;break}if(z(c)){Pe=!0;break}Pe=ae()>=V;break;case"chars":default:Pe=c.length>=W}if(P>0&&Pe){const Ne=this.getTailLines(o.src,P)+c;try{const me=this.core.parse(Ne,o.env,n).tokens,be=me.findIndex(Se=>Se.map&&typeof Se.map[1]=="number"&&Se.map[1]>P);if(be!==-1){const Se=me.slice(be),fe=O-P;fe!==0&&this.shiftTokenLines(Se,fe),B={tokens:Se}}}catch{B=null}}else B=null;if(!B){const Ne=O;if(Te)B={tokens:fc(n,c,o.env,{mode:"stream"})},Ne>0&&this.shiftTokenLines(B.tokens,Ne);else{const me=this.core.parse(c,o.env,n);Ne>0&&this.shiftTokenLines(me.tokens,Ne),B=me}}if(o.tokens.length>0&&B.tokens.length>0){const Ne=o.tokens[o.tokens.length-1],me=B.tokens[0];try{Ne.type==="inline"&&me.type==="inline"&&(me.children&&me.children.length>0&&(Ne.children||(Ne.children=[]),this.appendTokens(Ne.children,me.children)),Ne.content=(Ne.content||"")+(me.content||""),B.tokens.shift())}catch{}}const We=o.tokens.length;if(B.tokens.length>0){let Se=function(pe,D){if(!pe&&!D)return!0;if(!pe||!D||pe.length!==D.length)return!1;for(let X=0;X<pe.length;X++)if(pe[X][0]!==D[X][0]||pe[X][1]!==D[X][1])return!1;return!0},fe=function(pe,D){if(!pe&&!D)return!0;if(!pe||!D||pe.length!==D.length)return!1;for(let X=0;X<pe.length;X++)if(!K(pe[X],D[X]))return!1;return!0},K=function(pe,D){if(!pe||!D||pe.type!==D.type)return!1;const X=pe.map,oe=D.map;return!!X!=!!oe||X&&oe&&(X[0]!==oe[0]||X[1]!==oe[1])||pe.tag!==D.tag||pe.nesting!==D.nesting||pe.markup!==D.markup||pe.info!==D.info||pe.block!==D.block||pe.hidden!==D.hidden||!Se(pe.attrs,D.attrs)||!fe(pe.children,D.children)?!1:(pe.type==="inline",(pe.content||"")===(D.content||""))};const Ne=o.tokens,me=B.tokens,be=Math.min(Ne.length,me.length);let Z=0;for(let pe=be;pe>0;pe--){let D=!0;for(let X=0;X<pe;X++){const oe=Ne[Ne.length-pe+X],te=me[X];if(!K(oe,te)){D=!1;break}}if(D){Z=pe;break}}Z>0&&me.splice(0,Z),me.length>0&&this.appendTokens(o.tokens,me)}if(o.src=e,o.globalStateReason=ds(e),o.lineCount=O+(ie??Sn(c)),o.tokens.length>We){const Ne=this.getLastSegment(o.tokens.slice(We),e);Ne?o.lastSegment={tokenStart:We+Ne.tokenStart,tokenEnd:We+Ne.tokenEnd,lineStart:Ne.lineStart,lineEnd:Ne.lineEnd,srcOffset:Ne.srcOffset}:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,Te&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ss(o.env,{area:"stream",path:Te?"stream-unbounded-append":"stream-append",reason:Te?"large-delta":"safe-append",unbounded:Te}),o.tokens}const u=s??o.env,d=this.tryTailSegmentReparse(e,o,u,n);if(d)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ss(u,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),d;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,f=!!n.options?.streamChunkedFallback,y=!h&&!c&&m,S=f||y,_=n.options?.streamChunkAdaptive!==!1,b=n.options?.streamChunkTargetChunks??8,v=n.options?.streamChunkSizeChars,g=n.options?.streamChunkSizeLines,k=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,A=n.options?.autoTuneChunks!==!1,w=n.options?.streamChunkFenceAware??!0;let x=c&&o.lineCount!==void 0?o.lineCount+Sn(c):void 0;if(S){x===void 0&&(x=Sn(e));const O=(ie,ae,re)=>ie<ae?ae:ie>re?re:ie,P=A&&!$?Uk(e.length,x,n.options):null,B=P?.maxChunkChars??(_?O(Math.ceil(e.length/b),8e3,64e3):v??1e4),R=P?.maxChunkLines??(_?O(Math.ceil(x/b),150,700):g??200),W=P?.maxChunks??(_?O(Math.ceil(e.length/64e3),b,32):k),V=e.length>0&&e.charCodeAt(e.length-1)===10,z=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&P?.strategy!=="plain";if((f||z)&&(e.length>=B*2||x>=R*2)&&V){const ie=of(n,e,u,{maxChunkChars:B,maxChunkLines:R,fenceAware:P?.fenceAware??w,maxChunks:W});return this.cache={src:e,tokens:ie,env:u,lineCount:x,lastSegment:void 0,globalStateReason:ds(e)},this.updateCacheLineCount(this.cache,x),this.recordChunkedParseResult(u,f?"explicit-fallback-large-doc":"default-fallback-large-doc"),ie}}const I=this.parseFullDocument(e,u,n,x),L=I.tokens;return x=I.lineCount,this.cache={src:e,tokens:L,env:u,lineCount:x,lastSegment:void 0,globalStateReason:ds(e)},this.updateCacheLineCount(this.cache,x),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ss(u,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!_i(u)?.unbounded}),L}recordChunkedParseResult(e,t){const n=_i(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",ss(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!_i(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ss(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=ds(e);Zc(t)&&Ri(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?SC(n,e.length,s):"no";if(r==="yes"){const a=fc(n,e,t);return ss(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?Sn(e):0)}}let l=s;if(r==="need-lines"&&(l=Sn(e),wC(n,e.length,l))){const a=fc(n,e,t);return ss(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Sn(e):0),{tokens:Jl(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:Sn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t){if(!t.startsWith(e)||!e.endsWith(`
|
|
99
|
-
`))return null;const n=t.slice(e.length);if(!n)return null;const s=n.length;if(n.charCodeAt(s-1)!==10)return null;let o=0,i=-1;for(let l=0;l<s&&!(n.charCodeAt(l)===10&&(i===-1&&(i=l),o++,o>=2));l++);if(o<2)return null;const r=(i===-1?n:n.slice(0,i)).trim();if(r.length===0)return null;if(/^[-=]+$/.test(r)){const l=e.slice(0,-1),a=l.lastIndexOf(`
|
|
100
|
-
`);if(l.slice(a+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(n)?null:n}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=ds(e),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=Sn(e),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
|
|
101
|
-
`,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??PO}getStats(){return{...this.stats}}appendTokens(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}updateCacheLineCount(e,t){e.lineCount=t??Sn(e.src),e.lastSegment=void 0}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t){if(e.length===0)return null;let n=Number.POSITIVE_INFINITY,s=-1,o=0;for(let i=e.length-1;i>=0;i--){const r=e[i];if(r.map&&(r.map[0]<n&&(n=r.map[0]),r.map[1]>s&&(s=r.map[1])),r.nesting<0){o+=-r.nesting;continue}if(r.nesting>0){if(o-=r.nesting,r.level===0&&o<=0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}continue}if(r.level===0&&o===0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}}return null}getLineStartOffset(e,t){if(t<=0)return 0;let n=t,s=-1;for(;n>0;){if(s=e.indexOf(`
|
|
102
|
-
`,s+1),s===-1)return e.length;n--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const h=t.lineCount??Sn(t.src);h>0&&this.shiftTokenLines(d,h);const m=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),f=this.getListParagraphMode(u,0,u.length,0);return(m==="loose"||f==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=ds(e),t.lineCount=Sn(e),r.map&&(r.map[1]=this.getDocLineCount(e)),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:this.getDocLineCount(e),srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const h=this.getTableBodySection(d,0,d.length,0),m=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!h||!m||h.tbodyOpenIndex<0||h.tbodyCloseIndex<0)return null;const f=m.tbodyOpenIndex>=0?d.slice(h.tbodyOpenIndex+1,h.tbodyCloseIndex):d.slice(h.tbodyOpenIndex,h.tbodyCloseIndex+1);if(f.length===0)return null;const y=o.lineEnd-2;y!==0&&this.shiftTokenLines(f,y);const S=m.tbodyCloseIndex>=0?m.tbodyCloseIndex:m.tableCloseIndex;t.tokens.splice(S,0,...f),t.src=e,t.env=n,t.globalStateReason=ds(e),t.lineCount=Sn(e);const _=this.getDocLineCount(e);if(r.map&&(r.map[1]=_),m.tbodyOpenIndex>=0){const b=t.tokens[m.tbodyOpenIndex];b?.map&&(b.map[1]=_)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
103
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
104
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e){const t=Sn(e);return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;const n=[...e];for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}};const Yk={default:wO,zero:SO,commonmark:_O};function DO(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function BO(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 Xk(e){return e.experimental?{...e,...e.experimental}:e}function wo(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 Zk(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(wo(t,o)||wo(e,o))return!0}return!1}function Qk(e,t,n){return wo(t,n)||wo(e,n)}function Jk(e,t){const n=_i(e)?.chunk;if(n?.fallback){ss(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}ss(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function FO(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=Yk[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=Xk(n),typeof n.quotes=="string"){const k=n.quotes;k.length>=4?n.quotes=[k[0],k[1],k[2],k[3]]:n.quotes=["“","”","‘","’"]}let r=Zk(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Zk(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Qk(i?.options,o,"fullChunkedFallback"),c=Qk(i?.options,o,"streamChunkedFallback"),u=!1,d=null;const h=new eO;let m=null;const f=()=>(m||(m=new OO(n)),m);let y=null;const S=()=>(y||(y=new RO(h)),y);let _=null;const b=()=>(_||(_=new KS),_),v=k=>!u&&!!d&&!BO(k,d),g={core:h,block:h.block,inline:h.inline,get linkify(){const k=b();return Object.defineProperty(this,"linkify",{value:k,writable:!0,configurable:!0}),k},get renderer(){const k=f();return Object.defineProperty(this,"renderer",{value:k,writable:!0,configurable:!0}),k},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return v(this)},set(k){const $=Xk(k);return this.options={...this.options,...$},(wo(k,"fullChunkSizeChars")||wo(k,"fullChunkSizeLines")||wo(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(wo(k,"streamChunkSizeChars")||wo(k,"streamChunkSizeLines")||wo(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),wo(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),wo(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set($),typeof $.stream=="boolean"&&(this.stream.enabled=$.stream,y&&(y.reset(),y.resetStats())),this},configure(k){const $=typeof k=="string"?Yk[k]:k;if(!$)throw new Error("Wrong `markdown-it` preset, can't be empty");if($.options&&this.set($.options),$.components){const A=$.components;A.core?.rules&&this.core.ruler.enableOnly(A.core.rules),A.block?.rules&&this.block.ruler.enableOnly(A.block.rules),A.inline?.rules&&this.inline.ruler.enableOnly(A.inline.rules),A.inline2?.rules&&this.inline.ruler2.enableOnly(A.inline2.rules)}return this},enable(k,$){const A=Array.isArray(k)?k:[k],w=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],x=new Set;for(const I of w){if(!I)continue;const L=I.enable(A,!0);for(let O=0;O<L.length;O++)x.add(L[O])}if(!$){const I=A.filter(L=>!x.has(L));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(k,$){const A=Array.isArray(k)?k:[k],w=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],x=new Set;for(const I of w){if(!I)continue;const L=I.disable(A,!0);for(let O=0;O<L.length;O++)x.add(L[O])}if(!$){const I=A.filter(L=>!x.has(L));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(k,...$){const A=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!A)throw new TypeError("MarkdownIt.use: plugin must be a function");const w=[this,...$],x=k;return u=!0,A.apply(x,w),this},render(k,$={}){const A=this.parse(k,$);return f().render(A,this.options,$)},async renderAsync(k,$={}){const A=this.parse(k,$);return f().renderAsync(A,this.options,$)},renderIterable(k,$={}){const A=this.parseIterable(k,$);return f().render(A,this.options,$)},async renderAsyncIterable(k,$={}){const A=await this.parseAsyncIterable(k,$);return f().renderAsync(A,this.options,$)},renderInline(k,$={}){const A=this.parseInline(k,$);return f().render(A,this.options,$)},validateLink:dC,normalizeLink:fC,normalizeLinkText:hC,utils:kN,helpers:{...c8},parse(k,$={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Zs($);let A;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&v(this)){const x=SC(this,k.length);if(x==="yes"){const I=fc(this,k,$);return ss($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),I}x==="need-lines"&&(A=Sn(k))}if(!this.stream.enabled){const x=k.length,I=A??Sn(k),L=this.options.autoTuneChunks!==!1,O=r,P=!a&&v(this),B=!!this.options.fullChunkedFallback,R=P&&x>=2e5,W=L&&!O?bO(x,I,this.options):null;if((B||R)&&(B?x>=(this.options.fullChunkThresholdChars??2e4)||I>=(this.options.fullChunkThresholdLines??400):R)){if(W&&W.strategy!=="plain"){const V=of(this,k,$,{maxChunkChars:W.maxChunkChars,maxChunkLines:W.maxChunkLines,fenceAware:W.fenceAware,maxChunks:W.maxChunks});return Jk($,B?"explicit-full-chunk":"default-large-string"),V}if(B){const V=(me,be,Se)=>me<be?be:me>Se?Se:me,z=this.options.fullChunkAdaptive!==!1,ie=this.options.fullChunkTargetChunks??8,ae=V(Math.ceil(x/ie),8e3,64e3),re=V(Math.ceil(I/ie),150,700),Te=z?ae:this.options.fullChunkSizeChars??1e4,Pe=z?re:this.options.fullChunkSizeLines??200,We=z?V(Math.ceil(x/64e3),ie,32):this.options.fullChunkMaxChunks,Ne=of(this,k,$,{maxChunkChars:Te,maxChunkLines:Pe,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:We});return Jk($,"explicit-full-chunk"),Ne}}if(A!==void 0&&v(this)&&wC(this,x,I)){const V=fc(this,k,$);return ss($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),V}}const w=ds(k);return ss($,{area:"parse",path:"plain",reason:"default-plain"}),Jl($,w,()=>h.parse(k,$,this).tokens)},parseIterable(k,$={}){return Zs($),gO(this,k,$)},parseAsyncIterable(k,$={}){return Zs($),vO(this,k,$)},parseIterableToSink(k,$,A={}){return Zs(A),yO(this,k,$,A)},parseAsyncIterableToSink(k,$,A={}){return Zs(A),kO(this,k,$,A)},parseInline(k,$={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Zs($),Zc($)&&Ri($);const A=h.createState(k,$,this);return A.inlineMode=!0,h.process(A),A.tokens}};if(g.stream={enabled:!!n.stream,parse(k,$){return g.stream.enabled?S().parse(k,$,g):g.parse(k,$??{})},reset(){S().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 k=i.components;k.core?.rules&&g.core.ruler.enableOnly(k.core.rules),k.block?.rules&&g.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&g.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&g.inline.ruler2.enableOnly(k.inline2.rules)}return d=DO(g),g}var HO=FO;function WO(e,t,n){function s(h){return h.trim().split(" ",2)[0]===t}function o(h,m,f,y,S){return h[m].nesting===1&&h[m].attrJoin("class",t),S.renderToken(h,m,f,y,S)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(h,m,f,y){let S,_=!1,b=h.bMarks[m]+h.tShift[m],v=h.eMarks[m];if(l!==h.src.charCodeAt(b))return!1;for(S=b+1;S<=v&&r[(S-b)%a]===h.src[S];S++);const g=Math.floor((S-b)/a);if(g<i)return!1;S-=(S-b)%a;const k=h.src.slice(b,S),$=h.src.slice(S,v);if(!c($,k))return!1;if(y)return!0;let A=m;for(;A++,!(A>=f||(b=h.bMarks[A]+h.tShift[A],v=h.eMarks[A],b<v&&h.sCount[A]<h.blkIndent));)if(l===h.src.charCodeAt(b)&&!(h.sCount[A]-h.blkIndent>=4)){for(S=b+1;S<=v&&r[(S-b)%a]===h.src[S];S++);if(!(Math.floor((S-b)/a)<g)&&(S-=(S-b)%a,S=h.skipSpaces(S),!(S<v))){_=!0;break}}const w=h.parentType,x=h.lineMax;h.parentType="container",h.lineMax=A;const I=h.push("container_"+t+"_open","div",1);I.markup=k,I.block=!0,I.info=$,I.map=[m,A],h.md.block.tokenize(h,m+1,A);const L=h.push("container_"+t+"_close","div",-1);return L.markup=h.src.slice(b,S),L.block=!0,h.parentType=w,h.lineMax=x,h.line=A+(_?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 UO(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let S=0;S<a.length;S++){const _=a[S];if(_==="\\"){S++;continue}if(!u&&_==="'"){c=!c;continue}if(!c&&_==='"'){u=!u;continue}if(!c&&!u&&_===":"){d=S;break}}if(d===-1)return null;const h=a.slice(0,d).trim(),m=a.slice(d+1).trim();if(!h)return null;let f=h;if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))try{f=JSON.parse(f.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(f))return null;let y;if(!m)y="";else if(m.startsWith('"')&&m.endsWith('"')||m.startsWith("'")&&m.endsWith("'"))try{y=JSON.parse(m.replace(/^'/,'"').replace(/'$/,'"'))}catch{y=m}else/^-?\d+(?:\.\d+)?$/.test(m)?y=Number(m):m==="true"||m==="false"?y=m==="true":m==="null"?y=null:y=m;l[f]=y}return l}function qO(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(WO,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
105
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let h,m;const f=d.indexOf("{"),y=f>=0?d.slice(f).trimStart():void 0;if(f===-1)h=d||void 0;else{if(h=d.slice(0,f).trim()||void 0,y?.startsWith("{")){let k=0,$=-1;for(let A=0;A<y.length;A++)if(y[A]==="{"?k++:y[A]==="}"&&k--,k===0){$=A+1;break}$>0&&(m=y.slice(0,$))}m||(h=d||void 0)}if(o)return!0;const S=!!i.env.__markstreamFinal;let _=n+1,b=!1;for(;_<=s;){const k=i.bMarks[_]+i.tShift[_],$=i.eMarks[_];if(i.src.slice(k,$).trim()===":::"){b=!0;break}_++}b||(_=s);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!b&&!S},h&&v.attrSet("data-args",h),m)try{const k=JSON.parse(m);for(const[$,A]of Object.entries(k)){const w=A!=null&&typeof A=="object";v.attrSet(`data-${$}`,w?JSON.stringify(A):String(A))}}catch{const k=UO(m);if(k)for(const[$,A]of Object.entries(k)){const w=A!=null&&typeof A=="object";v.attrSet(`data-${$}`,w?JSON.stringify(A):String(A))}else v.attrSet("data-attrs",m)}const g=[];for(let k=n+1;k<_;k++){const $=i.bMarks[k]+i.tShift[k],A=i.eMarks[k];g.push(i.src.slice($,A))}if(g.some(k=>k.trim().length>0)){let k=g.join(`
|
|
106
|
-
`);k.endsWith(`
|
|
107
|
-
`)||(k+=`
|
|
108
|
-
`),k.endsWith(`
|
|
109
|
-
|
|
110
|
-
`)||(k+=`
|
|
111
|
-
`);const $=i.tokens[i.tokens.length-1];$&&($.raw=k);const A=[];i.md.block.parse(k,i.md,i.env,A),i.tokens.push(...A)}return b&&i.push("vmr_container_close","div",-1),i.line=b?_+1:_,!0},{alt:["paragraph","reference","blockquote","list"]})}const AC=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],jO=["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"],EC=["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"],zO=["svg","g","path"],VO=["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"],KO=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","srcdoc","ping"],GO=["action","data","href","src","srcset","poster","xlink:href","formaction"],YO=["script"],XO=["pre","script","style","textarea","title"],al=new Set(AC),ZO=new Set(EC),Hc=new Set([...AC,...jO,...EC,...zO]),IC=new Set([...Hc,...VO]),QO=new Set(KO),JO=new Set(GO),Jc=new Set(YO),$C=new Set(XO);function NC(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const eP={amp:"&",bsol:"\\",colon:":",newline:`
|
|
112
|
-
`,sol:"/",tab:" "};function LC(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return eP[String(o??"").toLowerCase()]??t})}const Gu=new Set(["http","https","mailto","tel"]),Va=new Set(["http","https"]);function OC(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function tP(e,t){return t==="href"||t==="xlink:href"?Gu:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Va:Gu}function na(e,t={}){const n=NC(LC(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=OC(n);return i?!tP(s,o).has(i):!1}function nP(e){const t=LC(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=OC(NC(t).toLowerCase());return n==="http"||n==="https"}function sP(e,t={}){const n=String(e??"").trim();return n?na(n,t)?"":n:""}function eb(e){return sP(e,{tagName:"img",attrName:"src"})}function to(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kn(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function sh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const oP=/^[a-z][a-z0-9_-]*$/;function tb(e){return oP.test(String(e??"").trim().toLowerCase())}function Oo(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return tb(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":tb(o)?o:""}function ga(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=Oo(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function iP(...e){const t=new Set,n=[];for(const s of e)for(const o of ga(s))t.has(o)||(t.add(o),n.push(o));return n}function rP(e){const t=ga(e);return{key:t.join(","),tags:t}}function PC(e){return Oo(e)}function lP(e,t){const n=String(e??""),s=Oo(t);if(!s)return!1;const o=to(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function RC(e,t){const n=Oo(t);return!!n&&!Hc.has(n)&&!lP(e,n)}function aP(e,t){const n=String(e??""),s=Oo(t);if(!s)return n;const o=to(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const DC=al,cP=Hc,BC=new Set(ZO);BC.delete("details");const uP=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,dP=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,hg=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,fP=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function af(e){return(e.match(hg)?.[1]??"").toLowerCase()}function F1(e){return/^\s*<\s*\//.test(e)}function H1(e,t){return DC.has(t)||/\/\s*>\s*$/.test(e)}function hP(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=af(i);if(r===t){if(F1(i)){if(n===0)return s;n--;continue}H1(i,r)||n++}}return-1}function pP(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=af(o);if(i===t){if(F1(o)){n>0&&n--;continue}H1(o,i)||n++}}return n}function nb(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${to(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function mP(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${to(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function cf(e){const t=e;return String(t.raw??t.content??t.markup??"")}function gP(e){const t=e;return t.meta||(t.meta={}),t.meta}function qp(e,t,n){const s=gP(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function vP(e,t){if(!t.size)return;const n=Array.from(t,m=>new RegExp(String.raw`<\s*${to(m)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=m=>m?n.some(f=>f.test(m)):!1,r=m=>{if(!(!m||!s.length))for(const f of s)f.raw+=m,f.inner+=m},l=()=>{!s.length||!o||(r(`
|
|
113
|
-
`),o=!1)},a=m=>{r(m)},c=m=>{for(let y=0;y<s.length;y++)s[y].raw+=m,y<s.length-1&&(s[y].inner+=m);const f=s.pop();qp(f.token,f.raw,f.inner)},u=m=>{const f=s[s.length-1]?.tag;if(!f)return null;const y=new RegExp(String.raw`^\s*<\s*\/\s*${to(f)}\s*>`,"i");return m.match(y)?.[0]??null},d=m=>!!u(m),h=(m,f,y)=>{const S=y??(m.type==="html_inline"?af(f):"");if(!(S&&t.has(S))){r(f);return}const _=F1(f),b=!_&&H1(f,S);if(_){if(!s.length||s[s.length-1].tag!==S){r(f);return}c(f);return}if(r(f),b){qp(m,f,"");return}s.push({tag:S,token:m,raw:f,inner:""})};for(const m of e){if(m.type==="inline"&&Array.isArray(m.children)){const f=String(m.content??"");if(d(f)?o=!1:l(),!s.length&&!i(f)){o=!1;continue}let y=0,S=!0;for(const _ of m.children){const b=cf(_),v=_.type==="html_inline"?af(b):"",g=v&&t.has(v);let k=b;if(S&&f&&b&&(s.length||g)){const $=f.indexOf(b,y);if($!==-1)a(f.slice(y,$)),k=f.slice($,$+b.length),y=$+b.length;else{if(s.length&&!g)continue;S=!1}}h(_,k,v)}S&&f&&y<f.length&&s.length&&a(f.slice(y)),o=s.length>0;continue}if(s.length&&typeof m.content=="string"){const f=cf(m),y=m.type==="html_block"?u(f):null;if(y){c(`${o?`
|
|
114
|
-
`:""}${y}`),o=s.length>0;continue}if(!m.content)continue;l(),r(m.content),o=!0}}for(const m of s)qp(m.token,m.raw,m.inner)}function yP(e){return/^\s*<\s*[!?]/.test(e)}function kP(e){const t=new Set(cP);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function sb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function bP(e,t){let n=null;for(const i of e.matchAll(uP)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();sb(l,t)&&kn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(dP)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();sb(l,t)&&kn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function _P(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function wP(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(_P(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const h=a.slice(d),m=h.match(hg);if(!m){i("<",c),u=d+1;continue}const f=kn(h);if(f===-1){i("<",c),u=d+1;continue}const y=h.slice(0,f+1),S=(m[1]??"").toLowerCase();t.has(S)?n.push({type:"html_inline",tag:"",content:y,raw:y}):i(y,c),u=d+y.length}}function l(a,c){if(!a)return;const u=bP(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=cf(a),o=s.buffer;const c=kn(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=cf(a),u=(c.match(hg)?.[1]??"").toLowerCase();if(u&&t.has(u)&&kn(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:o??void 0}}const SP=["a","span","strong","em","b","i","u"];function CP(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const h of t.customHtmlTags){const m=Oo(h);m&&n.add(m)}const s=h=>{const m=h,f=new Set(n),y=Array.isArray(m.env?.__markstreamCustomHtmlTags)?m.env.__markstreamCustomHtmlTags:[];for(const v of y){const g=Oo(String(v??""));g&&f.add(g)}const S=kP(Array.from(f)),_=new Set(SP);for(const v of f)_.add(v);return{autoCloseInlineTagSet:_,commonHtmlTags:S,customTagSet:f,shouldMergeHtmlBlockTag:v=>f.has(v)||!S.has(v)||BC.has(v)}},o=h=>{if(h.type==="html_block")return String(h.content??"");if(h.type!=="inline"||!Array.isArray(h.children)||h.children.length!==1)return"";const m=h.children[0];return m?.type!=="html_block"?"":String(h.content??m.content??"")},i=(h,m)=>{h.type="html_block",h.content=m,h.raw=m,h.children=[]},r=h=>h.replace(/^(?:\r?\n)+/,""),l=h=>/^(?: {4}|\t)/.test(h),a=h=>h.replace(/^(?: {4}|\t)/gm,""),c=(h,m)=>{const f=r(h);if(!/\S/.test(f))return[];if(l(f))return[{type:"code_block",content:a(f),raw:f}];const y=f.replace(/^[\t ]+/,"");if(!y)return[];if(y.startsWith("<"))return[{type:"html_block",content:y}];const S={type:"inline",tag:"",nesting:0,content:y,children:[{type:"text",content:y,raw:y}]};return m==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},S,{type:"paragraph_close",tag:"p",nesting:-1}]:m==="text"?[{type:"text",content:y,raw:y}]:[S]},u=(h,m,f)=>h[m-1]?.type==="paragraph_open"&&h[m+1]?.type==="paragraph_close"?"inline":f,d=(h,m)=>{const f=r(m);return!/\S/.test(f)||h.type!=="inline"||!Array.isArray(h.children)?!1:(h.content=`${String(h.content??"")}${f}`,h.children.push({type:"text",content:f,raw:f}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",h=>{const m=h.tokens??[],{commonHtmlTags:f,customTagSet:y}=s(h);for(const S of m){const _=S;if(_.type!=="inline"||!Array.isArray(_.children))continue;const b=String(_.content??""),v=_.children.length?_.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(v)try{const g=wP(v,f);if(_.children=g.children,g.pendingBuffer){const k=b.lastIndexOf(g.pendingBuffer);if(k!==-1){const $=b.slice(0,k);_.content=$,typeof _.raw=="string"&&(_.raw=$)}}}catch(g){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",g)}}vP(m,y)}),e.core.ruler.push("fix_html_inline_tokens",h=>{const m=h.tokens??[],{autoCloseInlineTagSet:f,customTagSet:y,shouldMergeHtmlBlockTag:S}=s(h),_=[];for(let b=0;b<m.length;b++){const v=m[b];if(_.length>0){const[k,$]=_[_.length-1];if(b!==$){if(v.type==="paragraph_open"||v.type==="paragraph_close"){m.splice(b,1),b--;continue}const A=String(v.content??v.raw??"");if(A){const w=m[$],x=`${String(w.content||"")}
|
|
115
|
-
${A}`,I=kn(x),L=I===-1?null:nb(x,k,I+1);if(L){const O=x.slice(0,L.end),P=x.slice(L.end);w.content=O,w.loading=!1,m.splice(b,1),_.pop();const B=d(w,P)?[]:c(P,u(m,b,"paragraph"));B.length&&m.splice(b,0,...B),b--;continue}w.content=x,w.loading!==!1&&(w.loading=!0)}m.splice(b,1),b--;continue}}const g=o(v);if(g){if(yP(g))continue;const k=(g.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),$=/^\s*<\s*\//.test(g);if(!k||!S(k))continue;if(i(v,g),!$)k&&!new RegExp(`^\\s*<\\s*${k}\\b[^>]*\\/\\s*>`,"i").test(g)&&mP(g,k)>0&&_.push([k,b]);else if(_.length>0&&k&&_[_.length-1][0]===k){const[,A]=_[_.length-1],w=m[A];w.content=`${String(w.content||"")}
|
|
116
|
-
${g}`,w.loading=!1,_.pop(),m.splice(b,1),b--}continue}else if(_.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){m.splice(b,1),b--;continue}const k=v.content||"",$=new RegExp(`<\\s*\\/\\s*${_[_.length-1][0]}\\s*>`,"i").test(k);if(k){const[,A]=_[_.length-1],w=m[A];w.content=`${w.content||""}
|
|
117
|
-
${k}`,w.loading!==!1&&(w.loading=!$)}$&&_.pop(),m.splice(b,1),b--}else continue}if(y.size>0){const b=new Map,v=new Map,g=A=>{let w=b.get(A);return w||(w=new RegExp(`<\\s*${A}\\b`,"i"),b.set(A,w)),w},k=A=>{let w=v.get(A);return w||(w=new RegExp(`<\\s*\\/\\s*${A}\\s*>`,"i"),v.set(A,w)),w},$=[];for(let A=0;A<m.length;A++){const w=m[A],x=String(w.content??"");if($.length>0){const L=$[$.length-1],O=m[L.index],P=w.type==="html_block"?k(L.tag).exec(x):null;if(P){const W=P.index+P[0].length,V=x.slice(0,W),z=x.slice(W);O.content=`${String(O.content??"")}
|
|
118
|
-
${V}`,Array.isArray(O.children)&&O.children.push({type:"html_inline",content:`</${L.tag}>`,raw:`</${L.tag}>`}),$.pop();const ie=d(O,z)?[]:c(z,u(m,A,"paragraph"));ie.length?m.splice(A,1,...ie):(m.splice(A,1),A--);continue}if(w.type!=="inline")continue;const B=Array.isArray(w.children)?w.children:[],R=hP(B,L.tag);if(R!==-1){const W=B.slice(0,R+1),V=B.slice(R+1),z=W.map(ie=>String(ie?.content??ie?.raw??"")).join("");if(O.content=`${String(O.content??"")}
|
|
119
|
-
${z}`,Array.isArray(O.children)&&O.children.push(...W),V.length){const ie=V.map(ae=>String(ae.content??ae.raw??"")).join("");if(ie.trim()){const ae=ie.replace(/^\s+/,"");if(d(O,ie))m.splice(A,1),A--;else if(ae.startsWith("<"))m.splice(A,1,{type:"html_block",content:ae});else{const re=c(ie,u(m,A,"paragraph"));m.splice(A,1,...re)}}else m.splice(A,1),A--}else m.splice(A,1),A--;$.pop();continue}O.content=`${String(O.content??"")}
|
|
120
|
-
${x}`,Array.isArray(O.children)&&O.children.push(...B),m.splice(A,1),A--;continue}if(w.type!=="inline")continue;const I=Array.isArray(w.children)?w.children:[];for(const L of y)if((I.length?pP(I,L):g(L).test(x)&&!k(L).test(x)?1:0)>0){$.push({tag:L,index:A});break}}}{let b=0;for(let v=0;v<m.length;v++){const g=m[v];if(g.type==="paragraph_open"){b++;continue}g.type==="paragraph_close"&&(b>0?b--:(m.splice(v,1),v--))}}for(let b=0;b<m.length;b++){const v=m[b];if(v.type==="html_block"){const w=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(w.startsWith("!")||w.startsWith("?")){v.loading=!1;continue}if(y.has(w)){const R=String(v.content??""),W=kn(R),V=W===-1?null:nb(R,w,W+1);v.loading=V?!1:v.loading!==void 0?v.loading:!0;const z=V?.start??-1,ie=V?V.end-V.start:0;if(z!==-1){const ae=R.slice(0,z+ie);let re="";W!==-1&&W<z&&(re=R.slice(W+1,z)),v.children=[{type:w,content:re,raw:ae,attrs:[],tag:w,loading:!1}],v.content=ae,v.raw=ae;const Te=c(R.slice(z+ie)||"","text");Te.length&&m.splice(b+1,0,...Te)}else v.children=[{type:w,content:"",raw:R,attrs:[],tag:w,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(w))continue;v.type="inline";const x=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let I;for(;(I=x.exec(v.content||""))!==null;)I[1],I[2]||I[3]||I[4];const L=String(v.content??""),O=new RegExp(`<\\/\\s*${w}\\s*>`,"i").exec(L),P=O?O.index:-1,B=O?O[0].length:0;if(P!==-1){const R=L.slice(0,P+B),W=(L.slice(P+B)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:R,tag:w,loading:!1}],v.content=R,v.raw=R,W&&m.splice(b+1,0,W.startsWith("<")?{type:"html_block",content:W}:{type:"text",content:W,raw:W})}else v.children=[{type:"html_block",content:v.content,tag:w,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const w=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),x=v.children[1],I=String(x?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(x?.type==="html_inline"&&I===w)continue;f.has(w)?(v.children[0].loading=!0,v.children[0].tag=w,v.children.push({type:"html_inline",tag:w,loading:!0,content:`</${w}>`})):v.children=[{type:"html_block",loading:!0,tag:w,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 w=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(f.has(w))continue;v.children=[{type:"html_block",loading:!1,tag:w,content:v.children.map(x=>x.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const g=String(v.content),k=v,$=k.children[0];if($?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(g)&&(k.children.length=0);continue}const A=String($.content??g).match(fP)?.[1]?.toLowerCase()??"";if(A){if(/\/\s*>\s*$/.test(g)||DC.has(A)){k.children=[{type:"html_inline",content:g}];continue}k.children.length=0}}})}function xP(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 TP(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!xP(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),o+=2}}})}const FC=/\.([a-z0-9]{1,15})$/i,MP=/[_()[\]{}<>]/u,AP=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,EP=/[?#@]/u,IP=/[\\/]/u,$P=/^[\p{L}\p{N}./\\-]+$/u,NP=/^[A-Za-z0-9-]{1,63}$/u,LP=/^xn--[a-z0-9-]{2,59}$/i,OP=/^(?:[A-Z]{1,6}|\d{1,8})$/u,PP=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,RP=/文件名\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,DP=/文件名\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,BP=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,FP=new Set(["ai","md","py","rs","sh","zip"]),HC=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),HP=new Set([...HC,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),WP=new Set(["com","dev","io","page","site"]),UP=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),qP=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]);function Wc(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function jp(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Wc(n)?n:void 0}function ob(e,t){if(!Wc(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 ib(e){const t=eu(e);return Wc(t)?t:void 0}function jP(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function rb(e,t){if(!Wc(t))return;const n=String(e??"").trim().split(/\s+/u).map(jP).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>uf(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>uf(o,{marketTicker:!0}))&&(s.marketTicker=!0),Wc(s)?s:void 0}function xr(e,t=!1){let n;return{options(s){return t||s==null?ob(e,n):ob(e,jp(ib(s),rb(s,n)))},remember(s){const o=ib(s);n=t?jp(n,o):jp(o,rb(s,n))},reset(){n=void 0}}}function lb(e){return NP.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function zP(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return lb(n)||LP.test(n)?t.every(lb):!1}function WC(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function VP(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function KP(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function UC(e,t,n){const s=VP(t);return WC(e)&&KP(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function eu(e){const t=String(e??"");return{explicitFilename:RP.test(t),filename:DP.test(t),marketTicker:BP.test(t)}}function GP(e){return zP(e.split(/[\\/]/)[0]??"")}function YP(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function XP(e){if(MP.test(e)||!$P.test(e))return!0;if(IP.test(e))return!GP(e);const t=e.replace(FC,"");return WC(t)?!0:t.split(".").filter(Boolean).some(YP)}function ZP(e,t,n){if(!(n?HP:HC).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?PP:OP).test(s)}function uf(e,t={}){if(!e||AP.test(e)||EP.test(e))return!1;const n=e.match(FC);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return ZP(e,s,t.marketTicker===!0)?!0:qP.has(s)?!FP.has(s)||t.filename?!0:XP(e):!!(t.explicitFilename&&WP.has(s)||t.filename&&UP.has(s))}const ab=["!"];function Os(e){return{type:"text",content:e,raw:e}}function Hr(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 Wr(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 Yi(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function QP(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(Os(t))}}function cb(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function JP(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function eR(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function tR(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function nR(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=sR(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function sR(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=eu(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=tR(e,s,i),l=JP(o);if(o.markup==="linkify"&&r&&!UC(r,l,t)&&uf(r,n)){e.splice(s,i-s+1,Os(r));continue}const a=cb(l,ab);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=cb(u.content,ab);if(d===-1)continue;const h=u.content[d],m=u.content.slice(0,d);let f=u.content.slice(d);for(let _=c+1;_<i;_++){const b=e[_];b?.type==="text"&&typeof b.content=="string"&&(f+=b.content)}u.content=m,u.raw=m;const y=i-(c+1);y>0&&(e.splice(c+1,y),i=c+1);let S=l;if(a!==-1)S=l.slice(0,a);else if(f){const _=encodeURI(f);if(_&&l.endsWith(_))S=l.slice(0,l.length-_.length);else{const b=h?encodeURI(h):"",v=b?l.indexOf(b):-1;v!==-1&&(S=l.slice(0,v))}}S!==l&&eR(o,S),f&&e.splice(i+1,0,Os(f));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Os(r));const c=i[1],u=l[1].length;Hr(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Yi(c,d,!e[s+4]?.content?.startsWith(")"))),Wr(a,u),e[s+4]?.type==="text"){const h=e[s+4].content?.replace(/^\)\**/,"");h&&a.push(Os(h)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(Os(r));let c=i[1];const u=c.match(/^\*+/);if(u){const h=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let m=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(m+=e[s+4]?.content||"",e[s+4].content=""),Hr(a,h),a.push(Yi(c,m,!e[s+4]?.content?.startsWith(")"))),Wr(a,h),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(Os(f)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Yi(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const h=e[s+4].content?.replace(/^\)/,"");h&&a.push(Os(h)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(Yi(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(Os(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(f=>f[0]==="href")?.[1]||"",a=r.find(f=>f[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),h=[];if(d){u+=1;const f=d[1].length;Hr(h,f)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let f=s+1;f<e.length;f++){const y=d?d[1].length:e[s-3].markup.length,S=e[f];if(y===1&&S.type==="em_close")break;if(y===2&&S.type==="strong_close")break;if(y===3&&(S.type==="em_close"||S.type==="strong_close"))break;c+=1}}const m={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(h.push(m),d){const f=d[1].length;Wr(h,f)}e.splice(s-u,c,...h),s-=h.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(Os(l)),Hr(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(Yi(a,c,u)),Wr(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(Os(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(Os(r)),Hr(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(Yi(l,a,c)),Wr(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(Os(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(Os(r)),Hr(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const h=e[s+2].attrs?.find(m=>m[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(h||c)+e[s+5].content,e[s+5].content=""):c=h||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const h=(e[s+2]?.content??"").indexOf(")");d=h===-1,h===-1&&(c+=e[s+2]?.content?.slice(0,h)||"",e[s+2].content="")}i.push(Yi(a,c,d)),Wr(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];Hr(a,2),a.push(Yi(r,l,!1)),Wr(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;QP(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function oR(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=iR(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function iR(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 rR(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=lR(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function lR(e){let t=0;const n=new Set,s=new Set;let o=0;for(let u=0;u<e.length;u++){const d=e[u],h=d.type;if(h==="strong_open"){t++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const y=e[f];let S=u+1;for(;S<e.length&&e[S].type==="text"&&e[S].content==="";)S++;const _=e[S];m==="__"&&(y?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(h==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(h==="em_open"){o++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const y=e[f];let S=u+1;for(;S<e.length&&e[S].type==="text"&&e[S].content==="";)S++;const _=e[S];m==="_"&&(y?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,s.add(o))}else h==="em_close"&&(s.has(o)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),o--,o<0&&(o=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,h=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],m=c.slice(0,-1);m&&h.unshift({type:"text",content:m,raw:m}),l.splice(i,d,...h)}return l=aR(l),l}function aR(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const h=u.slice(0,d),m=u.slice(d+2);t.push(s),t.push(o),t.push(l),h&&t.push({...c,type:"text",content:h,raw:h}),t.push(a),m&&t.push({...c,type:"text",content:m,raw:m}),n+=6;continue}}if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=cR(e,n+6);if(u){t.push(s),t.push(o),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(s)}return t}function cR(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function uR(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=gR(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function ub(){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 db(){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 fb(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 qC(e,t){if(!e.startsWith("|")||e.includes(`
|
|
121
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function zp(e){return qC(e)!==null}function jC(e){return/^:?-+:?$/.test(e.trim())}function dR(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(jC)}function fR(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function hR(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(jC)&&fR(n)}function pR(e){return e==="|"||e==="|:"}function mR(e){const t=qC(e);return t!==null&&t.every(n=>!n.includes(":"))}function gR(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
122
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
123
|
-
`),d=!t&&!r.includes(`
|
|
124
|
-
`)&&/\r?\n$/.test(n)&&zp(r);if(!t&&(r.includes(`
|
|
125
|
-
`)&&u.length===0&&zp(a)&&hR(c)||d)){const h=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>fb(f)),m=[...ub(),...h,...db()];s.splice(o-1,3,...m)}else if(r.includes(`
|
|
126
|
-
`)&&u.length===0&&zp(a)&&dR(c)){const h=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>fb(f)),m=[...ub(),...h,...db()];s.splice(o-1,3,...m)}else r.includes(`
|
|
127
|
-
`)&&u.length===0&&mR(a)&&pR(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function vR(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=s;let l=0,a=t;for(;a<o;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var yR=vR;const kR=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],df=kR.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),bR=/\\[a-z]+/i,zC="(?:\\\\|\\u0008)",_R=new RegExp(String.raw`${zC}(?:${df})\s*\{[^}]+\}`,"i"),wR=new RegExp(String.raw`(?:${zC})?(?:${df})\s*\{`,"i"),SR=/\\(?:text|frac|left|right|times)/,CR=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,xR=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,TR=/[A-Z]+\s*\([^)]+\)/i,MR=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,AR=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,ER=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,IR={"\b":"\\b","\v":"\\v","\f":"\\f"};function $R(e){let t="";for(const n of e)t+=IR[n]??n;return t}function tc(e){if(!e)return!1;const t=$R(e),n=t.trim();if(ER.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=bR.test(t),o=_R.test(t),i=wR.test(t),r=SR.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=CR.test(t)&&!xR.test(t),c=TR.test(t),u=MR.test(n),d=AR.test(t),h=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),m=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||h||m}const VC=["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"],NR=["cdot","mathbf{","partial","mu_{"],KC=VC.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),GC="[ \r\b\f\v]",LR=new RegExp(`([^\\\\])(${NR.map(e=>e).join("|")})+`,"g"),OR=/span\{([^}]+)\}/,PR=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,RR=/(^|[^\\])\\\r?\n/g,DR=/(^|[^\\])\\$/g,BR=new RegExp(`(${GC})|(${KC})\\b`,"g"),hb=new Map,pb=new Map;function FR(e){if(!e)return BR;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=hb.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${GC})|(${o})\\b`,"g");return hb.set(n,i),i}function HR(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=pb.get(s);if(o)return o;const i=e?[df,KC].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),df].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return pb.set(s,r),r}const mb={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function gb(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function vb(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function Xi(e,t){const n=t?.commands??VC,s=t?.escapeExclamation??!0,o=t?.commands==null,i=FR(o?void 0:n);let r=e.replace(i,(c,u,d,h,m)=>{if(u!==void 0&&mb[u]!==void 0)return`\\${mb[u]}`;if(d&&n.includes(d)){const f=m&&typeof h=="number"?m[h-1]:void 0;return f==="\\"||f&&/\w/.test(f)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=HR(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(OR,"span\\{$1\\}").replace(PR,"\\operatorname{span}\\{$1\\}"),l=l.replace(RR,`$1\\\\
|
|
128
|
-
`),l=l.replace(DR,"$1\\\\"),l=l.replace(LR,"$1\\$2"),l}function yb(e){const t=e.trim();return!(!tc(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 WR(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function kb(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function UR(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function YC(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function pg(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(YC(e,s)){n=s+1;continue}return s}return-1}function Vp(e,t){let n=t;for(;n<e.length;){const s=pg(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function Kp(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function qR(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function Gp(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function jR(e,t){const n=(i,r)=>{const l=i,a=!!t?.strictDelimiters,c=!l?.env?.__markstreamFinal,u=(_,b)=>{let v=b;for(;v<_.length&&(_[v]===" "||_[v]===" ");)v++;if(v===b||!(_[v]===`
|
|
129
|
-
`||_[v]==="\r"&&_[v+1]===`
|
|
130
|
-
`))return b;const g=_.slice(b,v),k=l.push("text","",0);return k.content=g,v};if(/^\*[^*]+/.test(l.src))return!1;const d=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(l.pending??""),m=Math.max(0,l.pos-h.length);let f=m,y=m;const S=m;for(const[_,b]of d){const v=l.src,g=WR(v),k=UR(v,c);let $=!1;_==="$$"&&f!==S&&(f=S);let A=-1,w=-1,x=0;const I=L=>{if((L==="undefined"||L==null)&&(L=""),L==="\\"){l.pos=l.pos+L.length,f=l.pos;return}if(L==="\\)"||L==="\\("){const B=l.push("text_special","",0);B.content=L==="\\)"?")":"(",B.markup=L,l.pos=l.pos+L.length,f=l.pos;return}if(!L)return;if(_==="$$"&&L.includes("$")){let B=0;for(;B<L.length;){const R=pg(L,B);if(R===-1){const Ne=L.slice(B);if(Ne){const me=l.push("text","",0);me.content=Ne,l.pos=l.pos+Ne.length,f=l.pos}break}if(R>0&&L[R-1]==="$"||R+1<L.length&&L[R+1]==="$"){const Ne=L.slice(B,R+1);if(Ne){const me=l.push("text","",0);me.content=Ne,l.pos=l.pos+Ne.length,f=l.pos}B=R+1;continue}const W=L.slice(B,R);if(W){const Ne=l.push("text","",0);Ne.content=W,l.pos=l.pos+W.length,f=l.pos}const V=Vp(L,R+1);if(V===-1){const Ne=L.slice(R),me=l.push("text","",0);me.content=Ne,l.pos=l.pos+Ne.length,f=l.pos;break}const z=L.slice(R+1,V),ie=z.includes("`"),ae=!z||!z.trim(),re=L[V+1],Te=Kp(z,re),Pe=Gp(z);if(!ie&&!ae&&!Te&&!Pe){const Ne=l.push("math_inline","math",0);Ne.content=Xi(z,t),Ne.markup="$",Ne.raw=`$${z}$`,Ne.loading=!1,l.pos=l.pos+(V-R+1),f=l.pos,B=V+1;continue}const We=l.push("text","",0);We.content="$",l.pos=l.pos+1,f=l.pos,B=R+1}return}const O=L.indexOf("![");if(O!==-1){if(O>0){const W=L.slice(0,O),V=l.push("text","",0);V.content=W,l.pos=l.pos+W.length,f=l.pos}const B=L.slice(O).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,W,V]=B,z=V.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),ie=z?z[1]:V,ae=z&&z[2]?z[2]:null,re=l.push("image","img",0);re.attrs=[["src",ie],["alt",W]],ae&&re.attrs.push(["title",ae]),re.content=W,re.children=[{type:"text",content:W,tag:""}],l.pos=l.pos+B[0].length,f=l.pos;const Te=L.slice(O+B[0].length);Te&&I(Te);return}const R=l.push("text","",0);R.content=L,l.pos=l.pos+L.length,f=l.pos;return}const P=l.push("text","",0);P.content=L,l.pos=l.pos+L.length,f=l.pos};for(;!(f>=v.length);){const L=v.indexOf(_,f);if(L===-1)break;if(YC(v,L)){f=L+Math.max(1,_.length);continue}const O=kb(g,L);if(O){f=O[1];continue}const P=kb(k,L);if(P){f=P[1];continue}if(L===A&&f===w){if(x++,x>2){f=L+Math.max(1,_.length);continue}}else x=0,A=L,w=f;if(_==="("&&L>0){let Te=L-1;for(;Te>=0&&v[Te]===" ";)Te--;if(Te>=0&&v[Te]==="]"){f=L+_.length;continue}}if(_==="$"&&L>0&&v[L-1]==="$"){f=L+1;continue}if(_==="$"&&L<v.length-1&&v[L+1]==="$"){f=L+2;continue}const B=_==="$"?Vp(v,L+_.length):yR(v,L+_.length,_,b);if(B===-1){const Te=v.slice(L+_.length);if(Te.includes(_)){f=v.indexOf(_,L+_.length);continue}if(B===-1){const Pe=_==="$"&&qR(Te);if(c&&!a&&!Pe&&tc(Te)&&!Te.includes("`")){if(f=L+_.length,$=!0,!r){l.pending="";const We=y?v.slice(y,f):v.slice(0,f),Ne=gb(We)%2===1;if(y)I(v.slice(y,f));else{let me=v.slice(0,f);me.endsWith(_)&&(me=me.slice(0,me.length-_.length)),I(me)}if(Ne){const me=vb(We)?.marker??"**",be=l.push("strong_open","",0);be.markup=me;const Se=l.push("math_inline","math",0);Se.content=Xi(Te,t),Se.markup=_==="$$"?"$$":_==="\\("?"\\(\\)":_==="$"?"$":"()",Se.raw=`${_}${Te}${b}`,Se.loading=!0,be.content=Te,l.push("strong_close","",0)}else{const me=l.push("math_inline","math",0);me.content=Xi(Te,t),me.markup=_==="$$"?"$$":_==="\\("?"\\(\\)":_==="$"?"$":"()",me.raw=`${_}${Te}${b}`,me.loading=!0}l.pos=v.length}f=v.length,y=f}break}}const R=v.slice(L+_.length,B),W=R.includes("`"),V=!R||!R.trim(),z=_==="$",ie=v[B+b.length],ae=z&&Kp(R,ie),re=z&&Gp(R);if(a?W||V||ae||re:W||V||ae||re||!z&&!tc(R)){f=B+b.length;const Te=v.slice(l.pos,f);l.pending||(I(Te),y=f);continue}if($=!0,!r){const Te=v.slice(l.pos-(l.pending??"").length,L);let Pe=v.slice(0,f)?v.slice(y,L):Te;const We=gb(Pe)%2===1;L!==l.pos&&We&&(Pe=l.pending+v.slice(l.pos,L));const Ne=We?vb(Pe):null,me=Ne?.marker??"**";if(l.pending!==Pe)if(l.pending="",We)if(Ne){const be=Pe.slice(Ne.index+me.length);I(Pe.slice(0,Ne.index));const Se=l.push("strong_open","",0);Se.markup=me;const fe=l.push("text","",0);fe.content=be,l.push("strong_close","",0)}else I(Pe);else I(Pe);if(We){const be=l.push("strong_open","",0);be.markup=me;const Se=l.push("math_inline","math",0);Se.content=Xi(R,t),Se.markup=_==="$$"?"$$":_==="\\("?"\\(\\)":_==="$"?"$":"()",Se.raw=`${_}${R}${b}`,Se.loading=!1;const fe=v.slice(B+b.length).startsWith(me);return fe&&l.push("strong_close","",0),l.pos=u(v,B+b.length),f=l.pos,y=f,fe||l.push("strong_close","",0),!0}else{const be=l.push("math_inline","math",0);be.content=Xi(R,t),be.markup=_==="$$"?"$$":_==="\\("?"\\(\\)":_==="$"?"$":"()",be.raw=`${_}${R}${b}`,be.loading=!1}}return f=u(v,B+b.length),y=f,l.pos=f,!0}if($){if(r)l.pos=f;else{if(_==="$$"&&f<v.length&&v.slice(f).includes("$")){let L=f;for(;!(L>=v.length);){const O=pg(v,L);if(O===-1)break;if(O+1<v.length&&v[O+1]==="$"){L=O+2;continue}if(O>0&&v[O-1]==="$"){L=O+1;continue}const P=Vp(v,O+1);if(P===-1)break;const B=v.slice(O+1,P),R=B.includes("`"),W=!B||!B.trim(),V=v[P+1],z=Kp(B,V),ie=Gp(B);if(!R&&!W&&!z&&!ie){const ae=v.slice(f,O);ae&&I(ae);const re=l.push("math_inline","math",0);re.content=Xi(B,t),re.markup="$",re.raw=`$${B}$`,re.loading=!1,f=P+1,L=P+1}else I("$"),L=O+1}L<v.length&&I(v.slice(L))}else f<v.length&&I(v.slice(f));l.pos=v.length}return!0}}return!1},s=(i,r,l,a)=>{const c=i,u=!c?.env?.__markstreamFinal,d=t?.strictDelimiters,h=d?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[r]+c.tShift[r];let f=c.src.slice(m,c.eMarks[r]).trim(),y=!1,S="",_="",b=!1;for(const[R,W]of h)if(f.startsWith(R))if(R.includes("["))if(t?.strictDelimiters){if(f.replace("\\","")==="["){if(r+1<l){y=!0,S=R,_=W;break}continue}}else if(f.replace("\\","")==="["){if(r+1<l){y=!0,S=R,_=W;break}continue}else{const V=c.tokens[c.tokens.length-1];if(V&&V.type==="list_item_open"&&V.mark==="-"&&f.slice(R.length,f.indexOf("]")).trim()==="x")continue;if(f.replace("\\","").startsWith("[")&&!f.includes("](")){const z=f.indexOf("]");if(f.slice(z).trim()!=="]")continue;const ie=f.slice(R.length,z);if(R==="["?yb(ie):tc(ie)){y=!0,S=R,_=W;break}continue}}else{y=!0,S=R,_=W;break}else if(R==="$$"&&f.endsWith(R)&&!f.slice(0,f.length-R.length).trim().includes(R)&&r+1<l){c.push("text","",0).content=f.slice(0,f.length-R.length);const V=c.bMarks[r+1]+c.tShift[r+1];f=c.src.slice(V,c.eMarks[r+1]).trim(),b=!0,y=!0,S=R,_=W;break}if(!y)return!1;if(a)return!0;const v=f.indexOf(S),g=v+S.length,k=!d&&S==="["?f.indexOf("\\]",g):-1,$=k>=0?"\\]":_,A=k>=0?k:f.indexOf(_,g);if(A>S.length){const R=f.slice(v+S.length,A),W=c.push("math_block","math",0);return W.content=Xi(R),W.markup=S==="$$"?"$$":S==="["?"[]":"\\[\\]",W.map=[r,r+1],W.raw=`${S}${R}${$}`,W.block=!0,W.loading=!1,c.line=r+1,!0}let w=r,x="",I=!1;const L=f===S?"":f.slice(S.length),O=!d&&S==="\\["?"]":"";if(L.includes(_)){const R=L.indexOf(_);x=L.slice(0,R),I=!0,w=r}else for(L&&!b&&(x=L),w=r+1;w<l;w++){const R=c.bMarks[w]+c.tShift[w],W=c.eMarks[w],V=c.src.slice(R,W),z=V.trim();if(!d&&S==="["&&z==="\\]"){_="\\]",I=!0;break}if(O&&V.trim()===O){_=O,I=!0;break}if(z===_){I=!0;break}else if(!d&&S==="["&&V.includes("\\]")){I=!0;const ie=V.indexOf("\\]");_="\\]",x+=(x?`
|
|
131
|
-
`:"")+V.slice(0,ie);break}else if(V.includes(_)){I=!0;const ie=V.indexOf(_);x+=(x?`
|
|
132
|
-
`:"")+V.slice(0,ie);break}x+=(x?`
|
|
133
|
-
`:"")+V}if((!u||d)&&!I)return!1;const P=/^\s*!\[/.test(x);if(!(S==="$$"?!P:S==="["?yb(x):tc(x)))return!1;const B=c.push("math_block","math",0);return B.content=Xi(x),B.markup=S==="$$"?"$$":S==="["?"[]":"\\[\\]",B.raw=`${S}${x}${x.startsWith(`
|
|
134
|
-
`)?`
|
|
135
|
-
`:""}${_}`,B.map=[r,w+1],B.block=!0,B.loading=!I,c.line=w+1,!0},o=(i,r,l,a)=>{const c=i,u=c.bMarks[r]+c.tShift[r],d=c.src.slice(u,c.eMarks[r]).trim();return!d.startsWith("$$")&&!d.startsWith("\\[")?!1:s(i,r,l,a)};e.inline.ruler.before("escape","math",n),e.block.ruler.before("lheading","explicit_math_block",o,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function zR(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function VR(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=new HO({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return(e.enableMath??!0)&&jR(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&qO(o),e.enableFixIndentedCodeBlock!==!1&&TP(o),nR(o),rR(o),oR(o),uR(o),zR(o),CP(o,{customHtmlTags:e.customHtmlTags}),o}function tl(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=>tl(n))),t}function KR(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function GR(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function YR(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Yu(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...bn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const bb=/\r?\n[ \t]*`+\s*$/,XC=["diff ","index ","--- ","+++ ","@@ "],XR=/\r?\n/;function ZR(e){const t=String(e??"");return t?XC.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function _b(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function QR(e,t){const n=[],s=[],o=[],i=[],r=e.split(XR),l=/\r?\n$/.test(e),a=r.some(m=>m.startsWith("diff ")||m.startsWith("--- ")||m.startsWith("+++ ")||m.startsWith("@@ ")),c=m=>{const f=m;if(!XC.some(y=>f.startsWith(y)))if(f.startsWith("-")){const y=f.slice(1);o.push(!a&&y.startsWith(" ")?` ${y}`:y)}else if(f.startsWith("+")){const y=f.slice(1);i.push(!a&&y.startsWith(" ")?` ${y}`:y)}else{_b(n,s,o,i);const y=a&&f.startsWith(" ")?f.slice(1):f;n.push(y),s.push(y)}},u=l?Math.max(0,r.length-1):r.length;for(let m=0;m<u;m++){const f=r[m]??"";!t&&!l&&m===u-1&&ZR(f)||c(f)}(t||o.length>0||i.length>0)&&_b(n,s,o,i);const d=n.join(`
|
|
136
|
-
`),h=s.join(`
|
|
137
|
-
`);return{original:t&&l&&d?`${d}
|
|
138
|
-
`:d,updated:t&&l&&h?`${h}
|
|
139
|
-
`:h}}function W1(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(bb.test(a)&&(a=a.replace(bb,"")),r){const{original:c,updated:u}=QR(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function JR(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function e7(){return{type:"hardbreak",raw:`\\
|
|
140
|
-
`}}function t7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...bn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let Yp=null;const Xp=new WeakMap;function wb(){return Yp||(Yp={customTagSet:null,allowedTagSet:ih()}),Yp}function ZC(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function QC(e){return/^<\s*\//.test(e)}function JC(e,t){return/\/\s*>\s*$/.test(t)||al.has(e)}function n7(e){if(!e||e.length===0)return wb();const t=Xp.get(e);if(t)return t;const n=e.map(Oo).filter(Boolean);if(!n.length){const o=wb();return Xp.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:ih({customHtmlTags:e})};return Xp.set(e,s),s}function ex(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function s7(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function ff(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function o7(e,t,n){const s=e.slice();return ff(s,"href")||s.push(["href",t]),n!=null&&!ff(s,"title")&&s.push(["title",n]),s}function mg(e){return e.map(ex).join("")}function gd(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:gd(s.children)});continue}t.push(s)}return t}function i7(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=ZC(r),a=QC(r),c=JC(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function Zp(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?i7(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:mg(s),innerTokens:o,nextIndex:i}}function r7(e,t,n,s,o,i,r){const l=String(e.content??""),a=ZC(l),{customTagSet:c,allowedTagSet:u}=n7(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Zp(t,n,a).closed){const k=ex(e);return[{type:"text",content:k,raw:k},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=QC(l),h=JC(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const k=Zp(t,n,a),$=sh(l),A=k.innerTokens,w=String(ff($,"href")??""),x=ff($,"title"),I=x==null?null:String(x),L=o7($,w,I),O=gd(A.length?s(A,o,i,r):[]),P=A.length?mg(A):w||"";return!O.length&&P&&O.push({type:"text",content:P,raw:P}),[{type:"link",href:w,title:I,text:P,attrs:L,children:O,loading:!k.closed,raw:k.html||l},k.nextIndex]}if(h)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const m=Zp(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:gd(m.innerTokens.length?s(m.innerTokens,o,i,r):[]),raw:m.html},m.nextIndex];const f=gd(m.innerTokens.length?s(m.innerTokens,o,i,r):[]);let y=m.html||l,S=!m.closed,_=!1;if(!m.closed){const k=`</${a}>`;y.toLowerCase().includes(k.toLowerCase())||(y+=k),_=!0,S=!0}const b=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let g;for(;(g=v.exec(l))!==null;){const k=g[1],$=g[2]||g[3]||g[4]||"";b.push([k,$])}if(c?.has(a)){const k=s7(e);return[{type:a,tag:a,attrs:b,content:k?k.inner:m.innerTokens.length?mg(m.innerTokens):"",children:m.innerTokens.length?s(m.innerTokens,o,i,r):[],raw:k?.raw??y,loading:e.loading||S,autoClosed:_},m.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:y,children:f,raw:y,loading:S,autoClosed:_},m.nextIndex]}function tx(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=>tx(t)).join(""):String(e.content??"")}function l7(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>tx(t)).join("")}function Sb(e,t=!1){let n=e.attrs??[],s=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const h=d.attrs;if(Array.isArray(h)&&h.length>0){n=h,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=l7(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:o,alt:l,title:c,raw:u,loading:t}}function a7(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function c7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...bn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function u7(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function hf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function d7(e,t,n){const s=e.slice();return hf(s,"href")||s.push(["href",t]),n!=null&&!hf(s,"title")&&s.push(["title",n]),s}function Xu(e,t,n){const s=e[t],o=u7(s.attrs),i=String(hf(o,"href")??""),r=hf(o,"title"),l=r==null?null:String(r),a=d7(o,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let h=u;const m=u[u.length-1];if(n?.__insideStrong&&m?.type==="text"&&String(m.content??"").endsWith("**")&&!u.some(S=>S.type==="strong_open")){const S=String(m.content??""),_=String(m.raw??S),b=tl(m);b.content=S.slice(0,-2),b.raw=_.replace(/\*\*$/,""),h=u.slice(),h[h.length-1]=b}const f=bn(h,void 0,void 0,n),y=f.map(S=>{const _=S;return"content"in S?String(_.content??""):String(_.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:y,children:f,raw:`[${y}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function Cb(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 f7(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function xb(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...bn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const h7=/\\([\\()[\]`$|*_\-!])/g;function p7(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(h7,"$1")===t))return n}function Ka(e,t,n,s){const o=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...s,__insideStrong:!0};return o.push(...bn(l,p7(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function m7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...bn(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function g7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...bn(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function v7(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const y7=/[^~]*~{2,}[^~]+/,k7=/\*\*/,b7=/[[_*^~]/,_7=/\\([\\()[\]`$|*_\-!])/g,U1=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),w7=/\s/u,S7=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,C7=/\p{P}/u,x7=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,T7=/:\/\//;function M7(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 nx(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&U1.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function kr(e){return!!e&&w7.test(e)}function br(e){return!!e&&(S7.test(e)||C7.test(e))}function A7(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||kr(s)?!1:!(br(s)&&n&&!kr(n)&&!br(n))}function E7(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||kr(n)?!1:!(br(n)&&s&&!kr(s)&&!br(s))}function I7(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?nx(e,s):t.indexOf("*",s);if(i===-1)break;if(E7(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function $7(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||kr(s)?!1:!(br(s)&&n&&!kr(n)&&!br(n))}function N7(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||kr(n)?!1:!(br(n)&&s&&!kr(s)&&!br(s))}function L7(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(N7(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function O7(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&U1.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function P7(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&U1.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function R7(e,t,n){const s=P7(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const D7=/[\p{L}\p{N}]/u,B7=/^[\p{L}\p{N}]+$/u;function gg(e){return e?D7.test(e):!1}function sx(e){return e?B7.test(e):!1}function mc(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:gg(s)&&gg(o)}}function F7(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=mc(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!sx(e.slice(s.end,o.start)))return o.end}return-1}function H7(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function W7(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=mc(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function U7(e){return e?x7.test(e)||T7.test(e):!1}function q7(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function bn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=eu(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,h=e;function m(){return e===h&&(e=e.slice()),e}function f(){c=null}function y(K,Z){const pe=e.length===1?t:String(Z.content??""),D=[],X=F7(K);if(X!==-1){k(K.slice(0,X),K.slice(0,X));const te=K.slice(X);return te&&(I({type:"text",content:te,raw:te}),u--),u++,!0}if(y7.test(K)){const te=K.indexOf("~~");te!==-1&&D.push({type:"strikethrough",index:te})}if(k7.test(K)){const te=K.indexOf("**");te!==-1&&D.push({type:"strong",index:te})}if(/[^*]*\*[^*]+/.test(K)){const te=pe?nx(pe,0):K.indexOf("*");if(pe&&te===-1)return!1;te!==-1&&D.push({type:"emphasis",index:te})}D.sort((te,ue)=>te.index!==ue.index?te.index-ue.index:te.type===ue.type?0:te.type==="strong"?-1:ue.type==="strong"?1:0);const oe=D[0];if(!oe)return!1;if(oe.type==="strikethrough"){const te=oe.index,ue=te>-1?K.slice(0,te):"";if(ue&&k(ue,ue),te===-1)return u++,!0;const U=K.indexOf("~~",te+2),q=U===-1?K.slice(te+2):K.slice(te+2,U),J=U===-1?"":K.slice(U+2),{node:de}=xb([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:q,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return f(),g(de),J&&(I({type:"text",content:J,raw:J}),u--),u++,!0}if(oe.type==="strong"){const te=oe.index,ue=te>-1?K.slice(0,te):"";if(ue&&k(ue,ue),te===-1)return u++,!0;if(t&&te===0){let Me=!1,le=0;for(;le<K.length&&K[le]==="*";)le++;if(t.startsWith("\\*")&&(Me=!0),Me){let _e=0,ze=0;for(;ze<t.length&&_e<le;)if(t[ze]==="\\"&&ze+1<t.length&&t[ze+1]==="*")_e+=1,ze+=2;else{if(t[ze]==="*")break;ze++}if(_e>=2)return k(K,K),u++,!0}}if(t&&(K.match(/\*/g)||[]).length>M7(t))return k(K.slice(ue.length),K.slice(ue.length)),u++,!0;const U=mc(K,te);if(U.len>=3){const Me=W7(K,te+U.len);if(Me!==-1){const le=K.slice(te+U.len,Me);if(H7(le)){const{node:_e}=Ka([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:le,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);f(),g(_e);const ze=K.slice(Me+3);return ze&&(I({type:"text",content:ze,raw:ze}),u--),u++,!0}}}if(!$7(K,te)){const Me=K.slice(te,te+U.len);k(Me,Me);const le=K.slice(te+U.len);return le&&(I({type:"text",content:le,raw:le}),u--),u++,!0}const q=L7(K,te+2);let J="",de="";if(q.index!==-1){J=K.slice(te+2,q.index),de=K.slice(q.index+2);const Me=q.index,le=mc(K,Me);if(U.intraword&&le.intraword&&!sx(J)||!J&&U.len>=4&&U.intraword)return k(K.slice(ue.length),K.slice(ue.length)),u++,!0}else{if(d||q.sawInvalidClose||U.intraword)return k(K.slice(ue.length),K.slice(ue.length)),u++,!0;J=K.slice(te+2),de=""}if(!J&&/^\*+$/.test(de))return k(K,K),u++,!0;const{node:ge}=Ka([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:J,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return f(),g(ge),de&&(I({type:"text",content:de,raw:de}),u--),u++,!0}if(oe.type==="emphasis"){let te=oe.index;te===-1&&(te=0);const ue=K.slice(0,te);if(ue&&k(ue,ue),!A7(K,te)){k(K[te],K[te]);const Me=K.slice(te+1);return Me&&(I({type:"text",content:Me,raw:Me}),u--),u++,!0}const U=mc(K,te),q=I7(pe,K,te+1),J=q.index,de=e[u+1];if(s?.final&&de?.type==="em_open"&&J!==-1&&K.slice(te+1,J).trim()!==K.slice(te+1,J)||J===-1&&(q.sawInvalidClose||s?.final||U.intraword||!gg(K[te+1])))return k(K.slice(te),K.slice(te)),u++,!0;const{node:ge}=Yu([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:J>-1?K.slice(te+1,J):K.slice(te+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(f(),g(ge),J!==-1&&J<K.length-1){const Me=K.slice(J+1);Me&&(I({type:"text",content:Me,raw:Me}),u--)}return u++,!0}return!1}function S(K,Z){if(!K.includes("`"))return!1;const D=(de=>{for(let ge=0;ge<de.length;ge++){if(de[ge]!=="`")continue;let Me=0;for(let le=ge-1;le>=0&&de[le]==="\\";le--)Me++;if(Me%2===0)return ge}return-1})(K);if(D===-1)return!1;let X=1;for(let de=D+1;de<K.length&&K[de]==="`";de++)X++;const oe="`".repeat(X),te=D+X,ue=K.indexOf(oe,te);if(ue===-1){if(X===1){const ge=K.slice(0,D),Me=K.slice(D+1);return ge&&(y(ge,Z)?u--:k(ge,ge)),b({type:"inline_code",code:Me,raw:String(Me)}),u++,!0}let de=K;for(let ge=u+1;ge<e.length;ge++)de+=String((e[ge].content??"")+(e[ge].markup??""));return u=e.length-1,k(de,de),u++,!0}f();const U=K.slice(0,D),q=K.slice(D+X,ue),J=K.slice(ue+X);return U&&(y(U,Z)?u--:k(U,U)),b({type:"inline_code",code:q,raw:String(q??"")}),J&&(I({type:"text",content:J,raw:J}),u--),u++,!0}function _(K){const Z=l?.__markdownIt;if(!Z||e.length<=1||!e.some(oe=>oe?.type==="math_inline")||!b7.test(K))return null;const pe=Z.parseInline(K,{__markstreamFinal:!!s?.final});if(!Array.isArray(pe)||pe.length===0)return null;const D=(pe.find(oe=>oe?.type==="inline")?.children??[]).filter(oe=>!(oe?.type==="text"&&String(oe.content??"")===""));if(!D.length||!D.some(oe=>oe?.type!=="text")||D.length===1&&D[0]?.type==="text"&&String(D[0].content??"")===K)return null;const X=bn(D,K,n,s);return X.length?X:null}function b(K){f(),a.push(K)}function v(K){f();const Z=tl(K);a.push(Z)}function g(K){b(K)}function k(K,Z){c?(c.content+=K,c.raw+=Z??K):(c={type:"text",content:String(K??""),raw:String(Z??K??"")},a.push(c))}function $(K,Z){if(!K)return;const pe=bn([{...Z,type:"text",content:K,raw:K}],K,n,s);if(pe.length===1&&pe[0]?.type==="text"){const D=pe[0];k(String(D.content??""),String(D.raw??D.content??""));return}for(const D of pe)g(D)}function A(K,Z){return String(K.markup??"").startsWith(Z)}function w(K){return K.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 x(K,Z){let pe=K;const D=String(Z.content??"");return pe.endsWith("\\")&&!A(Z,"\\\\")&&!D.endsWith("\\\\")&&(pe=pe.slice(0,-1)),pe.endsWith("(")&&!A(Z,"\\(")&&!D.endsWith("\\(")&&(pe=pe.slice(0,-1)),/\*+$/.test(pe)&&!A(Z,"\\*")&&!D.endsWith("\\*")&&(pe=pe.replace(/\*+$/,"")),pe}for(;u<e.length;){const K=e[u];I(K)}function I(K){switch(K.type){case"text":O(K);break;case"softbreak":c?(c.content+=`
|
|
141
|
-
`,c.raw+=`
|
|
142
|
-
`):(c={type:"text",content:`
|
|
143
|
-
`,raw:`
|
|
144
|
-
`},a.push(c)),u++;break;case"code_inline":g(a7(K)),u++;break;case"html_inline":{const[Z,pe]=r7(K,e,u,bn,t,n,s);g(Z),u=pe;break}case"link_open":P(K);break;case"image":Pe(K)||(f(),g(Sb(K)),u++);break;case"strong_open":{f();const{node:Z,nextIndex:pe}=Ka(e,u,K.content,s);g(Z),u=pe;break}case"em_open":{f();const{node:Z,nextIndex:pe}=Yu(e,u,s);g(Z),u=pe;break}case"s_open":{f();const{node:Z,nextIndex:pe}=xb(e,u,s);g(Z),u=pe;break}case"mark_open":{f();const{node:Z,nextIndex:pe}=t7(e,u,s);g(Z),u=pe;break}case"ins_open":{f();const{node:Z,nextIndex:pe}=c7(e,u,s);g(Z),u=pe;break}case"sub_open":{f();const{node:Z,nextIndex:pe}=m7(e,u,s);g(Z),u=pe;break}case"sup_open":{f();const{node:Z,nextIndex:pe}=g7(e,u,s);g(Z),u=pe;break}case"sub":f(),g({type:"subscript",children:[{type:"text",content:String(K.content??""),raw:String(K.content??"")}],raw:`~${String(K.content??"")}~`}),u++;break;case"sup":f(),g({type:"superscript",children:[{type:"text",content:String(K.content??""),raw:String(K.content??"")}],raw:`^${String(K.content??"")}^`}),u++;break;case"emoji":{f();const Z=e[u-1];Z?.type==="text"&&/\|:-+/.test(String(Z.content??""))?k("",""):g(YR(K)),u++;break}case"checkbox":f(),g(KR(K)),u++;break;case"checkbox_input":f(),g(GR(K)),u++;break;case"footnote_ref":f(),g(JR(K)),u++;break;case"footnote_anchor":{f();const Z=K.meta??{};b({type:"footnote_anchor",id:String(Z.label??K.content??""),raw:String(K.content??"")}),u++;break}case"hardbreak":f(),g(e7()),u++;break;case"fence":f(),g(W1(e[u])),u++;break;case"math_inline":f(),!K.content&&K.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(g(Cb({...K,content:e[u+1].content})),u+=2):g(Cb(K)),u++;break;case"reference":R(K);break;case"text_special":k(String(K.content??""),String(K.content??"")),u++;break;default:{const Z=K;if(K.type==="link"&&Z.href!=null&&s?.validateLink&&!s.validateLink(String(Z.href))){f();const pe=String(Z.text??"");k(pe,pe),u++}else We(K)||V(K)||ie(K)||W(K)||v(K),u++;break}}}function L(K,Z,pe,D){const X=v7({...Z,content:K});if(c){c.content+=x(X.content,Z),c.raw+=X.raw;return}const oe=pe?.tag==="br"&&e[u-2]?.content==="[";D||(X.content=x(X.content,Z)),c=X,c.center=oe,a.push(c)}function O(K){const Z=String(K.content??""),pe=e.length===1&&Z.includes("\\")&&typeof t=="string"?String(t):"";let D=pe?O7(pe):Z.replace(_7,"$1");if(K.content==="<"||D==="1"&&e[u-1]?.tag==="br"){u++;return}const X=D.indexOf("$");X!==-1&&X===D.lastIndexOf("$")&&D.endsWith("$")&&(D=D.slice(0,-1)),D.endsWith("undefined")&&!t?.endsWith("undefined")&&(D=D.slice(0,-9));let oe=a.length,te="";for(let J=a.length-1;J>=0;J--){const de=a[J];if(de.type!=="text")break;oe=J,te=String(de.content??"")+te}oe<a.length&&(D.startsWith(te)?(c=null,a.length=oe):c=a[a.length-1]);const ue=e[u+1];if((D==="`"||D==="|"||D==="$")&&!A(K,`\\${D}`)||/^\*+$/.test(D)&&!A(K,"\\*")){u++;return}if(!ue&&/[^\]]\s*\(\s*$/.test(D)&&(D=D.replace(/\(\s*$/,"")),!D){u++;return}if(Te(D)||Ne(D))return;if(!(D.includes("*")||D.includes("_")||D.includes("~")||D.includes("`")||D.includes("[")||D.includes("!")||D.includes("$")||D.includes("|")||D.includes("("))){L(D,K,e[u-1],ue),u++;return}if(fe(D))return;const U=e[u-1];if(D==="["&&!ue?.markup?.includes("*")&&!A(K,"\\[")||D==="]"&&!U?.markup?.includes("*")&&!A(K,"\\]")){u++;return}if(S(Z,K)||Se(D)||(e[u+1]?.type!=="link_open"||w(D))&&be(D,K))return;const q=_(Z);if(q){f();for(const J of q)g(J);u++;return}y(D,K)||(L(D,K,U,ue),u++)}function P(K){if(B(K))return;if(me()){const{node:ue,nextIndex:U}=Xu(e,u,s),q=String(ue.text||ue.href||"");k(q,q),u=U;return}f();const{node:Z,nextIndex:pe}=Xu(e,u,s);u=pe;const D=Z.text||Z.href||"";if(K.markup==="linkify"&&!UC(D,Z.href,t)&&uf(D,l?.__linkifyDemotionContext)){k(D,D);return}const X=Z.children.length===1&&Z.children[0]?.type==="text";if(Z.loading&&t&&Z.text===Z.href&&X){const ue=q7(t,Z.href);ue&&(Z.text=ue,Z.children=[{type:"text",content:ue,raw:ue}],Z.raw=`[${ue}](${Z.href}${Z.title?` "${Z.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(Z.href)){k(Z.text,Z.text);return}const oe=K.attrs?.find(([ue])=>ue==="href")?.[1],te=String(oe??"");if(t&&te){const ue=t.indexOf("](");if(ue!==-1){const U=t.indexOf(")",ue+2);U===-1?Z.loading=!0:Z.loading&&t.slice(ue+2,U).includes(te)&&(Z.loading=!1)}}W(Z)||b(Z)}function B(K){if(K.markup!=="linkify")return!1;const{node:Z,nextIndex:pe}=Xu(e,u,s);return z(Z,pe)?(u=pe,!0):!1}function R(K){f(),g(f7(K)),u++}function W(K){if(K.type!=="link")return!1;const Z=a[a.length-1];if(!Z||Z.type!=="text")return!1;const pe=String(Z.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!pe)return!1;const D=K,X=String(D.href??""),oe=String(D.text??""),te=String(pe[2]??""),ue=X.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!X||!(oe===X||oe===ue||U7(oe)))return!1;const U=String(pe[1]??"");return U?(Z.content=U,Z.raw=U):a.pop(),b({...K,text:te,children:[{type:"text",content:te,raw:te}],raw:`[${te}](${X}${D.title?` "${D.title}"`:""})`}),!0}function V(K){if(K.type!=="link")return!1;const Z=K,pe=String(Z.href??"");return pe?z({href:pe,title:Z.title==null||Z.title===""?null:String(Z.title),loading:!!Z.loading},u+1):!1}function z(K,Z){const pe=a[a.length-1];if(pe?.type!=="image"||pe.src||!pe.loading||!String(pe.raw??"").endsWith("]("))return!1;const D=e[Z],X=String(D?.content??"");if(D?.type!=="text"||!X.startsWith(")"))return!1;a.pop(),c=null;const oe=String(pe.alt??"");b({type:"image",src:K.href,alt:oe,title:K.title,raw:``,loading:!!K.loading});const te=X.slice(1),ue=tl(D);return ue.content=te,ue.raw=te,m()[Z]=ue,!0}function ie(K){if(K.type!=="link")return!1;const Z=a[a.length-1],pe=e[u-1];if(!Z||Z.type!=="text"||pe?.type!=="text")return!1;const D=String(Z.content??""),X=String(pe.content??"");if(!D.endsWith("!")||!X.endsWith("!")||A(pe,"\\!"))return!1;const oe=D.slice(0,-1);oe?(Z.content=oe,Z.raw=oe,c=Z):(a.pop(),c=null);const te=K,ue=String(te.text??te.children?.map(J=>String(J?.content??J?.raw??"")).join("")??""),U=String(te.href??""),q=te.title==null||te.title===""?null:String(te.title);return b({type:"image",src:U,alt:ue,title:q,raw:``,loading:!!te.loading}),!0}function ae(K,Z="",pe=null){const D=String(K.alt??K.raw??"");return{type:"link",href:Z,title:pe,text:D,children:[K],raw:`[${D}](${Z}${pe?` "${pe}"`:""})`,loading:!0}}function re(K){const Z=K.startsWith(";return{type:"image",src:"",alt:D===-1?pe.replace(/\]$/,""):pe.slice(0,D),title:null,raw:Z,loading:!0}}function Te(K){const Z=K.indexOf("[![");if(Z===-1||typeof t=="string"&&e.length===1&&R7(t,Z,"["))return!1;const pe=K.slice(0,Z);return pe&&k(pe,pe),b(ae(re(K.slice(Z+1)))),u++,!0}function Pe(K){if(s?.final)return!1;const Z=e[u-1];if(Z?.type!=="text"||!String(Z.content??"").endsWith("[")||A(Z,"\\["))return!1;const pe=a[a.length-1];if(pe?.type==="text"&&pe.content.endsWith("[")){const D=pe.content.slice(0,-1);D?(pe.content=D,pe.raw=D,c=pe):(a.pop(),c=null)}return b(ae(Sb(K))),u++,!0}function We(K){if(K.type!=="link")return!1;const Z=K,pe=String(Z.raw??""),D=String(Z.text??"");if(!pe.startsWith("[![")&&!D.startsWith("!["))return!1;const X=Z.title==null||Z.title===""?null:String(Z.title);return b(ae({type:"image",src:String(Z.href??""),alt:D.replace(/^!\[/,"").replace(/\]$/,""),title:X,raw:pe.startsWith("[)return!1;const Z=e[u-2];if(Z?.type==="text"&&String(Z.content??"").endsWith("[")&&A(Z,"\\["))return!1;const pe=a[a.length-1];if(pe?.type!=="image"&&pe?.type!=="link")return!1;const D=pe,X=pe?.type==="link"&&Array.isArray(D.children)&&D.children.length===1&&D.children[0]?.type==="image"?a.pop():null,oe=X?X.children[0]:a.pop();if(!oe||oe.type!=="image")return!1;const te=e[u+1];let ue=String(X?.href??""),U=X?.title==null?null:String(X.title),q=!0;if(te?.type==="link_open"){const{node:de,nextIndex:ge}=Xu(e,u+1,s);ue=de.href,U=de.title,q=!0,u=ge}else{if(ue=K.slice(2),ue.includes('"')){const de=ue.split('"');ue=String(de[0]??"").trim(),U=de[1]==null?null:String(de[1]).trim()}u++}const J=ae(oe,ue,U);return J.loading=q,b(J),!0}function me(){const K=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&K?.type==="text"&&String(K.content??"").endsWith("[")&&A(K,"\\[")}function be(K,Z){const pe=K.indexOf("[");if(pe===-1)return!1;let D=K.slice(0,pe);const X=K.indexOf("](",pe);if(X!==-1){const oe=e[u+2];let te=K.slice(pe+1,X);if(te.includes("[")){const Me=te.indexOf("[");D+=K.slice(0,pe+Me+1);const le=pe+Me+1;te=K.slice(le+1,X)}const ue=e[u+1];if(K.endsWith("](")&&ue?.type==="link_open"&&oe){const Me=e[u+4];let le=4,_e=!0;if(Me?.type==="text"){const Xe=String(Me.content??"");if(Xe.startsWith(")")){_e=!1;const ot=Xe.slice(1);if(ot){const Ye=tl(Me);Ye.content=ot,Ye.raw=ot,m()[u+4]=Ye}else le++}else Xe==="."&&le++}$(D,Z);const ze=String(oe.content??"");return s?.validateLink&&!s.validateLink(ze)?k(te,te):b({type:"link",href:ze,title:null,text:te,children:[{type:"text",content:te,raw:te}],loading:_e}),u+=le,!0}const U=K.indexOf(")",X),q=U!==-1?K.slice(X+2,U):"",J=U===-1;let de=D.match(/\*+$/);if(de&&(D=D.replace(/\*+$/,"")),$(D,Z),de||(de=te.match(/^\*+/)),!d&&de){const Me=de[0].length;te=te.replace(/^\*+/,"").replace(/\*+$/,"");const le=[];if(Me===1?le.push({type:"em_open",tag:"em",nesting:1}):Me===2?le.push({type:"strong_open",tag:"strong",nesting:1}):Me===3&&(le.push({type:"strong_open",tag:"strong",nesting:1}),le.push({type:"em_open",tag:"em",nesting:1})),le.push({type:"link",href:q,title:null,text:te,children:[{type:"text",content:te,raw:te}],loading:J}),Me===1){le.push({type:"em_close",tag:"em",nesting:-1});const{node:_e}=Yu(le,0,s);g(_e)}else if(Me===2){le.push({type:"strong_close",tag:"strong",nesting:-1});const{node:_e}=Ka(le,0,void 0,s);g(_e)}else if(Me===3){le.push({type:"em_close",tag:"em",nesting:-1}),le.push({type:"strong_close",tag:"strong",nesting:-1});const{node:_e}=Ka(le,0,void 0,s);g(_e)}else{const{node:_e}=Yu(le,0,s);g(_e)}}else s?.validateLink&&!s.validateLink(q)?k(te,te):b({type:"link",href:q,title:null,text:te,children:[{type:"text",content:te,raw:te}],loading:J});const ge=U!==-1?K.slice(U+1):"";return ge&&(I({type:"text",content:ge,raw:ge}),u--),u++,!0}return!1}function Se(K){const Z=K.indexOf("![");if(Z===-1)return!1;const pe=K.slice(0,Z);return pe&&!c?c={type:"text",content:pe,raw:pe}:pe&&c&&(c.content+=pe),c&&(a.push(c),c=null),b(re(K.slice(Z))),u++,!0}function fe(K){if(!(K?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Z=K.slice(1).match(/[^\s\]]/);if(Z===null)return u++,!0;if(Z&&/x/i.test(Z[0])){const pe=Z[0]==="x"||Z[0]==="X";return b({type:"checkbox_input",checked:pe,raw:pe?"[x]":"[ ]"}),u++,!0}return!1}return a}function j7(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function z7(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function V7(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function va(e,t,n){const s=e[t],o=[],i=xr(n,!0);let r=t+1;for(;r<e.length&&e[r].type!=="bullet_list_close"&&e[r].type!=="ordered_list_close";)if(e[r].type==="list_item_open"){const l=[];let a=r+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const c=e[a+1],u=V7(c)?tl(c):c,d=e[a-1];u!==c&&(z7(u),j7(u));const h=String(u.content??"");l.push({type:"paragraph",children:bn(u.children||[],h,d,i.options()),raw:h}),i.remember(h),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=ya(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=va(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=j1(e,a,i.options(),q1);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
|
|
145
|
-
`)},r+1]}function K7(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=xr(s,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:bn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=va(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=ya(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=oh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
|
|
146
|
-
${r.map(c=>c.raw).join(`
|
|
147
|
-
`)}
|
|
148
|
-
:::`},a+1]}const G7=new Set(["warning","info","note","tip","danger","caution"]);function Y7(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return G7.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function X7(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const h=d.slice(o.length).trim();h&&(i=h)}}else{const d=Y7(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=xr(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const h=d.children||[];let m=-1;for(let y=h.length-1;y>=0;y--){const S=h[y];if(S.type==="text"&&/:+/.test(S.content)){m=y;break}}const f={type:"paragraph",children:bn((m!==-1?h.slice(0,m):h)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,h]=va(e,c,a.options());l.push(d),a.remember(d.raw),c=h}else if(e[c].type==="blockquote_open"){const[d,h]=ya(e,c,a.options());l.push(d),a.remember(d.raw),c=h}else{const d=oh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
|
|
149
|
-
${l.map(d=>d.raw).join(`
|
|
150
|
-
`)}
|
|
151
|
-
:::`},c+1]}const Z7=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function Q7(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=Z7.exec(String(s.info??""));return o?K7(e,t,o,n):null}const q1={parseContainer:(e,t,n)=>X7(e,t,n),matchAdmonition:Q7};function ya(e,t,n){const s=[],o=xr(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:bn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=va(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=ya(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=j1(e,i,o.options(),q1);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
|
|
152
|
-
`)},i+1]}function J7(e){if(e.info?.startsWith("diff"))return W1(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function eD(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=xr(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=bn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:bn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
153
|
-
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
154
|
-
`)},o+1]}function tD(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=xr(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:bn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
155
|
-
`)}`},l+1]}function nD(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(s.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:bn(a.children||[],c,void 0,n),raw:c}}function sD(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=kn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=kn(c);if(u===-1)return-1;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return-1}function ox(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const s=kn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=al.has(n),l=sh(o),a=(s===-1?-1:sD(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
156
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function oD(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 iD(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function ix(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function rx(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return ix(n)?n:void 0}function rD(e,t,n){const s=rx(eu(t),n);if(!ix(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function lD(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const h=e[c].type==="th_open",m=e[c+1],f=String(m.content??""),y=iD(e[c].attrs),S=a.length,_=!h&&!r,b=_?o?.cells[S]?.raw:void 0;a.push({type:"table_cell",header:h||r,children:bn(m.children||[],f,void 0,rD(n,b,_?u:void 0)),raw:f,align:y}),_&&(u=rx(u,eu(f))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(h=>h.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
|
|
157
|
-
`)},s+1]}function aD(){return{type:"thematic_break",raw:"---"}}let Qp=null;const Jp=new WeakMap;function Tb(){return Qp||(Qp={allowedTagSet:ih(),customTagSet:null}),Qp}function cD(e){if(!e||e.length===0)return Tb();const t=Jp.get(e);if(t)return t;const n=e.map(Oo).filter(Boolean);if(!n.length){const o=Tb();return Jp.set(e,o),o}const s={allowedTagSet:ih({customHtmlTags:e}),customTagSet:new Set(n)};return Jp.set(e,s),s}function uD(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[m,f]of o)if(m==="class"){const y=f.match(/(?:\s|^)vmr-container-(\S+)/);y&&(i=y[1])}else if(m.startsWith("data-")){const y=m.slice(5);try{r[y]=JSON.parse(f)}catch{r[y]=f}}}const l=[],a=xr(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const m=e[c+1];if(m){const f={type:"paragraph",children:bn(m.children||[],void 0,void 0,a.options()),raw:String(m.content??"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[m,f]=va(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else if(e[c].type==="blockquote_open"){const[m,f]=ya(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else{const m=oh(e,c,a.options());m?(l.push(m[0]),a.remember(m[0].raw),c=m[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let h=`::: ${i}`;return Object.keys(r).length>0&&(h+=` ${JSON.stringify(r)}`),h+=`
|
|
158
|
-
`,l.length>0&&(h+=s.raw??l.map(m=>m.raw).join(`
|
|
159
|
-
`),h+=`
|
|
160
|
-
`),h+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:h},u?c+1:c]}function dD(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function fD(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function hD(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${to(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${to(s)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=kn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=kn(c);if(u===-1)return null;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function pD(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=kn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const f=c+1;return{raw:e.slice(r,f),end:f}}let u=1,d=c+1;const h=f=>{const y=e.slice(f);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(y)},m=f=>{const y=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(y)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),end:e.length};if(m(f)){const y=e.indexOf(">",f);if(y===-1)return null;if(u--,u===0){const S=y+1;return{raw:e.slice(r,S),end:S}}d=y+1;continue}if(h(f)){const y=kn(e.slice(f));if(y===-1)return null;u++,d=f+y+1;continue}d=f+1}return{raw:e.slice(r),end:e.length}}function vg(e){return Number.isFinite(e)&&e>0?e:0}function mD(e,t){const n=vg(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
161
|
-
`&&(s++,s===n))return o+1;return e.length}function oh(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[nD(e,t,n),t+3];case"code_block":return[J7(s),t+1];case"fence":return[W1(s),t+1];case"math_block":return[oD(s),t+1];case"html_block":{const o=ox(s),i=o.tag?cD(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?mD(l,Number(s.map?.[0]??0)):0,u=pD(l,r,Math.max(vg(a),vg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),h=kn(d),m=h!==-1?d.slice(0,h+1):d,f=h!==-1&&/\/\s*>\s*$/.test(m),y=h===-1?null:hD(d,r,h+1),S=y?.start??-1;let _="";h!==-1&&(S!==-1&&h<S?_=d.slice(h+1,S):_=d.slice(h+1)),S===-1&&(_=fD(_,r));const b=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let g;for(;(g=v.exec(m))!==null;){const $=g[1];if(!$||$.toLowerCase()===r)continue;const A=g[2]||g[3]||g[4]||"";b.push([$,A])}const k=!n?.final&&!f&&y==null;return[{type:r,tag:r,content:dD(_),raw:String(u?.raw??o.raw??d),loading:k,attrs:b.length?b:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=lD(e,t,n);return[o,i]}case"dl_open":{const[o,i]=eD(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=tD(e,t,n);return[o,i]}case"hr":return[aD(),t+1]}return null}function j1(e,t,n,s){const o=oh(e,t,n);if(o)return o;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return uD(e,t,n)}return null}function gD(){return{type:"hardbreak",raw:`\\
|
|
162
|
-
`}}function vD(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:bn(s.children||[],o,void 0,n),raw:o}}const Mb=new WeakMap;function da(){return typeof performance<"u"?performance.now():Date.now()}function z1(e,t,n){e&&(e[t]=(e[t]??0)+n)}function lx(e){return e.__timing}function em(e,t,n){return t&&z1(t,"parseMarkdownToStructureTotalMs",da()-n),e}function Ab(e,t,n){if(!n)return Pb(e,t);const s=da(),o=Pb(e,t);return z1(n,"processTokensMs",da()-s),o}function yD(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=ga(t);return n.length?new Set(n):null}function kD(e,t){const n=e;let s=Mb.get(n);s||(s=new Map,Mb.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function bD(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Zu(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=Vr(o.value,n))}}function Vr(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(Vr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Vr(l,t),Vr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Vr(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),Zu(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Zu(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),Zu(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!bD(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Zu(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Vr(i[r],t);return o}function ax(e,t=!0){if(!t)return tl(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>ax(a,t)):t&&r&&typeof r=="object"&&(l=Vr(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function Eb(e,t=!0){return e.map(n=>ax(n,t))}function cx(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function _D(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function wD(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function Ib(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!cx(e,s))return e.parse(t,n);const o=e.stream.parse(t,kD(e,n));if(!wD(s))return o;const i=lx(s);if(!i)return Eb(o,!0);const r=da(),l=Eb(o,!0);return z1(i,"tokenCloneMs",da()-r),l}function ih(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Hc;const n=new Set(Hc);for(const s of ga(t))s&&n.add(s);return n}function SD(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 $b(e){return{type:"paragraph",children:e,raw:e.map(SD).join("")}}function Nb(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=yD(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const h=s.slice(0,u);if(String(d.content??"").trim()&&h.some(m=>m?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push($b(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push($b(c)),a}function CD(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function gc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function xD(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${to(t)}\s*>\s*$`,"i").test(n)}function V1(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${to(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=kn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(al.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const h=f=>{const y=e.slice(f);return new RegExp(String.raw`^<\s*${to(s)}(?=\s|>|/)`,"i").test(y)},m=f=>{const y=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${to(s)}(?=\s|>)`,"i").test(y)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(m(f)){const y=kn(e.slice(f));if(y===-1)return null;u--;const S=f+y+1;if(u===0)return{raw:e.slice(r,S),start:r,end:S,closed:!0};d=S;continue}if(h(f)){const y=kn(e.slice(f));if(y===-1)return null;const S=e.slice(f,f+y+1);/\/\s*>$/.test(S)||u++,d=f+y+1;continue}d=f+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function TD(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
|
|
163
|
-
`){n++;continue}return-1}return s===t.length?n:-1}function MD(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
164
|
-
</${t}>`}function Lb(e){return e.replace(/\r\n/g,`
|
|
165
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function AD(e,t,n){return n?e.includes(n,t)?!0:Lb(e.slice(Math.max(0,t))).includes(Lb(n)):!1}function ED(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
166
|
-
`&&n++,n):e[n]===`
|
|
167
|
-
`?n+1:t}function Ob(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 ID(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function K1(e,t){const n=new RegExp(String.raw`<\s*\/\s*${to(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function ux(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const $D=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),ND=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function LD(e){return/\n\s*\n/.test(e)||ND.test(e)}function OD(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>$D.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!LD(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function PD(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||$C.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=kn(l);if(a===-1)return o;const c=K1(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=vc(u,t,ux(n,s));return OD(u,d)?{...o,children:d}:o})}function vc(e,t,n){return e.trim()?fx(e,t,{...n,__disableStreamParse:!0}):[]}function RD(e,t,n){const s=vc(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function DD(e,t,n){const s=ox({content:e}),o=kn(e),i=K1(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=RD(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function BD(e,t,n){const s=kn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=V1(o,"summary",0);if(!i)return vc(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...vc(r,t,n),DD(i.raw,t,n),...vc(l,t,n)]}function dx(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=gc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!Ob(c)){r.push(c);continue}const h=String(c.raw??gc(c)??""),m=d!==-1?d:t.indexOf(h,Math.max(0,l-h.length));if(m===-1){r.push(c);continue}let f=1,y=-1;for(let ie=a+1;ie<e.length;ie++){const ae=e[ie];if(Ob(ae)){f++;continue}if(ID(ae)&&(f--,f===0)){y=ie;break}}const S=V1(t,"details",m),_=y===-1&&S?.closed===!0,b=_?(()=>{const ie=K1(h,"details");return ie!==-1?h.slice(0,ie):h})():h,[v]=dx(_?[]:y===-1?e.slice(a+1):e.slice(a+1,y),t,n,s,o,m+h.length),g=BD(b,n,ux(s,o)),k=y===-1?"</details>":String(e[y].raw??gc(e[y])??"</details>"),$=_||y!==-1&&S?.closed===!0,A=k.replace(/[\t\r\n ]+$/,""),w=$?(()=>{const ie=(S?.raw??"").lastIndexOf(A);return ie===-1?t.length:m+ie})():t.length,x=kn(h),I=_&&x!==-1?m+x+1:m+h.length,L=t.slice(I,w===-1?t.length:w),O=n.parse(L,{__markstreamFinal:o}),P=n.renderer.render(O,n.options,{__markstreamFinal:o}),B=w+A.length,R=$?Math.max(w+k.length,ED(t,B)):t.length,W=$?t.slice(w,R):k,V=$?t.slice(m,R):t.slice(m),z=_&&x!==-1?h.slice(0,x+1):h;if(r.push({...c,tag:"details",attrs:sh(h.slice(0,x+1)),raw:V,content:`${z}${P}${W}`,children:[...g,...v],loading:!o&&!$}),l=$?R:t.length,y===-1&&!_)break;y!==-1&&(a=y)}return[r,l]}function FD(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=gc(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=V1(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),h=String(r.raw??d),m=MD(u.raw,c,u.closed),f=!t&&!u.closed,y=d!==m||h!==u.raw||!!r.loading!==f,S=kn(u.raw),_=S===-1?"":u.raw.slice(0,S+1),b=_?sh(_):[];if(r.content=m,r.raw=u.raw,r.loading=f,r.attrs=b.length?b:void 0,!y)continue;let v=TD(u.raw,h);v===-1&&(v=0);const g=i+1;for(;g<s.length;){if(u.closed&&xD(s[g],c)){s.splice(g,1);continue}const k=gc(s[g]);if(!k)break;const $=u.raw.indexOf(k,v);if($===-1){if(AD(n,u.end,k))break;s.splice(g,1);continue}v=$+k.length,s.splice(g,1)}}return s}function HD(e){const t=l=>l===" "||l===" "||l===`
|
|
168
|
-
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=y=>{const S=y.charCodeAt(0);return S>=65&&S<=90||S>=97&&S<=122},u=y=>{const S=y.charCodeAt(0);return S>=48&&S<=57},d=y=>y==="!"||c(y),h=y=>c(y)||u(y)||y===":"||y==="-",m=y=>c(y)||u(y)||y==="_"||y==="."||y===":"||y==="-",f=m;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&h(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!m(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const y=l[a];if(y==='"'||y==="'"){for(a++;a<l.length&&l[a]!==y;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const S=l[a];if(t(S)||S==="<"||S===">"||S==='"'||S==="'"||S==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const h=b=>b===" "||b===" ",m=b=>{let v=0;for(;v<b.length&&h(b[v]);)v++;const g=b[v];if(g!=="`"&&g!=="~")return null;let k=v;for(;k<b.length&&b[k]===g;)k++;const $=k-v;return $<3?null:{markerChar:g,markerLen:$,rest:b.slice(k)}},f=b=>{let v=0;for(;v<b.length&&h(b[v]);)v++;let g=!1;for(;v<b.length&&b[v]===">";)for(g=!0,v++;v<b.length&&h(b[v]);)v++;return g?b.slice(v):null},y=b=>{const v=m(b);if(v)return v;const g=f(b);return g==null?null:m(g)};let S=0;const _=l.split(/\r?\n/);for(const b of _){const v=S,g=S+b.length;if(a<v)break;const k=y(b);if(k){const $=k.markerChar,A=k.markerLen;c?$===u&&A>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=$,d=A)}if(a<=g)break;S=g+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
169
|
-
`||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
170
|
-
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function WD(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{const y=f.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122||y>=48&&y<=57||f==="_"||f==="-"||f===":"},i=f=>{if(!f)return!1;if(f[0]===" ")return!0;let y=0;for(let S=0;S<f.length;S++){const _=f[S];if(_===" "){if(y++,y>=4)return!0;continue}if(_===" ")return!0;break}return!1},r=f=>{let y=!1,S=!1;for(let _=0;_<f.length;_++){const b=f[_];if(b==="\\"){_++;continue}if(!S&&b==="'"){y=!y;continue}if(!y&&b==='"'){S=!S;continue}if(!y&&!S&&b===">")return _}return-1},l=f=>{let y=0;for(;y<f.length&&s(f[y]);)y++;const S=f[y];if(S!=="`"&&S!=="~")return null;let _=y;for(;_<f.length&&f[_]===S;)_++;const b=_-y;return b<3?null:{markerChar:S,markerLen:b,rest:f.slice(_)}},a=(f,y)=>{if(i(f))return-1;const S=f.replace(/^[ \t]+/,"");if(!S||S.startsWith(">")||S.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(S))return-1;let _=!1,b=0;for(;b<f.length;){const v=f[b];if(v!=="<"){s(v)||(_=!0),b++;continue}const g=r(f.slice(b));if(g===-1){_=!0,b++;continue}const k=f.slice(b,b+g+1);let $=1;for(;$<k.length&&s(k[$]);)$++;if($>=k.length){_=!0,b++;continue}const A=k[$];if(A==="!"||A==="?"){_=!0,b+=g+1;continue}if(A==="/"){_=!0,b+=g+1;continue}const w=$;for(;$<k.length&&o(k[$]);)$++;if($===w){_=!0,b++;continue}const x=k.slice(w,$).toLowerCase(),I=k[$];if(I&&I!==" "&&I!==" "&&I!==">"&&I!=="/"){_=!0,b++;continue}const L=new RegExp(String.raw`<\s*\/\s*${x}\s*>`,"i"),O=/\/\s*>$/.test(k),P=L.test(f.slice(b+g+1)),B=L.test(e.slice(y+b+g+1)),R=/[\r\n]/.test(e.slice(y+b+g+1));if(_&&n.has(x)&&!O&&!P&&(B||R))return b;_=!0,b+=g+1}return-1};let c=!1,u="",d=0,h="",m=0;for(;m<e.length;){const f=e.indexOf(`
|
|
171
|
-
`,m),y=f!==-1,S=y&&f>m&&e[f-1]==="\r",_=y?S?f-1:f:e.length,b=e.slice(m,_),v=y?S?`\r
|
|
172
|
-
`:`
|
|
173
|
-
`:"",g=l(b);let k=b;if(!c&&!g){const $=a(b,m);if($!==-1){const A=v||`
|
|
174
|
-
`;k=`${b.slice(0,$).replace(/[ \t]+$/,"")}${A}${A}${b.slice($).replace(/^[ \t]+/,"")}`}}h+=k,h+=v,g&&(c?g.markerChar===u&&g.markerLen>=d&&/^\s*$/.test(g.rest)&&(c=!1,u="",d=0):(c=!0,u=g.markerChar,d=g.markerLen)),m=y?f+1:e.length}return h}function UD(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=d=>{const h=d.charCodeAt(0);return h>=65&&h<=90||h>=97&&h<=122||h>=48&&h<=57||d==="_"||d==="-"},i=d=>{let h=0;for(;h<d.length&&s(d[h]);)h++;return d.slice(h)},r=d=>{let h=!1,m=!1;for(let f=0;f<d.length;f++){const y=d[f];if(y==="\\"){f++;continue}if(!m&&y==="'"){h=!h;continue}if(!h&&y==='"'){m=!m;continue}if(!h&&!m&&y===">")return f}return-1},l=(d,h,m)=>{const f=m.toLowerCase();let y=d.indexOf("<",h);for(;y!==-1;){let S=y+1;for(;S<d.length&&s(d[S]);)S++;if(S>=d.length||d[S]!=="/"){y=d.indexOf("<",y+1);continue}for(S++;S<d.length&&s(d[S]);)S++;if(S+f.length>d.length){y=d.indexOf("<",y+1);continue}let _=!0;for(let v=0;v<f.length;v++){const g=d[S+v];if((g>="A"&&g<="Z"?String.fromCharCode(g.charCodeAt(0)+32):g)!==f[v]){_=!1;break}}if(!_){y=d.indexOf("<",y+1);continue}let b=S+f.length;if(b<d.length&&o(d[b])){y=d.indexOf("<",y+1);continue}for(;b<d.length&&s(d[b]);)b++;if(b<d.length&&d[b]===">")return!0;y=d.indexOf("<",y+1)}return!1},a=d=>{let h=0;for(;h<d.length&&s(d[h]);)h++;if(h>=d.length||d[h]!=="<")return d;for(h++;h<d.length&&s(d[h]);)h++;if(h>=d.length||d[h]==="/")return d;const m=h;for(;h<d.length&&o(d[h]);)h++;if(h===m)return d;const f=d.slice(m,h).toLowerCase();if(!n.has(f))return d;const y=r(d.slice(h));if(y===-1)return d;const S=h+y;if(l(d,S+1,f))return d;const _=i(d.slice(S+1));return _?`${d.slice(0,S+1)}
|
|
175
|
-
${_}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
176
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const h=d>u&&e[d-1]==="\r",m=h?d-1:d,f=e.slice(u,m);c+=a(f),c+=h?`\r
|
|
177
|
-
`:`
|
|
178
|
-
`,u=d+1}return c}function qD(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()));if(!n.size)return e;const s=h=>h===" "||h===" ",o=h=>{let m=0,f=!1,y=0;for(;m<h.length;){for(;m<h.length&&s(h[m]);)m++;if(m>=h.length||h[m]!==">")break;for(f=!0,m++;m<h.length&&s(h[m]);)m++;y=m}return f?{prefix:h.slice(0,y),content:h.slice(y)}:null},i=h=>{let m=0;for(;m<h.length&&s(h[m]);)m++;const f=h[m];if(f!=="`"&&f!=="~")return null;let y=m;for(;y<h.length&&h[y]===f;)y++;const S=y-m;return S<3?null:{markerChar:f,markerLen:S,rest:h.slice(y)}},r=Array.from(n).map(h=>new RegExp(String.raw`(<\s*\/\s*${h}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const h=e.indexOf(`
|
|
179
|
-
`,d),m=h!==-1,f=m&&h>d&&e[h-1]==="\r",y=m?f?h-1:h:e.length,S=e.slice(d,y),_=m?f?`\r
|
|
180
|
-
`:`
|
|
181
|
-
`:"",b=o(S),v=b?.prefix??"",g=b?.content??S,k=i(g);k&&(l?k.markerChar===a&&k.markerLen>=c&&/^\s*$/.test(k.rest)&&(l=!1,a="",c=0):(l=!0,a=k.markerChar,c=k.markerLen));let $=g;if(!l&&$.includes("</"))for(const A of r)$=$.replace(A,(w,x,I,L)=>{if(L.replace(/^[\t ]+/,"").startsWith("|"))return w;const O=L.slice(0,I).replace(/^[\t ]+/,"");if(O.length>0){const P=x.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",B=O.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!P||!B||P!==B)return w}return`${x}
|
|
182
|
-
|
|
183
|
-
`});if(v){const A=v+$.split(`
|
|
184
|
-
`).join(`
|
|
185
|
-
${v}`);u+=A}else u+=$;u+=_,d=m?h+1:e.length}return u}function jD(e,t){if(!e||!t.length)return e;const n=new Set(t.map(O=>String(O??"").toLowerCase()));if(!n.size)return e;const s=O=>O===" "||O===" ",o=O=>{if(!O)return!1;if(O[0]===" ")return!0;let P=0;for(let B=0;B<O.length;B++){const R=O[B];if(R===" "){if(P++,P>=4)return!0;continue}if(R===" ")return!0;break}return!1},i=O=>{const P=O.charCodeAt(0);return P>=65&&P<=90||P>=97&&P<=122||P>=48&&P<=57||O==="_"||O==="-"||O===":"},r=O=>{let P=0;for(;P<O.length&&s(O[P]);)P++;return O.slice(P)},l=O=>{let P=0,B=!1,R=0;for(;P<O.length;){for(;P<O.length&&s(O[P]);)P++;if(P>=O.length||O[P]!==">")break;for(B=!0,P++;P<O.length&&s(O[P]);)P++;R=P}if(!B)return null;const W=O.slice(0,R);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:O.slice(R)}},a=O=>r(O).startsWith("<"),c=O=>{for(let P=0;P<O.length;P++){const B=O[P];if(B!==" "&&B!==" ")return!1}return!0},u=O=>{if(o(O))return"";const P=r(O);if(!P.startsWith("<"))return"";let B=1;for(;B<P.length&&s(P[B]);)B++;if(B>=P.length||P[B]==="/"||P[B]==="!"||P[B]==="?")return"";const R=B;for(;B<P.length&&i(P[B]);)B++;if(B===R)return"";const W=P.slice(R,B).toLowerCase();if(!n.has(W))return"";const V=P[B];return V&&V!==" "&&V!==" "&&V!==">"&&V!=="/"?"":W},d=O=>{if(o(O))return null;const P=r(O);if(!P.startsWith("<"))return null;let B=1;for(;B<P.length&&s(P[B]);)B++;if(B>=P.length)return null;const R=P[B]==="/";if(R)for(B++;B<P.length&&s(P[B]);)B++;const W=P[B];if(!W||W==="!"||W==="?")return null;const V=B;for(;B<P.length&&i(P[B]);)B++;if(B===V)return null;const z=P.slice(V,B).toLowerCase();if(!n.has(z))return null;const ie=P[B];if(ie&&ie!==" "&&ie!==" "&&ie!==">"&&ie!=="/")return null;if(R)return{type:"close",name:z};if(/\/\s*>\s*$/.test(P))return{type:"open",name:z,complete:!0};const ae=P.indexOf(">",B);if(ae!==-1){const re=P.slice(ae+1);if(new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i").test(re))return{type:"open",name:z,complete:!0}}return{type:"open",name:z,complete:!1}},h=O=>{if(o(O))return null;const P=r(O).replace(/[ \t]+$/,"");if(!P.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(P))return null;const B=P.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(B?.[1])return B[1].toLowerCase();const R=P.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const W=R[1].toLowerCase();return W===R[2].toLowerCase()?W:null};let m=!1,f="",y=0;const S=O=>{let P=0;for(;P<O.length&&s(O[P]);)P++;const B=O[P];if(B!=="`"&&B!=="~")return null;let R=P;for(;R<O.length&&O[R]===B;)R++;const W=R-P;return W<3?null:{markerChar:B,markerLen:W,rest:O.slice(R)}},_=O=>S(O),b=O=>{const P=r(O);return P?o(O)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(P):!1},v=(O,P,B)=>{let R=O,W=0;for(;R<e.length;){const V=e.indexOf(`
|
|
186
|
-
`,R),z=V!==-1,ie=z&&V>R&&e[V-1]==="\r",ae=z?ie?V-1:V:e.length,re=e.slice(R,ae),Te=l(re),Pe=Te?.key??"";if(W>0&&P&&Pe!==P)break;const We=Te?.content??re,Ne=d(We);if(Ne?.name===B){if(Ne.type==="open")Ne.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(c(We)||b(We)))return!0;if(z)R=V+1;else break}return!1};let g="",k=0,$=!0,A=!1,w=!1,x=`
|
|
187
|
-
`;const I=[];let L="";for(;k<e.length;){const O=e.indexOf(`
|
|
188
|
-
`,k),P=O!==-1,B=P&&O>k&&e[O-1]==="\r",R=P?B?O-1:O:e.length,W=e.slice(k,R),V=P?B?`\r
|
|
189
|
-
`:`
|
|
190
|
-
`:"",z=l(W),ie=z?.key??"",ae=z?.content??W,re=_(ae);re&&(m?re.markerChar===f&&re.markerLen>=y&&/^\s*$/.test(re.rest)&&(m=!1,f="",y=0):(m=!0,f=re.markerChar,y=re.markerLen));const Te=I.length>0;if(!m&&!Te){const We=u(ae),Ne=!!We&&!$&&A&&w&&v(k,ie,We);We&&!$&&(!A||Ne)&&(ie&&L&&ie===L?g+=`${ie}${x}`:ie||(g+=x))}if(g+=W,g+=V,V&&(x=V),!m){const We=d(ae);if(We){if(We.type==="open")We.complete||I.push(We.name);else for(let Ne=I.length-1;Ne>=0;Ne--)if(I[Ne]===We.name){I.length=Ne;break}}}const Pe=c(ae);$=Pe,A=!Pe&&a(ae),w=!Pe&&!!h(ae),L=ie,k=P?O+1:e.length}return g}function fx(e,t,n={}){const s=lx(n),o=s?da():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(_D(t,n)&&t.stream.reset(),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,S=>S.startsWith(`
|
|
191
|
-
`)?`
|
|
192
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,S=>S.startsWith(`
|
|
193
|
-
`)?`
|
|
194
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,S=>S.startsWith(`
|
|
195
|
-
`)?`
|
|
196
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
197
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,S=>S.startsWith(`
|
|
198
|
-
`)?`
|
|
199
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(S,_,b)=>`${_}${b.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,S=>S.startsWith(`
|
|
200
|
-
`)?`
|
|
201
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
202
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const S=ga(n.customHtmlTags);if(S.length&&(r=WD(r,S),r=UD(r,S),r=jD(r,S),r=qD(r,S),r.includes("</")))for(const _ of S){const b=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${_}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(b,"$1$2$2")}}i||(r=HD(r));const l=CD(r);if(l){const S=n.preTransformTokens,_=n.postTransformTokens;if(cx(t,n)||typeof S=="function"||typeof _=="function"){const b=Ib(t,r,{__markstreamFinal:i},n),v=typeof S=="function"&&S(b)||b;typeof _=="function"&&_(v)}return em(l,s,o)}const a=Ib(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return em([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const h=t,m=n.validateLink??h.options?.validateLink??(typeof h.validateLink=="function"?h.validateLink:void 0),f={...n,validateLink:m,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let y=Ab(d,f,s);if(u&&typeof u=="function"){const S=u(d);if(Array.isArray(S)){const _=S[0],b=_?.type;_&&typeof b=="string"?y=Ab(S,void 0,s):y=S}}if(y=FD(y,i,r),y=dx(y,r,t,n,i)[0],y=PD(y,t,n,i),i){const S=new WeakSet,_=b=>{if(!b||typeof b!="object"||S.has(b))return;if(S.add(b),Array.isArray(b)){for(const g of b)_(g);return}const v=b;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const g of Object.values(v))_(g)};_(y)}return n.debug&&console.log("Parsed Markdown Tree Structure:",y),em(y,s,o)}function Pb(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=xr(t);let o=0;for(;o<e.length;){const i=j1(e,o,s.options(),q1);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=vD(e,o,s.options(l)),c=Nb(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=va(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=ya(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(gD()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=bn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=Nb(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const zD=new Set([...Jc,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),VD=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","s","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]),Rb=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function Db(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function KD(e){return typeof e=="string"?e:e==null?"":String(e)}function hx(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function ir(e){return KD(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function px(e){return ir(e).replace(/`/g,"`")}function rh(e){return String(e??"").trim().toLowerCase()}function G1(e,t="safe"){const n=rh(e);return n?t==="escape"?!0:t==="trusted"?Jc.has(n):!VD.has(n):!1}function mx(e,t="safe"){const n=rh(e);return n?t==="escape"?!0:t==="trusted"?Jc.has(n):zD.has(n):!1}function Bb(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${px(s)}"`).join("")}function GD(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||na(o,{tagName:t,attrName:"srcset"})})}function gx(e,t,n,s){return QO.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?GD(t,s):!!(JO.has(e)&&t&&na(t,{tagName:s,attrName:e}))}function Kr(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function vx(e,t,n,s=!1){if(t!=="safe"||rh(n)!=="a")return e;const o=Kr(e,"href");if(s&&(!o||!e[o])){const a=Kr(e,"target"),c=Kr(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Kr(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Kr(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 Fb(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!hx(r)||gx(l,i,t,n)||(s[r]=i)}return vx(s,t,n,!!Kr(e,"href"))}function yx(e,t){const n=e.toLowerCase();return IC.has(n)?!1:Db(t,n)||Db(t,e)}function Y1(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!hx(r)||gx(l,i,t,n)||(s[r]=i)}return vx(s,t,n,!!Kr(e,"href"))}function pf(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function yg(e,t="safe",n){const s=Y1(pf(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function YD(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function XD(e){const t={};for(const[n,s]of Object.entries(e))t[n]=YD(s,n);return t}function Hb(e){return e.trim().length>0}function ZD(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);Hb(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);Hb(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const h=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=h.exec(u))!==null;){const f=m[1],y=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=y)}}t.push({type:l||al.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function QD(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const h=e.indexOf("-->",n);if(h!==-1){n=h+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const h=e.indexOf("]]>",s);if(h!==-1){t.push({type:"text",content:e.slice(s,h+3)}),n=h+3;continue}break}if(e.startsWith("!",s+1)){const h=e.indexOf(">",s);if(h!==-1){n=h+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const h=i.slice(1).trim();t.push({type:"tag_close",tagName:h}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const h=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=h.exec(u))!==null;){const f=m[1],y=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=y)}}t.push({type:l||al.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function JD(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${ir(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${ir(s)}`:` ${ir(s)}="${px(o)}"`).join("");return e.type==="self_closing"?`<${ir(t)}${n} />`:`<${ir(t)}${n}>`}function e9(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;Rb.lastIndex=0;let n;for(;(n=Rb.exec(e))!==null;)if(yx(n[1],t))return!0;return!1}function sa(e,t="safe"){if(!e)return"";if(t==="escape")return ir(e);const n=QD(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(ir(r.content??""));continue}const l=rh(r.tagName);if(!l)continue;if(mx(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"&&G1(l,t)){o.push(JD(r));continue}if(r.type==="self_closing"){o.push(`<${l}${Bb(Fb(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${Bb(Fb(r.attrs??{},t,l))}>`),al.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const t9=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],Wb="http://www.w3.org/2000/svg",n9=new Set(["script","style","iframe","object","embed","link","meta"]),s9=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"]),o9=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),i9=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),r9=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function l9(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function a9(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function c9(e){const t=e.nodeName.toLowerCase();return t==="use"?l9(e):t==="image"?a9(e):t==="text"||t==="tspan"?!!e.textContent?.trim():r9.has(t)}function u9(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 d9(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?na(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?na(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":na(i,{tagName:s,attrName:o})?"":i:""}function f9(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function kx(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function bx(e){const t=kx(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=f9(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function Ub(e){const t=kx(e);return t9.some(n=>n.test(t))||bx(t)}function h9(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 Qu(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function _x(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!n9.has(s)){if(s==="br"){t.push(`
|
|
203
|
-
`);return}for(const o of Array.from(n.childNodes))_x(o,t)}}function p9(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];_x(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=Qu(t.getAttribute("width")),i=Qu(t.getAttribute("height")),r=Qu(t.getAttribute("x")),l=Qu(t.getAttribute("y")),a=e.ownerDocument.createElementNS(Wb,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,h]of s.entries()){const m=e.ownerDocument.createElementNS(Wb,"tspan");m.setAttribute("x",String(r+o/2)),m.setAttribute("dy",d===0?`${u}em`:"1.2em"),m.textContent=h,a.appendChild(m)}}t.parentNode?.replaceChild(a,t)}}function m9(e){p9(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!s9.has(s)){n.remove();continue}if(s==="style"&&Ub(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&Ub(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(o9.has(r)&&i.value){const l=d9(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(i9.has(r)&&i.value&&bx(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=u9(i.value);l!==i.value&&n.setAttribute(i.name,l)}}h9(n)}}function Oue(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 m9(n),g9(n)?null:n}catch{return null}}function g9(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){c9(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const qb=[];function tm(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function v9(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function y9(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function jb(e=`editor-${Date.now()}`,t={}){const n=VR(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;o=m=>h[m]??s[m]??m}else o=h=>s[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[f,...y]=m;typeof f=="function"&&n.use(f,...y)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(qb.length)for(const h of qb)if(Array.isArray(h)){const[m,...f]=h;typeof m=="function"&&n.use(m,...f)}else typeof h=="function"&&n.use(h);n.use(W5),n.use(j5),n.use(B5);const i=oN,r=i.default??i;n.use(r),n.use(D5),n.use(R5),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,f=m.src,y=!!m.env?.__markstreamFinal,S=f.split(/\r?\n/);for(const _ of m.tokens){if(_.type!=="fence"||!_.map||!_.markup)continue;const b=_.map[0],v=_.map[1],g=_.markup,k=g[0],$=g.length,A=S[Math.max(0,v-1)]??"";let w=0;for(;w<A.length&&(A[w]===" "||A[w]===" ");)w++;let x=0;for(;w+x<A.length&&A[w+x]===k;)x++;let I=w+x;for(;I<A.length&&(A[I]===" "||A[I]===" ");)I++;const L=y?!0:v>b+1&&x>=$&&I===A.length,O=_;O.meta=O.meta??{},O.meta.unclosed=!L,O.meta.closed=!!L}});const l=(h,m)=>{const f=h,y=f.pos;if(f.src[y]!=="~")return!1;const S=f.src[y-1],_=f.src[y+1];if(/\d/.test(S)&&/\d/.test(_)){if(!m){const b=f.push("text","",0);b.content="~"}return f.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(h,m)=>{const f=h[m],y=String(f.info??"").trim(),S=String(f.content??""),_=btoa(unescape(encodeURIComponent(S))),b=v9(y),v=tm(b),g=y9(`editor-${e}-${m}-${b}`),k=tm(o("common.copy"));return`<div class="code-block" data-code="${_}" data-lang="${v}" id="${g}">
|
|
204
|
-
<div class="code-header">
|
|
205
|
-
<span class="code-lang">${tm(b.toUpperCase())}</span>
|
|
206
|
-
<button class="copy-button" data-code="${_}">${k}</button>
|
|
207
|
-
</div>
|
|
208
|
-
<div class="code-editor"></div>
|
|
209
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=h=>{if(!h.startsWith("["))return!1;const m=c.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const f=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(h,m)=>{const f=h;if(f.src[f.pos]!=="[")return!1;const y=a.exec(f.src.slice(f.pos));if(!y)return!1;const S=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(S))return!1;const _=f.src.slice(f.pos+y[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))return!1;if(!m){const b=y[1],v=f.push("reference","span",0);v.content=b,v.markup=y[0],v.raw=y[0]}return f.pos+=y[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const y=String(h[m].content??"");return`<span class="reference-link" data-reference-id="${y}" role="button" tabindex="0" title="Click to view reference">${y}</span>`},n}const k9="modulepreload",b9=function(e){return"/"+e},zb={},Js=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=b9(c),c in zb)return;zb[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":k9,u||(h.as="script"),h.crossOrigin="",h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),u)return new Promise((m,f)=>{h.addEventListener("load",m),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function _9({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 wx({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:_9({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}function Il(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function Vb(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var w9=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const h=this.source.length>0,m=this.pendingChars<=0;if(this.source+=d,m){const f=Kb();this.startedAt=h&&this.hasStarted?f-this.normalizedStartDelayMs:f,this.lastTick=f,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=Kb();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const h=1e3/Math.max(1,this.maxCommitFps),m=Math.min(100,Math.max(0,d-this.lastTick));if(m<h){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,y=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,S=T9(f/Math.max(.001,y/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(S-this.currentCps)*.2,this.charBudget+=this.currentCps*(m/1e3),this.charBudget<1){this.ensureLoop();return}const _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=x9(this.source.slice(this.visible.length),_,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Il(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Il(s,1e3,1)),this.normalizedTargetLatencyMs=Il(o,900,1),this.normalizedCatchUpLatencyMs=Il(i,350,1),this.normalizedCatchUpThreshold=Vb(r,600),this.normalizedStartDelayMs=Vb(a,80),this.maxCommitFps=Math.trunc(Il(l,30,1)),this.maxCharsPerCommit=Math.trunc(Il(c,80,1)),this.flushOnFinish=u,this.segmenter=C9(),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 S9(e={},t){const n=new w9(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 C9(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function x9(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function Kb(){return typeof performance<"u"?performance.now():Date.now()}function T9(e,t,n){return Math.min(n,Math.max(t,e))}var M9=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const kg=Symbol.for("markstream-vue:node-lifecycle"),bg=new Map;let Gb="material";const Ul=new Map,Yb=new Map;let _g=null;function A9(e){bg.set(e.id,e)}function E9(e){return M9(this,null,function*(){var t,n,s;if(Ul.has(e.id))return(t=Ul.get(e.id))!=null?t:null;let o=Yb.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Ul.set(e.id,i),_g?.(),i)).catch(()=>(Ul.set(e.id,null),null)),Yb.set(e.id,o)),o})}const Xb='<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>',Zb='<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>',I9={id:"material",core:{"":Zb,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:Zb,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:Xb,csharp:Xb,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:()=>Js(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},$9=ll(0);_g=()=>{$9.value++},A9(I9);const N9={"":"",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","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Sx(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=N9[n])!=null?t:n}function Pue(e){const t=Sx(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Rue(e){return(function(s){const o=bg.get(Gb);if(!o)return;const i=o.core[s];if(i)return i;const r=Ul.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Ul.has(o.id)&&E9(o)})(Sx(e))||((n=(t=bg.get(Gb))==null?void 0:t.fallback)!=null?n:"");var t,n}const Due={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#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let Cx=!1;function Bue(){return Cx}function Fue(){Cx=!0}var lh=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Mo=null,nm=!1,X1=xx;function ah(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Z1(){try{const e=globalThis;return ah(e?.katex)}catch{return null}}function xx(){return lh(null,null,function*(){const e=Z1();if(e)return e;const t=yield Js(()=>import("./katex-HP8lGamR.js"),[]);try{yield Js(()=>import("./mhchem-KEf2LMH_.js"),__vite__mapDeps([0,1]))}catch{}return ah(t)})}function Tx(){return typeof X1=="function"}function Hue(){var e;const t=X1;if(!t||t===xx)return null;if(Mo)return Mo;const n=Z1();if(n)return Mo=n,Mo;try{const s=t();return s&&typeof s?.then!="function"?(Mo=(e=ah(s))!=null?e:s,Mo):null}catch{return null}}function Q1(){return lh(this,null,function*(){var e;const t=Z1();if(t)return Mo=t,Mo;if(Mo)return Mo;if(nm)return null;const n=X1;if(!n)return nm=!0,null;try{const s=yield n();if(s)return Mo=(e=ah(s))!=null?e:s,Mo}catch{}return nm=!0,null})}function Mx(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let $l=null;const Ax=new Map,nc=new Map;let Ex=5;const Xr=new Set;function L9(){if(Ax.size<Ex&&Xr.size){const e=Array.from(Xr);Xr.clear();for(const t of e)try{t()}catch{}}}function O9(e,t=!0,n=2e3,s){return lh(this,null,function*(){performance.now();const o=Mx(e);if(!Tx()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if($l)return Promise.reject($l);const i=`${t?"d":"i"}:${o}`,r=nc.get(i);return r?Promise.resolve(r):($l=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$l.name="WorkerInitError",$l.code="WORKER_INIT_ERROR",Promise.reject($l))})}function Wue(e,t=!0,n){const s=`${t?"d":"i"}:${Mx(e)}`;if(nc.set(s,n),nc.size>200){const o=nc.keys().next().value;nc.delete(o)}}const P9="WORKER_BUSY";function R9(e=2e3,t){return Ax.size<Ex?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Xr.delete(r),n())};if(Xr.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Xr.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>L9()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Xr.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Ga={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Uue(e){return lh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!Tx()){const y=new Error("KaTeX rendering disabled");throw y.name="KaTeXDisabled",y.code="KATEX_DISABLED",y}const a=(o=s.timeout)!=null?o:Ga.timeout,c=(i=s.waitTimeout)!=null?i:Ga.waitTimeout,u=(r=s.backoffMs)!=null?r:Ga.backoffMs,d=(l=s.maxRetries)!=null?l:Ga.maxRetries,h=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Ga.maxRetries,m=s.signal;let f=0;for(;;){if(m?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}try{return yield O9(t,n,a,m)}catch(y){if(y?.code!==P9||f>=h)throw y;if(f++,yield R9(c,m).catch(()=>{}),m?.aborted){const S=new Error("Aborted");throw S.name="AbortError",S}u>0&&(yield new Promise(S=>globalThis.setTimeout(S,u*f)))}}})}var D9=Object.defineProperty,B9=Object.defineProperties,F9=Object.getOwnPropertyDescriptors,Qb=Object.getOwnPropertySymbols,H9=Object.prototype.hasOwnProperty,W9=Object.prototype.propertyIsEnumerable,Jb=(e,t,n)=>t in e?D9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,st=(e,t)=>{for(var n in t||(t={}))H9.call(t,n)&&Jb(e,n,t[n]);if(Qb)for(var n of Qb(t))W9.call(t,n)&&Jb(e,n,t[n]);return e},Et=(e,t)=>B9(e,F9(t)),yn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const U9="__global__",sm="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",wg=(()=>{const e=globalThis;if(e[sm])return e[sm];const t={scopedCustomComponents:{},revision:ll(0)};return e[sm]=t,t})(),e_=wg.revision,q9=Symbol("markstreamCustomComponents"),j9=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 tu(e){return j9.has(String(e).trim().toLowerCase())}function z9(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function om(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([Oo(n),Oo(z9(n))]))!o||tu(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function Wn(e){const t=Bt(q9,null);return j(()=>{var n;return e_.value,(function(s,o={}){return e_.value,st(st(st({},om(wg.scopedCustomComponents[U9]||{})),om(o)),om((function(i){return i&&wg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const V9=["aria-label"],K9={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"},G9={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"},Zt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},no=Zt(Je({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(C(),E("svg",G9,[...n[1]||(n[1]=[p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),p("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(C(),E("svg",K9,[...n[0]||(n[0]=[p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,V9))}),[["__scopeId","data-v-be21ab83"]]);no.install=e=>{e.component(no.__name,no)};const Y9={class:"emoji-node"},Fs=Zt(Je({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("span",Y9,N(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const X9=["id"],Z9=["title"],so=Zt(Je({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(C(),E("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[p("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+N(e.node.id)+"]",9,Z9)],8,X9))}}),[["__scopeId","data-v-c1463a29"]]);so.install=e=>{e.component(so.__name,so)};const Ix=(()=>{try{return!1}catch{}return!1})();function im(e){Ix&&console.warn(e)}function t_(e,t="safe",n){return Y1(e,t,n)}function $x(e){return XD(e)}function rm(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function J1(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=yg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),rm(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),rm(r.value)]):Object.entries(o).map(([r,l])=>[r,rm(l)]):null,t,n);var o;if(!s)return;const i=$x(pf(s));return Object.keys(i).length>0?i:void 0}function n_(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Ya(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function lm(e,t,n,s,o,i,r=!1){const l=(function(d,h){return yx(d,h)})(e,s);if(Jc.has(e.toLowerCase())||!l&&mx(e,i))return null;if(!l&&G1(e,i))return r?[n_(e,t,!0)]:[n_(e,t),...n,`</${e}>`];const a=Y1(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],h=$x(a);return Xt(d,Et(st({},h),{key:u}),n.length>0?n:void 0)}return Xt(e,Et(st({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function Nx(e,t){return e9(e,t)}function mf(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const h=lm(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Ya(c.length>0?c[c.length-1].children:u,h)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const h=d.tagName.toLowerCase();let m=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===h){m=f;break}if(m!==-1)for(;c.length>m;){const f=c.pop(),y=lm(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?Ya(c[c.length-1].children,y):Ya(u,y),f.tagName.toLowerCase()!==h&&c.length>m&&im(`Auto-closing unclosed tag: <${f.tagName}>`)}else im(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),h=lm(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Ya(c[c.length-1].children,h):Ya(u,h),im(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(ZD(e),t,n)}catch(o){return s=o,Ix&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const Q9=["innerHTML"],oo=Zt(Je({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Bt("markstreamHtmlPolicy",void 0),s=j(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=Wn(()=>t.customId),i=Je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=j(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:sa(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=mf(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!Nx(l,o.value))return{mode:"html",content:sa(l,s.value)};const a=mf(l,o.value,s.value);return a===null?{mode:"html",content:sa(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(C(),E("span",{key:0,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[kt(T(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(C(),E("span",{key:1,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},N(r.value.content),3)):(C(),E("span",{key:2,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,Q9))}}),[["__scopeId","data-v-d17f12b0"]]);oo.install=e=>{e.component(oo.__name,oo)};const J9={class:"inline-code"},eB={key:0},vs=Zt(Je({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Gc(),s=Bt("markstreamFade",void 0),o=Bt("markstreamTextStreamState",void 0),i=Bt("markstreamStreamVersion",void 0),r=j(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=j(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=j(()=>{var b;return String((b=t.node.code)!=null?b:"")}),c=j(()=>!l.value),u=j(()=>{var b;const v=(b=n["index-key"])!=null?b:n.indexKey;return v==null||v===""?"":String(v)}),d=se(t.node.code),h=se("");let m=i?.value;const f=se(0);function y(){return d.value+h.value}function S(){h.value&&(d.value=y(),h.value="")}Ve([()=>t.node.code,u,l,()=>i?.value],([b,v,g,k])=>{const $=String(b??""),A=u.value,w=k!==m;m=k;const x=wx({nextContent:$,persistedContent:A?o?.get(A):void 0,currentState:{settledContent:d.value,streamedDelta:h.value},typewriterEnabled:l.value,streamRenderVersionChanged:w});d.value=x.settledContent,h.value=x.streamedDelta,x.appended&&(f.value+=1),A&&o?.set(A,$)},{immediate:!0}),Ve(l,b=>{var v;b||(v=y(),d.value=v,h.value="")});const _=j(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,v)=>(C(),E("code",J9,[c.value?(C(),E(Le,{key:0},[vt(N(a.value),1)],64)):(C(),E(Le,{key:1},[d.value?(C(),E("span",eB,N(d.value),1)):ce("",!0),h.value?(C(),E("span",{key:1,class:$e(["inline-code-stream-delta",[_.value]]),onAnimationend:S},N(h.value),35)):ce("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);vs.install=e=>{e.component(vs.__name,vs)};const Sg=se(!1),s_=se(""),o_=se("top"),yc=se(null),kc=se(null),Cg=se(null),xg=se(null),i_=se(null);let vd=null,yd=null,Tg=0;function Lx(){vd&&(clearTimeout(vd),vd=null),yd&&(clearTimeout(yd),yd=null)}let Ju=!1,ed=null,r_=!1;function tB(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Tg;Lx();const l=()=>yn(null,null,function*(){var a,c;if(yield(function(){return yn(this,null,function*(){if(!Ju&&!r_&&typeof document<"u"){ed!=null||(ed=yn(null,null,function*(){const[{createApp:u,h:d},{default:h}]=yield Promise.all([Js(()=>import("./vue.runtime.esm-bundler-DPCj1V1e.js"),[]),Js(()=>import("./Tooltip-BGNN9cLC.js"),[])]),m=document.createElement("div");m.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(m),u({setup:()=>()=>{var f;return d(h,{visible:Sg.value,"anchor-el":yc.value,content:s_.value,placement:o_.value,id:kc.value,originX:Cg.value,originY:xg.value,isDark:(f=i_.value)!=null?f:void 0})}}).mount(m),Ju=!0}));try{yield ed}catch(u){Ju=!1,ed=null,r_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Ju&&r===Tg){kc.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,yc.value=e,s_.value=t,o_.value=n,Cg.value=(a=o?.x)!=null?a:null,xg.value=(c=o?.y)!=null?c:null,i_.value=typeof i=="boolean"?i:null,Sg.value=!0;try{e.setAttribute("aria-describedby",kc.value)}catch{}}});s?l():vd=setTimeout(l,80)}function nB(e=!1){Tg+=1,Lx();const t=()=>{if(yc.value&&kc.value)try{yc.value.removeAttribute("aria-describedby")}catch{}Sg.value=!1,yc.value=null,kc.value=null,Cg.value=null,xg.value=null};e?t():yd=setTimeout(t,120)}const Mg={"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..."},Ag=e=>{var t;return(t=Mg[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function l_(e){return{t(t){if(e.te&&Mg[t]&&!e.te(t))return Ag(t);const n=e.t(t);return n===t&&Mg[t]?Ag(t):n}}}function sB(){const e=(function(){var t,n;try{const s=ys(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return l_(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return l_({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Ag}}function oB(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const iB=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],rB={key:1,class:"image-placeholder"},lB={key:1,class:"image-node__raw-text"},aB={key:0,class:"image-shimmer-overlay"},cB={key:1,class:"image-node__raw-text"},uB={key:2,class:"image-error"},fr=Zt(Je({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=se(!1),i=se(!1),r=se(""),l=se("primary"),a=se(null),c=Gc(),u=Bt(kg,null);let d="",h=null;const m=j(()=>eb(n.node.src)),f=j(()=>eb(n.fallbackSrc)),y=j(()=>r.value),S=j(()=>!n.lazy),_=j(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),b=j(()=>l.value==="failed"),v=j(()=>!S.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),g=j(()=>oB(n,c));function k(B=g.value){B&&a.value&&u?.reportHeight(B,a.value.offsetHeight)}function $(B=g.value){B&>(()=>{k(B)})}function A(){h&&(clearTimeout(h),h=null)}function w(){const B=g.value;B&&d!==B&&(d&&u?.markSettled(d),A(),d=B,u?.markPending(B),typeof window<"u"&&(h=window.setTimeout(()=>{d===B&&($(B),x())},8e3)))}function x(){return yn(this,null,function*(){const B=d;B&&(A(),d="",yield gt(),k(B),u?.markSettled(B))})}function I(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,o.value=!1,i.value=!1,void $();l.value="failed",i.value=!0,s("error",r.value),$()}function L(){o.value=!0,i.value=!1,s("load",y.value),$()}function O(B){B.preventDefault(),o.value&&!i.value&&s("click",[B,y.value])}const{t:P}=sB();return Ve([m,f,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||m.value?(r.value=m.value,void(l.value="primary")):f.value?(r.value=f.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ve([_,o,i,y,()=>n.lazy],([B,R,W,V,z])=>B&&V&&!W?R?(x(),void $()):z?(w(),void $()):void(R||W||w()):(x(),void $()),{flush:"post",immediate:!0}),lo(()=>{(function(){const B=d;B&&(A(),d="",u?.markSettled(B))})()}),(B,R)=>{var W,V,z,ie,ae;return C(),E("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(C(),E("img",{key:0,src:y.value,alt:String((V=(W=n.node.alt)!=null?W:n.node.title)!=null?V:""),title:String((ie=(z=n.node.title)!=null?z:n.node.alt)!=null?ie:""),class:$e(["image-node__img",{"is-loading":!S.value&&!o.value,"is-loaded":S.value||o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:S.value?"high":void 0,decoding:S.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(ae=n.node.alt)!=null?ae:T(P)("image.preview"),onError:I,onLoad:L,onClick:O},null,42,iB)):ce("",!0),e.node.loading&&!i.value?(C(),E("span",rB,[n.usePlaceholder?Gl(B.$slots,"placeholder",{key:0,node:n.node,displaySrc:y.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[0]||(R[0]=p("span",{class:"image-shimmer"},null,-1))],!0):(C(),E("span",lB,N(e.node.raw),1))])):ce("",!0),kt(Ei,{name:"shimmer-fade"},{default:xn(()=>[v.value&&!e.node.loading?(C(),E("span",aB,[n.usePlaceholder?Gl(B.$slots,"placeholder",{key:0,node:n.node,displaySrc:y.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[1]||(R[1]=p("span",{class:"image-shimmer"},null,-1))],!0):(C(),E("span",cB,N(e.node.raw),1))])):ce("",!0)]),_:3}),b.value?(C(),E("span",uB,[Gl(B.$slots,"error",{node:n.node,displaySrc:y.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[2]||(R[2]=p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[p("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)),p("span",null,N(T(P)("image.loadError")),1)],!0)])):ce("",!0)],512)}}}),[["__scopeId","data-v-373b57e2"]]);fr.install=e=>{e.component(fr.__name,fr)};const dB={key:2},ai=Je({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Wn(()=>t.customId),s=Bt("markstreamHtmlPolicy",void 0),o=Bt("markstreamNestedRendererProps",void 0),i=j(()=>{var f;return(f=s?.value)!=null?f:"safe"}),r=j(()=>{var f,y;const S=(f=o?.value)!=null?f:{};return Et(st({},S),{customId:(y=t.customId)!=null?y:S.customId,htmlPolicy:i.value})}),l=ii({loader:()=>Promise.resolve().then(()=>rv),suspensible:!1}),a=j(()=>t.components[String(t.node.type)]),c=j(()=>!!(a.value&&n.value[t.node.type]&&!tu(String(t.node.type)))),u=j(()=>c.value?J1(t.node,i.value):void 0),d=j(()=>Array.isArray(t.node.children)&&t.node.children.length>0),h=j(()=>{var f;return String((f=t.node.content)!=null?f:"")}),m=j(()=>{var f,y;return String((y=(f=t.node.content)!=null?f:t.node.raw)!=null?y:"")});return(f,y)=>a.value&&c.value?(C(),je(ms(a.value),en({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:xn(()=>[d.value?(C(),je(T(l),en({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):h.value?(C(),je(T(l),en({key:1},r.value,{content:h.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(C(),je(ms(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(C(),E("span",dB,N(m.value),1)):ce("",!0)}}),fB=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],hB={key:0,translate:"no",class:"markstream-pre__diff-code"},pB={class:"markstream-pre__diff-number","aria-hidden":"true"},mB={class:"markstream-pre__diff-content"},gB={class:"markstream-pre__diff-content-inner"},vB={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},yB=["textContent"],xo=Je({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=j(()=>{var w,x,I;const L=String((x=(w=t.node)==null?void 0:w.language)!=null?x:"");return String((I=String(L).split(/\s+/g)[0])!=null?I:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=j(()=>`language-${n.value}`),o=j(()=>{var w,x;return String((x=(w=t.node)==null?void 0:w.code)!=null?x:"").split(/\r\n|\n|\r/)}),i=j(()=>Array.from({length:Math.max(1,o.value.length)},(w,x)=>x+1)),r=j(()=>{var w;return t.showLineNumbers===!0&&((w=t.node)==null?void 0:w.diff)===!0}),l=j(()=>r.value&&t.diffInline===!0),a=j(()=>{const w=Number(t.reservedHeightPx);if(!Number.isFinite(w)||w<=0)return;const x=`${Math.ceil(w)}px`;return{height:x,minHeight:x,maxHeight:x,overflow:"auto"}});function c(w,x="context"){const I=(function(L){return String(L??"").trim().length===0})(w);return{code:w,kind:I&&x!=="hunk"?"context":x,empty:I}}function u(w){return String(w??"").split(/\r\n|\n|\r/)}function d(w){return w.startsWith("-")&&!w.startsWith("---")}function h(w){return w.startsWith("+")&&!w.startsWith("+++")}const m=j(()=>{var w,x,I,L,O,P;const B=o.value.some(V=>d(V)||h(V));if(l.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:B?(function(z){const ie=[];let ae=1,re=1;for(const[Te,Pe]of z.entries())if(Pe.startsWith("@@"))ie.push(Et(st({},c(Pe,"hunk")),{key:`inline-hunk-${Te}`,number:""}));else if(d(Pe))ie.push(Et(st({},c(Pe.slice(1),"removed")),{key:`inline-removed-${Te}`,number:ae++}));else if(h(Pe))ie.push(Et(st({},c(Pe.slice(1),"added")),{key:`inline-added-${Te}`,number:re++}));else{const We=Pe.startsWith(" ")?Pe.slice(1):Pe;ie.push(Et(st({},c(We)),{key:`inline-context-${Te}`,number:re})),ae++,re++}return ie})(o.value):(function(z,ie){const ae=u(z),re=u(ie),Te=[];let Pe=0,We=ae.length-1,Ne=re.length-1;for(;Pe<=We&&Pe<=Ne&&ae[Pe]===re[Pe];)Te.push(Et(st({},c(re[Pe])),{key:`inline-prefix-${Pe}`,number:Pe+1})),Pe++;const me=[];for(;We>=Pe&&Ne>=Pe&&ae[We]===re[Ne];)me.unshift(Et(st({},c(re[Ne])),{key:`inline-suffix-${Ne}`,number:Ne+1})),We--,Ne--;for(let be=Pe;be<=We;be++)Te.push(Et(st({},c(ae[be],"removed")),{key:`inline-removed-source-${be}`,number:be+1}));for(let be=Pe;be<=Ne;be++)Te.push(Et(st({},c(re[be],"added")),{key:`inline-added-source-${be}`,number:be+1}));return Te.concat(me)})((w=t.node)==null?void 0:w.originalCode,(x=t.node)==null?void 0:x.updatedCode)}];if(!B&&(((I=t.node)==null?void 0:I.originalCode)!=null||((L=t.node)==null?void 0:L.updatedCode)!=null))return[{key:"original",className:"markstream-pre__diff-pane--original",lines:u((O=t.node)==null?void 0:O.originalCode).map((V,z)=>Et(st({},c(V,"removed")),{key:`original-${z}`,number:z+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:u((P=t.node)==null?void 0:P.updatedCode).map((V,z)=>Et(st({},c(V,"added")),{key:`modified-${z}`,number:z+1}))}];const R=[],W=[];for(const V of o.value)if(V.startsWith("@@"))R.push(c(V,"hunk")),W.push(c(V,"hunk"));else if(V.startsWith("-")&&!V.startsWith("---"))R.push(c(V.slice(1),"removed"));else if(V.startsWith("+")&&!V.startsWith("+++"))W.push(c(V.slice(1),"added"));else{const z=V.startsWith(" ")?V.slice(1):V;R.push(c(z)),W.push(c(z))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:R.map((V,z)=>Et(st({},V),{key:`original-${z}`,number:z+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:W.map((V,z)=>Et(st({},V),{key:`modified-${z}`,number:z+1}))}]}),f=j(()=>{const w=n.value;return w?`Code block: ${w}`:"Code block"}),y=se(null),S=se([]);let _=null,b=null;function v(w){const x=Number.parseFloat(String(w??""));return Number.isFinite(x)&&x>0?x:0}function g(w,x){var I;if(!w)return x;const L=w.querySelector(".markstream-pre__diff-content"),O=L?.getBoundingClientRect(),P=(I=O?.height)!=null?I:0;return Math.max(x,Math.ceil(P))}function k(){typeof window<"u"&&(_!=null&&window.cancelAnimationFrame(_),_=window.requestAnimationFrame(()=>{(function(){var w,x;_=null;const I=y.value;if(!I||!r.value)return void(S.value.length&&(S.value=[]));const L=(function(z){const ie=window.getComputedStyle(z),ae=v(ie.getPropertyValue("--markstream-pre-diff-line-height"));if(ae>0)return ae;const re=v(ie.lineHeight);return re>0?re:18})(I),O=Array.from(I.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),P=Array.from(I.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),B=Math.max(O.length,P.length),R=[];for(let z=0;z<B;z++){const ie=g((w=O[z])!=null?w:null,L),ae=g((x=P[z])!=null?x:null,L),re=Math.max(L,ie,ae);R.push({rowHeight:re,originalHeight:ie,modifiedHeight:ae})}var W,V;W=S.value,V=R,W.length===V.length&&W.every((z,ie)=>{const ae=V[ie];return ae&&Math.abs(z.rowHeight-ae.rowHeight)<=.5&&Math.abs(z.originalHeight-ae.originalHeight)<=.5&&Math.abs(z.modifiedHeight-ae.modifiedHeight)<=.5})||(S.value=R)})()}))}function $(w){b?.disconnect(),b=null,w&&r.value&&typeof ResizeObserver<"u"&&(b=new ResizeObserver(()=>{k()}),b.observe(w))}function A(w,x){const I=S.value[w];if(!I)return;const L=x==="original"?I.originalHeight:I.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(I.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(L)}px`}}return Ve(y,w=>{$(w),gt(()=>k())},{flush:"post"}),Ve([r,m],()=>{$(y.value),gt(()=>k())},{flush:"post",immediate:!0}),lo(()=>{_!=null&&(window.cancelAnimationFrame(_),_=null),b?.disconnect(),b=null}),(w,x)=>(C(),E("pre",{ref_key:"preRef",ref:y,style:Dt(a.value),class:$e([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":r.value,"markstream-pre--diff-inline":l.value}]),"aria-busy":e.node.loading===!0,"aria-label":f.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[r.value?(C(),E("code",hB,[(C(!0),E(Le,null,Qe(m.value,I=>(C(),E("span",{key:I.key,class:$e(["markstream-pre__diff-pane",I.className])},[(C(!0),E(Le,null,Qe(I.lines,(L,O)=>(C(),E("span",{key:L.key,class:$e(["markstream-pre__diff-line",[`markstream-pre__diff-line--${L.kind}`,{"markstream-pre__diff-line--empty":L.empty}]]),style:Dt(A(O,I.key))},[x[0]||(x[0]=p("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),p("span",pB,N(L.number),1),p("span",mB,[p("span",gB,N(L.code),1)])],6))),128))],2))),128))])):(C(),E(Le,{key:1},[t.showLineNumbers?(C(),E("span",vB,[(C(!0),E(Le,null,Qe(i.value,I=>(C(),E("span",{key:I,class:"markstream-pre__line-number"},N(I),1))),128))])):ce("",!0),p("code",{translate:"no",class:"markstream-pre__code",textContent:N(e.node.code)},null,8,yB)],64))],14,fB))}});xo.install=e=>{e.component(xo.__name,xo)};const am=ll(!1);let a_=null;const kB={key:0},Mn=Zt(Je({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(a_||(a_=Q1().then(_=>{am.value=!!_}).catch(()=>{am.value=!1})),Id(am)),s=Gc(),o=Bt("markstreamFade",void 0),i=Bt("markstreamTextStreamState",void 0),r=Bt("markstreamStreamVersion",void 0),l=j(()=>{const _=s.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=j(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=j(()=>{var _;const b=(_=s["index-key"])!=null?_:s.indexKey;return b==null||b===""?"":String(b)}),u=se(t.node.content),d=se("");let h=r?.value;const m=se(0);function f(){return u.value+d.value}function y(){d.value&&(u.value=f(),d.value="")}Ve([()=>t.node.content,c,a,()=>r?.value],([_,b,v,g])=>{const k=String(_??""),$=c.value,A=g!==h;h=g;const w=wx({nextContent:k,persistedContent:$?i?.get($):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:A});u.value=w.settledContent,d.value=w.streamedDelta,w.appended&&(m.value+=1),$&&i?.set($,k)},{immediate:!0}),Ve(a,_=>{var b;_||(b=f(),u.value=b,d.value="")});const S=j(()=>m.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,b)=>(C(),E("span",{class:$e([[T(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(C(),E("span",kB,N(u.value),1)):ce("",!0),d.value?(C(),E("span",{key:1,class:$e(["text-node-stream-delta",[S.value]]),onAnimationend:y},N(d.value),35)):ce("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Mn.install=e=>{e.component(Mn.__name,Mn)};const Ox=Je({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return Xt(xo,Et(st({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),cm=ii({loader:()=>yn(null,null,function*(){try{return(yield Js(()=>import("./CodeBlockNode-CEaJG3Ru.js"),__vite__mapDeps([2,3,4]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),xo}}),loadingComponent:Ox,delay:0,suspensible:!1}),Vo=ii(()=>yn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return Xt(Mn,Et(st({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield Q1())return(yield Js(()=>import("./index6-DdsuTXIR.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return Xt(Mn,Et(st({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),Px=ii(()=>yn(null,null,function*(){try{if(yield Q1())return(yield Js(()=>import("./index5-DYhhPUDp.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return Xt(Mn,Et(st({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),Ts=Zt(Je({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(C(),E("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},N(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Ts.install=e=>{e.component(Ts.__name,Ts)};const bB={class:"superscript-node"},Hs=Zt(Je({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wn(()=>t.customId),s=j(()=>st({text:Mn,inline_code:vs,link:Es,html_inline:oo,strong:Ms,emphasis:Is,footnote_reference:so,strikethrough:As,highlight:io,insert:Us,subscript:Ws,emoji:Fs,math_inline:Vo,reference:Ts},n.value));return(o,i)=>(C(),E("sup",bB,[(C(!0),E(Le,null,Qe(e.node.children,(r,l)=>(C(),je(T(ai),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Hs.install=e=>{e.component(Hs.__name,Hs)};const _B={class:"subscript-node"},Ws=Zt(Je({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wn(()=>t.customId),s=j(()=>st({text:Mn,inline_code:vs,link:Es,html_inline:oo,strong:Ms,emphasis:Is,footnote_reference:so,strikethrough:As,highlight:io,insert:Us,superscript:Hs,emoji:Fs,math_inline:Vo,reference:Ts},n.value));return(o,i)=>(C(),E("sub",_B,[(C(!0),E(Le,null,Qe(e.node.children,(r,l)=>(C(),je(T(ai),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Ws.install=e=>{e.component(Ws.__name,Ws)};const wB={class:"strong-node"},Ms=Zt(Je({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wn(()=>t.customId),s=j(()=>st({text:Mn,inline_code:vs,link:Es,html_inline:oo,emphasis:Is,strikethrough:As,highlight:io,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:so,math_inline:Vo,reference:Ts},n.value));return(o,i)=>(C(),E("strong",wB,[(C(!0),E(Le,null,Qe(e.node.children,(r,l)=>(C(),je(T(ai),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Ms.install=e=>{e.component(Ms.__name,Ms)};const SB={class:"strikethrough-node"},As=Zt(Je({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wn(()=>t.customId),s=j(()=>st({text:Mn,inline_code:vs,link:Es,html_inline:oo,strong:Ms,emphasis:Is,highlight:io,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:so,math_inline:Vo,reference:Ts},n.value));return(o,i)=>(C(),E("del",SB,[(C(!0),E(Le,null,Qe(e.node.children,(r,l)=>(C(),je(T(ai),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);As.install=e=>{e.component(As.__name,As)};const CB=["href","title","aria-label","aria-hidden","target","rel"],xB=["aria-hidden"],TB={class:"link-text-wrapper relative inline-flex"},MB={class:"leading-[normal] link-text"},Es=Zt(Je({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Bt("markstreamShowTooltips",void 0),s=j(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),o=j(()=>{var _,b,v,g,k;const $=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",A=(_=t.animationOpacity)!=null?_:.35,w=Math.max(.12,Math.min(.5*A,A)),x={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":$,"--underline-opacity":String(A),"--underline-rest-opacity":String(w),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(g=t.animationTiming)!=null?g:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(k=t.animationIteration)!=null?k:"infinite"};return t.color&&(x["--link-color"]=t.color),x}),i=Wn(()=>t.customId),r=j(()=>st({text:Mn,strong:Ms,strikethrough:As,emphasis:Is,image:fr,html_inline:oo,inline_code:vs},i.value)),l=Gc(),a=j(()=>{var _,b;const v=(_=t.node)==null?void 0:_.attrs;if(!v||typeof v!="object")return{};const g={};if(Array.isArray(v))for(const k of v)Array.isArray(k)&&k[0]&&(g[String(k[0])]=String((b=k[1])!=null?b:""));else for(const[k,$]of Object.entries(v))k&&$!=null&&$!==!1&&(g[k]=$===!0?"":String($));return t_(g,"safe","a")}),c=j(()=>st(st({},l),a.value)),u=j(()=>{var _,b;return t_({href:String((b=(_=t.node)==null?void 0:_.href)!=null?b:"")},"safe","a").href}),d=j(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(nP(u.value)?"_blank":void 0)}),h=j(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),m=j(()=>{if(!u.value)return;const _=c.value.rel,b=new Set((typeof _=="string"?_:String(_??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(b).filter(g=>g.toLowerCase()!=="opener"));return h.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),f=j(()=>{const _=st({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function y(){s.value&&nB()}const S=j(()=>{var _,b;const v=(_=t.node)==null?void 0:_.title;return typeof v=="string"&&v.trim().length>0?v:String((b=u.value)!=null?b:"")});return(_,b)=>{var v,g;return e.node.loading?(C(),E("span",en({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},T(l),{style:o.value}),[p("span",TB,[p("span",MB,[kt(T(Mn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((g=e.node.text)!=null?g:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=p("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,xB)):(C(),E("a",en({key:0,class:"link-node",href:u.value,title:s.value?"":S.value,"aria-label":`Link: ${S.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:m.value},f.value,{style:o.value,onMouseenter:b[0]||(b[0]=k=>(function($){var A,w,x,I;if(!s.value)return;const L=$,O=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,P=((A=t.node)==null?void 0:A.title)||((w=u.value)!=null&&w.includes("xn--")&&((I=(x=t.node)==null?void 0:x.text)!=null&&I.includes("://"))?t.node.text:u.value)||"";tB($.currentTarget,P,"top",!1,O)})(k)),onMouseleave:y}),[(C(!0),E(Le,null,Qe(e.node.children,(k,$)=>(C(),je(T(ai),{key:`${e.indexKey||"emphasis"}-${$}`,components:r.value,node:k,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${$}`},null,8,["components","node","custom-id","index-key"]))),128))],16,CB))}}}),[["__scopeId","data-v-367e6ca4"]]);Es.install=e=>{e.component(Es.__name,Es)};const AB={class:"insert-node"},Us=Zt(Je({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wn(()=>t.customId),s=j(()=>st({text:Mn,inline_code:vs,link:Es,html_inline:oo,strong:Ms,emphasis:Is,strikethrough:As,highlight:io,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:so,math_inline:Vo,reference:Ts},n.value));return(o,i)=>(C(),E("ins",AB,[(C(!0),E(Le,null,Qe(e.node.children,(r,l)=>(C(),je(T(ai),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Us.install=e=>{e.component(Us.__name,Us)};const EB={class:"highlight-node"},io=Zt(Je({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wn(()=>t.customId),s=j(()=>st({text:Mn,inline_code:vs,link:Es,html_inline:oo,strong:Ms,emphasis:Is,strikethrough:As,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:so,math_inline:Vo,reference:Ts},n.value));return(o,i)=>(C(),E("mark",EB,[(C(!0),E(Le,null,Qe(e.node.children,(r,l)=>(C(),je(T(ai),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);io.install=e=>{e.component(io.__name,io)};const IB={class:"emphasis-node"},Is=Zt(Je({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wn(()=>t.customId),s=j(()=>st({text:Mn,inline_code:vs,link:Es,html_inline:oo,strong:Ms,strikethrough:As,highlight:io,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:so,math_inline:Vo,reference:Ts},n.value));return(o,i)=>(C(),E("em",IB,[(C(!0),E(Le,null,Qe(e.node.children,(r,l)=>(C(),je(T(ai),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Is.install=e=>{e.component(Is.__name,Is)};const $B={class:"hard-break"},hr=Zt(Je({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("br",$B))}),[["__scopeId","data-v-50c58f70"]]);hr.install=e=>{e.component(hr.__name,hr)};const Uc=Je({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=rr({checkbox:no,checkbox_input:no,emoji:Fs,emphasis:Is,hardbreak:hr,highlight:io,inline_code:vs,insert:Us,link:Es,reference:Ts,strikethrough:As,strong:Ms,subscript:Ws,superscript:Hs,text:Mn}),s=Wn(()=>t.customId),o=j(()=>{const i=s.value;return Object.keys(i).length>0?st(st({},n),i):n});return(i,r)=>(C(!0),E(Le,null,Qe(e.nodes,(l,a)=>(C(),je(T(ai),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Eg(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(Eg)}function gf(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Eg))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(Eg)?o:null}function fa(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const NB=["cite"],LB={key:0,dir:"auto",class:"paragraph-node"},OB=["custom-id"],kd=Zt(Je({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Wn(()=>t.customId),s=j(()=>!!n.value.paragraph),o=j(()=>!!n.value.text),i=j(()=>gf(t.node.children,!s.value)),r=j(()=>t.fade!==!1||o.value?null:fa(i.value));return pn("markstreamShowTooltips",j(()=>t.showTooltips)),pn("markstreamFade",j(()=>t.fade)),(l,a)=>(C(),E("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(C(),E("p",LB,[r.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},N(r.value),9,OB)):(C(),je(T(Uc),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(C(),je(T(qs),{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,NB))}}),[["__scopeId","data-v-abfecebc"]]);kd.install=e=>{e.component(kd.__name,kd)};const PB={class:"definition-list"},RB={class:"definition-term"},DB={class:"definition-desc"},bd=Zt(Je({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(C(),E("dl",PB,[(C(!0),E(Le,null,Qe(t.node.items,(o,i)=>(C(),E(Le,{key:i},[p("dt",RB,[kt(T(qs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),p("dd",DB,[kt(T(qs),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);bd.install=e=>{e.component(bd.__name,bd)};const BB=["href","title"],bc=Zt(Je({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(C(),E("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,BB))}}),[["__scopeId","data-v-e1eb37b6"]]);bc.install=e=>{e.component(bc.__name,bc)};const FB=["id"],HB={class:"flex-1"},_d=Je({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(C(),E("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[p("div",HB,[kt(T(qs),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,FB))}});_d.install=e=>{e.component(_d.__name,_d)};const WB=["custom-id"],Ig=Zt(Je({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Wn(()=>t.customId),s=Bt("markstreamFade",void 0),o=j(()=>s?.value!==!1||n.value.text?null:fa(t.node.children)),i=j(()=>st({text:Mn,inline_code:vs,link:Es,image:fr,strong:Ms,emphasis:Is,strikethrough:As,highlight:io,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,checkbox:no,checkbox_input:no,footnote_reference:so,hardbreak:hr,math_inline:Vo,reference:Ts},n.value));return(r,l)=>(C(),je(ms(`h${e.node.level}`),en({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:xn(()=>[o.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},N(o.value),9,WB)):(C(!0),E(Le,{key:1},Qe(e.node.children,(a,c)=>(C(),je(T(ai),{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"]]),vf=Ig;vf.install=e=>{e.component(Ig.__name,Ig)};const UB={key:0,dir:"auto",class:"paragraph-node"},qB=["custom-id"],jB={dir:"auto",class:"paragraph-node"},zB=["custom-id"],oa=Zt(Je({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{}},emits:["copy"],setup(e){const t=e,n=j(()=>{var m;return(m=t.node)!=null?m:t.item}),s=Wn(()=>t.customId),o=j(()=>!!s.value.paragraph),i=j(()=>!!s.value.text),r=j(()=>{var m;return gf((m=n.value)==null?void 0:m.children,!o.value)}),l=j(()=>{var m;if(o.value)return null;const f=(m=n.value)==null?void 0:m.children;if(!Array.isArray(f)||f.length<2)return null;const y=f[0];if(y?.type!=="paragraph"||!Array.isArray(y.children))return null;const S=f.slice(1);if(!S.every(b=>b?.type==="list"))return null;const _=gf([y]);return _?{paragraphChildren:_,nestedLists:S}:null});function a(){return t.fade===!1&&!i.value}const c=j(()=>a()?fa(r.value):null),u=j(()=>{var m;return a()?fa((m=l.value)==null?void 0:m.paragraphChildren):null}),d=Object.freeze({}),h=j(()=>{const{value:m}=t;return typeof m=="number"&&Number.isFinite(m)?{value:m}:d});return pn("markstreamShowTooltips",j(()=>t.showTooltips)),pn("markstreamFade",j(()=>t.fade)),(m,f)=>{var y,S;return C(),E("li",en({class:"list-item",dir:"auto"},h.value),[r.value?(C(),E("p",UB,[c.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},N(c.value),9,qB)):(C(),je(T(Uc),{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?(C(),E(Le,{key:1},[p("p",jB,[u.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},N(u.value),9,zB)):(C(),je(T(Uc),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(C(!0),E(Le,null,Qe(l.value.nestedLists,(_,b)=>(C(),je(T(qs),{key:b,nodes:[_],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:f[0]||(f[0]=v=>m.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade"]))),128))],64)):(C(),je(T(qs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(S=(y=n.value)==null?void 0:y.children)!=null?S:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"batch-rendering":!1,onCopy:f[1]||(f[1]=_=>m.$emit("copy",_))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],16)}}}),[["__scopeId","data-v-356f1243"]]);oa.install=e=>{e.component(oa.__name,oa)};const ia=Zt(Je({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=Wn(()=>e.customId),n=j(()=>t.value.list_item||oa);return(s,o)=>(C(),je(ms(e.node.ordered?"ol":"ul"),{class:$e(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:xn(()=>[(C(!0),E(Le,null,Qe(e.node.items,(i,r)=>{var l;return C(),je(ms(n.value),en({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,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-7c789f94"]]);ia.install=e=>{e.component(ia.__name,ia)};const Rx=Symbol("ViewportPriority");function VB(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?se(t):t,r=o?(n=window.requestIdleCallback)!=null?n:_=>window.setTimeout(()=>_({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:_=>window.clearTimeout(_):null;let a=null,c=null;const u=new Map,d=new Set;let h=null;function m(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||(function(){if(h!=null){try{l?.(h)}catch{}h=null}})()}}function f(_){const b=u.get(_);if(b){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch{}}try{a?.unobserve(_)}catch{}u.delete(_),d.delete(_),m()}}function y(){r&&h==null&&d.size&&(h=r(()=>{h=null;const _=d.values().next().value;_&&(d.delete(_),f(_),d.size&&y())},{timeout:1200}))}const S=(_,b)=>{const v=se(!1);let g,k=!1;const $=new Promise(x=>{g=()=>{k||(k=!0,x())}}),A=()=>{try{a?.unobserve(_)}catch{}u.delete(_),d.delete(_),m()};if(!o||!i.value)return v.value=!0,g(),{isVisible:v,whenVisible:$,destroy:A};const w=(function(x,I){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const L=(function(B,R){var W,V,z;return{root:(W=e?.(B??null))!=null?W:null,rootMargin:(V=R?.rootMargin)!=null?V:"300px",threshold:(z=R?.threshold)!=null?z:0}})(x,I);if(a&&(P=L,(O=c)&&O.root===P.root&&O.rootMargin===P.rootMargin&&O.threshold===P.threshold))return a;var O,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(B=>{for(const R of B)(R.isIntersecting||R.intersectionRatio>0)&&f(R.target)},{root:L.root,rootMargin:L.rootMargin,threshold:L.threshold}),c=L;for(const B of u.keys())a.observe(B);return a})(_,b);return w?(u.set(_,{resolve:g,visible:v}),w.observe(_),d.add(_),y(),{isVisible:v,whenVisible:$,destroy:A}):(v.value=!0,g(),{isVisible:v,whenVisible:$,destroy:A})};return pn(Rx,S),S}function KB(){var e,t;const n=Bt(Rx,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=h=>{const m=s.get(h);if(m){if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{o?.unobserve(h)}catch{}s.delete(h),i.delete(h),i.size||c()}},d=()=>{l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),u(h),i.size&&d())},{timeout:1200}))};return h=>{const m=se(!1);let f,y=!1;const S=new Promise(v=>{f=()=>{y||(y=!0,v())}}),_=()=>{try{o?.unobserve(h)}catch{}s.delete(h),i.delete(h),i.size||c()},b=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const g of v)(g.isIntersecting||g.intersectionRatio>0)&&u(g.target)},{root:null,rootMargin:"300px",threshold:0}),o));return b?(s.set(h,{resolve:f,visible:m}),b.observe(h),i.add(h),d(),{isVisible:m,whenVisible:S,destroy:_}):(m.value=!0,f(),{isVisible:m,whenVisible:S,destroy:_})}}const GB={key:2,class:"html-block-node__raw"},YB=["innerHTML"],XB={key:1,class:"html-block-node__placeholder"},_c=Zt(Je({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Bt("markstreamHtmlPolicy",void 0),s=Bt("markstreamNestedRendererProps",void 0),o=j(()=>{var $,A;return(A=($=t.htmlPolicy)!=null?$:n?.value)!=null?A:"safe"}),i=j(()=>{var $,A;const w=($=s?.value)!=null?$:{};return Et(st({},w),{customId:(A=t.customId)!=null?A:w.customId,htmlPolicy:o.value})}),r=ii({loader:()=>Promise.resolve().then(()=>rv),suspensible:!1}),l=j(()=>{const $=yg(t.node.attrs,o.value);if(!$)return;const A=pf($);return Object.keys(A).length>0?A:void 0}),a=j(()=>{const $=String(t.node.tag||"").trim(),A=yg(t.node.attrs,o.value,$);if(!A)return;const w=pf(A);return Object.keys(w).length>0?w:void 0}),c=Wn(()=>t.customId),u=Je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=se(null),h=se(typeof window>"u"),m=se(t.node.content),f=j(()=>Array.isArray(t.node.children)?t.node.children:[]),y=j(()=>String(t.node.tag||"div")),S=j(()=>{const $=y.value.trim().toLowerCase();return $C.has($)||G1($,o.value)}),_=j(()=>f.value.length>0&&!!t.node.tag&&!S.value),b=j(()=>{var $,A,w;if(_.value)return{mode:"structured"};if(!h.value)return{mode:"html",content:($=m.value)!=null?$:""};const x=(A=m.value)!=null?A:t.node.content;if(!x)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:sa(x,o.value)};if(t.node.loading){const L=mf(x,c.value,o.value);return L===null?{mode:"text",content:(w=t.node.raw)!=null?w:x}:{mode:"dynamic",nodes:L}}if(!Nx(x,c.value))return{mode:"html",content:sa(x,o.value)};const I=mf(x,c.value,o.value);return I===null?{mode:"html",content:sa(x,o.value)}:{mode:"dynamic",nodes:I}}),v=KB(),g=se(null),k=!!t.node.loading;return typeof window<"u"?(Ve(d,$=>{var A,w;if((w=(A=g.value)==null?void 0:A.destroy)==null||w.call(A),g.value=null,!k)return h.value=!0,void(m.value=t.node.content);if(!$)return void(h.value=!1);const x=v($,{rootMargin:"400px"});g.value=x,h.value=x.isVisible.value,x.whenVisible.then(()=>{h.value=!0})},{immediate:!0}),Ve(()=>t.node.content,$=>{k&&!h.value||(m.value=$)})):h.value=!0,lo(()=>{var $,A;(A=($=g.value)==null?void 0:$.destroy)==null||A.call($),g.value=null}),($,A)=>(C(),je(ms(_.value?y.value:"div"),en({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:xn(()=>[h.value?(C(),E(Le,{key:0},[b.value.mode==="structured"?(C(),je(T(r),en({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):b.value.mode==="dynamic"?(C(),je(T(u),{key:1,nodes:b.value.nodes},null,8,["nodes"])):b.value.mode==="text"?(C(),E("pre",GB,N(b.value.content),1)):(C(),E("div",en({key:3},l.value,{innerHTML:b.value.content}),null,16,YB))],64)):(C(),E("div",XB,[Gl($.$slots,"placeholder",{node:e.node},()=>[A[0]||(A[0]=p("span",{class:"html-block-node__placeholder-bar"},null,-1)),A[1]||(A[1]=p("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),A[2]||(A[2]=p("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);_c.install=e=>{e.component(_c.__name,_c)};const ZB={dir:"auto",class:"paragraph-node"},QB=["custom-id"],nl=Zt(Je({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Wn(()=>t.customId),s=Bt("markstreamHtmlPolicy",void 0),o=Bt("markstreamFade",void 0),i=Bt("markstreamParseOptions",void 0),r=Bt("markstreamCustomMarkdownIt",void 0),l=Bt("markstreamNestedRendererProps",void 0),a=j(()=>{var w;return(w=s?.value)!=null?w:"safe"}),c=j(()=>{var w;return(w=t.parseOptions)!=null?w:i?.value}),u=j(()=>{var w;return(w=t.customMarkdownIt)!=null?w:r?.value}),d=j(()=>{var w,x;return(x=t.customHtmlTags)!=null?x:(w=l?.value)==null?void 0:w.customHtmlTags}),h=j(()=>{var w,x;const I=(w=l?.value)!=null?w:{};return Et(st({},I),{customId:(x=t.customId)!=null?x:I.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),m=ii({loader:()=>Promise.resolve().then(()=>rv),suspensible:!1});function f(w){var x;return w.type==="text"&&String((x=w.content)!=null?x:"").trim()===""}const y=j(()=>t.node.children.filter(w=>!f(w))),S=j(()=>y.value.length>0&&y.value.every(w=>w.type==="image"||(function(x){var I;const L=(function(O){return O.type==="link"&&Array.isArray(O.children)?O.children.filter(P=>!f(P)):[]})(x);return L.length===1&&((I=L[0])==null?void 0:I.type)==="image"})(w))),_=j(()=>new Set(ga(d.value))),b=j(()=>{if(!S.value||y.value.length<=1)return t.node.children;const w=[];for(let x=0;x<t.node.children.length;x++){const I=t.node.children[x];if(!f(I)){w.push(I);continue}const L=w.length>0,O=t.node.children.slice(x+1).some(P=>!f(P));L&&O&&w.push(Et(st({},I),{content:" ",raw:" "}))}return w}),v=j(()=>o?.value===!1&&!n.value.text),g=j(()=>v.value?fa(b.value):null);function k(w,x){return{node:w,"index-key":`${t.indexKey}-${x}`,"custom-id":t.customId,"custom-html-tags":d.value}}const $=j(()=>st({inline_code:vs,image:fr,link:Es,hardbreak:hr,emphasis:Is,strong:Ms,strikethrough:As,highlight:io,insert:Us,subscript:Ws,superscript:Hs,html_inline:oo,html_block:_c,emoji:Fs,checkbox:no,math_inline:Vo,checkbox_input:no,reference:Ts,footnote_anchor:bc,footnote_reference:so,text:Mn},n.value)),A=j(()=>b.value.map((w,x)=>{var I;const L=(function(O){var P,B,R,W;if(O.type==="html_block"||O.type==="html_inline"){const V=String((P=O.tag)!=null?P:"").trim().toLowerCase()||PC(O.content);if(V&&!_.value.has(V)&&RC((B=O.content)!=null?B:O.raw,V)){const z=String((W=(R=O.content)!=null?R:O.raw)!=null?W:"");return{child:{type:"text",content:z,raw:z},component:Mn,isCustomComponent:!1}}}return{child:O,component:$.value[O.type],isCustomComponent:!!(n.value[O.type]&&!tu(String(O.type)))}})(w);return Et(st({},L),{index:x,key:`${t.indexKey||"paragraph"}-${x}`,customAttrs:L.isCustomComponent?J1(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String((I=L.child.content)!=null?I:""),originalChild:w})}));return(w,x)=>(C(),E("p",ZB,[g.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},N(g.value),9,QB)):(C(!0),E(Le,{key:1},Qe(A.value,I=>{return C(),E(Le,{key:I.key},[S.value&&f(I.originalChild)?(C(),E(Le,{key:0},[vt(N((L=I.originalChild,String((O=L.content)!=null?O:""))),1)],64)):I.isCustomComponent?(C(),je(ms(I.component),en({key:1,ref_for:!0},I.customAttrs,{node:I.child,loading:I.child.loading,"index-key":I.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":h.value.isDark}),{default:xn(()=>[I.hasSlotChildren?(C(),je(T(m),en({key:0,ref_for:!0},h.value,{nodes:I.child.children,"index-key":I.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):I.slotContent?(C(),je(T(m),en({key:1,ref_for:!0},h.value,{content:I.slotContent,final:!I.child.loading,"index-key":`${I.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(C(),je(ms(I.component),en({key:2,ref_for:!0},k(I.child,I.index)),null,16))],64);var L,O}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);nl.install=e=>{e.component(nl.__name,nl)};const JB={class:"table-node-wrapper"},eF=["aria-busy"],tF={key:0},nF=["custom-id"],sF=["aria-label","onPointerdown"],oF=["custom-id"],iF={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},wc=Zt(Je({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=j(()=>{var _;return(_=t.node.loading)!=null&&_}),s=j(()=>{var _;return(_=t.node.rows)!=null?_:[]}),o=se(null),i=se([]);let r=null;const l=j(()=>t.node.header.cells.length),a=j(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=j(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);pn("markstreamShowTooltips",j(()=>t.showTooltips)),pn("markstreamFade",j(()=>t.fade));const u=Wn(()=>t.customId),d=j(()=>!!u.value.text),h=j(()=>!!u.value.paragraph),m=new WeakMap;function f(_){const b=t.fade===!1&&!d.value,v=!h.value,g=m.get(_);if(g?.children===_.children&&g.textFastPath===b&&g.paragraphFastPath===v)return g.info;const k=gf(_.children,v,!0),$={simpleChildren:k,plainText:k&&b?fa(k):null};return m.set(_,{children:_.children,textFastPath:b,paragraphFastPath:v,info:$}),$}function y(_){if(!r)return;_.preventDefault();const b=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(b/2)),g=Math.max(v,Math.min(b-v,Math.round(r.startWidth+_.clientX-r.startX))),k=[...r.widths];k[r.index]=g,k[r.index+1]=b-g,i.value=k}function S(){r&&(window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),r=null)}return Ve(l,()=>{S(),i.value=[]}),lo(S),(_,b)=>(C(),E("div",JB,[p("table",{ref_key:"tableRef",ref:o,class:$e(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(C(),E("colgroup",tF,[(C(!0),E(Le,null,Qe(e.node.header.cells,(v,g)=>(C(),E("col",{key:g,style:Dt(c.value[g])},null,4))),128))])):ce("",!0),p("thead",null,[p("tr",null,[(C(!0),E(Le,null,Qe(e.node.header.cells,(v,g)=>(C(),E("th",{key:g,dir:"auto",class:$e([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[f(v).plainText!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},N(f(v).plainText),9,nF)):f(v).simpleChildren?(C(),je(T(Uc),{key:1,nodes:f(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${g}`},null,8,["nodes","custom-id","index-key"])):(C(),je(T(qs),{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:b[0]||(b[0]=k=>_.$emit("copy",k))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),g<e.node.header.cells.length-1?(C(),E("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${g+1} and ${g+2}`,onPointerdown:k=>(function($,A){if(A.button!==0)return;const w=(function(){var L;const O=(L=o.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(O??[],P=>Math.round(P.getBoundingClientRect().width))})(),x=w[$],I=w[$+1];x&&I&&(A.preventDefault(),r={index:$,startX:A.clientX,startWidth:x,nextStartWidth:I,widths:w},i.value=w,window.addEventListener("pointermove",y),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S))})(g,k)},null,40,sF)):ce("",!0)],2))),128))])]),p("tbody",null,[(C(!0),E(Le,null,Qe(s.value,(v,g)=>(C(),E("tr",{key:g},[(C(!0),E(Le,null,Qe(v.cells,(k,$)=>(C(),E("td",{key:$,class:$e([k.align==="right"?"text-right":k.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(k).plainText!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},N(f(k).plainText),9,oF)):f(k).simpleChildren?(C(),je(T(Uc),{key:1,nodes:f(k).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${g}-${$}`},null,8,["nodes","custom-id","index-key"])):(C(),je(T(qs),{key:2,nodes:k.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=A=>_.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,eF),kt(Ei,{name:"table-node-fade"},{default:xn(()=>[n.value?(C(),E("div",iF,[Gl(_.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=p("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=p("span",{class:"sr-only"},"Loading",-1))],!0)])):ce("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);wc.install=e=>{e.component(wc.__name,wc)};const rF={class:"hr-node"},wd=Zt({},[["render",function(e,t){return C(),E("hr",rF)}],["__scopeId","data-v-39b2349c"]]);wd.install=e=>{e.component(wd.__name,wd)};const lF={class:"unknown-node"},$g=Je({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(C(),E("div",lF,N(e.node.raw),1))}),Sd=Zt(Je({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=j(()=>`vmr-container vmr-container-${t.node.name}`),s=Wn(()=>t.customId),o=j(()=>st({text:Mn,paragraph:nl,heading:vf,inline_code:vs,link:Es,image:fr,strong:Ms,emphasis:Is,strikethrough:As,insert:Us,subscript:Ws,superscript:Hs,checkbox:no,checkbox_input:no,hardbreak:hr,math_inline:Vo,reference:Ts,list:ia,math_block:Px,table:wc},s.value));return(i,r)=>(C(),E("div",en({class:n.value},e.node.attrs),[(C(!0),E(Le,null,Qe(e.node.children,(l,a)=>{return C(),je(ms((c=l.type,o.value[c]||$g)),{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"]]);Sd.install=e=>{e.component(Sd.__name,Sd)};const aF=["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"],c_=[[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 cF(e){if(e<=255)return aF[e];let t=0,n=c_.length-1;for(;t<=n;){const s=t+n>>1,o=c_[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const uF=/[ \t\n\r\f]+/g,dF=/[\t\n\r\f]| {2,}|^ | $/;let um=null;const fF=new RegExp("\\p{Script=Arabic}","u"),ch=new RegExp("\\p{M}","u"),Dx=new RegExp("\\p{Nd}","u");function u_(e){return fF.test(e)}function d_(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Ii(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(d_(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(d_(n))return!0}}return!1}const hF=new Set([" "," ","","\uFEFF"]);function pF(e){return Ii(e)}function Ng(e){return!(function(t){const n=yf(t);return n!==null&&(ev.has(n)||il.has(n))})(e)&&!(function(t){const n=yf(t);return n!==null&&hF.has(n)})(e)}const ev=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),uh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),tv=new Set(["'","’"]),il=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),mF=new Set([":",".","،","؛"]),gF=new Set(["၏"]),vF=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function yF(e){if(nv(e))return!0;let t=!1;for(const n of e)if(il.has(n))t=!0;else if(!t||!ch.test(n))return!1;return t}function kF(e){for(const t of e)if(!ev.has(t)&&!il.has(t))return!1;return e.length>0}function bF(e){if(nv(e))return!0;for(const t of e)if(!uh.has(t)&&!tv.has(t)&&!ch.test(t))return!1;return e.length>0}function nv(e){let t=!1;for(const n of e)if(n!=="\\"&&!ch.test(n)){if(!(uh.has(n)||il.has(n)||tv.has(n)))return!1;t=!0}return t}function Bx(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function yf(e){if(e.length===0)return null;const t=Bx(e,e.length);return e.slice(t)}function _F(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(ch.test(s))n--;else{if(!uh.has(s)&&!tv.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function wF(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function f_(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function h_(e,t){return e&&t!==null&&mF.has(t)}function SF(e){const t=yf(e);return t!==null&&gF.has(t)}function CF(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 Lg(e){let t=e.length;for(;t>0;){const n=Bx(e,t),s=e.slice(n,t);if(vF.has(s))return!0;if(!il.has(s))return!1;t=n}return!1}function xF(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
210
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const TF=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function So(e){return e.length===1?e[0]:e.join("")}function MF(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),So(n)}function AF(e,t,n,s){if(!TF.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=xF(u,s),h=d==="text"&&t;i===null||d!==i||h!==a?(i!==null&&o.push({text:So(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=h,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:So(r),isWordLike:a,kind:i,start:l}),o}function dm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const EF=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function IF(e,t){const n=e.texts[t];return!!n.startsWith("www.")||EF.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function $F(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const NF=new Set([":","-","/","×",",",".","+","–","—"]),p_=/^[A-Za-z0-9_]+[,:;]*$/,m_=/[,:;]+$/;function g_(e){for(const t of e)if(Dx.test(t))return!0;return!1}function Cd(e){if(e.length===0)return!1;for(const t of e)if(!Dx.test(t)&&!NF.has(t))return!1;return!0}function v_(e,t,n){var s,o,i;const r=(um===null&&(um=new Intl.Segmenter(void 0,{granularity:"word"})),um);let l=0;const a=[],c=[],u=[],d=[],h=[],m=[],f=[],y=[],S=[],_=[],b=[],v=[];for(const w of r.segment(e))for(const x of AF(w.segment,(s=w.isWordLike)!=null&&s,w.index,n)){let I=function(){m[z]!==null&&(c[z]=[f_(a,m,f,z)],m[z]=null),c[z].push(x.text),u[z]=u[z]||x.isWordLike,y[z]=y[z]||P,S[z]=S[z]||B,_[z]=W,b[z]=V,v[z]=h_(S[z],R)};const L=x.kind==="text",O=wF(x.text,x.isWordLike,x.kind),P=Ii(x.text),B=u_(x.text),R=yf(x.text),W=Lg(x.text),V=SF(x.text),z=l-1;t.carryCJKAfterClosingQuote&&L&&l>0&&d[z]==="text"&&P&&y[z]&&_[z]||L&&l>0&&d[z]==="text"&&kF(x.text)&&y[z]||L&&l>0&&d[z]==="text"&&b[z]?I():L&&l>0&&d[z]==="text"&&x.isWordLike&&B&&v[z]?(I(),u[z]=!0):O!==null&&l>0&&d[z]==="text"&&m[z]===O?f[z]=((o=f[z])!=null?o:1)+1:L&&!x.isWordLike&&l>0&&d[z]==="text"&&(yF(x.text)||x.text==="-"&&u[z])?I():(a[l]=x.text,c[l]=[x.text],u[l]=x.isWordLike,d[l]=x.kind,h[l]=x.start,m[l]=O,f[l]=O===null?0:1,y[l]=P,S[l]=B,_[l]=W,b[l]=V,v[l]=h_(B,R),l++)}for(let w=0;w<l;w++)m[w]===null?a[w]=So(c[w]):a[w]=f_(a,m,f,w);for(let w=1;w<l;w++)d[w]==="text"&&!u[w]&&nv(a[w])&&d[w-1]==="text"&&(a[w-1]+=a[w],u[w-1]=u[w-1]||u[w],a[w]="");const g=Array.from({length:l},()=>null);let k=-1;for(let w=l-1;w>=0;w--){const x=a[w];if(x.length!==0){if(d[w]==="text"&&!u[w]&&bF(x)&&k>=0&&d[k]==="text"){const I=(i=g[k])!=null?i:[];I.push(x),g[k]=I,h[k]=h[w],a[w]="";continue}k=w}}for(let w=0;w<l;w++){const x=g[w];x!=null&&(a[w]=MF(x,a[w]))}let $=0;for(let w=0;w<l;w++){const x=a[w];x.length!==0&&($!==w&&(a[$]=x,u[$]=u[w],d[$]=d[w],h[$]=h[w]),$++)}a.length=$,u.length=$,d.length=$,h.length=$;const A=(function(w){const x=w.texts.slice(),I=w.isWordLike.slice(),L=w.kinds.slice(),O=w.starts.slice();for(let P=0;P<x.length-1;P++){if(L[P]!=="text"||L[P+1]!=="text"||!Ii(x[P])||!Ii(x[P+1]))continue;const B=_F(x[P]);B!==null&&(x[P]=B.head,x[P+1]=B.tail+x[P+1],O[P+1]=O[P]+B.head.length)}return{len:x.length,texts:x,isWordLike:I,kinds:L,starts:O}})((function(w){const x=[],I=[],L=[],O=[];for(let P=0;P<w.len;P++){const B=w.texts[P],R=w.kinds[P],W=w.isWordLike[P];if(R==="text"&&W&&p_.test(B)){const V=[B];let z=m_.test(B),ie=P+1;for(;z&&ie<w.len&&w.kinds[ie]==="text"&&w.isWordLike[ie]&&p_.test(w.texts[ie]);){const ae=w.texts[ie];V.push(ae),z=m_.test(ae),ie++}x.push(So(V)),I.push(!0),L.push("text"),O.push(w.starts[P]),P=ie-1;continue}x.push(B),I.push(W),L.push(R),O.push(w.starts[P])}return{len:x.length,texts:x,isWordLike:I,kinds:L,starts:O}})((function(w){const x=[],I=[],L=[],O=[];for(let P=0;P<w.len;P++){const B=w.texts[P];if(w.kinds[P]==="text"&&B.includes("-")){const R=B.split("-");let W=R.length>1;for(let V=0;V<R.length;V++){const z=R[V];if(!W)break;z.length!==0&&g_(z)&&Cd(z)||(W=!1)}if(W){let V=0;for(let z=0;z<R.length;z++){const ie=R[z],ae=z<R.length-1?`${ie}-`:ie;x.push(ae),I.push(!0),L.push("text"),O.push(w.starts[P]+V),V+=ae.length}continue}}x.push(B),I.push(w.isWordLike[P]),L.push(w.kinds[P]),O.push(w.starts[P])}return{len:x.length,texts:x,isWordLike:I,kinds:L,starts:O}})((function(w){const x=[],I=[],L=[],O=[];for(let P=0;P<w.len;P++){const B=w.texts[P],R=w.kinds[P];if(R==="text"&&Cd(B)&&g_(B)){const W=[B];let V=P+1;for(;V<w.len&&w.kinds[V]==="text"&&Cd(w.texts[V]);)W.push(w.texts[V]),V++;x.push(So(W)),I.push(!0),L.push("text"),O.push(w.starts[P]),P=V-1;continue}x.push(B),I.push(w.isWordLike[P]),L.push(R),O.push(w.starts[P])}return{len:x.length,texts:x,isWordLike:I,kinds:L,starts:O}})((function(w){const x=[],I=[],L=[],O=[];for(let P=0;P<w.len;P++){const B=w.texts[P];if(x.push(B),I.push(w.isWordLike[P]),L.push(w.kinds[P]),O.push(w.starts[P]),!$F(B))continue;const R=P+1;if(R>=w.len||dm(w.kinds[R]))continue;const W=[],V=w.starts[R];let z=R;for(;z<w.len&&!dm(w.kinds[z]);)W.push(w.texts[z]),z++;W.length>0&&(x.push(So(W)),I.push(!0),L.push("text"),O.push(V),P=z-1)}return{len:x.length,texts:x,isWordLike:I,kinds:L,starts:O}})((function(w){const x=w.texts.slice(),I=w.isWordLike.slice(),L=w.kinds.slice(),O=w.starts.slice();for(let B=0;B<w.len;B++){if(L[B]!=="text"||!IF(w,B))continue;const R=[x[B]];let W=B+1;for(;W<w.len&&!dm(L[W]);){R.push(x[W]),I[B]=!0;const V=x[W].includes("?");if(L[W]="text",x[W]="",W++,V)break}x[B]=So(R)}let P=0;for(let B=0;B<x.length;B++){const R=x[B];R.length!==0&&(P!==B&&(x[P]=R,I[P]=I[B],L[P]=L[B],O[P]=O[B]),P++)}return x.length=P,I.length=P,L.length=P,O.length=P,{len:P,texts:x,isWordLike:I,kinds:L,starts:O}})((function(w){const x=[],I=[],L=[],O=[];let P=0;for(;P<w.len;){const B=[w.texts[P]];let R=w.isWordLike[P],W=w.kinds[P],V=w.starts[P];if(W==="glue"){const z=[B[0]],ie=V;for(P++;P<w.len&&w.kinds[P]==="glue";)z.push(w.texts[P]),P++;const ae=So(z);if(!(P<w.len&&w.kinds[P]==="text")){x.push(ae),I.push(!1),L.push("glue"),O.push(ie);continue}B[0]=ae,B.push(w.texts[P]),R=w.isWordLike[P],W="text",V=ie,P++}else P++;if(W==="text")for(;P<w.len&&w.kinds[P]==="glue";){const z=[];for(;P<w.len&&w.kinds[P]==="glue";)z.push(w.texts[P]),P++;const ie=So(z);P<w.len&&w.kinds[P]==="text"?(B.push(ie,w.texts[P]),R=R||w.isWordLike[P],P++):B.push(ie)}x.push(So(B)),I.push(R),L.push(W),O.push(V)}return{len:x.length,texts:x,isWordLike:I,kinds:L,starts:O}})({len:$,texts:a,isWordLike:u,kinds:d,starts:h})))))));for(let w=0;w<A.len-1;w++){const x=CF(A.texts[w]);x!==null&&(A.kinds[w]!=="space"&&A.kinds[w]!=="preserved-space"||A.kinds[w+1]!=="text"||!u_(A.texts[w+1])||(A.texts[w]=x.space,A.isWordLike[w]=!1,A.kinds[w]=A.kinds[w]==="preserved-space"?"preserved-space":"space",A.texts[w+1]=x.marks+A.texts[w+1],A.starts[w+1]=A.starts[w]+x.space.length))}return A}function LF(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Nl=null;const y_=new Map;let Ll=null;const OF=new RegExp("\\p{Emoji_Presentation}","u"),PF=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let fm=null;const k_=new Map;function Og(){if(Nl!==null)return Nl;if(typeof OffscreenCanvas<"u")return Nl=new OffscreenCanvas(1,1).getContext("2d"),Nl;if(typeof document<"u")return Nl=document.createElement("canvas").getContext("2d"),Nl;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Zi(e,t){let n=t.get(e);return n===void 0&&(n={width:Og().measureText(e).width,containsCJK:Ii(e)},t.set(e,n)),n}function dh(){if(Ll!==null)return Ll;if(typeof navigator>"u")return Ll={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ll;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 Ll={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ll}function Fx(){return fm===null&&(fm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),fm}function RF(e){return OF.test(e)||e.includes("️")}function Ur(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=Fx();for(const a of l.segment(i))RF(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function DF(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function BF(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function b_(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+dh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,h=-1,m=0;function f(g=u,k=d,$=a){l++,a=0,c=!1,h=-1,m=0}function y(g,k){c=!0,u=g+1,d=0,a=k}function S(g,k,$){c=!0,u=g,d=k+1,a=$}function _(g,k){c?(a+=k,u=g+1,d=0):y(g,k)}function b(g,k){const $=i[g];for(let A=k;A<$.length;A++){const w=$[A];c?a+w>r?(f(),S(g,A,w)):(a+=w,u=g,d=A+1):S(g,A,w)}c&&u===g&&d===$.length&&(u=g+1,d=0)}let v=0;for(;v<s.length&&(c||(v=DF(e,v),!(v>=s.length)));){const g=s[v],k=o[v],$=k==="space"||k==="preserved-space"||k==="tab"||k==="zero-width-break"||k==="soft-hyphen";if(c)if(a+g>r){if($){_(v,g),f(v+1,0,a-g),v++;continue}if(h>=0){if(u>h||u===h&&d>0){f();continue}f(h,0,m);continue}if(g>t&&i[v]!==null){f(),b(v,0),v++;continue}f()}else _(v,g),$&&(h=v+1,m=a-g),v++;else g>t&&i[v]!==null?b(v,0):y(v,g),$&&(h=v+1,m=a-g),v++}return c&&f(),l}let hm=null;function FF(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,h,m){s=[d],o=h,i=m,r=Lg(d),l=uh.has(d)}function u(d,h){s.push(d),i=i||h;const m=Lg(d);r=d.length===1&&il.has(d)&&r||m,l=!1}for(const d of(hm===null&&(hm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),hm).segment(e)){const h=d.segment,m=Ii(h);s.length!==0?l||ev.has(h)||il.has(h)||t.carryCJKAfterClosingQuote&&m&&r?u(h,m):i||m?(a(),c(h,d.index,m)):u(h,m):c(h,d.index,m)}return a(),n}function HF(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Ii(e[0].text),i=Ng(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=Ii(a.text),u=Ng(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function WF(e,t,n,s){const o=dh(),{cache:i,emojiCorrection:r}=(function(A,w){Og().font=A;const x=(function(O){let P=y_.get(O);return P||(P=new Map,y_.set(O,P)),P})(A),I=(function(O){const P=O.match(/(\d+(?:\.\d+)?)\s*px/);return P?parseFloat(P[1]):16})(A),L=w?(function(O,P){let B=k_.get(O);if(B!==void 0)return B;const R=Og();R.font=O;const W=R.measureText("😀").width;if(B=0,W>P+.5&&typeof document<"u"&&document.body!==null){const V=document.createElement("span");V.style.font=O,V.style.display="inline-block",V.style.visibility="hidden",V.style.position="absolute",V.textContent="😀",document.body.appendChild(V);const z=V.getBoundingClientRect().width;document.body.removeChild(V),W-z>.5&&(B=W-z)}return k_.set(O,B),B})(A,I):0;return{cache:x,fontSize:I,emojiCorrection:L}})(t,(l=e.normalized,PF.test(l)));var l;const a=Ur("-",Zi("-",i),r),c=8*Ur(" ",Zi(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],h=[],m=[];let f=e.chunks.length<=1;const y=null,S=[],_=n?[]:null,b=Array.from({length:e.len});function v(A,w,x,I,L,O,P){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(f=!1),u.push(w),d.push(x),h.push(I),m.push(L),S.push(P),_!==null&&_.push(A)}function g(A,w,x,I,L){const O=Zi(A,i),P=Ur(A,O,r),B=w==="space"||w==="preserved-space"||w==="zero-width-break"?0:P,R=w==="space"||w==="zero-width-break"?0:P;if(L&&I&&A.length>1){let W="sum-graphemes";Cd(A)?W="pair-context":o.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const V=(function(z,ie,ae,re,Te){if(ie.breakableFitAdvances!==void 0)return ie.breakableFitAdvances;const Pe=Fx(),We=[];for(const Se of Pe.segment(z))We.push(Se.segment);if(We.length<=1)return ie.breakableFitAdvances=null,ie.breakableFitAdvances;if(Te==="sum-graphemes"){const Se=[];for(const fe of We){const K=Zi(fe,ae);Se.push(Ur(fe,K,re))}return ie.breakableFitAdvances=Se,ie.breakableFitAdvances}if(Te==="pair-context"||We.length>96){const Se=[];let fe=null,K=0;for(const Z of We){const pe=Ur(Z,Zi(Z,ae),re);if(fe===null)Se.push(pe);else{const D=fe+Z,X=Zi(D,ae);Se.push(Ur(D,X,re)-K)}fe=Z,K=pe}return ie.breakableFitAdvances=Se,ie.breakableFitAdvances}const Ne=[];let me="",be=0;for(const Se of We){me+=Se;const fe=Ur(me,Zi(me,ae),re);Ne.push(fe-be),be=fe}return ie.breakableFitAdvances=Ne,ie.breakableFitAdvances})(A,O,i,r,W);return void v(A,P,B,R,w,x,V)}v(A,P,B,R,w,x,null)}for(let A=0;A<e.len;A++){b[A]=u.length;const w=e.texts[A],x=e.isWordLike[A],I=e.kinds[A],L=e.starts[A];if(I==="soft-hyphen"){v(w,0,a,a,I,L,null);continue}if(I==="hard-break"){v(w,0,0,0,I,L,null);continue}if(I==="tab"){v(w,0,0,0,I,L,null);continue}const O=Zi(w,i);if(I==="text"&&O.containsCJK){const P=FF(w,o),B=s==="keep-all"?HF(P):P;for(let R=0;R<B.length;R++){const W=B[R];g(W.text,"text",L+W.start,x,s==="keep-all"||!Ii(W.text))}continue}g(w,I,L,x,!0)}const k=(function(A,w,x){const I=[];for(let L=0;L<A.length;L++){const O=A[L],P=O.startSegmentIndex<w.length?w[O.startSegmentIndex]:x,B=O.endSegmentIndex<w.length?w[O.endSegmentIndex]:x,R=O.consumedEndSegmentIndex<w.length?w[O.consumedEndSegmentIndex]:x;I.push({startSegmentIndex:P,endSegmentIndex:B,consumedEndSegmentIndex:R})}return I})(e.chunks,b,u.length),$=y===null?null:(function(A,w){const x=(function(L){const O=L.length;if(O===0)return null;const P=new Array(O);let B=!1;for(let ae=0;ae<O;){const re=L.charCodeAt(ae);let Te=re,Pe=1;if(re>=55296&&re<=56319&&ae+1<O){const Ne=L.charCodeAt(ae+1);Ne>=56320&&Ne<=57343&&(Te=Ne-56320+(re-55296<<10)+65536,Pe=2)}const We=cF(Te);We!=="R"&&We!=="AL"&&We!=="AN"||(B=!0);for(let Ne=0;Ne<Pe;Ne++)P[ae+Ne]=We;ae+=Pe}if(!B)return null;let R=0;for(let ae=0;ae<O;ae++){const re=P[ae];if(re==="L"){R=0;break}if(re==="R"||re==="AL"){R=1;break}}const W=new Int8Array(O);for(let ae=0;ae<O;ae++)W[ae]=R;const V=1&R?"R":"L",z=V;let ie=z;for(let ae=0;ae<O;ae++)P[ae]==="NSM"?P[ae]=ie:ie=P[ae];ie=z;for(let ae=0;ae<O;ae++){const re=P[ae];re==="EN"?P[ae]=ie==="AL"?"AN":"EN":re!=="R"&&re!=="L"&&re!=="AL"||(ie=re)}for(let ae=0;ae<O;ae++)P[ae]==="AL"&&(P[ae]="R");for(let ae=1;ae<O-1;ae++)P[ae]==="ES"&&P[ae-1]==="EN"&&P[ae+1]==="EN"&&(P[ae]="EN"),P[ae]!=="CS"||P[ae-1]!=="EN"&&P[ae-1]!=="AN"||P[ae+1]!==P[ae-1]||(P[ae]=P[ae-1]);for(let ae=0;ae<O;ae++){if(P[ae]!=="EN")continue;let re;for(re=ae-1;re>=0&&P[re]==="ET";re--)P[re]="EN";for(re=ae+1;re<O&&P[re]==="ET";re++)P[re]="EN"}for(let ae=0;ae<O;ae++){const re=P[ae];re!=="WS"&&re!=="ES"&&re!=="ET"&&re!=="CS"||(P[ae]="ON")}ie=z;for(let ae=0;ae<O;ae++){const re=P[ae];re==="EN"?P[ae]=ie==="L"?"L":"EN":re!=="R"&&re!=="L"||(ie=re)}for(let ae=0;ae<O;ae++){if(P[ae]!=="ON")continue;let re=ae+1;for(;re<O&&P[re]==="ON";)re++;const Te=(ae>0?P[ae-1]:z)!=="L"?"R":"L";if(Te===((re<O?P[re]:z)!=="L"?"R":"L"))for(let Pe=ae;Pe<re;Pe++)P[Pe]=Te;ae=re-1}for(let ae=0;ae<O;ae++)P[ae]==="ON"&&(P[ae]=V);for(let ae=0;ae<O;ae++){const re=P[ae];1&W[ae]?re!=="L"&&re!=="AN"&&re!=="EN"||W[ae]++:re==="R"?W[ae]++:re!=="AN"&&re!=="EN"||(W[ae]+=2)}return W})(A);if(x===null)return null;const I=new Int8Array(w.length);for(let L=0;L<w.length;L++)I[L]=x[w[L]];return I})(e.normalized,y);return _!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:f,segLevels:$,breakableFitAdvances:S,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:k,segments:_}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:f,segLevels:$,breakableFitAdvances:S,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:k}}function UF(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return WF((function(c,u,d="normal",h="normal"){const m=(function(S){const _=S??"normal";return _==="pre-wrap"?{mode:_,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:_,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),f=m.mode==="pre-wrap"?(function(S){return/[\r\f]/.test(S)?S.replace(/\r\n/g,`
|
|
211
|
-
`).replace(/[\r\f]/g,`
|
|
212
|
-
`):S.replace(/\r\n/g,`
|
|
213
|
-
`)})(c):(function(S){if(!dF.test(S))return S;let _=S.replace(uF," ");return _.charCodeAt(0)===32&&(_=_.slice(1)),_.length>0&&_.charCodeAt(_.length-1)===32&&(_=_.slice(0,-1)),_})(c);if(f.length===0)return{normalized:f,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const y=h==="keep-all"?(function(S){if(S.len<=1)return S;const _=[],b=[],v=[],g=[];let k=null,$=!1,A=0,w=!1,x=!1;function I(){k!==null&&(_.push(So(k)),b.push($),v.push("text"),g.push(A),k=null)}for(let L=0;L<S.len;L++){const O=S.texts[L],P=S.kinds[L],B=S.isWordLike[L],R=S.starts[L];if(P==="text"){const W=pF(O),V=Ng(O);if(k!==null&&w&&x){k.push(O),$=$||B,w=w||W,x=V;continue}I(),k=[O],$=B,A=R,w=W,x=V;continue}I(),_.push(O),b.push(B),v.push(P),g.push(R)}return I(),{len:_.length,texts:_,isWordLike:b,kinds:v,starts:g}})(v_(f,u,m)):v_(f,u,m);return st({normalized:f,chunks:LF(y,m)},y)})(s,dh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const pm="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",zn=(()=>{const e=globalThis;if(e[pm])return e[pm];const t={configs:{},controllers:{},revision:ll(0),preparedCache:new Map,blockEstimateCache:new Map};return e[pm]=t,t})();let Xa=null;const __=zn.revision;function w_(e){var t;return e&&(t=zn.configs[e])!=null?t:null}function S_(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function qF(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function mm(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!qF(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
214
|
-
`)}return o.length>0?o:null}function gm(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Xa!=null)return Xa;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Xa=!!((i=r.getContext)!=null&&i.call(r,"2d")),Xa}catch{return Xa=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=zn.blockEstimateCache.get(r);if(l)return zn.blockEstimateCache.delete(r),zn.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(m,f,y){const S=`${y}\0${f}\0${m}`,_=zn.preparedCache.get(S);if(_)return zn.preparedCache.delete(S),zn.preparedCache.set(S,_),_.prepared;const b=UF(m,f,{whiteSpace:y});for(zn.preparedCache.set(S,{prepared:b});zn.preparedCache.size>240;){const v=zn.preparedCache.keys().next().value;if(!v)break;zn.preparedCache.delete(v)}return b})(e,n.font,a),u=(function(m,f,y){const S=(function(_,b){return _.simpleLineWalkFastPath?b_(_,b):(function(v,g){if(v.simpleLineWalkFastPath)return b_(v,g);const{widths:k,lineEndFitAdvances:$,lineEndPaintAdvances:A,kinds:w,breakableFitAdvances:x,discretionaryHyphenWidth:I,tabStopAdvance:L,chunks:O}=v;if(k.length===0||O.length===0)return 0;const P=dh(),B=P.lineFitEpsilon,R=g+B;let W=0,V=0,z=!1,ie=0,ae=0,re=-1,Te=0,Pe=0,We=null;function Ne(){re=-1,Te=0,Pe=0,We=null}function me(X=ie,oe=ae,te=V){W++,V=0,z=!1,Ne()}function be(X,oe){z=!0,ie=X+1,ae=0,V=oe}function Se(X,oe,te){z=!0,ie=X,ae=oe+1,V=te}function fe(X,oe){z?(V+=oe,ie=X+1,ae=0):be(X,oe)}function K(X,oe,te,ue){if(!oe)return;const U=X==="tab"?0:$[te],q=X==="tab"?ue:A[te];re=te+1,Te=V-ue+U,Pe=V-ue+q,We=X}function Z(X,oe){const te=x[X];for(let ue=oe;ue<te.length;ue++){const U=te[ue];z?V+U>R?(me(),Se(X,ue,U)):(V+=U,ie=X,ae=ue+1):Se(X,ue,U)}z&&ie===X&&ae===te.length&&(ie=X+1,ae=0)}function pe(X){if(We!=="soft-hyphen")return!1;const oe=x[X];if(oe==null)return!1;const{fitCount:te,fittedWidth:ue}=(function(U,q,J,de,ge){let Me=0,le=q;for(;Me<U.length;){const _e=le+U[Me];if((Me+1<U.length?_e+ge:_e)>J+de)break;le=_e,Me++}return{fitCount:Me,fittedWidth:le}})(oe,V,g,B,I);return te!==0&&(V=ue,ie=X,ae=te,Ne(),te===oe.length?(ie=X+1,ae=0,!0):(me(X,te,ue+I),Z(X,te),!0))}function D(X){W++,Ne()}for(let X=0;X<O.length;X++){const oe=O[X];if(oe.startSegmentIndex===oe.endSegmentIndex){D();continue}z=!1,V=0,oe.startSegmentIndex,ie=oe.startSegmentIndex,ae=0,Ne();let te=oe.startSegmentIndex;for(;te<oe.endSegmentIndex;){const ue=w[te],U=ue==="space"||ue==="preserved-space"||ue==="tab"||ue==="zero-width-break"||ue==="soft-hyphen",q=ue==="tab"?BF(V,L):k[te];if(ue!=="soft-hyphen")if(z){if(V+q>R){const J=V+(ue==="tab"?0:$[te]),de=V+(ue==="tab"?q:A[te]);if(We==="soft-hyphen"&&P.preferEarlySoftHyphenBreak&&Te<=R){me(re,0,Pe);continue}if(We==="soft-hyphen"&&pe(te)){te++;continue}if(U&&J<=R){fe(te,q),me(te+1,0,de),te++;continue}if(re>=0&&Te<=R){if(ie>re||ie===re&&ae>0){me();continue}const ge=re;me(ge,0,Pe),te=ge;continue}if(q>g&&x[te]!==null){me(),Z(te,0),te++;continue}me();continue}fe(te,q),K(ue,U,te,q),te++}else q>g&&x[te]!==null?Z(te,0):be(te,q),K(ue,U,te,q),te++;else z&&(ie=te+1,ae=0,re=te+1,Te=V+I,Pe=V+I,We=ue),te++}if(z){const ue=re===oe.consumedEndSegmentIndex?Pe:V;me(oe.consumedEndSegmentIndex,0,ue)}}return W})(_,b)})(m,f);return{lineCount:S,height:S*y}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),h=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(zn.blockEstimateCache.set(r,{height:h,contentHeight:Math.round(d)});zn.blockEstimateCache.size>4e3;){const m=zn.blockEstimateCache.keys().next().value;if(!m)break;zn.blockEstimateCache.delete(m)}return{kind:"simple-text",height:h,contentHeight:Math.round(d)}}catch{return null}}function Hx(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=mm(e.children);return i&&n.paragraph?gm(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=mm(e.children),l=n.headings[i];return r&&l?gm(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=mm((o=i[0])==null?void 0:o.children);return r?gm(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=Hx(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 td(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function jF(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function vm(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=S_(s.lineHeight,1.5*S_(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:jF(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}function kf(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function zF(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function Wx(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=zF(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function Ux(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 qx(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function jx(e,t=360,n=500){return qx(e,t,n)}function zx(e,t=360,n=500){return qx(e,t,n)}function C_(e,t,n,s){var o;const i=(function(h){return Math.max(0,Math.ceil(h.scrollHeight||0)-Math.ceil(h.clientHeight||0))})(e),r=(function(h,m){return Number.isFinite(h)?Math.min(Math.max(0,h),m):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const h of a){e.scrollTop=h;const m=s.getNormalizedScrollTop(e,t,!1),f=Math.abs(m-r);f<u&&(u=f,c=h)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const Vx=Symbol("MarkstreamMathBlockMinHeightCache");function que(){return Bt(Vx,null)}const VF=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],KF=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],GF=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),Kx=["raw","content","code","originalCode","updatedCode"],x_=new WeakMap,T_=new WeakMap;let YF=1;function Ho(){return typeof performance<"u"?performance.now():Date.now()}function M_(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Ao(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=x_.get(t);return n||(n=YF++,x_.set(t,n)),String(n)}function A_(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:Ao(t),customMarkdownIt:Ao(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:Ao(e.validateLink),preTransformTokens:Ao(e.preTransformTokens),postTransformTokens:Ao(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function E_(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
215
|
-
`,t-1)+1;return e.slice(n,t).trim()}function I_(e){const t=Gx(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function Gx(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function Yx(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 sv(e){const t=String(e??"");return`${t.length}:${Yx(t)}`}function Pg(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?sv(r):`${r.length}:${Yx(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Ao(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${Ao(s)}`;const i=Ao(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Pg(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}:${Pg(r[c],t,n+1)}`).join(";")}`}return typeof e}function bf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function Xx(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>bf(s)?_r(s,t,n+1):Xx(s,t,n+1)).join(",")}`:bf(e)?_r(e,t,n):Pg(e,t,n)}function XF(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!Kx.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${sv(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${Ao(o)}`:GF.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${Xx(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${Ao(o)}`:""}).filter(Boolean).join(";")}function ZF(e){return Kx.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${sv(n)}`:""}).filter(Boolean).join(";")}function _r(e,t=new WeakMap,n=0){const s=T_.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Ao(o)}`;const r=Ao(o);t.set(o,r);const l=(function(a,c,u){const d=a,h=Array.isArray(d.children)?d.children:[],m=h.length?h.slice(0,200).map(f=>_r(f,c,u+1)).join("|"):"";return[a.type,ZF(d),XF(d,c,u),h.length,m].join(":")})(e,t,n);return T_.set(o,l),l}function Zx(e,t){return _r(e)===_r(t)}function ov(e,t,n){const s=Ho(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ho()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function $_(e,t,n){return ov(t,n,()=>_r(e))}function Qx(e,t,n){return $_(e,n,"stabilizeSignatureMs")===$_(t,n,"stabilizeSignatureMs")}function ym(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function N_(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function QF(e,t){return e.length===t.length&&e===t}function iv(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const h=s[d],m=o[d];if(typeof h!=typeof m)return!1;if(typeof h!="string"){if(typeof h!="number"&&typeof h!="boolean"&&h!=null)return null;if(!Object.is(h,m))return!1}else if(typeof m!="string"||!QF(h,m))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],h=c[u];if(!bf(d)||!bf(h))return null;const m=iv(d,h,n+1);if(m==null)return null;if(!m)return!1}return!0}function JF(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=iv(e,t);return n??Zx(e,t)}function eH(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return ov(n,"stabilizeSignatureMs",()=>{s=iv(e,t)}),s??Qx(e,t,n)}function tH(e,t){const n={};for(const s of VF){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function nH(e,t){var n;const s=jb(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:j(()=>!1),r=se(t.renderContent.value);let l,a=[],c="",u="",d="",h=0,m=0,f=Ho();function y(){l&&(clearTimeout(l),l=void 0)}function S(){y();const x=t.renderContent.value;r.value!==x&&(r.value=x),f=Ho()}Ve([t.renderContent,t.effectiveFinal,i],([x,I,L])=>{r.value!==x&&(!L||I||(function(O,P){if(!O&&P||P.length<=80||P.length<O.length||!P.startsWith(O))return!0;const B=P.slice(O.length);return!!B&&(!!I_(E_(P))||!(!B.includes(`
|
|
216
|
-
|
|
217
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(B))||B.endsWith(`
|
|
218
|
-
`)&&!(function(R){const W=E_(R);if(I_(W))return!1;const V=Gx(W);return V.length>=2&&V.some(z=>z.trim())})(P))})(r.value,x)?S():(function(){if(m+=1,l)return;const O=Math.max(0,(function(P){const B=P.parseCoalesceMs;return typeof B=="number"&&Number.isFinite(B)&&B>=0?B:80})(e)-(Ho()-f));O<=0?S():l=setTimeout(S,O)})())},{flush:"sync",immediate:!0}),Yg(y);const _=j(()=>{var x,I,L,O;return iP(e.customHtmlTags,(x=e.parseOptions)==null?void 0:x.customHtmlTags,(O=(L=(I=t.customComponentsMap)==null?void 0:I.value)!=null?L:{},Object.entries(O).map(([P,B])=>{const R=Oo(P);return B==null||!R||tu(R)||IC.has(R)||Jc.has(R)?"":R}).filter(Boolean)))}),b=j(()=>{const{key:x,tags:I}=rP(_.value);if(!x)return s;const L=o.get(x);if(L)return L;const O=jb(t.instanceMsgId,{customHtmlTags:I});return o.set(x,O),O}),v=j(()=>{const x=b.value;return e.customMarkdownIt?e.customMarkdownIt(x):x}),g=j(()=>{var x,I;const L=(x=e.parseOptions)!=null?x:{},O=t.effectiveFinal.value,P=_.value,B=O!=null,R=P.length>0;return B||R||L.streamParse==null?st(st(Et(st({},L),{streamParse:(I=L.streamParse)==null||I}),B?{final:O}:{}),R?{customHtmlTags:P}:{}):L}),k=j(()=>{var x;return new Set(((x=g.value.customHtmlTags)!=null?x:[]).map(I=>String(I).trim().toLowerCase()).filter(Boolean))}),$=j(()=>A_(g.value,v.value,e.customMarkdownIt,{includeFinal:!0})),A=j(()=>A_(g.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ve([$,A],([x,I],[L,O])=>{L&&(x===L&&I===O||(S(),I!==O&&(a=[],d="")))},{flush:"sync"});const w=j(()=>{var x,I,L,O,P,B,R,W;if((x=e.nodes)!=null&&x.length)return a=[],d="",rr(e.nodes.slice());const V=r.value;if(!V)return a=[],d="",[];const z=t.debugPerformanceEnabled.value,ie=z?Ho():0,ae=v.value,re=$.value,Te=A.value;c&&re!==c&&(function(oe){var te,ue;(ue=(te=oe.stream)==null?void 0:te.reset)==null||ue.call(te)})(ae),u&&Te!==u&&(a=[],d="");const Pe=a.length>0&&V.startsWith(d)&&Te===u,We=z?M_(ae):null,Ne=z?{}:void 0,me=Ne?Et(st({},g.value),{__timing:Ne}):g.value,be=fx(V,ae,me),Se=z?Ho():0,fe=z?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let K,Z=z?ym(be.length):void 0,pe=0,D=0;if(Pe){const oe=z?Ho():0;if(fe){const te=(function(ue,U,q){if(!U.length)return{nodes:ue,metrics:ym(ue.length)};const J=(function(Me,le,_e){const ze=Math.min(Me.length,le.length);for(let Xe=0;Xe<ze;Xe++)if(!eH(le[Xe],Me[Xe],_e))return Xe;return Me.length===le.length?-1:ze})(ue,U,q);if(J<0)return{nodes:U,metrics:{reusedNodeCount:ue.length,dirtyStartIndex:J,stablePrefixNodeCount:ue.length,dirtyTailNodeCount:0}};const de=ue.slice();let ge=J;for(let Me=0;Me<J;Me++)de[Me]=U[Me];for(let Me=J;Me<ue.length;Me++){const le=U[Me],_e=ue[Me];le&&Qx(le,_e,q)&&(de[Me]=le,ge+=1)}return{nodes:de,metrics:{reusedNodeCount:ge,dirtyStartIndex:J,stablePrefixNodeCount:J,dirtyTailNodeCount:N_(J,ue,U)}}})(be,a,fe);K=te.nodes,Z=te.metrics}else{const te=(function(ue,U){if(!U.length)return{nodes:ue,metrics:ym(ue.length)};const q=(function(ge,Me){const le=Math.min(ge.length,Me.length);for(let _e=0;_e<le;_e++)if(!JF(Me[_e],ge[_e]))return _e;return ge.length===Me.length?-1:le})(ue,U);if(q<0)return{nodes:U,metrics:{reusedNodeCount:ue.length,dirtyStartIndex:q,stablePrefixNodeCount:ue.length,dirtyTailNodeCount:0}};const J=ue.slice();let de=q;for(let ge=0;ge<q;ge++)J[ge]=U[ge];for(let ge=q;ge<ue.length;ge++){const Me=U[ge],le=ue[ge];Me&&Zx(Me,le)&&(J[ge]=Me,de+=1)}return{nodes:J,metrics:{reusedNodeCount:de,dirtyStartIndex:q,stablePrefixNodeCount:q,dirtyTailNodeCount:N_(q,ue,U)}}})(be,a);K=te.nodes,Z=te.metrics}pe=z?Ho()-oe:0,D=Z?.dirtyStartIndex==null||Z.dirtyStartIndex<0?K.length:Z.dirtyStartIndex}else K=be;fe?(function(oe,te,ue=0){for(let U=Math.max(0,ue);U<oe.length;U++)ov(te,"primeSignatureMs",()=>_r(oe[U]))})(K,fe,D):(function(oe,te=0){for(let ue=Math.max(0,te);ue<oe.length;ue++)_r(oe[ue])})(K,D);const X=z?Ho()-Se:0;if(h+=1,d=V,c=re,u=Te,a=K,z){const oe=M_(ae),te=typeof oe?.total=="number"&&oe.total>((I=We?.total)!=null?I:0);t.logPerf(te?"parse(stream)":"parse(sync)",st(st(st({rendererId:t.instanceMsgId,ms:Math.round(Ho()-ie),nodes:K.length,contentLength:V.length,parseCommitCount:h,parseCoalescedCount:m,nodeReuseMs:X,signatureMs:(L=fe?.signatureMs)!=null?L:0,stabilizeSignatureMs:(O=fe?.stabilizeSignatureMs)!=null?O:0,primeSignatureMs:(P=fe?.primeSignatureMs)!=null?P:0,signatureCallCount:(B=fe?.signatureCallCount)!=null?B:0,stabilizeSignatureCallCount:(R=fe?.stabilizeSignatureCallCount)!=null?R:0,primeSignatureCallCount:(W=fe?.primeSignatureCallCount)!=null?W:0,stabilizeMs:pe},Z??{}),Ne?Object.fromEntries(KF.map(ue=>{var U;return[ue,(U=Ne[ue])!=null?U:0]})):{}),oe?{streamMode:oe.lastMode,streamDelta:tH(oe,We),streamStats:oe}:{}))}return rr(K)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:k,mdBase:b,mdInstance:v,mergedParseOptions:g,parsedNodes:w}}function sH(e){const{isClient:t}=e,n=se(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(h,m){if((y=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!y)return;var f,y;const S=n.value,_=S.has(h);if(m){if(_)return;const v=new Set(S);return v.add(h),void(n.value=v)}if(!_)return;const b=new Set(S);b.delete(h),n.value=b})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[h,m]of o.entries())h<c||(m(),o.delete(h));for(const[h,m]of s.entries())h<c||(m.destroy(),s.delete(h),r(h),(u=e.onNodeVisibilityCleaned)==null||u.call(e,h));for(const h of Array.from(i.keys()))h<c||r(h);if(!n.value.size)return;const d=new Set;for(const h of n.value)h<c&&d.add(h);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function oH(e={}){const t=se(""),n=se(""),s=se(!1),o=S9(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=j(()=>Math.max(0,t.value.length-n.value.length)),a=j(()=>l.value===0),c=j(()=>s.value&&a.value);return Gg()&&Yg(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const L_=/auto|scroll|overlay/i;function iH(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return L_.test(t)||L_.test(n)}function rH(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 lH=Je({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=j(()=>{var n,s;return zx((s=kf(e.estimatedPreviewHeightPx))!=null?s:Ux(String((n=e.node.code)!=null?n:"")))});return()=>Xt("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?Xt("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)"}},[Xt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Xt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Xt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Xt("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},()=>Xt("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,Xt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Xt("div",{class:"absolute inset-0"},[Xt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),aH=Je({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=j(()=>{var n,s;return jx((s=kf(e.estimatedPreviewHeightPx))!=null?s:Wx(String((n=e.node.code)!=null?n:"")))});return()=>Xt("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?Xt("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)"}},[Xt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Xt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Xt("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},()=>Xt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Xt("span",{class:"action-icon block"})])))]):null,Xt("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)"}},[Xt("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"}})])])}}),cH=["data-custom-id"],uH={class:"m-0 p-0"},dH=["data-probe"],fH=["data-node-index","data-node-type"],Jx=Zt(Je(Et(st({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},r=j(()=>{return(M=s.mode)==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),l=j(()=>s.renderCodeBlocksAsPre===!0?"pre":s.codeRenderer==="pre"||s.codeRenderer==="shiki"||s.codeRenderer==="monaco"?s.codeRenderer:s.renderCodeBlocksAsPre===!1||r.value==="docs"?"monaco":"pre"),a=j(()=>i[r.value]),c=j(()=>{var M;return(M=s.showTooltips)!=null?M:a.value.showTooltips}),u=j(()=>{var M;return(M=s.fade)!=null?M:a.value.fade}),d=j(()=>{var M;return(M=s.batchRendering)!=null?M:a.value.batchRendering}),h=j(()=>{var M;return(M=s.initialRenderBatchSize)!=null?M:a.value.initialRenderBatchSize}),m=j(()=>{var M;return(M=s.renderBatchSize)!=null?M:a.value.renderBatchSize}),f=j(()=>{var M;return(M=s.renderBatchDelay)!=null?M:a.value.renderBatchDelay}),y=j(()=>{var M;return(M=s.renderBatchBudgetMs)!=null?M:a.value.renderBatchBudgetMs}),S=j(()=>{var M;return(M=s.renderBatchIdleTimeoutMs)!=null?M:a.value.renderBatchIdleTimeoutMs}),_=j(()=>{var M;return(M=s.deferNodesUntilVisible)!=null?M:a.value.deferNodesUntilVisible}),b=j(()=>{var M;return(M=s.maxLiveNodes)!=null?M:a.value.maxLiveNodes}),v=j(()=>{var M;return(M=s.liveNodeBuffer)!=null?M:a.value.liveNodeBuffer}),g=j(()=>{var M;return(M=s.nodeVirtual)!=null?M:a.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return s.parseOptions},get customMarkdownIt(){return s.customMarkdownIt},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return s.customHtmlTags},get mode(){return s.mode},get htmlPolicy(){return s.htmlPolicy},get viewportPriority(){return s.viewportPriority},get codeBlockStream(){return s.codeBlockStream},get codeBlockDarkTheme(){return s.codeBlockDarkTheme},get codeBlockLightTheme(){return s.codeBlockLightTheme},get codeBlockMonacoOptions(){return s.codeBlockMonacoOptions},get codeRenderer(){return s.codeRenderer},get renderCodeBlocksAsPre(){return s.renderCodeBlocksAsPre},get codeBlockMinWidth(){return s.codeBlockMinWidth},get codeBlockMaxWidth(){return s.codeBlockMaxWidth},get codeBlockProps(){return s.codeBlockProps},get mermaidProps(){return s.mermaidProps},get d2Props(){return s.d2Props},get infographicProps(){return s.infographicProps},get showTooltips(){return c.value},get themes(){return s.themes},get isDark(){return s.isDark},get customId(){return s.customId},get indexKey(){return s.indexKey},get typewriter(){return s.typewriter},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return s.smoothStreamingOptions},get parseCoalesceMs(){return s.parseCoalesceMs},get fade(){return u.value},get batchRendering(){return d.value},get initialRenderBatchSize(){return h.value},get renderBatchSize(){return m.value},get renderBatchDelay(){return f.value},get renderBatchBudgetMs(){return y.value},get renderBatchIdleTimeoutMs(){return S.value},get deferNodesUntilVisible(){return _.value},get maxLiveNodes(){return b.value},get liveNodeBuffer(){return v.value},get nodeVirtual(){return g.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function $(M){o("height-change",M)}function A(M){o("virtual-state-change",M)}function w(M){o("anchor-change",M)}const x=se(),I=se(null),L=se(null),O=se(null),P=Qs({1:null,2:null,3:null,4:null,5:null,6:null}),B=se(!1),R=new Map,W=se(0),V=se(0),z=se({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ie(){var M,F;if(((M=s.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const G=(F=s.virtualScroll)==null?void 0:F.scrollRoot;return ae(typeof G=="function"?G():G)}function ae(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?ae(M.value):typeof M=="object"&&"$el"in M?ae(M.$el):null:null}const{isClient:re,renderAsFragment:Te,debugPerformanceEnabled:Pe,resolvedShowTooltips:We,resolvedHtmlPolicy:Ne,inheritedSmoothStreaming:me,ownsTypewriterCursor:be}=(function(M){const F=typeof window<"u",G=Gc(),Y=Bt("markstreamHtmlPolicy",void 0),ee=Bt("markstreamTypewriterCursor",void 0),he=Bt("markstreamSmoothStreaming",void 0),ye=j(()=>M.renderAsFragment===!0),ke=j(()=>!!(M.debugPerformance&&F&&typeof console<"u")),Oe=j(()=>{var Re;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Ae=(Re=G.showTooltips)!=null?Re:G["show-tooltips"];return Ae===""||Ae===!0||Ae==="true"||Ae!==!1&&Ae!=="false"&&void 0}),xe=j(()=>{var Re,Ae;return(Ae=(Re=M.htmlPolicy)!=null?Re:Y?.value)!=null?Ae:"safe"}),Fe=j(()=>ee?.value!==!0);return{isClient:F,renderAsFragment:ye,debugPerformanceEnabled:ke,resolvedShowTooltips:Oe,resolvedHtmlPolicy:xe,inheritedSmoothStreaming:he,inheritedTypewriterCursor:ee,ownsTypewriterCursor:Fe}})(k),{resolveViewportRoot:Se,resolveScrollContainer:fe,isReverseFlexScrollRoot:K,getNormalizedScrollTop:Z,getOffsetTopWithinRoot:pe}=(function(M,F){function G(){var ke,Oe;return(Oe=(ke=F.scrollRoot)==null?void 0:ke.call(F))!=null?Oe:null}function Y(ke){if(typeof window>"u")return null;const Oe=G();if(Oe)return Oe;const xe=ke??M.value;if(!xe)return null;const Fe=xe.ownerDocument||document,Re=Fe.scrollingElement||Fe.documentElement;let Ae=xe;for(;Ae&&Ae!==Fe.body&&Ae!==Re;){if(iH(window.getComputedStyle(Ae))&&rH(Ae))return Ae;Ae=Ae.parentElement}return null}function ee(ke){if(!F.isClient)return!1;try{const Oe=window.getComputedStyle(ke);return!!(Oe.display||"").toLowerCase().includes("flex")&&(Oe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function he(ke,Oe,xe){var Fe,Re;if(xe)return ye(Oe);const Ae=ke.scrollTop;if(!ee(ke))return Ae;const De=Ae<0?-Ae:Ae;return Math.max(0,((Fe=ke.scrollHeight)!=null?Fe:0)-((Re=ke.clientHeight)!=null?Re:0))-De}function ye(ke){var Oe,xe,Fe,Re,Ae;const De=Number((Oe=ke.scrollingElement)==null?void 0:Oe.scrollTop),qe=Number((Fe=(xe=ke.documentElement)==null?void 0:xe.scrollTop)!=null?Fe:0),Ue=Number((Ae=(Re=ke.body)==null?void 0:Re.scrollTop)!=null?Ae:0);return Math.max(0,Number.isFinite(De)?De:0,Number.isFinite(qe)?qe:0,Number.isFinite(Ue)?Ue:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(ke){var Oe,xe,Fe,Re;const Ae=G();if(Ae)return Ae;const De=Y((Oe=ke??M.value)!=null?Oe:null);if(De)return De;const qe=(Re=(Fe=ke?.ownerDocument)!=null?Fe:(xe=M.value)==null?void 0:xe.ownerDocument)!=null?Re:typeof document<"u"?document:null;return qe?.scrollingElement||qe?.documentElement||null},isReverseFlexScrollRoot:ee,getNormalizedScrollTop:he,getOffsetTopWithinRoot:function(ke,Oe){const xe=Oe.ownerDocument||ke.ownerDocument||document;if((function(De,qe){return De===qe.documentElement||De===qe.body||De===qe.scrollingElement})(Oe,xe))return ke.getBoundingClientRect().top+ye(xe);const Fe=Oe.getBoundingClientRect(),Re=ke.getBoundingClientRect(),Ae=he(Oe,xe,!1);return Re.top-Fe.top+Ae}}})(x,{isClient:re,scrollRoot:ie});pn("markstreamShowTooltips",We),pn("markstreamHtmlPolicy",Ne),pn("markstreamTypewriter",j(()=>s.typewriter!==!1)),pn("markstreamFade",j(()=>k.fade!==!1)),pn("markstreamTypewriterCursor",j(()=>!0)),pn("markstreamTextStreamState",R),pn("markstreamStreamVersion",W),pn("markstreamParseOptions",j(()=>s.parseOptions)),pn("markstreamCustomMarkdownIt",j(()=>s.customMarkdownIt));const{smoothStreamingEnabled:D,renderContent:X,effectiveFinal:oe}=(function(M,F){const G=oH(M.smoothStreamingOptions),Y=j(()=>{var xe,Fe,Re;return M.smoothStreaming!==!1&&!((xe=M.nodes)!=null&&xe.length)&&(M.smoothStreaming===!0||!((Fe=F.inheritedSmoothStreaming)!=null&&Fe.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((Re=M.maxLiveNodes)!=null?Re:0)<=0)}),ee=se(!F.isClient||M.smoothStreaming===!0);ln(()=>{ee.value=!0});const he=j(()=>ee.value&&Y.value),ye=j(()=>{var xe;return he.value?G.visible.value:(xe=M.content)!=null?xe:""}),ke=j(()=>{var xe,Fe;const Re=(xe=M.parseOptions)!=null?xe:{};return(Fe=M.final)!=null?Fe:Re.final}),Oe=j(()=>{const xe=ke.value;return he.value&&xe!=null?!!xe&&G.caughtUp.value:xe});return Ve([()=>M.content,()=>M.nodes,he,ke],([xe,Fe,Re,Ae])=>{if(Fe?.length)return void G.reset("");const De=xe??"";if(!Re)return G.reset(De),void(Ae&&G.finish({flush:!0}));const qe=G.source.value;De?De===qe||(De.startsWith(qe)?G.enqueue(De.slice(qe.length)):G.reset(De)):G.reset(""),Ae&&G.finish()},{immediate:!0}),{smoothStream:G,smoothStreamingEligible:Y,smoothStreamingEnabled:he,renderContent:ye,requestedFinal:ke,effectiveFinal:Oe}})(k,{isClient:re,inheritedSmoothStreaming:me});pn("markstreamSmoothStreaming",D);const te=se(!1);let ue="",U=!1,q=null;function J(){re&&q!=null&&(window.clearTimeout(q),q=null)}function de(){te.value=!1,J()}function ge(M,F){if(!Pe.value)return;const G=(function(){if(!Pe.value)return null;const Y=Xe(Me),ee=Xe(le),he=Math.max(ze,ee);if(Y<=0&&he<=0)return null;const ye={total:Y,maxPerFrame:he,byLabel:(ke=Me,Object.fromEntries(Array.from(ke.entries()).sort((Oe,xe)=>xe[1]-Oe[1]||Oe[0].localeCompare(xe[0]))))};var ke;return Me.clear(),le.clear(),ze=0,ye})();console.info(`[markstream-vue][perf] ${M}`,G?Et(st({},F),{layoutReads:G}):F)}Ve([X,()=>s.nodes,oe],([M,F,G])=>{const Y=M??"";return F?.length||G===!0?(de(),ue=Y,void(U=!0)):U?(ue&&Y.length>ue.length&&Y.startsWith(ue)?(te.value=!0,re&&(J(),q=window.setTimeout(()=>{var ee;q=null,oe.value===!0||(ee=s.nodes)!=null&&ee.length||(_l(),te.value=!1,hi())},1200))):(Y.length<ue.length||!Y.startsWith(ue))&&de(),void(ue=Y)):(ue=Y,void(U=!0))},{flush:"sync",immediate:!0});const Me=new Map,le=new Map;let _e=!1,ze=0;function Xe(M){let F=0;for(const G of M.values())F+=G;return F}function ot(){ze=Math.max(ze,Xe(le)),le.clear(),_e=!1}function Ye(M,F){return(function(G){var Y,ee;Pe.value&&(Me.set(G,((Y=Me.get(G))!=null?Y:0)+1),le.set(G,((ee=le.get(G))!=null?ee:0)+1),_e||(_e=!0,re&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(ot):typeof queueMicrotask!="function"?setTimeout(ot,0):queueMicrotask(ot)))})(M),F()}const mt=s.customId?`renderer-${s.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,It=(function(M){const F=new Map;return{scope:M,cache:F,clear:()=>F.clear()}})(mt),Mt=j(()=>`${mt}:${W.value}`);pn(Vx,It);const Kt=Wn(()=>s.customId),{effectiveCustomHtmlTagsSet:fn,mergedParseOptions:un,parsedNodes:Ge}=nH(s,{instanceMsgId:mt,renderContent:X,effectiveFinal:oe,smoothStreamingEnabled:D,debugPerformanceEnabled:Pe,customComponentsMap:Kt,logPerf:ge});Ve(Ge,()=>{It.clear(),W.value+=1},{immediate:!0});const Pt=j(()=>({customId:s.customId,customHtmlTags:un.value.customHtmlTags,parseOptions:s.parseOptions,customMarkdownIt:s.customMarkdownIt,htmlPolicy:Ne.value,viewportPriority:s.viewportPriority,mode:r.value,codeRenderer:l.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:s.codeBlockDarkTheme,codeBlockLightTheme:s.codeBlockLightTheme,codeBlockMonacoOptions:s.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:s.codeBlockMinWidth,codeBlockMaxWidth:s.codeBlockMaxWidth,codeBlockProps:s.codeBlockProps,mermaidProps:s.mermaidProps,d2Props:s.d2Props,infographicProps:s.infographicProps,showTooltips:We.value,themes:s.themes,isDark:s.isDark,typewriter:s.typewriter,smoothStreamingOptions:s.smoothStreamingOptions,parseCoalesceMs:s.parseCoalesceMs,fade:k.fade}));pn("markstreamNestedRendererProps",Pt);const Gn=j(()=>Ge.value),_n=j(()=>Ge.value.length),In=se(null),On=se(null),as=se(null),ks=se(null),bs=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),$s=!bs&&s.customId?w_(s.customId):null,Jn=j(()=>$s?(__.value,w_(s.customId)):null),wn=j(()=>{var M;return!!(re&&!Te.value&&s.customId&&!bs&&((M=Jn.value)!=null&&M.enabled))}),on=j(()=>{var M;return!!(!Te.value&&((M=s.virtualScroll)!=null&&M.enabled))}),Un=se(!1);ln(()=>{Un.value=!0});const Tt=j(()=>!!(re&&on.value));pn("markstreamHostScrollManaged",Tt);const $n=j(()=>!!(Un.value&&Tt.value)),Gt=j(()=>wn.value||Tt.value),js=j(()=>wn.value||$n.value),Po=j(()=>{var M;return Gt.value&&((M=Jn.value)==null?void 0:M.textEstimation)!==!1}),co=j(()=>{var M;return Gt.value&&((M=Jn.value)==null?void 0:M.codeBlockEstimation)!==!1});function zs(){const M=V.value||Ye("getMeasuredContainerWidth.clientWidth",()=>{var F;return((F=x.value)==null?void 0:F.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const uo=j(()=>{const M=zs();return M>0?Math.max(1,Math.round(M)):640}),fo=j(()=>{var M;return Math.max(1,(M=k.maxLiveNodes)!=null?M:320)}),wt=j(()=>{var M;return!Te.value&&k.nodeVirtual!==!1&&!(((M=k.maxLiveNodes)!=null?M:0)<=0)&&(k.nodeVirtual===!0?Ge.value.length>0:Ge.value.length>fo.value)}),ho=j(()=>wt.value||wn.value||Tt.value),es=j(()=>s.viewportPriority!==!1&&!B.value),Ns=VB(M=>{var F;return Se((F=M??x.value)!=null?F:null)},es),{requestFrame:gn,cancelFrame:vn,hasIdleCallback:Ie,isTestEnv:ve}=(function(M){const F=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,G=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=M.isClient&&typeof window.requestIdleCallback=="function",ee=(function(){var he;if(typeof globalThis>"u"||!("process"in globalThis))return;const ye=(he=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:he.value;return ye?.env})();return{requestFrame:F,cancelFrame:G,hasIdleCallback:Y,isTestEnv:ee?.NODE_ENV==="test"}})({isClient:re}),{resolvedBatchSize:ne,resolvedInitialBatch:Ee,batchingEnabled:He,incrementalRenderingActive:it,renderedCount:Ke,previousRenderContext:H,adaptiveBatchSize:Q,previousBatchConfig:Ce}=(function(M,F){var G;const Y=j(()=>{var Re;const Ae=Math.trunc((Re=M.renderBatchSize)!=null?Re:80);return Number.isFinite(Ae)?Math.max(0,Ae):0}),ee=j(()=>{var Re;const Ae=Math.trunc((Re=M.initialRenderBatchSize)!=null?Re:Y.value);return Number.isFinite(Ae)?Math.max(0,Ae):Y.value}),he=j(()=>!F.renderAsFragment.value&&M.batchRendering!==!1&&Y.value>0&&F.isClient&&!F.isTestEnv),ye=se(0),ke=se({key:M.indexKey,total:0}),Oe=se(Math.max(1,Y.value||1)),xe=j(()=>{var Re;return he.value&&((Re=M.maxLiveNodes)!=null?Re:0)<=0}),Fe=se({batchSize:Y.value,initial:ee.value,delay:(G=M.renderBatchDelay)!=null?G:16,enabled:xe.value});return{resolvedBatchSize:Y,resolvedInitialBatch:ee,batchingEnabled:he,incrementalRenderingActive:xe,renderedCount:ye,previousRenderContext:ke,adaptiveBatchSize:Oe,previousBatchConfig:Fe}})(k,{isClient:re,isTestEnv:ve,renderAsFragment:Te}),Be=new Map,nt=new Map,lt=new WeakMap;let At=null;const qn=new WeakMap,Qt=new Map,po=se(0),Nn=j(()=>(po.value,Array.from(Be.entries()).sort((M,F)=>M[0]-F[0]))),Jt=se(null),qt=se(null);let Vs=null,ui=0,Ro=null;const{activeRestoreAnchor:Do,getRelativeScrollTopWithinContainer:ul,setRelativeScrollTopWithinContainer:Ch,resolveAnchorOffset:e3,clearRestoreReconcile:ou,scheduleRestoreReconcile:ba,captureRestoreAnchor:yv,restoreAnchor:kv,getAnchorDrift:t3}=(function(M){const{isClient:F,containerRef:G,parsedNodeCount:Y,requestFrame:ee,cancelFrame:he,resolveScrollContainer:ye,getNormalizedScrollTop:ke,getOffsetTopWithinRoot:Oe,isReverseFlexScrollRoot:xe,estimateIndexForOffset:Fe,estimateHeightRange:Re,getFallbackNodeHeight:Ae,clamp:De}=M,qe=se(null);let Ue=null,ut=[];function tt(){const ft=ye(),St=G.value;if(!ft||!St)return null;const Ct=ft.ownerDocument||St.ownerDocument||document;if(ft===Ct.documentElement||ft===Ct.body||ft===Ct.scrollingElement){const Ft=St.getBoundingClientRect();return Math.max(0,-Ft.top)}return Math.max(0,ke(ft,Ct,!1)-Oe(St,ft))}function et(ft){var St;const Ct=ye(),Ft=G.value;if(!Ct||!Ft)return;const _s=Math.max(0,ft),ws=Ct.ownerDocument||Ft.ownerDocument||document,Bo=ws.defaultView||(typeof window<"u"?window:null);if(Ct===ws.documentElement||Ct===ws.body||Ct===ws.scrollingElement){const qi=ke(Ct,ws,!0)+Ft.getBoundingClientRect().top;return void((St=Bo?.scrollTo)==null||St.call(Bo,0,Math.max(0,qi+_s)))}C_(Ct,ws,Oe(Ft,Ct)+_s,{isReverseFlexScrollRoot:qi=>{var ji;return(ji=xe?.(qi))!=null&&ji},getNormalizedScrollTop:ke})}function ht(ft){const St=Y.value,Ct=De(ft.nodeIndex,0,Math.max(0,St-1));return Re(0,Ct)+Math.max(0,ft.offsetWithinNodePx)}function pt(){if(Ue!=null&&(he?.(Ue),Ue=null),F)for(const ft of ut)window.clearTimeout(ft);ut=[]}function yt(ft){const St=ht(ft),Ct=tt();Ct!=null&&Math.abs(Ct-St)<=.5||et(St)}return{activeRestoreAnchor:qe,getRelativeScrollTopWithinContainer:tt,setRelativeScrollTopWithinContainer:et,resolveAnchorOffset:ht,clearRestoreReconcile:pt,applyRestoreAnchor:yt,scheduleRestoreReconcile:function(){qe.value&&F&&Ue==null&&(Ue=ee?ee(()=>{Ue=null,qe.value&&yt(qe.value)}):null,Ue==null&&qe.value&&yt(qe.value))},captureRestoreAnchor:function(){const ft=tt(),St=Y.value;if(ft==null||St<=0)return null;const Ct=De(Fe(ft+1),0,St-1),Ft=Re(0,Ct),_s=Ae(Ct);return{nodeIndex:Ct,offsetWithinNodePx:De(ft-Ft,0,Math.max(0,_s-1))}},restoreAnchor:function(ft){const St=Y.value;if(qe.value={nodeIndex:De(ft.nodeIndex,0,Math.max(0,St-1)),offsetWithinNodePx:Math.max(0,ft.offsetWithinNodePx)},pt(),yt(qe.value),F)for(const Ct of[0,120,280,480])ut.push(window.setTimeout(()=>{qe.value&&yt(qe.value)},Ct))},getAnchorDrift:function(ft){const St=tt();return St==null?null:St-ht(ft)}}})({isClient:re,containerRef:x,parsedNodeCount:_n,requestFrame:gn,cancelFrame:vn,resolveScrollContainer:()=>Jt.value||fe(),getNormalizedScrollTop:Z,getOffsetTopWithinRoot:pe,isReverseFlexScrollRoot:K,estimateIndexForOffset:cp,estimateHeightRange:Ui,getFallbackNodeHeight:pu,clamp:ns}),{nodeHeights:mo,heightStats:go,heightTreeSize:_a,heightSumTree:xh,heightKnownTree:Th,averageNodeHeight:Ko,resetHeightMeasurements:n3,pruneHeightMeasurements:s3,rebuildHeightTrees:iu,recordNodeHeight:o3,removeNodeHeights:i3,exportHeightCache:r3,importHeightCache:l3,fenwickRangeSum:ru}=(function(M={}){const F=Qs({}),G=Qs({total:0,count:0}),Y=se(0),ee=se([]),he=se([]);function ye(){for(const Ae of Object.keys(F))delete F[Number(Ae)];G.total=0,G.count=0,Y.value=0,ee.value=[],he.value=[]}function ke(Ae,De,qe){for(let Ue=De+1;Ue<Ae.length;Ue+=Ue&-Ue)Ae[Ue]+=qe}function Oe(Ae,De){let qe=0;for(let Ue=De+1;Ue>0;Ue-=Ue&-Ue)qe+=Ae[Ue];return qe}function xe(Ae){Y.value=Ae;const De=new Array(Ae+1).fill(0),qe=new Array(Ae+1).fill(0);for(const[Ue,ut]of Object.entries(F)){const tt=Number(Ue),et=Number(ut);!Number.isFinite(tt)||tt<0||tt>=Ae||!Number.isFinite(et)||et<=0||(ke(De,tt,et),ke(qe,tt,1))}ee.value=De,he.value=qe}function Fe(Ae){if(!Number.isInteger(Ae)||Ae<0)return!1;const De=F[Ae];if(!Number.isFinite(De)||De<=0)return!1;if(delete F[Ae],G.total=Math.max(0,G.total-De),G.count=Math.max(0,G.count-1),Y.value>Ae){const qe=ee.value,Ue=he.value;qe.length&&Ue.length&&(ke(qe,Ae,-De),ke(Ue,Ae,-1))}return!0}const Re=j(()=>G.count>0?Math.max(12,G.total/G.count):32);return{nodeHeights:F,heightStats:G,heightTreeSize:Y,heightSumTree:ee,heightKnownTree:he,averageNodeHeight:Re,resetHeightMeasurements:ye,pruneHeightMeasurements:function(Ae){if(Ae<=0)return void ye();let De=0,qe=0;for(const[Ue,ut]of Object.entries(F)){const tt=Number(Ue),et=Number(ut);!Number.isFinite(tt)||tt<0||tt>=Ae||!Number.isFinite(et)||et<=0?delete F[tt]:(De+=et,qe++)}G.total=De,G.count=qe},rebuildHeightTrees:xe,recordNodeHeight:function(Ae,De,qe={}){(function(Ue,ut,tt={}){var et;if(!Number.isFinite(ut)||ut<=0)return!1;const ht=F[Ue];if(ht&&(tt.allowShrink===!1&&ut<ht||Math.abs(ut-ht)<=1))return!1;if(F[Ue]=ut,ht?G.total+=ut-ht:(G.total+=ut,G.count++),Y.value>Ue){const pt=ee.value,yt=he.value;if(pt.length&&yt.length)if(ht){const ft=ut-ht;ft!==0&&ke(pt,Ue,ft)}else ke(pt,Ue,ut),ke(yt,Ue,1)}tt.notify!==!1&&((et=M.onHeightRecorded)==null||et.call(M))})(Ae,De,Et(st({},qe),{notify:!0}))},removeNodeHeight:function(Ae,De={}){var qe;const Ue=Fe(Ae);return Ue&&De.notify!==!1&&((qe=M.onHeightRecorded)==null||qe.call(M)),Ue},removeNodeHeights:function(Ae,De={}){var qe;let Ue=0;for(const ut of Ae)Fe(Number(ut))&&Ue++;return Ue>0&&De.notify!==!1&&((qe=M.onHeightRecorded)==null||qe.call(M)),Ue},exportHeightCache:function(){return Object.entries(F).map(([Ae,De])=>({index:Number(Ae),height:Number(De)})).filter(Ae=>Number.isFinite(Ae.index)&&Ae.index>=0&&Number.isFinite(Ae.height)&&Ae.height>0).sort((Ae,De)=>Ae.index-De.index)},importHeightCache:function(Ae,De={}){var qe;if(!Array.isArray(Ae))return;const Ue=Y.value;let ut=!1;if(De.mode!=="merge"){const tt=Object.keys(F);if(tt.length>0){for(const et of tt)delete F[Number(et)];ut=!0}}for(const tt of Ae){const et=Number(tt.index),ht=Number(tt.height);if(!Number.isInteger(et)||et<0||Ue>0&&et>=Ue||!Number.isFinite(ht)||ht<=0)continue;const pt=F[et];pt&&Math.abs(pt-ht)<=1||(F[et]=ht,ut=!0)}ut&&((function(){let tt=0,et=0;const ht=Y.value;for(const[pt,yt]of Object.entries(F)){const ft=Number(pt),St=Number(yt);!Number.isFinite(ft)||ft<0||ht>0&&ft>=ht||!Number.isFinite(St)||St<=0?delete F[ft]:(tt+=St,et++)}G.total=tt,G.count=et})(),Ue>0&&xe(Ue),(qe=M.onHeightRecorded)==null||qe.call(M))},fenwickRangeSum:function(Ae,De,qe){if(qe<=De)return 0;const Ue=Oe(Ae,qe-1);return De<=0?Ue:Ue-Oe(Ae,De-1)}}})({onHeightRecorded:()=>{yo(),Tt.value&&Da(),Do.value&&ba(),qt.value&&yl(),an("node-resize")}});function lu(){n3(),Qt.clear()}function bv(M){!Number.isInteger(M)||M<0||M>=Ge.value.length||Qt.set(M,Ta(M))}function _v(M,F,G={}){const Y=mo[M];o3(M,F,G);const ee=mo[M];ee&&ee>0?bv(M):Y&&Qt.delete(M)}function wv(M,F){const G=Ye("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,ee;return(ee=(Y=Be.get(M))==null?void 0:Y.offsetHeight)!=null?ee:0});return G>0?G:Ye("getNodeLayoutHeight.content.offsetHeight",()=>F.offsetHeight)}function Sv(M,F={}){l3(M,F),ep()}const Bi=j(()=>{var M;return!Te.value&&k.deferNodesUntilVisible!==!1&&!(((M=k.maxLiveNodes)!=null?M:0)<=0)&&!wt.value&&!(Ge.value.length>900)&&es.value}),Cv=j(()=>!!Ns&&(Bi.value||wt.value)),xv=j(()=>wt.value||Tt.value),{liveNodeBufferResolved:wa,focusIndex:vo,liveRange:ts,updateLiveRange:Tr}=(function(M,F){const{parsedNodeCount:G,virtualizationEnabled:Y,maxLiveNodesResolved:ee,clamp:he}=F,ye=j(()=>{var xe;return Math.max(0,(xe=M.liveNodeBuffer)!=null?xe:60)}),ke=se(0),Oe=Qs({start:0,end:0});return{liveNodeBufferResolved:ye,focusIndex:ke,liveRange:Oe,updateLiveRange:function(){const xe=G.value;if(!Y.value||xe===0)return Oe.start=0,void(Oe.end=xe);const Fe=Math.min(ee.value,xe),Re=ye.value,Ae=he(ke.value-Re,0,Math.max(0,xe-Fe));Oe.start=Ae,Oe.end=Math.min(xe,Ae+Fe)}}})(k,{parsedNodeCount:_n,virtualizationEnabled:wt,maxLiveNodesResolved:fo,clamp:ns}),Go=new Map,Mr=new Map,Fi=new Map,au=[],di=new Map,Hi=new Set,Tv=se(0);let Mh=!1;const Mv=j(()=>(Tv.value,Hi.size)),Ks=new Map,Yo=new Map,Av=se(0),Ah=j(()=>{Av.value;let M=0;for(const F of Ks.values())M+=Math.max(0,F);return M});let Gs=null,Eh=!0,Ev=[0],Iv="";function yo(){Eh=!0}const cu=j(()=>{if(!wt.value)return Ge.value.length;const M=wa.value,F=Math.max(ts.end+M,Ee.value),G=Math.min(Ge.value.length,F);return Math.max(Ke.value,G)});function uu(){Mh||(Mh=!0,queueMicrotask(()=>{Mh=!1,Tv.value+=1}))}function $v(M,F,G="node-resize"){if(!re||typeof window>"u")return null;const Y=window.setTimeout(()=>{Hi.delete(Y)&&uu();try{F()}finally{an(G)}},Math.max(0,M));return Hi.add(Y),uu(),Y}function du(M){re&&M!=null&&(Hi.delete(M)&&uu(),window.clearTimeout(M))}function Nv(){if(re&&typeof window<"u")for(const M of Hi)window.clearTimeout(M);Hi.size&&(Hi.clear(),uu()),au.length=0,Fi.clear()}function a3(M){var F,G;return(G=(F=ks.value)==null?void 0:F[M])!=null?G:null}const{cancelScheduledFocusSync:Ih,scheduleFocusSync:Xo}=(function(M){const{isClient:F,containerRef:G,virtualizationEnabled:Y,requestFrame:ee,cancelFrame:he,syncFocusToScroll:ye}=M;let ke=null;function Oe(){var Fe,Re,Ae;return(Ae=(Re=(Fe=G.value)==null?void 0:Fe.ownerDocument)==null?void 0:Re.defaultView)!=null?Ae:typeof window<"u"?window:null}function xe(){if(!ke)return;const Fe=Oe();ke.viaTimeout?Fe?Fe.clearTimeout(ke.id):clearTimeout(ke.id):he?.(ke.id),ke=null}return{cancelScheduledFocusSync:xe,scheduleFocusSync:function(Fe={}){if(!Y.value)return;if(!F)return void ye(!0);if(Fe.immediate)return xe(),void ye(!0);if(ke)return;const Re=()=>{ke=null,ye()};if(ee)return void(ke={id:ee(Re),viaTimeout:!1});const Ae=Oe();ke={id:Ae?Ae.setTimeout(Re,16):setTimeout(Re,16),viaTimeout:!0}}}})({isClient:re,containerRef:x,virtualizationEnabled:wt,requestFrame:gn,cancelFrame:vn,syncFocusToScroll:function(M=!1){var F;if(!wt.value)return;const G=Jt.value||fe();if(!G)return;const Y=G.ownerDocument||((F=x.value)==null?void 0:F.ownerDocument)||document,ee=Y?.defaultView||(typeof window<"u"?window:null),he=G===Y?.documentElement||G===Y?.body,ye=Ge.value.length;if(!he&&ye>0&&K(G)){const qe=Ye("syncFocusToScroll.clientHeight",()=>G.clientHeight||0),Ue=Ye("syncFocusToScroll.scrollTop",()=>G.scrollTop),ut=Ue<0?-Ue:Ue,tt=(function(ht){var pt,yt;const ft=Ge.value;if(!ft.length)return 0;if(ht<=0)return Math.max(0,ft.length-1);if(Gt.value){const Ct=(pt=Ph()[ft.length])!=null?pt:0;return Hv(Math.max(0,Ct-ht))}if(_a.value===ft.length){const Ct=Ui(0,ft.length);return cp(Math.max(0,Ct-ht))}let St=ht;for(let Ct=ft.length-1;Ct>=0;Ct--){const Ft=(yt=mo[Ct])!=null?yt:Ko.value;if(St<=Ft)return Ct;St-=Ft}return 0})(Math.max(0,ut)+.5*Math.max(0,qe)),et=ns(tt,0,Math.max(0,ye-1));return void((M||Math.abs(et-vo.value)>1)&&(vo.value=et,Tr()))}const ke=he?null:Ye("syncFocusToScroll.root.getBoundingClientRect",()=>G.getBoundingClientRect()),Oe=he?0:ke.top,xe=he?Ye("syncFocusToScroll.viewport.clientHeight",()=>{var qe,Ue;return(Ue=(qe=ee?.innerHeight)!=null?qe:G.clientHeight)!=null?Ue:0}):ke.bottom,Fe=Nn.value;let Re=null,Ae=null;for(const[qe,Ue]of Fe){if(!Ue)continue;const ut=Ye("syncFocusToScroll.slot.getBoundingClientRect",()=>Ue.getBoundingClientRect());ut.bottom<=Oe||ut.top>=xe||(Re==null&&(Re=qe),Ae=qe)}if(Re==null||Ae==null){const qe=x.value;if(!qe)return;const Ue=he?{top:0}:Ye("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>G.getBoundingClientRect()),ut=Ye("syncFocusToScroll.fallback.scrollTop",()=>Z(G,Y,he)),tt=he?(()=>{const pt=Ye("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>qe.getBoundingClientRect()),yt=(he?0:Ue.top)-pt.top;return Math.max(0,yt)})():(()=>{const pt=pe(qe,G);return Math.max(0,ut-pt)})(),et=he?Ye("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var pt,yt,ft,St;return(St=(ft=(yt=ee?.innerHeight)!=null?yt:(pt=Y?.documentElement)==null?void 0:pt.clientHeight)!=null?ft:G.clientHeight)!=null?St:0}):Ye("syncFocusToScroll.fallback.root.clientHeight",()=>G.clientHeight),ht=cp(tt+.5*Math.max(0,et));return vo.value=ns(ht,0,Math.max(0,Ge.value.length-1)),void Tr()}const De=Math.round((Re+Ae)/2);!M&&Math.abs(De-vo.value)<=1||(vo.value=ns(De,0,Math.max(0,Ge.value.length-1)),Tr())}}),{visibleNodeIndices:$h,nodeVisibilityHandles:dl,nodeVisibilityWatchStops:fu,nodeVisibilityFallbackTimers:Lv,clearVisibilityFallback:hu,markNodeVisible:Wi,cleanupNodeVisibility:c3,destroyNodeVisibilityState:Nh}=sH({isClient:re,shouldTrackVisibleNodeIndices:()=>Bi.value,shouldCleanupNodeVisibility:()=>wt.value,onNodeMarkedVisible:M=>{wt.value?Xo():vo.value=ns(M,0,Math.max(0,Ge.value.length-1))},onNodeVisibilityCleaned:M=>{Be.delete(M)&&a0()}}),{cleanupScrollListener:Ov,setupScrollListener:u3}=(function(M){const{isClient:F,virtualizationEnabled:G,listenerEnabled:Y,scrollRootElement:ee,resolveScrollContainer:he,scheduleFocusSync:ye,onScroll:ke}=M;let Oe=null,xe=null;function Fe(){Oe&&(Oe(),Oe=null),xe=null,ee.value=null}function Re(Ae){const De=M.getScrollTop?M.getScrollTop(Ae):Ae.scrollTop;return Math.max(0,Number.isFinite(De)?Math.abs(De):0)}return{cleanupScrollListener:Fe,setupScrollListener:function(){if(!F)return;if(!((Ae=Y?.value)!=null?Ae:G.value))return void Fe();var Ae;const De=he();if(!De)return void Fe();if(ee.value===De&&Oe)return;Fe(),xe=Re(De);const qe=()=>{if(ke?.(),G.value){const Ue=(function(ut){const tt=Re(ut),et=xe;xe=tt;const ht=Math.max(480,.75*(ut.clientHeight||0));return et==null?tt>ht?{immediate:!0}:void 0:Math.abs(tt-et)>ht?{immediate:!0}:void 0})(De);Ue?ye(Ue):ye()}};De.addEventListener("scroll",qe,{passive:!0}),ee.value=De,Oe=()=>{De.removeEventListener("scroll",qe)}}}})({isClient:re,virtualizationEnabled:wt,listenerEnabled:xv,scrollRootElement:Jt,resolveScrollContainer:fe,scheduleFocusSync:Xo,onScroll:function(){const M=qt.value;if(!M)return;const F=xa();if(!F||(function(Y){if($a()>=ui)return Ro=null,!1;const ee=Ro;if(ee==null)return!0;const he=Math.abs(Y.scrollTop-ee)<=2;return he||(Ro=null),he})(F))return;const G=Yv(F);G!=null?(G<-32||Math.abs(Math.max(0,G)-Math.max(0,M.distanceFromBottomPx))>32)&&vl("restore"):vl("restore")},getScrollTop:M=>{var F;const G=M.ownerDocument||((F=x.value)==null?void 0:F.ownerDocument)||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement;return Ye("scrollListener.getScrollTop",()=>Z(M,G,Y))}});function ns(M,F,G){return Math.min(Math.max(M,F),G)}function Lh(M){return M?.firstElementChild}function Pv(M,F){var G;return M?(G=M.matches)!=null&&G.call(M,F)?M:M.querySelector(F):null}function Rv(){if(!Gt.value)return void(V.value=0);const M=Ye("updateExperimentContainerWidth.clientWidth",()=>{var F,G;return(G=(F=x.value)==null?void 0:F.clientWidth)!=null?G:0});V.value=M>0?M:0}let Sa=null;function Oh(){Sa?.disconnect(),Sa=null}const Dv=ii({loader:()=>yn(null,null,function*(){return(yield Js(()=>import("./index8-nFDUP4kC.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:Ox,delay:0,suspensible:!1});function Bv(M){return M===Dv}const Fv=j(()=>l.value==="pre"?xo:l.value==="shiki"?Dv:cm),Ar=j(()=>{const M=Ge.value;if(!M.length||!Gt.value)return M.map(()=>null);const F=V.value||Ye("estimatedNodeHeights.clientWidth",()=>{var G;return((G=x.value)==null?void 0:G.clientWidth)||0});return!Number.isFinite(F)||F<=0?M.map(()=>null):M.map((G,Y)=>{const ee=mo[Y],he=typeof ee=="number"&&ee>0;if(Po.value&&!he){const ke=Hx(G,F,z.value);if(ke)return ke}if(co.value&&G.type==="code_block"){const ke=(function(Oe){if(Oe.type!=="code_block")return null;const xe=g0(Oe,_u(Oe));return Bv(xe)?"markdown":xe===xo?"pre":xe===Fv.value||xe===cm?"monaco":null})(G);if(ke==="monaco"||ke==="markdown"||ke==="pre")return(function(Oe,xe){var Fe;if(!Oe||Oe.type!=="code_block")return null;const Re=xe.rendererKind,Ae=xe.showHeader!==!1,De=(function(et){var ht,pt,yt,ft;return et.diff?Math.max(td(String((ht=et.originalCode)!=null?ht:"")),td(String((pt=et.updatedCode)!=null?pt:"")),td(String((yt=et.code)!=null?yt:""))):td(String((ft=et.code)!=null?ft:""))})(Oe),qe=!!Oe.diff;let Ue=0,ut=500;if(Re==="monaco"){const et=(Fe=xe.monacoOptions)!=null?Fe:{},ht=(function(yt,ft){const St=typeof yt?.fontSize=="number"&&yt.fontSize>0?yt.fontSize:ft?13:12;return typeof yt?.lineHeight=="number"&&yt.lineHeight>0?yt.lineHeight:ft?30:Math.round(1.5*St)})(et,qe),pt=(function(yt,ft){var St,Ct;if(!ft)return 0;const Ft=typeof((St=yt?.padding)==null?void 0:St.top)=="number"?yt.padding.top:10,_s=typeof((Ct=yt?.padding)==null?void 0:Ct.bottom)=="number"?yt.padding.bottom:22;return Math.max(0,Ft)+Math.max(0,_s)})(et,qe);ut=typeof et.MAX_HEIGHT=="number"&&et.MAX_HEIGHT>0?et.MAX_HEIGHT:500,Ue=Math.round(qe?De*ht+pt:De*(ht+1.5))}else Re==="markdown"?Ue=Math.round(21*De+32):(Ue=Math.round(21*De+32),ut=Number.POSITIVE_INFINITY);const tt=Math.max(1,Math.min(Ue,ut));return{kind:"code-block",height:Math.round(tt+(Ae?40:0)),contentHeight:tt,rendererKind:Re}})(G,{rendererKind:ke,monacoOptions:s.codeBlockMonacoOptions,showHeader:((ye=s.codeBlockProps)==null?void 0:ye.showHeader)!==!1})}var ye;return null})});function pu(M){var F;const G=mo[M];if(Number.isFinite(G)&&G>0)return G;const Y=(F=Ar.value[M])==null?void 0:F.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Ko.value,(function(ee){var he,ye,ke,Oe,xe,Fe,Re,Ae,De,qe,Ue,ut,tt;const et=Ge.value[ee];if(!et||typeof et!="object")return 32;const ht=String((he=et.type)!=null?he:""),pt=zs()||640;switch(ht){case"heading":return 44;case"paragraph":return fl(String((ke=(ye=et.raw)!=null?ye:et.content)!=null?ke:""),pt,34);case"list":{const yt=Array.isArray(et.items)?et.items.length:1;return Math.max(48,30*yt+12)}case"list_item":return fl(String((xe=(Oe=et.raw)!=null?Oe:et.content)!=null?xe:""),pt,34);case"blockquote":return fl(String((Re=(Fe=et.raw)!=null?Fe:et.content)!=null?Re:""),pt,56);case"table":{const yt=Array.isArray(et.rows)?et.rows.length:Array.isArray(et.children)?et.children.length:3;return Math.max(120,38*yt+48)}case"code_block":return fl(String((De=(Ae=et.code)!=null?Ae:et.raw)!=null?De:""),pt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return fl(String((Ue=(qe=et.raw)!=null?qe:et.content)!=null?Ue:""),pt,96);case"thematic_break":return 24;default:return fl(String((tt=(ut=et.raw)!=null?ut:et.content)!=null?tt:""),pt,40)}})(M))}function fl(M,F,G,Y=22){const ee=String(M??"");if(!ee)return G;const he=Math.max(18,Math.floor(Math.max(320,F)/8)),ye=ee.split(/\r?\n/).length,ke=Math.ceil(ee.length/he),Oe=Math.max(1,ye,ke);return Math.max(G,Math.ceil(Oe*Y+12))}function Ca(M){const F=Number(M);return!Number.isFinite(F)||F<=0?-1:Math.round(F/32)}function Ph(){var M,F;const G=Ge.value.length,Y=Ca(V.value||Ye("getFallbackHeightPrefix.clientWidth",()=>{var ke;return((ke=x.value)==null?void 0:ke.clientWidth)||0})),ee=((M=s.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(s.virtualScroll.measurementKey),he=[G,go.count,Math.round(go.total),Math.round(100*Ko.value),ee,Y,Gt.value?1:0,__.value,W.value].join(":");if(!Eh&&Iv===he)return Ev;const ye=new Array(G+1);ye[0]=0;for(let ke=0;ke<G;ke++)ye[ke+1]=ye[ke]+(Gt.value?pu(ke):(F=mo[ke])!=null?F:Ko.value);return Ev=ye,Iv=he,Eh=!1,ye}function Hv(M){var F,G;const Y=Ge.value.length;if(Y<=0||M<=0)return 0;const ee=Ph();if(M>=((F=ee[Y])!=null?F:0))return Y-1;let he=0,ye=Y-1,ke=Y-1;for(;he<=ye;){const Oe=he+ye>>1;((G=ee[Oe+1])!=null?G:0)>=M?(ke=Oe,ye=Oe-1):he=Oe+1}return ke}function Ui(M,F){var G,Y;if(M>=F)return 0;if(Gt.value)return(function(ye,ke){var Oe,xe;const Fe=Ge.value.length,Re=ns(Math.trunc(ye),0,Fe),Ae=ns(Math.trunc(ke),Re,Fe);if(Re>=Ae)return 0;const De=Ph();return((Oe=De[Ae])!=null?Oe:0)-((xe=De[Re])!=null?xe:0)})(M,F);if(_a.value!==Ge.value.length){let ye=0;for(let ke=M;ke<F;ke++)ye+=(G=mo[ke])!=null?G:Ko.value;return ye}const ee=xh.value,he=Th.value;if(!ee.length||!he.length){let ye=0;for(let ke=M;ke<F;ke++)ye+=(Y=mo[ke])!=null?Y:Ko.value;return ye}return ru(ee,M,F)+(F-M-ru(he,M,F))*Ko.value}Ve(()=>Ge.value.length,M=>{yo(),M<=0?lu():(M<_a.value&&s3(M),M!==_a.value&&iu(M))},{immediate:!0});const d3=j(()=>{if(!wt.value)return Ge.value.map((Y,ee)=>({node:Y,index:ee}));const M=Ge.value.length,F=ns(ts.start,0,M),G=ns(ts.end,F,M);return Ge.value.slice(F,G).map((Y,ee)=>({node:Y,index:F+ee}))}),Rh=j(()=>wt.value?Ui(0,Math.min(ts.start,Ge.value.length)):0),Dh=j(()=>{if(!wt.value)return 0;const M=Ge.value.length;return Ui(Math.min(ts.end,M),M)});function Wv(){if(!Gt.value)return 0;let M=0;const F=Ar.value;for(let G=0;G<F.length;G++){if(!F[G])continue;const Y=mo[G];Number.isFinite(Y)&&Y>0||M++}return M}function Uv(){const M=Ge.value.length;return{totalNodes:M,measuredCount:go.count,estimatedCount:Wv(),averageNodeHeight:Ko.value,topSpacerHeight:Rh.value,bottomSpacerHeight:Dh.value,estimatedTotalHeight:Ui(0,M),width:Er()}}function f3(){const M=Ge.value,F=Uv();return Et(st({},F),{probe:{paragraphReady:!!z.value.paragraph,listItemReady:!!z.value.listItem,listWrapperOverhead:z.value.listWrapperOverhead,headingReadyLevels:Object.entries(z.value.headings).filter(([,G])=>!!G).map(([G])=>Number(G))},nodes:M.map((G,Y)=>{var ee,he,ye,ke,Oe,xe,Fe,Re,Ae;return{index:Y,type:G.type,estimateKind:(he=(ee=Ar.value[Y])==null?void 0:ee.kind)!=null?he:null,rendererKind:(ke=(ye=Ar.value[Y])==null?void 0:ye.rendererKind)!=null?ke:null,estimatedHeight:(xe=(Oe=Ar.value[Y])==null?void 0:Oe.height)!=null?xe:null,estimatedContentHeight:(Re=(Fe=Ar.value[Y])==null?void 0:Fe.contentHeight)!=null?Re:null,measuredHeight:(Ae=mo[Y])!=null?Ae:null}})})}function Bh(){return s.indexKey!=null?String(s.indexKey):on.value?`virtual-${hn()}`:"markdown-renderer"}function qv(M){const F=String(M),G=`${Bh()}-`;if(!F.startsWith(G))return null;const Y=F.slice(G.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const ee=Number(Y[1]);return!Number.isInteger(ee)||ee<0||ee>=Ge.value.length?null:ee}function hn(){var M,F,G;const Y=(M=s.virtualScroll)==null?void 0:M.sessionKey;return String(Y!=null&&Y!==""?Y:(G=(F=s.indexKey)!=null?F:s.customId)!=null?G:mt)}function jn(){var M;const F=(M=s.virtualScroll)==null?void 0:M.threadKey;return F==null||F===""?void 0:String(F)}function Fh(M){var F;return(M??"")===((F=jn())!=null?F:"")}function h3(){var M;const F=(M=s.virtualScroll)==null?void 0:M.measurementKey;return F==null?"":String(F)}function p3(){const M=l.value,F=M==="monaco"?s.codeBlockMonacoOptions:void 0,G=s.codeBlockProps;return[s.isDark?"dark":"light",M==="monaco"?"code-rich":M==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",Yn(s.codeBlockMinWidth),Yn(s.codeBlockMaxWidth),Yn(F?.fontSize),Yn(F?.lineHeight),Yn(F?.fontFamily),Yn(F?.tabSize),Yn(F?.MAX_HEIGHT),Yn(F?.wordWrap),Yn(F?.wrappingIndent),Yn(F?.padding),Yn(G?.showHeader),Yn(G?.showCopyButton),Yn(G?.showExpandButton),Yn(G?.showPreviewButton),Yn(G?.showCollapseButton),Yn(G?.showFontSizeButtons)].join("\0")}function fi(){return[h3(),p3()].join("\0")}function Er(){return zs()}const mu=j(()=>Ca(Er())),Ys=j(()=>[fi(),mu.value].join("\0")),m3=j(()=>{var M;return on.value?["virtual",(M=jn())!=null?M:"",hn(),Ys.value].join("\0"):s.indexKey});function hl(){Av.value+=1}function Hh(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=Ge.value.length||M.sessionKey!==hn()||M.threadKey!==jn()||M.layoutEpochKey!==Ys.value)}function jv(M){const F=String(M),G=Yo.get(F);return G?Hh(G)?G.index:null:qv(F)}function zv(M="async-node"){(Ks.size||Yo.size)&&(Ks.clear(),Yo.clear(),hl(),an(M))}const pl=Bt(kg,null),Wh={reportHeight(M,F){if(!Tt.value)return;const G=jv(M);if(G==null)return;const Y=Go.get(G);if(!Y)return;const ee=Number(F),he=wv(G,Y);_v(G,Number.isFinite(ee)&&ee>0?Math.max(ee,he||0):he)},markPending(M){if(!Tt.value)return;const F=qv(M);F!=null&&(function(G,Y){var ee;const he=Yo.get(G);if(he&&Hh(he))return Ks.set(G,Math.max(0,(ee=Ks.get(G))!=null?ee:0)+1),hl(),void an("async-node");Ks.set(G,1),Yo.set(G,(function(ye){return{index:ye,sessionKey:hn(),threadKey:jn(),layoutEpochKey:Ys.value}})(Y)),hl(),an("async-node")})(String(M),F)},markSettled(M){if(!Tt.value)return;const F=String(M),G=jv(M);(G!=null||(function(Y){return Ks.has(String(Y))})(F))&&(function(Y){var ee;const he=(ee=Ks.get(Y))!=null?ee:0;return!(he<=0||(he<=1?(Ks.delete(Y),Yo.delete(Y)):Ks.set(Y,he-1),hl(),he===1&&an("async-node"),0))})(F)&&G!=null&&hi()}};function g3(){let M=0;for(const F of Go.values())M+=Ye("getVisibleDomHeight.offsetHeight",()=>{var G;return(G=F?.offsetHeight)!=null?G:0});return Math.ceil(Math.max(0,M))}pn(kg,{reportHeight(M,F){Wh.reportHeight(M,F),pl?.reportHeight(M,F)},markPending(M){Wh.markPending(M),pl?.markPending(M)},markSettled(M){Wh.markSettled(M),pl?.markSettled(M)}});let Uh,qh=null,ml=null;function gu(M){return M!==!1&&M!=null&&M!==""}function Vv(){return wt.value?(function(){if(!wt.value)return!0;const M=Ge.value.length,F=ns(ts.start,0,M),G=ns(ts.end,F,M);if(F>=G)return!0;for(let Y=F;Y<G;Y++)if(!Be.has(Y)||up(Y)&&!Go.has(Y))return!1;return!0})():Ke.value>=cu.value}function jh(){return oe.value===!0&&!te.value&&Ah.value===0&&Hi.size===0&&di.size===0&&Gs==null&&Vv()}function Kv(){var M,F;if(((M=s.virtualScroll)==null?void 0:M.settleMode)!=="manual"||qh===hn()&&Uh===jn())return!0;const G=(F=s.virtualScroll)==null?void 0:F.settledToken;return!!gu(G)&&ml===Ba(G)}function zh(){return jh()&&Kv()}function v3(M,F){return F.totalNodes<=0?M==="final"?"final":"estimate":F.measuredCount>=F.totalNodes?M==="final"?"final":"measured":F.measuredCount>0||F.estimatedCount>0?"mixed":"estimate"}function Ir(M="manual",F){const G=Uv(),Y=(function(ee){return ee||(oe.value!==!0?Ge.value.length>0?"streaming":"estimating":!Vv()||di.size>0||Gs!=null?"measuring":zh()?"settled":"settling")})(F);return{sessionKey:hn(),threadKey:jn(),phase:Y,nodeCount:G.totalNodes,liveRange:{start:ts.start,end:ts.end},renderedCount:Ke.value,measuredCount:G.measuredCount,estimatedCount:G.estimatedCount,averageNodeHeight:G.averageNodeHeight,topSpacerHeight:G.topSpacerHeight,bottomSpacerHeight:G.bottomSpacerHeight,visibleDomHeight:g3(),totalHeight:Gv(),width:G.width,final:oe.value===!0,stable:zh(),confidence:v3(Y,G),reason:M}}function xa(){const M=Jt.value||fe(),F=x.value;if(!M||!F)return null;const G=M.ownerDocument||F.ownerDocument||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement,ee=Ye("getScrollBox.scrollTop",()=>Z(M,G,Y)),he=Ye("getScrollBox.scrollHeight",()=>{var ke,Oe,xe,Fe,Re;return Y?Math.max((Oe=(ke=G.documentElement)==null?void 0:ke.scrollHeight)!=null?Oe:0,(Fe=(xe=G.body)==null?void 0:xe.scrollHeight)!=null?Fe:0,(Re=M.scrollHeight)!=null?Re:0):M.scrollHeight}),ye=Ye("getScrollBox.clientHeight",()=>{var ke;return Y?((ke=G.documentElement)==null?void 0:ke.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:G,isViewportRoot:Y,scrollTop:ee,scrollHeight:he,clientHeight:ye}}function Gv(){const M=Ge.value.length,F=Math.max(0,Ui(0,M)),G=Ye("getRendererLogicalHeight.offsetHeight",()=>{var ee,he;return(he=(ee=x.value)==null?void 0:ee.offsetHeight)!=null?he:0}),Y=Math.max(0,G>0?G:Ye("getRendererLogicalHeight.scrollHeight",()=>{var ee,he;return(he=(ee=x.value)==null?void 0:ee.scrollHeight)!=null?he:0}));return M<=0?Math.ceil(G):wt.value?F>0?Math.max(1,Math.ceil(F),(function(){let ee=Rh.value+Dh.value;for(const he of Be.values())he&&(ee+=Math.max(0,Ye("getVirtualizedDomLogicalHeight.offsetHeight",()=>he.offsetHeight||0)));return Math.ceil(Math.max(0,ee))})(),(function(ee,he){return ee<=0||he<=0?0:he<=ee+Math.max(512,.05*ee)?Math.ceil(he):0})(F,Y)):Math.max(1,Math.ceil(Y)):Tt.value?F>0||go.count>0||Wv()>0?(it.value&&Ke.value,Math.max(1,Math.ceil(Y),Math.ceil(F))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(F))}function Yv(M){const F=x.value;if(!F)return null;const G=Ye("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>F.getBoundingClientRect());return(function(ee){return ee.isViewportRoot?ee.clientHeight:Ye("getViewportBottomInRoot.getBoundingClientRect",()=>ee.root.getBoundingClientRect().bottom)})(M)-G.bottom}function y3(M={}){const F=M.requireViewport!==!1,G=(function(he=64){const ye=xa(),ke=x.value;if(!ye||!ke)return!1;const Oe=(function(Fe){if(Fe.isViewportRoot)return{top:0,bottom:Fe.clientHeight};const Re=Ye("getVirtualViewportRect.getBoundingClientRect",()=>Fe.root.getBoundingClientRect());return{top:Re.top,bottom:Re.bottom}})(ye),xe=Ye("isRendererNearVirtualViewport.getBoundingClientRect",()=>ke.getBoundingClientRect());return xe.bottom>=Oe.top-he&&xe.top<=Oe.bottom+he})();if(F&&!G)return null;const Y=(function(){const he=xa(),ye=x.value;if(!he||!ye||Math.max(0,he.scrollHeight-he.scrollTop-he.clientHeight)>64)return null;const ke=Yv(he);return ke==null?null:ke>=-8&&ke<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,ke)}:null})();if(Y)return{anchor:Y,captured:!0};const ee=yv();if(ee)return{anchor:{type:"node",nodeIndex:ee.nodeIndex,offsetWithinNodePx:ee.offsetWithinNodePx},captured:G};if(M.allowFallback===!0){const he=(function(){const ye=Ge.value.length;return ye<=0?null:{type:"node",nodeIndex:ns(vo.value,0,Math.max(0,ye-1)),offsetWithinNodePx:0}})();return he?{anchor:he,captured:!1}:null}return null}function Vh(M){let F=2166136261;for(let G=0;G<M.length;G++)F^=M.charCodeAt(G),F=Math.imul(F,16777619);return(F>>>0).toString(36)}function k3(M,F){let G=M;for(let Y=0;Y<F.length;Y++)G^=F.charCodeAt(Y),G=Math.imul(G,16777619);return G^=31,G=Math.imul(G,16777619),G}const b3=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function vu(M,F=new WeakSet,G=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(Y){const ee=Y.length>8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${Vh(ee)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(F.has(M))return"cycle";if(G>=6)return"max-depth";F.add(M);try{if(Array.isArray(M)){if(M.length<=160){const xe=[];for(let Fe=0;Fe<M.length;Fe++)xe.push(vu(M[Fe],F,G+1));return`a:${M.length}:${xe.join(",")}`}const he=[],ye=[],ke=Math.max(0,M.length-32);let Oe=2166136261;for(let xe=0;xe<M.length;xe++){const Fe=vu(M[xe],F,G+1);Oe=k3(Oe,Fe),xe<32&&he.push(Fe),xe>=ke&&ye.push(Fe)}return[`a:${M.length}`,`h=${he.join(",")}`,`t=${ye.join(",")}`,`all=${(Oe>>>0).toString(36)}`].join(":")}const Y=M,ee=Object.keys(Y).filter(he=>{const ye=Y[he];return he!=="parent"&&he!=="el"&&he!=="component"&&(ye==null||typeof ye=="string"||typeof ye=="number"||typeof ye=="boolean"||b3.has(he))}).sort();return`o:${ee.length}:${ee.map(he=>`${he}=${vu(Y[he],F,G+1)}`).join(";")}`}finally{F.delete(M)}}let Xv=-1,Kh="";function Ta(M){const F=Ge.value[M];return F?Vh(vu(F)):""}function Gh(){const M=W.value;if(Xv===M)return Kh;let F=2166136261;for(let G=0;G<Ge.value.length;G++){const Y=Ta(G);for(let ee=0;ee<Y.length;ee++)F^=Y.charCodeAt(ee),F=Math.imul(F,16777619)}return Kh=(F>>>0).toString(36),Xv=M,Kh}function gl(M,F={}){var G;const Y=F.includeHeightCache===!0,ee=(G=F.includeContentHash)!=null?G:Y,he=Y?(function(ke){const Oe=(function(){var Ue,ut;const tt=Number((ut=(Ue=s.virtualScroll)==null?void 0:Ue.heightCacheLimit)!=null?ut:5e3);return!Number.isFinite(tt)||tt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(tt))})();if(!Number.isFinite(Oe)||ke.length<=Oe)return ke;const xe=new Map,Fe=Ue=>{!Ue||xe.size>=Oe||xe.set(Ue.index,Ue)},Re=Ge.value.length,Ae=ns(ts.start-2*wa.value,0,Re),De=ns(ts.end+2*wa.value,Ae,Re);for(const Ue of ke)Ue.index>=Ae&&Ue.index<De&&Fe(Ue);const qe=Math.max(1,Math.ceil(ke.length/Oe));for(let Ue=0;Ue<ke.length&&xe.size<Oe;Ue+=qe)Fe(ke[Ue]);for(let Ue=ke.length-1;Ue>=0&&xe.size<Oe;Ue-=qe)Fe(ke[Ue]);return Array.from(xe.values()).sort((Ue,ut)=>Ue.index-ut.index).slice(0,Oe)})(r3().map(ke=>{var Oe;const xe=Ge.value[ke.index];return xe?Et(st({},ke),{nodeType:String((Oe=xe.type)!=null?Oe:""),signature:Ta(ke.index)}):null}).filter(ke=>!!ke)):[],ye=y3({allowFallback:F.allowAnchorFallback===!0,requireViewport:F.requireViewport});return ye||he.length||F.includeEmptyState===!0?Et(st({sessionKey:M.sessionKey,threadKey:M.threadKey},ye?{anchor:ye.anchor,anchorCaptured:ye.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:ee?Gh():void 0,measurementKey:fi()||void 0,heightCache:he.length?he:void 0}):null}function Yh(M){var F,G;const Y=xa();if(!Y)return;const ee=(function(ke){const Oe=x.value;if(!Oe)return null;const xe=pe(Oe,ke.root),Fe=Ge.value.length,Re=Ye("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Oe.offsetHeight||0),Ae=Math.max(0,Re>0?Re:Fe>0?Ye("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Oe.scrollHeight||0):0),De=Gv();return xe+Math.max(Ae,De)})(Y);if(ee==null)return;const he=Math.max(0,M.distanceFromBottomPx),ye=Math.max(0,ee-Y.clientHeight-he);(function(ke){ui=$a()+120,Ro=ke})(ye),Y.isViewportRoot?(G=(F=Y.doc.defaultView)==null?void 0:F.scrollTo)==null||G.call(F,0,ye):C_(Y.root,Y.doc,ye,{isReverseFlexScrollRoot:K,getNormalizedScrollTop:Z})}const Xh=[];function Zv(){if(re)for(Vs!=null&&(vn?.(Vs),Vs=null);Xh.length;){const M=Xh.pop();M!=null&&window.clearTimeout(M)}}function vl(M){const F=!!qt.value;qt.value=null,ui=0,Ro=null,Zv(),F&&M&&an(M)}function yl(){if(!qt.value||!re||Vs!=null)return;const M=()=>{Vs=null;const F=qt.value;F&&Yh(F)};Vs=gn?gn(M):null,Vs==null&&M()}function Qv(M,F={}){const G=Ge.value.length;return G<=0?[]:M.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=G)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(F.requireSignature&&!Y.signature)&&!(F.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(ee){var he;const ye=Ge.value[ee.index];return!(!ye||ee.nodeType&&ee.nodeType!==String((he=ye.type)!=null?he:"")||ee.signature&&ee.signature!==Ta(ee.index))})(Y))}function Jv(M){const F=Ca(Er()),G=Ca(M);return F!==-1&&G!==-1&&F===G}function Zh(M){var F;const G=Number(M?.width);if(Number.isFinite(G)&&G>0)return G;const Y=Number((F=M?.metrics)==null?void 0:F.width);return Number.isFinite(Y)&&Y>0?Y:null}function e0(M){var F;return M.sessionKey===hn()&&!!Fh(M.threadKey)&&((F=M.measurementKey)!=null?F:"")===fi()&&!!Jv(Zh(M))&&!!(function(G){const Y=G.heightCache;return!!Y?.length&&(t0(G)?Y.some(ee=>!!(ee.nodeType||ee.signature)):Y.some(ee=>!!ee.signature))})(M)}function t0(M){return!!(M.contentHash&&M.contentHash===Gh())}function _3(M){return!t0(M)}let $r=null,Nr=null,yu=null,Ma=null,Aa=null;function Qh(M){var F;const G=M.map(ee=>{var he,ye;return[ee.index,Math.round(10*ee.height),(he=ee.nodeType)!=null?he:"",(ye=ee.signature)!=null?ye:""].join("")}).join(""),Y=Ca(Er());return[(F=jn())!=null?F:"",hn(),fi(),Ge.value.length,Y,M.length,Vh(G)].join(":")}function n0(M=(F=>(F=s.virtualScroll)==null?void 0:F.heightCache)()){if(!Tt.value||!M?.length||Ge.value.length<=0||!Jv((F=s.virtualScroll)==null?void 0:F.heightCacheWidth))return!1;var F;const G=Qv(M,{requireSignature:!0});if(!G.length)return!1;const Y=Qh(G);return Y===$r?(Nr="standalone",!0):(Sv(G,{mode:"merge"}),yo(),$r=Y,Nr="standalone",La(),an("restore"),!0)}function Jh(M,F={}){var G,Y,ee;if(!Tt.value||!M||M.sessionKey!==hn()||!Fh(M.threadKey)||Ge.value.length<=0)return!1;const he=!!((G=M.heightCache)!=null&&G.length)&&!ku(),ye=!M.anchor||M.anchorCaptured===!1&&F.allowUncapturedAnchor!==!0?null:M.anchor,ke=F.restoreAnchor===!0&&!!ye&&!ku()&&Number(Zh(M))>0;let Oe=!1;if((Y=M.heightCache)!=null&&Y.length&&e0(M)){const Fe=Qv(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:_3(M)});Fe.length&&(Sv(Fe,{mode:"merge"}),yo(),$r=Qh(Fe),Nr="restore",La(),Oe=!0)}if(he||ke)return!1;if(!F.restoreAnchor||!ye)return Oe&&an("restore"),!0;const xe=(function(Fe,Re){var Ae;const De=Fe.anchor,qe=De?De.type==="bottom"?`bottom:${Math.round(De.distanceFromBottomPx)}`:`node:${De.nodeIndex}:${Math.round(De.offsetWithinNodePx)}`:"none";return[(Ae=jn())!=null?Ae:"",hn(),fi(),mu.value,Re,qe].join(":")})(M,(ee=F.restoreToken)!=null?ee:"imperative");return yu===xe?(Oe&&an("restore"),!0):(yu=xe,(function(Fe){const Re=()=>{if(Fe.type==="node")return vl(),void kv({nodeIndex:Fe.nodeIndex,offsetWithinNodePx:Fe.offsetWithinNodePx});if(ou(),Do.value=null,qt.value=Fe,Zv(),Yh(Fe),re)for(const Ae of[0,120,280,480])Xh.push(window.setTimeout(()=>{const De=qt.value;De&&Yh(De)},Ae))};(function(Ae){if(!wt.value)return!1;const De=Ge.value.length;return!(De<=0||(vo.value=Ae.type==="node"?ns(Ae.nodeIndex,0,De-1):De-1,Tr(),0))})(Fe)?gt(Re):Re()})(ye),an("restore"),!0)}function ku(){const M=Er();return Number.isFinite(M)&&M>0}function s0(M){var F;return M.sessionKey===hn()&&!!Fh(M.threadKey)&&(Ge.value.length<=0||!(!((F=M.heightCache)!=null&&F.length)||ku())||!(!(M.anchor&&Number(Zh(M))>0)||ku()))}function ep(){Qt.clear();for(const M of Object.keys(mo)){const F=Number(M);Number.isInteger(F)&&F>=0&&F<Ge.value.length&&bv(F)}}function Ea(){Gs!=null&&(vn?.(Gs),Gs=null),dp()}function o0(){return!re||ve?Promise.resolve():new Promise(M=>{let F=!1,G=null;const Y=()=>{F||(F=!0,G!=null&&window.clearTimeout(G),M())};if(gn)return gn(Y),void(G=window.setTimeout(Y,50));G=window.setTimeout(Y,0)})}function tp(M,F=jn(),G=Ys.value){return hn()===M&&jn()===F&&Ys.value===G}function np(){return yn(this,arguments,function*(M={}){var F,G,Y,ee,he;const ye=hn(),ke=jn(),Oe=Ys.value,xe=(F=M.frames)!=null?F:2,Fe=(G=M.timeoutMs)!=null?G:120,Re=(Y=M.reason)!=null?Y:"manual",Ae=M.expectedSettledTokenKey,De=M.flushPendingTimers===!0,qe=Ir(Re),Ue=()=>Et(st({},qe),{phase:qe.final?"settling":qe.phase,stable:!1,confidence:qe.confidence==="final"?"mixed":qe.confidence,reason:Re}),ut=()=>tp(ye,ke,Oe)&&(Ae==null||Na()===Ae);for(let pt=0;pt<xe;pt++){if(yield gt(),!ut()||(yield o0(),!ut()))return Ue();hi(),Ea()}if(yield(function(pt){return!re||pt<=0?Promise.resolve():new Promise(yt=>window.setTimeout(yt,pt))})(Fe),!ut()||(De&&Nv(),hi(),Ea(),!ut()))return Ue();const tt=jh();tt&&(qh=ye,Uh=ke,((ee=s.virtualScroll)==null?void 0:ee.settleMode)==="manual"&&Ae!=null&&gu((he=s.virtualScroll)==null?void 0:he.settledToken)&&Na()===Ae&&(ml=Ba(s.virtualScroll.settledToken)));const et=ut()&&tt&&Kv(),ht=Ir(Re,et?"final":void 0);return lp(ht,!0),ht})}let sp="content",Lr=null,Or=null,op=0,Ia=null,kl=null,ip=null,rp=null;function $a(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function i0(M){var F,G;const Y=Ia;if(!Y)return!0;const ee=(G=(F=s.virtualScroll)==null?void 0:F.heightDiffThresholdPx)!=null?G:1;return Math.abs(M.totalHeight-Y.totalHeight)>ee||M.sessionKey!==Y.sessionKey||M.phase!==Y.phase||M.stable!==Y.stable||M.final!==Y.final||M.threadKey!==Y.threadKey||M.nodeCount!==Y.nodeCount||M.measuredCount!==Y.measuredCount||M.width!==Y.width}function Yn(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function Na(M=(F=>(F=s.virtualScroll)==null?void 0:F.settledToken)()){return Yn(M)}function r0(M,F){var G,Y;return[M,F.sessionKey,(G=F.threadKey)!=null?G:"",fi(),Gh(),Yn((Y=s.virtualScroll)==null?void 0:Y.settledToken),Math.round(F.totalHeight),Math.round(F.width)].join("\0")}function La(){ip=null,rp=null,kl=null}function w3(M){const F=M.heightCache;return F?.length?Qh(F):""}function Oa(M){var F,G,Y;const ee=M.metrics,he=M.anchor?(ye=M.anchor).type==="bottom"?`bottom:${Math.round(ye.distanceFromBottomPx)}`:`node:${ye.nodeIndex}:${Math.round(ye.offsetWithinNodePx)}`:"none";var ye;return[M.sessionKey,(F=M.threadKey)!=null?F:"",(G=M.measurementKey)!=null?G:fi(),(Y=M.contentHash)!=null?Y:"",w3(M),he,M.anchorCaptured?1:0,ee.liveRange.start,ee.liveRange.end,ee.renderedCount,ee.nodeCount,Math.round(ee.totalHeight),Math.round(ee.width),ee.phase,ee.stable?1:0].join("\0")}function lp(M,F=!1){if(!Tt.value||(function(ye=!1){return!ye&&on.value&&!$n.value})(F))return;const G=F||i0(M),Y=(function(ye,ke=!1){return ke||ye.stable||ye.phase==="final"?{state:gl(ye,{includeHeightCache:!0})}:{state:gl(ye)}})(M,F),ee=Y.state,he=!!(ee&&(G||(function(ye,ke=!1){return!!ke||Oa(ye)!==kl})(ee,F)));if(G&&($(M),Ia=M,op=$a()),ee&&he&&(A(ee),ee.anchor&&w(ee.anchor),kl=Oa(ee)),M.stable){const ye=r0("settled",M);if(ye!==ip){ip=ye;const ke=gl(M,{includeHeightCache:!0});ke&&(A(ke),kl=Oa(ke)),(function(Oe){o("render-settled",Oe)})(M)}}if(M.phase==="final"){const ye=r0("final",M);if(ye!==rp){rp=ye;const ke=gl(M,{includeHeightCache:!0});ke&&(A(ke),kl=Oa(ke)),(function(Oe){o("render-final",Oe)})(M)}}}function ap(){Lr!=null&&(vn?.(Lr),Lr=null),Or!=null&&re&&(window.clearTimeout(Or),Or=null)}function l0(){Lr=null,Or=null,(function(M){if(di.size>0||Gs!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(sp)&&(hi(),Ea()),lp(Ir(sp))}function an(M){var F,G;if(!Tt.value||(sp=M,Lr!=null||Or!=null))return;const Y=Math.max(0,(G=(F=s.virtualScroll)==null?void 0:F.emitIntervalMs)!=null?G:32),ee=Math.max(0,Y-($a()-op)),he=()=>{Or=null,Lr=gn?gn(l0):null,Lr==null&&l0()};re&&ee>0?Or=window.setTimeout(he,ee):he()}function cp(M){var F;if(M<=0)return 0;const G=Ge.value;if(Gt.value)return Hv(M);if(_a.value===G.length&&xh.value.length&&Th.value.length){const ee=Ko.value,he=xh.value,ye=Th.value,ke=Re=>Re<=0?0:ru(he,0,Re)+(Re-ru(ye,0,Re))*ee;let Oe=0,xe=G.length-1,Fe=G.length-1;for(;Oe<=xe;){const Re=Oe+xe>>1;ke(Re+1)>=M?(Fe=Re,xe=Re-1):Oe=Re+1}return Fe}let Y=M;for(let ee=0;ee<G.length;ee++){const he=(F=mo[ee])!=null?F:Ko.value;if(Y<=he)return ee;Y-=he}return Math.max(0,G.length-1)}function a0(){po.value+=1}function up(M){return!(it.value&&M>=Ke.value)&&(!Bi.value||M<Ee.value||$h.value.has(M))}function bl(M){const F=fu.get(M);F&&(F(),fu.delete(M));const G=dl.get(M);G&&(G.destroy(),dl.delete(M)),hu(M)}function c0(M,F){let G=!1;if(F){const he=Be.get(M);Be.set(M,F),he!==F&&(G=!0)}else Be.delete(M)&&(G=!0);if(G&&a0(),F||hu(M),!Cv.value||!Ns||!wt.value&&Bi.value&&!B.value&&dl.size>=640&&(B.value||(B.value=!0,Nh()),!Cv.value||!Ns))return bl(M),void(F&&Wi(M,!0));if(M<Ee.value&&!wt.value||$h.value.has(M))return bl(M),void Wi(M,!0);if(!F)return void bl(M);bl(M);const Y=Ns(F,{rootMargin:"400px"});if(!Y)return;dl.set(M,Y),Wi(M,Y.isVisible.value),Bi.value&&(function(he){if(!re||!Bi.value)return;hu(he);const ye=he%17*23,ke=window.setTimeout(()=>{if(Lv.delete(he),!Bi.value||$h.value.has(he))return;const Oe=Be.get(he);if(!Oe)return;const xe=fe(Oe),Fe=Oe.ownerDocument||document,Re=Fe.defaultView||window,Ae=!xe||xe===Fe.documentElement||xe===Fe.body,De=!Ae&&xe?Ye("nodeVisibilityFallback.root.getBoundingClientRect",()=>xe.getBoundingClientRect()):null,qe=Ae?0:De.top,Ue=Ae?Ye("nodeVisibilityFallback.clientHeight",()=>{var tt,et;return(et=(tt=Re.innerHeight)!=null?tt:xe?.clientHeight)!=null?et:0}):De.bottom,ut=Ye("nodeVisibilityFallback.node.getBoundingClientRect",()=>Oe.getBoundingClientRect());ut.bottom>=qe-500&&ut.top<=Ue+500&&Wi(he,!0)},1800+ye);Lv.set(he,ke)})(M);let ee=null;ee=Ve(()=>Y.isVisible.value,he=>{if(he){hu(M),Wi(M,!0),ee?.(),fu.delete(M),dl.get(M)===Y&&dl.delete(M);try{Y.destroy()}catch{}}},{immediate:!0}),fu.set(M,ee),wt.value&&Xo()}function dp(){Gs=null;for(const[M,F]of di)di.delete(M),Go.get(M)===F.el&&Mr.get(M)===F.version&&_v(M,F.height,{allowShrink:F.allowShrink})}function _l(){Gs!=null&&(vn?.(Gs),Gs=null),di.clear()}function bu(M,F){(function(G,Y,ee){var he;if(!Number.isFinite(ee)||ee<=0||Go.get(G)!==Y)return;const ye=Mr.get(G);if(ye==null)return;const ke=Ge.value[G],Oe=te.value&&oe.value!==!0&&!((he=s.nodes)!=null&&he.length)&&G>=Ge.value.length-2,xe=!(ke?.loading===!0||Oe),Fe=di.get(G),Re=Fe?Fe.allowShrink&&xe:xe,Ae=Fe&&!Re?Math.max(Fe.height,ee):ee;di.set(G,{height:Ae,allowShrink:Re,version:ye,el:Y}),Gs==null&&(Gs=gn?gn(dp):null,Gs==null&&dp())})(M,F,wv(M,F))}function hi(){for(const[M,F]of Go)F&&bu(M,F)}function u0(){At?.disconnect(),At=null,nt.clear()}function fp(){for(;au.length;)du(au.pop())}Ve($n,M=>{M&&an("content")},{flush:"post"}),t({getVirtualMetrics:Ir,captureVirtualState:function(M={}){var F;return gl(Ir("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(F=M.includeEmptyState)==null||F})},restoreVirtualState:function(M,F={}){const G=F.restoreAnchor===!0,Y=F.restoreToken==null?"imperative":String(F.restoreToken);Ma=M,Aa={restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:F.allowUncapturedAnchor===!0},!Jh(M,{restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:F.allowUncapturedAnchor===!0})&&s0(M)||(Ma=null,Aa=null)},forceMeasure:function(M="manual"){return yn(this,null,function*(){yield gt(),yield o0(),hi(),Ea(),yield gt();const F=Ir(M);return lp(F,!0),F})},settle:np,scrollToNode:function(M,F="start"){vl(),ou();const G=Ge.value.length;if(G<=0)return;const Y=ns(M,0,G-1),ee=()=>{var he;const ye=e3({nodeIndex:Y,offsetWithinNodePx:0}),ke=pu(Y),Oe=xa(),xe=(he=Oe?.clientHeight)!=null?he:0,Fe=ul();let Re=ye;if(F==="center")Re=ye-xe/2+ke/2;else if(F==="end")Re=ye-xe+ke;else if(F==="nearest"&&Fe!=null){if(ye>=Fe&&ye+ke<=Fe+xe)return;Re=ye<Fe?ye:ye-xe+ke}Ch(Math.max(0,Re)),Xo({immediate:!0}),wt.value&&(vo.value=Y,Tr())};if(wt.value)return vo.value=Y,Tr(),void gt(ee);ee()}}),Ve(()=>ho.value,M=>{if(!M){u0();for(const F of Fi.values())for(const G of F)du(G);Fi.clear(),Mr.clear(),fp(),_l()}},{immediate:!0}),Ve(oe,M=>{M&&(function(){if(re&&oe.value&&Go.size){fp();for(const F of[80,240,640]){const G=$v(F,()=>{for(const[Y,ee]of Go)ee&&bu(Y,ee)},"final");G!=null&&au.push(G)}}})(),an(M?"final":"content")}),Ve([()=>Ge.value.length,()=>Ke.value],()=>{qt.value&&yl(),an("content")},{flush:"post",immediate:!0}),Ve([()=>ts.start,()=>ts.end],()=>{an("batch")},{flush:"post"});const{cleanupBatchScheduler:S3}=(function(M){const{props:F,isClient:G,isTestEnv:Y,parsedNodesIdentity:ee,parsedNodeCount:he,desiredRenderedCount:ye,datasetKey:ke,batchingEnabled:Oe,incrementalRenderingActive:xe,resolvedBatchSize:Fe,resolvedInitialBatch:Re,renderedCount:Ae,adaptiveBatchSize:De,previousRenderContext:qe,previousBatchConfig:Ue,requestFrame:ut,cancelFrame:tt,hasIdleCallback:et,cleanupNodeVisibility:ht,onDatasetKeyChanged:pt,onDatasetChanged:yt}=M;let ft=null,St=null,Ct=!1,Ft=null,_s=null,ws=0,Bo=!1,qi=!1;const ji=new Set,Rr=new Set;function S0(){if(G){ft!=null&&(tt?.(ft),ft=null),St!=null&&(window.clearTimeout(St),St=null),_s!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(_s),_s=null),ws+=1;for(const cs of ji)tt?.(cs);ji.clear();for(const cs of Rr)window.clearTimeout(cs);Rr.clear(),Ct=!1,Ft=null,Bo=!1,qi=!1}}function Mu(){return typeof performance<"u"?performance.now():Date.now()}function C0(cs){(function(pi){var zi;if(!xe.value)return;const mi=Math.max(2,(zi=F.renderBatchBudgetMs)!=null?zi:6),gi=Math.max(1,Fe.value||1),Fo=Math.max(1,Math.floor(gi/4));pi>1.2*mi?De.value=Math.max(Fo,Math.floor(.7*De.value)):pi<.5*mi&&De.value<gi&&(De.value=Math.min(gi,Math.ceil(1.2*De.value)))})(cs),Bo=!1;const Ls=qi||Ae.value<ye.value;qi=!1,Ls&&M0()}function x0(cs,Ls={}){var pi,zi;if(!xe.value)return;const mi=ye.value;if(Ae.value>=mi)return;const gi=Math.max(1,cs),Fo=()=>{const Cl=Mu();let xl=0;ft=null,St=null,_s=null,Ct=!1;const Tl=Ft??gi;Ft=null;const kp=Mu();Ae.value=Math.min(mi,Ae.value+Tl),ht(Ae.value),xl=Mu()-kp,(function(bp,A0){if(!G)return void C0(A0);Bo=!0;const E0=++ws;gt().then(()=>{var I0;if(E0!==ws)return;const q3=Mu(),j3=Math.max(A0,q3-bp),$0=()=>{E0===ws&&C0(j3)};if(ut){let L0=!1,vi=null;const O0=()=>{L0||(L0=!0,$0())},Au=ut(()=>{ji.delete(Au),vi!=null&&(window.clearTimeout(vi),Rr.delete(vi),vi=null),O0()});return ji.add(Au),vi=window.setTimeout(()=>{vi!=null&&Rr.delete(vi),vi=null,tt?.(Au),ji.delete(Au),O0()},Math.max(32,(I0=F.renderBatchIdleTimeoutMs)!=null?I0:120)),void Rr.add(vi)}const N0=window.setTimeout(()=>{Rr.delete(N0),$0()},0);Rr.add(N0)})})(Cl,xl)};if(!G||Ls.immediate)return void Fo();const Vi=Math.max(0,(pi=F.renderBatchDelay)!=null?pi:16);if(Ft=Ft!=null?Math.max(Ft,gi):gi,!Ct){if(Ct=!0,!Y&&et&&window.requestIdleCallback){const Cl=Math.max(0,(zi=F.renderBatchIdleTimeoutMs)!=null?zi:120);return void(_s=window.requestIdleCallback(()=>Fo(),{timeout:Cl}))}ut&&!Y?ft=ut(()=>{Vi!==0?St=window.setTimeout(()=>Fo(),Vi):Fo()}):St=window.setTimeout(()=>Fo(),Vi)}}function T0(cs,Ls={}){Bo?qi=!0:cs==null?M0():x0(cs,Ls)}function M0(){xe.value&&x0(Oe.value?Math.max(1,Math.round(De.value)):Math.max(1,Fe.value))}return Ve([ee,he,ke,xe,Fe,Re,()=>F.renderBatchDelay],()=>{var cs;const Ls=he.value,pi=qe.value,zi=ke.value,mi=!Object.is(zi,pi.key),gi=Ls!==pi.total,Fo=mi||gi;qe.value={key:zi,total:Ls};const Vi=Ue.value,Cl=(cs=F.renderBatchDelay)!=null?cs:16,xl=Vi.batchSize!==Fe.value||Vi.initial!==Re.value||Vi.delay!==Cl||Vi.enabled!==xe.value;Ue.value={batchSize:Fe.value,initial:Re.value,delay:Cl,enabled:xe.value},mi&&pt(Ls),(Fo||xl||!xe.value)&&S0(),(Fo||xl)&&(De.value=Math.max(1,Fe.value||1)),Fo&&yt();const Tl=ye.value;if(!Ls)return Ae.value=0,void ht(0);if(!xe.value)return Ae.value=Tl,void ht(Ae.value);const kp=mi||pi.total===0;Ae.value=kp||xl?Math.min(Tl,Re.value):Math.min(Ae.value,Tl);const bp=Math.max(1,Re.value||Fe.value||Ls);Ae.value<Tl?T0(bp,{immediate:!G}):ht(Ae.value)},{immediate:!0}),Ve(ye,(cs,Ls)=>{xe.value&&(typeof Ls=="number"&&cs<=Ls||cs>Ae.value&&T0())}),{cleanupBatchScheduler:S0}})({props:k,isClient:re,isTestEnv:ve,parsedNodesIdentity:Gn,parsedNodeCount:_n,desiredRenderedCount:cu,datasetKey:m3,batchingEnabled:He,incrementalRenderingActive:it,resolvedBatchSize:ne,resolvedInitialBatch:Ee,renderedCount:Ke,adaptiveBatchSize:Q,previousRenderContext:H,previousBatchConfig:Ce,requestFrame:gn,cancelFrame:vn,hasIdleCallback:Ie,cleanupNodeVisibility:c3,onDatasetKeyChanged:M=>{_l(),lu(),yo(),La(),M>0&&iu(M)},onDatasetChanged:()=>{wt.value&&Xo({immediate:!0})}});Ve([xv,wt,()=>x.value,()=>ie()],([M,F])=>{if(!M)return Ov(),void Ih();u3(),F?Xo({immediate:!0}):Ih()},{flush:"post",immediate:!0}),Ve([()=>Ge.value.length,()=>wt.value],M=>yn(null,[M],function*([F,G]){G&&F&&re&&(yield gt(),Xo({immediate:!0}))}),{flush:"post"}),Ve(Gt,M=>{M&&(function(){var F;if(In.value&&On.value&&as.value&&((F=ks.value)!=null&&F[1]))return;const G=rr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=rr({type:"list_item",children:[G],raw:"- Probe paragraph text"}),ee=rr({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});In.value=G,On.value=Y,as.value=ee;const he={1:null,2:null,3:null,4:null,5:null,6:null};for(let ye=1;ye<=6;ye++)he[ye]=rr({type:"heading",level:ye,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ye)} Probe heading`});ks.value=he})()},{immediate:!0}),Ve([()=>x.value,Gt],()=>{if(!Gt.value)return Oh(),void(V.value=0);Rv(),Oh(),Gt.value&&x.value&&typeof ResizeObserver<"u"&&(Sa=new ResizeObserver(()=>{Rv(),Do.value&&ba(),qt.value&&yl(),an("resize")}),Sa.observe(x.value))},{immediate:!0}),Ve([Gt,uo,Ys],()=>yn(null,null,function*(){if(!Gt.value)return z.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void yo();yield gt(),(function(){if(!Gt.value||typeof window>"u")return z.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void yo();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},F=Pv(Lh(I.value),".paragraph-node");M.paragraph=vm(I.value,F,"pre-wrap");const G=Lh(L.value),Y=G?.querySelector(".paragraph-node");M.listItem=vm(L.value,Y,"pre-wrap");const ee=Ye("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ye,ke;return(ke=(ye=O.value)==null?void 0:ye.offsetHeight)!=null?ke:0}),he=Ye("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ye,ke;return(ke=(ye=L.value)==null?void 0:ye.offsetHeight)!=null?ke:0});M.listWrapperOverhead=Math.max(0,ee-he);for(let ye=1;ye<=6;ye++){const ke=Pv(Lh(P[ye]),`h${ye}`);M.headings[ye]=vm(P[ye],ke,"pre-wrap")}z.value=M,yo()})()}),{flush:"post",immediate:!0}),Ve(()=>Ge.value.length,()=>{wt.value&&Xo({immediate:!0})}),Ve([Gt,V],()=>{yo(),wt.value&&Xo({immediate:!0}),Do.value&&ba(),qt.value&&yl(),an("resize")},{immediate:!1}),Ve(()=>Bi.value,M=>{if(M)for(const[F,G]of Be)c0(F,G);else{Nh();for(const[F,G]of Be)G&&Wi(F,!0)}},{immediate:!1}),Ve([()=>s.viewportPriority,()=>Ge.value.length],([M,F])=>{M!==!1?B.value&&F<=200&&(B.value=!1):B.value=!1}),Ve(()=>Ke.value,()=>{wt.value&&Xo({immediate:!0})}),Ve([vo,fo,wa,()=>Ge.value.length,wt],()=>{Tr()},{immediate:!0});let Pa=null,Ra=!1,wl=null;function Da(){Pa=null,qh=null,Uh=void 0,ml=null,La()}function hp(){_l(),lu(),yo(),Qt.clear();const M=Ge.value.length;M>0&&iu(M),ep()}function pp(){ap(),Nv(),Ia=null,$r=null,Nr=null,yu=null,Ma=null,Aa=null,Ra=!1,Da(),zv("restore"),ou(),vl()}function Ba(M){var F;return[(F=jn())!=null?F:"",hn(),fi(),mu.value,Na(M),Ge.value.length,Math.round(Ui(0,Ge.value.length)),Math.round(Er()),go.count,Math.round(go.total)].join(":")}function d0(){return yn(this,null,function*(){var M,F,G,Y;const ee=(M=s.virtualScroll)==null?void 0:M.settledToken,he=Na(ee),ye=hn(),ke=jn(),Oe=Ys.value;if(Tt.value&&((F=s.virtualScroll)==null?void 0:F.settleMode)==="manual"&&gu(ee))if(jh()){if(Ba(ee)!==ml&&!Ra){Ra=!0;try{const xe=yield np({reason:"manual",expectedSettledTokenKey:he}),Fe=Na()===he;tp(ye,ke,Oe)&&xe.sessionKey===ye&&xe.threadKey===ke&&Fe&&xe.stable&&xe.phase==="final"&&(ml=Ba((G=s.virtualScroll)==null?void 0:G.settledToken))}finally{Ra=!1,yield gt();const xe=(Y=s.virtualScroll)==null?void 0:Y.settledToken,Fe=gu(xe)?Ba(xe):"";tp(ye,ke,Oe)&&Fe&&ml!==Fe&&d0()}}}else an("manual")})}Ve(Tt,(M,F)=>{if(M!==F){if(!M)return pp(),void ap();pp(),hp(),wl=Ys.value,an("content")}},{flush:"post"}),Ve([Tt,Ys],([M,F])=>{M?wl!=null?wl!==F&&(wl=F,(function(G="resize"){_l(),lu(),yo(),Qt.clear();const Y=Ge.value.length;Y>0&&iu(Y),ep(),$r=null,Nr=null,yu=null,Ia=null,Ra=!1,Da(),n0(),gt(()=>{hi(),Do.value&&ba(),qt.value&&yl(),an(G)})})("resize")):wl=F:wl=null},{flush:"post",immediate:!0}),Ve([Tt,()=>hn(),()=>jn()],([M])=>{M&&(pp(),hp(),zv("content"),an("content"))}),Ve([Tt,()=>hn(),()=>jn(),Ys,()=>Ge.value.length],([M])=>{M&&(function(F="async-node"){let G=!1;for(const[Y,ee]of Array.from(Yo.entries()))Hh(ee)||(Yo.delete(Y),Ks.delete(Y),G=!0);G&&(hl(),an(F))})("async-node")},{flush:"post"}),Ve([Tt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>s.indexKey,()=>W.value],([M])=>{M&&(La(),(function(F="content"){if(!Tt.value)return;const G=[],Y=Ge.value.length;for(const ee of Array.from(Qt.keys())){if(ee>=Y){G.push(ee);continue}const he=Ta(ee),ye=Qt.get(ee);ye!=null&&ye!==he&&G.push(ee),Qt.set(ee,he)}for(const ee of Array.from(Qt.keys()))ee>=Y&&Qt.delete(ee);G.length&&((function(ee,he={}){const ye=Array.from(ee,Number);i3(ye,he)>0&&(function(Oe){for(const xe of Oe)Qt.delete(xe)})(ye)})(G,{notify:!1}),yo(),Da(),Do.value&&ba(),qt.value&&yl(),an(F))})("content"))},{flush:"post",immediate:!0}),Ve([Tt,()=>Ge.value.length,()=>hn(),()=>jn()],([M,F,G,Y],[ee,he,ye,ke])=>{M&&ee&&G===ye&&Y===ke&&F!==he&&Da()},{flush:"post"}),Ve([Tt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>Ge.value.length,()=>hn(),V],()=>{n0()},{flush:"post",immediate:!0}),Ve([Tt,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>Ge.value.length,()=>hn(),V],M=>yn(null,[M],function*([F,G]){if(!F||!G)return;yield gt();const Y=(function(){var ee;const he=(ee=s.virtualScroll)==null?void 0:ee.restoreAnchor;return he==null||he===!1?null:he===!0?"true":String(he)})();Jh(G,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),Ve([Tt,V,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var F;if(!M)return;const G=(F=s.virtualScroll)==null?void 0:F.restoreState;G&&$r&&Nr==="restore"&&(e0(G)||(hp(),$r=null,Nr=null,an("resize")))},{flush:"post"}),Ve([Tt,()=>Ge.value.length,()=>hn(),V],M=>yn(null,[M],function*([F]){var G;const Y=Ma,ee=Aa;F&&Y&&(yield gt(),!Jh(Y,{restoreAnchor:ee?.restoreAnchor===!0,restoreToken:(G=ee?.restoreToken)!=null?G:"imperative",allowUncapturedAnchor:ee?.allowUncapturedAnchor===!0})&&s0(Y)||(Ma=null,Aa=null))}),{flush:"post",immediate:!0}),Ve([Tt,oe,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>hn(),()=>jn(),Ys,Ah,Mv,()=>Ke.value,cu,()=>go.count,()=>go.total],([M,F,G])=>{if(!M||F!==!0||G==="manual"||!zh())return;const Y=(function(){var ee;const he=Ge.value.length;return[(ee=jn())!=null?ee:"",hn(),fi(),mu.value,he,Math.round(Ui(0,he)),Math.round(Er()),go.count,Math.round(go.total)].join(":")})();Pa!==Y&&(Pa=Y,np({reason:"final"}).then(ee=>{ee.stable||Pa!==Y||(Pa=null)}))},{flush:"post",immediate:!0}),Ve([Tt,oe,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settledToken},()=>hn(),()=>jn(),Ys,Ah,Mv,()=>Ke.value,cu,()=>Ge.value.length,()=>go.count,()=>go.total],()=>{d0()},{flush:"post",immediate:!0}),Ve([()=>Ge.value.length,wt,fo,wa,()=>ts.start,()=>ts.end],([M,F,G,Y,ee,he])=>{Pe.value&&ge("virtualization",{nodes:M,virtualization:F,maxLiveNodes:G,buffer:Y,focusIndex:vo.value,scroll:F?(()=>{const ye=Jt.value||fe();return ye?{reverse:K(ye),scrollTop:Math.round(ye.scrollTop),scrollTopAbs:Math.round(Math.abs(ye.scrollTop)),scrollHeight:Math.round(ye.scrollHeight),clientHeight:Math.round(ye.clientHeight)}:null})():null,liveRange:{start:ee,end:he},rendered:Ke.value})}),Ve([()=>s.customId],([M],F,G)=>{if(!M||bs)return;const Y=(function(ee,he){return ee?(zn.controllers[ee]=he,()=>{zn.controllers[ee]===he&&delete zn.controllers[ee]}):()=>{}})(M,{captureRestoreAnchor:yv,restoreAnchor:kv,getAnchorDrift:t3,getReport:f3});G(()=>{Y()})},{immediate:!0}),lo(()=>{(function(){if(Tt.value)try{hi(),Ea();const M=Ir("manual");i0(M)&&($(M),Ia=M,op=$a());const F=gl(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});F&&(A(F),F.anchor&&w(F.anchor),kl=Oa(F))}catch{}})(),S3(),Nh(),J(),u0();for(const M of Fi.values())for(const F of M)du(F);Fi.clear(),Mr.clear(),Qt.clear(),fp(),_l(),Oh(),ou(),vl(),ap(),Ov(),Ih()});const C3=ii({loader:()=>yn(null,null,function*(){try{return(yield Js(()=>import("./index11-jpw4aORI.js"),__vite__mapDeps([6,3]))).default}catch(M){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".',M),xo}}),loadingComponent:aH,delay:0}),x3=ii({loader:()=>yn(null,null,function*(){try{return(yield Js(()=>import("./index10-9hz8xOXN.js"),[])).default}catch(M){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.',M),xo}}),loadingComponent:lH,delay:0}),T3=ii(()=>yn(null,null,function*(){try{return(yield Js(()=>import("./index7-CoWnZiYw.js"),[])).default}catch(M){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".',M),xo}})),f0={text:Mn,paragraph:nl,heading:vf,code_block:cm,list:ia,list_item:oa,blockquote:kd,table:wc,definition_list:bd,footnote:_d,footnote_reference:so,footnote_anchor:bc,admonition:xd,vmr_container:Sd,hardbreak:hr,link:Es,image:fr,thematic_break:wd,math_inline:Vo,math_block:Px,strong:Ms,emphasis:Is,strikethrough:As,highlight:io,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,checkbox:no,checkbox_input:no,inline_code:vs,html_inline:oo,reference:Ts,html_block:_c},M3=j(()=>Bh()),h0=j(()=>st(st({stream:k.codeBlockStream,darkTheme:s.codeBlockDarkTheme,lightTheme:s.codeBlockLightTheme,monacoOptions:s.codeBlockMonacoOptions,themes:s.themes,minWidth:s.codeBlockMinWidth,maxWidth:s.codeBlockMaxWidth},typeof We.value=="boolean"?{showTooltips:We.value}:{}),s.codeBlockProps||{}));function p0(M){return typeof M=="boolean"?M:void 0}const A3=j(()=>{const M=s.codeBlockProps||{},F={},G=p0(M.showLineNumbers);G!==void 0&&(F.showLineNumbers=G);const Y=p0(M.diffInline);Y!==void 0&&(F.diffInline=Y);const ee=(function(he){const ye=Number(he);return Number.isFinite(ye)&&ye>0?ye:void 0})(M.reservedHeightPx);return ee!==void 0&&(F.reservedHeightPx=ee),F}),E3=j(()=>{const M=s.codeBlockProps||{};return st(st({stream:k.codeBlockStream,darkTheme:s.codeBlockDarkTheme,lightTheme:s.codeBlockLightTheme,themes:s.themes,minWidth:s.codeBlockMinWidth,maxWidth:s.codeBlockMaxWidth},typeof We.value=="boolean"?{showTooltips:We.value}:{}),M)}),I3=j(()=>st({},s.mermaidProps||{})),$3=j(()=>st({},s.d2Props||{})),N3=j(()=>st({},s.infographicProps||{})),Fa=j(()=>({typewriter:s.typewriter,fade:k.fade,customHtmlTags:un.value.customHtmlTags})),L3=j(()=>st(st({},Fa.value),typeof We.value=="boolean"?{showTooltip:We.value}:{})),O3=j(()=>st(st({},Fa.value),typeof We.value=="boolean"?{showTooltips:We.value}:{})),P3=j(()=>st(st({},Fa.value),typeof We.value=="boolean"?{showTooltips:We.value}:{})),R3=j(()=>st(st({},Fa.value),typeof We.value=="boolean"?{showTooltips:We.value}:{}));function D3(M){return Array.isArray(M.children)&&M.children.length>0}const mp=j(()=>d3.value.map(M=>{var F,G,Y,ee,he,ye,ke,Oe;let xe=(function(tt){var et,ht,pt,yt,ft,St,Ct;if(tt.type!=="code_block")return tt;const Ft=tt,_s=[String((et=Ft.language)!=null?et:""),String((ht=Ft.loading)!=null?ht:""),String((pt=Ft.diff)!=null?pt:""),String((yt=Ft.code)!=null?yt:""),String((ft=Ft.originalCode)!=null?ft:""),String((St=Ft.updatedCode)!=null?St:""),String((Ct=Ft.raw)!=null?Ct:"")].join("\0"),ws=qn.get(Ft);if(ws&&ws.signature===_s)return ws.node;const Bo=st({},Ft);return qn.set(Ft,{signature:_s,node:Bo}),Bo})(M.node);const Fe=_u(xe);let Re=g0(xe,Fe);if((xe.type==="html_block"||xe.type==="html_inline")&&Re===f0[xe.type]){const tt=xe,et=String((F=tt.tag)!=null?F:"").trim().toLowerCase()||PC(tt.content);if(et){const ht=Kt.value[et];if(fn.value.has(et)&&ht)Re=ht,xe=Et(st({},tt),{type:et,tag:et,content:aP(tt.content,et)});else if(RC((G=tt.content)!=null?G:tt.raw,et)){const pt=String((ee=(Y=tt.content)!=null?Y:tt.raw)!=null?ee:"");xe.type==="html_inline"?(Re=Mn,xe={type:"text",content:pt,raw:pt}):(Re=nl,xe={type:"paragraph",children:[{type:"text",content:pt,raw:pt}],raw:pt})}}}const Ae=m0(xe,Fe,Re);let De=st({},(function(tt,et,ht){const pt=et??_u(tt);return ht&&m0(tt,pt,ht)?A3.value:tt.type==="code_block"&&(function(yt){return!!(yt&&yt===Kt.value.code_block)})(ht)?h0.value:tt.type==="code_block"&&Bv(ht)?E3.value:pt==="mermaid"?I3.value:pt==="infographic"?N3.value:pt==="d2"||pt==="d2lang"?$3.value:tt.type==="link"?L3.value:tt.type==="list"?O3.value:tt.type==="blockquote"?P3.value:tt.type==="table"?R3.value:tt.type==="code_block"?h0.value:Fa.value})(xe,Fe,Re));const qe=Ar.value[M.index];xe.type==="code_block"&&qe?.kind==="code-block"&&(De=Et(st({},De),Ae?{reservedHeightPx:(he=qe.height)!=null?he:qe.contentHeight}:{estimatedHeightPx:qe.height,estimatedContentHeightPx:qe.contentHeight})),Ae||xe.type!=="code_block"||Fe!=="mermaid"||kf(De.estimatedPreviewHeightPx)!=null||(De=Et(st({},De),{estimatedPreviewHeightPx:jx(Wx(String((ye=xe.code)!=null?ye:"")))})),Ae||xe.type!=="code_block"||Fe!=="infographic"||kf(De.estimatedPreviewHeightPx)!=null||(De=Et(st({},De),{estimatedPreviewHeightPx:zx(Ux(String((ke=xe.code)!=null?ke:"")))})),xe.type==="math_block"&&(De=Et(st({},De),{cacheScope:Mt.value}));const Ue=(function(tt,et){const ht=String(tt.type);return!tu(ht)&&Kt.value[ht]===et})(xe,Re),ut=Ue?J1(xe,Ne.value):void 0;return Et(st({},M),{node:xe,component:Re,bindings:De,customBindings:st(st({},ut??{}),De),rendersCustomNode:Ue,hasSlotChildren:D3(xe),slotContent:String((Oe=xe.content)!=null?Oe:""),isCodeBlock:xe.type==="code_block",indexKey:`${M3.value}-${M.index}`})}));function _u(M){var F;return M?.type==="code_block"?String((F=M.language)!=null?F:"").trim().toLowerCase():""}function m0(M,F,G){return M.type==="code_block"&&l.value==="pre"&&!(function(Y){return!!(Y&&Kt.value[Y])})(F)&&G===xo}function g0(M,F){if(!M)return $g;const G=Kt.value,Y=G[String(M.type)];if(M.type==="code_block"){const ee=F??_u(M),he=ee?G[ee]:void 0;return he||(l.value==="pre"?G.code_block||xo:ee==="mermaid"?G.mermaid||C3:ee==="infographic"?G.infographic||x3:ee==="d2"||ee==="d2lang"?G.d2||T3:Y||G.code_block||Fv.value)}return Y||f0[String(M.type)]||$g}function gp(M){o("click",M)}function B3(M){var F;(F=M.target)!=null&&F.closest("[data-node-index]")&&o("mouseover",M)}function F3(M){var F;(F=M.target)!=null&&F.closest("[data-node-index]")&&o("mouseout",M)}function v0(M){o("mouseover",M)}function y0(M){o("mouseout",M)}const Pr=se(null),Zo=se(!1);let Ha,Sl=null,vp=0,wu=0,Su=0;const k0=["code_block","admonition","table","math_block","html_block","image","thematic_break"],H3=new Set(k0),b0=[".typewriter-cursor",".height-estimation-probes",...k0.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function _0(M){if(!M||typeof M!="object")return!1;const F=M.type;return typeof F=="string"&&H3.has(F)}function Cu(M){var F,G;if(!M||typeof M!="object")return 0;const Y=M,ee=(G=(F=Y.raw)!=null?F:Y.content)!=null?G:Y.code;if(typeof ee=="string")return ee.length;const he=Y.children;if(Array.isArray(he))return he.reduce((ke,Oe)=>ke+Cu(Oe),0);const ye=Y.items;return Array.isArray(ye)?ye.reduce((ke,Oe)=>ke+Cu(Oe),0):0}function xu(){Ha&&(clearTimeout(Ha),Ha=void 0)}function w0(){vp+=1,Sl!=null&&(vn?.(Sl),Sl=null)}function Tu(){w0(),Pr.value&&(Pr.value.style.visibility="hidden")}function W3(M){var F;if(M.nodeType!==Node.TEXT_NODE||!((F=M.textContent)!=null?F:"").trim())return!1;const G=M.parentElement;return!!G&&!G.closest(b0)}function U3(M){let F=M.lastChild;for(;F;){if(W3(F))return F;if(F.nodeType===Node.ELEMENT_NODE){const G=F;if(!G.matches(b0)&&G.lastChild){F=G.lastChild;continue}}for(;F&&F!==M&&!F.previousSibling;)F=F.parentNode;if(!F||F===M)break;F=F.previousSibling}return null}function yp(){if(!re||!Zo.value||Sl!=null)return;const M=vp,F=()=>{Sl=null,M===vp&&(function(){var G,Y;if(!(re&&Zo.value&&x.value&&Pr.value))return;const ee=x.value,he=Pr.value;he.style.visibility="hidden";const ye=(function(){const Re=mp.value;for(let Ae=Re.length-1;Ae>=0;Ae--){const De=Re[Ae];if(!De||_0(De.node)||!up(De.index))continue;const qe=Be.get(De.index);if(!qe)continue;const Ue=U3(qe);if(Ue)return Ue}return null})();if(!ye)return;let ke=0,Oe=0,xe=20,Fe=!1;if(ye?.textContent){const Re=ye.textContent.length,Ae=document.createRange();Ae.setStart(ye,Math.max(0,Re-1)),Ae.setEnd(ye,Re);const De=typeof Ae.getClientRects=="function"?Ae.getClientRects():void 0,qe=(Y=De?.[De.length-1])!=null?Y:(G=ye.parentElement)==null?void 0:G.getBoundingClientRect();if(qe){const Ue=Ye("typewriterCursor.root.getBoundingClientRect",()=>ee.getBoundingClientRect());ke=qe.right-Ue.left+ee.scrollLeft,Oe=qe.top-Ue.top+ee.scrollTop,xe=qe.height||xe,Fe=!0}Ae.detach()}Fe&&(he.style.transform=`translate(${Math.max(0,ke)}px, ${Math.max(0,Oe)}px)`,he.style.height=`${xe}px`,he.style.visibility="visible")})()};gn?Sl=gn(F):F()}return Ve([X,()=>s.content,()=>s.nodes,()=>s.typewriter,oe],()=>yn(null,null,function*(){var M,F;if(!re||Te.value||!be.value)return;if(oe.value)return Zo.value=!1,xu(),void Tu();if((M=s.nodes)!=null&&M.length)return Zo.value=!1,xu(),Tu(),wu=((F=s.content)!=null?F:"").length,void(Su=X.value.length);const G=(function(){var ke,Oe;return(ke=s.nodes)!=null&&ke.length?s.nodes.reduce((xe,Fe)=>xe+Cu(Fe),0):((Oe=s.content)!=null?Oe:"").length})(),Y=(function(){var ke;return(ke=s.nodes)!=null&&ke.length?s.nodes.reduce((Oe,xe)=>Oe+Cu(xe),0):X.value.length})(),ee=!_0(Ge.value[Ge.value.length-1]),he=G>wu,ye=Y>Su;if(s.typewriter===!1||!ee||!he&&!ye)return s.typewriter!==!1&&ee||(Zo.value=!1,Tu()),wu=G,void(Su=Y);wu=G,Su=Y,Zo.value=!0,Pr.value&&(Pr.value.style.visibility="hidden"),xu(),yield gt(),yp(),Ha=setTimeout(()=>{Ha=void 0,Zo.value=!1},3e3)}),{flush:"post",immediate:!0}),Ve(Zo,M=>yn(null,null,function*(){M?(yield gt(),yp()):Tu()}),{flush:"post"}),Ve([()=>Ke.value,()=>ts.start,()=>ts.end],()=>yn(null,null,function*(){re&&!Te.value&&be.value&&Zo.value&&(yield gt(),yp())}),{flush:"post"}),lo(()=>{xu(),w0(),It.clear()}),(M,F)=>{const G=mA("NodeRenderer",!0);return T(Te)?(C(!0),E(Le,{key:0},Qe(mp.value,Y=>(C(),E(Le,{key:Y.index},[Y.rendersCustomNode?(C(),je(ms(Y.component),en({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onClick:gp,onMouseover:v0,onMouseout:y0,onCopy:F[0]||(F[0]=ee=>o("copy",ee)),onHandleArtifactClick:F[1]||(F[1]=ee=>o("handleArtifactClick",ee))}),{default:xn(()=>[Y.hasSlotChildren?(C(),je(G,en({key:0,ref_for:!0},Pt.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),je(G,en({key:1,ref_for:!0},Pt.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),je(ms(Y.component),en({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onClick:gp,onMouseover:v0,onMouseout:y0,onCopy:F[2]||(F[2]=ee=>o("copy",ee)),onHandleArtifactClick:F[3]||(F[3]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(C(),E("div",{key:1,ref_key:"containerRef",ref:x,class:$e(["markstream-vue markdown-renderer",[{dark:s.isDark},{virtualized:wt.value},{"virtual-scroll-coordinated":$n.value}]]),"data-custom-id":s.customId,onClick:gp,onMouseover:B3,onMouseout:F3},[js.value||wt.value?(C(),E(Le,{key:0},[js.value?(C(),E("div",{key:0,class:"height-estimation-probes",style:Dt({width:`${uo.value}px`}),"aria-hidden":"true"},[p("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[kt(T(nl),{node:In.value,"index-key":"probe-paragraph"},null,8,["node"])],512),p("div",{ref_key:"listItemProbeWrapperRef",ref:L,class:"node-content","data-probe":"list-item"},[p("ul",uH,[kt(T(oa),{node:On.value,"index-key":"probe-list-item"},null,8,["node"])])],512),p("div",{ref_key:"listProbeWrapperRef",ref:O,class:"node-content","data-probe":"list"},[kt(T(ia),{node:as.value,"index-key":"probe-list"},null,8,["node"])],512),(C(),E(Le,null,Qe(6,Y=>p("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:ee=>(function(he,ye){he<1||he>6||(P[he]=ye)})(Y,ee),class:"node-content","data-probe":`heading-${Y}`},[kt(T(vf),{node:a3(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,dH)),64))],4)):ce("",!0),wt.value?(C(),E("div",{key:1,class:"node-spacer",style:Dt({height:`${Rh.value}px`}),"aria-hidden":"true"},null,4)):ce("",!0)],64)):ce("",!0),(C(!0),E(Le,null,Qe(mp.value,Y=>(C(),E("div",{key:Y.index,ref_for:!0,ref:ee=>c0(Y.index,ee),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[up(Y.index)?(C(),E("div",{key:0,ref_for:!0,ref:ee=>(function(he,ye){var ke;ye||(function(Re){const Ae=`${Bh()}-${Re}`;let De=!1;for(const qe of Array.from(Ks.keys())){const Ue=Yo.get(qe);(Ue?.index===Re||qe===Ae||qe.startsWith(`${Ae}-`))&&(Ks.delete(qe),Yo.delete(qe),De=!0)}De&&(hl(),an("async-node"))})(he),di.delete(he),(function(Re){var Ae;const De=((Ae=Mr.get(Re))!=null?Ae:0)+1;Mr.set(Re,De)})(he);const Oe=Fi.get(he);if(Oe){for(const Re of Oe)du(Re);Fi.delete(he)}if((function(Re){const Ae=nt.get(Re);Ae&&(At?.unobserve(Ae),lt.delete(Ae),nt.delete(Re))})(he),!ye||!ho.value)return Go.delete(he),void Mr.delete(he);Go.set(he,ye);const xe=()=>{bu(he,ye)};queueMicrotask(xe);const Fe=(At||typeof ResizeObserver>"u"||(At=new ResizeObserver(Re=>{if(Re.length)for(const Ae of Re){const De=lt.get(Ae.target),qe=nt.get(De??-1);De!=null&&qe&&bu(De,qe)}else hi()})),At);if(Fe&&(nt.set(he,ye),lt.set(ye,he),Fe.observe(ye)),typeof window<"u"){const Re=((ke=Ge.value[he])==null?void 0:ke.type)==="code_block"?[16,80,240,800]:oe.value?[80]:[];if(Re.length){const Ae=Re.map(De=>$v(De,xe,"node-resize")).filter(De=>De!=null);Ae.length&&Fi.set(he,Ae)}}})(Y.index,ee),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(C(),je(ms(Y.component),en({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onCopy:F[8]||(F[8]=ee=>o("copy",ee)),onHandleArtifactClick:F[9]||(F[9]=ee=>o("handleArtifactClick",ee))}),{default:xn(()=>[Y.hasSlotChildren?(C(),je(G,en({key:0,ref_for:!0},Pt.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),je(G,en({key:1,ref_for:!0},Pt.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),je(ms(Y.component),en({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onCopy:F[10]||(F[10]=ee=>o("copy",ee)),onHandleArtifactClick:F[11]||(F[11]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(C(),je(Ei,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:xn(()=>[Y.rendersCustomNode?(C(),je(ms(Y.component),en({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onCopy:F[4]||(F[4]=ee=>o("copy",ee)),onHandleArtifactClick:F[5]||(F[5]=ee=>o("handleArtifactClick",ee))}),{default:xn(()=>[Y.hasSlotChildren?(C(),je(G,en({key:0,ref_for:!0},Pt.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),je(G,en({key:1,ref_for:!0},Pt.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),je(ms(Y.component),en({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onCopy:F[6]||(F[6]=ee=>o("copy",ee)),onHandleArtifactClick:F[7]||(F[7]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(C(),E("div",{key:1,class:"node-placeholder",style:Dt({height:`${pu(Y.index)}px`})},null,4))],8,fH))),128)),Zo.value?(C(),E("span",{key:1,ref_key:"typewriterCursorRef",ref:Pr,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ce("",!0),wt.value?(C(),E("div",{key:2,class:"node-spacer",style:Dt({height:`${Dh.value}px`}),"aria-hidden":"true"},null,4)):ce("",!0)],42,cH))}}})),[["__scopeId","data-v-661c7a50"]]),qs=Jx;qs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",qs.__name,qs.name].filter(n=>!!n));for(const n of t)e.component(n,Jx)};const rv=Object.freeze(Object.defineProperty({__proto__:null,default:qs},Symbol.toStringTag,{value:"Module"})),hH={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"},pH={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"},mH={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"},gH={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"},vH={class:"admonition-title"},yH=["aria-expanded","aria-controls"],kH=["id"],xd=Zt(Je({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=j(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=se(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(C(),E("div",{class:$e(["admonition",[`admonition-${s.node.kind}`]])},[p("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(C(),E("svg",hH,[...u[1]||(u[1]=[p("circle",{cx:"12",cy:"12",r:"10"},null,-1),p("path",{d:"M12 16v-4"},null,-1),p("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(C(),E("svg",pH,[...u[2]||(u[2]=[p("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),p("path",{d:"M9 18h6"},null,-1),p("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(C(),E("svg",mH,[...u[3]||(u[3]=[p("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),p("path",{d:"M12 9v4"},null,-1),p("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(C(),E("svg",gH,[...u[4]||(u[4]=[p("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),p("path",{d:"M12 8v4"},null,-1),p("path",{d:"M12 16h.01"},null,-1)])])):ce("",!0),p("span",vH,N(i.value),1),s.node.collapsible?(C(),E("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(C(),E("svg",{style:Dt({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]=[p("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,yH)):ce("",!0)]),Lt(p("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[kt(T(qs),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,kH),[[Uo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);xd.install=e=>{e.component(xd.__name,xd)};const eT=()=>Js(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let nd=null,bH=eT;function jue(){return yn(this,null,function*(){if(nd)return nd;const e=bH;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===eT?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(nd=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),nd):null})}function zue(){return!1}function Vue(){return yn(this,null,function*(){return null})}const sd=se(!1);let O_=!1;function km(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function _H(){return!O_&&typeof window<"u"&&typeof document<"u"&&(O_=!0,sd.value=km(),new MutationObserver(()=>{sd.value=km()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{sd.value=km()})),sd}const tT=["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"],wH=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Rg=[...tT].sort((e,t)=>t.length-e.length).join("|"),bm=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Rg}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Rg})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),nT=/[),.;!?,。;!?)]+$/;function SH(e){const t=e.toLowerCase();return tT.some(n=>t.endsWith(`.${n}`))}function CH(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Rg}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function xH(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(nT,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=wH.has(i),a=SH(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function TH(e,t={}){const n=[];bm.lastIndex=0;let s;for(;(s=bm.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(nT,""),u=a.length-c.length;a=c;const d=xH(a,t);if(!d)continue;const h=s.index+r,m=h+a.length;n.push({...d,start:h,end:m,text:a}),u>0&&(bm.lastIndex-=u)}return n}const MH=12e4,AH=6e4,EH=32,IH=3e4,P_=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function $H(e){let t=0,n=0,s=0;P_.lastIndex=0;let o;for(;(o=P_.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=MH||n>=AH||t>=EH||s>=IH?"pre":"shiki",codeFenceCount:t,codeChars:n}}const NH={key:1,class:"diff-wrap"},LH={class:"diff-bar"},OH=["title","onClick"],PH={class:"diff-pre"},RH="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",R_="github-light",D_="github-dark",DH=Je({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){const{t}=xt(),n=Bt("resolveImage"),s=se(null),o=e,i=j(()=>!o.streaming),r=j(()=>CH(o.text??"")),l=j(()=>o.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:$H(o.text??"")),a=_H(),c=j(()=>!o.streaming),u=Qs(new Map),d=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,m=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function f(P){return!/^(https?:|data:|blob:)/i.test(P)}function y(P){if(!n)return;const B=[];for(const R of[h,m]){R.lastIndex=0;let W;for(;(W=R.exec(P))!==null;)B.push(W[2]??"")}for(const R of B)!R||!f(R)||u.has(R)||d.has(R)||(d.add(R),n(R).then(W=>{u.set(R,W!==R?W:"")}).catch(()=>{u.set(R,"")}).finally(()=>{d.delete(R)}))}function S(P){if(!n)return P;const B=R=>{if(!f(R))return null;const W=u.get(R);return W===void 0?RH:W===""?null:W};return P.replace(h,(R,W,V,z)=>{const ie=B(V);return ie===null?R:`${W}${ie}${z}`}).replace(m,(R,W,V,z)=>{const ie=B(V);return ie===null?R:`${W}${ie}${z}`})}Ve(()=>o.text,P=>y(P??""),{immediate:!0});function _(){if(!s.value||!o.openFile||o.streaming)return;const P=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),B=[];let R=P.nextNode();for(;R;){const W=R,V=W.parentElement;V&&!V.closest("a, pre, .md-file-link")&&W.data.trim().length>0&&B.push(W),R=P.nextNode()}for(const W of B){const V=TH(W.data,{aliases:r.value});if(V.length===0||!W.parentNode)continue;const z=document.createDocumentFragment();let ie=0;for(const ae of V){ae.start>ie&&z.append(document.createTextNode(W.data.slice(ie,ae.start)));const re=document.createElement("button");re.type="button",re.className="md-file-link",re.textContent=ae.text,re.title=ae.line?`${ae.path}:${ae.line}`:ae.path,re.addEventListener("click",Te=>{Te.preventDefault(),Te.stopPropagation(),o.openFile?.({path:ae.path,line:ae.line})}),z.append(re),ie=ae.end}ie<W.data.length&&z.append(document.createTextNode(W.data.slice(ie))),W.parentNode.replaceChild(z,W)}}function b(P){return!(!P||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(P))}function v(P){let B=P.length;for(const R of["#","?"]){const W=P.indexOf(R);W!==-1&&W<B&&(B=W)}return P.slice(0,B)}function g(){if(!s.value||!o.openFile||o.streaming)return;const P=s.value.querySelectorAll("a[href]");for(const B of P){if(B.dataset.mdLinkHandled==="true")continue;const R=B.getAttribute("href")??"";b(R)&&(B.dataset.mdLinkHandled="true",B.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),o.openFile?.({path:v(R)})}))}}function k(){gt().then(()=>{_(),g()})}Ve(()=>o.text,k),Ve(()=>o.streaming,k);let $=null;ln(()=>{k(),s.value&&($=new MutationObserver(k),$.observe(s.value,{childList:!0,subtree:!0}))}),Ut(()=>{$?.disconnect()});const A={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},w=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,x=j(()=>{const P=S(o.text??""),B=[];let R=0;w.lastIndex=0;let W;for(;(W=w.exec(P))!==null;){const z=W[1]??"",ie=P.slice(R,W.index)+(z||"");ie.trim()&&B.push({kind:"md",text:ie}),B.push({kind:"diff",code:W[2]??""}),R=w.lastIndex}const V=P.slice(R);return(V.trim()||B.length===0)&&B.push({kind:"md",text:V}),B});function I(P){return P.split(`
|
|
219
|
-
`).map(B=>/^\+(?!\+\+)/.test(B)?{cls:"diff-add",text:B}:/^-(?!--)/.test(B)?{cls:"diff-del",text:B}:B.startsWith("@@")?{cls:"diff-hunk",text:B}:{cls:"diff-ctx",text:B})}const L=se(null);function O(P,B){navigator.clipboard.writeText(P).then(()=>{L.value=B,setTimeout(()=>{L.value=null},1400)}).catch(()=>{})}return(P,B)=>(C(),E("div",{ref_key:"mdRef",ref:s,class:"md"},[(C(!0),E(Le,null,Qe(x.value,(R,W)=>(C(),E(Le,{key:W},[R.kind==="md"?(C(),je(T(qs),{key:0,content:R.text,mode:"chat","code-renderer":l.value.codeRenderer,"is-dark":T(a),"code-block-light-theme":R_,"code-block-dark-theme":D_,themes:[R_,D_],"code-block-props":A,final:i.value,"smooth-streaming":e.streaming,"batch-rendering":c.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(C(),E("div",NH,[p("div",LH,[B[0]||(B[0]=p("span",{class:"diff-lang"},"diff",-1)),p("button",{class:"diff-copy",title:T(t)("filePreview.copyCode"),onClick:V=>O(R.code,W)},N(L.value===W?"✓":"⧉"),9,OH)]),p("pre",PH,[p("code",null,[(C(!0),E(Le,null,Qe(I(R.code),(V,z)=>(C(),E("span",{key:z,class:$e(V.cls)},N(V.text),3))),128))])])]))],64))),128))],512))}}),_f=_t(DH,[["__scopeId","data-v-9786e921"]]),BH={class:"tc-anim"},FH={class:"prev-anim"},HH={class:"prev"},WH=Je({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=j(()=>n.foldable&&o.value.length>1),r=j(()=>n.streaming||!i.value),l=j(()=>o.value.pop()??""),a=se(null);return ln(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ve(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||gt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(C(),E("div",{class:$e(["think",{mob:e.mobile}])},[i.value?(C(),E("div",{key:0,class:$e(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[p("div",BH,[p("pre",{ref_key:"bodyEl",ref:a,class:"tc"},N(e.text),513)]),p("div",FH,[p("span",HH,N(l.value),1)])],2)):(C(),E("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},N(e.text),513))],2))}}),B_=_t(WH,[["__scopeId","data-v-67632248"]]),UH={class:"activity-notice",role:"status"},qH={class:"an-moon","aria-hidden":"true"},jH={class:"an-label"},zH=120,VH=Je({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=se(0);let s=null;return ln(()=>{s=setInterval(()=>{n.value=(n.value+1)%t.length},zH)}),Ut(()=>{s&&(clearInterval(s),s=null)}),(o,i)=>(C(),E("div",UH,[p("span",qH,N(t[n.value]),1),p("span",jH,N(e.label),1)]))}}),F_=_t(VH,[["__scopeId","data-v-bca6ec2b"]]),KH=["disabled"],GH={class:"agent-main"},YH={class:"agent-title-row"},XH={class:"agent-name"},ZH={key:0,class:"agent-type"},QH={class:"agent-phase"},JH={key:0,class:"agent-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},eW=Je({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=j(()=>o.value.at(-1)),r=j(()=>n.member.phase==="queued"||n.member.phase==="working"||n.member.phase==="suspended"),l=j(()=>!!(n.member.summary||n.member.suspendedReason||n.member.prompt||o.value.length>0));function a(u){switch(u){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(){l.value&&s("open",n.member.id)}return(u,d)=>(C(),E("div",{class:$e(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[p("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=p("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),p("span",GH,[p("span",YH,[p("span",XH,N(e.member.name),1),e.member.subagentType?(C(),E("span",ZH,N(e.member.subagentType),1)):ce("",!0),r.value?(C(),E("span",{key:1,class:$e(["agent-live",{empty:!i.value}])},N(i.value),3)):ce("",!0)])]),p("span",QH,N(a(e.member.phase)),1),l.value?(C(),E("svg",JH,[...d[0]||(d[0]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])])):ce("",!0)],8,KH)],2))}}),Dg=_t(eW,[["__scopeId","data-v-41bb2d23"]]),tW={class:"agent-group"},nW={class:"group-count"},sW={key:0,class:"group-live"},oW={key:0,class:"group-body"},iW=Je({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=se(!0),i=j(()=>n.members.filter(l=>l.phase==="completed"||l.phase==="failed").length),r=j(()=>n.members.filter(l=>l.phase==="queued"||l.phase==="working"||l.phase==="suspended").length);return(l,a)=>(C(),E("section",tW,[p("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>o.value=!o.value)},[a[3]||(a[3]=p("span",{class:"group-title"},"Agents",-1)),p("span",nW,N(i.value)+"/"+N(e.members.length),1),r.value>0?(C(),E("span",sW,N(r.value)+" running",1)):ce("",!0),(C(),E("svg",{class:$e(["group-chevron",{open:o.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...a[2]||(a[2]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),o.value?(C(),E("div",oW,[(C(!0),E(Le,null,Qe(e.members,c=>(C(),je(Dg,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>s("open",u))},null,8,["member"]))),128))])):ce("",!0)]))}}),H_=_t(iW,[["__scopeId","data-v-644d434d"]]),rW=["aria-label"],lW=120,aW=60,cW=Je({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*lW}ms`,"--moon-frame-fast-delay":`${s*aW}ms`}}return(s,o)=>(C(),E("span",{class:$e(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(C(),E(Le,null,Qe(t,(i,r)=>p("span",{key:i,class:"moon-frame",style:Dt(n(r)),"aria-hidden":"true"},N(i),5)),64))],10,rW))}}),Bg=_t(cW,[["__scopeId","data-v-e7ccbb9a"]]);function uW(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const dW={key:0,class:"chat"},fW={key:0,class:"chat-loading"},hW={class:"chat-loading-text"},pW={key:1,class:"chat-empty"},mW={key:1,class:"top-sentinel-text"},gW=["data-turn-id"],vW={key:0,class:"u-imgs"},yW=["src"],kW=["src","alt"],bW={key:1,class:"skill-act"},_W={class:"skill-act-head"},wW={key:0,class:"skill-act-args"},SW={key:2,class:"u-text"},CW={key:0,class:"u-meta"},xW=["data-tooltip","onClick"],TW={class:"u-edit-text"},MW=["onClick"],AW=["onClick"],EW=["data-turn-id"],IW=["onClick"],$W={class:"cd-view"},NW={key:1,class:"cd-label"},LW=["data-turn-id"],OW={key:1,class:"msg"},PW={key:2,class:"tool-stack"},RW={key:0,class:"a-msg-ft"},DW=["title"],BW=["onClick"],FW={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},HW={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},WW={class:"a-cpbtn-text"},UW={key:4,class:"sending-placeholder"},qW={key:1,class:"term"},jW={key:0,class:"chat-loading"},zW={class:"chat-loading-text"},VW={key:1,class:"chat-empty"},KW={key:1,class:"top-sentinel-text"},GW=["data-turn-id"],YW=["onClick"],XW={class:"cd-view"},ZW={key:1,class:"cd-label"},QW=["data-turn-id"],JW={class:"no"},eU={class:"tx"},tU={class:"role-row"},nU=["onClick"],sU={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},oU={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},iU={class:"cpbtn-text"},rU=["title"],lU={key:0,class:"u-text"},aU={key:0,class:"skill-act"},cU={class:"skill-act-head"},uU={key:0,class:"skill-act-args"},dU={key:2,class:"tool-stack"},fU=["data-tooltip","onClick"],hU={class:"u-edit-text"},pU=["onClick"],mU={key:4,class:"ln sending-line"},gU={class:"tx"},vU=Je({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},bubble:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","editMessage","loadOlderMessages"],setup(e,{expose:t,emit:n}){const{t:s}=xt();Ut(()=>{ae!==null&&(clearTimeout(ae),ae=null),L!==null&&(clearTimeout(L),L=null),g!==null&&(clearTimeout(g),g=null)});const o=e,i=j(()=>o.bubble||o.mobile),r=se(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(fe=>{fe[0]?.isIntersecting&&o.hasMoreMessages&&!o.loadingMore&&!o.loadingMoreError&&!o.sessionLoading&&!o.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}ln(a),Ut(()=>{l?.disconnect(),l=null}),Ve(()=>[o.hasMoreMessages,o.loadingMore,o.loadingMoreError],()=>{gt().then(a)});const c=j(()=>{if(!o.running||o.turns.length===0)return null;const fe=o.turns.at(-1);return fe.role==="assistant"?fe.id:null}),u=j(()=>o.sending||o.running),d=n,h=j(()=>{for(let fe=o.turns.length-1;fe>=0;fe--)if(o.turns[fe].role==="user")return o.turns[fe].id;return null});function m(fe){return fe.role==="user"&&fe.id===h.value&&!o.running&&!o.sending&&!fe.skillActivation}function f(fe){return fe>=1e6?`${(fe/1e6).toFixed(1)}M`:fe>=1e3?`${(fe/1e3).toFixed(1)}k`:String(fe)}function y(fe){if(fe<1e3)return`${fe}ms`;if(fe<6e4)return`${(fe/1e3).toFixed(1)}s`;const K=Math.floor(fe/6e4),Z=(fe%6e4/1e3).toFixed(1);return`${K}m${Z}s`}function S(fe){const K=fe.compaction,Z=K?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof K?.tokensBefore=="number"&&typeof K?.tokensAfter=="number"?Z+s("conversation.compactedTokens",{before:f(K.tokensBefore),after:f(K.tokensAfter)}):Z}const _=se(null),b=se(null),v=se(null);let g=null;const k=se(new Set);function $(fe){return k.value.has(fe)}function A(fe){const K=new Set(k.value);K.has(fe)?K.delete(fe):K.add(fe),k.value=K}function w(fe,K){if($(K)){const Z=new Date(fe);if(Number.isNaN(Z.getTime()))return fe;const pe=D=>String(D).padStart(2,"0");return`${Z.getFullYear()}-${pe(Z.getMonth()+1)}-${pe(Z.getDate())} ${pe(Z.getHours())}:${pe(Z.getMinutes())}`}return uW(fe,s("conversation.yesterday"))}function x(fe){v.value===null&&(b.value=null,v.value=fe.id,g=setTimeout(()=>{g=null,d("editMessage",fe.text),v.value=null},240))}const I=se(!1);let L=null;function O(fe){return Te(fe).flatMap(K=>K.kind==="text"&&K.text?[K.text]:[]).join(`
|
|
220
|
-
|
|
221
|
-
`)}function P(fe){const K=[];for(const Z of Te(fe))if(Z.kind==="thinking"&&Z.thinking)K.push(`> **Thinking**
|
|
222
|
-
> ${Z.thinking.split(`
|
|
223
|
-
`).join(`
|
|
224
|
-
> `)}`);else if(Z.kind==="text"&&Z.text)K.push(Z.text);else if(Z.kind==="tool"&&Z.tool.output&&Z.tool.output.length>0){const pe=Z.tool.output.join(`
|
|
225
|
-
`);K.push(`\`\`\`
|
|
226
|
-
[${Z.tool.name}]
|
|
227
|
-
${pe}
|
|
228
|
-
\`\`\``)}else Z.kind==="agent"?K.push(`**Agent** ${Z.member.name} (${Z.member.phase})`):Z.kind==="agentGroup"&&K.push(`**Agents**
|
|
229
|
-
|
|
230
|
-
${Z.members.map(pe=>`- ${pe.name}: ${pe.phase}`).join(`
|
|
231
|
-
`)}`);return K.join(`
|
|
232
|
-
|
|
233
|
-
`)}function B(){if(o.turns.length===0)return;const fe=[];for(const Z of o.turns){if(Z.role==="compaction")continue;const pe=Z.role==="user"?"User":"Assistant",D=P(Z);D.trim()&&fe.push(`**${pe}**
|
|
234
|
-
|
|
235
|
-
${D}`)}const K=fe.join(`
|
|
236
|
-
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
`);navigator.clipboard.writeText(K).then(()=>{I.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,I.value=!1},2e3)}).catch(()=>{})}function R(fe){const K=[];for(let Z=fe;Z>=0;Z--){const pe=o.turns[Z];if(!pe||pe.role!=="assistant")break;K.unshift(pe)}return K}function W(fe){return R(fe).map(K=>O(K)).filter(Boolean).join(`
|
|
240
|
-
|
|
241
|
-
`)}function V(){for(let fe=o.turns.length-1;fe>=0;fe-=1)if(o.turns[fe]?.role==="assistant")return W(fe);return""}function z(){const fe=V();fe.trim()&&navigator.clipboard.writeText(fe).then(()=>{I.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,I.value=!1},2e3)}).catch(()=>{})}t({copyConversation:B,copyFinalSummary:z});function ie(fe){const K=o.turns[fe];if(!K||K.role!=="assistant")return!1;const Z=o.turns[fe+1];return!Z||Z.role!=="assistant"}let ae=null;function re(fe){const K=o.turns[fe];if(!K)return;const Z=W(fe);Z.trim()&&navigator.clipboard.writeText(Z).then(()=>{_.value=K.id,ae!==null&&clearTimeout(ae),ae=setTimeout(()=>{ae=null,_.value=null},1400)}).catch(()=>{})}function Te(fe){if(fe.blocks)return fe.blocks;const K=[];fe.thinking&&K.push({kind:"thinking",thinking:fe.thinking}),fe.text&&K.push({kind:"text",text:fe.text});for(const Z of fe.tools??[])K.push({kind:"tool",tool:Z});return K}function Pe(fe){return!(fe.tool.status==="ok"&&fe.tool.media)}function We(fe,K){return K<=1?"single":fe===0?"first":fe===K-1?"last":"middle"}function Ne(fe){const K=Te(fe),Z=[];let pe=[];const D=()=>{if(pe.length===1){const[X]=pe;X&&Z.push({kind:"tool",tool:X.tool,sourceIndex:X.sourceIndex})}else pe.length>1&&Z.push({kind:"tool-stack",tools:pe});pe=[]};return K.forEach((X,oe)=>{if(X.kind==="tool"){if(Pe(X)){pe.push({tool:X.tool,sourceIndex:oe});return}D(),Z.push({kind:"tool",tool:X.tool,sourceIndex:oe});return}D(),X.kind==="thinking"?Z.push({kind:"thinking",thinking:X.thinking,sourceIndex:oe}):X.kind==="text"?Z.push({kind:"text",text:X.text,sourceIndex:oe}):X.kind==="agent"?Z.push({kind:"agent",member:X.member,sourceIndex:oe}):Z.push({kind:"agentGroup",members:X.members,sourceIndex:oe})}),D(),Z}function me(fe,K){return fe.id!==c.value?!1:K.sourceIndex===Te(fe).length-1}function be(fe){return fe.tool.id||`tool-${fe.sourceIndex}`}function Se(fe,K){return fe.kind==="tool-stack"?`tool-stack-${fe.tools[0]?.sourceIndex??K}`:fe.kind==="tool"?be({tool:fe.tool,sourceIndex:fe.sourceIndex}):fe.kind==="agent"?`agent-${fe.member.id}-${fe.sourceIndex}`:fe.kind==="agentGroup"?`agent-group-${fe.members[0]?.id??fe.sourceIndex}`:`${fe.kind}-${fe.sourceIndex}`}return(fe,K)=>i.value?(C(),E("div",dW,[e.sessionLoading?(C(),E("div",fW,[K[10]||(K[10]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),p("span",hW,N(T(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),E("div",pW)):ce("",!0),e.hasMoreMessages||e.loadingMore?(C(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:$e(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),E("span",mW,[K[11]||(K[11]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),vt(" "+N(T(s)("conversation.loadingOlder")),1)])):(C(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:K[0]||(K[0]=Z=>d("loadOlderMessages"))},N(T(s)("conversation.loadOlder")),1))],2)):ce("",!0),(C(!0),E(Le,null,Qe(e.turns,(Z,pe)=>(C(),E(Le,{key:Z.id},[Z.role==="user"?(C(),E(Le,{key:0},[p("div",{class:$e(["u-bub turn-anchor",{undoing:v.value===Z.id}]),"data-turn-id":Z.id},[Z.images&&Z.images.length>0?(C(),E("div",vW,[(C(!0),E(Le,null,Qe(Z.images,(D,X)=>(C(),E(Le,{key:X},[D.kind==="video"?(C(),E("video",{key:0,class:"u-img",src:D.url,controls:"",playsinline:"",preload:"metadata"},null,8,yW)):(C(),E("img",{key:1,class:"u-img",src:D.url,alt:D.alt||"",loading:"lazy"},null,8,kW))],64))),128))])):ce("",!0),Z.skillActivation?(C(),E("div",bW,[p("div",_W,[K[12]||(K[12]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,N(T(s)("conversation.activatedSkill",{name:Z.skillActivation.name})),1)]),Z.skillActivation.args?(C(),E("div",wW,N(Z.skillActivation.args),1)):ce("",!0)])):(C(),E("div",SW,N(Z.text),1))],10,gW),Z.createdAt||m(Z)?(C(),E("div",CW,[m(Z)?(C(),E("div",{key:0,class:$e(["u-edit-wrap",{undoing:v.value===Z.id}])},[b.value!==Z.id?(C(),E("button",{key:0,type:"button",class:"u-edit","data-tooltip":T(s)("conversation.undoTooltip"),onClick:D=>b.value=Z.id},[p("span",TW,N(T(s)("conversation.undo")),1),K[13]||(K[13]=p("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),p("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,xW)):(C(),E("div",{key:1,class:"u-edit-confirm",onClick:K[2]||(K[2]=Ze(()=>{},["stop"]))},[p("span",null,N(T(s)("conversation.undoConfirm")),1),p("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(D=>x(Z),["stop"])},N(T(s)("conversation.confirm")),9,MW),p("button",{type:"button",class:"u-edit-confirm-btn",onClick:K[1]||(K[1]=Ze(D=>b.value=null,["stop"]))},N(T(s)("conversation.cancel")),1)]))],2)):ce("",!0),Z.createdAt?(C(),E("button",{key:1,type:"button",class:"u-time",onClick:Ze(D=>A(Z.id),["stop"])},N(w(Z.createdAt,Z.id)),9,AW)):ce("",!0)])):ce("",!0)],64)):Z.role==="compaction"?(C(),E("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":Z.id,role:"separator"},[K[14]||(K[14]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Z.text?(C(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:D=>d("openCompaction",{turnId:Z.id})},[p("span",null,N(S(Z)),1),p("span",$W,N(T(s)("conversation.viewSummary")),1)],8,IW)):(C(),E("span",NW,N(S(Z)),1)),K[15]||(K[15]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,EW)):(C(),E("div",{key:2,class:"a-msg turn-anchor","data-turn-id":Z.id},[(C(!0),E(Le,null,Qe(Ne(Z),(D,X)=>(C(),E(Le,{key:Se(D,X)},[D.kind==="thinking"?(C(),je(B_,{key:0,text:D.thinking,mobile:i.value,streaming:me(Z,D),onOpen:oe=>d("openThinking",{turnId:Z.id,blockIndex:D.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):D.kind==="text"&&D.text?(C(),E("div",OW,[kt(_f,{text:D.text,streaming:me(Z,D),"open-file":oe=>d("openFile",oe)},null,8,["text","streaming","open-file"])])):D.kind==="tool-stack"?(C(),E("div",PW,[(C(!0),E(Le,null,Qe(D.tools,(oe,te)=>(C(),je(Uu,{key:be(oe),tool:oe.tool,mobile:i.value,"stack-position":We(te,D.tools.length),onOpenMedia:K[3]||(K[3]=ue=>d("openMedia",ue))},null,8,["tool","mobile","stack-position"]))),128))])):D.kind==="agent"?(C(),je(Dg,{key:3,member:D.member,onOpen:oe=>d("openAgent",{turnId:Z.id,blockIndex:D.sourceIndex,memberId:oe})},null,8,["member","onOpen"])):D.kind==="agentGroup"?(C(),je(H_,{key:4,members:D.members,onOpen:oe=>d("openAgent",{turnId:Z.id,blockIndex:D.sourceIndex,memberId:oe})},null,8,["members","onOpen"])):D.kind==="tool"?(C(),je(Uu,{key:5,tool:D.tool,mobile:i.value,onOpenMedia:K[4]||(K[4]=oe=>d("openMedia",oe))},null,8,["tool","mobile"])):ce("",!0)],64))),128)),Z.id!==c.value&&ie(pe)&&(W(pe).trim().length>0||Z.durationMs!==void 0)?(C(),E("div",RW,[Z.durationMs!==void 0?(C(),E("span",{key:0,class:"a-duration",title:`${Z.durationMs} ms`},N(y(Z.durationMs)),9,DW)):ce("",!0),W(pe).trim().length>0?(C(),E("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:D=>re(pe)},[_.value!==Z.id?(C(),E("svg",FW,[...K[16]||(K[16]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),E("svg",HW,[...K[17]||(K[17]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),p("span",WW,N(T(s)("filePreview.copy")),1)],8,BW)):ce("",!0)])):ce("",!0)],8,LW))],64))),128)),e.compaction?(C(),je(F_,{key:3,label:T(s)("conversation.compacting")},null,8,["label"])):ce("",!0),u.value?(C(),E("div",UW,[kt(Bg,{fast:e.fastMoon},null,8,["fast"])])):ce("",!0)])):(C(),E("div",qW,[e.sessionLoading?(C(),E("div",jW,[K[18]||(K[18]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),p("span",zW,N(T(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),E("div",VW)):ce("",!0),e.hasMoreMessages||e.loadingMore?(C(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:$e(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),E("span",KW,[K[19]||(K[19]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),vt(" "+N(T(s)("conversation.loadingOlder")),1)])):(C(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:K[5]||(K[5]=Z=>d("loadOlderMessages"))},N(T(s)("conversation.loadOlder")),1))],2)):ce("",!0),(C(!0),E(Le,null,Qe(e.turns,(Z,pe)=>(C(),E(Le,{key:Z.id},[Z.role==="compaction"?(C(),E("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":Z.id,role:"separator"},[K[20]||(K[20]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Z.text?(C(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:D=>d("openCompaction",{turnId:Z.id})},[p("span",null,N(S(Z)),1),p("span",XW,N(T(s)("conversation.viewSummary")),1)],8,YW)):(C(),E("span",ZW,N(S(Z)),1)),K[21]||(K[21]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,GW)):(C(),E("div",{key:1,class:$e(["ln turn-anchor",[Z.role==="user"?"userline":"ai",{undoing:v.value===Z.id}]]),"data-turn-id":Z.id},[p("span",JW,N(Z.no),1),p("div",eU,[p("div",tU,[Z.role==="user"?(C(),E(Le,{key:0},[K[22]||(K[22]=p("span",{class:"pr"},"user@kimi",-1)),K[23]||(K[23]=p("span",{class:"who"}," $ ",-1))],64)):(C(),E(Le,{key:1},[K[24]||(K[24]=p("span",{class:"pr"},"kimi",-1)),K[25]||(K[25]=p("span",{class:"who"}," > ",-1))],64)),Z.id!==c.value&&ie(pe)&&W(pe).trim().length>0?(C(),E("button",{key:2,class:"cpbtn",onClick:D=>re(pe),tabindex:"-1"},[_.value!==Z.id?(C(),E("svg",sU,[...K[26]||(K[26]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),E("svg",oU,[...K[27]||(K[27]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),p("span",iU,N(T(s)("filePreview.copy")),1)],8,nU)):ce("",!0),Z.durationMs!==void 0&&Z.role==="assistant"?(C(),E("span",{key:3,class:"turn-duration",title:`${Z.durationMs} ms`},N(y(Z.durationMs)),9,rU)):ce("",!0)]),Z.role==="user"?(C(),E("div",lU,[Z.skillActivation?(C(),E("div",aU,[p("div",cU,[K[28]||(K[28]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,N(T(s)("conversation.activatedSkill",{name:Z.skillActivation.name})),1)]),Z.skillActivation.args?(C(),E("div",uU,N(Z.skillActivation.args),1)):ce("",!0)])):(C(),E(Le,{key:1},[vt(N(Z.text),1)],64))])):(C(!0),E(Le,{key:1},Qe(Ne(Z),(D,X)=>(C(),E(Le,{key:Se(D,X)},[D.kind==="thinking"?(C(),je(B_,{key:0,text:D.thinking,streaming:me(Z,D),onOpen:oe=>d("openThinking",{turnId:Z.id,blockIndex:D.sourceIndex})},null,8,["text","streaming","onOpen"])):D.kind==="text"&&D.text?(C(),je(_f,{key:1,text:D.text,streaming:me(Z,D),"open-file":oe=>d("openFile",oe)},null,8,["text","streaming","open-file"])):D.kind==="tool-stack"?(C(),E("div",dU,[(C(!0),E(Le,null,Qe(D.tools,(oe,te)=>(C(),je(Uu,{key:be(oe),tool:oe.tool,"stack-position":We(te,D.tools.length),onOpenMedia:K[6]||(K[6]=ue=>d("openMedia",ue))},null,8,["tool","stack-position"]))),128))])):D.kind==="agent"?(C(),je(Dg,{key:3,member:D.member,onOpen:oe=>d("openAgent",{turnId:Z.id,blockIndex:D.sourceIndex,memberId:oe})},null,8,["member","onOpen"])):D.kind==="agentGroup"?(C(),je(H_,{key:4,members:D.members,onOpen:oe=>d("openAgent",{turnId:Z.id,blockIndex:D.sourceIndex,memberId:oe})},null,8,["members","onOpen"])):D.kind==="tool"?(C(),je(Uu,{key:5,tool:D.tool,onOpenMedia:K[7]||(K[7]=oe=>d("openMedia",oe))},null,8,["tool"])):ce("",!0)],64))),128))]),Z.role==="user"&&m(Z)?(C(),E("div",{key:0,class:$e(["u-edit-wrap ln-edit-wrap",{undoing:v.value===Z.id}])},[b.value!==Z.id?(C(),E("button",{key:0,type:"button",class:"u-edit","data-tooltip":T(s)("conversation.undoTooltip"),onClick:D=>b.value=Z.id},[K[29]||(K[29]=p("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),p("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),p("span",hU,N(T(s)("conversation.undo")),1)],8,fU)):(C(),E("div",{key:1,class:"u-edit-confirm",onClick:K[9]||(K[9]=Ze(()=>{},["stop"]))},[p("span",null,N(T(s)("conversation.undoConfirm")),1),p("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(D=>x(Z),["stop"])},N(T(s)("conversation.confirm")),9,pU),p("button",{type:"button",class:"u-edit-confirm-btn",onClick:K[8]||(K[8]=Ze(D=>b.value=null,["stop"]))},N(T(s)("conversation.cancel")),1)]))],2)):ce("",!0)],10,QW))],64))),128)),e.compaction?(C(),je(F_,{key:3,label:T(s)("conversation.compacting")},null,8,["label"])):ce("",!0),u.value?(C(),E("div",mU,[K[31]||(K[31]=p("span",{class:"no"},"—",-1)),p("div",gU,[K[30]||(K[30]=p("div",{class:"role-row"},[p("span",{class:"pr"},"kimi"),p("span",{class:"who"}," > ")],-1)),kt(Bg,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):ce("",!0)]))}}),sT=_t(vU,[["__scopeId","data-v-5479dea1"]]),yU={class:"chat-header"},kU={class:"ch-id"},bU={key:0,class:"ch-ws"},_U={key:1,class:"ch-sep"},wU=["onKeydown"],SU=["title"],CU=["title","aria-label","aria-expanded"],xU=["title"],TU=["title"],MU={key:0,class:"ch-pill ch-sync-pill"},AU={key:0,class:"ch-ahead"},EU={key:1,class:"ch-behind"},IU={key:1,class:"ch-pill ch-diff-pill"},$U={key:0,class:"ch-add"},NU={key:1,class:"ch-del"},LU=["title"],OU=Je({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=j(()=>s.ahead??0),r=j(()=>s.behind??0),l=j(()=>s.gitDiffStats?.totalAdditions??0),a=j(()=>s.gitDiffStats?.totalDeletions??0),c=j(()=>l.value>0||a.value>0),u=se(!1),d=se(null),h=se(null),m=se({});function f(V){const z=V.target;h.value?.contains(z)||d.value?.contains(z)||_()}function y(){_()}async function S(V){if(V.stopPropagation(),u.value){_();return}u.value=!0,document.addEventListener("mousedown",f),document.addEventListener("scroll",y,!0),window.addEventListener("resize",y),await gt();const z=d.value,ie=h.value;if(!z||!ie)return;const ae=z.getBoundingClientRect(),re=4,Te=8,Pe=ie.offsetWidth,We=ie.offsetHeight;let Ne=ae.bottom+re;Ne+We>window.innerHeight-Te&&(Ne=Math.max(Te,ae.top-We-re));let me=ae.left;me+Pe>window.innerWidth-Te&&(me=Math.max(Te,ae.right-Pe)),m.value={top:`${Math.round(Ne)}px`,left:`${Math.round(me)}px`}}function _(){u.value=!1,R(),document.removeEventListener("mousedown",f),document.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}Ut(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)});function b(){o("copyAll"),_()}function v(){o("copyFinalSummary"),_()}const g=se(!1);function k(){s.sessionId&&navigator.clipboard.writeText(s.sessionId).then(()=>{g.value=!0,setTimeout(()=>{g.value=!1},1200)}).catch(()=>{})}const $=se(!1),A=se(""),w=se(null);async function x(){if(_(),!!s.sessionId){$.value=!0,A.value=s.sessionTitle??"",await gt();try{w.value?.focus(),w.value?.select()}catch{}}}function I(){const V=A.value.trim();V&&s.sessionId&&V!==(s.sessionTitle??"").trim()&&o("renameSession",s.sessionId,V),$.value=!1}function L(){$.value=!1}function O(){s.sessionId&&(_(),o("forkSession",s.sessionId))}const P=se(!1);let B;function R(){clearTimeout(B),P.value=!1}function W(){if(s.sessionId){if(P.value){o("archiveSession",s.sessionId),_();return}P.value=!0,B=setTimeout(()=>{P.value=!1},2500)}}return(V,z)=>(C(),E("header",yU,[p("div",kU,[e.workspaceName?(C(),E("span",bU,N(e.workspaceName),1)):ce("",!0),e.workspaceName&&e.sessionTitle?(C(),E("span",_U,"/")):ce("",!0),$.value?Lt((C(),E("input",{key:2,ref_key:"renameInputRef",ref:w,"onUpdate:modelValue":z[0]||(z[0]=ie=>A.value=ie),class:"ch-rename",type:"text",onKeydown:[Eo(Ze(I,["stop"]),["enter"]),Eo(Ze(L,["stop"]),["esc"])],onBlur:I,onClick:z[1]||(z[1]=Ze(()=>{},["stop"]))},null,40,wU)),[[Tn,A.value]]):e.sessionTitle?(C(),E("span",{key:3,class:"ch-ses",title:e.sessionTitle},N(e.sessionTitle),9,SU)):ce("",!0)]),p("button",{ref_key:"kebabRef",ref:d,type:"button",class:$e(["ch-act ch-act-more",{open:u.value}]),title:T(n)("header.options"),"aria-label":T(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:z[2]||(z[2]=Ze(ie=>S(ie),["stop"]))},[...z[6]||(z[6]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"3",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,CU),u.value?(C(),E("div",{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Dt(m.value),onClick:z[3]||(z[3]=Ze(()=>{},["stop"]))},[p("button",{type:"button",class:"chm-item",onClick:Ze(b,["stop"])},N(e.copied?T(n)("header.copied"):T(n)("header.copyAll")),1),p("button",{type:"button",class:"chm-item",onClick:Ze(v,["stop"])},N(T(n)("header.copyFinalSummary")),1),e.sessionId?(C(),E(Le,{key:0},[z[7]||(z[7]=p("div",{class:"chm-divider"},null,-1)),p("button",{type:"button",class:"chm-item",onClick:Ze(k,["stop"])},[p("span",null,N(g.value?T(n)("header.copied"):T(n)("header.copySessionId")),1)]),p("button",{type:"button",class:"chm-item",onClick:Ze(x,["stop"])},N(T(n)("header.renameSession")),1),p("button",{type:"button",class:"chm-item",onClick:Ze(O,["stop"])},N(T(n)("header.forkSession")),1),p("button",{type:"button",class:"chm-item del",onClick:Ze(W,["stop"])},N(P.value?T(n)("header.confirmArchive"):T(n)("header.archiveSession")),1)],64)):ce("",!0)],4)):ce("",!0),z[9]||(z[9]=p("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(C(),E("button",{key:1,type:"button",class:"ch-git",title:T(n)("header.gitTooltip"),onClick:z[4]||(z[4]=ie=>o("openChanges"))},[p("span",{class:$e(["ch-branch",{"ch-detached":!e.branch}]),title:e.branch||T(n)("header.detached")},N(e.branch||T(n)("header.detached")),11,TU),i.value>0||r.value>0?(C(),E("span",MU,[i.value>0?(C(),E("span",AU,"↑"+N(i.value),1)):ce("",!0),r.value>0?(C(),E("span",EU,"↓"+N(r.value),1)):ce("",!0)])):ce("",!0),c.value?(C(),E("span",IU,[l.value>0?(C(),E("span",$U,"+"+N(l.value),1)):ce("",!0),a.value>0?(C(),E("span",NU,"-"+N(a.value),1)):ce("",!0)])):ce("",!0)],8,xU)):ce("",!0),e.pr?(C(),E("button",{key:2,type:"button",class:$e(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:T(n)("header.openPr"),onClick:z[5]||(z[5]=ie=>e.pr&&o("openPr",e.pr.url))},[z[8]||(z[8]=gr('<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-bb5e949f><circle cx="5" cy="6" r="3" data-v-bb5e949f></circle><path d="M5 9v12" data-v-bb5e949f></path><circle cx="19" cy="18" r="3" data-v-bb5e949f></circle><path d="m15 9-3-3 3-3" data-v-bb5e949f></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-bb5e949f></path></svg>',1)),p("span",null,"PR #"+N(e.pr.number)+" · "+N(e.pr.state),1)],10,LU)):ce("",!0)]))}}),PU=_t(OU,[["__scopeId","data-v-bb5e949f"]]),RU={key:0,class:"slash-menu",role:"listbox"},DU=["aria-selected","onMouseenter","onMousedown"],BU={class:"slash-name"},FU={class:"slash-desc"},HU=Je({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=se([]);return Ve(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(C(),E("div",RU,[(C(!0),E(Le,null,Qe(e.items,(a,c)=>(C(),E("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:$e(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:Ze(u=>o("select",a),["prevent"])},[p("span",BU,N(a.name),1),p("span",FU,N(a.isSkill?a.desc:T(n)(a.desc)),1)],42,DU))),128))])):ce("",!0)}}),WU=_t(HU,[["__scopeId","data-v-94bf2ae6"]]),UU={class:"mention-menu",role:"listbox"},qU={key:0,class:"mention-state dim"},jU={key:1,class:"mention-state dim"},zU=["aria-selected","onMouseenter","onMousedown"],VU=["innerHTML"],KU={class:"mention-name"},GU={class:"mention-path"},YU='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',XU='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><polyline points="5.5,5 2.5,8 5.5,11"/><polyline points="10.5,5 13.5,8 10.5,11"/></svg>',ZU='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><line x1="6" y1="8" x2="11" y2="8"/><line x1="6" y1="10.5" x2="11" y2="10.5"/></svg>',QU='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="3" width="12" height="10" rx="1"/><circle cx="5.5" cy="6.5" r="1.1"/><path d="M3 12l3.5-3.5L9 11l2-2 3 3"/></svg>',W_='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><polyline points="9,1.5 9,4.5 12,4.5"/></svg>',JU=Je({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=xt(),i=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),r=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),l=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function a(c){const u=c.path;if(u.endsWith("/"))return YU;const d=c.name||u.split("/").pop()||u,h=d.lastIndexOf("."),m=h>0?d.slice(h+1).toLowerCase():"";return m?i.has(m)?XU:r.has(m)?ZU:l.has(m)?QU:W_:W_}return(c,u)=>(C(),E("div",UU,[n.loading?(C(),E("div",qU,N(T(o)("mention.searching")),1)):n.items.length===0?(C(),E("div",jU,N(T(o)("mention.noMatch")),1)):(C(!0),E(Le,{key:2},Qe(n.items,(d,h)=>(C(),E("div",{key:d.path,class:$e(["mention-item",{active:h===n.activeIndex}]),role:"option","aria-selected":h===n.activeIndex,onMouseenter:m=>s("hover",h),onMousedown:Ze(m=>s("select",d),["prevent"])},[p("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,VU),p("span",KU,N(d.name),1),p("span",GU,N(d.path),1)],42,zU))),128))]))}}),eq=_t(JU,[["__scopeId","data-v-13371515"]]),oT=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/sessions",desc:"commands.sessions.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/provider",desc:"commands.provider.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function tq(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}function U_(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...oT,...t]}function nq(e,t=oT){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((s,o)=>{const i=s.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:s,index:o,score:r}}).filter(({score:s})=>s>0).sort((s,o)=>s.score!==o.score?o.score-s.score:s.index-o.index).map(({item:s})=>s)}function iT(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 q_(e,t){switch(iT(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const sq={key:0,class:"att-strip"},oq=["title","onClick"],iq=["src"],rq=["src","alt"],lq={key:2,class:"att-video-badge","aria-hidden":"true"},aq={class:"att-name"},cq=["aria-label"],uq=["title"],dq=["title","onClick"],fq={class:"att-lightbox-card"},hq=["title"],pq=["src"],mq=["src","alt"],gq={class:"att-lightbox-name"},vq={class:"composer-card"},yq={class:"cin-wrap"},kq={class:"input-row"},bq=["placeholder"],_q=["aria-label","title"],wq={class:"toolbar-left"},Sq=["title"],Cq=["title","onKeydown"],xq=["onClick"],Tq={class:"pd-check"},Mq={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Aq={class:"pd-info"},Eq={class:"pd-desc"},Iq=["title"],$q={class:"mode-label"},Nq={key:0,class:"mode-tag"},Lq={key:1,class:"mode-tag"},Oq={key:2,class:"mode-tag"},Pq={class:"mode-row-name"},Rq={class:"mode-row-name"},Dq={class:"mode-row-name"},Bq={key:0,class:"mode-row-actions"},Fq={class:"toolbar-right"},Hq=["title"],Wq={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Uq=["stroke-dasharray","stroke-dashoffset"],qq={class:"ctx-num"},jq=["title","onKeydown"],zq={key:0,class:"think-suffix"},Vq={key:0,class:"md-section"},Kq=["onClick"],Gq={class:"md-check"},Yq={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Xq={class:"md-name"},Zq={class:"md-provider"},Qq={key:1,class:"md-divider"},Jq={key:2,class:"md-section"},ej=["onClick"],tj={class:"md-check"},nj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},sj={class:"md-name"},oj={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},ij={key:3,class:"md-divider"},rj=["disabled"],lj={class:"md-check"},aj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},cj={class:"md-name"},uj={key:0,class:"md-note"},dj={key:1,class:"md-note"},fj={class:"md-name"},hj=Je({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=j(()=>s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=xt();function l(ne){return En(nk(ne))??""}function a(ne,Ee){const He=nk(ne);Ee?An(He,Ee):Rc(He)}const c=se(l(s.sessionId)),u=se(null);function d(){const ne=u.value;ne&&ne.style.removeProperty("height")}Ve(c,ne=>{gt(d),a(s.sessionId,ne)}),Ve(()=>s.sessionId,(ne,Ee)=>{ne!==Ee&&(a(Ee,c.value),c.value=l(ne),gt(d))});const h=se([]);let m=-1,f="";function y(ne){const Ee=ne.trim();m=-1,Ee&&h.value[h.value.length-1]!==Ee&&(h.value=[...h.value,Ee])}function S(){const ne=u.value;if(!ne)return!1;const Ee=ne.selectionStart??0;return ne.value.lastIndexOf(`
|
|
242
|
-
`,Ee-1)===-1}function _(ne){c.value=ne,gt(()=>{const Ee=u.value;if(!Ee)return;d();const He=ne.length;Ee.setSelectionRange(He,He)})}function b(){if(h.value.length!==0){if(m===-1)f=c.value,m=h.value.length-1;else if(m>0)m-=1;else return;_(h.value[m])}}function v(){m!==-1&&(m<h.value.length-1?(m+=1,_(h.value[m])):(m=-1,_(f)))}const g=se(!1),k=se([]),$=se(0);function A(){const ne=c.value;ne.startsWith("/")&&!ne.includes(" ")?(k.value=nq(ne,U_(s.skills)),$.value=0,g.value=k.value.length>0):g.value=!1}function w(ne){if(g.value=!1,ne.acceptsInput){c.value=`${ne.name} `,gt(()=>{const Ee=u.value;if(!Ee)return;const He=c.value.length;Ee.setSelectionRange(He,He),Ee.focus(),d()});return}c.value="",i("command",ne.name)}const x=se(!1),I=se([]),L=se(0),O=se(!1);let P=null;function B(){const ne=c.value,Ee=u.value?.selectionStart??ne.length;let He=Ee-1;for(;He>=0&&!/\s/.test(ne[He]);)He--;He++;const it=ne.slice(He,Ee);return it.startsWith("@")?{token:it.slice(1),start:He,end:Ee}:null}function R(){const ne=B();if(!ne||!s.searchFiles){x.value=!1;return}const Ee=ne.token;P!==null&&clearTimeout(P),P=setTimeout(async()=>{O.value=!0,x.value=!0,L.value=0;try{const He=await s.searchFiles(Ee);I.value=He}catch{I.value=[]}finally{O.value=!1}},200)}function W(ne){const Ee=B();if(!Ee)return;const He=c.value;c.value=He.slice(0,Ee.start)+ne.path+He.slice(Ee.end),x.value=!1,gt(()=>{const it=u.value;if(!it)return;const Ke=Ee.start+ne.path.length;it.setSelectionRange(Ke,Ke),it.focus(),d()})}function V(){m=-1,A(),R()}const z=se([]),ie=se(null),ae=se(null),re=se(!1);let Te=0;function Pe(){return`att_${++Te}`}function We(ne){try{URL.revokeObjectURL(ne.previewUrl)}catch{}}function Ne(ne){return ne.startsWith("image/")?"image":ne.startsWith("video/")?"video":null}async function me(ne){if(!s.uploadImage)return;const Ee=ne.map(He=>({file:He,kind:Ne(He.type)})).filter(He=>He.kind!==null);if(Ee.length!==0)for(const{file:He,kind:it}of Ee){const Ke=Pe(),H=URL.createObjectURL(He),Q={localId:Ke,name:He.name,kind:it,previewUrl:H,uploading:!0};z.value=[...z.value,Q],s.uploadImage(He,He.name).then(Ce=>{z.value=z.value.map(Be=>Be.localId===Ke?{...Be,uploading:!1,fileId:Ce?.fileId,error:Ce===null}:Be)}).catch(()=>{z.value=z.value.map(Ce=>Ce.localId===Ke?{...Ce,uploading:!1,error:!0}:Ce)})}}function be(ne){const Ee=z.value.find(He=>He.localId===ne);ie.value?.localId===ne&&(ie.value=null),Ee&&We(Ee),z.value=z.value.filter(He=>He.localId!==ne)}function Se(ne){ie.value=ne}function fe(){ie.value=null}function K(){ae.value?.click()}function Z(ne){const Ee=ne.target,He=Array.from(Ee.files??[]);me(He),Ee.value=""}function pe(ne){if(!s.uploadImage)return;const Ee=ne.clipboardData;if(!Ee)return;const He=[],it=new Set,Ke=(H,Q)=>{const Ce=`${H.size}:${H.type}:${Q}`;if(it.has(Ce))return;it.add(Ce);const Be=H.type.split("/")[1]??"png",nt=Q.includes(".")?Q:`paste-${Date.now()}.${Be}`;He.push(H instanceof File?H:new File([H],nt,{type:H.type}))};for(const H of Array.from(Ee.items))if(H.kind==="file"&&Ne(H.type)){const Q=H.getAsFile();Q&&Ke(Q,Q.name||`paste-${Date.now()}.${H.type.split("/")[1]??"png"}`)}for(const H of Array.from(Ee.files))Ne(H.type)&&Ke(H,H.name);He.length!==0&&(ne.preventDefault(),me(He))}function D(ne){!s.uploadImage||!Array.from(ne.dataTransfer?.items??[]).some(He=>He.kind==="file")||(ne.preventDefault(),re.value=!0)}function X(){re.value=!1}function oe(ne){if(re.value=!1,!s.uploadImage)return;ne.preventDefault();const Ee=Array.from(ne.dataTransfer?.files??[]);me(Ee)}ln(()=>{document.addEventListener("paste",pe),c.value&>(d)}),Ut(()=>{document.removeEventListener("paste",pe),document.removeEventListener("mousedown",co);for(const ne of z.value)We(ne);ie.value=null,de()});function te(ne){c.value=ne,gt(()=>{const Ee=u.value;if(!Ee)return;Ee.focus();const He=ne.length;Ee.setSelectionRange(He,He),d()})}t({loadForEdit:te});function ue(){const ne=c.value.trim();if(z.value.some(it=>it.uploading))return;const Ee=z.value.filter(it=>!it.uploading&&!it.error&&it.fileId);if(!ne&&Ee.length===0)return;if(ne){const it=tq(ne),Ke=it?U_(s.skills).some(H=>H.name===it.cmd):!1;if(it&&Ke){c.value="",g.value=!1,i("command",it.arg?`${it.cmd} ${it.arg}`:it.cmd);return}}const He={text:ne,attachments:Ee.map(it=>({fileId:it.fileId,kind:it.kind}))};ie.value=null;for(const it of z.value)We(it);z.value=[],y(ne),c.value="",g.value=!1,x.value=!1,i("submit",He)}function U(){if(!s.running||z.value.some(it=>it.uploading))return;const ne=c.value.trim(),Ee=z.value.filter(it=>!it.uploading&&!it.error&&it.fileId);if(!ne&&Ee.length===0&&s.queued.length===0)return;const He={text:ne,attachments:Ee.map(it=>({fileId:it.fileId,kind:it.kind}))};for(const it of z.value)We(it);z.value=[],y(ne),c.value="",g.value=!1,x.value=!1,i("steer",He)}let q=!1,J=null;function de(){J!==null&&(clearTimeout(J),J=null)}function ge(){de(),q=!0}function Me(){de(),J=setTimeout(()=>{J=null,q=!1},0)}function le(ne){return q||ne.isComposing||ne.keyCode===229}function _e(ne){if(!le(ne)){if(ne.key==="Escape"){if(ot.value){ne.preventDefault(),Mt();return}if(Ye.value){ne.preventDefault(),fn();return}}if(g.value){if(ne.key==="ArrowDown"){ne.preventDefault(),$.value=($.value+1)%k.value.length;return}if(ne.key==="ArrowUp"){ne.preventDefault(),$.value=($.value-1+k.value.length)%k.value.length;return}if(ne.key==="Enter"||ne.key==="Tab"){ne.preventDefault();const Ee=k.value[$.value];Ee&&w(Ee);return}if(ne.key==="Escape"){ne.preventDefault(),g.value=!1;return}}if(x.value&&!O.value){if(ne.key==="ArrowDown"){ne.preventDefault(),L.value=(L.value+1)%Math.max(1,I.value.length);return}if(ne.key==="ArrowUp"){ne.preventDefault(),L.value=(L.value-1+Math.max(1,I.value.length))%Math.max(1,I.value.length);return}if(ne.key==="Enter"||ne.key==="Tab"){ne.preventDefault();const Ee=I.value[L.value];Ee&&W(Ee);return}if(ne.key==="Escape"){ne.preventDefault(),x.value=!1;return}}if(ne.key==="s"&&(ne.ctrlKey||ne.metaKey)&&!ne.shiftKey&&!ne.altKey){s.running&&(ne.preventDefault(),U());return}if(!g.value&&!x.value&&!ne.shiftKey&&!ne.altKey&&!ne.metaKey&&!ne.ctrlKey){const Ee=m!==-1;if(ne.key==="ArrowUp"&&h.value.length>0&&(Ee||S())){ne.preventDefault(),b();return}if(ne.key==="ArrowDown"&&Ee){ne.preventDefault(),v();return}}ne.key==="Enter"&&!ne.shiftKey&&(ne.preventDefault(),ue())}}const ze=j(()=>s.running?r("composer.interrupt"):r("composer.send")),Xe=j(()=>!!s.uploadImage),ot=se(!1),Ye=se(!1),mt=se(null);function It(){ot.value=!ot.value,ot.value?(Ye.value=!1,document.addEventListener("click",un,!0)):document.removeEventListener("click",un,!0)}function Mt(){ot.value=!1,Ye.value||document.removeEventListener("click",un,!0)}function Kt(){Ye.value=!Ye.value,Ye.value?(ot.value=!1,document.addEventListener("click",un,!0)):document.removeEventListener("click",un,!0)}function fn(){Ye.value=!1,ot.value||document.removeEventListener("click",un,!0)}function un(ne){mt.value&&!mt.value.contains(ne.target)&&(Mt(),fn())}Ut(()=>{document.removeEventListener("click",un,!0)});const Ge=ne=>`${Math.round(ne/1e3)}k`,Pt=j(()=>{const ne=s.status?.ctxMax??0;return ne<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/ne*100)))}),Gn=j(()=>{const ne=(s.status?.ctxUsed??0).toLocaleString(),Ee=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:ne,max:Ee,pct:Pt.value})}),_n=j(()=>Pt.value>=80),In=j(()=>{const ne=s.status?.modelId??s.status?.model??"";return s.models?.find(Ee=>Ee.id===ne||Ee.model===ne||Ee.displayName===s.status?.model)}),On=j(()=>iT(In.value)),as=j(()=>On.value==="toggle"),ks=j(()=>On.value==="always-on"?!0:On.value==="unsupported"?!1:(s.thinking??"off")!=="off");function bs(){as.value&&i("setThinking",ks.value?"off":"high")}const $s=j(()=>s.planMode===!0),Jn=j(()=>s.swarmMode===!0),wn=j(()=>s.activationBadges?.goal!==null),on=j(()=>wn.value||s.goalMode===!0),Un=se(!1),Tt=se(null),$n=se(null),Gt=se({}),js=j(()=>$s.value||Jn.value||on.value);function Po(){Un.value=!1,document.removeEventListener("mousedown",co)}function co(ne){const Ee=ne.target;Tt.value?.contains(Ee)||$n.value?.contains(Ee)||Po()}function zs(){if(Un.value){Po();return}const ne=Tt.value?.getBoundingClientRect();ne&&(Gt.value={left:`${Math.round(ne.left)}px`,bottom:`${Math.round(window.innerHeight-ne.top+8)}px`}),Un.value=!0,setTimeout(()=>document.addEventListener("mousedown",co),0)}const uo=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--warn)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--err)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function fo(ne){i("setPermission",ne),fn()}const wt=j(()=>uo.find(ne=>ne.mode===s.status?.permission)),ho=j(()=>wt.value?r(wt.value.labelKey):""),es=j(()=>In.value?.provider??""),Ns=j(()=>!es.value||!s.models?.length?[]:s.models.filter(ne=>ne.provider===es.value)),gn=j(()=>new Set(s.starredIds??[]));function vn(ne){return gn.value.has(ne)}const Ie=j(()=>s.models?.length?s.models.filter(ne=>vn(ne.id)&&ne.provider!==es.value):[]);function ve(ne){i("selectModel",ne),Mt()}return(ne,Ee)=>(C(),E("div",{class:$e(["composer",{"drag-over":re.value}]),onDragover:D,onDragleave:X,onDrop:oe},[z.value.length>0?(C(),E("div",sq,[(C(!0),E(Le,null,Qe(z.value,He=>(C(),E("div",{key:He.localId,class:$e(["att-chip",{"att-error":He.error}])},[p("button",{type:"button",class:"att-preview",title:T(r)("composer.previewAttachment",{name:He.name}),onClick:it=>Se(He)},[He.kind==="video"?(C(),E("video",{key:0,class:"att-thumb",src:He.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,iq)):(C(),E("img",{key:1,class:"att-thumb",src:He.previewUrl,alt:He.name},null,8,rq)),He.kind==="video"?(C(),E("span",lq,[...Ee[14]||(Ee[14]=[p("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[p("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):ce("",!0)],8,oq),p("span",aq,N(He.name),1),He.uploading?(C(),E("span",{key:0,class:"att-spinner","aria-label":T(r)("composer.uploading")},[...Ee[15]||(Ee[15]=[p("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[p("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),p("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,cq)):He.error?(C(),E("span",{key:1,class:"att-err-icon",title:T(r)("composer.uploadFailed")},[...Ee[16]||(Ee[16]=[p("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[p("circle",{cx:"6",cy:"6",r:"5"}),p("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),p("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,uq)):ce("",!0),p("button",{class:"att-rm",title:T(r)("composer.removeNamed",{name:He.name}),onClick:it=>be(He.localId)},[...Ee[17]||(Ee[17]=[p("svg",{viewBox:"0 0 12 12",width:"9",height:"9",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,dq)],2))),128))])):ce("",!0),ie.value?(C(),E("div",{key:1,class:"att-lightbox",onClick:Ze(fe,["self"])},[p("div",fq,[p("button",{type:"button",class:"att-lightbox-close",title:T(r)("model.close"),onClick:fe},"✕",8,hq),ie.value.kind==="video"?(C(),E("video",{key:0,class:"att-lightbox-media",src:ie.value.previewUrl,controls:"",playsinline:""},null,8,pq)):(C(),E("img",{key:1,class:"att-lightbox-media",src:ie.value.previewUrl,alt:ie.value.name},null,8,mq)),p("div",gq,N(ie.value.name),1)])])):ce("",!0),p("div",vq,[p("div",yq,[g.value?(C(),je(WU,{key:0,items:k.value,"active-index":$.value,onSelect:w,onHover:Ee[0]||(Ee[0]=He=>$.value=He)},null,8,["items","active-index"])):ce("",!0),x.value?(C(),je(eq,{key:1,items:I.value,"active-index":L.value,loading:O.value,onSelect:W,onHover:Ee[1]||(Ee[1]=He=>L.value=He)},null,8,["items","active-index","loading"])):ce("",!0),p("div",kq,[Lt(p("textarea",{ref_key:"textareaRef",ref:u,"onUpdate:modelValue":Ee[2]||(Ee[2]=He=>c.value=He),class:"ph",placeholder:o.value,rows:"1",onKeydown:_e,onCompositionstart:ge,onCompositionend:Me,onInput:V},null,40,bq),[[Tn,c.value]]),p("button",{class:$e(["send",{aborting:e.running}]),"aria-label":ze.value,title:e.running?T(r)("composer.interruptTitle"):ze.value,onClick:Ee[3]||(Ee[3]=He=>e.running?i("interrupt"):ue())},[(C(),E("svg",{class:$e(["send-icon",{hidden:e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...Ee[18]||(Ee[18]=[p("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(C(),E("svg",{class:$e(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...Ee[19]||(Ee[19]=[p("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,_q)])]),Xe.value?(C(),E("input",{key:0,ref_key:"fileInputRef",ref:ae,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:Z},null,544)):ce("",!0),p("div",{ref_key:"toolbarRef",ref:mt,class:"toolbar"},[p("div",wq,[Xe.value?(C(),E("button",{key:0,class:"attach-btn",title:T(r)("composer.attachImage"),type:"button",onClick:K},[...Ee[20]||(Ee[20]=[p("svg",{class:"attach-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},[p("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Sq)):ce("",!0),e.status?(C(),E("span",{key:1,class:$e(["perm-pill",["perm-"+e.status.permission,{open:Ye.value}]]),role:"button",tabindex:"0",title:T(r)("status.permissionTooltip"),onClick:Ze(Kt,["stop"]),onKeydown:[Eo(Kt,["enter"]),Eo(Ze(Kt,["prevent"]),["space"])]},N(ho.value),43,Cq)):ce("",!0),Ye.value&&e.status?(C(),E("div",{key:2,class:"perm-dropdown",role:"menu",onClick:Ee[4]||(Ee[4]=Ze(()=>{},["stop"]))},[(C(),E(Le,null,Qe(uo,He=>p("button",{key:He.mode,class:$e(["pd-row",{"is-current":He.mode===e.status.permission}]),role:"menuitem",onClick:it=>fo(He.mode)},[p("span",Tq,[He.mode===e.status.permission?(C(),E("svg",Mq,[...Ee[21]||(Ee[21]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ce("",!0)]),p("span",Aq,[p("span",{class:"pd-name",style:Dt({color:He.color})},N(T(r)(He.labelKey)),5),p("span",Eq,N(T(r)(He.descKey)),1)])],10,xq)),64))])):ce("",!0),e.status?(C(),E("div",{key:3,ref_key:"modesRef",ref:Tt,class:"modes"},[p("button",{type:"button",class:$e(["mode-pill",{on:js.value}]),title:T(r)("status.modesTooltip"),onClick:Ze(zs,["stop"])},[p("span",$q,N(T(r)("status.modesLabel")),1),$s.value?(C(),E("span",Nq,N(T(r)("status.planLabel")),1)):ce("",!0),Jn.value?(C(),E("span",Lq,N(T(r)("status.swarmLabel")),1)):ce("",!0),on.value?(C(),E("span",Oq,N(T(r)("status.goalLabel")),1)):ce("",!0)],10,Iq),Un.value?(C(),E("div",{key:0,ref_key:"modesMenuRef",ref:$n,class:"modes-menu",style:Dt(Gt.value)},[p("button",{type:"button",class:$e(["mode-row",{on:$s.value}]),onClick:Ee[5]||(Ee[5]=He=>i("togglePlan"))},[p("span",Pq,N(T(r)("status.planLabel")),1),p("span",{class:$e(["mode-switch",{on:$s.value}])},[...Ee[22]||(Ee[22]=[p("span",{class:"mode-knob"},null,-1)])],2)],2),p("button",{type:"button",class:$e(["mode-row",{on:Jn.value}]),onClick:Ee[6]||(Ee[6]=He=>i("toggleSwarm"))},[p("span",Rq,N(T(r)("status.swarmLabel")),1),p("span",{class:$e(["mode-switch",{on:Jn.value}])},[...Ee[23]||(Ee[23]=[p("span",{class:"mode-knob"},null,-1)])],2)],2),p("div",{class:$e(["mode-row mode-row-goal",{on:wn.value||s.goalMode}])},[p("button",{type:"button",class:"mode-row-main",onClick:Ee[7]||(Ee[7]=He=>wn.value?i("controlGoal","cancel"):i("toggleGoal"))},[p("span",Dq,N(T(r)("status.goalLabel")),1),wn.value?ce("",!0):(C(),E("span",{key:0,class:$e(["mode-switch",{on:s.goalMode}])},[...Ee[24]||(Ee[24]=[p("span",{class:"mode-knob"},null,-1)])],2))]),wn.value?(C(),E("div",Bq,[p("button",{type:"button",class:"mode-row-action",onClick:Ee[8]||(Ee[8]=He=>i("controlGoal","pause"))},N(T(r)("status.goalPause")),1),p("button",{type:"button",class:"mode-row-action",onClick:Ee[9]||(Ee[9]=He=>i("controlGoal","resume"))},N(T(r)("status.goalResume")),1)])):ce("",!0)],2)],4)):ce("",!0)],512)):ce("",!0)]),p("div",Fq,[_n.value?(C(),E("button",{key:0,class:"compact-chip",onClick:Ee[10]||(Ee[10]=Ze(He=>i("compact"),["stop"]))},"/compact")):ce("",!0),e.status&&!e.hideContext?(C(),E("span",{key:1,class:"ctx-group",title:Gn.value},[(C(),E("svg",Wq,[Ee[25]||(Ee[25]=p("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),p("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${2*Math.PI*7}`,"stroke-dashoffset":`${2*Math.PI*7*(1-Pt.value/100)}`},null,8,Uq)])),p("span",qq,N(Ge(e.status.ctxUsed))+"/"+N(Ge(e.status.ctxMax)),1)],8,Hq)):ce("",!0),e.status?(C(),E("span",{key:2,class:$e(["model-pill",{open:ot.value}]),role:"button",tabindex:"0",title:T(r)("status.modelTooltip"),onClick:Ze(It,["stop"]),onKeydown:[Eo(It,["enter"]),Eo(Ze(It,["prevent"]),["space"])]},[p("b",null,N(e.status.model),1),ks.value?(C(),E("span",zq,N(T(r)("composer.thinkingSuffix")),1)):ce("",!0),Ee[26]||(Ee[26]=p("svg",{class:"cv",viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M4 6l4 4 4-4"})],-1))],42,jq)):ce("",!0)]),ot.value&&e.status?(C(),E("div",{key:0,class:"model-dropdown",role:"menu",onClick:Ee[13]||(Ee[13]=Ze(()=>{},["stop"]))},[Ie.value.length>0?(C(),E("div",Vq,N(T(r)("status.starredModels")),1)):ce("",!0),(C(!0),E(Le,null,Qe(Ie.value,He=>(C(),E("button",{key:He.id,class:$e(["md-row",{"is-current":He.id===e.status.modelId}]),role:"menuitem",onClick:it=>ve(He.id)},[p("span",Gq,[He.id===e.status.model||He.model===e.status.model||He.displayName===e.status.model?(C(),E("svg",Yq,[...Ee[27]||(Ee[27]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ce("",!0)]),p("span",Xq,N(He.displayName??He.model),1),p("span",Zq,N(He.provider),1),Ee[28]||(Ee[28]=p("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[p("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})],-1))],10,Kq))),128)),Ie.value.length>0?(C(),E("div",Qq)):ce("",!0),Ns.value.length>0?(C(),E("div",Jq,N(es.value),1)):ce("",!0),(C(!0),E(Le,null,Qe(Ns.value,He=>(C(),E("button",{key:He.id,class:$e(["md-row",{"is-current":He.id===e.status.modelId}]),role:"menuitem",onClick:it=>ve(He.id)},[p("span",tj,[He.id===e.status.model||He.model===e.status.model||He.displayName===e.status.model?(C(),E("svg",nj,[...Ee[29]||(Ee[29]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ce("",!0)]),p("span",sj,N(He.displayName??He.model),1),vn(He.id)?(C(),E("svg",oj,[...Ee[30]||(Ee[30]=[p("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):ce("",!0)],10,ej))),128)),Ns.value.length>0?(C(),E("div",ij)):ce("",!0),p("button",{class:$e(["md-row md-row-toggle",{"is-on":ks.value,"is-disabled":!as.value}]),role:"menuitem",disabled:!as.value,onClick:Ee[11]||(Ee[11]=He=>bs())},[p("span",lj,[ks.value?(C(),E("svg",aj,[...Ee[31]||(Ee[31]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ce("",!0)]),p("span",cj,N(T(r)("status.thinkingLabel")),1),On.value==="always-on"?(C(),E("span",uj,N(T(r)("status.planOn")),1)):On.value==="unsupported"?(C(),E("span",dj,N(T(r)("status.modeNotSupported")),1)):ce("",!0)],10,rj),Ee[32]||(Ee[32]=p("div",{class:"md-divider"},null,-1)),p("button",{class:"md-row md-row-more",role:"menuitem",onClick:Ee[12]||(Ee[12]=He=>{Mt(),i("pickModel")})},[p("span",fj,N(T(r)("status.moreModels")),1)])])):ce("",!0)],512)])],34))}}),rT=_t(hj,[["__scopeId","data-v-ca19a6c6"]]),pj=["id"],mj={class:"swarm-head"},gj={class:"swarm-count"},vj={class:"swarm-grid"},yj={class:"member-top"},kj={class:"member-name"},bj={class:"member-phase"},_j={class:"member-mid"},wj={class:"member-bar"},Sj={key:0,class:"member-type"},Cj={key:0,class:"member-bottom"},xj=Je({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=j(()=>t.group.members.length),s=j(()=>t.group.counts.completed+t.group.counts.failed);function o(l){switch(l){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function i(l){switch(l.phase){case"queued":return"......";case"working":return":::...";case"suspended":return"::....";case"completed":return"::::::";case"failed":return"!!...."}}function r(l){return l.outputLines?.map(a=>a.trimEnd()).filter(Boolean).at(-1)}return(l,a)=>(C(),E("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[p("header",mj,[a[0]||(a[0]=p("div",{class:"swarm-title"},[p("span",{class:"swarm-mark","aria-hidden":"true"}),p("span",null,"Swarm")],-1)),p("div",gj,N(s.value)+"/"+N(n.value),1)]),p("div",vj,[(C(!0),E(Le,null,Qe(e.group.members,c=>(C(),E("article",{key:c.id,class:$e(["swarm-member",`phase-${c.phase}`])},[p("div",yj,[p("span",kj,N(c.name),1),p("span",bj,N(o(c.phase)),1)]),p("div",_j,[p("span",wj,N(i(c)),1),c.subagentType?(C(),E("span",Sj,N(c.subagentType),1)):ce("",!0)]),c.suspendedReason||r(c)||c.summary?(C(),E("div",Cj,N(c.suspendedReason||r(c)||c.summary),1)):ce("",!0)],2))),128))])],8,pj))}}),Tj=_t(xj,[["__scopeId","data-v-6ae42022"]]),Mj={class:"goal-progress","aria-hidden":"true"},Aj={key:0,class:"goal-body"},Ej={class:"goal-full"},Ij={key:0,class:"goal-criterion"},$j={class:"goal-stats"},Nj={key:0},Lj={class:"goal-actions"},Oj=Je({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=xt(),i=se(!1);Ve(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=j(()=>{const a=n.goal.budget.tokenBudget;return!a||a<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/a*100)))});function l(a){const c=Math.max(0,Math.round(a/1e3)),u=Math.floor(c/60),d=c%60;return u<=0?`${d}s`:u<60?`${u}m ${d}s`:`${Math.floor(u/60)}h ${u%60}m`}return(a,c)=>(C(),E("section",{class:$e(["goal-strip",{expanded:i.value}])},[p("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=p("span",{class:"goal-kicker"},"Goal",-1)),p("span",{class:$e(["goal-objective",{"expanded-hidden":i.value}])},N(e.goal.objective),3),p("span",{class:$e(["goal-status",`status-${e.goal.status}`])},N(e.goal.status),3),p("span",Mj,[p("span",{class:"goal-progress-fill",style:Dt({width:`${r.value}%`})},null,4)]),(C(),E("svg",{class:$e(["goal-chevron",{open:i.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...c[4]||(c[4]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(C(),E("div",Aj,[p("div",Ej,N(e.goal.objective),1),e.goal.completionCriterion?(C(),E("div",Ij,[c[6]||(c[6]=p("span",null,"Done when",-1)),p("p",null,N(e.goal.completionCriterion),1)])):ce("",!0),p("div",$j,[p("span",null,N(e.goal.turnsUsed)+" turns",1),p("span",null,N(e.goal.tokensUsed.toLocaleString())+" tokens",1),p("span",null,N(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(C(),E("span",Nj,N(r.value)+"% token budget",1)):ce("",!0)]),p("div",Lj,[e.goal.status!=="paused"?(C(),E("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ze(u=>s("controlGoal","pause"),["stop"]))},N(T(o)("status.goalPause")),1)):ce("",!0),e.goal.status==="paused"?(C(),E("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ze(u=>s("controlGoal","resume"),["stop"]))},N(T(o)("status.goalResume")),1)):ce("",!0),p("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ze(u=>s("controlGoal","cancel"),["stop"]))},N(T(o)("status.goalCancel")),1)])])):ce("",!0)],2))}}),Pj=_t(Oj,[["__scopeId","data-v-bca1710c"]]),Rj={class:"qh"},Dj={class:"qtitle"},Bj={class:"qstep"},Fj=["disabled"],Hj=["disabled"],Wj={key:1,class:"qmin-peek"},Uj=["title","aria-label"],qj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},jj={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},zj={key:0,class:"qbody"},Vj={key:0,class:"qheader-chip"},Kj={class:"qtext"},Gj={class:"qopts"},Yj=["onClick"],Xj={class:"qopt-key"},Zj={class:"qopt-glyph"},Qj={key:0,class:"chk"},Jj={key:1,class:"rad"},ez={class:"qopt-text"},tz={class:"qopt-label"},nz={key:0,class:"qopt-desc"},sz={class:"qopt-glyph"},oz={key:0,class:"chk"},iz={key:1,class:"rad"},rz={class:"qopt-label"},lz=["placeholder"],az={key:1,class:"qfooter"},cz=["disabled"],uz=Je({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=xt(),o=t,i=se(0),r=se(!1),l=j(()=>n.question.questions[i.value]),a=j(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}const d=se({});function h(w){return w.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${w.label} ${w.description??""}`.toLowerCase())}function m(){const w={...d.value};let x=!1;for(const I of n.question.questions){if(w[I.id])continue;const L=I.options.filter(h);L.length!==0&&(w[I.id]=I.multiSelect?{kind:"multi",optionIds:L.map(O=>O.id)}:{kind:"single",optionId:L[0].id},x=!0)}x&&(d.value=w)}Ve(()=>n.question.questionId,()=>{i.value=0,r.value=!1,d.value={},S.value={}}),Ve(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),m()},{immediate:!0,deep:!0});function f(w,x){const I=d.value[w];if(I&&I.kind==="single"&&I.optionId===x){const L={...d.value};delete L[w],d.value=L}else d.value={...d.value,[w]:{kind:"single",optionId:x}}}function y(w,x){const I=d.value[w],L=I&&(I.kind==="multi"||I.kind==="multiWithOther")?I.kind==="multi"?[...I.optionIds]:[...I.optionIds]:[],O=L.indexOf(x);O>=0?L.splice(O,1):L.push(x);const P=d.value[w],B=P&&P.kind==="multiWithOther"?P.otherText:"";B?d.value={...d.value,[w]:{kind:"multiWithOther",optionIds:L,otherText:B}}:d.value={...d.value,[w]:{kind:"multi",optionIds:L}}}const S=se({});function _(w){const x=n.question.questions.find(L=>L.id===w),I=S.value[w]??"";if(x.multiSelect){const L=d.value[w],O=L&&(L.kind==="multi"||L.kind==="multiWithOther")?L.kind==="multi"?[...L.optionIds]:[...L.optionIds]:[];d.value={...d.value,[w]:{kind:"multiWithOther",optionIds:O,otherText:I}}}else d.value={...d.value,[w]:{kind:"other",text:I}}}function b(w,x){const I=d.value[w];return I?I.kind==="single"?I.optionId===x:I.kind==="multi"||I.kind==="multiWithOther"?I.optionIds.includes(x):!1:!1}function v(w){const x=d.value[w];return!!(x&&(x.kind==="other"||x.kind==="multiWithOther"))}function g(){return n.question.questions.every(w=>{const x=d.value[w.id];return x?x.kind==="multi"?x.optionIds.length>0:x.kind==="multiWithOther"?x.optionIds.length>0||x.otherText.trim().length>0:x.kind==="other"?x.text.trim().length>0:!0:!1})}function k(){if(!g())return;const w={answers:d.value,method:"click"};o("answer",n.question.questionId,w)}function $(){o("dismiss",n.question.questionId)}function A(w){const x=(document.activeElement?.tagName??"").toLowerCase();if(x==="input"||x==="textarea"||r.value&&w.key!=="Escape")return;if(w.key==="Escape"){w.preventDefault(),$();return}if(w.key==="Enter"){w.preventDefault(),k();return}const I=parseInt(w.key,10);if(!isNaN(I)&&I>=1&&I<=9){w.preventDefault();const L=l.value,O=I-1,P=L.options[O];P&&(L.multiSelect?y(L.id,P.id):f(L.id,P.id))}}return ln(()=>document.addEventListener("keydown",A)),Ut(()=>document.removeEventListener("keydown",A)),(w,x)=>(C(),E("div",{class:$e(["qcard",{minimized:r.value}])},[p("div",Rj,[p("span",Dj,N(T(s)("question.title")),1),a.value>1&&!r.value?(C(),E(Le,{key:0},[p("span",Bj,N(T(s)("question.step",{current:i.value+1,total:a.value})),1),p("button",{class:"qnav",disabled:i.value===0,onClick:c},N(T(s)("question.prev")),9,Fj),p("button",{class:"qnav",disabled:i.value===a.value-1,onClick:u},N(T(s)("question.next")),9,Hj)],64)):ce("",!0),r.value?(C(),E("span",Wj,N(l.value.question),1)):ce("",!0),p("button",{class:"qmin",title:r.value?T(s)("question.expand"):T(s)("question.minimize"),"aria-label":r.value?T(s)("question.expand"):T(s)("question.minimize"),onClick:x[0]||(x[0]=I=>r.value=!r.value)},[r.value?(C(),E("svg",qj,[...x[4]||(x[4]=[p("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),E("svg",jj,[...x[5]||(x[5]=[p("path",{d:"M3 8h10"},null,-1)])]))],8,Uj)]),r.value?ce("",!0):(C(),E("div",zj,[l.value.header?(C(),E("div",Vj,N(l.value.header),1)):ce("",!0),p("div",Kj,N(l.value.question),1),l.value.body?(C(),je(_f,{key:1,text:l.value.body,class:"qmdbody"},null,8,["text"])):ce("",!0),p("div",Gj,[(C(!0),E(Le,null,Qe(l.value.options,(I,L)=>(C(),E("label",{key:I.id,class:$e(["qopt",{selected:b(l.value.id,I.id)}]),onClick:Ze(O=>l.value.multiSelect?y(l.value.id,I.id):f(l.value.id,I.id),["prevent"])},[p("span",Xj,N(L+1),1),p("span",Zj,[l.value.multiSelect?(C(),E("span",Qj,N(b(l.value.id,I.id)?"■":"□"),1)):(C(),E("span",Jj,N(b(l.value.id,I.id)?"●":"○"),1))]),p("span",ez,[p("span",tz,N(I.label),1),I.description?(C(),E("span",nz,N(I.description),1)):ce("",!0)])],10,Yj))),128)),l.value.allowOther?(C(),E("label",{key:0,class:$e(["qopt",{selected:v(l.value.id)}]),onClick:Ze(()=>{},["prevent"])},[x[6]||(x[6]=p("span",{class:"qopt-key"},null,-1)),p("span",sz,[l.value.multiSelect?(C(),E("span",oz,N(v(l.value.id)?"■":"□"),1)):(C(),E("span",iz,N(v(l.value.id)?"●":"○"),1))]),p("span",rz,N(l.value.otherLabel??T(s)("question.otherDefault")),1),Lt(p("input",{"onUpdate:modelValue":x[1]||(x[1]=I=>S.value[l.value.id]=I),class:"other-input",type:"text",placeholder:l.value.otherLabel??T(s)("question.otherDefault"),onInput:x[2]||(x[2]=I=>_(l.value.id)),onFocus:x[3]||(x[3]=I=>_(l.value.id))},null,40,lz),[[Tn,S.value[l.value.id]]])],2)):ce("",!0)])])),r.value?ce("",!0):(C(),E("div",az,[p("button",{class:"qbtn pri",disabled:!g(),onClick:k},N(T(s)("question.submit")),9,cz),p("button",{class:"qbtn",onClick:$},N(T(s)("question.dismiss")),1)]))],2))}}),dz=_t(uz,[["__scopeId","data-v-e5fa2cb7"]]),fz={class:"ah"},hz={class:"akind"},pz={class:"apath"},mz={key:0,class:"abadge"},gz={key:1,class:"aw"},vz=["title","aria-label"],yz={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},kz={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},bz={key:0,class:"diff"},_z={class:"dg"},wz={class:"dc"},Sz={key:1,class:"body-shell"},Cz={class:"shell-cmd"},xz={key:0,class:"shell-cwd"},Tz={key:1,class:"shell-danger"},Mz={key:2,class:"body-file"},Az={class:"file-bar"},Ez={class:"file-lang"},Iz={class:"file-content"},$z={class:"file-ln"},Nz={class:"file-text"},Lz={key:3,class:"body-chip"},Oz={class:"chip-label"},Pz={class:"chip-value"},Rz={key:0,class:"chip-detail"},Dz={key:4,class:"body-chip"},Bz={key:0,class:"chip-label"},Fz={class:"chip-value"},Hz={key:5,class:"body-chip"},Wz={class:"chip-label"},Uz={class:"chip-value"},qz={key:0,class:"chip-detail"},jz={key:6,class:"body-chip"},zz={class:"chip-label"},Vz={class:"chip-value"},Kz={key:0,class:"chip-detail"},Gz={key:7,class:"body-todo"},Yz={class:"todo-glyph"},Xz={key:8,class:"body-generic"},Zz={class:"gen-text"},Qz={key:9,class:"feedback-wrap"},Jz=["placeholder"],eV={class:"feedback-hint"},tV={class:"abtn"},nV=Je({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=xt(),i=se(!1),r=["shell","diff","file","fileop","url","search","invocation","todo","generic"];function l(){const v=r.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${v}`)}const a=se(!1),c=se(""),u=se(null);function d(){a.value=!0,c.value="",setTimeout(()=>u.value?.focus(),0)}function h(){const v=c.value.trim();s("decide",{decision:"rejected",feedback:v||void 0}),a.value=!1,c.value=""}function m(){a.value=!1,c.value=""}function f(v){v.key==="Enter"&&!v.shiftKey?(v.preventDefault(),h()):v.key==="Escape"&&(v.preventDefault(),m())}function y(){s("decide",{decision:"approved"})}function S(){s("decide",{decision:"approved",scope:"session"})}function _(){s("decide",{decision:"rejected"})}function b(v){const g=(document.activeElement?.tagName??"").toLowerCase();g==="input"||g==="textarea"||i.value||(v.key==="1"?(v.preventDefault(),y()):v.key==="2"?(v.preventDefault(),S()):v.key==="3"?(v.preventDefault(),_()):v.key==="4"&&(v.preventDefault(),d()))}return ln(()=>document.addEventListener("keydown",b)),Ut(()=>document.removeEventListener("keydown",b)),(v,g)=>(C(),E("div",{class:$e(["appr",{minimized:i.value}])},[p("div",fz,[p("span",hz,N(l()),1),p("span",pz,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(C(),E(Le,{key:0},[vt(N(e.block.path),1)],64)):e.block.kind==="shell"?(C(),E(Le,{key:1},[vt(N(e.block.command),1)],64)):e.block.kind==="url"?(C(),E(Le,{key:2},[vt(N(e.block.url),1)],64)):e.block.kind==="search"?(C(),E(Le,{key:3},[vt(N(e.block.query),1)],64)):e.block.kind==="invocation"?(C(),E(Le,{key:4},[vt(N(e.block.name),1)],64)):e.block.kind==="generic"?(C(),E(Le,{key:5},[vt(N(e.block.summary),1)],64)):ce("",!0)]),e.agentName&&!i.value?(C(),E("span",mz,N(T(o)("approval.subagentBadge",{name:e.agentName})),1)):ce("",!0),i.value?ce("",!0):(C(),E("span",gz,N(T(o)("approval.required")),1)),p("button",{class:"amin",title:i.value?T(o)("question.expand"):T(o)("question.minimize"),"aria-label":i.value?T(o)("question.expand"):T(o)("question.minimize"),onClick:g[0]||(g[0]=k=>i.value=!i.value)},[i.value?(C(),E("svg",yz,[...g[2]||(g[2]=[p("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),E("svg",kz,[...g[3]||(g[3]=[p("path",{d:"M3 8h10"},null,-1)])]))],8,vz)]),i.value?ce("",!0):(C(),E(Le,{key:0},[e.block.kind==="diff"?(C(),E("div",bz,[(C(!0),E(Le,null,Qe(e.block.diff,(k,$)=>(C(),E("div",{key:$,class:$e(["dl",k.kind==="add"?"add":k.kind==="rem"?"del":""])},[p("span",_z,N(k.gutter),1),p("span",wz,N(k.text),1)],2))),128))])):e.block.kind==="shell"?(C(),E("div",Sz,[p("div",Cz,[g[4]||(g[4]=p("span",{class:"shell-dollar"},"$",-1)),vt(" "+N(e.block.command),1)]),e.block.cwd?(C(),E("div",xz,"cwd: "+N(e.block.cwd),1)):ce("",!0),e.block.danger?(C(),E("div",Tz,N(T(o)("approval.danger",{detail:e.block.danger})),1)):ce("",!0)])):e.block.kind==="file"?(C(),E("div",Mz,[p("div",Az,[p("span",Ez,N(e.block.language??""),1)]),p("div",Iz,[(C(!0),E(Le,null,Qe(e.block.content.split(`
|
|
243
|
-
`),(k,$)=>(C(),E("div",{key:$,class:"file-line"},[p("span",$z,N($+1),1),p("span",Nz,N(k),1)]))),128))])])):e.block.kind==="fileop"?(C(),E("div",Lz,[p("span",Oz,N(e.block.op),1),p("span",Pz,N(e.block.path),1),e.block.detail?(C(),E("span",Rz,N(e.block.detail),1)):ce("",!0)])):e.block.kind==="url"?(C(),E("div",Dz,[e.block.method?(C(),E("span",Bz,N(e.block.method),1)):ce("",!0),p("span",Fz,N(e.block.url),1)])):e.block.kind==="search"?(C(),E("div",Hz,[p("span",Wz,N(T(o)("approval.searchQueryLabel")),1),p("span",Uz,N(e.block.query),1),e.block.scope?(C(),E("span",qz,N(T(o)("approval.searchScope",{scope:e.block.scope})),1)):ce("",!0)])):e.block.kind==="invocation"?(C(),E("div",jz,[p("span",zz,N(e.block.kind2),1),p("span",Vz,N(e.block.name),1),e.block.description?(C(),E("span",Kz,N(e.block.description),1)):ce("",!0)])):e.block.kind==="todo"?(C(),E("div",Gz,[(C(!0),E(Le,null,Qe(e.block.items,(k,$)=>(C(),E("div",{key:$,class:"todo-item"},[p("span",Yz,N(k.status==="done"||k.status==="completed"?"✓":"○"),1),p("span",{class:$e(["todo-title",{"todo-done":k.status==="done"||k.status==="completed"}])},N(k.title),3)]))),128))])):(C(),E("div",Xz,[p("span",Zz,N(e.block.summary),1)])),a.value?(C(),E("div",Qz,[Lt(p("textarea",{ref_key:"feedbackRef",ref:u,"onUpdate:modelValue":g[1]||(g[1]=k=>c.value=k),class:"feedback-ta",placeholder:T(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:f},null,40,Jz),[[Tn,c.value]]),p("div",eV,N(T(o)("approval.feedbackHint")),1)])):ce("",!0),p("div",tV,[p("div",{class:"kbtn pri",onClick:y},[vt(N(T(o)("approval.approve")),1),g[5]||(g[5]=p("span",{class:"k"},"[1]",-1))]),p("div",{class:"kbtn",onClick:S},[vt(N(T(o)("approval.approveSession")),1),g[6]||(g[6]=p("span",{class:"k"},"[2]",-1))]),p("div",{class:"kbtn",onClick:_},[vt(N(T(o)("approval.reject")),1),g[7]||(g[7]=p("span",{class:"k"},"[3]",-1))]),p("div",{class:"kbtn",onClick:d},[vt(N(T(o)("approval.feedback")),1),g[8]||(g[8]=p("span",{class:"k"},"[4]",-1))])])],64))],2))}}),sV=_t(nV,[["__scopeId","data-v-01d528a6"]]),oV={class:"taskspane"},iV={class:"tp-head"},rV={class:"tp-title"},lV={class:"tp-count"},aV={class:"tp-list"},cV={key:0,class:"tp-empty"},uV=["role","onClick"],dV={class:"tp-name"},fV={class:"tp-kind"},hV={class:"tp-time"},pV=["onClick"],mV={key:0,class:"tp-detail"},gV={key:0,class:"tp-codebox"},vV=["onClick"],yV={class:"tp-pre"},kV={class:"tp-cmd"},bV={key:1,class:"tp-codebox"},_V=["onClick"],wV={class:"tp-pre"},SV=Je({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:s}=xt(),o=Qs(new Set),i=Qs(new Set),r=Qs(new Set);function l(f){return!!(f.output&&f.output.length>0||f.meta)}function a(f){l(f)&&(o.has(f.id)?o.delete(f.id):o.add(f.id))}function c(f){switch(f){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(f){switch(f){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(f,y,S){try{await navigator.clipboard.writeText(f),S.add(y),setTimeout(()=>S.delete(y),1500)}catch{}}async function h(f){f.meta&&await d(f.meta,f.id,i)}async function m(f){const y=f.output?.join(`
|
|
244
|
-
`)??"";y&&await d(y,f.id,r)}return(f,y)=>(C(),E("div",oV,[p("div",iV,[p("span",rV,N(T(s)("tasks.tag")),1),p("span",lV,N(e.tasks.length),1)]),p("div",aV,[e.tasks.length===0?(C(),E("div",cV,N(T(s)("tasks.emptyTasks")),1)):(C(!0),E(Le,{key:1},Qe(e.tasks,S=>(C(),E("div",{key:S.id,class:$e(["tp-row",{done:S.state==="done",fail:S.state==="fail",expandable:l(S)}])},[p("div",{class:"tp-main",role:l(S)?"button":void 0,onClick:_=>a(S)},[p("span",{class:$e(["tp-glyph",u(S.state)])},N(c(S.state)),3),p("span",dV,N(S.name),1),p("span",fV,N(S.kind),1),p("span",hV,N(S.timing),1),S.state==="run"?(C(),E("button",{key:0,class:"tp-stop",onClick:Ze(_=>n("cancel",S.id),["stop"])},N(T(s)("tasks.stop")),9,pV)):ce("",!0),l(S)?(C(),E("svg",{key:1,class:$e(["tp-chevron",{open:o.has(S.id)}]),viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...y[0]||(y[0]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):ce("",!0)],8,uV),o.has(S.id)&&l(S)?(C(),E("div",mV,[S.meta?(C(),E("div",gV,[p("button",{class:$e(["tp-copy",{copied:i.has(S.id)}]),onClick:Ze(_=>h(S),["stop"])},N(i.has(S.id)?"已复制":"复制"),11,vV),p("pre",yV,[p("code",null,[p("span",kV,N(S.meta),1)])])])):ce("",!0),S.output&&S.output.length>0?(C(),E("div",bV,[p("button",{class:$e(["tp-copy",{copied:r.has(S.id)}]),onClick:Ze(_=>m(S),["stop"])},N(r.has(S.id)?"已复制":"复制"),11,_V),p("pre",wV,[p("code",null,[y[1]||(y[1]=vt(`
|
|
245
|
-
`,-1)),(C(!0),E(Le,null,Qe(S.output,(_,b)=>(C(),E("span",{key:b,class:"tp-line"},N(_),1))),128)),y[2]||(y[2]=vt(`
|
|
246
|
-
`,-1))])])])):ce("",!0)])):ce("",!0)],2))),128))])]))}}),j_=_t(SV,[["__scopeId","data-v-99eb3f76"]]),CV={class:"tc-title"},xV={key:0,class:"tc-count"},TV={key:0,class:"tc-list"},MV={key:0,class:"tc-empty"},AV={class:"tc-name"},EV=Je({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=xt(),s=se(!1),o=j(()=>!t.inline),i=j(()=>t.inline||!s.value);function r(){o.value&&(s.value=!s.value)}const l=j(()=>t.todos.filter(c=>c.status==="done").length);function a(c){return c==="done"?"done":c==="in_progress"?"in_progress":"pending"}return(c,u)=>(C(),E("div",{class:$e(["todo-card",{"tab-mode":e.inline}])},[(C(),je(ms(o.value?"button":"div"),{class:$e(["tc-head",{static:!o.value}]),type:o.value?"button":void 0,onClick:r},{default:xn(()=>[u[1]||(u[1]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[p("polyline",{points:"2,4.5 3.5,6 5.5,3"}),p("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),p("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),p("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),p("span",CV,N(T(n)("tasks.todoTag")),1),e.todos.length>0?(C(),E("span",xV,N(l.value)+"/"+N(e.todos.length),1)):ce("",!0),o.value&&e.todos.length>0?(C(),E("svg",{key:1,class:$e(["tc-chev",{open:!s.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...u[0]||(u[0]=[p("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):ce("",!0)]),_:1},8,["class","type"])),i.value?(C(),E("div",TV,[e.todos.length===0?(C(),E("div",MV,N(T(n)("tasks.emptyTodo")),1)):ce("",!0),(C(!0),E(Le,null,Qe(e.todos,(d,h)=>(C(),E("div",{key:h,class:$e(["tc-row",`s-${d.status}`])},[p("span",{class:$e(["tc-glyph",`g-${a(d.status)}`])},null,2),p("span",AV,N(d.title),1)],2))),128))])):ce("",!0)],2))}}),IV=_t(EV,[["__scopeId","data-v-aa76ea4d"]]),$V={key:0,class:"queue-head"},NV={class:"queue-label"},LV=["title"],OV={class:"queue-list"},PV=["disabled","title","onClick"],RV={key:0,class:"queue-img",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},DV=["title","onClick"],BV=Je({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:s}=xt();function o(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(C(),E("div",{class:$e(["queue-pane",{"tab-mode":e.inline}])},[e.inline?ce("",!0):(C(),E("div",$V,[p("span",NV,N(T(s)("composer.queueLabel"))+" · "+N(e.queued.length),1),e.running?(C(),E("button",{key:0,class:"queue-steer",type:"button",title:T(s)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},N(T(s)("composer.steerNow")),9,LV)):ce("",!0)])),p("div",OV,[(C(!0),E(Le,null,Qe(e.queued,(l,a)=>(C(),E("div",{key:a,class:"queue-item"},[p("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?T(s)("composer.queuedHasImage",{n:l.attachmentCount}):T(s)("composer.editQueued"),onClick:c=>o(a,l)},[l.attachmentCount>0?(C(),E("svg",RV,[...r[1]||(r[1]=[p("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),p("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),p("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):ce("",!0),p("span",{class:$e(["queue-text-inner",{placeholder:!l.text}])},N(l.text||T(s)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,PV),p("button",{class:"queue-rm",title:T(s)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[p("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,DV)]))),128))])],2))}}),FV=_t(BV,[["__scopeId","data-v-32b1ed3b"]]),HV={class:"dock-work-head"},WV={key:0,class:"dock-work-tab static"},UV={key:1,class:"dock-work-tab static"},qV={key:2,class:"dock-work-tab static"},jV={key:3,class:"dock-work-tab static"},zV=["title"],VV={class:"dock-work-body"},KV=["aria-pressed"],GV={class:"dw-count"},YV=["aria-pressed"],XV={class:"dw-count"},ZV=["aria-pressed"],QV={class:"dw-count"},JV=["aria-pressed"],eK={class:"dw-count"},tK=Je({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},pendingApproval:{},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=xt(),r=se(null),l=se(null),a=se(null);function c(h){r.value?.loadForEdit(h)}function u(h){const m=s.queued?.[h]?.text??"";m&&c(m),o("editQueued",h)}function d(h){if(!s.dockPanel)return;const m=h.target;m&&(l.value?.contains(m)||a.value?.contains(m)||o("close-dock-panel"))}return Ve(()=>s.dockPanel,h=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),h&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),Ut(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c}),(h,m)=>(C(),E("div",{class:$e(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:m[31]||(m[31]=Ze(()=>{},["stop"]))},[kt(Ei,{name:"dock-panel"},{default:xn(()=>[e.dockPanel?(C(),E("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:m[5]||(m[5]=Ze(()=>{},["stop"]))},[p("div",HV,[e.dockPanel==="bash"?(C(),E("span",WV,N(T(i)("tasks.dockBash"))+" · "+N(e.bashRunning)+" "+N(T(i)("tasks.running")),1)):e.dockPanel==="subagent"?(C(),E("span",UV,N(T(i)("tasks.dockSubagent"))+" · "+N(e.subagentRunning)+" "+N(T(i)("tasks.running")),1)):e.dockPanel==="todos"?(C(),E("span",qV,N(T(i)("tasks.dockTodos"))+" · "+N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1)):e.dockPanel==="queue"?(C(),E("span",jV,N(T(i)("tasks.dockQueue"))+" · "+N(e.queued?.length??0),1)):ce("",!0),e.dockPanel==="queue"&&e.running?(C(),E("button",{key:4,type:"button",class:"dock-queue-steer",title:T(i)("composer.steerTitle"),onClick:m[0]||(m[0]=f=>o("steer",{text:"",attachments:[]}))},N(T(i)("composer.steerNow")),9,zV)):ce("",!0)]),p("div",VV,[e.dockPanel==="bash"?(C(),je(j_,{key:0,tasks:e.bashTasks,onCancel:m[1]||(m[1]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="subagent"?(C(),je(j_,{key:1,tasks:e.subagentTasks,onCancel:m[2]||(m[2]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="todos"?(C(),je(IV,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(C(),je(FV,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:m[3]||(m[3]=f=>o("steer",{text:"",attachments:[]})),onUnqueue:m[4]||(m[4]=f=>o("unqueue",f)),onEditQueued:u},null,8,["queued","running"]))])],512)):ce("",!0)]),_:1}),e.goal?(C(),je(Pj,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:m[6]||(m[6]=f=>o("controlGoal",f))},null,8,["goal","force-expanded"])):ce("",!0),e.hasDockWork?(C(),E("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(C(),E("button",{key:0,type:"button",class:$e(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:m[7]||(m[7]=f=>o("toggle-dock-panel","bash"))},[m[34]||(m[34]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("circle",{cx:"8",cy:"8",r:"5.5"}),p("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),p("span",null,N(T(i)("tasks.dockBash")),1),p("span",GV,[m[32]||(m[32]=vt("(",-1)),p("b",null,N(e.bashTasks.length),1),m[33]||(m[33]=vt(")",-1))])],10,KV)):ce("",!0),e.subagentTasks.length>0?(C(),E("button",{key:1,type:"button",class:$e(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:m[8]||(m[8]=f=>o("toggle-dock-panel","subagent"))},[m[37]||(m[37]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),p("span",null,N(T(i)("tasks.dockSubagent")),1),p("span",XV,[m[35]||(m[35]=vt("(",-1)),p("b",null,N(e.subagentTasks.length),1),m[36]||(m[36]=vt(")",-1))])],10,YV)):ce("",!0),(e.todos?.length??0)>0?(C(),E("button",{key:2,type:"button",class:$e(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:m[9]||(m[9]=f=>o("toggle-dock-panel","todos"))},[m[40]||(m[40]=gr('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-8dab8b74><path d="M3 4.5l1.5 1.5L7 3.5" data-v-8dab8b74></path><path d="M8.5 5h4" data-v-8dab8b74></path><path d="M3 11l1.5 1.5L7 10" data-v-8dab8b74></path><path d="M8.5 11.5h4" data-v-8dab8b74></path></svg>',1)),p("span",null,N(T(i)("tasks.dockTodos")),1),p("span",QV,[m[38]||(m[38]=vt("(",-1)),p("b",null,N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1),m[39]||(m[39]=vt(")",-1))])],10,ZV)):ce("",!0),(e.queued?.length??0)>0?(C(),E("button",{key:3,type:"button",class:$e(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:m[10]||(m[10]=f=>o("toggle-dock-panel","queue"))},[m[43]||(m[43]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("path",{d:"M2 4l6 4 6-4"}),p("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),p("span",null,N(T(i)("tasks.dockQueue")),1),p("span",eK,[m[41]||(m[41]=vt("(",-1)),p("b",null,N(e.queued?.length??0),1),m[42]||(m[42]=vt(")",-1))])],10,JV)):ce("",!0)],512)):ce("",!0),e.pendingQuestion?(C(),je(dz,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:m[11]||(m[11]=(f,y)=>o("answer",f,y)),onDismiss:m[12]||(m[12]=f=>o("dismiss",f))},null,8,["question"])):e.pendingApproval?(C(),je(sV,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:m[13]||(m[13]=f=>o("approval",e.pendingApproval.approvalId,f))},null,8,["block","agent-name"])):(C(),je(rT,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:m[14]||(m[14]=f=>o("submit",f)),onSteer:m[15]||(m[15]=f=>o("steer",f)),onCommand:m[16]||(m[16]=f=>o("command",f)),onInterrupt:m[17]||(m[17]=f=>o("interrupt")),onSetPermission:m[18]||(m[18]=f=>o("setPermission",f)),onSetThinking:m[19]||(m[19]=f=>o("setThinking",f)),onTogglePlan:m[20]||(m[20]=f=>o("togglePlan")),onToggleSwarm:m[21]||(m[21]=f=>o("toggleSwarm")),onToggleGoal:m[22]||(m[22]=f=>o("toggleGoal")),onOpenBtw:m[23]||(m[23]=f=>o("openBtw")),onCreateGoal:m[24]||(m[24]=f=>o("createGoal",f)),onControlGoal:m[25]||(m[25]=f=>o("controlGoal",f)),onFocusGoal:m[26]||(m[26]=f=>o("focusGoal")),onFocusSwarm:m[27]||(m[27]=f=>o("focusSwarm")),onCompact:m[28]||(m[28]=f=>o("compact")),onPickModel:m[29]||(m[29]=f=>o("pickModel")),onSelectModel:m[30]||(m[30]=f=>o("selectModel",f))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),nK=_t(tK,[["__scopeId","data-v-8dab8b74"]]),sK=5;function oK(e,t,n,s=sK){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const iK=["aria-label"],rK={class:"toc-track"},lK=["aria-label","onMouseenter","onClick"],aK={class:"toc-no"},cK={class:"chat-layout"},uK={class:"empty-hint"},dK={class:"empty-hint-title"},fK={class:"empty-hint-text"},hK={key:0,class:"ws-pick"},pK=["title"],mK={class:"ws-pick-name"},gK={key:1,class:"ws-pick-menu"},vK=["onClick"],yK={class:"ws-pick-item-name"},kK={class:"ws-pick-item-path"},bK={key:0,class:"swarm-stack"},_K=["aria-label"],wK={key:0,class:"abort-toast",role:"status","aria-live":"polite"},SK={class:"abort-toast-text"},od=10,CK=56,xK=420,z_=80,TK=1e3,MK=3e3,AK=Je({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},modern:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},betaToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=se(!1),r=se(!1),l=j(()=>s.workspaces?.find(ve=>ve.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=j(()=>(s.workspaces?.length??0)>0),c=j(()=>oK(s.workspaces??[],s.activeWorkspaceId,r.value)),u=j(()=>(s.workspaces?.length??0)-c.value.length);Ve(i,Ie=>{Ie||(r.value=!1)});const d=j(()=>s.swarms?.filter(Ie=>Ie.members.some(ve=>ve.phase!=="completed"&&ve.phase!=="failed"))??[]);function h(Ie){i.value=!1,Ie!==s.activeWorkspaceId&&o("selectWorkspace",Ie)}const{t:m}=xt();Rc(Ot.contentAlign);const f=se(null),y=se(null),S=se(null),_=se(!1),b=se(0);let v=null;function g(Ie){(S.value??y.value)?.loadForEdit(Ie)}function k(){_.value=!0,v!==null&&clearTimeout(v),v=setTimeout(()=>{v=null,_.value=!1},2e3)}function $(){b.value++}function A(){gt(()=>{D.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const w=j(()=>s.mobile===!0||s.modern===!0),x=j(()=>s.tasks.filter(Ie=>Ie.kind!=="subagent")),I=j(()=>s.tasks.filter(Ie=>Ie.kind==="subagent")),L=j(()=>x.value.filter(Ie=>Ie.state==="run").length),O=j(()=>I.value.filter(Ie=>Ie.state==="run").length),P=j(()=>(s.todos??[]).filter(Ie=>Ie.status==="done").length),B=j(()=>s.tasks.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),R=se(null),W=j(()=>s.gitInfo?s.changes?.length??0:0);function V(Ie){R.value=R.value===Ie?null:Ie}function z(){R.value=null}Ve(B,Ie=>{Ie||z()});function ie(Ie){if(Ie.role==="compaction")return m("conversation.compactedPlain");if(Ie.role==="user"){if(Ie.skillActivation)return`/${Ie.skillActivation.name}`;const ne=Ie.text.trim().replaceAll(/\s+/g," ");return ne.length>0?ne:"user"}const ve=(Ie.text||Ie.thinking||"").trim().replaceAll(/\s+/g," ");return ve.length>0?ve:(Ie.tools?.length??0)>0?`${Ie.tools.length} tools`:"kimi"}const ae=j(()=>s.turns.map((Ie,ve)=>({id:Ie.id,role:Ie.role,no:Ie.no||ve+1,title:ie(Ie)})));function re(Ie){return Ie.role==="compaction"?20:Ie.role==="user"?(Ie.text?.length??0)+(Ie.skillActivation?20:0):(Ie.text?.length??0)+(Ie.thinking?.length??0)+(Ie.tools?.reduce((ve,ne)=>ve+ne.name.length+(ne.arg?.length??0)+(ne.output?.join("").length??0),0)??0)}const Te=j(()=>{const Ie=ae.value,ve=Ie.map(Ee=>{const He=s.turns.find(it=>it.id===Ee.id);return He?re(He):od}),ne=ve.reduce((Ee,He)=>Ee+He,0)||Ie.length*od;return Ie.map((Ee,He)=>{const it=ve[He]??od,Ke=ne>0?it/ne:0,H=Math.max(od,Math.min(CK,Ke*xK));return{id:Ee.id,height:Math.round(H)}})}),Pe=j(()=>Te.value.reduce((Ie,ve)=>Ie+ve.height,0)+(ae.value.length-1)*4),We=se(null),Ne=se(null),me=se({visible:!1,text:"",top:0});function be(){const Ie=D.value;if(!Ie)return;const ve=Ie.querySelectorAll(".turn-anchor[data-turn-id]");if(ve.length===0)return;const ne=Ie.getBoundingClientRect(),Ee=ne.height/2;let He=null,it=1/0;ve.forEach(nt=>{const lt=nt.getBoundingClientRect(),At=lt.top-ne.top,qn=Math.abs(At+lt.height/2-Ee);qn<it&&(it=qn,He=nt.dataset.turnId??null)}),We.value=He;const Ke=Ie.scrollHeight-Ie.clientHeight,H=Ke>0?Ie.scrollTop/Ke:0,Q=Pe.value,Ce=H*Q,Be=Ie.scrollHeight>0?Ie.clientHeight/Ie.scrollHeight*Q:Q;Ne.value={top:Math.max(0,Ce),height:Math.max(8,Math.min(Be,Q-Ce))}}function Se(Ie,ve){const ne=ve.currentTarget;ne&&(me.value={visible:!0,text:Ie,top:ne.offsetTop})}function fe(){me.value.visible=!1}const K=j(()=>!s.mobile&&!s.sessionLoading&&ae.value.length>1),Z=j(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),pe=j(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),D=se(null),X=se(null),oe=se(0),te=se(0),ue=j(()=>({"--panes-scrollbar-width":`${oe.value}px`}));function U(Ie){return Ie instanceof HTMLElement?Ie:Ie&&"$el"in Ie&&Ie.$el instanceof HTMLElement?Ie.$el:null}function q(){const Ie=D.value;oe.value=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0,te.value=X.value?.offsetHeight??0}function J(Ie){const ve=U(Ie);D.value=ve,ve&&uo()}function de(Ie){const ve=U(Ie);X.value=ve??null,Ie&&"loadForEdit"in Ie&&typeof Ie.loadForEdit=="function"?S.value={loadForEdit:Ie.loadForEdit.bind(Ie)}:S.value=null,zs()}const ge=se(!0),Me=se(!1);function le(){const Ie=D.value;return Ie?Ie.scrollHeight-Ie.scrollTop-Ie.clientHeight:0}let _e=0,ze=0,Xe=0,ot=0,Ye=0;function mt(){return Date.now()<ze}function It(){const Ie=D.value;if(!Ie)return;const ve=Ie.scrollTop;if(performance.now()-Xe<100){_e=ve;return}const ne=le();if(mt()){ge.value=!0,Me.value=!1,_e=ve;return}ve<_e-1&&ne>1?ge.value=!1:ne<=z_&&ve>_e+1&&(ge.value=!0,Me.value=!1),_e=ve,be()}function Mt(Ie=!1){const ve=D.value;ve&&(Ie&&typeof ve.scrollTo=="function"?(Xe=performance.now(),ve.scrollTo({top:ve.scrollHeight,behavior:"smooth"})):ve.scrollTop=ve.scrollHeight,_e=ve.scrollTop,ge.value=!0,Me.value=!1)}function Kt(Ie,ve){const ne=Ie.querySelectorAll(".turn-anchor");for(const Ee of ne)if(Ee.offsetTop>=ve){const He=Ee.dataset.turnId;if(He)return{id:He,top:Ee.offsetTop}}return null}async function fn(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Ie=s.sessionId,ve=D.value,ne=ve?.scrollTop??0,Ee=ve?.scrollHeight??0,He=ve?Kt(ve,ne):null;js.value=!0;try{await s.loadOlderMessages(Ie),await gt()}finally{js.value=!1}if(s.sessionId!==Ie)return;const it=D.value;if(!it)return;let Ke=0;if(He){const H=it.querySelector(`.turn-anchor[data-turn-id="${un(He.id)}"]`);H&&(Ke=H.offsetTop-He.top)}Ke===0&&(Ke=it.scrollHeight-Ee),it.scrollTop=ne+Ke}function un(Ie){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ie):Ie.replaceAll(/["\\]/g,"\\$&")}function Ge(Ie){const ve=D.value;if(!ve)return;const ne=ve.querySelector(`.turn-anchor[data-turn-id="${un(Ie)}"]`);ne&&(ge.value=!1,Me.value=le()>z_,ne.scrollIntoView({behavior:"smooth",block:"center"}))}function Pt(){const Ie=D.value;if(!Ie)return"none";const ve=Ie.firstElementChild,ne=ve instanceof HTMLElement?ve.offsetHeight:0,Ee=X.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${ne}:${Ee}`}function Gn(Ie){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ie):setTimeout(Ie,16)}function _n(Ie){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ie):clearTimeout(Ie)}function In(Ie=36){if(!ge.value&&!mt())return;const ve=++Ye;let ne="",Ee=0,He=0;ot&&(_n(ot),ot=0);const it=()=>{if(ot=0,ve!==Ye||!ge.value&&!mt())return;Mt(!1);const Ke=Pt();Ee=Ke===ne?Ee+1:0,ne=Ke,He++,Ee<3&&He<Ie&&(ot=Gn(it))};ot=Gn(it)}function On(Ie,ve){return Ie!==void 0&&Ie.length>0&&ve.length>=Ie.length&&Ie.firstId!==ve.firstId&&Ie.lastId===ve.lastId&&Ie.lastTextLen===ve.lastTextLen&&Ie.lastThinkingLen===ve.lastThinkingLen&&Ie.lastToolsLen===ve.lastToolsLen&&Ie.approvalIds===ve.approvalIds}const as=j(()=>{const Ie=(s.approvals??[]).map(it=>it.approvalId).join(","),ve=s.turns,ne=ve.at(-1),Ee=ne?.thinking?.length??0,He=ne?.tools?.reduce((it,Ke)=>it+Ke.name.length+(Ke.arg?.length??0)+(Ke.output?.join("").length??0),0)??0;return{length:ve.length,firstId:ve[0]?.id??"",lastId:ne?.id??"",lastTextLen:ne?.text.length??0,lastThinkingLen:Ee,lastToolsLen:He,approvalIds:Ie}});Ve(as,async(Ie,ve)=>{if(js.value&&On(ve,Ie)){be();return}await gt(),ge.value||mt()?Mt(!1):Me.value=!0,be()}),Ve(X,()=>{zs()}),Ve(()=>s.mobile,async()=>{await gt(),q()}),Ve(()=>s.fileReloadKey,async()=>{ge.value=!0,_e=0,await gt(),In(),be()}),Ve(()=>s.sessionLoading,async(Ie,ve)=>{Ie||!ve||(ge.value=!0,await gt(),In(),be())}),Ve(()=>s.running,async(Ie,ve)=>{Ie||!ve||!ge.value&&!mt()||(await gt(),In(48),be())});function ks(){ge.value=!0,Me.value=!1,ze=Date.now()+TK,gt(()=>{Mt(!1),In(16)})}function bs(Ie){ks(),o("submit",Ie)}function $s(Ie,ve){ks(),o("answer",Ie,ve)}function Jn(Ie,ve){!Ie||!ve||o("approval",Ie,ve)}let wn=null,on=null,Un=null,Tt=null,$n=0,Gt=!1;const js=se(!1);function Po(Ie){if(js.value||(Gt=Gt||Ie,$n))return;$n=(typeof requestAnimationFrame=="function"?requestAnimationFrame:ne=>setTimeout(ne,16))(()=>{$n=0;const ne=Gt;Gt=!1,ge.value||mt()?Mt(!1):ne&&(Me.value=!0)})}function co(){if(!on)return;const Ie=D.value?.firstElementChild??null;Ie!==Un&&(Un&&on.unobserve(Un),Un=Ie,Ie&&on.observe(Ie))}function zs(){if(!on)return;const Ie=X.value;Ie!==Tt&&(Tt&&on.unobserve(Tt),Tt=Ie,Ie&&on.observe(Ie))}function uo(){const Ie=D.value;q(),wn&&(wn.disconnect(),Ie&&wn.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),on&&(on.disconnect(),Un=null,Tt=null,Ie&&on.observe(Ie),co(),zs())}function fo(){co(),Po(!0)}function wt(){typeof document>"u"||document.visibilityState==="visible"&&ge.value&&In()}const ho=se(!1);let es=null;function Ns(){ho.value=!0,es!==null&&clearTimeout(es),es=setTimeout(()=>{ho.value=!1},MK)}function gn(){Ns(),o("interrupt")}function vn(Ie){Ie.key==="Escape"&&(s.running||s.sending)&&(Ie.preventDefault(),gn())}return ln(()=>{gt(()=>{typeof MutationObserver=="function"&&(wn=new MutationObserver(fo)),typeof ResizeObserver=="function"&&(on=new ResizeObserver(()=>{q(),Po(!1)})),uo(),In(48),be(),typeof document<"u"&&(document.addEventListener("visibilitychange",wt),document.addEventListener("keydown",vn))})}),Ut(()=>{wn&&wn.disconnect(),on&&on.disconnect(),$n&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame($n),ot&&_n(ot),es!==null&&clearTimeout(es),v!==null&&(clearTimeout(v),v=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",wt),document.removeEventListener("keydown",vn))}),t({loadComposerForEdit:g}),(Ie,ve)=>(C(),E("section",{class:$e(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(C(),je(PU,{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:_.value,onOpenChanges:ve[0]||(ve[0]=ne=>o("openChanges")),onCopyAll:ve[1]||(ve[1]=ne=>f.value?.copyConversation()),onCopyFinalSummary:ve[2]||(ve[2]=ne=>f.value?.copyFinalSummary()),onOpenPr:ve[3]||(ve[3]=ne=>e.pr&&o("openPr",e.pr.url)),onRenameSession:ve[4]||(ve[4]=(ne,Ee)=>o("renameSession",ne,Ee)),onForkSession:ve[5]||(ve[5]=ne=>o("forkSession",ne)),onArchiveSession:ve[6]||(ve[6]=ne=>o("archiveSession",ne))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ce("",!0),K.value&&e.betaToc?(C(),E("nav",{key:1,class:"conversation-toc","aria-label":T(m)("conversation.toc")},[p("div",rK,[(C(!0),E(Le,null,Qe(ae.value,(ne,Ee)=>(C(),E("button",{key:ne.id,type:"button",class:$e(["toc-bubble",[ne.role,{active:We.value===ne.id}]]),style:Dt({height:Te.value[Ee]?.height+"px"}),"aria-label":`#${ne.no} ${ne.title}`,onMouseenter:He=>Se(ne.title,He),onMouseleave:fe,onClick:He=>Ge(ne.id)},[p("span",aK,N(ne.no),1)],46,lK))),128)),Ne.value?(C(),E("div",{key:0,class:"toc-viewport",style:Dt({top:Ne.value.top+"px",height:Ne.value.height+"px"})},null,4)):ce("",!0)]),kt(Ei,{name:"toc-tip"},{default:xn(()=>[Lt(p("div",{class:"toc-tooltip",style:Dt({top:me.value.top+"px"})},N(me.value.text),5),[[Uo,me.value.visible]])]),_:1})],8,iK)):ce("",!0),p("div",cK,[p("div",{ref:J,class:"panes chat-scroll",onScrollPassive:It},[p("div",{class:$e(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(C(),E(Le,{key:0},[ve[58]||(ve[58]=p("div",{class:"empty-spacer"},null,-1)),p("div",uK,[p("span",dK,N(T(m)("composer.emptyConversationTitle")),1),p("span",fK,N(T(m)("composer.emptyConversation")),1),a.value?(C(),E("div",hK,[p("button",{type:"button",class:"ws-pick-btn",title:T(m)("conversation.switchWorkspace"),onClick:ve[7]||(ve[7]=Ze(ne=>i.value=!i.value,["stop"]))},[ve[54]||(ve[54]=p("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[p("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),p("path",{d:"M1 5.5h12"})],-1)),p("span",mK,N(l.value),1),(C(),E("svg",{class:$e(["ws-pick-chev",{open:i.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ve[53]||(ve[53]=[p("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,pK),i.value?(C(),E("div",{key:0,class:"ws-pick-backdrop",onClick:ve[8]||(ve[8]=ne=>i.value=!1)})):ce("",!0),i.value?(C(),E("div",gK,[(C(!0),E(Le,null,Qe(c.value,ne=>(C(),E("button",{key:ne.id,type:"button",class:$e(["ws-pick-item",{on:ne.id===e.activeWorkspaceId}]),onClick:Ze(Ee=>h(ne.id),["stop"])},[p("span",yK,N(ne.name),1),p("span",kK,N(ne.shortPath),1)],10,vK))),128)),u.value>0?(C(),E("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:ve[9]||(ve[9]=Ze(ne=>r.value=!r.value,["stop"]))},[p("span",null,N(T(m)("conversation.moreWorkspaces",{count:u.value})),1)])):ce("",!0),ve[56]||(ve[56]=p("div",{class:"ws-pick-divider"},null,-1)),p("button",{type:"button",class:"ws-pick-action",onClick:ve[10]||(ve[10]=Ze(ne=>{i.value=!1,o("addWorkspace")},["stop"]))},[ve[55]||(ve[55]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("path",{d:"M8 3v10M3 8h10"})],-1)),p("span",null,N(T(m)("conversation.addWorkspace")),1)])])):ce("",!0)])):(C(),E("button",{key:1,type:"button",class:"empty-add-workspace",onClick:ve[11]||(ve[11]=ne=>o("addWorkspace"))},[ve[57]||(ve[57]=p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),p("path",{d:"M1 5.5h12"}),p("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),p("span",null,N(T(m)("conversation.addWorkspace")),1)]))]),kt(rT,{ref_key:"emptyComposerRef",ref:y,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:bs,onSteer:ve[12]||(ve[12]=ne=>o("steer",ne)),onCommand:ve[13]||(ve[13]=ne=>o("command",ne)),onInterrupt:gn,onUnqueue:ve[14]||(ve[14]=ne=>o("unqueue",ne)),onEditQueued:ve[15]||(ve[15]=ne=>o("editQueued",ne)),onSetPermission:ve[16]||(ve[16]=ne=>o("setPermission",ne)),onSetThinking:ve[17]||(ve[17]=ne=>o("setThinking",ne)),onTogglePlan:ve[18]||(ve[18]=ne=>o("togglePlan")),onToggleSwarm:ve[19]||(ve[19]=ne=>o("toggleSwarm")),onToggleGoal:ve[20]||(ve[20]=ne=>o("toggleGoal")),onOpenBtw:ve[21]||(ve[21]=ne=>o("command","/btw")),onCreateGoal:ve[22]||(ve[22]=ne=>o("createGoal",ne)),onControlGoal:ve[23]||(ve[23]=ne=>o("controlGoal",ne)),onFocusGoal:$,onFocusSwarm:A,onCompact:ve[24]||(ve[24]=ne=>o("compact")),onPickModel:ve[25]||(ve[25]=ne=>o("pickModel")),onSelectModel:ve[26]||(ve[26]=ne=>o("selectModel",ne))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),ve[59]||(ve[59]=p("div",{class:"empty-spacer"},null,-1))],64)):(C(),E(Le,{key:1},[(C(),je(sT,{ref_key:"chatPaneRef",ref:f,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:w.value,mobile:e.mobile,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":ge.value,onOpenFile:ve[27]||(ve[27]=ne=>o("openFile",ne)),onOpenMedia:ve[28]||(ve[28]=ne=>o("openMedia",ne)),onCopyConversationCopied:k,onOpenThinking:ve[29]||(ve[29]=ne=>o("openThinking",ne)),onOpenCompaction:ve[30]||(ve[30]=ne=>o("openCompaction",ne)),onOpenAgent:ve[31]||(ve[31]=ne=>o("openAgent",ne)),onEditMessage:ve[32]||(ve[32]=ne=>o("editMessage",ne)),onLoadOlderMessages:fn},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following"])),d.value.length>0?(C(),E("div",bK,[(C(!0),E(Le,null,Qe(d.value,ne=>(C(),je(Tj,{key:ne.id,group:ne},null,8,["group"]))),128))])):ce("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ce("",!0):(C(),je(nK,{key:0,ref:de,style:Dt(ue.value),"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":b.value,"dock-panel":R.value,"bash-tasks":x.value,"subagent-tasks":I.value,"bash-running":L.value,"subagent-running":O.value,"todo-done-count":P.value,"has-dock-work":B.value,todos:e.todos,"pending-question":Z.value,"pending-approval":pe.value,mobile:e.mobile,onToggleDockPanel:ve[33]||(ve[33]=ne=>V(ne)),onCloseDockPanel:ve[34]||(ve[34]=ne=>z()),onAnswer:$s,onDismiss:ve[35]||(ve[35]=ne=>o("dismiss",ne)),onApproval:Jn,onCancelTask:ve[36]||(ve[36]=ne=>o("cancelTask",ne)),onControlGoal:ve[37]||(ve[37]=ne=>o("controlGoal",ne)),onSubmit:bs,onSteer:ve[38]||(ve[38]=ne=>o("steer",ne)),onCommand:ve[39]||(ve[39]=ne=>o("command",ne)),onInterrupt:gn,onUnqueue:ve[40]||(ve[40]=ne=>o("unqueue",ne)),onEditQueued:ve[41]||(ve[41]=ne=>o("editQueued",ne)),onSetPermission:ve[42]||(ve[42]=ne=>o("setPermission",ne)),onSetThinking:ve[43]||(ve[43]=ne=>o("setThinking",ne)),onTogglePlan:ve[44]||(ve[44]=ne=>o("togglePlan")),onToggleSwarm:ve[45]||(ve[45]=ne=>o("toggleSwarm")),onToggleGoal:ve[46]||(ve[46]=ne=>o("toggleGoal")),onOpenBtw:ve[47]||(ve[47]=ne=>o("command","/btw")),onCreateGoal:ve[48]||(ve[48]=ne=>o("createGoal",ne)),onFocusGoal:$,onFocusSwarm:A,onCompact:ve[49]||(ve[49]=ne=>o("compact")),onPickModel:ve[50]||(ve[50]=ne=>o("pickModel")),onSelectModel:ve[51]||(ve[51]=ne=>o("selectModel",ne))},null,8,["style","session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","pending-approval","mobile"]))]),kt(Ei,{name:"pill"},{default:xn(()=>[Me.value?(C(),E("button",{key:0,class:"newmsg-pill",style:Dt({bottom:`${te.value+12}px`}),"aria-label":T(m)("conversation.jumpToLatestAria"),onClick:ve[52]||(ve[52]=ne=>Mt(!0))},[ve[60]||(ve[60]=p("svg",{class:"pill-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("polyline",{points:"4,6 8,10 12,6"})],-1)),vt(" "+N(T(m)("conversation.newMessages")),1)],12,_K)):ce("",!0)]),_:1}),kt(Ei,{name:"abort-toast"},{default:xn(()=>[ho.value?(C(),E("div",wK,[p("span",SK,N(T(m)("conversation.manuallyAborted")),1)])):ce("",!0)]),_:1})],2))}}),EK=_t(AK,[["__scopeId","data-v-367814e0"]]),IK={key:0,class:"fp-empty fp-error"},$K={key:1,class:"fp-empty"},NK={key:2,class:"fp-loading"},LK={class:"fp-header"},OK={class:"fp-title"},PK=["title"],RK={class:"fp-meta"},DK={key:0,class:"fp-lines"},BK={class:"fp-size"},FK=["aria-label"],HK=["aria-label"],WK=["aria-label"],UK={key:3,class:"fp-search"},qK=["placeholder"],jK={key:0,class:"fp-search-count"},zK=["disabled","title"],VK=["disabled","title"],KK=["title"],GK={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},YK={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},XK=["title"],ZK=["title"],QK=["href","title"],JK=["title"],eG={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},tG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},nG=["title","aria-label"],sG={key:1,class:"fp-code"},oG={class:"fp-line-table"},iG=["data-line"],rG={class:"fp-gutter"},lG=["innerHTML"],aG={key:1,class:"fp-body fp-code"},cG={class:"fp-line-table"},uG=["data-line"],dG={class:"fp-gutter"},fG=["innerHTML"],hG={key:2,class:"fp-body"},pG=["srcdoc","title"],mG={key:1,class:"fp-code"},gG={class:"fp-line-table"},vG=["data-line"],yG={class:"fp-gutter"},kG=["innerHTML"],bG={key:3,class:"fp-body fp-pdf-wrap"},_G=["src","title"],wG={key:1,class:"fp-binary-card"},SG={class:"fp-binary-label"},CG={key:4,class:"fp-body fp-table-wrap"},xG={class:"fp-table"},TG=["data-line"],MG={key:5,class:"fp-body fp-image-wrap"},AG=["src","alt"],EG={key:1,class:"fp-binary-card"},IG={class:"fp-binary-label"},$G={key:6,class:"fp-body fp-code"},NG={class:"fp-line-table"},LG=["data-line"],OG={class:"fp-gutter"},PG=["innerHTML"],RG={key:7,class:"fp-body fp-binary-wrap"},DG={class:"fp-binary-card"},BG={class:"fp-binary-label"},FG=Je({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=xt();function s(me,be){const Se=be?be.split("/").filter(Boolean):[];for(const fe of me.split("/"))fe===""||fe==="."||(fe===".."?Se.pop():Se.push(fe));return Se.join("/")}const o=Bt("resolveImage",async me=>me),i=j(()=>{const me=c.file?.path??"",be=me.lastIndexOf("/");return be>0?me.slice(0,be):""});function r(me){if(/^(https?:|data:|blob:)/i.test(me)||me.startsWith("/"))return me;const be=i.value;return be?s(me,be):me}async function l(me){const be=r(me);return o?o(be):be}pn("resolveImage",l);function a(me){let be=me.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(be)||be.startsWith("/"))return me;for(const fe of["#","?"]){const K=be.indexOf(fe);K!==-1&&(be=be.slice(0,K))}const Se=i.value;return{...me,path:s(be,Se)}}const c=e,u=t;function d(me){c.openFile?.(a(me))}const h=se(null),m=j(()=>{const me=c.file;if(!me)return"binary";const be=me.mime??"",Se=me.languageId??"",fe=me.path.toLowerCase();return be==="text/markdown"||Se==="markdown"||Se==="md"||fe.endsWith(".mdx")?"markdown":be==="application/json"||Se==="json"?"json":be==="text/html"||Se==="html"||fe.endsWith(".html")||fe.endsWith(".htm")?"html":be==="application/pdf"||fe.endsWith(".pdf")?"pdf":be==="text/csv"||Se==="csv"||fe.endsWith(".csv")?"csv":be.startsWith("image/")?"image":me.isBinary?"binary":be.startsWith("text/")||Se!==""?"text":"binary"});function f(me){const be=atob(me),Se=Uint8Array.from(be,fe=>fe.charCodeAt(0));return new TextDecoder().decode(Se)}const y=j(()=>{const me=c.file;if(!me)return"";if(me.encoding==="base64")try{return f(me.content)}catch{return me.content}return me.content}),S=j(()=>{if(m.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(y.value),null,2)}catch{return y.value}}),_=j(()=>c.file?(m.value==="json"?S.value:y.value).split(`
|
|
247
|
-
`):[]),b=j(()=>c.file?m.value==="json"?S.value:y.value:""),v=se(""),g=se(0),k=j(()=>{const me=v.value.trim().toLowerCase();if(!me)return[];const be=[];return _.value.forEach((Se,fe)=>{Se.toLowerCase().includes(me)&&be.push(fe+1)}),be});Ve(v,()=>{g.value=0});function $(me,be=!1){me&>(()=>{const Se=h.value?.querySelector(".fp-body"),fe=Se?.querySelector(`[data-line="${me}"]`);if(!Se||!fe)return;be&&(Se.scrollTop=0);const K=Se.getBoundingClientRect(),Z=fe.getBoundingClientRect(),pe=Z.top-K.top+Se.scrollTop;Se.scrollTop=pe-Se.clientHeight/2+Z.height/2})}Ve(()=>[c.file?.path,c.line],()=>$(c.line,!0),{immediate:!0});function A(me){const be=k.value;be.length!==0&&(g.value=(g.value+me+be.length)%be.length,$(be[g.value]))}function w(me){const be=k.value;return{target:c.line===me,hit:be.includes(me),active:be[g.value]===me}}function x(me){return me<1024?`${me} B`:me<1024*1024?`${(me/1024).toFixed(1)} KB`:`${(me/(1024*1024)).toFixed(1)} MB`}const I=se(!1),L=se(!1);function O(){c.file&&navigator.clipboard.writeText(b.value).then(()=>{I.value=!0,setTimeout(()=>{I.value=!1},1400)}).catch(()=>{})}function P(){c.file&&navigator.clipboard.writeText(c.file.path).then(()=>{L.value=!0,setTimeout(()=>{L.value=!1},1400)}).catch(()=>{})}const B=se("preview"),R=se("preview"),W=se("fit");Ve(m,me=>{B.value=me==="html"?"preview":"source",R.value="preview",W.value="fit"});const V=j(()=>{const me=c.file;return!me||m.value!=="image"?null:me.sourceUrl?me.sourceUrl:me.encoding==="base64"?`data:${me.mime};base64,${me.content}`:me.mime==="image/svg+xml"?`data:${me.mime};charset=utf-8,${encodeURIComponent(me.content)}`:null}),z=j(()=>{const me=c.file;return!me||m.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:me.encoding==="base64"?`data:${me.mime};base64,${me.content}`:null}),ie=j(()=>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:;">`,y.value].join(""):"");function ae(me){const be=[];let Se="",fe=!1;for(let K=0;K<me.length;K++){const Z=me[K];Z==='"'&&me[K+1]==='"'?(Se+='"',K++):Z==='"'?fe=!fe:Z===","&&!fe?(be.push(Se),Se=""):Se+=Z}return be.push(Se),be}const re=j(()=>_.value.slice(0,200).map(ae));function Te(me){return me.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function Pe(){const me=c.file;if(!me)return"";const be=me.languageId?.toLowerCase();return be||(me.path.split(".").pop()?.toLowerCase()??"")}function We(me){const be=Pe();let Se=Te(me);return m.value==="json"||be==="json"||be==="jsonc"?(Se=Se.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),Se=Se.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),Se=Se.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Se=Se.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Se):m.value==="html"||be==="html"||be==="xml"||be==="svg"?(Se=Se.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Se=Se.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),Se=Se.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Se):(Se=Se.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>'),Se=Se.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),Se=Se.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Se)}function Ne(me,be=55){return!me||me.length<=be?me:"…"+me.slice(me.length-be+1)}return(me,be)=>(C(),E("div",{ref_key:"rootRef",ref:h,class:"file-preview"},[e.error&&!e.loading?(C(),E("div",IK,[p("span",null,N(e.error),1),e.closable?(C(),E("button",{key:0,type:"button",class:"fp-action",onClick:be[0]||(be[0]=Se=>u("close"))},N(T(n)("filePreview.close")),1)):ce("",!0)])):!e.file&&!e.loading?(C(),E("div",$K,N(T(n)("filePreview.empty")),1)):e.loading?(C(),E("div",NK,[be[13]||(be[13]=p("span",{class:"spinner"},null,-1)),p("span",null,N(T(n)("filePreview.loading")),1)])):e.file?(C(),E(Le,{key:3},[p("div",LK,[p("span",OK,N(T(n)("common.preview")),1),p("span",{class:"fp-path",title:e.file.path},N(Ne(e.file.path)),9,PK),p("span",RK,[e.file.lineCount?(C(),E("span",DK,N(T(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ce("",!0),p("span",BK,N(x(e.file.size)),1)]),m.value==="html"?(C(),E("div",{key:0,class:"fp-seg",role:"group","aria-label":T(n)("filePreview.htmlMode")},[p("button",{type:"button",class:$e(["fp-seg-btn",{on:B.value==="preview"}]),onClick:be[1]||(be[1]=Se=>B.value="preview")},N(T(n)("filePreview.preview")),3),p("button",{type:"button",class:$e(["fp-seg-btn",{on:B.value==="source"}]),onClick:be[2]||(be[2]=Se=>B.value="source")},N(T(n)("filePreview.source")),3)],8,FK)):ce("",!0),m.value==="markdown"?(C(),E("div",{key:1,class:"fp-seg",role:"group","aria-label":T(n)("filePreview.markdownMode")},[p("button",{type:"button",class:$e(["fp-seg-btn",{on:R.value==="preview"}]),onClick:be[3]||(be[3]=Se=>R.value="preview")},N(T(n)("filePreview.preview")),3),p("button",{type:"button",class:$e(["fp-seg-btn",{on:R.value==="source"}]),onClick:be[4]||(be[4]=Se=>R.value="source")},N(T(n)("filePreview.source")),3)],8,HK)):ce("",!0),m.value==="image"?(C(),E("div",{key:2,class:"fp-seg",role:"group","aria-label":T(n)("filePreview.imageFit")},[p("button",{type:"button",class:$e(["fp-seg-btn",{on:W.value==="fit"}]),onClick:be[5]||(be[5]=Se=>W.value="fit")},N(T(n)("filePreview.fit")),3),p("button",{type:"button",class:$e(["fp-seg-btn",{on:W.value==="actual"}]),onClick:be[6]||(be[6]=Se=>W.value="actual")},N(T(n)("filePreview.actual")),3)],8,WK)):ce("",!0),m.value==="text"||m.value==="json"||m.value==="html"||m.value==="csv"?(C(),E("div",UK,[Lt(p("input",{"onUpdate:modelValue":be[7]||(be[7]=Se=>v.value=Se),class:"fp-search-input",type:"search",placeholder:T(n)("filePreview.search")},null,8,qK),[[Tn,v.value]]),v.value.trim()?(C(),E("span",jK,N(k.value.length),1)):ce("",!0),p("button",{type:"button",class:"fp-icon-btn",disabled:k.value.length===0,title:T(n)("filePreview.prevMatch"),onClick:be[8]||(be[8]=Se=>A(-1))},"↑",8,zK),p("button",{type:"button",class:"fp-icon-btn",disabled:k.value.length===0,title:T(n)("filePreview.nextMatch"),onClick:be[9]||(be[9]=Se=>A(1))},"↓",8,VK)])):ce("",!0),p("button",{type:"button",class:$e(["fp-action fp-act-icon",{copied:L.value}]),title:L.value?T(n)("filePreview.copied"):T(n)("filePreview.copyPath"),onClick:P},[L.value?(C(),E("svg",YK,[...be[15]||(be[15]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),E("svg",GK,[...be[14]||(be[14]=[p("path",{d:"M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.2l-1 1"},null,-1),p("path",{d:"M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.2l1-1"},null,-1)])]))],10,KK),e.externalActions?(C(),E("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:T(n)("filePreview.openInEditor"),onClick:be[10]||(be[10]=Se=>u("openExternal"))},[...be[16]||(be[16]=[p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M12 8.7V12a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12V5.5A1.5 1.5 0 0 1 4 4h3.3"}),p("path",{d:"M9.5 2.5h4v4"}),p("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,XK)):ce("",!0),e.externalActions?(C(),E("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:T(n)("filePreview.reveal"),onClick:be[11]||(be[11]=Se=>u("reveal"))},[...be[17]||(be[17]=[p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M1.5 4.5A1.5 1.5 0 0 1 3 3h3l1.5 1.5H13A1.5 1.5 0 0 1 14.5 6v6A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12z"})],-1)])],8,ZK)):ce("",!0),e.downloadUrl?(C(),E("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:T(n)("filePreview.download")},[...be[18]||(be[18]=[p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M8 2v8"}),p("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),p("path",{d:"M2.5 13.5h11"})],-1)])],8,QK)):ce("",!0),!e.file.isBinary&&m.value!=="image"?(C(),E("button",{key:7,type:"button",class:$e(["fp-action fp-act-icon",{copied:I.value}]),title:I.value?T(n)("filePreview.copied"):T(n)("filePreview.copy"),onClick:O},[I.value?(C(),E("svg",tG,[...be[20]||(be[20]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),E("svg",eG,[...be[19]||(be[19]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,JK)):ce("",!0),e.closable?(C(),E("button",{key:8,type:"button",class:"fp-close",title:T(n)("filePreview.close"),"aria-label":T(n)("filePreview.close"),onClick:be[12]||(be[12]=Se=>u("close"))}," × ",8,nG)):ce("",!0)]),m.value==="markdown"?(C(),E("div",{key:0,class:$e(["fp-body",{"fp-markdown":R.value==="preview"}])},[R.value==="preview"?(C(),je(_f,{key:0,text:y.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(C(),E("div",sG,[p("div",oG,[(C(!0),E(Le,null,Qe(_.value,(Se,fe)=>(C(),E("div",{key:fe,class:$e(["fp-line-row",w(fe+1)]),"data-line":fe+1},[p("span",rG,N(fe+1),1),p("span",{class:"fp-line-text",innerHTML:We(Se)},null,8,lG)],10,iG))),128))])]))],2)):m.value==="json"?(C(),E("div",aG,[p("div",cG,[(C(!0),E(Le,null,Qe(_.value,(Se,fe)=>(C(),E("div",{key:fe,class:$e(["fp-line-row",w(fe+1)]),"data-line":fe+1},[p("span",dG,N(fe+1),1),p("span",{class:"fp-line-text",innerHTML:We(Se)},null,8,fG)],10,uG))),128))])])):m.value==="html"?(C(),E("div",hG,[B.value==="preview"?(C(),E("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ie.value,title:e.file.path},null,8,pG)):(C(),E("div",mG,[p("div",gG,[(C(!0),E(Le,null,Qe(_.value,(Se,fe)=>(C(),E("div",{key:fe,class:$e(["fp-line-row",w(fe+1)]),"data-line":fe+1},[p("span",yG,N(fe+1),1),p("span",{class:"fp-line-text",innerHTML:We(Se)},null,8,kG)],10,vG))),128))])]))])):m.value==="pdf"?(C(),E("div",bG,[z.value?(C(),E("iframe",{key:0,class:"fp-pdf-frame",src:z.value,title:e.file.path},null,8,_G)):(C(),E("div",wG,[p("span",SG,N(T(n)("filePreview.pdfNoPreview")),1)]))])):m.value==="csv"?(C(),E("div",CG,[p("table",xG,[p("tbody",null,[(C(!0),E(Le,null,Qe(re.value,(Se,fe)=>(C(),E("tr",{key:fe,class:$e(w(fe+1)),"data-line":fe+1},[p("th",null,N(fe+1),1),(C(!0),E(Le,null,Qe(Se,(K,Z)=>(C(),E("td",{key:Z},N(K),1))),128))],10,TG))),128))])])])):m.value==="image"?(C(),E("div",MG,[V.value?(C(),E("img",{key:0,src:V.value,alt:e.file.path,class:$e(["fp-image",{actual:W.value==="actual"}])},null,10,AG)):(C(),E("div",EG,[be[21]||(be[21]=p("span",{class:"fp-binary-icon"},[p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[p("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),p("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),p("span",IG,N(T(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:x(e.file.size)})),1)]))])):m.value==="text"?(C(),E("div",$G,[p("div",NG,[(C(!0),E(Le,null,Qe(_.value,(Se,fe)=>(C(),E("div",{key:fe,class:$e(["fp-line-row",w(fe+1)]),"data-line":fe+1},[p("span",OG,N(fe+1),1),p("span",{class:"fp-line-text",innerHTML:We(Se)},null,8,PG)],10,LG))),128))])])):(C(),E("div",RG,[p("div",DG,[be[22]||(be[22]=p("span",{class:"fp-binary-icon"},[p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[p("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),p("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),p("span",BG,N(T(n)("filePreview.binaryNoPreview",{mime:e.file.mime||T(n)("filePreview.unknownType"),size:x(e.file.size)})),1)])]))],64)):ce("",!0)],512))}}),HG=_t(FG,[["__scopeId","data-v-64e171fe"]]),WG={class:"tp"},UG={class:"tp-header"},qG={class:"tp-title"},jG={class:"tp-sub"},zG=["title","aria-label"],VG=Je({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=xt(),i=se(null);return Ve(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||gt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(C(),E("div",WG,[p("div",UG,[p("span",qG,N(T(o)("common.preview")),1),p("span",jG,N(e.subtitle??T(o)("thinking.panelTitle")),1),p("button",{type:"button",class:"tp-close",title:T(o)("thinking.close"),"aria-label":T(o)("thinking.close"),onClick:l[0]||(l[0]=a=>s("close"))},[...l[1]||(l[1]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,zG)]),p("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},N(e.text),513)]))}}),V_=_t(VG,[["__scopeId","data-v-5cc773cd"]]),KG={class:"ap"},GG={class:"ap-header"},YG={class:"ap-title"},XG={class:"ap-sub"},ZG=["title","aria-label"],QG={key:0,class:"ap-type"},JG={key:1,class:"ap-reason"},eY={key:2,class:"ap-field"},tY={class:"ap-field-body"},nY={key:3,class:"ap-field"},sY={class:"ap-field-body ap-progress"},oY={key:4,class:"ap-field"},iY={class:"ap-field-body"},rY=Je({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=xt(),i=j(()=>(n.member.outputLines??[]).map(a=>a.trimEnd()).filter(a=>a.length>0));function r(a){switch(a){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const l=se(null);return Ve(()=>i.value.length,()=>{const a=l.value;!a||!(a.scrollHeight-a.scrollTop-a.clientHeight<24)||gt(()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)})},{immediate:!0}),(a,c)=>(C(),E("div",KG,[p("div",GG,[p("span",YG,N(T(o)("common.preview")),1),p("span",XG,N(e.member.name),1),p("span",{class:$e(["ap-phase",`phase-${e.member.phase}`])},N(r(e.member.phase)),3),p("button",{type:"button",class:"ap-close",title:T(o)("thinking.close"),"aria-label":T(o)("thinking.close"),onClick:c[0]||(c[0]=u=>s("close"))},[...c[1]||(c[1]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,ZG)]),p("div",{ref_key:"bodyEl",ref:l,class:"ap-body"},[e.member.subagentType?(C(),E("div",QG,N(e.member.subagentType),1)):ce("",!0),e.member.suspendedReason?(C(),E("div",JG,N(e.member.suspendedReason),1)):ce("",!0),e.member.prompt?(C(),E("div",eY,[c[2]||(c[2]=p("span",{class:"ap-field-label"},"Task",-1)),p("div",tY,N(e.member.prompt),1)])):ce("",!0),i.value.length>0?(C(),E("div",nY,[c[3]||(c[3]=p("span",{class:"ap-field-label"},"Progress",-1)),p("div",sY,[(C(!0),E(Le,null,Qe(i.value,(u,d)=>(C(),E("span",{key:d},N(u),1))),128))])])):ce("",!0),e.member.summary?(C(),E("div",oY,[c[4]||(c[4]=p("span",{class:"ap-field-label"},"Result",-1)),p("div",iY,N(e.member.summary),1)])):ce("",!0)],512)]))}}),lY=_t(rY,[["__scopeId","data-v-723eed48"]]),aY={class:"sc"},cY={class:"sc-header"},uY={class:"sc-title"},dY=["title"],fY=["title","aria-label"],hY={key:0,class:"sc-empty"},pY={key:2,class:"sc-loading","aria-hidden":"true"},mY={class:"sc-composer"},gY=["placeholder"],vY=["disabled","title"],yY=Je({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=xt(),i=j(()=>n.turns.find(b=>b.role==="user")?.text?.trim()??""),r=j(()=>n.title?.trim()||o("sideChat.title")),l=j(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=se(""),c=se(null),u=se(null);function d(){const _=a.value.trim();_&&(s("send",_),a.value="",gt(()=>{c.value&&(c.value.style.height="auto"),h()}))}function h(){const _=u.value;_&&(_.scrollTop=_.scrollHeight)}const m=j(()=>{const _=n.turns;if(_.length===0)return"0";const b=_.at(-1),v=b.thinking?.length??0,g=b.tools?.reduce((k,$)=>k+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${_.length}:${b.text.length}:${v}:${g}`});Ve(m,async()=>{!n.running&&!n.sending||(await gt(),h())});const f=j(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function y(_){_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&(_.preventDefault(),d())}function S(){const _=c.value;_&&(_.style.height="auto",_.style.height=`${Math.min(_.scrollHeight,160)}px`)}return(_,b)=>(C(),E("div",aY,[p("div",cY,[p("span",uY,N(r.value),1),p("span",{class:"sc-subtitle",title:l.value},N(l.value),9,dY),p("button",{type:"button",class:"sc-close",title:T(o)("thinking.close"),"aria-label":T(o)("thinking.close"),onClick:b[0]||(b[0]=v=>s("close"))},[...b[2]||(b[2]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,fY)]),p("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(C(),E("div",hY,N(T(o)("sideChat.empty")),1)):(C(),je(sT,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),f.value?(C(),E("div",pY,[kt(Bg)])):ce("",!0)],512),p("div",mY,[Lt(p("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":b[1]||(b[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:T(o)("sideChat.placeholder"),onInput:S,onKeydown:y},null,40,gY),[[Tn,a.value]]),p("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:T(o)("sideChat.send"),onClick:d},[...b[3]||(b[3]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M2 8h10"}),p("path",{d:"M8 4l4 4-4 4"})],-1)])],8,vY)])]))}}),kY=_t(yY,[["__scopeId","data-v-6db6c388"]]),bY={class:"changes-pane"},_Y={class:"dv-panel-head"},wY={class:"dv-title"},SY=["title"],CY=["title","aria-label"],xY={class:"diff-head"},TY=["title"],MY={class:"back-label"},AY={key:0,class:"empty-state"},EY={key:1,class:"diff-lines"},IY={key:0,class:"hunk-text"},$Y={class:"dl-gutter old"},NY={class:"dl-gutter new"},LY={class:"dl-sign"},OY={class:"dl-text"},PY={key:2,class:"empty-state"},RY={class:"dv-panel-head"},DY={class:"dv-title"},BY={class:"dv-change-count"},FY=["aria-label"],HY=["aria-pressed"],WY=["aria-pressed"],UY=["title","aria-label"],qY={class:"ch-head"},jY={class:"br-label"},zY={class:"br-name"},VY={key:0,class:"sync-info"},KY=["title"],GY=["title"],YY={key:1,class:"empty-head"},XY={key:0,class:"ch-list"},ZY=["title","onClick"],QY={class:"fpath"},JY={key:1,class:"ch-list ch-tree"},eX={class:"tree-list"},tX=["onClick"],nX={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},sX=["d"],oX={class:"tree-name"},iX=["title","onClick"],rX={class:"tree-name"},lX={key:2,class:"empty-state"},aX={key:3,class:"empty-state"},cX=Je({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t;function i(R){const W=R.toLowerCase();return W==="modified"?"modified":W==="added"?"added":W==="deleted"?"deleted":W==="renamed"?"renamed":W==="untracked"?"untracked":W==="conflicted"?"conflicted":W==="ignored"?"ignored":W==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(R){return r[i(R)]??"?"}function a(R,W=60){return R.length<=W?R:"…"+R.slice(R.length-W+1)}const c=j(()=>s.gitInfo!==null),u=j(()=>s.changes.length>0),d=j(()=>(s.selectedDiffPath??null)!==null),h=j(()=>s.mode==="detail"||s.mode==="full"&&d.value),m=j(()=>s.fileDiff??[]),f=j(()=>s.fileDiffLoading===!0);function y(R){return R.oldNo!==void 0?String(R.oldNo):""}function S(R){return R.newNo!==void 0?String(R.newNo):""}function _(R){return`dl-${R.type}`}function b(R){o("open",R)}function v(){o("back")}function g(){o("close")}const k=se("list");function $(R){k.value=R}function A(R){const W={children:[]},V=[...R].sort((z,ie)=>z.path.localeCompare(ie.path));for(const z of V){const ie=z.path.split("/");let ae=W;for(let re=0;re<ie.length;re++){const Te=ie[re],Pe=re===ie.length-1,We=ie.slice(0,re+1).join("/");let Ne=ae.children.find(me=>me.name===Te&&me.kind===(Pe?"file":"folder"));Ne||(Ne={name:Te,path:We,kind:Pe?"file":"folder",status:Pe?z.status:void 0,children:[]},ae.children.push(Ne)),ae=Ne}}return W.children}const w=j(()=>A(s.changes)),x=se(new Set);function I(R){return!x.value.has(R)}const L=j(()=>{const R=[];function W(V,z){for(const ie of V)R.push({node:ie,depth:z}),ie.kind==="folder"&&I(ie.path)&&W(ie.children,z+1)}return W(w.value,0),R});function O(R){const W=new Set(x.value);W.has(R.path)?W.delete(R.path):W.add(R.path),x.value=W}const P=R=>"M1.5 3.5h3l1.5 2h7a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z";function B(R){return`${16+R*16}px`}return(R,W)=>(C(),E("div",bY,[h.value?(C(),E(Le,{key:0},[p("div",_Y,[p("span",wY,N(T(n)("diff.title")),1),p("span",{class:"dv-path",title:e.selectedDiffPath??""},N(a(e.selectedDiffPath??"",50)),9,SY),e.closable?(C(),E("button",{key:0,type:"button",class:"dv-close",title:T(n)("diff.close"),"aria-label":T(n)("diff.close"),onClick:g},[...W[2]||(W[2]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,CY)):ce("",!0)]),p("div",xY,[e.hideBack?ce("",!0):(C(),E("button",{key:0,class:"back-btn",type:"button",onClick:v,title:T(n)("diff.back")},[W[3]||(W[3]=p("span",{"aria-hidden":"true"},"←",-1)),p("span",MY,N(T(n)("diff.back")),1)],8,TY))]),f.value?(C(),E("div",AY,N(T(n)("diff.loading")),1)):m.value.length>0?(C(),E("div",EY,[(C(!0),E(Le,null,Qe(m.value,(V,z)=>(C(),E("div",{key:z,class:$e(["dl",_(V)])},[V.type==="hunk"?(C(),E("span",IY,N(V.text),1)):(C(),E(Le,{key:1},[p("span",$Y,N(y(V)),1),p("span",NY,N(S(V)),1),p("span",LY,N(V.type==="add"?"+":V.type==="del"?"-":" "),1),p("span",OY,N(V.text),1)],64))],2))),128))])):(C(),E("div",PY,N(T(n)("diff.noDiff")),1))],64)):(C(),E(Le,{key:1},[p("div",RY,[p("span",DY,N(T(n)("diff.title")),1),p("span",BY,N(T(n)("diff.changeCount",{count:e.changes.length})),1),p("div",{class:"dv-toggle",role:"group","aria-label":T(n)("diff.list")+" / "+T(n)("diff.tree")},[p("button",{type:"button",class:$e(["dv-toggle-btn",{active:k.value==="list"}]),"aria-pressed":k.value==="list",onClick:W[0]||(W[0]=V=>$("list"))},N(T(n)("diff.list")),11,HY),p("button",{type:"button",class:$e(["dv-toggle-btn",{active:k.value==="tree"}]),"aria-pressed":k.value==="tree",onClick:W[1]||(W[1]=V=>$("tree"))},N(T(n)("diff.tree")),11,WY)],8,FY),e.closable?(C(),E("button",{key:0,type:"button",class:"dv-close",title:T(n)("diff.close"),"aria-label":T(n)("diff.close"),onClick:g},[...W[4]||(W[4]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,UY)):ce("",!0)]),p("div",qY,[c.value?(C(),E(Le,{key:0},[p("span",jY,N(T(n)("diff.branch")),1),p("span",zY,N(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(C(),E("span",VY,[e.gitInfo.ahead>0?(C(),E("span",{key:0,class:"ahead",title:T(n)("diff.aheadTitle")},"↑"+N(e.gitInfo.ahead),9,KY)):ce("",!0),e.gitInfo.behind>0?(C(),E("span",{key:1,class:"behind",title:T(n)("diff.behindTitle")},"↓"+N(e.gitInfo.behind),9,GY)):ce("",!0)])):ce("",!0)],64)):(C(),E("span",YY,N(T(n)("diff.empty")),1))]),u.value&&k.value==="list"?(C(),E("div",XY,[(C(!0),E(Le,null,Qe(e.changes,V=>(C(),E("button",{key:V.path,type:"button",class:"ch-row",title:V.path,onClick:z=>b(V.path)},[p("span",{class:$e(["badge",i(V.status)])},N(l(V.status)),3),p("span",QY,N(a(V.path)),1)],8,ZY))),128))])):u.value&&k.value==="tree"?(C(),E("div",JY,[p("ul",eX,[(C(!0),E(Le,null,Qe(L.value,({node:V,depth:z})=>(C(),E("li",{key:V.path,class:"tree-node"},[V.kind==="folder"?(C(),E("button",{key:0,type:"button",class:"tree-row tree-folder",style:Dt({paddingLeft:B(z)}),onClick:ie=>O(V)},[(C(),E("svg",nX,[p("path",{d:P(I(V.path))},null,8,sX)])),p("span",oX,N(V.name),1)],12,tX)):(C(),E("button",{key:1,type:"button",class:"tree-row tree-file",style:Dt({paddingLeft:B(z)}),title:V.path,onClick:ie=>b(V.path)},[p("span",{class:$e(["badge",i(V.status)])},N(l(V.status)),3),p("span",rX,N(V.name),1)],12,iX))]))),128))])])):c.value?(C(),E("div",lX,N(T(n)("diff.clean")),1)):(C(),E("div",aX,N(T(n)("diff.empty")),1))],64))]))}}),uX=_t(cX,[["__scopeId","data-v-4c13e2b6"]]);function fh(e,t){let n=null;ln(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,gt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),lo(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const dX=["aria-label"],fX={class:"dh"},hX={class:"dtitle"},pX=["title"],mX={class:"search-wrap"},gX=["placeholder"],vX=["aria-label"],yX=["aria-selected","onClick"],kX={key:1,class:"loading-state"},bX={key:2,class:"unavail-state"},_X={key:3,class:"model-list"},wX=["aria-selected","onClick","onMouseenter"],SX={class:"check"},CX={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},xX={class:"model-main"},TX={class:"model-name"},MX={class:"model-id"},AX={class:"model-provider"},EX={class:"model-ctx"},IX={key:0,class:"caps"},$X=["title","onClick"],NX={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},LX=["fill"],OX={key:0,class:"empty"},PX={class:"footer-hint"},RX=Je({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=j(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=se(""),a=se(null),c=se(null),u=se("all");fh(c,a);const d=j(()=>{const v=new Set,g=[{id:"all",label:n("model.allTab")}];for(const k of s.models)v.has(k.provider)||(v.add(k.provider),g.push({id:k.provider,label:k.provider}));return g}),h=j(()=>{const v=l.value.toLowerCase().trim(),g=s.models.filter(k=>{if(u.value!=="all"&&k.provider!==u.value)return!1;const $=(k.displayName??k.model).toLowerCase().includes(v),A=k.provider.toLowerCase().includes(v),w=k.id.toLowerCase().includes(v);return!v||$||A||w});return u.value!=="all"?g:g.sort((k,$)=>{const A=r(k.id)?1:0;return(r($.id)?1:0)-A})}),m=j(()=>h.value),f=se(0);Ve([l,u],()=>{f.value=0}),Ve(d,v=>{v.some(g=>g.id===u.value)||(u.value="all")}),Ve(m,v=>{f.value=Math.min(f.value,Math.max(v.length-1,0))});function y(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),f.value=Math.min(f.value+1,m.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),f.value=Math.max(f.value-1,0);else if(v.key==="Enter"){const g=m.value[f.value];g&&o("select",g.id)}}ln(()=>{document.addEventListener("keydown",y)}),Ut(()=>{document.removeEventListener("keydown",y)});function S(v){o("select",v)}function _(v){return m.value.indexOf(v)}function b(v){u.value=v}return(v,g)=>(C(),E("div",{class:"backdrop",onClick:g[3]||(g[3]=Ze(k=>o("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":T(n)("model.dialogLabel")},[p("div",fX,[p("span",hX,N(T(n)("model.title")),1),p("button",{class:"close-btn",title:T(n)("model.close"),onClick:g[0]||(g[0]=k=>o("close"))},"✕",8,pX)]),p("div",mX,[Lt(p("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":g[1]||(g[1]=k=>l.value=k),class:"search-input",type:"text",placeholder:T(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,gX),[[Tn,l.value]])]),d.value.length>1?(C(),E("div",{key:0,class:"tab-strip",role:"tablist","aria-label":T(n)("model.providerTabs")},[(C(!0),E(Le,null,Qe(d.value,k=>(C(),E("button",{key:k.id,type:"button",class:$e(["tab-btn",{on:k.id===u.value}]),role:"tab","aria-selected":k.id===u.value,onClick:$=>b(k.id)},N(k.label),11,yX))),128))],8,vX)):ce("",!0),e.loading?(C(),E("div",kX,[g[4]||(g[4]=p("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),p("span",null,N(T(n)("model.loading")),1)])):e.unavailable?(C(),E("div",bX,[g[5]||(g[5]=p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M10 2 L19 18 H1 Z"}),p("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),p("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),p("span",null,N(T(n)("model.unavailable")),1)])):(C(),E("div",_X,[(C(!0),E(Le,null,Qe(m.value,k=>(C(),E("div",{key:k.id,class:$e(["model-row",{"is-current":k.id===e.current,"is-selected":_(k)===f.value}]),role:"option","aria-selected":k.id===e.current,onClick:$=>S(k.id),onMouseenter:$=>f.value=_(k)},[p("span",SX,[k.id===e.current?(C(),E("svg",CX,[...g[6]||(g[6]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ce("",!0)]),p("span",xX,[p("span",TX,N(k.displayName??k.model),1),p("span",MX,N(k.id),1)]),p("span",AX,N(k.provider),1),p("span",EX,N(T(n)("model.contextSuffix",{size:Math.round(k.maxContextSize/1e3)})),1),k.capabilities&&k.capabilities.length>0?(C(),E("span",IX,N(k.capabilities.join(", ")),1)):ce("",!0),p("button",{type:"button",class:$e(["star-btn",{starred:r(k.id)}]),title:r(k.id)?T(n)("model.unstarTitle"):T(n)("model.starTitle"),onClick:Ze($=>o("toggle-star",k.id),["stop"]),onMouseenter:g[2]||(g[2]=Ze(()=>{},["stop"]))},[(C(),E("svg",NX,[p("path",{fill:r(k.id)?"currentColor":"none",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,8,LX)]))],42,$X)],42,wX))),128)),m.value.length===0&&!e.loading&&!e.unavailable?(C(),E("div",OX,N(s.models.length===0?T(n)("model.emptyNoModels"):T(n)("model.emptyNoMatch")),1)):ce("",!0)])),p("div",PX,N(T(n)("model.footerHint")),1)],8,dX)]))}}),DX=_t(RX,[["__scopeId","data-v-cb98ad2b"]]),BX=["aria-label"],FX={class:"dh"},HX={class:"dtitle"},WX=["title"],UX={class:"prov-list"},qX={key:0,class:"state-row"},jX={key:1,class:"state-row unavail"},zX={key:2,class:"empty"},VX=["title"],KX={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},GX=["fill"],YX={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},XX=["fill"],ZX={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},QX={class:"prov-info"},JX={class:"prov-type"},eZ={key:0,class:"prov-url"},tZ={class:"prov-meta"},nZ={key:0},sZ={key:0,class:"confirm-row"},oZ={class:"confirm-text"},iZ={key:1,class:"prov-actions"},rZ=["title","onClick"],lZ=["title","onClick"],aZ={key:0,class:"add-section"},cZ={key:0,class:"add-btns"},uZ={key:1,class:"add-form"},dZ={class:"form-row"},fZ={class:"flabel"},hZ=["value"],pZ={class:"form-row"},mZ={class:"flabel"},gZ={class:"form-row"},vZ={class:"flabel"},yZ=["placeholder"],kZ={class:"form-row"},bZ={class:"flabel"},_Z=["placeholder"],wZ={key:0,class:"add-error"},SZ={class:"form-btns"},CZ={class:"footer-hint"},xZ=Je({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=xt(),s=se(null);fh(s);const o=t,i=se(null);function r(v){i.value=v}function l(){i.value&&(o("delete",i.value),i.value=null)}function a(){i.value=null}const c=se(!1),u=Qs({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=se(""),h=["moonshot","anthropic","openai","custom"];function m(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function f(){c.value=!1}function y(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",o("add",{type:u.type,apiKey:u.apiKey.trim()||void 0,baseUrl:u.baseUrl.trim()||void 0,defaultModel:u.defaultModel.trim()||void 0}),c.value=!1}function S(v){if(v.key==="Escape"){if(c.value){f();return}if(i.value){a();return}o("close")}}ln(()=>document.addEventListener("keydown",S)),Ut(()=>document.removeEventListener("keydown",S));function _(v){return v==="connected"?"var(--ok)":v==="error"?"var(--err)":"var(--faint)"}function b(v){return n(v==="connected"?"providers.status.connected":v==="error"?"providers.status.error":"providers.status.unconfigured")}return(v,g)=>(C(),E("div",{class:"backdrop",onClick:g[7]||(g[7]=Ze(k=>o("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":T(n)("providers.dialogLabel")},[p("div",FX,[p("span",HX,N(T(n)("providers.title")),1),p("button",{class:"close-btn",title:T(n)("providers.close"),onClick:g[0]||(g[0]=k=>o("close"))},"✕",8,WX)]),p("div",UX,[e.loading?(C(),E("div",qX,[g[8]||(g[8]=p("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),p("span",null,N(T(n)("providers.loading")),1)])):e.unavailable?(C(),E("div",jX,[g[9]||(g[9]=p("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),p("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),p("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),p("span",null,N(T(n)("providers.unavailable")),1)])):e.providers.length===0?(C(),E("div",zX,N(T(n)("providers.empty")),1)):(C(!0),E(Le,{key:3},Qe(e.providers,k=>(C(),E("div",{key:k.id,class:"prov-row"},[p("span",{class:"status-dot",style:Dt({color:_(k.status)}),title:b(k.status)},[k.status==="connected"?(C(),E("svg",KX,[p("circle",{cx:"4",cy:"4",r:"3.5",fill:_(k.status)},null,8,GX)])):k.status==="error"?(C(),E("svg",YX,[p("circle",{cx:"4",cy:"4",r:"3.5",fill:_(k.status)},null,8,XX)])):(C(),E("svg",ZX,[...g[10]||(g[10]=[p("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,VX),p("div",QX,[p("span",JX,N(k.type),1),k.baseUrl?(C(),E("span",eZ,N(k.baseUrl),1)):ce("",!0),p("span",tZ,[p("span",{class:$e(["prov-key-state",k.hasApiKey?"has-key":"no-key"])},N(k.hasApiKey?T(n)("providers.keySet"):T(n)("providers.keyNotSet")),3),k.models&&k.models.length>0?(C(),E("span",nZ," · "+N(T(n)("providers.modelCount",{count:k.models.length})),1)):ce("",!0)])]),i.value===k.id?(C(),E("div",sZ,[p("span",oZ,N(T(n)("providers.confirmDelete")),1),p("button",{class:"act-btn danger",onClick:l},N(T(n)("providers.confirm")),1),p("button",{class:"act-btn",onClick:a},N(T(n)("providers.cancel")),1)])):(C(),E("div",iZ,[p("button",{class:"act-btn",title:T(n)("providers.refreshTitle",{type:k.type}),onClick:$=>o("refresh",k.id)},N(T(n)("providers.refresh")),9,rZ),p("button",{class:"act-btn danger",title:T(n)("providers.deleteTitle",{type:k.type}),onClick:$=>r(k.id)},N(T(n)("providers.delete")),9,lZ)]))]))),128))]),e.unavailable?ce("",!0):(C(),E("div",aZ,[c.value?(C(),E("div",uZ,[p("div",dZ,[p("label",fZ,N(T(n)("providers.fieldType")),1),Lt(p("select",{"onUpdate:modelValue":g[3]||(g[3]=k=>u.type=k),class:"finput fselect"},[(C(),E(Le,null,Qe(h,k=>p("option",{key:k,value:k},N(k),9,hZ)),64))],512),[[Vd,u.type]])]),p("div",pZ,[p("label",mZ,N(T(n)("providers.fieldApiKey")),1),Lt(p("input",{"onUpdate:modelValue":g[4]||(g[4]=k=>u.apiKey=k),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[Tn,u.apiKey]])]),p("div",gZ,[p("label",vZ,N(T(n)("providers.fieldBaseUrl")),1),Lt(p("input",{"onUpdate:modelValue":g[5]||(g[5]=k=>u.baseUrl=k),class:"finput",type:"text",placeholder:T(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,yZ),[[Tn,u.baseUrl]])]),p("div",kZ,[p("label",bZ,N(T(n)("providers.fieldDefaultModel")),1),Lt(p("input",{"onUpdate:modelValue":g[6]||(g[6]=k=>u.defaultModel=k),class:"finput",type:"text",placeholder:T(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,_Z),[[Tn,u.defaultModel]])]),d.value?(C(),E("div",wZ,N(d.value),1)):ce("",!0),p("div",SZ,[p("button",{class:"act-btn primary",onClick:y},N(T(n)("providers.add")),1),p("button",{class:"act-btn",onClick:f},N(T(n)("providers.cancel")),1)])])):(C(),E("div",cZ,[p("button",{class:"add-btn-oauth",onClick:g[1]||(g[1]=k=>o("openLogin","moonshot"))},[g[11]||(g[11]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("circle",{cx:"5",cy:"3",r:"2"}),p("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),vt(" "+N(T(n)("providers.loginKimi")),1)]),p("button",{class:"add-btn-oauth",onClick:g[2]||(g[2]=k=>o("openLogin","anthropic"))},[g[12]||(g[12]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("circle",{cx:"5",cy:"3",r:"2"}),p("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),vt(" "+N(T(n)("providers.loginAnthropic")),1)]),p("button",{class:"add-btn add-btn-key",onClick:m},[g[13]||(g[13]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),p("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),vt(" "+N(T(n)("providers.enterApiKey")),1)])]))])),p("div",CZ,N(T(n)("providers.escClose")),1)],8,BX)]))}}),TZ=_t(xZ,[["__scopeId","data-v-2fd7e21e"]]),MZ={class:"backdrop"},AZ=["aria-label"],EZ={class:"dh"},IZ={class:"dtitle"},$Z=["title"],NZ={key:0,class:"center-body"},LZ={class:"center-text"},OZ={key:1,class:"nb"},PZ={class:"nb-lead"},RZ=["href"],DZ={class:"nb-or"},BZ={class:"nb-fallback"},FZ={class:"nb-fb-text"},HZ=["href"],WZ={class:"nb-code-row"},UZ={class:"nb-code"},qZ={class:"nb-status"},jZ=["aria-label"],zZ={class:"nb-status-text"},VZ={class:"nb-countdown"},KZ={key:2,class:"center-body"},GZ={class:"center-text success-text"},YZ={class:"center-hint"},XZ={class:"center-body"},ZZ={class:"center-text err-text"},QZ={class:"center-hint"},JZ={class:"actions"},eQ={class:"center-body"},tQ={class:"center-text warn-text"},nQ={class:"center-hint"},sQ={class:"actions"},oQ=Je({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=xt(),s=se(null);fh(s);const o=t,i=e,r=se("starting"),l=se(null),a=se(0),c=se(!1);let u=null,d=null;ln(async()=>{document.addEventListener("keydown",v),await h()}),Ut(()=>{document.removeEventListener("keydown",v),y()});async function h(){y(),l.value=null,r.value="starting";const k=await i.onStartOAuthLogin();if(!k){r.value="error";return}l.value={flowId:k.flowId,verificationUri:k.verificationUri,verificationUriComplete:k.verificationUriComplete,userCode:k.userCode,expiresIn:k.expiresIn,interval:k.interval},a.value=k.expiresIn,r.value="device-code",m(),f(k.interval)}function m(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function f(k){u&&clearTimeout(u),u=setTimeout(async()=>{const $=await i.onPollOAuthLogin();$?.status==="authenticated"?(y(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):$?.status==="expired"||$?.status==="cancelled"?(y(),r.value="expired"):f(k)},k*1e3)}function y(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function S(){await h()}async function _(){if(l.value)try{await navigator.clipboard.writeText(l.value.userCode),c.value=!0,setTimeout(()=>{c.value=!1},2e3)}catch{}}async function b(){y(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function v(k){k.key==="Escape"&&b()}function g(k){const $=Math.floor(k/60),A=k%60;return`${$}:${String(A).padStart(2,"0")}`}return(k,$)=>(C(),E("div",MZ,[p("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":T(n)("login.title")},[p("div",EZ,[p("span",IZ,N(T(n)("login.title")),1),p("button",{class:"close-btn",title:T(n)("login.close"),onClick:b},[...$[0]||($[0]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,$Z)]),r.value==="starting"?(C(),E("div",NZ,[$[1]||($[1]=p("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),p("span",LZ,N(T(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(C(),E("div",OZ,[p("div",PZ,N(T(n)("login.lead")),1),p("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[vt(N(T(n)("login.authorizeInBrowser"))+" ",1),$[2]||($[2]=p("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.6"},[p("path",{d:"M6 2H2.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8"}),p("path",{d:"M9.5 1.5h3v3M12.5 1.5 7 7"})],-1))],8,RZ),p("div",DZ,N(T(n)("login.orDivider")),1),p("div",BZ,[p("div",FZ,[vt(N(T(n)("login.fallbackPrefix")),1),p("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},N(l.value.verificationUri),9,HZ),vt(N(T(n)("login.fallbackSuffix")),1)]),p("div",WZ,[p("span",UZ,N(l.value.userCode),1),p("button",{class:$e(["nb-copy",{"is-copied":c.value}]),onClick:_},[c.value?(C(),E(Le,{key:0},[$[3]||($[3]=p("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[p("polyline",{points:"1,6 4,9 11,2"})],-1)),vt(" "+N(T(n)("login.copied")),1)],64)):(C(),E(Le,{key:1},[$[4]||($[4]=p("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),p("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),vt(" "+N(T(n)("login.copy")),1)],64))],2)])]),p("div",qZ,[p("span",{class:"nb-spinner","aria-label":T(n)("login.waitingAuth")},[...$[5]||($[5]=[p("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,jZ),p("span",zZ,N(T(n)("login.waitingAutoClose")),1),p("span",VZ,N(g(a.value)),1)])])):r.value==="success"?(C(),E("div",KZ,[$[6]||($[6]=p("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[p("circle",{cx:"18",cy:"18",r:"15"}),p("polyline",{points:"10,18 15,24 26,12"})],-1)),p("span",GZ,N(T(n)("login.success")),1),p("span",YZ,N(T(n)("login.successHint")),1)])):r.value==="expired"?(C(),E(Le,{key:3},[p("div",XZ,[$[7]||($[7]=p("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[p("circle",{cx:"14",cy:"14",r:"12"}),p("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),p("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),p("span",ZZ,N(T(n)("login.expiredTitle")),1),p("span",QZ,N(T(n)("login.expiredHint")),1)]),p("div",JZ,[p("button",{class:"act-btn primary",onClick:S},N(T(n)("login.retry")),1),p("button",{class:"act-btn",onClick:b},N(T(n)("login.closeBtn")),1)])],64)):r.value==="error"?(C(),E(Le,{key:4},[p("div",eQ,[$[8]||($[8]=p("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M14 3 L26 24 H2 Z"}),p("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),p("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),p("span",tQ,N(T(n)("login.errorTitle")),1),p("span",nQ,N(T(n)("login.errorHint")),1)]),p("div",sQ,[p("button",{class:"act-btn primary",onClick:S},N(T(n)("login.retry")),1),p("button",{class:"act-btn",onClick:b},N(T(n)("login.closeBtn")),1)])],64)):ce("",!0)],8,AZ)]))}}),iQ=_t(oQ,[["__scopeId","data-v-2c7f0348"]]),rQ=["aria-label"],lQ={class:"dh"},aQ={class:"dtitle"},cQ=["title"],uQ={class:"form-body"},dQ={class:"form-row"},fQ={class:"flabel",for:"ns-cwd"},hQ=["placeholder"],pQ={key:0,class:"recent-section"},mQ={class:"recent-label"},gQ={class:"recent-list"},vQ=["title","onClick"],yQ={class:"recent-path"},kQ={class:"form-row"},bQ={class:"flabel",for:"ns-title"},_Q=["placeholder"],wQ={class:"actions"},SQ=["disabled"],CQ={class:"footer-hint"},xQ=Je({__name:"NewSessionDialog",props:{recentCwds:{}},emits:["create","close"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=se(""),r=se("");Ve(()=>s.recentCwds,h=>{i.value===""&&h.length>0&&(i.value=h[0])},{immediate:!0});const l=j(()=>i.value.trim()),a=j(()=>l.value.length>0);function c(){if(!a.value)return;const h={cwd:l.value},m=r.value.trim();m&&(h.title=m),o("create",h)}function u(h){i.value=h}function d(h){h.key==="Escape"?o("close"):h.key==="Enter"&&!(h.target instanceof HTMLButtonElement)&&c()}return ln(()=>document.addEventListener("keydown",d)),Ut(()=>document.removeEventListener("keydown",d)),(h,m)=>(C(),E("div",{class:"backdrop",onClick:m[4]||(m[4]=Ze(f=>o("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":T(n)("newSession.title")},[p("div",lQ,[p("span",aQ,N(T(n)("newSession.title")),1),p("button",{class:"close-btn",title:T(n)("newSession.close"),onClick:m[0]||(m[0]=f=>o("close"))},[...m[5]||(m[5]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,cQ)]),p("div",uQ,[p("div",dQ,[p("label",fQ,N(T(n)("newSession.cwdLabel")),1),Lt(p("input",{id:"ns-cwd","onUpdate:modelValue":m[1]||(m[1]=f=>i.value=f),class:"finput",type:"text",placeholder:T(n)("newSession.cwdPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,hQ),[[Tn,i.value]])]),e.recentCwds.length>0?(C(),E("div",pQ,[p("div",mQ,N(T(n)("newSession.recentLabel")),1),p("div",gQ,[(C(!0),E(Le,null,Qe(e.recentCwds,f=>(C(),E("button",{key:f,class:$e(["recent-item",{"is-active":i.value===f}]),title:f,onClick:y=>u(f)},[m[6]||(m[6]=p("svg",{class:"dir-icon",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[p("rect",{x:"1",y:"3",width:"9",height:"6.5",rx:"1"}),p("path",{d:"M1 4.5V3a1 1 0 0 1 1-1h2.5l1 1.5"})],-1)),p("span",yQ,N(f),1)],10,vQ))),128))])])):ce("",!0),p("div",kQ,[p("label",bQ,N(T(n)("newSession.titleFieldLabel")),1),Lt(p("input",{id:"ns-title","onUpdate:modelValue":m[2]||(m[2]=f=>r.value=f),class:"finput",type:"text",placeholder:T(n)("newSession.titleFieldPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,_Q),[[Tn,r.value]])])]),p("div",wQ,[p("button",{class:"act-btn primary",disabled:!a.value,onClick:c},N(T(n)("newSession.create")),9,SQ),p("button",{class:"act-btn",onClick:m[3]||(m[3]=f=>o("close"))},N(T(n)("newSession.cancel")),1)]),p("div",CQ,N(T(n)("newSession.footerHint")),1)],8,rQ)]))}}),TQ=_t(xQ,[["__scopeId","data-v-9238ae59"]]),MQ={class:"lang-switch",role:"group","aria-label":"Language"},AQ=["aria-pressed","onClick"],EQ=Je({__name:"LanguageSwitcher",setup(e){const{locale:t}=xt();function n(s){t.value!==s&&ES(s)}return(s,o)=>(C(),E("div",MQ,[(C(!0),E(Le,null,Qe(T(AS),i=>(C(),E("button",{key:i.code,type:"button",class:$e(["lang-opt",{on:T(t)===i.code}]),"aria-pressed":T(t)===i.code,onClick:Ze(r=>n(i.code),["stop"])},N(i.label),11,AQ))),128))]))}}),lT=_t(EQ,[["__scopeId","data-v-807a4065"]]),K_=Ot.clientId,IQ="kimi-code-web",$Q="web";function NQ(){return{serverHttpUrl:OQ(),clientId:BQ(),clientName:IQ,clientVersion:FQ(),clientUiMode:$Q}}function LQ(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function OQ(e){const t=LQ(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function PQ(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function RQ(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return PQ(e)}function wf(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function DQ(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 BQ(){const e=En(K_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return An(K_,t),t}function FQ(){return"0.1.1".trim()?"0.1.1":"0.0.0-dev"}const G_=1e3,_m=16384,wm=500,Sm=50,HQ=6,WQ=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,UQ=/^[A-Za-z0-9+/=_-]{200,}$/;let Cm=null;function ci(){if(Cm!==null)return Cm;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=En(Ot.debug)==="1"),Cm=e,e}const ar=[];let qQ=1;const lv=se(0),sc=ll(!1);function jQ(){return ar}function zQ(){ar.length=0,lv.value++}function cl(e){sc.value||(ar.push({id:qQ++,ts:Date.now(),...e}),ar.length>G_&&ar.splice(0,ar.length-G_),lv.value++)}function Fg(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return UQ.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>wm?`${o.slice(0,wm)}… [+${o.length-wm} chars]`:o}if(n!=="object")return String(e);if(t>=HQ)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,Sm).map(i=>Fg(i,t+1));return e.length>Sm&&o.push(`[+${e.length-Sm} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=WQ.test(o)?"[redacted]":Fg(i,t+1);return s}function ka(e){if(e===void 0)return;const t=Fg(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>_m)return{_truncated:`detail JSON was ${n.length} chars; first ${_m} kept`,preview:n.slice(0,_m)}}catch{return"[unserializable detail]"}return t}function Y_(e){ci()&&cl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:ka(e.body)}})}function X_(e){if(!ci())return;const t=e.code!==0;cl({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:ka(e.data)}})}function id(e){ci()&&cl({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 Ol(e,t){ci()&&cl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:ka(t)})}function VQ(e){if(!ci())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;cl({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:ka(e)})}function KQ(e){if(!ci())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);cl({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:ka(t.payload)})}const GQ={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function xm(e,t,n){ci()&&cl({source:"client",kind:`client:${e}`,label:`${GQ[e]} ${t}`,detail:ka(n)})}let Z_=!1;function YQ(){if(!(Z_||!ci())){Z_=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{xm("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;xm("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{xm(e,n.map(XQ).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function XQ(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 aT(e=ar){if(typeof document>"u")return;const t=new Blob([ZQ(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function ZQ(e=ar){return e.map(t=>JSON.stringify(t)).join(`
|
|
248
|
-
`)}const QQ=["aria-label"],JQ={class:"dh"},eJ={class:"dtitle"},tJ=["title"],nJ={class:"settings-layout"},sJ=["aria-label"],oJ=["aria-selected","aria-controls","id","onClick"],iJ={class:"body"},rJ={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},lJ={class:"sec"},aJ={class:"sec-title"},cJ={class:"row"},uJ={class:"rlabel"},dJ=["aria-label"],fJ=["aria-pressed"],hJ=["aria-pressed"],pJ={class:"row"},mJ={class:"rlabel"},gJ=["aria-label"],vJ=["aria-pressed"],yJ=["aria-pressed"],kJ=["aria-pressed"],bJ={class:"row"},_J={class:"rlabel"},wJ={class:"num-field"},SJ=["value","aria-label"],CJ={class:"row"},xJ={class:"rlabel"},TJ={class:"sec"},MJ={class:"sec-title"},AJ={class:"row"},EJ={class:"rlabel"},IJ={key:0,class:"hint"},$J=["aria-checked","disabled"],NJ={class:"sec"},LJ={class:"sec-title"},OJ={class:"row"},PJ={class:"rlabel"},RJ=["title"],DJ={class:"actions"},BJ={class:"sec"},FJ={class:"sec-title"},HJ={class:"row"},WJ={class:"rlabel"},UJ={class:"rvalue mono"},qJ={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},jJ={class:"sec"},zJ={class:"sec-head"},VJ={class:"sec-title"},KJ={key:0,class:"saving"},GJ={class:"row"},YJ={class:"rlabel"},XJ={class:"hint"},ZJ=["value","disabled","aria-label"],QJ={key:0,value:"",disabled:""},JJ=["label"],eee=["value"],tee={key:1,class:"rvalue mono"},nee={class:"row"},see={class:"rlabel"},oee={class:"hint"},iee=["aria-label"],ree=["aria-pressed","disabled","onClick"],lee={class:"row"},aee={class:"rlabel"},cee={class:"hint"},uee=["aria-checked","disabled"],dee={class:"row"},fee={class:"rlabel"},hee={class:"hint"},pee=["aria-checked","disabled"],mee={class:"row"},gee={class:"rlabel"},vee={class:"hint"},yee=["aria-checked","disabled"],kee={key:0,class:"row"},bee={class:"rlabel"},_ee=["aria-checked","disabled"],wee={key:1,class:"provider-list"},See={class:"provider-main"},Cee={class:"provider-id"},xee={class:"provider-type"},Tee={class:"provider-meta"},Mee={key:0,class:"provider-model"},Aee={key:1,class:"empty-config"},Eee={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},Iee={class:"sec"},$ee={class:"sec-title"},Nee={class:"row"},Lee={class:"rlabel"},Oee={class:"rvalue mono"},Pee={class:"row"},Ree={class:"rlabel"},Dee={key:0,class:"hint"},Bee={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},Fee={class:"sec"},Hee={class:"sec-title"},Wee={class:"row"},Uee={class:"rlabel"},qee={class:"hint"},jee=["aria-checked"],zee=Je({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyPermission:{},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=se("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"experimental",labelKey:"settings.tabs.experimental"}],l=RQ(),a=["manual","auto","yolo"],c=se(null);fh(c);function u(A){A.key==="Escape"&&o("close")}ln(()=>document.addEventListener("keydown",u)),Ut(()=>document.removeEventListener("keydown",u));function d(){aT()}const h=j(()=>{const A=new Map;for(const w of s.models??[])A.set(w.id,{id:w.id,label:w.displayName??w.model??w.id,provider:w.provider});for(const[w,x]of Object.entries(s.config?.models??{})){if(A.has(w))continue;const I=S(x);A.set(w,{id:w,label:_(w,x,I),provider:I??w})}return Array.from(A.values())}),m=j(()=>{const A=new Map;for(const w of h.value){const x=A.get(w.provider)??[];x.push(w),A.set(w.provider,x)}for(const w of A.values())w.sort((x,I)=>x.label.localeCompare(I.label));return Array.from(A.entries()).toSorted(([w],[x])=>w.localeCompare(x)).map(([w,x])=>({provider:w,options:x}))}),f=j(()=>Object.entries(s.config?.providers??{}).map(([A,w])=>({id:A,provider:w})).sort((A,w)=>A.id.localeCompare(w.id))),y=j(()=>{const A=s.config?.defaultPermissionMode;return A==="auto"||A==="yolo"||A==="manual"?A:"manual"});function S(A){if(!A||typeof A!="object")return;const w=A;return typeof w.provider=="string"?w.provider:void 0}function _(A,w,x){if(!w||typeof w!="object")return A;const I=w,L=typeof I.model=="string"?I.model:void 0,O=x??S(w);return L&&O?`${A} (${O}/${L})`:L?`${A} (${L})`:A}function b(A){return A===!0}function v(A){const w=A.target.value;!w||w===s.config?.defaultModel||o("updateConfig",{defaultModel:w})}function g(A){A!==y.value&&o("updateConfig",{defaultPermissionMode:A})}function k(A){const w=s.config?.[A];o("updateConfig",{[A]:!b(w)})}function $(A){i.value=A}return(A,w)=>(C(),E("div",{class:"backdrop",onClick:w[16]||(w[16]=Ze(x=>o("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":T(n)("settings.title")},[p("div",JQ,[p("span",eJ,N(T(n)("settings.title")),1),p("button",{class:"close-btn",title:T(n)("newSession.close"),onClick:w[0]||(w[0]=x=>o("close"))},[...w[17]||(w[17]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,tJ)]),p("div",nJ,[p("nav",{class:"settings-tabs",role:"tablist","aria-label":T(n)("settings.title")},[(C(),E(Le,null,Qe(r,x=>p("button",{key:x.id,type:"button",class:$e(["tab",{on:i.value===x.id}]),role:"tab","aria-selected":i.value===x.id,"aria-controls":`settings-panel-${x.id}`,id:`settings-tab-${x.id}`,onClick:I=>$(x.id)},N(T(n)(x.labelKey)),11,oJ)),64))],8,sJ),p("div",iJ,[Lt(p("section",rJ,[p("section",lJ,[p("h3",aJ,N(T(n)("settings.appearance")),1),p("div",cJ,[p("span",uJ,N(T(n)("theme.label")),1),p("div",{class:"seg",role:"group","aria-label":T(n)("theme.label")},[p("button",{type:"button",class:$e(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:w[1]||(w[1]=x=>o("setTheme","modern"))},N(T(n)("theme.modern")),11,fJ),p("button",{type:"button",class:$e(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:w[2]||(w[2]=x=>o("setTheme","kimi"))},N(T(n)("theme.kimi")),11,hJ)],8,dJ)]),p("div",pJ,[p("span",mJ,N(T(n)("theme.colorSchemeLabel")),1),p("div",{class:"seg",role:"group","aria-label":T(n)("theme.colorSchemeLabel")},[p("button",{type:"button",class:$e(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:w[3]||(w[3]=x=>o("setColorScheme","light"))},N(T(n)("theme.light")),11,vJ),p("button",{type:"button",class:$e(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:w[4]||(w[4]=x=>o("setColorScheme","dark"))},N(T(n)("theme.dark")),11,yJ),p("button",{type:"button",class:$e(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:w[5]||(w[5]=x=>o("setColorScheme","system"))},N(T(n)("theme.system")),11,kJ)],8,gJ)]),p("div",bJ,[p("span",_J,N(T(n)("settings.uiFontSize")),1),p("label",wJ,[p("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":T(n)("settings.uiFontSize"),onInput:w[6]||(w[6]=x=>o("setUiFontSize",Number(x.target.value)))},null,40,SJ),w[18]||(w[18]=p("span",{class:"num-unit"},"px",-1))])]),p("div",CJ,[p("span",xJ,N(T(n)("sidebar.language")),1),kt(lT)])]),p("section",TJ,[p("h3",MJ,N(T(n)("settings.notifications")),1),p("div",AJ,[p("span",EJ,[vt(N(T(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(C(),E("span",IJ,N(T(n)("settings.notifyDenied")),1)):ce("",!0)]),p("button",{type:"button",class:$e(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:w[7]||(w[7]=x=>o("setNotify",!e.notify))},[...w[19]||(w[19]=[p("span",{class:"knob"},null,-1)])],10,$J)])]),p("section",NJ,[p("h3",LJ,N(T(n)("settings.account")),1),p("div",OJ,[p("span",PJ,N(e.authReady?"managed:kimi-code":T(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(C(),E("span",{key:0,class:"rvalue",title:e.accountModel},N(e.accountModel),9,RJ)):ce("",!0)]),p("div",DJ,[p("button",{type:"button",class:"act",onClick:w[8]||(w[8]=x=>{o("openOnboarding"),o("close")})},N(T(n)("onboarding.reopen")),1),e.authReady?(C(),E("button",{key:0,type:"button",class:"act danger",onClick:w[9]||(w[9]=x=>o("logout"))},N(T(n)("sidebar.signOut")),1)):(C(),E("button",{key:1,type:"button",class:"act signin",onClick:w[10]||(w[10]=x=>o("login"))},N(T(n)("sidebar.signIn")),1))])]),p("section",BJ,[p("h3",FJ,N(T(n)("settings.build")),1),p("div",HJ,[p("span",WJ,N(T(n)("settings.serverVersion")),1),p("span",UJ,N(e.serverVersion||"-"),1)])])],512),[[Uo,i.value==="general"]]),Lt(p("section",qJ,[p("section",jJ,[p("div",zJ,[p("h3",VJ,N(T(n)("settings.agentDefaults")),1),e.configSaving?(C(),E("span",KJ,N(T(n)("settings.saving")),1)):ce("",!0)]),e.config?(C(),E(Le,{key:0},[p("div",GJ,[p("span",YJ,[vt(N(T(n)("settings.defaultModel"))+" ",1),p("span",XJ,N(T(n)("settings.defaultModelHint")),1)]),m.value.length>0?(C(),E("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":T(n)("settings.defaultModel"),onChange:v},[e.config.defaultModel?ce("",!0):(C(),E("option",QJ,N(T(n)("settings.noDefaultModel")),1)),(C(!0),E(Le,null,Qe(m.value,x=>(C(),E("optgroup",{key:x.provider,label:x.provider},[(C(!0),E(Le,null,Qe(x.options,I=>(C(),E("option",{key:I.id,value:I.id},N(I.label),9,eee))),128))],8,JJ))),128))],40,ZJ)):(C(),E("span",tee,N(e.config.defaultModel??T(n)("settings.noDefaultModel")),1))]),p("div",nee,[p("span",see,[vt(N(T(n)("settings.defaultPermission"))+" ",1),p("span",oee,N(T(n)("settings.defaultPermissionHint")),1)]),p("div",{class:"seg",role:"group","aria-label":T(n)("settings.defaultPermission")},[(C(),E(Le,null,Qe(a,x=>p("button",{key:x,type:"button",class:$e(["opt",{on:y.value===x}]),"aria-pressed":y.value===x,disabled:e.configSaving,onClick:I=>g(x)},N(T(n)(`settings.permission.${x}`)),11,ree)),64))],8,iee)]),p("div",lee,[p("span",aee,[vt(N(T(n)("settings.defaultThinking"))+" ",1),p("span",cee,N(T(n)("settings.defaultThinkingHint")),1)]),p("button",{type:"button",class:$e(["switch",{on:b(e.config.defaultThinking)}]),role:"switch","aria-checked":b(e.config.defaultThinking),disabled:e.configSaving,onClick:w[11]||(w[11]=x=>k("defaultThinking"))},[...w[20]||(w[20]=[p("span",{class:"knob"},null,-1)])],10,uee)]),p("div",dee,[p("span",fee,[vt(N(T(n)("settings.defaultPlanMode"))+" ",1),p("span",hee,N(T(n)("settings.defaultPlanModeHint")),1)]),p("button",{type:"button",class:$e(["switch",{on:b(e.config.defaultPlanMode)}]),role:"switch","aria-checked":b(e.config.defaultPlanMode),disabled:e.configSaving,onClick:w[12]||(w[12]=x=>k("defaultPlanMode"))},[...w[21]||(w[21]=[p("span",{class:"knob"},null,-1)])],10,pee)]),p("div",mee,[p("span",gee,[vt(N(T(n)("settings.mergeSkills"))+" ",1),p("span",vee,N(T(n)("settings.mergeSkillsHint")),1)]),p("button",{type:"button",class:$e(["switch",{on:b(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":b(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:w[13]||(w[13]=x=>k("mergeAllAvailableSkills"))},[...w[22]||(w[22]=[p("span",{class:"knob"},null,-1)])],10,yee)]),e.config.telemetry!==void 0?(C(),E("div",kee,[p("span",bee,N(T(n)("settings.telemetry")),1),p("button",{type:"button",class:$e(["switch",{on:b(e.config.telemetry)}]),role:"switch","aria-checked":b(e.config.telemetry),disabled:e.configSaving,onClick:w[14]||(w[14]=x=>k("telemetry"))},[...w[23]||(w[23]=[p("span",{class:"knob"},null,-1)])],10,_ee)])):ce("",!0),f.value.length>0?(C(),E("div",wee,[(C(!0),E(Le,null,Qe(f.value,({id:x,provider:I})=>(C(),E("div",{key:x,class:"provider-row"},[p("div",See,[p("span",Cee,N(x),1),p("span",xee,N(I.type),1)]),p("div",Tee,[p("span",{class:$e(["provider-badge",I.hasApiKey?"ok":"warn"])},N(I.hasApiKey?T(n)("settings.credentialReady"):T(n)("settings.credentialMissing")),3),I.defaultModel?(C(),E("span",Mee,N(I.defaultModel),1)):ce("",!0)])]))),128))])):ce("",!0)],64)):(C(),E("div",Aee,N(T(n)("settings.configUnavailable")),1))])],512),[[Uo,i.value==="agent"]]),Lt(p("section",Eee,[p("section",Iee,[p("h3",$ee,N(T(n)("settings.advanced")),1),p("div",Nee,[p("span",Lee,N(T(n)("sidebar.daemon")),1),p("span",Oee,N(T(l)),1)]),p("div",Pee,[p("span",Ree,[vt(N(T(n)("settings.exportLog"))+" ",1),T(ci)()?ce("",!0):(C(),E("span",Dee,N(T(n)("settings.logHint")),1))]),p("button",{type:"button",class:"act",onClick:d},N(T(n)("settings.exportLogBtn")),1)])])],512),[[Uo,i.value==="advanced"]]),Lt(p("section",Bee,[p("section",Fee,[p("h3",Hee,N(T(n)("settings.beta")),1),p("div",Wee,[p("span",Uee,[vt(N(T(n)("settings.betaToc"))+" ",1),p("span",qee,N(T(n)("settings.betaTocHint")),1)]),p("button",{type:"button",class:$e(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:w[15]||(w[15]=x=>o("setBetaToc",!e.betaToc))},[...w[24]||(w[24]=[p("span",{class:"knob"},null,-1)])],10,jee)])])],512),[[Uo,i.value==="experimental"]])])])],8,QQ)]))}}),Vee=_t(zee,[["__scopeId","data-v-96ebddac"]]),Kee=["aria-label"],Gee={class:"dh"},Yee={class:"dtitle"},Xee={class:"count"},Zee=["aria-label","title"],Qee={class:"search-wrap"},Jee=["placeholder"],ete={class:"session-list"},tte=["aria-selected","onClick","onMouseenter"],nte={class:"meta"},ste={class:"title"},ote={class:"sub"},ite={class:"ws"},rte={class:"time"},lte={key:0,class:"attn-badge"},ate={key:0,class:"empty"},cte={class:"footer-hint"},ute=Je({__name:"SessionsDialog",props:{sessions:{},workspaceGroups:{},attentionBySession:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=j(()=>{const f={};for(const y of s.workspaceGroups)for(const S of y.sessions)f[S.id]=y.workspace.name;return f}),r=se(""),l=se(null),a=j(()=>{const f=r.value.toLowerCase().trim();return f?s.sessions.filter(y=>y.title.toLowerCase().includes(f)):s.sessions}),c=se(0);Ve(r,()=>{c.value=0});function u(f){o("select",f)}function d(f){return s.attentionBySession[f]??0}function h(f){return d(f.id)>0||f.status==="awaitingApproval"||f.status==="awaitingQuestion"?"attn":f.busy?"run":f.status==="aborted"?"aborted":"idle"}function m(f){if(f.key==="Escape"){o("close");return}if(f.key==="ArrowDown")f.preventDefault(),c.value=Math.min(c.value+1,a.value.length-1);else if(f.key==="ArrowUp")f.preventDefault(),c.value=Math.max(c.value-1,0);else if(f.key==="Enter"){const y=a.value[c.value];y&&u(y.id)}}return ln(()=>{document.addEventListener("keydown",m),gt(()=>l.value?.focus())}),Ut(()=>{document.removeEventListener("keydown",m)}),(f,y)=>(C(),E("div",{class:"backdrop",onClick:y[2]||(y[2]=Ze(S=>o("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":T(n)("sessions.title")},[p("div",Gee,[p("span",Yee,N(T(n)("sessions.title")),1),p("span",Xee,N(e.sessions.length),1),p("button",{class:"close-btn","aria-label":T(n)("sessions.close"),title:T(n)("sessions.close"),onClick:y[0]||(y[0]=S=>o("close"))},[...y[3]||(y[3]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Zee)]),p("div",Qee,[Lt(p("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":y[1]||(y[1]=S=>r.value=S),class:"search-input",type:"text",placeholder:T(n)("sessions.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Jee),[[Tn,r.value]])]),p("div",ete,[(C(!0),E(Le,null,Qe(a.value,(S,_)=>(C(),E("div",{key:S.id,class:$e(["session-row",{"is-active":S.id===e.activeId,"is-selected":_===c.value}]),role:"option","aria-selected":S.id===e.activeId,onClick:b=>u(S.id),onMouseenter:b=>c.value=_},[p("span",{class:$e(["dot",h(S)])},null,2),p("div",nte,[p("span",ste,N(S.title),1),p("span",ote,[p("span",ite,N(i.value[S.id]??T(n)("sessions.noWorkspace")),1),y[4]||(y[4]=p("span",{class:"sep"},"·",-1)),p("span",rte,N(S.time),1)])]),d(S.id)>0?(C(),E("span",lte,N(d(S.id)),1)):ce("",!0)],42,tte))),128)),a.value.length===0?(C(),E("div",ate,N(e.sessions.length===0?T(n)("sessions.emptyNone"):T(n)("sessions.emptyNoMatch")),1)):ce("",!0)]),p("div",cte,N(T(n)("sessions.footerHint")),1)],8,Kee)]))}}),dte=_t(ute,[["__scopeId","data-v-c48c4439"]]),fte=["aria-label"],hte={class:"dh"},pte={class:"dtitle"},mte=["aria-label"],gte={class:"crumbbar"},vte=["disabled","title","aria-label"],yte={class:"crumbs"},kte={key:0,class:"crumb-sep"},bte=["onClick"],_te={key:0,class:"filterbar"},wte=["placeholder"],Ste={key:0,class:"search-spin","aria-hidden":"true"},Cte={class:"folder-list"},xte={key:0,class:"fl-loading"},Tte=["onClick"],Mte={class:"folder-name search-rel"},Ate={key:0,class:"git-tag"},Ete={key:0,class:"git-branch"},Ite={key:0,class:"fl-empty"},$te={key:1,class:"fl-loading"},Nte=["onClick"],Lte={class:"folder-name"},Ote={key:0,class:"git-tag"},Pte={key:0,class:"git-branch"},Rte={key:0,class:"fl-empty"},Dte={class:"paste-label",for:"aw-path"},Bte=["placeholder","onKeydown"],Fte=["disabled","title"],Hte={class:"actions"},Wte=["disabled","title"],Ute={class:"footer-hint"},qte=600,jte=6,Q_=150,zte=Je({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=se(!1),r=se(!1),l=se(""),a=se(null),c=se([]),u=se(""),d=se(!1),h=se([]),m=j(()=>u.value.trim().length>0);let f=0,y=null;function S(P,B){const R=P.toLowerCase(),W=B.toLowerCase();let V=0;for(let z=0;z<W.length&&V<R.length;z++)W[z]===R[V]&&V++;return V===R.length}async function _(P){const B=l.value,R=P.trim();if(!B||R===""){h.value=[],d.value=!1;return}const W=++f;d.value=!0;const V=[],z=[{path:B,depth:0}];let ie=0;for(;z.length>0&&ie<qte&&V.length<Q_;){if(W!==f)return;const ae=z.shift();ie++;let re;try{re=await s.browseFs(ae.path)}catch{continue}if(W!==f)return;for(const Te of re.entries){if(!Te.isDir)continue;const Pe=Te.path.startsWith(B)?Te.path.slice(B.length).replace(/^\/+/,""):Te.path;if(S(R,Pe||Te.name)&&(V.push({path:Te.path,name:Te.name,rel:Pe||Te.name,isGitRepo:Te.isGitRepo,branch:Te.branch}),V.length>=Q_))break;ae.depth+1<jte&&z.push({path:Te.path,depth:ae.depth+1})}W===f&&(h.value=[...V])}W===f&&(d.value=!1)}Ve(u,P=>{if(y&&clearTimeout(y),P.trim()===""){f++,h.value=[],d.value=!1;return}y=setTimeout(()=>void _(P),220)});const b=se(!1),v=se(""),g=j(()=>v.value.trim()),k=j(()=>{const P=l.value;if(!P)return[];const B=P.split("/").filter(Boolean),R=[{label:"/",path:"/"}];let W="";for(const V of B)W+=`/${V}`,R.push({label:V,path:W});return R}),$=j(()=>l.value.length>0);async function A(P){i.value=!0;try{const B=await s.browseFs(P);if(!B.path){r.value=!0;return}l.value=B.path,a.value=B.parent,c.value=B.entries,u.value="",r.value=!1}catch{r.value=!0}finally{i.value=!1}}function w(P){P.isDir&&A(P.path)}function x(){a.value&&A(a.value)}function I(){$.value&&o("add",l.value)}function L(){g.value.length!==0&&o("add",g.value)}ln(async()=>{i.value=!0;try{if(s.defaultPath&&(await A(s.defaultPath),!r.value))return;const P=await s.getFsHome();P.home?await A(P.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function O(P){P.key==="Escape"&&o("close")}return ln(()=>document.addEventListener("keydown",O)),Ut(()=>{document.removeEventListener("keydown",O),y&&clearTimeout(y)}),(P,B)=>(C(),E("div",{class:"backdrop",onClick:B[6]||(B[6]=Ze(R=>o("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":T(n)("workspace.addTitle")},[p("div",hte,[p("span",pte,N(T(n)("workspace.addTitle")),1),p("button",{class:"close-btn","aria-label":T(n)("workspace.cancel"),onClick:B[0]||(B[0]=R=>o("close"))},[...B[7]||(B[7]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,mte)]),r.value?ce("",!0):(C(),E(Le,{key:0},[p("div",gte,[p("button",{class:"up-btn",disabled:!a.value,title:T(n)("workspace.up"),"aria-label":T(n)("workspace.up"),onClick:x},[...B[8]||(B[8]=[p("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[p("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,vte),p("div",yte,[(C(!0),E(Le,null,Qe(k.value,(R,W)=>(C(),E(Le,{key:R.path},[W>1?(C(),E("span",kte,"/")):ce("",!0),p("button",{class:$e(["crumb",{last:W===k.value.length-1}]),onClick:V=>A(R.path)},N(R.label),11,bte)],64))),128))])]),i.value?ce("",!0):(C(),E("div",_te,[B[9]||(B[9]=p("svg",{class:"filter-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("circle",{cx:"7",cy:"7",r:"4.5"}),p("path",{d:"M11 11l3 3"})],-1)),Lt(p("input",{"onUpdate:modelValue":B[1]||(B[1]=R=>u.value=R),class:"filter-input",type:"text",placeholder:T(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:B[2]||(B[2]=Ze(()=>{},["stop"]))},null,40,wte),[[Tn,u.value]]),d.value?(C(),E("span",Ste)):ce("",!0)])),p("div",Cte,[i.value?(C(),E("div",xte,N(T(n)("workspace.browsing")),1)):m.value?(C(),E(Le,{key:1},[(C(!0),E(Le,null,Qe(h.value,R=>(C(),E("button",{key:R.path,class:"folder-row",onClick:W=>A(R.path)},[B[10]||(B[10]=p("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),p("span",Mte,N(R.rel),1),R.isGitRepo?(C(),E("span",Ate,[vt(N(T(n)("workspace.gitTag")),1),R.branch?(C(),E("span",Ete,N(R.branch),1)):ce("",!0)])):ce("",!0)],8,Tte))),128)),!d.value&&h.value.length===0?(C(),E("div",Ite,N(T(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&h.value.length===0?(C(),E("div",$te,N(T(n)("workspace.searching")),1)):ce("",!0)],64)):(C(),E(Le,{key:2},[(C(!0),E(Le,null,Qe(c.value,R=>(C(),E("button",{key:R.path,class:"folder-row",onClick:W=>w(R)},[B[11]||(B[11]=p("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),p("span",Lte,N(R.name),1),R.isGitRepo?(C(),E("span",Ote,[vt(N(T(n)("workspace.gitTag")),1),R.branch?(C(),E("span",Pte,N(R.branch),1)):ce("",!0)])):ce("",!0)],8,Nte))),128)),c.value.length===0?(C(),E("div",Rte,N(T(n)("workspace.noSubfolders")),1)):ce("",!0)],64))])],64)),p("div",{class:$e(["paste-section",{"paste-only":r.value}])},[!r.value&&!b.value?(C(),E("button",{key:0,type:"button",class:"paste-toggle",onClick:B[3]||(B[3]=R=>b.value=!0)},N(T(n)("workspace.pasteToggle")),1)):(C(),E(Le,{key:1},[p("label",Dte,N(T(n)("workspace.pathLabel")),1),Lt(p("input",{id:"aw-path","onUpdate:modelValue":B[4]||(B[4]=R=>v.value=R),class:"paste-input",type:"text",placeholder:T(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:Eo(Ze(L,["stop"]),["enter"])},null,40,Bte),[[Tn,v.value]]),p("button",{class:"paste-add",disabled:g.value.length===0,title:T(n)("workspace.add"),onClick:L},[...B[12]||(B[12]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Fte)],64))],2),p("div",Hte,[r.value?ce("",!0):(C(),E("button",{key:0,class:"act-btn primary",disabled:!$.value,title:l.value,onClick:I},N(T(n)("workspace.openThisFolder")),9,Wte)),p("button",{class:"act-btn",onClick:B[5]||(B[5]=R=>o("close"))},N(T(n)("workspace.cancel")),1)]),p("div",Ute,N(T(n)("workspace.browseHint")),1)],8,fte)]))}}),Vte=_t(zte,[["__scopeId","data-v-50af6ed0"]]),Kte=["aria-label"],Gte={class:"dh"},Yte={class:"dtitle"},Xte=["title"],Zte={class:"rows"},Qte={class:"row"},Jte={class:"row"},ene={class:"row"},tne={class:"row"},nne={class:"row"},sne={class:"row"},one={class:"ctx-text"},ine={key:0,class:"bar"},rne={class:"row"},lne=Je({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=j(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),r=j(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(f){return n(f==="yolo"?"status.permissionYolo":f==="auto"?"status.permissionAuto":"status.permissionManual")}const a=j(()=>{const f=s.status.permission;return f==="yolo"?"var(--err)":f==="auto"?"var(--warn)":"var(--ink)"}),c=j(()=>s.planMode?n("status.planOn"):n("status.planOff")),u=j(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=j(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=j(()=>d.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));function m(f){f.key==="Escape"&&o("close")}return ln(()=>document.addEventListener("keydown",m)),Ut(()=>document.removeEventListener("keydown",m)),(f,y)=>(C(),E("div",{class:"backdrop",onClick:y[1]||(y[1]=Ze(S=>o("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":T(n)("status.statusPanelTitle")},[p("div",Gte,[p("span",Yte,N(T(n)("status.statusPanelTitle")),1),p("button",{class:"close-btn",title:T(n)("status.statusPanelClose"),onClick:y[0]||(y[0]=S=>o("close"))},"✕",8,Xte)]),p("dl",Zte,[p("div",Qte,[p("dt",null,N(T(n)("status.statusModel")),1),p("dd",null,N(e.status.model),1)]),p("div",Jte,[p("dt",null,N(T(n)("status.statusThinking")),1),p("dd",null,N(e.thinking),1)]),p("div",ene,[p("dt",null,N(T(n)("status.statusPermission")),1),p("dd",{style:Dt({color:a.value})},N(l(e.status.permission)),5)]),p("div",tne,[p("dt",null,N(T(n)("status.statusPlanMode")),1),p("dd",{class:$e({"plan-on":e.planMode})},N(c.value),3)]),p("div",nne,[p("dt",null,N(T(n)("status.statusSwarmMode")),1),p("dd",{class:$e({"swarm-on":e.swarmMode})},N(u.value),3)]),p("div",sne,[p("dt",null,N(T(n)("status.statusContext")),1),p("dd",null,[p("span",one,N(r.value),1),e.status.ctxMax>0?(C(),E("span",ine,[p("i",{style:Dt({width:i.value+"%"})},null,4)])):ce("",!0)])]),p("div",rne,[p("dt",null,N(T(n)("status.statusCost")),1),p("dd",null,N(h.value),1)])])],8,Kte)]))}}),ane=_t(lne,[["__scopeId","data-v-b8e6208e"]]),cne={key:0,class:"toasts",role:"status","aria-live":"polite"},une=["onPointerenter","onPointerleave"],dne={class:"body"},fne={class:"title"},hne={key:0,class:"msg"},pne={key:1,class:"actions"},mne=["onClick"],gne=["onClick"],vne={key:2,class:"details"},yne=["aria-label","onClick"],kne=Je({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=xt();function i(w){return typeof w=="object"&&w!==null}function r(w){return i(w)?w.title:w}function l(w){return i(w)?w.message??"":""}function a(w){return i(w)?w.details:void 0}function c(w){return i(w)?w.severity==="error":w.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(w)}function u(w){return i(w)?`notice:${w.severity}:${w.title}:${w.message??""}:${JSON.stringify(w.details??[])}`:`text:${w}`}function d(w){if(!i(w))return w;const x=[w.title];w.message&&x.push(w.message);const I=w.details??[];if(I.length>0){x.push("",`${o("warnings.diagnostics")}:`);for(const L of I)x.push(`${L.label}: ${L.value}`)}return x.join(`
|
|
249
|
-
`)}let h=1;const m=se([]),f=new Map,y=new Map;function S(w){const x=c(w)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?x+5e3:x}function _(w,x){const I=f.get(w)??{handle:null,deadline:0,remaining:0};I.handle=setTimeout(()=>A(w),x),I.deadline=Date.now()+x,f.set(w,I)}function b(w){const x=f.get(w);x&&x.handle!==null&&clearTimeout(x.handle),f.delete(w)}function v(w){const x=f.get(w);!x||x.handle===null||(clearTimeout(x.handle),x.handle=null,x.remaining=Math.max(0,x.deadline-Date.now()))}function g(w){if(m.value.find(L=>L.id===w)?.detailsOpen)return;const I=f.get(w);!I||I.handle!==null||_(w,I.remaining)}function k(w){w.detailsOpen=!w.detailsOpen,w.detailsOpen?v(w.id):g(w.id)}async function $(w){if(!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(d(w.warning)),w.copied=!0;const x=y.get(w.id);x&&clearTimeout(x),y.set(w.id,setTimeout(()=>{w.copied=!1,y.delete(w.id)},1400))}function A(w){b(w);const x=y.get(w);x&&clearTimeout(x),y.delete(w);const I=m.value.findIndex(L=>L.id===w);I!==-1&&(m.value=m.value.filter(L=>L.id!==w),s("dismiss",I))}return Ve(()=>n.warnings,w=>{const x=[...m.value];m.value=w.map(I=>{const L=u(I),O=x.findIndex(R=>R.key===L),P=O===-1?void 0:x.splice(O,1)[0];if(P)return P.warning=I,P;const B={id:h++,key:L,warning:I,detailsOpen:!1,copied:!1};return _(B.id,S(I)),B});for(const I of x){b(I.id);const L=y.get(I.id);L&&clearTimeout(L),y.delete(I.id)}},{immediate:!0,flush:"post"}),Ut(()=>{f.forEach(w=>{w.handle!==null&&clearTimeout(w.handle)}),f.clear(),y.forEach(w=>clearTimeout(w)),y.clear()}),(w,x)=>m.value.length?(C(),E("div",cne,[(C(!0),E(Le,null,Qe(m.value,I=>(C(),E("div",{key:I.id,class:$e(["toast",{err:c(I.warning)}]),onPointerenter:L=>v(I.id),onPointerleave:L=>g(I.id)},[x[1]||(x[1]=p("span",{class:"dot","aria-hidden":"true"},null,-1)),p("div",dne,[p("div",fne,N(r(I.warning)),1),l(I.warning)?(C(),E("div",hne,N(l(I.warning)),1)):ce("",!0),a(I.warning)?.length?(C(),E("div",pne,[p("button",{class:"link",type:"button",onClick:L=>k(I)},N(I.detailsOpen?T(o)("warnings.hideDetails"):T(o)("warnings.showDetails")),9,mne),p("button",{class:"link",type:"button",onClick:L=>$(I)},N(I.copied?T(o)("warnings.copied"):T(o)("warnings.copyDetails")),9,gne)])):ce("",!0),I.detailsOpen&&a(I.warning)?.length?(C(),E("dl",vne,[(C(!0),E(Le,null,Qe(a(I.warning),L=>(C(),E("div",{key:`${L.label}:${L.value}`,class:"detail-row"},[p("dt",null,N(L.label),1),p("dd",null,N(L.value),1)]))),128))])):ce("",!0)]),p("button",{class:"x",type:"button","aria-label":T(o)("warnings.dismiss"),onClick:L=>A(I.id)},[...x[0]||(x[0]=[p("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[p("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,yne)],42,une))),128))])):ce("",!0)}}),bne=_t(kne,[["__scopeId","data-v-0a9833a1"]]),_ne={class:"topbar"},wne={class:"wsq"},Sne=["aria-label"],Cne={class:"tb-path"},xne={class:"ws"},Tne={class:"se"},Mne={class:"tb-sub"},Ane=["aria-label"],Ene=Je({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=j(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=j(()=>s.workspace?.name??n("workspace.noWorkspace")),l=j(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(C(),E("div",_ne,[p("span",wne,N(i.value),1),p("button",{type:"button",class:"tb-mid","aria-label":T(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[p("span",Cne,[p("span",xne,N(r.value),1),e.sessionTitle?(C(),E(Le,{key:0},[c[2]||(c[2]=p("span",{class:"sl"},"/",-1)),p("span",Tne,N(e.sessionTitle),1)],64)):ce("",!0),c[3]||(c[3]=p("span",{class:"cv"},"⌄",-1))]),p("span",Mne,[p("span",{class:$e(["rd",{on:e.running}])},null,2),p("span",null,N(l.value),1),e.branch?(C(),E(Le,{key:0},[vt(" · "+N(e.branch),1)],64)):ce("",!0),e.sessionCount>0?(C(),E(Le,{key:1},[vt(" · "+N(T(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ce("",!0)])],8,Sne),p("button",{type:"button",class:"tb-set","aria-label":T(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},[...c[4]||(c[4]=[gr('<svg viewBox="0 0 24 24" width="21" height="21" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true" data-v-95de12de><line x1="4" y1="8" x2="20" y2="8" data-v-95de12de></line><circle cx="10" cy="8" r="2.5" fill="var(--bg)" data-v-95de12de></circle><line x1="4" y1="16" x2="20" y2="16" data-v-95de12de></line><circle cx="15" cy="16" r="2.5" fill="var(--bg)" data-v-95de12de></circle></svg>',1)])],8,Ane)]))}}),Ine=_t(Ene,[["__scopeId","data-v-95de12de"]]),$ne={key:0,class:"sheet-root"},Nne=["aria-label"],Lne=["aria-label"],One={key:0,class:"sheet-head"},Pne={class:"sheet-title"},Rne={class:"sheet-body"},Dne=Je({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ve(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Ut(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(C(),je(Ei,{name:"sheet"},{default:xn(()=>[e.modelValue?(C(),E("div",$ne,[p("div",{class:"sheet-scrim",onClick:i}),p("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||T(n)("mobile.sheetLabel")},[p("button",{type:"button",class:"sheet-grab","aria-label":T(n)("mobile.closeSheet"),onClick:i},null,8,Lne),e.title?(C(),E("div",One,[p("span",Pne,N(e.title),1)])):ce("",!0),p("div",Rne,[Gl(l.$slots,"default",{},void 0,!0)])],8,Nne)])):ce("",!0)]),_:3}))}}),cT=_t(Dne,[["__scopeId","data-v-ee82f5a2"]]),Bne={class:"mlist"},Fne={key:0,class:"mempty"},Hne=["onClick"],Wne={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},Une={class:"mgh-main"},qne={class:"mgh-name"},jne=["title"],zne={key:0,class:"att"},Vne=["title","aria-label","onClick"],Kne=["title","aria-label","onClick"],Gne=["onClick"],Yne=["onClick"],Xne={key:0,class:"mempty small"},Zne=["onClick"],Qne={class:"m"},Jne={class:"s"},ese={key:0,class:"att"},tse=["title","onClick"],nse=["onClick"],sse=["onClick"],ose=["onClick"],J_=5,ise=7200*60*1e3,rse=Je({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t;function i(){o("update:modelValue",!1)}function r(B){o("select",B),i()}function l(B){o("createInWorkspace",B),i()}function a(){o("create"),i()}function c(){o("addWorkspace"),i()}const u=se(new Set);function d(B){return u.value.has(B)}function h(B){const R=new Set(u.value);if(R.has(B)){R.delete(B);const W=new Set(f.value);W.delete(B),f.value=W}else R.add(B);u.value=R,b.value=null,w.value=null}function m(B){return s.attentionByWorkspace[B]??0}const f=se(new Set);function y(B){return f.value.has(B)}function S(B){const R=new Set(f.value);R.has(B)?R.delete(B):R.add(B),f.value=R}function _(B,R,W){if(R||B.length<=J_)return B;const z=Date.now()-ise,ie=B.slice(0,J_),ae=new Set(ie.map(Pe=>Pe.id)),re=B.filter(Pe=>ae.has(Pe.id)?!1:(Pe.updatedAt?Date.parse(Pe.updatedAt):0)>z),Te=[...ie,...re];if(W&&!Te.some(Pe=>Pe.id===W)){const Pe=B.find(We=>We.id===W);Pe&&Te.push(Pe)}return Te}const b=se(null),v=se(null);let g;function k(B){b.value=b.value===B?null:B,w.value=null,clearTimeout(g),v.value=null}function $(B){b.value=null;const W=(typeof window<"u"?window.prompt(n("sidebar.rename"),B.title):null)?.trim();W&&o("rename",B.id,W)}function A(B){if(v.value===B){clearTimeout(g),v.value=null,b.value=null,o("archive",B);return}clearTimeout(g),v.value=B,g=setTimeout(()=>{v.value=null},2500)}const w=se(null),x=se(null);let I;function L(B){w.value=w.value===B?null:B,b.value=null,clearTimeout(I),x.value=null}function O(B){navigator.clipboard.writeText(B.root),w.value=null}function P(B){if(x.value===B){clearTimeout(I),x.value=null,w.value=null,o("deleteWorkspace",B);return}clearTimeout(I),x.value=B,I=setTimeout(()=>{x.value=null},2500)}return Ut(()=>{clearTimeout(g),clearTimeout(I)}),(B,R)=>(C(),je(cT,{"model-value":e.modelValue,"onUpdate:modelValue":R[2]||(R[2]=W=>o("update:modelValue",W))},{default:xn(()=>[p("button",{type:"button",class:"newrow",onClick:a},[R[3]||(R[3]=p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),vt(" "+N(T(n)("sidebar.newChat")),1)]),p("button",{type:"button",class:"newrow secondary",onClick:c},[R[4]||(R[4]=p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[p("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),p("path",{d:"M1 5.5h12"})],-1)),vt(" "+N(T(n)("sidebar.newWorkspace")),1)]),p("div",Bne,[e.groups.length===0?(C(),E("div",Fne,N(T(n)("workspace.noWorkspace")),1)):ce("",!0),(C(!0),E(Le,null,Qe(e.groups,W=>(C(),E("div",{key:W.workspace.id,class:"mgroup"},[p("div",{class:$e(["mgh",{on:W.workspace.id===e.activeWorkspaceId}]),onClick:V=>h(W.workspace.id)},[(C(),E("svg",Wne,[d(W.workspace.id)?(C(),E(Le,{key:0},[R[5]||(R[5]=p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),R[6]||(R[6]=p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),E(Le,{key:1},[R[7]||(R[7]=p("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),R[8]||(R[8]=p("path",{d:"M1 5.5h12"},null,-1))],64))])),p("div",Une,[p("span",qne,N(W.workspace.name),1),p("span",{class:"mgh-path",title:W.workspace.root},N(W.workspace.branch||W.workspace.shortPath),9,jne)]),d(W.workspace.id)&&m(W.workspace.id)>0?(C(),E("span",zne,N(m(W.workspace.id)),1)):ce("",!0),p("button",{type:"button",class:"mgh-more",title:T(n)("sidebar.options"),"aria-label":T(n)("sidebar.options"),onClick:Ze(V=>L(W.workspace.id),["stop"])},[...R[9]||(R[9]=[p("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Vne),p("button",{type:"button",class:"mgh-add",title:T(n)("workspace.newInGroup"),"aria-label":T(n)("workspace.newInGroup"),onClick:Ze(V=>l(W.workspace.id),["stop"])},"+",8,Kne),w.value===W.workspace.id?(C(),E("div",{key:1,class:"kmenu wsmenu",onClick:R[0]||(R[0]=Ze(()=>{},["stop"]))},[p("button",{class:"kitem",onClick:Ze(V=>O(W.workspace),["stop"])},N(T(n)("sidebar.copyPath")),9,Gne),p("button",{class:"kitem archive",onClick:Ze(V=>P(W.workspace.id),["stop"])},N(x.value===W.workspace.id?T(n)("sidebar.confirm"):T(n)("sidebar.delete")),9,Yne)])):ce("",!0)],10,Hne),Lt(p("div",null,[W.sessions.length===0?(C(),E("div",Xne,N(T(n)("sidebar.noSessions")),1)):ce("",!0),(C(!0),E(Le,null,Qe(_(W.sessions,y(W.workspace.id),e.activeId),V=>(C(),E("div",{key:V.id,class:$e(["srow",{cur:V.id===e.activeId}]),onClick:z=>r(V.id)},[p("div",Qne,[p("div",{class:$e(["t",{run:V.busy,aborted:V.status==="aborted"}])},N(V.title),3),p("div",Jne,N(V.time),1)]),(e.attentionBySession[V.id]??0)>0?(C(),E("span",ese,N(e.attentionBySession[V.id]),1)):ce("",!0),p("button",{type:"button",class:"kb",title:T(n)("sidebar.options"),onClick:Ze(z=>k(V.id),["stop"])},[...R[10]||(R[10]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,tse),b.value===V.id?(C(),E("div",{key:1,class:"kmenu",onClick:R[1]||(R[1]=Ze(()=>{},["stop"]))},[p("button",{class:"kitem",onClick:Ze(z=>$(V),["stop"])},N(T(n)("sidebar.rename")),9,nse),p("button",{class:"kitem archive",onClick:Ze(z=>A(V.id),["stop"])},N(v.value===V.id?T(n)("sidebar.archiveConfirm"):T(n)("sidebar.archive")),9,sse)])):ce("",!0)],10,Zne))),128)),!y(W.workspace.id)&&_(W.sessions,!1,e.activeId).length<W.sessions.length?(C(),E("button",{key:1,type:"button",class:"mshow-more",onClick:Ze(V=>S(W.workspace.id),["stop"])},N(T(n)("sidebar.showMore",{count:W.sessions.length-_(W.sessions,!1,e.activeId).length})),9,ose)):ce("",!0)],512),[[Uo,!d(W.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),lse=_t(rse,[["__scopeId","data-v-6125071b"]]),ase={class:"srow-main"},cse={class:"srow-label"},use={class:"srow-sub"},dse={class:"srow-main"},fse={class:"srow-label"},hse={class:"srow-val"},pse={class:"srow-main"},mse={class:"srow-label"},gse={class:"srow-sub"},vse=["aria-checked"],yse={class:"srow-main"},kse={class:"srow-label"},bse={class:"srow-sub"},_se=["aria-checked"],wse={class:"srow-main"},Sse={class:"srow-label"},Cse={class:"srow read-only"},xse={class:"srow-main"},Tse={class:"srow-label"},Mse={class:"srow-sub"},Ase=["aria-label"],Ese={class:"srow read-only pref"},Ise={class:"srow-main"},$se={class:"srow-label"},Nse=["aria-label"],Lse=["aria-pressed"],Ose=["aria-pressed"],Pse={class:"srow read-only pref"},Rse={class:"srow-main"},Dse={class:"srow-label"},Bse=["aria-label"],Fse=["aria-pressed"],Hse=["aria-pressed"],Wse=["aria-pressed"],Use={class:"srow read-only pref"},qse={class:"srow-main"},jse={class:"srow-label"},zse={class:"srow read-only pref"},Vse={class:"srow-main"},Kse={class:"srow-label"},Gse={class:"num-field"},Yse=["value","aria-label"],Xse={class:"srow-main"},Zse={class:"srow-label"},Qse={class:"srow-sub"},Jse=["aria-checked"],eoe={class:"srow-main"},toe={class:"srow-label"},noe={class:"srow-main"},soe={class:"srow-label"},ooe={key:2,class:"srow read-only"},ioe={class:"srow-main"},roe={class:"srow-label"},loe={class:"srow-val dim"},aoe=Je({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},theme:{default:"terminal"},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},betaToc:{type:Boolean},serverVersion:{default:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setTheme","setColorScheme","setUiFontSize","setBetaToc","login","logout"],setup(e,{emit:t}){const{t:n}=xt(),s=e,o=t,i=["manual","auto","yolo"],r=j(()=>s.thinking??"high"),l=j(()=>s.planMode===!0),a=j(()=>s.swarmMode===!0),c=j(()=>{const v=s.status.permission;return v==="yolo"?"var(--err)":v==="auto"?"var(--warn)":"var(--faint)"}),u=j(()=>{const v=s.status.permission,g=n(v==="yolo"?"mobile.permYoloSub":v==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${v} · ${g}`}),d=v=>`${Math.round(v/1e3)}k`,h=j(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),m=j(()=>s.status.ctxMax>0?`${d(s.status.ctxUsed)}/${d(s.status.ctxMax)}`:n("status.statusNone"));function f(){o("setThinking",r.value==="off"?"high":"off")}function y(){const v=i.indexOf(s.status.permission),g=i[(v+1)%i.length];o("setPermission",g)}function S(){o("pickModel"),o("update:modelValue",!1)}function _(){o("login"),o("update:modelValue",!1)}function b(){o("logout"),o("update:modelValue",!1)}return(v,g)=>(C(),je(cT,{"model-value":e.modelValue,title:T(n)("mobile.settingsTitle"),"onUpdate:modelValue":g[9]||(g[9]=k=>o("update:modelValue",k))},{default:xn(()=>[p("button",{type:"button",class:"srow",onClick:S},[p("span",ase,[p("span",cse,N(T(n)("status.statusModel")),1),p("span",use,N(e.status.model),1)]),g[10]||(g[10]=p("span",{class:"chev"},"›",-1))]),p("button",{type:"button",class:"srow",onClick:f},[p("span",dse,[p("span",fse,N(T(n)("status.statusThinking")),1)]),p("span",hse,N(r.value==="off"?T(n)("status.planOff"):T(n)("status.planOn")),1),g[11]||(g[11]=p("span",{class:"chev"},"›",-1))]),p("button",{type:"button",class:"srow",onClick:g[0]||(g[0]=k=>o("togglePlan"))},[p("span",pse,[p("span",mse,N(T(n)("status.statusPlanMode")),1),p("span",gse,N(T(n)("mobile.planModeSub")),1)]),p("span",{class:$e(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,vse)]),p("button",{type:"button",class:"srow",onClick:g[1]||(g[1]=k=>o("toggleSwarm"))},[p("span",yse,[p("span",kse,N(T(n)("status.statusSwarmMode")),1),p("span",bse,N(T(n)("mobile.swarmModeSub")),1)]),p("span",{class:$e(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,_se)]),p("button",{type:"button",class:"srow",onClick:y},[p("span",wse,[p("span",Sse,N(T(n)("status.statusPermission")),1),p("span",{class:"srow-sub",style:Dt({color:c.value})},N(u.value),5)]),g[12]||(g[12]=p("span",{class:"chev"},"›",-1))]),p("div",Cse,[p("span",xse,[p("span",Tse,N(T(n)("status.statusContext")),1),p("span",Mse,N(m.value),1)]),p("span",{class:"ctx-meter","aria-label":m.value},[p("i",{style:Dt({width:h.value+"%"})},null,4)],8,Ase)]),p("div",Ese,[p("span",Ise,[p("span",$se,N(T(n)("theme.label")),1)]),p("div",{class:"seg",role:"group","aria-label":T(n)("theme.label")},[p("button",{type:"button",class:$e(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:g[2]||(g[2]=k=>o("setTheme","modern"))},N(T(n)("theme.modern")),11,Lse),p("button",{type:"button",class:$e(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:g[3]||(g[3]=k=>o("setTheme","kimi"))},N(T(n)("theme.kimi")),11,Ose)],8,Nse)]),p("div",Pse,[p("span",Rse,[p("span",Dse,N(T(n)("theme.colorSchemeLabel")),1)]),p("div",{class:"seg",role:"group","aria-label":T(n)("theme.colorSchemeLabel")},[p("button",{type:"button",class:$e(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:g[4]||(g[4]=k=>o("setColorScheme","light"))},N(T(n)("theme.light")),11,Fse),p("button",{type:"button",class:$e(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:g[5]||(g[5]=k=>o("setColorScheme","dark"))},N(T(n)("theme.dark")),11,Hse),p("button",{type:"button",class:$e(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:g[6]||(g[6]=k=>o("setColorScheme","system"))},N(T(n)("theme.system")),11,Wse)],8,Bse)]),p("div",Use,[p("span",qse,[p("span",jse,N(T(n)("sidebar.language")),1)]),kt(lT)]),p("div",zse,[p("span",Vse,[p("span",Kse,N(T(n)("settings.uiFontSize")),1)]),p("label",Gse,[p("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":T(n)("settings.uiFontSize"),onInput:g[7]||(g[7]=k=>o("setUiFontSize",Number(k.target.value)))},null,40,Yse),g[13]||(g[13]=p("span",{class:"num-unit"},"px",-1))])]),p("button",{type:"button",class:"srow",onClick:g[8]||(g[8]=k=>o("setBetaToc",!e.betaToc))},[p("span",Xse,[p("span",Zse,N(T(n)("settings.betaToc")),1),p("span",Qse,N(T(n)("settings.betaTocHint")),1)]),p("span",{class:$e(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,Jse)]),e.authReady?(C(),E("button",{key:0,type:"button",class:"srow acct out",onClick:b},[p("span",eoe,[p("span",toe,N(T(n)("sidebar.signOut")),1)])])):(C(),E("button",{key:1,type:"button",class:"srow acct in",onClick:_},[p("span",noe,[p("span",soe,N(T(n)("sidebar.signIn")),1)])])),e.serverVersion?(C(),E("div",ooe,[p("span",ioe,[p("span",roe,N(T(n)("settings.serverVersion")),1)]),p("span",loe,N(e.serverVersion),1)])):ce("",!0)]),_:1},8,["model-value","title"]))}}),coe=_t(aoe,[["__scopeId","data-v-7fa4029d"]]),uoe={class:"ob-backdrop"},doe=["aria-label"],foe=["aria-label"],hoe={class:"ob-brand"},poe={class:"ob-title"},moe={class:"ob-sub"},goe={class:"ob-sec"},voe={class:"ob-label"},yoe={class:"ob-seg",role:"group"},koe=["aria-pressed","onClick"],boe={class:"ob-sec"},_oe={class:"ob-label"},woe={class:"ob-themes"},Soe=["aria-pressed"],Coe={class:"ob-theme-name"},xoe={class:"ob-theme-desc"},Toe=["aria-pressed"],Moe={class:"ob-theme-name"},Aoe={class:"ob-theme-desc"},Eoe=Je({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,s=t,{t:o,locale:i}=xt();function r(c){i.value!==c&&ES(c)}const l=se(n.theme);function a(){l.value!==n.theme&&s("setTheme",l.value),s("complete")}return(c,u)=>(C(),E("div",uoe,[p("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":T(o)("onboarding.title")},[p("button",{type:"button",class:"ob-close","aria-label":T(o)("onboarding.skip"),onClick:u[0]||(u[0]=d=>s("skip"))},[...u[3]||(u[3]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[p("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,foe),p("div",hoe,[u[4]||(u[4]=p("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[p("defs",null,[p("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[p("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),p("g",{class:"ob-eyes",fill:"#000"},[p("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),p("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),p("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obKimiEyes)"})],-1)),p("div",null,[p("div",poe,N(T(o)("onboarding.title")),1),p("div",moe,N(T(o)("onboarding.subtitle")),1)])]),p("section",goe,[p("div",voe,N(T(o)("onboarding.languageLabel")),1),p("div",yoe,[(C(!0),E(Le,null,Qe(T(AS),d=>(C(),E("button",{key:d.code,type:"button",class:$e(["ob-seg-btn",{on:T(i)===d.code}]),"aria-pressed":T(i)===d.code,onClick:h=>r(d.code)},N(d.label),11,koe))),128))])]),p("section",boe,[p("div",_oe,N(T(o)("onboarding.themeLabel")),1),p("div",woe,[p("button",{type:"button",class:$e(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=p("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[p("span",{class:"bub u"}),p("span",{class:"bub a"})],-1)),p("span",Coe,N(T(o)("theme.modern")),1),p("span",xoe,N(T(o)("onboarding.modernDesc")),1)],10,Soe),p("button",{type:"button",class:$e(["ob-theme",{on:l.value==="kimi"}]),"aria-pressed":l.value==="kimi",onClick:u[2]||(u[2]=d=>l.value="kimi")},[u[6]||(u[6]=p("span",{class:"ob-theme-prev kimi","aria-hidden":"true"},[p("span",{class:"kb u"}),p("span",{class:"kb a"})],-1)),p("span",Moe,N(T(o)("theme.kimi")),1),p("span",Aoe,N(T(o)("onboarding.kimiDesc")),1)],10,Toe)])]),p("button",{type:"button",class:"ob-start",onClick:a},N(T(o)("onboarding.start")),1)],8,doe)]))}}),Ioe=_t(Eoe,[["__scopeId","data-v-f94b338e"]]),$oe=["aria-label"],Noe={class:"gload-box"},Loe={class:"gload-text"},Ooe=Je({__name:"GlobalLoading",setup(e){const{t}=xt();return(n,s)=>(C(),E("div",{class:"gload",role:"status","aria-label":T(t)("app.connecting")},[p("div",Noe,[s[0]||(s[0]=gr('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-d8748888><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-d8748888></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-d8748888></path></svg><div class="gload-bar" aria-hidden="true" data-v-d8748888><span class="gload-bar-fill" data-v-d8748888></span></div>',2)),p("div",Loe,N(T(t)("app.connecting")),1)])],8,$oe))}}),Poe=_t(Ooe,[["__scopeId","data-v-d8748888"]]),Roe={class:"kap-root"},Doe={class:"kap-head"},Boe={class:"kap-count"},Foe={class:"kap-head-actions"},Hoe={class:"kap-filters"},Woe=["value"],Uoe={class:"kap-check"},qoe={class:"kap-check"},joe={class:"kap-view-toggle",role:"group"},zoe={key:0,class:"kap-empty"},Voe=["onClick"],Koe={class:"kap-ts"},Goe={class:"kap-label"},Yoe={key:0,class:"kap-detail"},Xoe={class:"kap-detail-actions"},Zoe=["onClick"],Qoe={key:1,class:"kap-agg"},Joe={class:"mono"},eie={class:"mono"},tie={class:"num"},nie={class:"num"},sie={key:0},oie={class:"mono"},iie={class:"num"},rie={class:"num"},lie={key:0},aie=Je({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=se("all"),o=se(""),i=se(""),r=se(!1),l=se("timeline"),a=j(()=>(lv.value,[...jQ()])),c=j(()=>{const x=new Set;for(const I of a.value)I.sessionId&&x.add(I.sessionId);return[...x].sort()});function u(x){return x.kind==="rest:error"||x.code!==void 0&&x.code!==0||x.eventType==="error"||x.eventType==="parse-error"}const d=j(()=>{const x=o.value.trim().toLowerCase();return a.value.filter(I=>!(s.value!=="all"&&I.source!==s.value||i.value&&I.sessionId!==i.value||r.value&&!u(I)||x&&!`${I.label} ${I.kind} ${I.eventType??""} ${I.sessionId??""} ${I.requestId??""}`.toLowerCase().includes(x)))}),h=j(()=>{const x=new Map;for(const I of d.value){if(I.kind!=="ws:in"&&I.kind!=="ws:out")continue;const L=I.kind==="ws:in"?"←":"→",O=`${L} ${I.eventType??"?"} @ ${I.sessionId??"-"}`,P=x.get(O)??{key:O,sessionId:I.sessionId??"-",eventType:I.eventType??"?",dir:L,count:0};P.count++,I.seq!==void 0&&(P.lastSeq=I.seq),x.set(O,P)}return[...x.values()].sort((I,L)=>L.count-I.count)}),m=j(()=>{const x=new Map;for(const I of d.value){if(I.source!=="rest"||I.kind==="rest:request")continue;const L=`${I.method??"?"} ${I.path??"?"}`,O=x.get(L)??{count:0,errors:0,totalMs:0,timed:0};O.count++,u(I)&&O.errors++,I.durationMs!==void 0&&(O.totalMs+=I.durationMs,O.timed++),x.set(L,O)}return[...x.entries()].map(([I,L])=>({key:I,count:L.count,errors:L.errors,avgMs:L.timed>0?Math.round(L.totalMs/L.timed):0})).sort((I,L)=>L.count-I.count)}),f=se(null),y=se(!0),S=se(null),_=se(null);Ve(()=>d.value.length,async()=>{if(!y.value||l.value!=="timeline")return;await gt();const x=S.value;x&&(x.scrollTop=x.scrollHeight)});function b(x){f.value=f.value===x?null:x}function v(x){const I=new Date(x),L=(O,P=2)=>String(O).padStart(P,"0");return`${L(I.getHours())}:${L(I.getMinutes())}:${L(I.getSeconds())}.${L(I.getMilliseconds(),3)}`}function g(x){return JSON.stringify(x,null,2)}async function k(x){try{await navigator.clipboard.writeText(g(x)),_.value=x.id,setTimeout(()=>{_.value===x.id&&(_.value=null)},1500)}catch{}}function $(){aT(d.value)}function A(x){return u(x)||x.source==="client"?"b-err":x.source==="rest"?"b-rest":x.kind==="ws:lifecycle"?"b-life":x.kind==="ws:out"?"b-out":"b-in"}function w(x){return x.source==="rest"?"REST":x.source==="client"?"APP":"WS"}return(x,I)=>(C(),E("section",Roe,[p("header",Doe,[I[11]||(I[11]=p("strong",null,"KAP debug",-1)),p("span",Boe,N(d.value.length)+"/"+N(a.value.length),1),p("div",Foe,[p("button",{type:"button",class:$e({on:T(sc)}),onClick:I[0]||(I[0]=L=>sc.value=!T(sc))},N(T(sc)?"resume":"pause"),3),p("button",{type:"button",onClick:I[1]||(I[1]=L=>T(zQ)())},"clear"),p("button",{type:"button",onClick:I[2]||(I[2]=L=>$())},"export jsonl"),p("button",{type:"button",title:"Close window",onClick:I[3]||(I[3]=L=>n("close"))},"✕")])]),p("div",Hoe,[Lt(p("select",{"onUpdate:modelValue":I[4]||(I[4]=L=>s.value=L),"aria-label":"Source filter"},[...I[12]||(I[12]=[p("option",{value:"all"},"rest + ws + app",-1),p("option",{value:"rest"},"rest",-1),p("option",{value:"ws"},"ws",-1),p("option",{value:"client"},"app errors",-1)])],512),[[Vd,s.value]]),Lt(p("select",{"onUpdate:modelValue":I[5]||(I[5]=L=>i.value=L),"aria-label":"Session filter"},[I[13]||(I[13]=p("option",{value:""},"all sessions",-1)),(C(!0),E(Le,null,Qe(c.value,L=>(C(),E("option",{key:L,value:L},N(L),9,Woe))),128))],512),[[Vd,i.value]]),Lt(p("input",{"onUpdate:modelValue":I[6]||(I[6]=L=>o.value=L),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[Tn,o.value]]),p("label",Uoe,[Lt(p("input",{"onUpdate:modelValue":I[7]||(I[7]=L=>r.value=L),type:"checkbox"},null,512),[[zd,r.value]]),I[14]||(I[14]=vt(" errors",-1))]),p("label",qoe,[Lt(p("input",{"onUpdate:modelValue":I[8]||(I[8]=L=>y.value=L),type:"checkbox"},null,512),[[zd,y.value]]),I[15]||(I[15]=vt(" follow",-1))]),p("div",joe,[p("button",{type:"button",class:$e({on:l.value==="timeline"}),onClick:I[9]||(I[9]=L=>l.value="timeline")},"timeline",2),p("button",{type:"button",class:$e({on:l.value==="aggregate"}),onClick:I[10]||(I[10]=L=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(C(),E("div",{key:0,ref_key:"listRef",ref:S,class:"kap-list"},[d.value.length===0?(C(),E("div",zoe," No trace entries yet. REST calls and WS frames will appear here. ")):ce("",!0),(C(!0),E(Le,null,Qe(d.value,L=>(C(),E("div",{key:L.id,class:"kap-row-wrap"},[p("button",{type:"button",class:$e(["kap-row",{expanded:f.value===L.id}]),onClick:O=>b(L.id)},[p("span",Koe,N(v(L.ts)),1),p("span",{class:$e(["kap-badge",A(L)])},N(w(L)),3),p("span",Goe,N(L.label),1)],10,Voe),f.value===L.id?(C(),E("div",Yoe,[p("div",Xoe,[p("button",{type:"button",onClick:O=>k(L)},N(_.value===L.id?"copied ✓":"copy json"),9,Zoe)]),p("pre",null,N(g(L)),1)])):ce("",!0)]))),128))],512)):(C(),E("div",Qoe,[I[20]||(I[20]=p("h4",null,"WS frames by session / type",-1)),p("table",null,[I[17]||(I[17]=p("thead",null,[p("tr",null,[p("th",null,"dir"),p("th",null,"type"),p("th",null,"session"),p("th",null,"count"),p("th",null,"last seq")])],-1)),p("tbody",null,[(C(!0),E(Le,null,Qe(h.value,L=>(C(),E("tr",{key:L.key},[p("td",null,N(L.dir),1),p("td",Joe,N(L.eventType),1),p("td",eie,N(L.sessionId),1),p("td",tie,N(L.count),1),p("td",nie,N(L.lastSeq??"—"),1)]))),128)),h.value.length===0?(C(),E("tr",sie,[...I[16]||(I[16]=[p("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ce("",!0)])]),I[21]||(I[21]=p("h4",null,"REST by endpoint",-1)),p("table",null,[I[19]||(I[19]=p("thead",null,[p("tr",null,[p("th",null,"endpoint"),p("th",null,"count"),p("th",null,"errors"),p("th",null,"avg ms")])],-1)),p("tbody",null,[(C(!0),E(Le,null,Qe(m.value,L=>(C(),E("tr",{key:L.key},[p("td",oie,N(L.key),1),p("td",iie,N(L.count),1),p("td",{class:$e(["num",{err:L.errors>0}])},N(L.errors),3),p("td",rie,N(L.avgMs),1)]))),128)),m.value.length===0?(C(),E("tr",lie,[...I[18]||(I[18]=[p("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ce("",!0)])])]))]))}}),cie=_t(aie,[["__scopeId","data-v-ecab45a5"]]),uie=["title"],die=Je({__name:"DebugPanel",setup(e){const t=se(!1);let n=null,s=null,o=null;const i=["data-theme","data-color-scheme","data-accent"];function r(u){const d=document.documentElement,h=u.documentElement;for(const m of i){const f=d.getAttribute(m);f!==null?h.setAttribute(m,f):h.removeAttribute(m)}}function l(u){const d=u.document;d.title="KAP debug";const h=d.createElement("base");h.href=location.href,d.head.appendChild(h);for(const f of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(f.cloneNode(!0));r(d),d.body.style.margin="0";const m=d.createElement("div");return m.style.height="100vh",d.body.appendChild(m),m}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),h=Kd(cie,{onClose:()=>u.close()});h.mount(d),s=h,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return ln(()=>{c()}),lo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(C(),E("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,uie))}}),fie=_t(die,[["__scopeId","data-v-0a50ee88"]]);function uT(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 Hg(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function hie(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function ni(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:Hg(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:uT(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 Sf(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function ew(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url}}function av(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:ew(e.source)};case"video":return{type:"video",source:ew(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 Wg(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(av),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function pie(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function mie(e){return{content:e.content.map(pie),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 gie(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function dT(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 vie(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function yie(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(vie),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function fT(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(yie),expiresAt:e.expires_at,createdAt:e.created_at}}function kie(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 bie(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=kie(s);return{answers:t,method:e.method,note:e.note}}function Ug(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index}}function tw(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 Qi(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Pl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function bo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function _ie(e){if(!e||typeof e!="object")return null;const t=e,n=Qi(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:Qi(t,"goalId")??Qi(t,"goal_id")??"goal",objective:Qi(t,"objective")??"",completionCriterion:Qi(t,"completionCriterion")??Qi(t,"completion_criterion"),status:n,turnsUsed:Pl(t,"turnsUsed")??Pl(t,"turns_used")??0,tokensUsed:Pl(t,"tokensUsed")??Pl(t,"tokens_used")??0,wallClockMs:Pl(t,"wallClockMs")??Pl(t,"wall_clock_ms")??0,terminalReason:Qi(t,"terminalReason")??Qi(t,"terminal_reason"),budget:{tokenBudget:bo(o,"tokenBudget")??bo(o,"token_budget"),remainingTokens:bo(o,"remainingTokens")??bo(o,"remaining_tokens"),turnBudget:bo(o,"turnBudget")??bo(o,"turn_budget"),remainingTurns:bo(o,"remainingTurns")??bo(o,"remaining_turns"),wallClockBudgetMs:bo(o,"wallClockBudgetMs")??bo(o,"wall_clock_budget_ms"),remainingWallClockMs:bo(o,"remainingWallClockMs")??bo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function wie(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ni(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:Sf(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Sf(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:Hg(t.payload.status),previousStatus:Hg(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:uT(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=_ie(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:Wg(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(av),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:dT(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:fT(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.question.expired":return{type:"questionExpired",sessionId:t.session_id,questionId:t.payload.question_id};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:Ug(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:qg(t.payload.config)};default:return{type:"unknown",raw:e}}}function Sie(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function Tm(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function qg(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultThinking:e.default_thinking,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function Cie(e){return e.session_id}function xie(e){return e.seq}const Tie="main",Mie=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function sr(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 Aie(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 nw(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function fs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function jr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function _o(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Eie(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=fs(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=fs(t,"goalId")??fs(t,"goal_id")??"goal",r=fs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:fs(t,"completionCriterion")??fs(t,"completion_criterion"),status:o,turnsUsed:jr(t,"turnsUsed")??jr(t,"turns_used")??0,tokensUsed:jr(t,"tokensUsed")??jr(t,"tokens_used")??0,wallClockMs:jr(t,"wallClockMs")??jr(t,"wall_clock_ms")??0,terminalReason:fs(t,"terminalReason")??fs(t,"terminal_reason"),budget:{tokenBudget:_o(s,"tokenBudget")??_o(s,"token_budget"),remainingTokens:_o(s,"remainingTokens")??_o(s,"remaining_tokens"),turnBudget:_o(s,"turnBudget")??_o(s,"turn_budget"),remainingTurns:_o(s,"remainingTurns")??_o(s,"remaining_turns"),wallClockBudgetMs:_o(s,"wallClockBudgetMs")??_o(s,"wall_clock_budget_ms"),remainingWallClockMs:_o(s,"remainingWallClockMs")??_o(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function oc(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Iie(e){if(e==null)return"";try{const t=typeof e=="string"?e:JSON.stringify(e);return t.length>120?`${t.slice(0,117)}...`:t}catch{return""}}function $ie(e,t){if(e==="turn.step.started")return"Started a step";if(e==="tool.use"||e==="tool.call.started"){const n=fs(t,"name")??fs(t,"toolName")??"tool",s=Iie(t.args??t.input);return s?`Calling ${n}: ${s}`:`Calling ${n}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=fs(n,"text");if(o)return o;const i=fs(n,"message");if(i)return i}const s=fs(t,"message");if(s)return s}return e==="tool.result"?`Finished ${fs(t,"name")??fs(t,"toolName")??fs(t,"toolCallId")??"tool"}`:null}function Nie(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];const r=$ie(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=oc(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 rd(e){return{...e,content:e.content.map(t=>({...t}))}}function sw(e,t,n){const s={id:sr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Lie(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function Oie(e){return Array.isArray(e)?e.map(t=>av(t)):[]}function ow(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function Pie(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function Rie(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function iw(e,t){e.messages.find(n=>n.id===t)}function Die(e,t,n,s,o,i){const r={id:sr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Mm(e,t){return e.messages.find(n=>n.id===t)}function rw(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 Bie(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=nw(),e.set(u,d)),d}function s(u){e.set(u,nw())}function o(u){t.add(u)}function i(u,d){const h=n(u);h.currentPromptId=d}function r(u,d){s(u);const h=n(u),m=d.promptId??sr("pr_");h.currentPromptId=m,h.turnPromptId.set(d.turnId,m);const f=sw(h,u,m);d.thinkingText.length>0&&f.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&f.content.push({type:"text",text:d.assistantText});for(const y of d.runningTools){const S=typeof y.lastProgress?.text=="string"&&y.lastProgress.text.length>0?[y.lastProgress.text]:void 0;f.content.push({type:"toolUse",toolCallId:y.toolCallId,toolName:y.name,input:y.args??{},outputLines:S}),h.toolStartTimes.set(y.toolCallId,Date.now())}return h.currentAssistantMsgId=f.id,h.turnTextLen=d.assistantText.length,h.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:m},{type:"messageCreated",message:rd(f)}]}function l(u,d,h,m){try{return c(u,d,h,m)}catch(f){return console.error("[agentProjector] Error projecting event:",u,f instanceof Error?f.message:f),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,h,m){const f=n(h),y=d,S=[],_=y?.agentId;if(typeof _=="string"&&_!==Tie){const b=t.has(_);if(b&&(u==="thinking.delta"||u==="assistant.delta")){const v=y?.delta??"";return v?[{type:"agentDelta",sessionId:h,agentId:_,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(b&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:h,agentId:_,reason:y?.reason}];if(Mie.has(u))return Nie(f,h,_,u,y??{},t)}switch(u){case"session.meta.updated":{const b=y?.patch?.title??y?.title,v=y?.patch?.lastPrompt,g={};typeof b=="string"&&b.length>0&&(g.title=b),typeof v=="string"&&(g.lastPrompt=v),(g.title!==void 0||g.lastPrompt!==void 0)&&S.push({type:"sessionMetaUpdated",sessionId:h,...g});break}case"prompt.submitted":{const b=y?.promptId,v=y?.userMessageId;if(!b||!v)break;const g=Oie(y?.content);if(g.length===0)break;f.currentPromptId=b;const k=Lie(f,h,b,v,g,typeof y?.createdAt=="string"?y.createdAt:new Date().toISOString());S.push({type:"messageCreated",message:rd(k)});break}case"turn.started":{const b=y?.turnId,v=f.currentPromptId??sr("pr_");f.currentPromptId=v,b!==void 0&&f.turnPromptId.set(b,v),f.turnTextLen=0,f.turnThinkLen=0,S.push({type:"sessionStatusChanged",sessionId:h,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const b=y?.turnId;let v=f.turnPromptId.get(b)??f.currentPromptId;v||(v=sr("pr_"),f.currentPromptId=v,b!==void 0&&f.turnPromptId.set(b,v));const g=sw(f,h,v);f.currentAssistantMsgId=g.id,S.push({type:"messageCreated",message:rd(g)});break}case"thinking.delta":{const b=f.currentAssistantMsgId;if(!b)break;const v=y?.delta??"";if(!v)break;m?.offset===0&&f.turnThinkLen>0&&(f.turnThinkLen=0);const g=a(f.turnThinkLen,m?.offset);if(g==="skip")break;if(g==="gap"){S.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"delta_gap"});break}const k=ow(f,b,"thinking",v);if(k<0)break;f.turnThinkLen+=v.length,S.push({type:"assistantDelta",sessionId:h,messageId:b,contentIndex:k,delta:{thinking:v}});break}case"assistant.delta":{const b=f.currentAssistantMsgId;if(!b)break;const v=y?.delta??"";if(!v)break;m?.offset===0&&f.turnTextLen>0&&(f.turnTextLen=0);const g=a(f.turnTextLen,m?.offset);if(g==="skip")break;if(g==="gap"){S.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"delta_gap"});break}const k=ow(f,b,"text",v);if(k<0)break;f.turnTextLen+=v.length,S.push({type:"assistantDelta",sessionId:h,messageId:b,contentIndex:k,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const b=f.currentAssistantMsgId,v=y?.turnId,g=f.turnPromptId.get(v)??f.currentPromptId;if(!b||!g)break;const k=y?.toolCallId,$=y?.name??y?.toolName??"",A=y?.args??y?.input??{};Pie(f,b,k,$,A);const w=Mm(f,b);w&&w.content.length-1,f.toolStartTimes.set(k,Date.now()),w&&S.push({type:"messageUpdated",sessionId:h,messageId:b,content:w.content.map(x=>({...x})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const b=y?.toolCallId,v=Rie(y??{});b&&v&&S.push({type:"toolOutput",sessionId:h,toolCallId:b,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const b=y?.turnId;let v=f.turnPromptId.get(b)??f.currentPromptId;v||(v=sr("pr_"),f.currentPromptId=v,b!==void 0&&f.turnPromptId.set(b,v));const g=y?.toolCallId,k=y?.output,$=y?.isError??!1;f.toolStartTimes.get(g)??Date.now(),f.toolStartTimes.delete(g);const A=Die(f,h,g,k,$,v);S.push({type:"messageCreated",message:rd(A)}),f.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const b=f.currentAssistantMsgId,v=Aie(y?.usage);if(f.totalInput+=v.input,f.totalOutput+=v.output,f.totalCacheRead+=v.cacheRead,f.totalCacheCreate+=v.cacheCreate,b){iw(f,b);const g=Mm(f,b);g&&S.push({type:"messageUpdated",sessionId:h,messageId:b,content:g.content.map(k=>({...k})),status:"completed"})}break}case"agent.status.updated":{y?.model&&(f.model=y.model),y?.contextTokens!==void 0&&(f.contextTokens=y.contextTokens),y?.maxContextTokens!==void 0&&(f.contextLimit=y.maxContextTokens),S.push({type:"sessionUsageUpdated",sessionId:h,usage:rw(f),model:f.model||void 0,swarmMode:y?.swarmMode===!0?!0:y?.swarmMode===!1?!1:void 0,planMode:y?.planMode===!0?!0:y?.planMode===!1?!1:void 0});break}case"turn.ended":{const b=f.currentAssistantMsgId,v=y?.reason??"completed",g=jr(y??{},"durationMs");if(b){iw(f,b);const A=Mm(f,b);A&&S.push({type:"messageUpdated",sessionId:h,messageId:b,content:A.content.map(w=>({...w})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:g})}f.turnCount++;const k=rw(f);S.push({type:"sessionUsageUpdated",sessionId:h,usage:k});const $=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";S.push({type:"sessionStatusChanged",sessionId:h,status:$,previousStatus:"running"}),f.currentAssistantMsgId=void 0,f.currentPromptId=void 0,f.turnTextLen=0,f.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{f.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof y?.subagentId=="string"&&y.subagentId.length>0?y.subagentId:sr("task_"),sessionId:h,kind:"subagent",description:typeof y?.description=="string"?y.description:y?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof y?.subagentName=="string"?y.subagentName:void 0,parentToolCallId:typeof y?.parentToolCallId=="string"?y.parentToolCallId:void 0,swarmIndex:typeof y?.swarmIndex=="number"?y.swarmIndex:void 0};f.subagentMeta.set(v.id,v),S.push({type:"taskCreated",sessionId:h,task:v});break}case"subagent.started":{const b=oc(f,h,y?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});b&&S.push({type:"taskCreated",sessionId:h,task:b});break}case"subagent.suspended":{const b=oc(f,h,y?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof y?.reason=="string"?y.reason:void 0});b&&S.push({type:"taskCreated",sessionId:h,task:b});break}case"subagent.completed":{const b=typeof y?.resultSummary=="string"?y.resultSummary:void 0,v=oc(f,h,y?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:b});v&&S.push({type:"taskCreated",sessionId:h,task:v}),S.push({type:"taskCompleted",sessionId:h,taskId:y?.subagentId??"",status:"completed",outputPreview:b});break}case"subagent.failed":{const b=typeof y?.error=="string"?y.error:void 0,v=oc(f,h,y?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:b});v&&S.push({type:"taskCreated",sessionId:h,task:v}),S.push({type:"taskCompleted",sessionId:h,taskId:y?.subagentId??"",status:"failed",outputPreview:b});break}case"error":{S.push({type:"unknown",raw:{_agentError:!0,code:y?.code,message:y?.message}});break}case"warning":{S.push({type:"unknown",raw:{_agentWarning:!0,message:y?.message}});break}case"background.task.started":{const b=y?.info??{},v=typeof b.startedAt=="number"?new Date(b.startedAt).toISOString():void 0,g=typeof b.taskId=="string"?b.taskId:typeof b.taskId=="number"?String(b.taskId):sr("task_"),k=typeof b.description=="string"?b.description:typeof b.command=="string"?b.command:Ln.global.t("tasks.defaultDescription"),$=typeof b.command=="string"?b.command:void 0;S.push({type:"taskCreated",sessionId:h,task:{id:g,sessionId:h,kind:"bash",description:k,command:$,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:$!==void 0?`$ ${$}`:void 0}});break}case"background.task.terminated":{const b=y?.info??{},v=b.status==="failed"||typeof b.exitCode=="number"&&b.exitCode!==0;S.push({type:"taskCompleted",sessionId:h,taskId:typeof b.taskId=="string"?b.taskId:typeof b.taskId=="number"?String(b.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const b=y?.result??{};S.push({type:"compactionCompleted",sessionId:h,tokensBefore:typeof b.tokensBefore=="number"?b.tokensBefore:void 0,tokensAfter:typeof b.tokensAfter=="number"?b.tokensAfter:void 0,summary:typeof b.summary=="string"?b.summary:void 0}),S.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{S.push({type:"compactionStarted",sessionId:h,trigger:y?.trigger==="manual"?"manual":"auto",instruction:typeof y?.instruction=="string"?y.instruction:void 0});break}case"compaction.cancelled":{S.push({type:"compactionCancelled",sessionId:h});break}case"goal.updated":{const b=Eie(y?.snapshot??null);S.push({type:"goalUpdated",sessionId:h,goal:b?.status==="complete"?null:b});break}}return S}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const Fie=new Set(["server_hello","ack","ping","resync_required","error","pong"]),lw=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated"]),Hie=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","question.expired","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),Wie=new Set(["assistant.delta","thinking.delta"]);function Uie(e,t){if(Fie.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return Wie.has(s)?qie(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Hie.has(s)?{route:"protocol"}:lw.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:lw.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function qie(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 jg extends Error{code;requestId;details;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details}}class ic extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview}}function nu(e){return e instanceof jg||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function hT(e){return e instanceof ic||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const rc=3e4,pT="0123456789ABCDEFGHJKMNPQRSTVWXYZ",aw=500;function cw(){try{return AbortSignal.timeout(rc)}catch{return}}function jie(e,t){let n="",s=e;for(let o=0;o<t;o++)n=pT[s%32]+n,s=Math.floor(s/32);return n}function zie(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=>pT[n%32]).join("")}function uw(){return`${jie(Date.now(),10)}${zie(16)}`}function Vie(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function dw(e){try{const t=await e.text();return t?t.length>aw?`${t.slice(0,aw)}...`:t:void 0}catch{return}}class Kie{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=wf(this.origin,t),o=uw(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();Y_({method:"POST",path:t,url:s,requestId:o,body:Vie(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:cw()})}catch(u){throw id({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new ic({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:rc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw id({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new ic({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:rc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await dw(c)})}if(X_({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),a.code!==0)throw new jg({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=wf(this.origin,n);if(o){const m=new URLSearchParams;for(const[y,S]of Object.entries(o))S!==void 0&&m.set(y,String(S));const f=m.toString();f&&(r=`${r}?${f}`)}const l=uw(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();Y_({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:cw()})}catch(m){throw id({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:m}),new ic({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:rc})}let d;const h=u.clone();try{d=await u.json()}catch(m){throw id({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:m}),new ic({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:rc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await dw(h)})}if(X_({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),d.code!==0&&!i.includes(d.code))throw new jg({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}}class Gie{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Ol("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=new WebSocket(this.wsUrl);this.ws=t,t.onopen=()=>{Ol("open")},t.onmessage=n=>{try{const s=JSON.parse(String(n.data));KQ(s),this.handleFrame(s)}catch(s){Ol("parse-error",{error:String(s)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},t.onerror=()=>{Ol("error"),this.handlers.onError(0,"WebSocket error",!1)},t.onclose=n=>{Ol("close",n?{code:n.code,reason:n.reason,wasClean:n.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Ol("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=ld(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(ld(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(ld(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=ld(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=Uie(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),VQ(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function ld(e,t){return`${e}\0${t}`}function Am(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 fw(e){return e==="auto_compact"||e==="manual_compact"}class Yie{http;config;constructor(t){this.config=t,this.http=new Kie(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[]}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?hie(t.status):void 0,include_archive:t?.includeArchive,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(ni),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return ni(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ni(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return ni(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingLevel:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(Wg),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:ni(n.session),messages:n.messages.items.map(Wg),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(dT),pendingQuestions:n.pending_questions.map(fT)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,mie(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return ni(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return ni(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ni)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,gie(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,bie(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(Ug)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return Ug(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(Am)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return Am(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Am(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(tw)])):void 0;return{items:o.items.map(tw),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return wf(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Sf)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Sf(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(Sie)}async listProviders(){return(await this.http.get("/providers")).items.map(Tm)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return Tm(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Tm(n)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return{changed:t.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.unchanged,failed:t.failed}}async getConfig(){const t=await this.http.get("/config");return qg(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return qg(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return wf(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=DQ(this.config.serverHttpUrl,this.config.clientId),s=Bie(),o=new Gie(n,this.config.clientId,{onWireEvent:i=>{const r=Cie(i),l=xie(i),a=wie(i);a.type==="historyCompacted"&&!fw(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const h of d)h.type==="historyCompacted"&&!fw(h.reason)&&t.onResync(a,l),t.onEvent(h,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}let hw;function at(){return hw??=new Yie(NQ()),hw}const mT=["blue","mono"],gT=["light","dark","system"],vT=15,Xie=12,Zie=20;function Qie(){const e=En(Ot.accent);return e&&mT.includes(e)?e:"blue"}function Jie(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function ere(){const e=En(Ot.colorScheme);return e&&gT.includes(e)?e:"system"}function tre(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function nre(){const e=En(Ot.theme);return e==="terminal"||e==="modern"||e==="kimi"?e:"modern"}function sre(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}function cv(e){return Number.isFinite(e)?Math.min(Zie,Math.max(Xie,Math.round(e))):vT}function ore(){const e=En(Ot.uiFontSize);return e===null?vT:cv(Number(e))}function ire(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${cv(e)}px`)}const hh=se(nre()),uv=se(ere()),dv=se(Qie()),fv=se(ore());Ve(hh,sre,{immediate:!0});Ve(uv,tre,{immediate:!0});Ve(dv,Jie,{immediate:!0});Ve(fv,ire,{immediate:!0});function yT(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(hh.value=e,An(Ot.theme,e))}function rre(){yT(hh.value==="modern"?"terminal":"modern")}function lre(e){gT.includes(e)&&(uv.value=e,An(Ot.colorScheme,e))}function are(e){mT.includes(e)&&(dv.value=e,An(Ot.accent,e))}function cre(e){const t=cv(e);fv.value=t,An(Ot.uiFontSize,String(t))}const ure=600,dre=250,ph=250,fre=1e3,hre=160,Cf=se(!1);let Gr=[],Zr=null,xf=-ph;function pre(){Gr=[],xf=-ph,Cf.value=!1,Zr!==null&&(clearTimeout(Zr),Zr=null)}function mre(){Cf.value=!0,Zr!==null&&clearTimeout(Zr),Zr=setTimeout(()=>{Zr=null,Gr=[],xf=-ph,Cf.value=!1},fre)}function gre(e){if(e<=0)return;const t=Date.now();Gr.push({time:t,chars:e});const n=t-ure;if(Gr=Gr.filter(l=>l.time>=n),t-xf<ph)return;xf=t;const s=Gr[0]?.time??t,o=Math.max(t-s,dre);Gr.reduce((l,a)=>l+a.chars,0)/o*1e3>=hre&&mre()}function vre(){return{theme:hh,colorScheme:uv,accent:dv,uiFontSize:fv,fastMoon:Cf,setTheme:yT,toggleTheme:rre,setColorScheme:lre,setAccent:are,setUiFontSize:cre,resetFastMoon:pre,recordMoonDelta:gre}}function yre(){const e=En(Ot.notifyOnComplete);return e===null?!0:e==="1"}const Tf=se(yre()),hv=se(typeof Notification<"u"?Notification.permission:"denied");async function kre(e){if(!e){Tf.value=!1,An(Ot.notifyOnComplete,"0");return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}hv.value=t,t==="granted"&&(Tf.value=!0,An(Ot.notifyOnComplete,"1"))}function bre(e,t){if(!Tf.value||typeof Notification>"u")return;const n=Notification.permission;if(n!=="denied"){if(n==="default"){Notification.requestPermission().then(s=>{hv.value=s,s==="granted"&&pw(e,t)});return}pw(e,t)}}function pw(e,t){if(t.isActiveAndVisible)return;const n=t.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(n,{body:Ln.global.t("settings.notifyBody"),tag:`kimi-complete-${e}`});s.onclick=()=>{try{window.focus()}catch{}t.onClick(),s.close()}}catch{}}function _re(){return{notifyOnComplete:Tf,notifyPermission:hv,setNotifyOnComplete:kre,maybeNotifyCompletion:bre}}function mw(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const wre=1e3,Sre=4096,gw=32*1024;function Cre(e,t){let n=null,s;const o=new Set;async function i(h){try{const f=await at().listTasks(h);e.tasksBySession={...e.tasksBySession,[h]:mw(f,e.tasksBySession[h]??[])},await r(h,f)}catch{}}async function r(h,m){if(e.activeSessionId!==h)return;const f=m??e.tasksBySession[h]??[],y=at(),S=new Map;if(await Promise.all(f.map(async b=>{if((b.status==="completed"||b.status==="failed"||b.status==="cancelled")&&!o.has(b.id)&&!((b.outputLines?.length??0)>0))try{const g=await y.getTask(h,b.id,{withOutput:!0,outputBytes:gw});g.outputPreview!==void 0&&S.set(b.id,{preview:g.outputPreview,bytes:g.outputBytes})}catch{}finally{o.add(b.id)}})),S.size===0)return;const _=e.tasksBySession[h]??[];e.tasksBySession={...e.tasksBySession,[h]:_.map(b=>{const v=S.get(b.id);return v?{...b,outputPreview:v.preview,outputBytes:v.bytes}:b})}}async function l(h){if(e.activeSessionId!==h)return;const m=at();let f;try{f=await m.listTasks(h)}catch{return}const y=new Map;await Promise.all(f.map(async v=>{const g=v.status==="running",k=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!g&&!k)&&!(k&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const $=await m.getTask(h,v.id,{withOutput:!0,outputBytes:g?Sre:gw});$.outputPreview!==void 0&&y.set(v.id,{preview:$.outputPreview,bytes:$.outputBytes})}catch{}finally{k&&o.add(v.id)}}));const S=e.tasksBySession[h]??[],_=new Map(S.map(v=>[v.id,v])),b=f.map(v=>{const g=_.get(v.id),k=y.get(v.id);return{...v,outputLines:g?.outputLines,outputPreview:k?.preview??g?.outputPreview,outputBytes:k?.bytes??g?.outputBytes}});e.tasksBySession={...e.tasksBySession,[h]:mw(b,S)}}function a(h){n!==null&&s===h||(c(),s=h,l(h),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===h?l(h):c())},wre))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=se(0);let d=null;return Ve(()=>t.value.some(h=>h.status==="running"),h=>{h&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!h&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ve(()=>{const h=e.activeSessionId;if(!h)return{sid:void 0,hasRunning:!1};const m=e.tasksBySession[h]??[];return{sid:h,hasRunning:m.some(f=>f.status==="running")}},({sid:h,hasRunning:m},f,y)=>{let S;m&&h!==void 0?a(h):h!==void 0?S=setTimeout(()=>{(e.tasksBySession[h]??[]).some(b=>b.status==="running")||c()},1500):c(),y(()=>{S!==void 0&&clearTimeout(S)})},{deep:!0,immediate:!0}),{taskClock:j(()=>u.value),loadTasksForSession:i}}const kT=Ot.starredModels;function xre(){try{const e=En(kT);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Tre(e){try{An(kT,JSON.stringify(e))}catch{}}function Mre(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=se([]),d=se(xre()),h=se({}),m=se([]),f=se(null);function y(W){if(!(W==null||W.length===0))return u.value.find(V=>V.id===W||V.model===W)}function S(){const W=e.activeSessionId?e.sessions.find(V=>V.id===e.activeSessionId):void 0;return y(W?.model??f.value??e.defaultModel)}function _(W){const V=q_(S(),W);return e.thinking=V,l(V),V}async function b(W){try{const z=await at().listSkills(W);h.value={...h.value,[W]:z}}catch{}}async function v(){try{const W=at();u.value=await W.listModels(),_(e.thinking)}catch(W){n("loadModels",W)}}async function g(){try{const W=await at().refreshOAuthProviderModels();for(const V of W.failed)n("refreshOAuthProviderModels",new Error(V.reason),{message:V.provider})}catch{}}async function k(){try{const W=at();m.value=await W.listProviders()}catch(W){n("loadProviders",W)}}async function $(W){const V=e.activeSessionId,z=q_(y(W),e.thinking),ie=e.thinking;if(!V){f.value=W,_(z);return}const ae=e.sessions.find(re=>re.id===V)?.model;a(V,re=>({...re,model:W})),z!==ie&&(e.thinking=z,l(z));try{await at().updateSession(V,{model:W,thinking:z!==ie?z:void 0})}catch(re){a(V,Te=>({...Te,model:ae??Te.model})),z!==ie&&(e.thinking=ie,l(ie)),n("setModel",re,{sessionId:V});return}await s(V)}function A(W){const V=new Set(d.value);V.has(W)?V.delete(W):V.add(W),d.value=Array.from(V),Tre(d.value)}async function w(W,V){const z=e.activeSessionId;if(!z)return;const ie=i.value==="idle"&&!r.has(z),ae=`msg_skill_opt_${Date.now().toString(36)}`;if(ie){r.add(z),e.sendingBySession={...e.sendingBySession,[z]:!0};const re={id:ae,sessionId:z,role:"user",content:[{type:"text",text:`/${W}${V?` ${V}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:W,skillArgs:V}}};c(z,Te=>[...Te,re])}try{await at().activateSkill(z,W,V)}catch(re){ie&&(r.delete(z),e.sendingBySession={...e.sendingBySession,[z]:!1},c(z,Te=>Te.filter(Pe=>Pe.id!==ae))),n("activateSkill",re,{sessionId:z})}}async function x(W){try{await at().addProvider(W),await Promise.all([k(),v()])}catch(V){n("addProvider",V)}}async function I(W){try{await at().deleteProvider(W),await Promise.all([k(),v()])}catch(V){n("deleteProvider",V)}}async function L(W){try{const z=await at().refreshProvider(W);m.value=m.value.map(ie=>ie.id===W?z:ie)}catch(V){n("refreshProvider",V)}}async function O(){try{return await at().startOAuthLogin()}catch{return null}}async function P(){try{return await at().pollOAuthLogin()}catch{return null}}async function B(){try{await at().cancelOAuthLogin()}catch{}}function R(W){const V=_(W);o({thinking:V})}return{models:u,starredModelIds:d,providers:m,draftModel:f,skillsBySession:h,loadSkillsForSession:b,loadModels:v,refreshOAuthProviderModels:g,loadProviders:k,setModel:$,toggleStarModel:A,activateSkill:w,addProvider:x,deleteProvider:I,refreshProvider:L,startOAuthLogin:O,pollOAuthLogin:P,cancelOAuthLogin:B,setThinking:R}}const bT="kimiWeb.compaction",Are=/^read[_-]?media(?:file)?$/i,Ere=/^agent$/i,Ire=/^data:([^;]+);base64,(.*)$/s,$re=/^<(image|video|audio)\s+path="([^"]+)">$/,Nre=/Mime type:\s*([^.\s]+)/i,Lre=/Size:\s*(\d+)\s*bytes/i,Ore=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Pre(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 Rre(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 Dre(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function Bre(e,t){if(!Are.test(e))return;const n=Rre(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const m=d.text,f=$re.exec(m);f&&(o=f[1],s=f[2]);const y=Nre.exec(m);y?.[1]&&(i=y[1]);const S=Lre.exec(m);S?.[1]&&(r=Number(S[1]));const _=Ore.exec(m);_?.[1]&&_[2]&&(l=`${_[1]}x${_[2]}`);continue}const h=Dre(d);h&&(a=h)}if(a===null)return;const c=Ire.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Pre(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function _T(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
250
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
251
|
-
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
252
|
-
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
253
|
-
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Fre(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Hre(e){let t=null;if(typeof e=="string")try{const n=JSON.parse(e);n&&typeof n=="object"&&(t=n)}catch{t=null}else e&&typeof e=="object"&&(t=e);return t?{description:typeof t.description=="string"?t.description:void 0,subagentType:typeof t.subagent_type=="string"?t.subagent_type:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0}:{}}function Wre(e,t,n,s){const o=Hre(t),i=n?n.isError?"failed":"completed":s?"working":"completed",r=n?_T(n.output):void 0;return{id:e,toolCallId:e,name:o.description&&o.description.length>0?o.description:"Sub Agent",subagentType:o.subagentType,prompt:o.prompt,phase:i,status:n?n.isError?"failed":"completed":s?"running":"completed",summary:r&&r.length>0?r.join(`
|
|
254
|
-
`):void 0}}function Ure(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function qre(e,t){const n=e.split(`
|
|
255
|
-
`),s=t.split(`
|
|
256
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function jre(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:qre(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}return n==="shell"||n==="command"?{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0}:n==="file_content"||n==="file"?{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0}:n==="file_op"||n==="fileop"?{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0}:n==="url_fetch"||n==="url"?{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action}:n==="search"?{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0}:n==="invocation"||n==="agent_call"||n==="skill_call"?{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0}:n==="todo"||n==="todo_list"?{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})}:{kind:"generic",summary:e.action}}function zre(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"?t?.trigger==="user-slash":!1}function Vre(e){return e.metadata?.origin?.kind==="compaction_summary"}function Kre(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function wT(e,t,n,s=!0,o=[]){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);const a=new Map;for(const f of o){if(f.kind!=="subagent")continue;const y=[f.parentToolCallId,f.id].filter(S=>typeof S=="string"&&S.length>0);for(const S of y){const _=a.get(S)??[];_.push(f),a.set(S,_)}}for(const[f,y]of a.entries())a.set(f,y.toSorted(Ure));const c=new Map;for(const f of e)for(const y of f.content)y.type==="toolResult"&&c.set(y.toolCallId,{output:y.output,isError:!!y.isError});let u=null;function d(f=!1){if(!u)return;const y=u;if(u=null,!f||!s)for(let S=0;S<y.tools.length;S++){const _=y.tools[S];if(_.status!=="running")continue;const b={..._,status:"ok"};y.tools[S]=b;const v=y.blocks.find(g=>g.kind==="tool"&&g.tool.id===b.id);v&&v.kind==="tool"&&(v.tool=b)}i.push({id:y.id,role:"assistant",no:r++,text:y.textParts.join(`
|
|
257
|
-
`),thinking:y.thinkingParts.length>0?y.thinkingParts.join(`
|
|
258
|
-
`):void 0,tools:y.tools.length>0?y.tools:void 0,blocks:y.blocks.length>0?y.blocks:void 0,approval:y.approval,approvalId:y.approvalId,durationMs:y.durationMs})}function h(f,y){for(const S of y)if(S.type==="text"){if(S.text){f.textParts.push(S.text);const _=f.blocks.at(-1);_&&_.kind==="text"?_.text+=`
|
|
259
|
-
`+S.text:f.blocks.push({kind:"text",text:S.text})}}else if(S.type==="thinking"){if(S.thinking){f.thinkingParts.push(S.thinking);const _=f.blocks.at(-1);_&&_.kind==="thinking"?_.thinking+=`
|
|
260
|
-
`+S.thinking:f.blocks.push({kind:"thinking",thinking:S.thinking})}}else if(S.type==="toolUse"){const _=a.get(S.toolCallId);if(_&&_.length>0){if(_.filter($=>$.swarmIndex!==void 0).length>1)continue;const k=_.map(Fre);k.length===1?f.blocks.push({kind:"agent",member:k[0]}):f.blocks.push({kind:"agentGroup",members:k});continue}if(Ere.test(S.toolName)){const g=Wre(S.toolCallId,S.input,c.get(S.toolCallId),s);f.blocks.push({kind:"agent",member:g});continue}const b=l.get(S.toolCallId),v={id:S.toolCallId,name:S.toolName,arg:typeof S.input=="string"?S.input:JSON.stringify(S.input),status:"running",output:S.outputLines};f.tools.push(v),f.blocks.push({kind:"tool",tool:v}),b&&(f.approval=jre(b),f.approvalId=b.approvalId)}else if(S.type==="toolResult"){const _=f.tools.findIndex(b=>b.id===S.toolCallId);if(_!==-1){const b=f.tools[_],v={...b,status:S.isError?"error":"ok",output:_T(S.output),media:S.isError?void 0:Bre(b.name,S.output)};f.tools[_]=v;const g=f.blocks.find(k=>k.kind==="tool"&&k.tool.id===S.toolCallId);g&&g.kind==="tool"&&(g.tool=v)}}}function m(f){if(f.type==="image"||f.type==="video"){const y=f.type,S=f.source;if(S.kind==="url")return{url:S.url,kind:y};if(S.kind==="base64")return{url:`data:${S.mediaType};base64,${S.data}`,kind:y};if(S.kind==="file"&&n)return{url:n(S.fileId),kind:y}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image"};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video"}}}for(const f of e){if(f.role==="system")continue;if(Vre(f)){d();const v=f.metadata?.[bT];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(g=>g.type==="text").map(g=>g.text).join(`
|
|
261
|
-
`),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(f.role==="user"){if(d(),!zre(f))continue;const v=f.metadata?.origin,g=v?.kind==="skill_activation"&&v?.trigger==="user-slash",k=[],$=[];for(const A of f.content){A.type==="text"&&(g?k.push(v.skillArgs??""):k.push(A.text));const w=m(A);w&&$.push({url:w.url,kind:w.kind,alt:A.type==="file"?A.name:void 0})}i.push({id:f.id,role:"user",no:r++,text:k.join(`
|
|
262
|
-
`),images:$.length>0?$:void 0,skillActivation:g?{name:v.skillName,args:v.skillArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){u&&h(u,f.content);continue}const y=f.promptId;Kre(u,y)?u!==null&&u.promptId===void 0&&y!==void 0&&(u.promptId=y):(d(),u={id:f.id,promptId:y,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const _=u;if(_===null)continue;const b=JSON.stringify(f.content);_.promptId!==void 0&&_.seenSigs.has(b)||(_.seenSigs.add(b),h(_,f.content))}return d(!0),i}function Gre(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=se({}),l=j(()=>{const A=e.activeSessionId;if(!A)return null;const w=r.value[A];return w?{parentId:A,agentId:w.agentId}:null}),a=j(()=>l.value?.parentId??null),c=j(()=>l.value!==null),u=j(()=>{const A=l.value;return A?!!e.sideChatSendingByAgent[A.agentId]:!1}),d=j(()=>{const A=l.value;return A?e.sideChatSendingByAgent[A.agentId]?!0:(e.tasksBySession[A.parentId]??[]).some(w=>w.id===A.agentId&&w.status==="running"):!1}),h=j(()=>{const A=l.value;if(!A)return[];const w=e.sideChatMessagesByAgent[A.agentId]??[];return wT(w,[],x=>at().getFileUrl(x),d.value,[])});function m(A,w){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[A]:w(e.sideChatMessagesByAgent[A]??[])}}function f(A,w){m(A,x=>[...x,w])}function y(A){m(A,w=>{const x=[...w].reverse().findIndex(L=>L.role==="user");if(x===-1)return w;const I=w.length-1-x;return w.filter((L,O)=>O!==I)})}function S(A,w){m(A,x=>{const I=[...x];for(let L=I.length-1;L>=0;L-=1){const O=I[L];if(O.role==="user")return I[L]={...O,promptId:O.promptId??w},I}return x})}function _(A,w,x){x&&m(A,I=>{const L=I.at(-1);if(L?.role==="assistant"){const O=L.content[0],P=O?.type==="text"?O.text:"";return[...I.slice(0,-1),{...L,content:[{type:"text",text:`${P}${x}`}]}]}return[...I,{id:s(),sessionId:w,role:"assistant",content:[{type:"text",text:x}],createdAt:new Date().toISOString()}]})}function b(A,w,x){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[A]:!1},!x)return;const L=(e.sideChatMessagesByAgent[A]??[]).at(-1);(L?.role==="assistant"&&L.content[0]?.type==="text"?L.content[0].text:"").trim().length>0||_(A,w,x)}async function v(A){const w=e.activeSessionId;if(w){if(!r.value[w]){let x;try{({agentId:x}=await at().startBtw(w))}catch(I){n("openSideChat",I,{sessionId:w});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[x]:e.sideChatMessagesByAgent[x]??[]},r.value={...r.value,[w]:{agentId:x}},o(),i()?.markSideChannelAgent(x)}A&&A.trim()&&await k(A.trim())}}function g(){const A=e.activeSessionId;if(!A)return;const{[A]:w,...x}=r.value;r.value=x}async function k(A){const w=l.value,x=A.trim();if(!w||!x)return;const I=w.parentId,L=w.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[L]:!0};const O={id:s(),sessionId:I,role:"user",content:[{type:"text",text:x}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};f(L,O);try{const P=await at().submitPrompt(I,{content:[{type:"text",text:x}],agentId:L});S(L,P.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],P.userMessageId]}}catch(P){n("sendSideChatPrompt",P,{sessionId:I}),y(L),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[L]:!1}}}function $(A){if(!r.value[A])return;const{[A]:w,...x}=r.value;r.value=x}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:h,appendSideChatAssistantText:_,finishSideChatAgent:b,openSideChat:v,closeSideChat:g,sendSideChatPrompt:k,clearSideChatForSession:$}}function Yre(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 Xre(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
263
|
-
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Yre(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const zg="/sessions/";function vw(e){const{pathname:t}=e;if(!t.startsWith(zg))return;const n=t.slice(zg.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function Zre(e){return e===void 0||e.length===0?"/":`${zg}${encodeURIComponent(e)}`}const Qre=50,Jre=40402;function ele(e,t){const{taskPoller:n,sideChat:s,modelProvider:o,pushOperationFailure:i,activity:r,inFlightPromptSessions:l,sessionsKnownEmpty:a,setSessions:c,updateSession:u,upsertSessionFront:d,appendSession:h,forgetSession:m,setActiveSessionId:f,updateSessionMessages:y,nextOptimisticMsgId:S,getEventConn:_,syncSessionFromSnapshot:b,subscribeToSessionEvents:v,hasLoadedMessages:g,refreshSessionStatus:k,persistSessionProfile:$,mergedWorkspaces:A,status:w,workspaceIdForSession:x,savePermissionToStorage:I,savePlanModeToStorage:L,saveSwarmModeToStorage:O,saveGoalModeToStorage:P,saveUnread:B,saveActiveWorkspaceToStorage:R,saveHiddenWorkspacesToStorage:W,goalErrorMessage:V,basename:z,resetFastMoon:ie,initialized:ae,selectedDiffPath:re,fileDiffLines:Te,fileDiffLoading:Pe}=t;async function We(H){if(e.messagesLoadingMoreBySession[H])return;const Q=e.messagesBySession[H];if(!Q||Q.length===0)return;const Ce=Q[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[H]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[H]:!1};try{const Be=await at().listMessages(H,{beforeId:Ce,pageSize:Qre}),nt=[...Be.items].reverse();y(H,lt=>[...nt,...lt]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[H]:Be.hasMore}}catch(Be){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[H]:!0},i("loadOlderMessages",Be,{sessionId:H})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[H]:!1}}}function Ne(H){n.loadTasksForSession(H),Se(H),k(H),Object.prototype.hasOwnProperty.call(o.skillsBySession.value,H)||o.loadSkillsForSession(H)}async function me(H){const Q=e.activeSessionId;if(Q){re.value=H,Te.value=[],Pe.value=!0;try{const Be=await at().getFileDiff(Q,H);if(re.value!==H)return;Te.value=Xre(Be.diff)}catch(Ce){re.value===H&&(Te.value=[]),console.warn("[loadFileDiff] diff unavailable for",H,Ce)}finally{re.value===H&&(Pe.value=!1)}}}function be(){re.value=null,Te.value=[],Pe.value=!1}async function Se(H){try{const Ce=await at().getGitStatus(H);e.gitStatusBySession={...e.gitStatusBySession,[H]:Ce}}catch{}}async function fe(){try{const Q=await at().getAuth();e.authReady=Q.ready,e.defaultModel=Q.defaultModel,e.managedProviderStatus=Q.managedProvider?.status??null}catch{}}async function K(){try{const H=at();e.config=await H.getConfig()}catch{}}async function Z(H){try{const Ce=await at().setConfig(H);return e.config=Ce,e.defaultModel=Ce.defaultModel??null,!0}catch(Q){return i("setConfig",Q),!1}}const pe=100;async function D(){const H=at(),Q=[];let Ce;for(;;){const Be=await H.listSessions({pageSize:pe,beforeId:Ce});if(Q.push(...Be.items),!Be.hasMore||Be.items.length===0)break;Ce=Be.items[Be.items.length-1].id}return Q}async function X(){e.loading=!0;try{const H=at();await Promise.all([H.getHealth().catch(()=>null),H.getMeta().then(At=>{e.serverVersion=At.serverVersion,e.availableOpenInApps=At.openInApps}).catch(()=>null),o.loadModels()]),await fe(),await K();const Q=await D().catch(()=>[]);c(Q),await oe();const Ce=Q[0],Be=e.activeWorkspaceId;!(Be!==null&&A.value.some(At=>At.id===Be))&&Ce&&te(x(Ce)),It();const lt=typeof window<"u"?vw(window.location):void 0;!e.activeSessionId&<!==void 0&&(e.sessions.some(qn=>qn.id===lt)||await ot(lt))&&await Mt(lt,{urlMode:"replace"}),!e.activeSessionId&&Q.length>0&&await Mt(Q[0].id,{urlMode:"replace"})}catch(H){i("load",H)}finally{e.loading=!1,ae.value=!0}}async function oe(){try{const H=at(),[Q,Ce]=await Promise.all([H.listWorkspaces().catch(()=>[]),H.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Q,e.fsHome=Ce.home||null,e.recentRoots=Ce.recentRoots}catch{}}function te(H){e.activeWorkspaceId=H,R(H)}function ue(H){te(H);const Q=e.sessions.filter(Ce=>x(Ce)===H);if(Q.length>0){const Ce=Q[0];Ce&&Ce.id!==e.activeSessionId&&Mt(Ce.id)}else f(void 0),Xe(void 0,"push")}function U(H){e.hiddenWorkspaceRoots.includes(H.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Be=>Be!==H.root),W(e.hiddenWorkspaceRoots));const Q=e.workspaces.findIndex(Be=>Be.id===H.id||Be.root===H.root);if(Q===-1){e.workspaces=[H,...e.workspaces];return}const Ce=[...e.workspaces];Ce[Q]=H,e.workspaces=Ce}function q(H){if(H.type==="workspaceCreated"||H.type==="workspaceUpdated"){U(H.workspace);return}const Q=e.workspaces.find(Be=>Be.id===H.workspaceId)?.root??H.root;if(Q&&!e.hiddenWorkspaceRoots.includes(Q)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Q],W(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Be=>Be.id!==H.workspaceId&&Be.root!==Q),e.activeWorkspaceId===H.workspaceId||e.activeWorkspaceId===Q){const Be=A.value[0]?.id??null;if(e.activeWorkspaceId=Be,Be)R(Be);else try{Rc(Ot.activeWorkspace)}catch{}f(void 0),e.sessionLoading=!1,be(),Xe(void 0,"replace")}}function J(){f(void 0),Xe(void 0,"push")}function de(H){te(H),J(),be()}async function ge(H){const Q=A.value.find(Ce=>Ce.id===H);if(Q)try{const Ce=at();let Be,nt=Q.root;try{const At=await Ce.addWorkspace({root:Q.root});Be=At.id,nt=At.root,U(At)}catch{}const lt=await Ce.createSession({workspaceId:Be,cwd:nt});return d(lt),te(lt.workspaceId??Be??H),a.add(lt.id),await Mt(lt.id),lt}catch(Ce){i("createSessionInWorkspace",Ce);return}}async function Me(H,Q,Ce){const Be=A.value.find(nt=>nt.id===H);if(Be)try{const nt=at();let lt,At=Be.root;try{const Nn=await nt.addWorkspace({root:Be.root});lt=Nn.id,At=Nn.root,U(Nn)}catch{}const qn=o.draftModel.value??void 0,Qt=await nt.createSession({workspaceId:lt,cwd:At,model:qn});o.draftModel.value=null;const po=qn!==void 0&&(!Qt.model||Qt.model.length===0)?{...Qt,model:qn}:Qt;d(po),te(Qt.workspaceId??lt??H),await Mt(Qt.id),await fn(Qt.id,Q,Ce)}catch(nt){i("startSessionAndSendPrompt",nt)}}async function le(H){const Q=H.trim();if(!Q)return;const Ce=at();try{const Be=await Ce.addWorkspace({root:Q});U(Be),de(Be.id)}catch{e.workspaces.find(nt=>nt.root===Q)||(e.workspaces=[{id:Q,root:Q,name:z(Q),isGitRepo:!1,sessionCount:0},...e.workspaces]),de(Q)}}async function _e(H){try{return await at().browseFs(H)}catch{return{path:"",parent:null,entries:[]}}}async function ze(){try{return await at().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Xe(H,Q){if(Q==="none"||typeof window>"u"||!window.history)return;const Ce=Zre(H);if(window.location.pathname!==Ce)try{Q==="push"?window.history.pushState(null,"",Ce):window.history.replaceState(null,"",Ce)}catch{}}async function ot(H){try{const Q=await at().getSession(H);return e.sessions.some(Ce=>Ce.id===Q.id)||h(Q),!0}catch{return!1}}function Ye(){const H=vw(window.location);if(H===void 0){f(void 0);return}if(H!==e.activeSessionId){if(e.sessions.some(Q=>Q.id===H)){Mt(H,{urlMode:"none"});return}(async()=>{if(await ot(H)){await Mt(H,{urlMode:"none"});return}const Q=e.sessions[0];Q?await Mt(Q.id,{urlMode:"replace"}):(f(void 0),Xe(void 0,"replace"))})()}}let mt=!1;function It(){mt||typeof window>"u"||(mt=!0,window.addEventListener("popstate",Ye))}async function Mt(H,Q){const Ce=g(H),Be=!Ce&&a.has(H);a.delete(H);try{Xe(H,Q?.urlMode??"push"),e.sessionLoading=!Ce&&!Be,f(H),ie(),e.unreadBySession[H]&&(e.unreadBySession={...e.unreadBySession,[H]:!1},B({[H]:!1})),be();const nt=e.sessions.find(lt=>lt.id===H);if(nt){const lt=x(nt);e.activeWorkspaceId!==lt&&te(lt)}if(Ce)v(H);else if(await b(H)==="not-found")return;Ne(H)}catch(nt){i("selectSession",nt,{sessionId:H})}finally{e.activeSessionId===H&&(e.sessionLoading=!1)}}async function Kt(H,Q){try{const Be=await at().createSession({cwd:H,title:Q?.title,model:Q?.model});d(Be),a.add(Be.id),await Mt(Be.id)}catch(Ce){i("createSession",Ce)}}async function fn(H,Q,Ce){l.add(H),e.sendingBySession={...e.sendingBySession,[H]:!0};const Be=S();try{const nt=at(),lt=[];Q&<.push({type:"text",text:Q});for(const Nn of Ce??[])Nn.kind==="video"?lt.push({type:"video",source:{kind:"file",fileId:Nn.fileId}}):lt.push({type:"image",source:{kind:"file",fileId:Nn.fileId}});if(lt.length===0)return l.delete(H),e.sendingBySession={...e.sendingBySession,[H]:!1},!1;const At={id:Be,sessionId:H,role:"user",content:lt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};y(H,Nn=>[...Nn,At]);const qn=e.sessions.find(Nn=>Nn.id===H),Qt=(qn?.model&&qn.model.length>0?qn.model:e.defaultModel)??void 0;if(e.goalMode&&Q)try{await nt.updateSession(H,{goalObjective:Q.trim()})}catch(Nn){return i("createGoal",Nn,{sessionId:H}),l.delete(H),e.sendingBySession={...e.sendingBySession,[H]:!1},y(H,Jt=>Jt.some(qt=>qt.id===Be)?Jt.filter(qt=>qt.id!==Be):Jt),!1}const po=await nt.submitPrompt(H,{content:lt,model:Qt,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});return e.goalMode&&(e.goalMode=!1,P(!1)),e.promptIdBySession={...e.promptIdBySession,[H]:po.promptId},y(H,Nn=>{const Jt=Nn.findIndex(Vs=>Vs.id===Be);if(Jt===-1)return Nn;const qt=[...Nn];return qt[Jt]={...qt[Jt],promptId:qt[Jt].promptId??po.promptId},qt}),_()?.bindNextPromptId(H,po.promptId),!0}catch(nt){return l.delete(H),e.sendingBySession={...e.sendingBySession,[H]:!1},y(H,lt=>lt.some(At=>At.id===Be)?lt.filter(At=>At.id!==Be):lt),i("sendPrompt",nt,{sessionId:H}),!1}}async function un(H,Q){const Ce=e.activeSessionId;if(Ce){if(r.value!=="idle"||l.has(Ce)){Gn(H,Q);return}await fn(Ce,H,Q)}}async function Ge(H,Q){const Ce=e.activeSessionId;if(!Ce)return;const Be=e.queuedBySession[Ce]??[],nt=[],lt=[];for(const Jt of Be){const qt=Jt.text.trim();qt&&nt.push(qt),Jt.attachments?.length&<.push(...Jt.attachments)}const At=H.trim();if(At&&nt.push(At),Q?.length&<.push(...Q),nt.length===0&<.length===0)return;Be.length>0&&(e.queuedBySession={...e.queuedBySession,[Ce]:[]});const qn=nt.join(`
|
|
264
|
-
|
|
265
|
-
`);if(r.value==="idle"&&!l.has(Ce)){await fn(Ce,qn,lt);return}const Qt=[];qn&&Qt.push({type:"text",text:qn});for(const Jt of lt)Jt.kind==="video"?Qt.push({type:"video",source:{kind:"file",fileId:Jt.fileId}}):Qt.push({type:"image",source:{kind:"file",fileId:Jt.fileId}});const po=S(),Nn={id:po,sessionId:Ce,role:"user",content:Qt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};y(Ce,Jt=>[...Jt,Nn]);try{const Jt=at(),qt=e.sessions.find(Ro=>Ro.id===Ce),Vs=(qt?.model&&qt.model.length>0?qt.model:e.defaultModel)??void 0,ui=await Jt.submitPrompt(Ce,{content:Qt,model:Vs,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});if(y(Ce,Ro=>{const Do=Ro.findIndex(Ch=>Ch.id===po);if(Do===-1)return Ro;const ul=[...Ro];return ul[Do]={...ul[Do],promptId:ul[Do].promptId??ui.promptId},ul}),ui.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ce]:ui.promptId},_()?.bindNextPromptId(Ce,ui.promptId);return}try{await Jt.steerPrompts(Ce,[ui.promptId])}catch{}}catch(Jt){y(Ce,qt=>qt.filter(Vs=>Vs.id!==po)),i("steer",Jt,{sessionId:Ce})}}async function Pt(H,Q){try{const Be=await at().uploadFile({file:H,name:Q});return{fileId:Be.id,name:Be.name,mediaType:Be.mediaType}}catch(Ce){return i("uploadImage",Ce),null}}function Gn(H,Q){const Ce=e.activeSessionId;if(!Ce)return;const Be=e.queuedBySession[Ce]??[];e.queuedBySession={...e.queuedBySession,[Ce]:[...Be,{text:H,attachments:Q}]}}async function _n(){const H=e.activeSessionId;if(!H)return;const Q=e.sessions.find(nt=>nt.id===H);let Ce=e.promptIdBySession[H];if(Ce===void 0){const nt=Q?.currentPromptId;nt?.startsWith("prompt_")&&(Ce=nt)}const Be=at();if(Ce!==void 0)try{await Be.abortPrompt(H,Ce);return}catch(nt){if(!(nu(nt)&&nt.code===Jre)){i("abortCurrentPrompt",nt,{sessionId:H});return}}try{await Be.abortSession(H)}catch(nt){i("abortCurrentPrompt",nt,{sessionId:H})}}async function In(H,Q){const Ce=e.activeSessionId;if(Ce)try{const Be=at(),nt={decision:Q.decision,scope:Q.scope,feedback:Q.feedback};await Be.respondApproval(Ce,H,nt);const lt=e.approvalsBySession[Ce]??[];e.approvalsBySession={...e.approvalsBySession,[Ce]:lt.filter(At=>At.approvalId!==H)}}catch(Be){i("respondApproval",Be,{sessionId:Ce})}}async function On(H,Q){const Ce=e.activeSessionId;if(Ce)try{await at().respondQuestion(Ce,H,Q);const nt=e.questionsBySession[Ce]??[];e.questionsBySession={...e.questionsBySession,[Ce]:nt.filter(lt=>lt.questionId!==H)}}catch(Be){i("respondQuestion",Be,{sessionId:Ce})}}async function as(H){const Q=e.activeSessionId;if(Q)try{await at().dismissQuestion(Q,H);const Be=e.questionsBySession[Q]??[];e.questionsBySession={...e.questionsBySession,[Q]:Be.filter(nt=>nt.questionId!==H)}}catch(Ce){i("dismissQuestion",Ce,{sessionId:Q})}}async function ks(H){const Q=e.activeSessionId;if(Q)try{await at().cancelTask(Q,H);const Be=e.tasksBySession[Q]??[];e.tasksBySession={...e.tasksBySession,[Q]:Be.map(nt=>nt.id===H?{...nt,status:"cancelled"}:nt)}}catch(Ce){i("cancelTask",Ce,{sessionId:Q})}}function bs(H){e.planMode=H,L(H),$({planMode:H})}function $s(){bs(!e.planMode)}function Jn(H){e.swarmMode=H,O(H),$({swarmMode:H})}function wn(){const H=!e.swarmMode;H&&e.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||Jn(H)}function on(H){e.goalMode=H,P(H)}function Un(){on(!e.goalMode)}async function Tt(H){const Q=H.trim();if(!Q||e.permission==="manual"&&!confirm(`Start goal: "${Q}"? The agent will run autonomously toward this objective.`))return;const Ce=e.activeSessionId;if(Ce){try{await at().updateSession(Ce,{goalObjective:Q})}catch(Be){i("createGoal",Be,{sessionId:Ce,message:V(Be)});return}await un(Q)}}function $n(H){const Q=e.activeSessionId;Q&&Promise.resolve(at().updateSession(Q,{goalControl:H})).catch(Ce=>{i("controlGoal",Ce,{sessionId:Q,message:V(Ce)})})}function Gt(H){if(e.permission=H,I(H),$({permissionMode:H}),H==="auto"||H==="yolo"){const Q=e.activeSessionId;if(Q){const Ce=[...e.approvalsBySession[Q]??[]];for(const Be of Ce)In(Be.approvalId,{decision:"approved",scope:H==="yolo"?"session":void 0})}}}function js(H){const Q=[...e.warnings];Q.splice(H,1),e.warnings=Q}async function Po(H,Q){try{await at().updateSession(H,{title:Q}),u(H,Be=>({...Be,title:Q}))}catch(Ce){i("renameSession",Ce,{sessionId:H})}}function co(H,Q){e.workspaces=e.workspaces.map(Ce=>Ce.id===H?{...Ce,name:Q}:Ce)}async function zs(H){const Q=e.workspaces.find(lt=>lt.id===H)?.root??A.value.find(lt=>lt.id===H)?.root??H,Ce=e.activeSessionId?e.sessions.find(lt=>lt.id===e.activeSessionId):void 0,Be=e.activeWorkspaceId===H||e.activeWorkspaceId===Q,nt=!!(Ce&&(Ce.cwd===Q||Ce.workspaceId===H||x(Ce)===H));Q&&!e.hiddenWorkspaceRoots.includes(Q)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Q],W(e.hiddenWorkspaceRoots));try{await at().deleteWorkspace(H)}catch{}if(e.workspaces=e.workspaces.filter(lt=>lt.id!==H&<.root!==Q),Be||nt){const lt=A.value[0]?.id??null;if(e.activeWorkspaceId=lt,lt)R(lt);else try{Rc(Ot.activeWorkspace)}catch{}}(Be||nt)&&(f(void 0),e.sessionLoading=!1,be(),Xe(void 0,"replace"))}async function uo(H){try{await at().archiveSession(H),m(H),s.clearSideChatForSession(H);const{[H]:Ce,...Be}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Be,e.activeSessionId===H){const nt=e.sessions[0];nt?await Mt(nt.id,{urlMode:"replace"}):(f(void 0),Xe(void 0,"replace"))}}catch(Q){i("archiveSession",Q,{sessionId:H})}}async function fo(){try{await at().logout(),await fe(),await X()}catch(H){i("logout",H)}}function wt(H){const Q=e.activeSessionId;Q&&at().compactSession(Q,H).catch(Ce=>{i("compact",Ce,{sessionId:Q})})}async function ho(H){const Q=H??e.activeSessionId;if(Q)try{const Ce=await at().forkSession(Q);d(Ce),await Mt(Ce.id)}catch(Ce){i("fork",Ce,{sessionId:Q})}}async function es(H=1){const Q=e.activeSessionId;if(!Q)return null;const Ce=(()=>{const Be=e.messagesBySession[Q]??[];for(let nt=Be.length-1;nt>=0;nt--){const lt=Be[nt];if(lt.role==="user"&&!(lt.metadata?.origin&<.metadata.origin.kind!=="user"))return lt.content.filter(At=>At.type==="text").map(At=>At.text).join(`
|
|
266
|
-
`)}return null})();try{return await at().undoSession(Q,H),await b(Q),Ce}catch(Be){return i("undo",Be,{sessionId:Q}),null}}function Ns(H){const Q=e.activeSessionId;if(!Q)return;const Ce=e.queuedBySession[Q]??[];if(H<0||H>=Ce.length)return;const Be=[...Ce];Be.splice(H,1),e.queuedBySession={...e.queuedBySession,[Q]:Be}}async function gn(H){const Q=e.activeSessionId;if(!Q)return[];try{return(await at().listDirectory(Q,{path:H,includeGitStatus:!0})).items}catch{return[]}}async function vn(H){const Q=e.activeSessionId;if(!Q)return null;try{const Be=await at().readFile(Q,{path:H});return{path:Be.path,content:Be.content,encoding:Be.encoding,mime:Be.mime,languageId:Be.languageId,isBinary:Be.isBinary,size:Be.size,lineCount:Be.lineCount}}catch{return null}}const Ie=10485760;function ve(H){const Q=e.activeSessionId;return Q?at().getFileDownloadUrl(Q,H):null}async function ne(H,Q){const Ce=e.activeSessionId;if(!Ce)return!1;try{return await at().openFile(Ce,{path:H,line:Q}),!0}catch(Be){return i("openFile",Be,{sessionId:Ce}),!1}}async function Ee(H){const Q=e.activeSessionId;if(!Q)return;const Ce=w.value.cwd||".";try{await at().openInApp(Q,H,Ce)}catch(Be){i("openInApp",Be,{sessionId:Q})}}async function He(H){const Q=e.activeSessionId;if(!Q)return!1;try{return await at().revealFile(Q,{path:H}),!0}catch(Ce){return i("revealFile",Ce,{sessionId:Q}),!1}}async function it(H){if(/^(https?:|data:|blob:)/i.test(H))return H;const Q=e.activeSessionId;if(!Q)return H;let Ce=H;if(Ce.startsWith("/")){const Be=e.sessions.find(nt=>nt.id===Q)?.cwd;if(Be&&(Ce===Be||Ce.startsWith(Be.endsWith("/")?Be:`${Be}/`))){if(Ce=Ce.slice(Be.length).replace(/^\//,""),!Ce)return H}else return H}try{const nt=await at().readFile(Q,{path:Ce,length:Ie});return!nt.isBinary||nt.encoding!=="base64"||nt.truncated?H:`data:${nt.mime};base64,${nt.content}`}catch{return H}}async function Ke(H){const Q=e.activeSessionId;if(!Q)return[];try{return(await at().searchFiles(Q,{query:H,limit:20})).items.map(nt=>({path:nt.path,name:nt.name}))}catch{return[]}}return{loadFileDiff:me,clearFileDiff:be,loadGitStatus:Se,checkAuth:fe,loadConfig:K,updateConfig:Z,listAllSessionsGlobal:D,load:X,loadWorkspaces:oe,selectWorkspace:te,openWorkspace:ue,upsertWorkspacePreserveOrder:U,applyWorkspaceEvent:q,clearActiveSession:J,openWorkspaceDraft:de,createSessionInWorkspace:ge,startSessionAndSendPrompt:Me,addWorkspaceByPath:le,browseFs:_e,getFsHome:ze,writeSessionUrl:Xe,fetchSessionIntoList:ot,onSessionRoutePopState:Ye,bindSessionRoute:It,selectSession:Mt,createSession:Kt,submitPromptInternal:fn,sendPrompt:un,steerPrompt:Ge,uploadImage:Pt,enqueue:Gn,unqueue:Ns,abortCurrentPrompt:_n,respondApproval:In,respondQuestion:On,dismissQuestion:as,cancelTask:ks,setPlanMode:bs,togglePlanMode:$s,setSwarmMode:Jn,toggleSwarmMode:wn,setGoalMode:on,toggleGoalMode:Un,createGoal:Tt,controlGoal:$n,setPermission:Gt,dismissWarning:js,renameSession:Po,renameWorkspace:co,deleteWorkspace:zs,archiveSession:uo,logout:fo,compact:wt,forkSession:ho,undo:es,listDir:gn,readFileContent:vn,getFileDownloadUrl:ve,openWorkspaceFile:ne,openInApp:Ee,revealWorkspaceFile:He,resolveImageUrl:it,searchFiles:Ke,loadOlderMessages:We,refreshSessionSidecars:Ne}}const tle="kimiWeb.optimisticUserMessage";function nle(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function sle(e){return{...e,sessions:[...e.sessions],messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function ole(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function Em(e){return e.role==="user"&&e.metadata?.[tle]===!0}function ile(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function yw(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function rle(e,t){const n=yw(e),s=yw(t);return n.text===s.text&&n.media===s.media}function lle(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(Em(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Em(o)&&ile(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Em(o)&&rle(o,t))return s}return-1}function ale(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function cle(e,t,n){const s=sle(e);switch(ole(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[bT]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=s.messagesBySession[o]??[];if(!i.some(l=>l.id===t.message.id)){if(t.message.role==="user"){const l=lle(i,t.message);if(l!==-1){const a=[...i],c=a[l];a[l]={...t.message,id:c.id,promptId:t.message.promptId??c.promptId,metadata:{...t.message.metadata,...c.metadata}},s.messagesBySession[o]=a;break}}s.messagesBySession[o]=[...i,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=ale(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(l=>l.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":case"questionExpired":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i];l[r]=t.task,s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];return l.at(-1)===t.outputChunk?r:{...r,outputLines:[...l,t.outputChunk].slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?Ln.global.t("warnings.errorLabel"):Ln.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function ule(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function dle(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||Xc(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:ule(a.status)}]:[]})}}return[]}const fle=["queued","working","suspended","completed","failed"];function hle(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function ple(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function mle(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:hle(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=ple();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function gle(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of fle)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const Xs=vre(),Td=_re(),ST=Ot.permission,CT=Ot.activeWorkspace,xT=Ot.thinking,TT=Ot.planMode,MT=Ot.swarmMode,AT=Ot.goalMode,kw=40401,ET=Ot.onboarded,vle=["off","low","medium","high","xhigh","max"];Rc(Ot.codeFont);function yle(){try{const e=En(ST);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function kle(e){try{An(ST,e)}catch{}}function ble(){try{const e=En(xT);if(e&&vle.includes(e))return e}catch{}return"high"}function _le(e){try{An(xT,e)}catch{}}function wle(){try{return En(TT)==="true"}catch{return!1}}function Sle(e){try{An(TT,e?"true":"false")}catch{}}function Cle(){try{return En(MT)==="true"}catch{return!1}}function xle(e){try{An(MT,e?"true":"false")}catch{}}function Tle(){try{return En(AT)==="true"}catch{return!1}}function Mle(e){try{An(AT,e?"true":"false")}catch{}}function Ale(){try{return En(CT)}catch{return null}}const IT=Ot.hiddenWorkspaces;function Ele(){try{const e=En(IT);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Ile(e){try{An(IT,JSON.stringify(e))}catch{}}function $le(e){try{An(CT,e)}catch{}}function $T(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Nle(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const we=Qs({...nle(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:yle(),thinking:ble(),planMode:wle(),swarmMode:Cle(),goalMode:Tle(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:_1(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Ale(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Ele(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{}});function NT(e){we.sessions=e}function mh(e,t){we.sessions=we.sessions.map(n=>n.id===e?t(n):n)}function Lle(e){we.sessions=[e,...we.sessions.filter(t=>t.id!==e.id)]}function Ole(e){we.sessions=[...we.sessions,e]}function Ple(e){we.sessions=we.sessions.filter(t=>t.id!==e)}function LT(){const e=we.activeSessionId;e&&we.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(we.unreadBySession={...we.unreadBySession,[e]:!1},w1({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ot.unread&&(we.unreadBySession=_1(),LT())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&<()});function pv(e){we.activeSessionId=e}function Rle(e){we.messagesBySession=e}function Dle(e,t){we.messagesBySession={...we.messagesBySession,[e]:t}}function OT(e,t){we.messagesBySession={...we.messagesBySession,[e]:t(we.messagesBySession[e]??[])}}function Ble(e){const{[e]:t,...n}=we.messagesBySession;we.messagesBySession=n}function PT(e){li?.unsubscribe(e),Ple(e),Ble(e),delete we.approvalsBySession[e],delete we.questionsBySession[e],delete we.tasksBySession[e],delete we.goalBySession[e],delete we.gitStatusBySession[e],delete we.lastSeqBySession[e],delete we.compactionBySession[e],delete we.messagesLoadingMoreBySession[e],delete we.messagesHasMoreBySession[e],delete we.messagesLoadMoreErrorBySession[e],delete yh[e],zT.delete(e),vh.delete(e),delete we.queuedBySession[e],delete we.promptIdBySession[e],delete we.sendingBySession[e]}const RT=se(null),DT=se([]),BT=se(!1),FT=se(!1);async function gh(e){let t;try{t=await at().getSessionStatus(e)}catch{return}mh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),we.swarmMode=t.swarmMode,we.planMode=t.planMode}function HT(e){const t=we.activeSessionId;t&&Promise.resolve(at().updateSession(t,e)).then(()=>gh(t)).catch(()=>{})}const WT=Ot.betaToc;function Fle(){try{return En(WT)==="true"}catch{return!1}}function Hle(e){try{An(WT,e?"true":"false")}catch{}}const UT=se(Fle());function Wle(e){UT.value=e,Hle(e)}function Ule(e){try{return En(e)??""}catch{return""}}const qT=se(Ule(ET)==="1");function qle(e){qT.value=e;try{An(ET,e?"1":"0")}catch{}}let li=null,bw=0;function jT(){return bw+=1,`msg_opt_${Date.now().toString(36)}_${bw}`}const vh=new Set;function jle(e,t,n){const s={sessions:we.sessions,activeSessionId:we.activeSessionId,messagesBySession:we.messagesBySession,approvalsBySession:we.approvalsBySession,questionsBySession:we.questionsBySession,tasksBySession:we.tasksBySession,goalBySession:we.goalBySession,lastSeqBySession:we.lastSeqBySession,compactionBySession:we.compactionBySession,config:we.config,warnings:we.warnings},o=cle(s,e,{sessionId:t,seq:n});NT(o.sessions),pv(o.activeSessionId),Rle(o.messagesBySession),we.approvalsBySession=o.approvalsBySession,we.questionsBySession=o.questionsBySession,we.tasksBySession=o.tasksBySession,we.goalBySession=o.goalBySession,we.lastSeqBySession=o.lastSeqBySession,we.compactionBySession=o.compactionBySession,we.config=o.config??null,we.warnings=o.warnings,e.type==="configChanged"&&(we.defaultModel=e.config.defaultModel??null),e.type==="sessionUsageUpdated"&&e.sessionId===we.activeSessionId&&e.swarmMode!==void 0&&(we.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===we.activeSessionId&&e.planMode!==void 0&&(we.planMode=e.planMode)}function mv(){if(li!==null||typeof WebSocket>"u")return;we.connection="connecting",li=at().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){dt.applyWorkspaceEvent(t);return}jle(t,n.sessionId,n.seq);const s=hs.sideChatTargetBySession.value[n.sessionId];if(s){const{agentId:o}=s,i=n.sessionId;t.type==="agentDelta"&&t.agentId===o?t.delta.text&&hs.appendSideChatAssistantText(o,i,t.delta.text):t.type==="agentTurnEnded"&&t.agentId===o?hs.finishSideChatAgent(o,i):t.type==="taskProgress"&&t.taskId===o?hs.appendSideChatAssistantText(o,i,t.outputChunk):t.type==="taskCompleted"&&t.taskId===o&&hs.finishSideChatAgent(o,i,t.outputPreview)}if(t.type==="messageCreated"&&t.message.role==="user"&&t.message.promptId!==void 0){const o=t.message.sessionId;we.promptIdBySession[o]!==t.message.promptId&&(we.promptIdBySession={...we.promptIdBySession,[o]:t.message.promptId})}if(t.type==="assistantDelta"&&n.sessionId===we.activeSessionId&&Xs.recordMoonDelta((t.delta.text?.length??0)+(t.delta.thinking?.length??0)),t.type==="sessionStatusChanged"&&(t.status==="idle"||t.status==="aborted")&&Jae(t.sessionId,t.status),t.type==="approvalRequested"){const o=we.permission;(o==="auto"||o==="yolo")&&dt.respondApproval(t.approval.approvalId,{decision:"approved",scope:o==="yolo"?"session":void 0})}},onResync(t,n,s){s!==void 0&&(yh[t]=s),GT(t)},onError(t,n,s){KT({severity:"error",title:Ln.global.t("warnings.wsTitle"),message:n,details:[Xn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){we.connected=t,we.connection=t?"connected":"disconnected"}})}const yh={},zT=new Set;function zle(e){return nu(e)&&e.code===kw?!0:typeof e=="object"&&e!==null&&e.code===kw}function Xn(e,t){if(!(t==null||t===""))return{label:Ln.global.t(`warnings.details.${e}`),value:VT(t)}}function VT(e){if(e instanceof Error)return e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Vle(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Kle(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Gle(e,t,n){const s=[Xn("operation",e),Xn("sessionId",n)];return hT(t)?s.push(Xn("request",`${t.method} ${t.path}`),Xn("endpoint",t.url),Xn("requestId",t.requestId),Xn("phase",t.phase),Xn("timeout",`${t.timeoutMs}ms`),Xn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Xn("contentType",t.contentType),Xn("responsePreview",t.bodyPreview),Xn("cause",t.cause)):nu(t)?s.push(Xn("code",t.code),Xn("requestId",t.requestId),Xn("message",t.message),Xn("details",t.details)):s.push(Xn("errorName",Vle(t)),Xn("message",Kle(t)??VT(t))),s.filter(o=>o!==void 0)}function Yle(e,t,n={}){const s=hT(t),o=nu(t),i=n.title??(s?Ln.global.t("warnings.daemonNetworkTitle"):o?Ln.global.t("warnings.daemonApiTitle"):Ln.global.t("warnings.operationFailedTitle")),r=n.message??(s?Ln.global.t("warnings.daemonNetworkMessage"):o?t.message:Ln.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Gle(e,t,n.sessionId)}}function KT(e){we.warnings=[...we.warnings,e]}function kh(e,t,n){KT(Yle(e,t,n))}const Xle={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function Zle(e){if(!nu(e))return;const t=Xle[e.code];return t?Ln.global.t(t):void 0}async function Qle(e){if(PT(e),we.activeSessionId!==e)return;const t=we.sessions[0];t?await dt.selectSession(t.id,{urlMode:"replace"}):(pv(void 0),we.sessionLoading=!1,dt.writeSessionUrl(void 0,"replace"))}async function GT(e){try{const n=await at().getSessionSnapshot(e);return mh(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),Dle(e,n.messages),we.messagesHasMoreBySession={...we.messagesHasMoreBySession,[e]:n.hasMoreMessages},we.approvalsBySession={...we.approvalsBySession,[e]:n.pendingApprovals},we.questionsBySession={...we.questionsBySession,[e]:n.pendingQuestions},we.lastSeqBySession={...we.lastSeqBySession,[e]:n.asOfSeq},yh[e]=n.epoch,mv(),li&&(li.seedSnapshot(e,n),li.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),"ok"}catch(t){return zle(t)?(await Qle(e),"not-found"):(kh("getSessionSnapshot",t,{title:Ln.global.t("warnings.sessionSnapshotTitle"),message:Ln.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}function Jle(e){return Object.prototype.hasOwnProperty.call(we.messagesBySession,e)}function eae(e){if(mv(),li){const t=we.lastSeqBySession[e]??0,n=yh[e];li.subscribe(e,{seq:t,epoch:n})}}function bh(e){const t=we.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=hs.sideChatTargetBySession.value[e]?.agentId,o=(we.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&we.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function gv(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;return o<6e4?Ln.global.t("sessions.justNow"):i<1?`${Math.round(o/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString(Ln.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const tae=3e4,qc=se(0);let Im=null;function nae(){Im===null&&(Im=setInterval(()=>{qc.value=(qc.value+1)%Number.MAX_SAFE_INTEGER},tae),Im.unref?.())}function sae(e,t){const n=e.split(`
|
|
267
|
-
`),s=t.split(`
|
|
268
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function oae(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:sae(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}return n==="todo"||n==="todo_list"?{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})}:{kind:"generic",summary:e.action}}function iae(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 rae(e){const t=we.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function lae(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=Ln.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=Ln.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??rae(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s}}const aae=j(()=>{const e=we.sessions.find(n=>n.id===we.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:we.workspaceName,branch:t}}),cae=j(()=>(qc.value,we.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:gv(e.updatedAt,e.status),status:e.status,busy:bh(e.id)})))),uae=j(()=>we.activeSessionId??""),dae=j(()=>{const e=we.activeSessionId;return e?Pn.skillsBySession.value[e]??[]:[]}),fae=j(()=>{const e=we.activeSessionId;return e?we.sendingBySession[e]??!1:!1}),hs=Gre(we,{pushOperationFailure:kh,nextOptimisticMsgId:jT,connectEventsIfNeeded:mv,getEventConn:()=>li}),_h=j(()=>{const e=we.activeSessionId;if(!e)return[];const t=hs.sideChatTargetBySession.value[e]?.agentId;return(we.tasksBySession[e]??[]).filter(n=>n.id!==t)}),YT=Cre(we,_h),hae=j(()=>{const e=we.activeSessionId;if(!e)return[];const t=new Set(we.sideChatUserMessageIdsBySession[e]??[]),n=(we.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=we.approvalsBySession[e]??[];return wT(n,s,o=>at().getFileUrl(o),wh.value!=="idle",_h.value)}),pae=j(()=>(YT.taskClock.value,_h.value.map(lae))),XT=j(()=>mle(_h.value)),Fl=j(()=>{const e=we.activeSessionId;return e?we.goalBySession[e]??null:null}),mae=j(()=>{const e=we.activeSessionId;return e?dle(we.messagesBySession[e]??[]):[]}),gae=j(()=>{const e=we.activeSessionId;return e?we.compactionBySession[e]??null:null}),vae=j(()=>we.connection),yae=j(()=>we.loading),kae=j(()=>we.sessionLoading),bae=j(()=>{const e=we.activeSessionId;return e?we.messagesLoadingMoreBySession[e]??!1:!1}),_ae=j(()=>{const e=we.activeSessionId;return e?we.messagesHasMoreBySession[e]??!1:!1}),wae=j(()=>{const e=we.activeSessionId;return e?we.messagesLoadMoreErrorBySession[e]??!1:!1}),Sae=j(()=>we.serverVersion),Cae=j(()=>we.permission),xae=j(()=>we.thinking),Tae=j(()=>we.planMode),Mae=j(()=>we.swarmMode),Aae=j(()=>we.goalMode),Eae=j(()=>{const e=gle(XT.value);return{plan:we.planMode,goal:Fl.value&&Fl.value.status!=="complete"?{status:Fl.value.status,turnsUsed:Fl.value.turnsUsed,elapsedMs:Fl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Iae=j(()=>{const e=we.activeSessionId;return e?(we.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),$ae=j(()=>we.warnings),Nae=j(()=>{const e=we.activeSessionId;return e?(we.questionsBySession[e]??[]).map(iae):[]}),Lae=j(()=>{const e=we.activeSessionId;return e?(we.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:oae(t),agentName:t.agentName})):[]}),wh=j(()=>{const e=we.activeSessionId;return e?(we.approvalsBySession[e]??[]).length>0?"awaiting-approval":(we.questionsBySession[e]??[]).length>0?"awaiting-question":bh(e)?"running":"idle":"idle"}),Pn=Mre(we,{pushOperationFailure:kh,refreshSessionStatus:gh,persistSessionProfile:HT,activity:wh,inFlightPromptSessions:vh,saveThinkingToStorage:_le,updateSession:mh,updateSessionMessages:OT}),Mf=j(()=>{const e=we.activeSessionId;if(!e)return null;const t=we.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Oae=j(()=>{const e=we.activeSessionId;return e?we.gitStatusBySession[e]?.pullRequest??null:null}),Pae=j(()=>{const e=we.activeSessionId;if(!e)return[];const t=we.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),Rae=j(()=>{const e=we.activeSessionId;if(!e)return null;const t=we.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),ZT=j(()=>{const e=we.sessions.find(r=>r.id===we.activeSessionId),t=Mf.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Pn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??we.defaultModel)??"—",o=Pn.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:we.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Mf.value!==null}}),Dae=j(()=>DT.value),Bae=j(()=>we.sessions.find(t=>t.id===we.activeSessionId)?.usage.totalCostUsd??0),Fae=j(()=>we.authReady),Hae=j(()=>we.defaultModel),Wae=j(()=>we.managedProviderStatus),Uae=j(()=>we.config),qae=j(()=>{const e=we.activeSessionId;if(!e)return{};const t=we.gitStatusBySession[e];return t?{...t.entries}:{}});function su(e){return we.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const vv=j(()=>{const e=new Set(we.hiddenWorkspaceRoots),t=new Map;for(const a of we.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of we.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:$T(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of we.sessions){const c=su(a);n.set(c,(n.get(c)??0)+1)}const s=Mf.value,o=we.sessions.find(a=>a.id===we.activeSessionId)?.cwd,i=we.workspaces.map(a=>a.root),r=[...t.keys()].filter(a=>!i.includes(a));r.sort((a,c)=>a.localeCompare(c));const l=[];for(const a of[...i,...r]){const c=t.get(a),u=n.get(c.id)??n.get(c.root)??(we.loading?c.sessionCount:0);let d=c.branch;!d&&s&&o===c.root&&(d=s.branch),l.push({...c,sessionCount:u,branch:d})}return l}),Sh=j(()=>vv.value.map(e=>({id:e.id,name:e.name,root:e.root,shortPath:Nle(e.root,we.fsHome),branch:e.branch,sessionCount:e.sessionCount}))),QT=j(()=>{const e=we.activeWorkspaceId,t=vv.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),jae=j(()=>{const e=QT.value;return e?Sh.value.find(t=>t.id===e)??null:null}),zae=j(()=>{qc.value;const e=new Set(Sh.value.map(t=>t.id));return we.sessions.filter(t=>!t.parentSessionId&&e.has(su(t))).map(t=>({id:t.id,title:t.title,time:gv(t.updatedAt,t.status),status:t.status,busy:bh(t.id),lastPrompt:t.lastPrompt}))}),Vae=j(()=>{qc.value;const e=new Map;for(const t of we.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=su(t),s={id:t.id,title:t.title,time:gv(t.updatedAt,t.status),status:t.status,busy:bh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Sh.value.map(t=>({workspace:t,sessions:e.get(t.id)??[]}))}),JT=j(()=>{const e={};for(const[t,n]of Object.entries(we.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(we.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),Kae=j(()=>{const e={};for(const[t,n]of Object.entries(we.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(we.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),Gae=j(()=>{const e={};for(const[t,n]of Object.entries(we.unreadBySession))n&&(e[t]=!0);return e}),Yae=j(()=>{const e={},t=JT.value;for(const n of we.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=su(n);e[o]=(e[o]??0)+s}return e}),Xae=j(()=>we.recentRoots),Zae=j(()=>{const e=new Set,t=[];for(const n of we.sessions){const s=n.cwd;if(s&&!e.has(s)&&(e.add(s),t.push(s),t.length>=8))break}return t}),Qae=j(()=>we.availableOpenInApps),dt=ele(we,{taskPoller:YT,sideChat:hs,modelProvider:Pn,pushOperationFailure:kh,activity:wh,inFlightPromptSessions:vh,sessionsKnownEmpty:zT,setSessions:NT,updateSession:mh,upsertSessionFront:Lle,appendSession:Ole,forgetSession:PT,setActiveSessionId:pv,updateSessionMessages:OT,nextOptimisticMsgId:jT,getEventConn:()=>li,syncSessionFromSnapshot:GT,subscribeToSessionEvents:eae,hasLoadedMessages:Jle,refreshSessionStatus:gh,persistSessionProfile:HT,mergedWorkspaces:vv,status:ZT,workspaceIdForSession:su,savePermissionToStorage:kle,savePlanModeToStorage:Sle,saveSwarmModeToStorage:xle,saveGoalModeToStorage:Mle,saveUnread:w1,saveActiveWorkspaceToStorage:$le,saveHiddenWorkspacesToStorage:Ile,goalErrorMessage:Zle,basename:$T,resetFastMoon:Xs.resetFastMoon,initialized:FT,selectedDiffPath:RT,fileDiffLines:DT,fileDiffLoading:BT});function Jae(e,t){if(vh.delete(e),we.sendingBySession={...we.sendingBySession,[e]:!1},we.promptIdBySession[e]!==void 0){const i={...we.promptIdBySession};delete i[e],we.promptIdBySession=i}e===we.activeSessionId?(Xs.resetFastMoon(),dt.loadGitStatus(e),gh(e)):t==="idle"&&(we.unreadBySession={...we.unreadBySession,[e]:!0},w1({[e]:!0})),Td.maybeNotifyCompletion(e,{isActiveAndVisible:e===we.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:we.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{dt.selectSession(e)}});const n=we.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;we.queuedBySession={...we.queuedBySession,[e]:o},s!==void 0&&dt.submitPromptInternal(e,s.text,s.attachments).then(i=>{if(!i){const r=we.queuedBySession[e]??[];we.queuedBySession={...we.queuedBySession,[e]:[s,...r]}}})}function ece(){return nae(),{workspace:aae,sessions:cae,activeSessionId:uae,workspacesView:Sh,visibleWorkspace:jae,activeWorkspaceId:QT,sessionsForView:zae,workspaceGroups:Vae,attentionBySession:JT,pendingBySession:Kae,attentionByWorkspace:Yae,unreadBySession:Gae,recentRoots:Xae,turns:hae,tasks:pae,todos:mae,goal:Fl,swarms:XT,activationBadges:Eae,compaction:gae,status:ZT,sessionCost:Bae,fileDiff:Dae,selectedDiffPath:RT,fileDiffLoading:BT,changes:Pae,gitInfo:Mf,gitDiffStats:Rae,activePullRequest:Oae,changesByPath:qae,pendingApprovals:Lae,recentCwds:Zae,availableOpenInApps:Qae,connection:vae,loading:yae,sessionLoading:kae,loadingMoreMessages:bae,hasMoreMessages:_ae,loadMoreMessagesError:wae,serverVersion:Sae,initialized:FT,permission:Cae,thinking:xae,planMode:Tae,swarmMode:Mae,goalMode:Aae,queued:Iae,warnings:$ae,questions:Nae,activity:wh,isSending:fae,fastMoon:Xs.fastMoon,models:Pn.models,starredModelIds:Pn.starredModelIds,providers:Pn.providers,theme:Xs.theme,setTheme:Xs.setTheme,toggleTheme:Xs.toggleTheme,uiFontSize:Xs.uiFontSize,setUiFontSize:Xs.setUiFontSize,betaToc:UT,setBetaToc:Wle,colorScheme:Xs.colorScheme,setColorScheme:Xs.setColorScheme,accent:Xs.accent,setAccent:Xs.setAccent,notifyOnComplete:Td.notifyOnComplete,notifyPermission:Td.notifyPermission,setNotifyOnComplete:Td.setNotifyOnComplete,onboarded:qT,setOnboarded:qle,load:dt.load,selectSession:dt.selectSession,createSession:dt.createSession,loadOlderMessages:dt.loadOlderMessages,loadWorkspaces:dt.loadWorkspaces,selectWorkspace:dt.selectWorkspace,openWorkspace:dt.openWorkspace,openWorkspaceDraft:dt.openWorkspaceDraft,createSessionInWorkspace:dt.createSessionInWorkspace,startSessionAndSendPrompt:dt.startSessionAndSendPrompt,addWorkspaceByPath:dt.addWorkspaceByPath,browseFs:dt.browseFs,getFsHome:dt.getFsHome,sendPrompt:dt.sendPrompt,steerPrompt:dt.steerPrompt,sideChatVisible:hs.sideChatVisible,sideChatSessionId:hs.sideChatSessionId,sideChatTurns:hs.sideChatTurns,sideChatRunning:hs.sideChatRunning,sideChatSending:hs.sideChatSending,openSideChat:hs.openSideChat,closeSideChat:hs.closeSideChat,sendSideChatPrompt:hs.sendSideChatPrompt,uploadImage:dt.uploadImage,abortCurrentPrompt:dt.abortCurrentPrompt,respondApproval:dt.respondApproval,respondQuestion:dt.respondQuestion,dismissQuestion:dt.dismissQuestion,cancelTask:dt.cancelTask,setPermission:dt.setPermission,setThinking:Pn.setThinking,setPlanMode:dt.setPlanMode,togglePlanMode:dt.togglePlanMode,setSwarmMode:dt.setSwarmMode,toggleSwarmMode:dt.toggleSwarmMode,setGoalMode:dt.setGoalMode,toggleGoalMode:dt.toggleGoalMode,createGoal:dt.createGoal,controlGoal:dt.controlGoal,enqueue:dt.enqueue,dismissWarning:dt.dismissWarning,renameSession:dt.renameSession,renameWorkspace:dt.renameWorkspace,deleteWorkspace:dt.deleteWorkspace,archiveSession:dt.archiveSession,compact:dt.compact,forkSession:dt.forkSession,undo:dt.undo,unqueue:dt.unqueue,searchFiles:dt.searchFiles,loadGitStatus:dt.loadGitStatus,loadFileDiff:dt.loadFileDiff,clearFileDiff:dt.clearFileDiff,listDir:dt.listDir,readFileContent:dt.readFileContent,getFileDownloadUrl:dt.getFileDownloadUrl,openWorkspaceFile:dt.openWorkspaceFile,openInApp:dt.openInApp,revealWorkspaceFile:dt.revealWorkspaceFile,resolveImageUrl:dt.resolveImageUrl,refreshOAuthProviderModels:Pn.refreshOAuthProviderModels,loadModels:Pn.loadModels,loadProviders:Pn.loadProviders,skills:dae,activateSkill:Pn.activateSkill,setModel:Pn.setModel,toggleStarModel:Pn.toggleStarModel,addProvider:Pn.addProvider,deleteProvider:Pn.deleteProvider,refreshProvider:Pn.refreshProvider,authReady:Fae,defaultModel:Hae,managedProviderStatus:Wae,config:Uae,updateConfig:dt.updateConfig,checkAuth:dt.checkAuth,startOAuthLogin:Pn.startOAuthLogin,pollOAuthLogin:Pn.pollOAuthLogin,cancelOAuthLogin:Pn.cancelOAuthLogin,logout:dt.logout}}function tce({client:e,authLogoRef:t}){const n=j(()=>e.authReady.value),s=j(()=>e.initialized.value&&!n.value),o="/login",i=se(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ve(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return Ut(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function nce({running:e,showAuthGate:t}){const{t:n}=xt(),s=["◐","◓","◑","◒"],o=se(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ve(e,c=>{c?r():l()},{immediate:!0});const a=j(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});qM(()=>{typeof document<"u"&&(document.title=a.value)}),Ut(()=>{l()})}const sce=Ot.sidebarWidth,_w=Ot.sidebarCollapsed,ww=270,oce=170,ice=420,rce=36;function lce(){const e=se(ww),t=se(!1),n=j(()=>t.value?rce:e.value);function s(){try{t.value=En(_w)==="true"}catch{t.value=!1}}function o(){try{An(_w,String(t.value))}catch{}}function i(){t.value=!t.value,o()}return{SIDEBAR_WIDTH_KEY:sce,SIDEBAR_DEFAULT:ww,SIDEBAR_MIN:oce,SIDEBAR_MAX:ice,sessionColWidth:e,sidebarCollapsed:t,sideWidth:n,loadSidebarCollapsed:s,toggleSidebarCollapse:i}}function ace({client:e,detailTarget:t}){const{t:n}=xt(),s=se(null),o=se(null),i=se(!1),r=se(null),l=se(null);let a=0;const c=j(()=>{const g=l.value;return g?e.getFileDownloadUrl(g):null}),u=j(()=>s.value!==null);function d(g){return g.length>1?g.replace(/\/+$/,""):g}function h(g){const k=[];for(const $ of g.split(/[\\/]+/))if(!(!$||$===".")){if($===".."){k.pop();continue}k.push($)}return k.join("/")}function m(g){const k=g.trim();if(!k)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(k))return{error:n("filePreview.errors.unsupportedPath")};if(k.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const $=d(e.status.value.cwd);if(k.startsWith("/")){if(!$||k!==$&&!k.startsWith(`${$}/`))return{error:n("filePreview.errors.outsideWorkspace")};const w=k===$?"":k.slice($.length+1);if(w.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const x=h(w);return x?{path:x}:{error:n("filePreview.errors.isDirectory")}}if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const A=h(k);return A?{path:A}:{error:n("filePreview.errors.emptyPath")}}async function f(g){const k=++a;t.value="file",o.value=null,r.value=null,i.value=!0,s.value=g,l.value=null;const $=m(g.path);if("error"in $){i.value=!1,r.value=$.error;return}l.value=$.path;try{const A=await e.readFileContent($.path);if(k!==a)return;A?o.value={...A,path:A.path||$.path}:o.value={path:$.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(A){if(k!==a)return;r.value=A instanceof Error?A.message:n("filePreview.errors.loadFailed")}finally{k===a&&(i.value=!1)}}function y(g){return/^data:([^;,]+)/i.exec(g)?.[1]}function S(g){g.kind==="image"&&(t.value="file",s.value=null,l.value=null,r.value=null,i.value=!1,o.value={path:g.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:g.mimeType??y(g.url)??"image/*",sourceUrl:g.url,isBinary:!0,size:g.bytes??0})}function _(){s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function b(){const g=o.value?.path??s.value?.path;g&&e.openWorkspaceFile(g,s.value?.line)}function v(){const g=o.value?.path??s.value?.path;g&&e.revealWorkspaceFile(g)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:f,openMediaPreview:S,closeFilePreview:_,openPreviewInEditor:b,revealPreviewFile:v}}const cce="kimi-web.file-preview-width",qr=320;function uce({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){function o(){return typeof window>"u"?qr*2:Math.max(0,window.innerWidth-t.value)}function i(re){const Te=Math.max(qr,o()-qr);return Math.min(Te,Math.max(qr,Math.round(re)))}function r(){return i(o()/2)}const l=j(()=>r()),a=j(()=>Math.max(qr,o()-qr)),c=se(l.value),u=se(null),d=j(()=>{const re=u.value;if(!re)return null;const Pe=e.turns.value.find(We=>We.id===re.turnId)?.blocks?.[re.blockIndex];return Pe?.kind==="thinking"?Pe.thinking:null}),h=j(()=>d.value!==null);function m(re){const Te=u.value;if(Te&&Te.turnId===re.turnId&&Te.blockIndex===re.blockIndex){u.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",u.value=re}function f(){u.value=null,n.value==="thinking"&&(n.value=null)}const y=se(null),S=j(()=>{const re=y.value;if(!re)return null;const Te=e.turns.value.find(Pe=>Pe.id===re.turnId);return Te?.role==="compaction"&&Te.text?Te.text:null}),_=j(()=>S.value!==null);function b(re){if(y.value?.turnId===re.turnId){y.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",y.value=re}function v(){y.value=null,n.value==="compaction"&&(n.value=null)}const g=se(null),k=j(()=>{const re=g.value;if(!re)return null;const Pe=e.turns.value.find(We=>We.id===re.turnId)?.blocks?.[re.blockIndex];return Pe?Pe.kind==="agent"?Pe.member.id===re.memberId?Pe.member:null:Pe.kind==="agentGroup"?Pe.members.find(We=>We.id===re.memberId)??null:null:null}),$=j(()=>k.value!==null);function A(re){const Te=g.value;if(Te&&Te.turnId===re.turnId&&Te.memberId===re.memberId){g.value=null,n.value==="agent"&&(n.value=null);return}n.value="agent",g.value=re}function w(){g.value=null,n.value==="agent"&&(n.value=null)}const x=se("list"),I=se(null);function L(){n.value="diff",x.value="list",I.value=null,e.loadGitStatus(e.activeSessionId.value)}function O(){n.value==="diff"&&(n.value=null),x.value="list",I.value=null,e.clearFileDiff()}async function P(re){x.value="detail",I.value=re,await e.loadFileDiff(re)}async function B(re){await e.openSideChat(re),n.value="btw"}function R(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function W(){n.value==="btw"&&(n.value=null)}const V=j(()=>e.sideChatVisible.value),z=j(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||_.value)&&(n.value!=="agent"||$.value)&&(n.value!=="btw"||V.value)),ie=se(!1);function ae(){return n.value==="thinking"&&h.value?(f(),!0):n.value==="compaction"&&_.value?(v(),!0):n.value==="agent"&&$.value?(w(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(O(),!0):n.value==="btw"?(R(),!0):!1}return Ve(e.activeSessionId,()=>{s(),f(),v(),w(),O(),W()}),{PREVIEW_WIDTH_KEY:cce,PREVIEW_MIN:qr,previewDefaultWidth:l,previewMaxWidth:a,previewWidth:c,thinkingPanelText:d,thinkingVisible:h,openThinkingPanel:m,closeThinkingPanel:f,compactionPanelText:S,compactionPanelVisible:_,openCompactionPanel:b,closeCompactionPanel:v,agentPanelMember:k,agentPanelVisible:$,openAgentPanel:A,closeAgentPanel:w,detailDiffMode:x,detailDiffPath:I,openDiffDetail:L,closeDiffDetail:O,selectDiffFile:P,btwVisible:V,openSideChatTab:B,closeSideChat:R,hideSideChatPanel:W,sidePanelVisible:z,panelDragging:ie,closeOpenSidePanel:ae}}const dce=640,fce=`(max-width: ${dce}px)`;function hce(){const e=se(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(fce);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Ut(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Ut(()=>t.removeListener(n))),e}const pce={class:"app-shell"},mce={key:0,class:"auth-page"},gce={class:"auth-page-inner"},vce={class:"auth-page-copy"},yce={key:0,class:"sidebar-rail"},kce=["title","aria-label"],bce={key:3,class:"coming-soon"},_ce={class:"cs-text"},wce=["aria-label","aria-hidden"],Sce=Je({__name:"App",setup(e){const t=ece();pn("resolveImage",t.resolveImageUrl);const{t:n}=xt(),s=ci(),o=hce(),i=se(!1),r=se(!1),l=j(()=>{const Ke=t.activeSessionId.value;return t.sessions.value.find(H=>H.id===Ke)?.title??""}),a=j(()=>t.visibleWorkspace.value?.sessionCount??0),c=j(()=>t.activity.value!=="idle"),u=se(null),{showAuthGate:d,blinkAuthLogo:h}=tce({client:t,authLogoRef:u});nce({running:c,showAuthGate:d});function m(Ke){return Ke==="off"?"high":"off"}const f=se(!t.onboarded.value);function y(){t.setOnboarded(!0),f.value=!1}function S(){f.value=!0}ln(()=>{t.load(),x(),document.addEventListener("keydown",_,!0)}),Ut(()=>{document.removeEventListener("keydown",_,!0)});function _(Ke){Ke.key==="Escape"&&(ks.value||Ye()&&(Ke.stopPropagation(),Ke.preventDefault()))}const{SIDEBAR_WIDTH_KEY:b,SIDEBAR_DEFAULT:v,SIDEBAR_MIN:g,SIDEBAR_MAX:k,sessionColWidth:$,sidebarCollapsed:A,sideWidth:w,loadSidebarCollapsed:x,toggleSidebarCollapse:I}=lce(),L=se(null),{previewTarget:O,previewFile:P,previewLoading:B,previewError:R,previewDownloadUrl:W,previewExternalActions:V,openFilePreview:z,openMediaPreview:ie,closeFilePreview:ae,openPreviewInEditor:re,revealPreviewFile:Te}=ace({client:t,detailTarget:L}),{PREVIEW_WIDTH_KEY:Pe,PREVIEW_MIN:We,previewDefaultWidth:Ne,previewMaxWidth:me,previewWidth:be,thinkingPanelText:Se,thinkingVisible:fe,openThinkingPanel:K,closeThinkingPanel:Z,compactionPanelText:pe,compactionPanelVisible:D,openCompactionPanel:X,closeCompactionPanel:oe,agentPanelMember:te,openAgentPanel:ue,closeAgentPanel:U,detailDiffMode:q,detailDiffPath:J,openDiffDetail:de,closeDiffDetail:ge,selectDiffFile:Me,btwVisible:le,openSideChatTab:_e,closeSideChat:ze,sidePanelVisible:Xe,panelDragging:ot,closeOpenSidePanel:Ye}=uce({client:t,sideWidth:w,detailTarget:L,closeFilePreview:ae}),mt=se(null),It=se([]),Mt=j(()=>It.value.length>1);function Kt(Ke){It.value=Ke}const fn=se(!1),un=se(!1),Ge=se(!1),Pt=se(!1),Gn=se(!1),_n=se(!1),In=se(!1),On=se(!1),as=se(null),ks=j(()=>fn.value||un.value||Ge.value||Pt.value||Gn.value||_n.value||In.value||On.value||f.value||i.value||r.value),bs=se(!1),$s=se(!1),Jn=se(!1),wn=se(!1),on=se(!1);async function Un(){bs.value=!0,$s.value=!1,fn.value=!0;try{await t.refreshOAuthProviderModels(),await t.loadModels()}catch{$s.value=!0}finally{bs.value=!1}}async function Tt(){Jn.value=!0,wn.value=!1,un.value=!0;try{await t.loadProviders()}catch{wn.value=!0}finally{Jn.value=!1}}function $n(){Ge.value=!0}async function Gt(Ke){fn.value=!1,await t.setModel(Ke)}async function js(Ke){await t.addProvider(Ke)}async function Po(Ke){await t.deleteProvider(Ke)}async function co(Ke){await t.refreshProvider(Ke)}async function zs(Ke){on.value=!0;try{await t.updateConfig(Ke)&&await t.checkAuth()}finally{on.value=!1}}async function uo(){return t.startOAuthLogin()}async function fo(){return t.pollOAuthLogin()}async function wt(){return t.cancelOAuthLogin()}async function ho(){Ge.value=!1,await t.checkAuth(),await t.load()}async function es(Ke){await t.undo(1),await gt(),mt.value?.loadComposerForEdit(Ke)}function Ns(Ke){if(Ke==="/compact"||Ke.startsWith("/compact ")){t.compact(Ke.slice(8).trim()||void 0);return}if(Ke==="/swarm"||Ke.startsWith("/swarm ")){const H=Ke.slice(6).trim();H==="on"?t.setSwarmMode(!0):H==="off"?t.setSwarmMode(!1):H?(t.setSwarmMode(!0),t.sendPrompt(H)):t.toggleSwarmMode();return}if(Ke==="/goal"||Ke.startsWith("/goal ")){const H=Ke.slice(5).trim();H==="pause"||H==="resume"||H==="cancel"?t.controlGoal(H):H?t.createGoal(H):t.toggleGoalMode();return}if(Ke==="/btw"||Ke.startsWith("/btw ")){const H=Ke.slice(4).trim();!H&&t.sideChatVisible.value?t.closeSideChat():_e(H||void 0);return}switch(Ke){case"/new":case"/clear":Pt.value=!0;break;case"/sessions":Gn.value=!0;break;case"/fork":t.forkSession();break;case"/undo":t.undo();break;case"/permission":{const H=t.permission.value,Q=H==="manual"?"auto":H==="auto"?"yolo":"manual";t.setPermission(Q);break}case"/plan":t.togglePlanMode();break;case"/auto":t.setPermission("auto");break;case"/yolo":t.setPermission("yolo");break;case"/thinking":t.setThinking(m(t.thinking.value));break;case"/help":t.dismissWarning(-1);break;case"/status":In.value=!0;break;case"/model":Un();break;case"/provider":Tt();break;case"/login":$n();break;default:{const H=Ke.indexOf(" "),Q=(H===-1?Ke:Ke.slice(0,H)).slice(1),Ce=H===-1?void 0:Ke.slice(H+1).trim()||void 0;Q&&t.activateSkill(Q,Ce);break}}}function gn(Ke){t.unqueue(Ke)}function vn(Ke){t.unqueue(Ke)}async function Ie(Ke){const H=t.activeWorkspaceId.value;if(!t.activeSessionId.value&&H){await t.startSessionAndSendPrompt(H,Ke.text,Ke.attachments);return}if(!t.activeSessionId.value&&!H){as.value=Ke,_n.value=!0;return}t.sendPrompt(Ke.text,Ke.attachments)}async function ve(Ke){_n.value=!1,await t.addWorkspaceByPath(Ke);const H=as.value;as.value=null;const Q=t.activeWorkspaceId.value;H&&Q&&await t.startSessionAndSendPrompt(Q,H.text,H.attachments)}function ne(){as.value=null,_n.value=!1}function Ee(){const Ke=t.activeWorkspaceId.value;Ke?t.openWorkspaceDraft(Ke):Pt.value=!0}function He(Ke){t.openWorkspaceDraft(Ke)}function it(Ke){Ke&&window.open(Ke,"_blank","noopener")}return(Ke,H)=>(C(),E("div",pce,[T(d)?(C(),E("section",mce,[p("div",gce,[(C(),E("svg",{ref_key:"authLogoRef",ref:u,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:H[0]||(H[0]=Ze(()=>{},["prevent"])),onClick:H[1]||(H[1]=(...Q)=>T(h)&&T(h)(...Q))},[...H[92]||(H[92]=[gr('<defs data-v-d2222aaa><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-d2222aaa><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-d2222aaa></rect><g class="ch-eyes" fill="#000" data-v-d2222aaa><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-d2222aaa></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-d2222aaa></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-d2222aaa></rect>',2)])],544)),p("div",vce,[p("h1",null,N(T(n)("app.authPageTitle")),1),p("p",null,N(T(n)("app.authPageMessage")),1)]),p("button",{type:"button",class:"auth-page-btn",onClick:$n},[H[93]||(H[93]=p("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),p("path",{d:"M9 8H2"}),p("path",{d:"M5 5l3 3-3 3"})],-1)),p("span",null,N(T(n)("app.authPageLogin")),1)])])])):(C(),E("div",{key:1,class:$e(["app",{mobile:T(o),"sidebar-collapsed":T(A)&&!T(o)}]),style:Dt({"--side-w":T(w)+"px","--preview-w":T(be)+"px"})},[T(o)?(C(),je(Ine,{key:1,workspace:T(t).visibleWorkspace.value,"session-title":l.value,running:c.value,branch:T(t).status.value.branch,"session-count":a.value,onOpenSwitcher:H[14]||(H[14]=Q=>i.value=!0),onOpenSettings:H[15]||(H[15]=Q=>r.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(C(),E(Le,{key:0},[Lt(kt(AI,{"col-width":T($),"active-workspace":T(t).visibleWorkspace.value,"active-workspace-id":T(t).activeWorkspaceId.value,sessions:T(t).sessionsForView.value,groups:T(t).workspaceGroups.value,"active-id":T(t).activeSessionId.value,"attention-by-session":T(t).attentionBySession.value,"pending-by-session":T(t).pendingBySession.value,"unread-by-session":T(t).unreadBySession.value,onSelect:H[2]||(H[2]=Q=>T(t).selectSession(Q)),onCreate:Ee,onCreateInWorkspace:H[3]||(H[3]=Q=>He(Q)),onSelectWorkspace:H[4]||(H[4]=Q=>T(t).openWorkspace(Q)),onAddWorkspace:H[5]||(H[5]=Q=>_n.value=!0),onRename:H[6]||(H[6]=(Q,Ce)=>T(t).renameSession(Q,Ce)),onArchive:H[7]||(H[7]=Q=>T(t).archiveSession(Q)),onFork:H[8]||(H[8]=Q=>T(t).forkSession(Q)),onRenameWorkspace:H[9]||(H[9]=(Q,Ce)=>T(t).renameWorkspace(Q,Ce)),onDeleteWorkspace:H[10]||(H[10]=Q=>T(t).deleteWorkspace(Q)),onSelectWorkspaces:Kt,onOpenSettings:H[11]||(H[11]=Q=>On.value=!0),onCollapse:T(I)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),[[Uo,!T(A)]]),Lt(kt(sk,{"storage-key":T(b),"default-width":T(v),min:T(g),max:T(k),"onUpdate:width":H[12]||(H[12]=Q=>$.value=Q)},null,8,["storage-key","default-width","min","max"]),[[Uo,!T(A)]]),T(A)?(C(),E("div",yce,[p("button",{type:"button",class:"sidebar-expand-btn",title:T(n)("sidebar.expandSidebar"),"aria-label":T(n)("sidebar.expandSidebar"),onClick:H[13]||(H[13]=(...Q)=>T(I)&&T(I)(...Q))},[...H[94]||(H[94]=[gr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-d2222aaa><path d="M4 6h9" data-v-d2222aaa></path><path d="M4 12h9" data-v-d2222aaa></path><path d="M4 18h9" data-v-d2222aaa></path><path d="M17 9l3 3-3 3" data-v-d2222aaa></path></svg>',1)])],8,kce)])):ce("",!0)],64)),Mt.value?(C(),E("div",bce,[H[95]||(H[95]=p("span",{class:"cs-icon"},"🚧",-1)),p("span",_ce,N(T(n)("app.comingSoon")),1)])):(C(),je(EK,{key:2,ref_key:"conversationPaneRef",ref:mt,mobile:T(o),modern:T(t).theme.value==="modern"||T(t).theme.value==="kimi",turns:T(t).turns.value,"session-id":T(t).activeSessionId.value,approvals:T(t).pendingApprovals.value,changes:T(t).changes.value,"git-info":T(t).gitInfo.value,tasks:T(t).tasks.value,todos:T(t).todos.value,goal:T(t).goal.value,swarms:T(t).swarms.value,"activation-badges":T(t).activationBadges.value,status:T(t).status.value,thinking:T(t).thinking.value,"plan-mode":T(t).planMode.value,"swarm-mode":T(t).swarmMode.value,"goal-mode":T(t).goalMode.value,models:T(t).models.value,"starred-ids":T(t).starredModelIds.value,skills:T(t).skills.value,questions:T(t).questions.value,running:c.value,queued:T(t).queued.value,"search-files":T(t).searchFiles,"upload-image":T(t).uploadImage,sending:T(t).isSending.value,"fast-moon":T(t).fastMoon.value,"file-reload-key":T(t).activeSessionId.value,"session-loading":T(t).sessionLoading.value,compaction:T(t).compaction.value,"has-more-messages":T(t).hasMoreMessages.value,"loading-more":T(t).loadingMoreMessages.value,"loading-more-error":T(t).loadMoreMessagesError.value,"load-older-messages":T(t).loadOlderMessages,"workspace-name":T(t).visibleWorkspace.value?.name,"workspace-root":T(t).visibleWorkspace.value?.root??T(t).status.value.cwd,"git-diff-stats":T(t).gitDiffStats.value,workspaces:T(t).workspacesView.value,"active-workspace-id":T(t).activeWorkspaceId.value,"session-title":l.value,pr:T(t).activePullRequest.value,"beta-toc":T(t).betaToc.value,onOpenChanges:H[16]||(H[16]=Q=>T(de)()),onSelectWorkspace:H[17]||(H[17]=Q=>He(Q)),onAddWorkspace:H[18]||(H[18]=Q=>_n.value=!0),onOpenPr:it,onSubmit:H[19]||(H[19]=Q=>Ie(Q)),onSteer:H[20]||(H[20]=Q=>T(t).steerPrompt(Q.text,Q.attachments)),onApproval:H[21]||(H[21]=(Q,Ce)=>T(t).respondApproval(Q,Ce)),onCancelTask:H[22]||(H[22]=Q=>T(t).cancelTask(Q)),onAnswer:H[23]||(H[23]=(Q,Ce)=>T(t).respondQuestion(Q,Ce)),onDismiss:H[24]||(H[24]=Q=>T(t).dismissQuestion(Q)),onCommand:Ns,onInterrupt:H[25]||(H[25]=Q=>T(t).abortCurrentPrompt()),onUnqueue:gn,onEditQueued:vn,onSetPermission:H[26]||(H[26]=Q=>T(t).setPermission(Q)),onSetThinking:H[27]||(H[27]=Q=>T(t).setThinking(Q)),onTogglePlan:H[28]||(H[28]=Q=>T(t).togglePlanMode()),onToggleSwarm:H[29]||(H[29]=Q=>T(t).toggleSwarmMode()),onToggleGoal:H[30]||(H[30]=Q=>T(t).toggleGoalMode()),onCreateGoal:H[31]||(H[31]=Q=>T(t).createGoal(Q)),onControlGoal:H[32]||(H[32]=Q=>T(t).controlGoal(Q)),onRefreshGitStatus:H[33]||(H[33]=Q=>T(t).activeSessionId.value&&T(t).loadGitStatus(T(t).activeSessionId.value)),onRenameSession:H[34]||(H[34]=(Q,Ce)=>T(t).renameSession(Q,Ce)),onForkSession:H[35]||(H[35]=Q=>T(t).forkSession(Q)),onArchiveSession:H[36]||(H[36]=Q=>T(t).archiveSession(Q)),onCompact:H[37]||(H[37]=Q=>T(t).compact()),onPickModel:H[38]||(H[38]=Q=>Un()),onSelectModel:H[39]||(H[39]=Q=>T(t).setModel(Q)),onOpenFile:H[40]||(H[40]=Q=>T(z)(Q)),onOpenMedia:H[41]||(H[41]=Q=>T(ie)(Q)),onOpenThinking:H[42]||(H[42]=Q=>T(K)(Q)),onOpenCompaction:H[43]||(H[43]=Q=>T(X)(Q)),onOpenAgent:H[44]||(H[44]=Q=>T(ue)(Q)),onEditMessage:es},null,8,["mobile","modern","turns","session-id","approvals","changes","git-info","tasks","todos","goal","swarms","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","running","queued","search-files","upload-image","sending","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","beta-toc"])),T(Xe)&&!T(o)?(C(),je(sk,{key:4,"storage-key":T(Pe),"default-width":T(Ne),min:T(We),max:T(me),reverse:"","aria-label":T(n)("layout.resizePreviewAria"),"onUpdate:width":H[45]||(H[45]=Q=>be.value=Q),"onUpdate:dragging":H[46]||(H[46]=Q=>ot.value=Q)},null,8,["storage-key","default-width","min","max","aria-label"])):ce("",!0),!T(o)||T(Xe)?(C(),E("aside",{key:5,class:$e(["global-preview",{open:T(Xe),mobile:T(o),"no-anim":T(ot)}]),role:"complementary","aria-label":T(n)("layout.detailPanelAria"),"aria-hidden":!T(Xe)},[L.value==="thinking"&&T(fe)?(C(),je(V_,{key:0,text:T(Se)??"",onClose:T(Z)},null,8,["text","onClose"])):L.value==="compaction"&&T(D)?(C(),je(V_,{key:1,text:T(pe)??"",subtitle:T(n)("conversation.summaryTitle"),onClose:T(oe)},null,8,["text","subtitle","onClose"])):L.value==="agent"&&T(te)?(C(),je(lY,{key:2,member:T(te),onClose:T(U)},null,8,["member","onClose"])):L.value==="btw"&&T(le)?(C(),je(kY,{key:3,turns:T(t).sideChatTurns.value,running:T(t).sideChatRunning.value,sending:T(t).sideChatSending.value,onSend:H[47]||(H[47]=Q=>T(t).sendSideChatPrompt(Q)),onClose:T(ze)},null,8,["turns","running","sending","onClose"])):L.value==="diff"?(C(),je(uX,{key:4,mode:T(q),changes:T(t).changes.value,"git-info":T(t).gitInfo.value,"file-diff":T(t).fileDiff.value,"selected-diff-path":T(t).selectedDiffPath.value,"file-diff-loading":T(t).fileDiffLoading.value,closable:"",onOpen:T(Me),onBack:H[48]||(H[48]=Q=>{q.value="list",J.value=null,T(t).clearFileDiff()}),onClose:T(ge)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):L.value==="file"?(C(),je(HG,{key:5,file:T(P),loading:T(B),error:T(R),line:T(O)?.line,"download-url":T(W),closable:"","external-actions":T(V),"open-file":T(z),onClose:T(ae),onOpenExternal:T(re),onReveal:T(Te)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ce("",!0)],10,wce)):ce("",!0),fn.value?(C(),je(DX,{key:6,models:T(t).models.value,current:T(t).status.value.modelId,"starred-ids":T(t).starredModelIds.value,loading:bs.value,unavailable:$s.value,onSelect:H[49]||(H[49]=Q=>Gt(Q)),onToggleStar:H[50]||(H[50]=Q=>T(t).toggleStarModel(Q)),onClose:H[51]||(H[51]=Q=>fn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ce("",!0),On.value?(C(),je(Vee,{key:7,theme:T(t).theme.value,"color-scheme":T(t).colorScheme.value,"ui-font-size":T(t).uiFontSize.value,"auth-ready":T(t).authReady.value,"account-model":T(t).defaultModel.value,notify:T(t).notifyOnComplete.value,"notify-permission":T(t).notifyPermission.value,"beta-toc":T(t).betaToc.value,config:T(t).config.value,models:T(t).models.value,"config-saving":on.value,"server-version":T(t).serverVersion.value,onSetTheme:H[52]||(H[52]=Q=>T(t).setTheme(Q)),onSetColorScheme:H[53]||(H[53]=Q=>T(t).setColorScheme(Q)),onSetUiFontSize:H[54]||(H[54]=Q=>T(t).setUiFontSize(Q)),onSetNotify:H[55]||(H[55]=Q=>T(t).setNotifyOnComplete(Q)),onSetBetaToc:H[56]||(H[56]=Q=>T(t).setBetaToc(Q)),onUpdateConfig:H[57]||(H[57]=Q=>zs(Q)),onLogin:H[58]||(H[58]=()=>{On.value=!1,$n()}),onLogout:T(t).logout,onOpenOnboarding:H[59]||(H[59]=()=>{On.value=!1,S()}),onClose:H[60]||(H[60]=Q=>On.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-permission","beta-toc","config","models","config-saving","server-version","onLogout"])):ce("",!0),un.value?(C(),je(TZ,{key:8,providers:T(t).providers.value,loading:Jn.value,unavailable:wn.value,onAdd:H[61]||(H[61]=Q=>js(Q)),onRefresh:H[62]||(H[62]=Q=>co(Q)),onDelete:H[63]||(H[63]=Q=>Po(Q)),onOpenLogin:H[64]||(H[64]=()=>{un.value=!1,$n()}),onClose:H[65]||(H[65]=Q=>un.value=!1)},null,8,["providers","loading","unavailable"])):ce("",!0),Pt.value?(C(),je(TQ,{key:9,"recent-cwds":T(t).recentCwds.value,onCreate:H[66]||(H[66]=({cwd:Q,title:Ce})=>{Pt.value=!1,T(t).createSession(Q,{title:Ce})}),onClose:H[67]||(H[67]=Q=>Pt.value=!1)},null,8,["recent-cwds"])):ce("",!0),Gn.value?(C(),je(dte,{key:10,sessions:T(t).sessions.value,"workspace-groups":T(t).workspaceGroups.value,"attention-by-session":T(t).attentionBySession.value,"active-id":T(t).activeSessionId.value,onSelect:H[68]||(H[68]=Q=>{T(t).selectSession(Q),Gn.value=!1}),onClose:H[69]||(H[69]=Q=>Gn.value=!1)},null,8,["sessions","workspace-groups","attention-by-session","active-id"])):ce("",!0),In.value?(C(),je(ane,{key:11,status:T(t).status.value,thinking:T(t).thinking.value,"plan-mode":T(t).planMode.value,"swarm-mode":T(t).swarmMode.value,"cost-usd":T(t).sessionCost.value,onClose:H[70]||(H[70]=Q=>In.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ce("",!0),_n.value?(C(),je(Vte,{key:12,"browse-fs":T(t).browseFs,"get-fs-home":T(t).getFsHome,"default-path":T(t).visibleWorkspace.value?.root??T(t).status.value.cwd,onAdd:H[71]||(H[71]=Q=>ve(Q)),onClose:ne},null,8,["browse-fs","get-fs-home","default-path"])):ce("",!0),kt(Ei,{name:"gload-fade"},{default:xn(()=>[T(t).initialized.value?ce("",!0):(C(),je(Poe,{key:0}))]),_:1}),f.value&&!T(d)?(C(),je(Ioe,{key:13,theme:T(t).theme.value,onSetTheme:H[72]||(H[72]=Q=>T(t).setTheme(Q)),onComplete:y,onSkip:y},null,8,["theme"])):ce("",!0),kt(bne,{warnings:T(t).warnings.value,onDismiss:T(t).dismissWarning},null,8,["warnings","onDismiss"]),T(s)?(C(),je(fie,{key:14})):ce("",!0),T(o)?(C(),je(lse,{key:15,modelValue:i.value,"onUpdate:modelValue":H[73]||(H[73]=Q=>i.value=Q),groups:T(t).workspaceGroups.value,"active-workspace-id":T(t).activeWorkspaceId.value,"active-id":T(t).activeSessionId.value,"attention-by-session":T(t).attentionBySession.value,"attention-by-workspace":T(t).attentionByWorkspace.value,onSelect:H[74]||(H[74]=Q=>T(t).selectSession(Q)),onCreate:Ee,onCreateInWorkspace:H[75]||(H[75]=Q=>He(Q)),onAddWorkspace:H[76]||(H[76]=Q=>_n.value=!0),onRename:H[77]||(H[77]=(Q,Ce)=>T(t).renameSession(Q,Ce)),onArchive:H[78]||(H[78]=Q=>T(t).archiveSession(Q)),onDeleteWorkspace:H[79]||(H[79]=Q=>T(t).deleteWorkspace(Q))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ce("",!0),T(o)?(C(),je(coe,{key:16,modelValue:r.value,"onUpdate:modelValue":H[80]||(H[80]=Q=>r.value=Q),status:T(t).status.value,thinking:T(t).thinking.value,"plan-mode":T(t).planMode.value,"swarm-mode":T(t).swarmMode.value,theme:T(t).theme.value,"color-scheme":T(t).colorScheme.value,"ui-font-size":T(t).uiFontSize.value,"auth-ready":T(t).authReady.value,"beta-toc":T(t).betaToc.value,"server-version":T(t).serverVersion.value,onPickModel:H[81]||(H[81]=Q=>Un()),onSetThinking:H[82]||(H[82]=Q=>T(t).setThinking(Q)),onTogglePlan:H[83]||(H[83]=Q=>T(t).togglePlanMode()),onToggleSwarm:H[84]||(H[84]=Q=>T(t).toggleSwarmMode()),onSetPermission:H[85]||(H[85]=Q=>T(t).setPermission(Q)),onSetTheme:H[86]||(H[86]=Q=>T(t).setTheme(Q)),onSetColorScheme:H[87]||(H[87]=Q=>T(t).setColorScheme(Q)),onSetUiFontSize:H[88]||(H[88]=Q=>T(t).setUiFontSize(Q)),onSetBetaToc:H[89]||(H[89]=Q=>T(t).setBetaToc(Q)),onLogin:H[90]||(H[90]=()=>{r.value=!1,$n()}),onLogout:T(t).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):ce("",!0)],6)),Ge.value?(C(),je(iQ,{key:2,"on-start-o-auth-login":uo,"on-poll-o-auth-login":fo,"on-cancel-o-auth-login":wt,onSuccess:ho,onClose:H[91]||(H[91]=Q=>Ge.value=!1)})):ce("",!0)]))}}),Cce=_t(Sce,[["__scopeId","data-v-d2222aaa"]]);YQ();Kd(Cce).use(Ln).mount("#app");export{rM as $,Qce as A,XM as B,Dn as C,Tue as D,Ew as E,Le as F,gr as G,vt as H,kt as I,EM as J,Xce as K,ii as L,Je as M,w4 as N,tue as O,nue as P,iue as Q,Ad as R,Xl as S,qce as T,sue as U,d1 as V,eue as W,Aue as X,oue as Y,_ue as Z,Tce as _,s2 as a,ms as a$,ys as a0,Gg as a1,Pce as a2,e1 as a3,VA as a4,Xt as a5,pa as a6,Wce as a7,Nue as a8,Vce as a9,a2 as aA,lA as aB,hA as aC,ln as aD,fA as aE,dA as aF,Yg as aG,uA as aH,Ut as aI,n1 as aJ,OM as aK,C as aL,k4 as aM,Fce as aN,pn as aO,Vw as aP,Bce as aQ,Ld as aR,Qs as aS,Id as aT,se as aU,mue as aV,D4 as aW,Qe as aX,Gl as aY,mA as aZ,Zce as a_,Yce as aa,Gce as ab,Kce as ac,vue as ad,Lue as ae,Bt as af,QA as ag,Wf as ah,cr as ai,Oi as aj,Fn as ak,gue as al,eo as am,mr as an,rr as ao,aue as ap,cue as aq,en as ar,gt as as,s4 as at,$e as au,xce as av,Dt as aw,rA as ax,cA as ay,lo as az,Dce as b,oB as b$,Cue as b0,Mc as b1,Fd as b2,wue as b3,pr as b4,xM as b5,Ace as b6,ll as b7,WM as b8,Sue as b9,Tn as bA,Uo as bB,JA as bC,kue as bD,Ve as bE,qM as bF,Uce as bG,jM as bH,due as bI,xn as bJ,rue as bK,Lt as bL,Eo as bM,yue as bN,Ze as bO,Hce as bP,Zt as bQ,Js as bR,Hue as bS,KB as bT,Mx as bU,Uue as bV,P9 as bW,Q1 as bX,Wue as bY,kg as bZ,que as b_,Mce as ba,N as bb,ad as bc,Jce as bd,Rt as be,Nce as bf,$ce as bg,Ice as bh,pue as bi,Ece as bj,T as bk,Gc as bl,Iue as bm,Mue as bn,C4 as bo,jce as bp,fue as bq,UM as br,Eue as bs,lue as bt,zce as bu,n2 as bv,zd as bw,N4 as bx,G2 as by,Vd as bz,bue as c,sB as c0,Sx as c1,nB as c2,Due as c3,$9 as c4,Rue as c5,tB as c6,zue as c7,zx as c8,kf as c9,Ux as ca,Vue as cb,jue as cc,Fue as cd,xo as ce,Pue as cf,Bue as cg,jx as ch,Wx as ci,zF as cj,Oue as ck,hue as d,ur as e,Lce as f,Ei as g,$ue as h,Oce as i,Rce as j,Lo as k,zc as l,Kn as m,Lf as n,Pi as o,xue as p,j as q,Kd as r,je as s,ce as t,E as u,p as v,DA as w,uue as x,RA as y,B4 as z};
|