@moonshot-ai/kimi-code 0.22.3 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.mjs +1802 -730
- package/dist-web/assets/{CodeBlockNode--K4eRmNh.js → CodeBlockNode-Bi8jIiGS.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-8z4SytTj.js → CodeBlockShell.vue_vue_type_style_index_0_lang-B0EX64Fy.js} +1 -1
- package/dist-web/assets/DesignSystemView-CxzrbiS1.css +1 -0
- package/dist-web/assets/DesignSystemView-uZVLgoX6.js +12 -0
- package/dist-web/assets/{Tooltip-sFOhW5c-.js → Tooltip-BvXZgTKH.js} +1 -1
- package/dist-web/assets/{arc-b1f-JaXG.js → arc-Dq8eiFQP.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-DRV073hL.js → architectureDiagram-3BPJPVTR-b6nIVGZD.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-BG0TxS08.js → blockDiagram-GPEHLZMM-B3B2WOkj.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-CsocakY-.js → c4Diagram-AAUBKEIU-BKyN3yLu.js} +1 -1
- package/dist-web/assets/channel-DYPbvBMu.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-D7mBRhm2.js → chunk-2J33WTMH-HN_s9nzs.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-BMOSnPC4.js → chunk-4BX2VUAB-fxHwG6FR.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DH7ZU8ec.js → chunk-55IACEB6-D-XDLZ_9.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-CaYu9Tne.js → chunk-727SXJPM-BdVZmbdu.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-Dd2oKOPL.js → chunk-AQP2D5EJ-C0q5GUyy.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-JdHZqUnV.js → chunk-FMBD7UC4-BHvs9p4D.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-DBm1Ahcp.js → chunk-ND2GUHAM-BCuwZrYk.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-DmqufK50.js → chunk-QZHKN3VN-sdMQprxY.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-7hR3h9FG.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-7hR3h9FG.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-HNWFCNh9.js → cose-bilkent-S5V4N54A-DAKVyg0y.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-Dv6WU7Ym.js → dagre-BM42HDAG-fE0QBWG7.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-DlQ3gFah.js → diagram-2AECGRRQ-DhTfW7BA.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-DdXhz5jN.js → diagram-5GNKFQAL-BFxW-PQU.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-CbAHWTiw.js → diagram-KO2AKTUF-D29F_M5j.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-DhASU77a.js → diagram-LMA3HP47-DVsX1Zqb.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-vyegCtBh.js → diagram-OG6HWLK6-C1xkLsBo.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-u41T2VU1.js → erDiagram-TEJ5UH35-RExHqUHF.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-BlZR3M4a.js → flowDiagram-I6XJVG4X-Bb2CxfqX.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-CBIULxGb.js → ganttDiagram-6RSMTGT7-CPgclO8f.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-C6SGJJUo.js → gitGraphDiagram-PVQCEYII-CkbhTuQx.js} +1 -1
- package/dist-web/assets/index-BBqKjyg_.css +1 -0
- package/dist-web/assets/{index-BNJo44oI.js → index-C20P6k3r.js} +1 -1
- package/dist-web/assets/{index-D3WSVtYV.js → index-CvZ8g4D9.js} +2 -2
- package/dist-web/assets/index-SziNj6Ky.js +292 -0
- package/dist-web/assets/{index10-CizaPNSY.js → index10-C34WriXe.js} +1 -1
- package/dist-web/assets/{index11-C3vBSelg.js → index11-DnWluvv0.js} +1 -1
- package/dist-web/assets/{index5-DCmdgd-c.js → index5-DMfYcwho.js} +1 -1
- package/dist-web/assets/{index6-DeBB3wcO.js → index6-CM7_ALPI.js} +1 -1
- package/dist-web/assets/{index7-D0RS__NS.js → index7-DOz39QJX.js} +1 -1
- package/dist-web/assets/{index8-ByeMRBS0.js → index8-DDNiq5_W.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-BEQeL8qo.js → infoDiagram-5YYISTIA-DhTeo1nz.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BGEkrGOU.js → ishikawaDiagram-YF4QCWOH-C6zNOyfV.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-DAEyZppi.js → journeyDiagram-JHISSGLW-GqHLo20m.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-6nYYByea.js → kanban-definition-UN3LZRKU-COLCFNmp.js} +1 -1
- package/dist-web/assets/{linear-RPDuZEc_.js → linear-BNWcliWU.js} +1 -1
- package/dist-web/assets/{mermaid.core-CmwZMEVS.js → mermaid.core-Dvwdy-Wb.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-MLtqKWd1.js → mindmap-definition-RKZ34NQL-MmqWhMt1.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-Bfifo7At.js → pieDiagram-4H26LBE5-D2HeVweL.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DZRwxAP7.js → quadrantDiagram-W4KKPZXB-D0Gnhh0w.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-lazNkbiM.js → requirementDiagram-4Y6WPE33-DV_rvSe0.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-D4yxPAzq.js → sankeyDiagram-5OEKKPKP-CIOHPqwt.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-D7Cjzr6g.js → sequenceDiagram-3UESZ5HK-OMPW2dQZ.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-0z8M0BXQ.js → stateDiagram-AJRCARHV-DGC2N7WX.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BWIlZ-Ms.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-Cfxia7fX.js → timeline-definition-PNZ67QCA-DVD8syC3.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-CBtQvJlD.js → vennDiagram-CIIHVFJN-DjolQSRq.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-BJW6XsQa.js → vue.runtime.esm-bundler-DOh9SYil.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-lhlQsxcl.js → wardley-L42UT6IY-4aEVZF_y.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-CNRYkXLH.js → wardleyDiagram-YWT4CUSO-CMJ7T5Da.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-mUzDW-MM.js → xychartDiagram-2RQKCTM6-SWdAUpzG.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +8 -8
- package/dist-web/assets/DesignSystemView-BskvdBnn.css +0 -1
- package/dist-web/assets/DesignSystemView-gstQZ6Dp.js +0 -12
- package/dist-web/assets/channel-Cwe7TdNc.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-CQ4_AXuT.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CQ4_AXuT.js +0 -1
- package/dist-web/assets/index-CK7yaL8y.js +0 -279
- package/dist-web/assets/index-D0u_059j.css +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-lF1PY-XM.js +0 -1
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-gstQZ6Dp.js","assets/DesignSystemView-BskvdBnn.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode--K4eRmNh.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-8z4SytTj.js","assets/index8-ByeMRBS0.js","assets/index11-C3vBSelg.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function Vp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const zt={},za=[],Js=()=>{},pC=()=>!1,Ju=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Kp=e=>e.startsWith("onUpdate:"),pn=Object.assign,q1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},vE=Object.prototype.hasOwnProperty,sn=(e,t)=>vE.call(e,t),yt=Array.isArray,Ua=e=>mc(e)==="[object Map]",Xl=e=>mc(e)==="[object Set]",sb=e=>mc(e)==="[object Date]",yE=e=>mc(e)==="[object RegExp]",At=e=>typeof e=="function",yn=e=>typeof e=="string",Ps=e=>typeof e=="symbol",rn=e=>e!==null&&typeof e=="object",j1=e=>(rn(e)||At(e))&&At(e.then)&&At(e.catch),hC=Object.prototype.toString,mc=e=>hC.call(e),kE=e=>mc(e).slice(8,-1),Gp=e=>mc(e)==="[object Object]",Yp=e=>yn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Bl=Vp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Xp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},bE=/-\w/g,vo=Xp(e=>e.replace(bE,t=>t.slice(1).toUpperCase())),_E=/\B([A-Z])/g,fs=Xp(e=>e.replace(_E,"-$1").toLowerCase()),Qp=Xp(e=>e.charAt(0).toUpperCase()+e.slice(1)),wf=Xp(e=>e?`on${Qp(e)}`:""),Eo=(e,t)=>!Object.is(e,t),qa=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},mC=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Zp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Uf=e=>{const t=yn(e)?Number(e):NaN;return isNaN(t)?e:t};let ib;const Jp=()=>ib||(ib=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),wE="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",SE=Vp(wE);function Gt(e){if(yt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=yn(o)?TE(o):Gt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(yn(e)||rn(e))return e}const CE=/;(?![^(]*\))/g,xE=/:([^]+)/,AE=/\/\*[^]*?\*\//g;function TE(e){const t={};return e.replace(AE,"").split(CE).forEach(n=>{if(n){const o=n.split(xE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Re(e){let t="";if(yn(e))t=e;else if(yt(e))for(let n=0;n<e.length;n++){const o=Re(e[n]);o&&(t+=o+" ")}else if(rn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Jfe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!yn(t)&&(e.class=Re(t)),n&&(e.style=Gt(n)),e}const ME="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",EE=Vp(ME);function gC(e){return!!e||e===""}function IE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=tr(e[o],t[o]);return n}function tr(e,t){if(e===t)return!0;let n=sb(e),o=sb(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=Ps(e),o=Ps(t),n||o)return e===t;if(n=yt(e),o=yt(t),n||o)return n&&o?IE(e,t):!1;if(n=rn(e),o=rn(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!tr(e[r],t[r]))return!1}}return String(e)===String(t)}function eh(e,t){return e.findIndex(n=>tr(n,t))}const vC=e=>!!(e&&e.__v_isRef===!0),R=e=>yn(e)?e:e==null?"":yt(e)||rn(e)&&(e.toString===hC||!At(e.toString))?vC(e)?R(e.value):JSON.stringify(e,yC,2):String(e),yC=(e,t)=>vC(t)?yC(e,t.value):Ua(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[zm(o,i)+" =>"]=s,n),{})}:Xl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>zm(n))}:Ps(t)?zm(t):rn(t)&&!yt(t)&&!Gp(t)?String(t):t,zm=(e,t="")=>{var n;return Ps(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function $E(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 go;class kC{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&&go&&(go.active?(this.parent=go,this.index=(go.scopes||(go.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=go;try{return go=this,t()}finally{go=n}}}on(){++this._on===1&&(this.prevScope=go,go=this)}off(){if(this._on>0&&--this._on===0){if(go===this)go=this.prevScope;else{let t=go;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function NE(e){return new kC(e)}function V1(){return go}function K1(e,t=!1){go&&go.cleanups.push(e)}let Tn;const Um=new WeakSet;class qf{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,go&&(go.active?go.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Um.has(this)&&(Um.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||_C(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rb(this),wC(this);const t=Tn,n=pi;Tn=this,pi=!0;try{return this.fn()}finally{SC(this),Tn=t,pi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)X1(t);this.deps=this.depsTail=void 0,rb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Um.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){kv(this)&&this.run()}get dirty(){return kv(this)}}let bC=0,iu,ru;function _C(e,t=!1){if(e.flags|=8,t){e.next=ru,ru=e;return}e.next=iu,iu=e}function G1(){bC++}function Y1(){if(--bC>0)return;if(ru){let t=ru;for(ru=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;iu;){let t=iu;for(iu=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function wC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function SC(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),X1(o),LE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function kv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(CC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function CC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===xu)||(e.globalVersion=xu,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!kv(e))))return;e.flags|=2;const t=e.dep,n=Tn,o=pi;Tn=e,pi=!0;try{wC(e);const s=e.fn(e._value);(t.version===0||Eo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Tn=n,pi=o,SC(e),e.flags&=-3}}function X1(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)X1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function LE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function epe(e,t){e.effect instanceof qf&&(e=e.effect.fn);const n=new qf(e);t&&pn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function tpe(e){e.effect.stop()}let pi=!0;const xC=[];function nr(){xC.push(pi),pi=!1}function or(){const e=xC.pop();pi=e===void 0?!0:e}function rb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Tn;Tn=void 0;try{t()}finally{Tn=n}}}let xu=0;class OE{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 th{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(!Tn||!pi||Tn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Tn)n=this.activeLink=new OE(Tn,this),Tn.deps?(n.prevDep=Tn.depsTail,Tn.depsTail.nextDep=n,Tn.depsTail=n):Tn.deps=Tn.depsTail=n,AC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Tn.depsTail,n.nextDep=void 0,Tn.depsTail.nextDep=n,Tn.depsTail=n,Tn.deps===n&&(Tn.deps=o)}return n}trigger(t){this.version++,xu++,this.notify(t)}notify(t){G1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Y1()}}}function AC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)AC(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const jf=new WeakMap,Fl=Symbol(""),bv=Symbol(""),Au=Symbol("");function Ho(e,t,n){if(pi&&Tn){let o=jf.get(e);o||jf.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new th),s.map=o,s.key=n),s.track()}}function Ki(e,t,n,o,s,i){const r=jf.get(e);if(!r){xu++;return}const l=a=>{a&&a.trigger()};if(G1(),t==="clear")r.forEach(l);else{const a=yt(e),c=a&&Yp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,p)=>{(p==="length"||p===Au||!Ps(p)&&p>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Au)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Fl)),Ua(e)&&l(r.get(bv)));break;case"delete":a||(l(r.get(Fl)),Ua(e)&&l(r.get(bv)));break;case"set":Ua(e)&&l(r.get(Fl));break}}Y1()}function PE(e,t){const n=jf.get(e);return n&&n.get(t)}function ya(e){const t=Kt(e);return t===e?t:(Ho(t,"iterate",Au),Ms(e)?t:t.map(mi))}function nh(e){return Ho(e=Kt(e),"iterate",Au),e}function Ii(e,t){return sr(e)?sc(Wr(e)?mi(t):t):mi(t)}const RE={__proto__:null,[Symbol.iterator](){return qm(this,Symbol.iterator,e=>Ii(this,e))},concat(...e){return ya(this).concat(...e.map(t=>yt(t)?ya(t):t))},entries(){return qm(this,"entries",e=>(e[1]=Ii(this,e[1]),e))},every(e,t){return Hi(this,"every",e,t,void 0,arguments)},filter(e,t){return Hi(this,"filter",e,t,n=>n.map(o=>Ii(this,o)),arguments)},find(e,t){return Hi(this,"find",e,t,n=>Ii(this,n),arguments)},findIndex(e,t){return Hi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Hi(this,"findLast",e,t,n=>Ii(this,n),arguments)},findLastIndex(e,t){return Hi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Hi(this,"forEach",e,t,void 0,arguments)},includes(...e){return jm(this,"includes",e)},indexOf(...e){return jm(this,"indexOf",e)},join(e){return ya(this).join(e)},lastIndexOf(...e){return jm(this,"lastIndexOf",e)},map(e,t){return Hi(this,"map",e,t,void 0,arguments)},pop(){return Wc(this,"pop")},push(...e){return Wc(this,"push",e)},reduce(e,...t){return lb(this,"reduce",e,t)},reduceRight(e,...t){return lb(this,"reduceRight",e,t)},shift(){return Wc(this,"shift")},some(e,t){return Hi(this,"some",e,t,void 0,arguments)},splice(...e){return Wc(this,"splice",e)},toReversed(){return ya(this).toReversed()},toSorted(e){return ya(this).toSorted(e)},toSpliced(...e){return ya(this).toSpliced(...e)},unshift(...e){return Wc(this,"unshift",e)},values(){return qm(this,"values",e=>Ii(this,e))}};function qm(e,t,n){const o=nh(e),s=o[t]();return o!==e&&!Ms(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const DE=Array.prototype;function Hi(e,t,n,o,s,i){const r=nh(e),l=r!==e&&!Ms(e),a=r[t];if(a!==DE[t]){const d=a.apply(e,i);return l?mi(d):d}let c=n;r!==e&&(l?c=function(d,p){return n.call(this,Ii(e,d),p,e)}:n.length>2&&(c=function(d,p){return n.call(this,d,p,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function lb(e,t,n,o){const s=nh(e),i=s!==e&&!Ms(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=Ii(e,c)),n.call(this,c,Ii(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?Ii(e,a):a}function jm(e,t,n){const o=Kt(e);Ho(o,"iterate",Au);const s=o[t](...n);return(s===-1||s===!1)&&ih(n[0])?(n[0]=Kt(n[0]),o[t](...n)):s}function Wc(e,t,n=[]){nr(),G1();const o=Kt(e)[t].apply(e,n);return Y1(),or(),o}const BE=Vp("__proto__,__v_isRef,__isVue"),TC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ps));function FE(e){Ps(e)||(e=String(e));const t=Kt(this);return Ho(t,"has",e),t.hasOwnProperty(e)}class MC{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?OC:LC:i?NC:$C).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=yt(t);if(!s){let a;if(r&&(a=RE[n]))return a;if(n==="hasOwnProperty")return FE}const l=Reflect.get(t,n,eo(t)?t:o);if((Ps(n)?TC.has(n):BE(n))||(s||Ho(t,"get",n),i))return l;if(eo(l)){const a=r&&Yp(n)?l:l.value;return s&&rn(a)?Vf(a):a}return rn(l)?s?Vf(l):No(l):l}}class EC extends MC{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=yt(t)&&Yp(n);if(!this._isShallow){const c=sr(i);if(!Ms(o)&&!sr(o)&&(i=Kt(i),o=Kt(o)),!r&&eo(i)&&!eo(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:sn(t,n),a=Reflect.set(t,n,o,eo(t)?t:s);return t===Kt(s)&&(l?Eo(o,i)&&Ki(t,"set",n,o):Ki(t,"add",n,o)),a}deleteProperty(t,n){const o=sn(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Ki(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!Ps(n)||!TC.has(n))&&Ho(t,"has",n),o}ownKeys(t){return Ho(t,"iterate",yt(t)?"length":Fl),Reflect.ownKeys(t)}}class IC extends MC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const HE=new EC,WE=new IC,zE=new EC(!0),UE=new IC(!0),_v=e=>e,Hd=e=>Reflect.getPrototypeOf(e);function qE(e,t,n){return function(...o){const s=this.__v_raw,i=Kt(s),r=Ua(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?_v:t?sc:mi;return!t&&Ho(i,"iterate",a?bv:Fl),pn(Object.create(c),{next(){const{value:d,done:p}=c.next();return p?{value:d,done:p}:{value:l?[u(d[0]),u(d[1])]:u(d),done:p}}})}}function Wd(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function jE(e,t){const n={get(s){const i=this.__v_raw,r=Kt(i),l=Kt(s);e||(Eo(s,l)&&Ho(r,"get",s),Ho(r,"get",l));const{has:a}=Hd(r),c=t?_v:e?sc:mi;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&Ho(Kt(s),"iterate",Fl),s.size},has(s){const i=this.__v_raw,r=Kt(i),l=Kt(s);return e||(Eo(s,l)&&Ho(r,"has",s),Ho(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=Kt(l),c=t?_v:e?sc:mi;return!e&&Ho(a,"iterate",Fl),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return pn(n,e?{add:Wd("add"),set:Wd("set"),delete:Wd("delete"),clear:Wd("clear")}:{add(s){const i=Kt(this),r=Hd(i),l=Kt(s),a=!t&&!Ms(s)&&!sr(s)?l:s;return r.has.call(i,a)||Eo(s,a)&&r.has.call(i,s)||Eo(l,a)&&r.has.call(i,l)||(i.add(a),Ki(i,"add",a,a)),this},set(s,i){!t&&!Ms(i)&&!sr(i)&&(i=Kt(i));const r=Kt(this),{has:l,get:a}=Hd(r);let c=l.call(r,s);c||(s=Kt(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?Eo(i,u)&&Ki(r,"set",s,i):Ki(r,"add",s,i),this},delete(s){const i=Kt(this),{has:r,get:l}=Hd(i);let a=r.call(i,s);a||(s=Kt(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Ki(i,"delete",s,void 0),c},clear(){const s=Kt(this),i=s.size!==0,r=s.clear();return i&&Ki(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=qE(s,e,t)}),n}function oh(e,t){const n=jE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(sn(n,s)&&s in o?n:o,s,i)}const VE={get:oh(!1,!1)},KE={get:oh(!1,!0)},GE={get:oh(!0,!1)},YE={get:oh(!0,!0)},$C=new WeakMap,NC=new WeakMap,LC=new WeakMap,OC=new WeakMap;function XE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function No(e){return sr(e)?e:sh(e,!1,HE,VE,$C)}function QE(e){return sh(e,!1,zE,KE,NC)}function Vf(e){return sh(e,!0,WE,GE,LC)}function npe(e){return sh(e,!0,UE,YE,OC)}function sh(e,t,n,o,s){if(!rn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=XE(kE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function Wr(e){return sr(e)?Wr(e.__v_raw):!!(e&&e.__v_isReactive)}function sr(e){return!!(e&&e.__v_isReadonly)}function Ms(e){return!!(e&&e.__v_isShallow)}function ih(e){return e?!!e.__v_raw:!1}function Kt(e){const t=e&&e.__v_raw;return t?Kt(t):e}function Dr(e){return!sn(e,"__v_skip")&&Object.isExtensible(e)&&mC(e,"__v_skip",!0),e}const mi=e=>rn(e)?No(e):e,sc=e=>rn(e)?Vf(e):e;function eo(e){return e?e.__v_isRef===!0:!1}function Z(e){return PC(e,!1)}function Ql(e){return PC(e,!0)}function PC(e,t){return eo(e)?e:new ZE(e,t)}class ZE{constructor(t,n){this.dep=new th,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Kt(t),this._value=n?t:mi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Ms(t)||sr(t);t=o?t:Kt(t),Eo(t,n)&&(this._rawValue=t,this._value=o?t:mi(t),this.dep.trigger())}}function ope(e){e.dep&&e.dep.trigger()}function x(e){return eo(e)?e.value:e}function RC(e){return At(e)?e():x(e)}const JE={get:(e,t,n)=>t==="__v_raw"?e:x(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return eo(s)&&!eo(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function DC(e){return Wr(e)?e:new Proxy(e,JE)}class eI{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new th,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function tI(e){return new eI(e)}function spe(e){const t=yt(e)?new Array(e.length):{};for(const n in e)t[n]=BC(e,n);return t}class nI{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Ps(n)?n:String(n),this._raw=Kt(t);let s=!0,i=t;if(!yt(t)||Ps(this._key)||!Yp(this._key))do s=!ih(i)||Ms(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=x(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&eo(this._raw[this._key])){const n=this._object[this._key];if(eo(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return PE(this._raw,this._key)}}class oI{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 ipe(e,t,n){return eo(e)?e:At(e)?new oI(e):rn(e)&&arguments.length>1?BC(e,t,n):Z(e)}function BC(e,t,n){return new nI(e,t,n)}class sI{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new th(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Tn!==this)return _C(this,!0),!0}get value(){const t=this.dep.track();return CC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function iI(e,t,n=!1){let o,s;return At(e)?o=e:(o=e.get,s=e.set),new sI(o,s,n)}const rpe={GET:"get",HAS:"has",ITERATE:"iterate"},lpe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},zd={},Kf=new WeakMap;let Er;function ape(){return Er}function rI(e,t=!1,n=Er){if(n){let o=Kf.get(n);o||Kf.set(n,o=[]),o.push(e)}}function lI(e,t,n=zt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>s?y:Ms(y)||s===!1||s===0?Gi(y,1):Gi(y);let u,d,p,h,f=!1,m=!1;if(eo(e)?(d=()=>e.value,f=Ms(e)):Wr(e)?(d=()=>c(e),f=!0):yt(e)?(m=!0,f=e.some(y=>Wr(y)||Ms(y)),d=()=>e.map(y=>{if(eo(y))return y.value;if(Wr(y))return c(y);if(At(y))return a?a(y,2):y()})):At(e)?t?d=a?()=>a(e,2):e:d=()=>{if(p){nr();try{p()}finally{or()}}const y=Er;Er=u;try{return a?a(e,3,[h]):e(h)}finally{Er=y}}:d=Js,t&&s){const y=d,A=s===!0?1/0:s;d=()=>Gi(y(),A)}const b=V1(),_=()=>{u.stop(),b&&b.active&&q1(b.effects,u)};if(i&&t){const y=t;t=(...A)=>{y(...A),_()}}let g=m?new Array(e.length).fill(zd):zd;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const A=u.run();if(s||f||(m?A.some((O,$)=>Eo(O,g[$])):Eo(A,g))){p&&p();const O=Er;Er=u;try{const $=[A,g===zd?void 0:m&&g[0]===zd?[]:g,h];g=A,a?a(t,3,$):t(...$)}finally{Er=O}}}else u.run()};return l&&l(v),u=new qf(d),u.scheduler=r?()=>r(v,!1):v,h=y=>rI(y,!1,u),p=u.onStop=()=>{const y=Kf.get(u);if(y){if(a)a(y,4);else for(const A of y)A();Kf.delete(u)}},t?o?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Gi(e,t=1/0,n){if(t<=0||!rn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,eo(e))Gi(e.value,t,n);else if(yt(e))for(let o=0;o<e.length;o++)Gi(e[o],t,n);else if(Xl(e)||Ua(e))e.forEach(o=>{Gi(o,t,n)});else if(Gp(e)){for(const o in e)Gi(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Gi(e[o],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const FC=[];function aI(e){FC.push(e)}function cI(){FC.pop()}function cpe(e,t){}const upe={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"},uI={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 ed(e,t,n,o){try{return o?e(...o):e()}catch(s){gc(s,t,n)}}function ti(e,t,n,o){if(At(e)){const s=ed(e,t,n,o);return s&&j1(s)&&s.catch(i=>{gc(i,t,n)}),s}if(yt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(ti(e[i],t,n,o));return s}}function gc(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||zt;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){nr(),ed(i,null,10,[e,a,c]),or();return}}dI(e,n,s,o,r)}function dI(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const Xo=[];let Ai=-1;const ja=[];let Ir=null,Aa=0;const HC=Promise.resolve();let Gf=null;function ht(e){const t=Gf||HC;return e?t.then(this?e.bind(this):e):t}function fI(e){let t=Ai+1,n=Xo.length;for(;t<n;){const o=t+n>>>1,s=Xo[o],i=Tu(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function Q1(e){if(!(e.flags&1)){const t=Tu(e),n=Xo[Xo.length-1];!n||!(e.flags&2)&&t>=Tu(n)?Xo.push(e):Xo.splice(fI(t),0,e),e.flags|=1,WC()}}function WC(){Gf||(Gf=HC.then(zC))}function Yf(e){yt(e)?ja.push(...e):Ir&&e.id===-1?Ir.splice(Aa+1,0,e):e.flags&1||(ja.push(e),e.flags|=1),WC()}function ab(e,t,n=Ai+1){for(;n<Xo.length;n++){const o=Xo[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Xo.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Xf(e){if(ja.length){const t=[...new Set(ja)].sort((n,o)=>Tu(n)-Tu(o));if(ja.length=0,Ir){Ir.push(...t);return}for(Ir=t,Aa=0;Aa<Ir.length;Aa++){const n=Ir[Aa];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ir=null,Aa=0}}const Tu=e=>e.id==null?e.flags&2?-1:1/0:e.id;function zC(e){try{for(Ai=0;Ai<Xo.length;Ai++){const t=Xo[Ai];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ed(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ai<Xo.length;Ai++){const t=Xo[Ai];t&&(t.flags&=-2)}Ai=-1,Xo.length=0,Xf(),Gf=null,(Xo.length||ja.length)&&zC()}}let Ta,Ud=[];function UC(e,t){var n,o;Ta=e,Ta?(Ta.enabled=!0,Ud.forEach(({event:s,args:i})=>Ta.emit(s,...i)),Ud=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{UC(i,t)}),setTimeout(()=>{Ta||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ud=[])},3e3)):Ud=[]}let Lo=null,rh=null;function Mu(e){const t=Lo;return Lo=e,rh=e&&e.type.__scopeId||null,t}function dpe(e){rh=e}function fpe(){rh=null}const ppe=e=>_e;function _e(e,t=Lo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&tp(-1);const i=Mu(t);let r;try{r=e(...s)}finally{Mu(i),o._d&&tp(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Mn(e,t){if(Lo===null)return e;const n=sd(Lo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=zt]=t[s];i&&(At(i)&&(i={mounted:i,updated:i}),i.deep&&Gi(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Mi(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(nr(),ti(a,n,8,[e.el,l,e,t]),or())}}function En(e,t){if(Io){let n=Io.provides;const o=Io.parent&&Io.parent.provides;o===n&&(n=Io.provides=Object.create(o)),n[e]=t}}function Ut(e,t,n=!1){const o=Oo();if(o||Hl){let s=Hl?Hl._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&At(t)?t.call(o&&o.proxy):t}}function hpe(){return!!(Oo()||Hl)}const pI=Symbol.for("v-scx"),hI=()=>Ut(pI);function mI(e,t){return td(e,null,t)}function mpe(e,t){return td(e,null,{flush:"post"})}function gI(e,t){return td(e,null,{flush:"sync"})}function Ke(e,t,n){return td(e,t,n)}function td(e,t,n=zt){const{immediate:o,deep:s,flush:i,once:r}=n,l=pn({},n),a=t&&o||!t&&i!=="post";let c;if(Vl){if(i==="sync"){const h=hI();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=Js,h.resume=Js,h.pause=Js,h}}const u=Io;l.call=(h,f,m)=>ti(h,u,f,m);let d=!1;i==="post"?l.scheduler=h=>{no(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,f)=>{f?h():Q1(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const p=lI(e,t,l);return Vl&&(c?c.push(p):a&&p()),p}function vI(e,t,n){const o=this.proxy,s=yn(e)?e.includes(".")?qC(o,e):()=>o[e]:e.bind(o,o);let i;At(t)?i=t:(i=t.handler,n=t);const r=vc(this),l=td(s,i.bind(o),n);return r(),l}function qC(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const Tr=new WeakMap,jC=Symbol("_vte"),VC=e=>e.__isTeleport,Il=e=>e&&(e.disabled||e.disabled===""),yI=e=>e&&(e.defer||e.defer===""),cb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,ub=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,wv=(e,t)=>{const n=e&&e.to;return yn(n)?t?t(n):null:n},kI={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:p,o:{insert:h,querySelector:f,createText:m,createComment:b,parentNode:_}}=c,g=Il(t.props);let{dynamicChildren:v}=t;const y=($,k,E)=>{$.shapeFlag&16&&u($.children,k,E,s,i,r,l,a)},A=($=t)=>{const k=Il($.props),E=$.target=wv($.props,f),M=Sv(E,$,m,h);E&&(r!=="svg"&&cb(E)?r="svg":r!=="mathml"&&ub(E)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(E),k||(y($,E,M),Qc($,!1)))},O=$=>{const k=()=>{if(Tr.get($)===k){if(Tr.delete($),Il($.props)){const E=_($.el)||n;y($,E,$.anchor),Qc($,!0)}A($)}};Tr.set($,k),no(k,i)};if(e==null){const $=t.el=m(""),k=t.anchor=m("");if(h($,n,o),h(k,n,o),yI(t.props)||i&&i.pendingBranch){O(t);return}g&&(y(t,n,k),Qc(t,!0)),A()}else{t.el=e.el;const $=t.anchor=e.anchor,k=Tr.get(e);if(k){k.flags|=8,Tr.delete(e),O(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,M=t.targetAnchor=e.targetAnchor,L=Il(e.props),S=L?n:E,I=L?$:M;if(r==="svg"||cb(E)?r="svg":(r==="mathml"||ub(E))&&(r="mathml"),v?(p(e.dynamicChildren,v,S,s,i,r,l),a0(e,t,!0)):a||d(e,t,S,I,s,i,r,l,!1),g)L?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):qd(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=t.target=wv(t.props,f);P&&qd(t,P,null,c,0)}else L&&qd(t,E,M,c,1);Qc(t,g)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:p}=e,h=i||!Il(p),f=Tr.get(e);if(f&&(f.flags|=8,Tr.delete(e)),d&&(s(c),s(u)),i&&s(a),!f&&r&16)for(let m=0;m<l.length;m++){const b=l[m];o(b,t,n,h,!!b.dynamicChildren)}},move:qd,hydrate:bI};function qd(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!Tr.has(e)&&(!d||Il(u))&&a&16)for(let p=0;p<c.length;p++)s(c[p],t,n,2);d&&o(l,t,n)}function bI(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function p(b,_){let g=_;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(b,_){_.anchor=d(r(b),_,l(b),n,o,s,i)}const f=t.target=wv(t.props,a),m=Il(t.props);if(f){const b=f._lpa||f.firstChild;t.shapeFlag&16&&(m?(h(e,t),p(f,b),t.targetAnchor||Sv(f,t,u,c,l(e)===f?e:null)):(t.anchor=r(e),p(f,b),t.targetAnchor||Sv(f,t,u,c),d(b&&r(b),t,f,n,o,s,i))),Qc(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const lh=kI;function Qc(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Sv(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[jC]=r,e&&(o(i,e,s),o(r,e,s)),r}const Ks=Symbol("_leaveCb"),zc=Symbol("_enterCb");function KC(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return hn(()=>{e.isMounted=!0}),lo(()=>{e.isUnmounting=!0}),e}const zs=[Function,Array],GC={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:zs,onEnter:zs,onAfterEnter:zs,onEnterCancelled:zs,onBeforeLeave:zs,onLeave:zs,onAfterLeave:zs,onLeaveCancelled:zs,onBeforeAppear:zs,onAppear:zs,onAfterAppear:zs,onAppearCancelled:zs},YC=e=>{const t=e.subTree;return t.component?YC(t.component):t},_I={name:"BaseTransition",props:GC,setup(e,{slots:t}){const n=Oo(),o=KC();return()=>{const s=t.default&&Z1(t.default(),!0),i=s&&s.length?XC(s):n.subTree?ie():void 0;if(!i)return;const r=Kt(e),{mode:l}=r;if(o.isLeaving)return Vm(i);const a=db(i);if(!a)return Vm(i);let c=Eu(a,r,o,n,d=>c=d);a.type!==so&&Vr(a,c);let u=n.subTree&&db(n.subTree);if(u&&u.type!==so&&!ci(u,a)&&YC(n).type!==so){let d=Eu(u,r,o,n);if(Vr(u,d),l==="out-in"&&a.type!==so)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Vm(i);l==="in-out"&&a.type!==so?d.delayLeave=(p,h,f)=>{const m=QC(o,u);m[String(u.key)]=u,p[Ks]=()=>{h(),p[Ks]=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 XC(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==so){t=n;break}}return t}const wI=_I;function QC(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Eu(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:h,onAfterLeave:f,onLeaveCancelled:m,onBeforeAppear:b,onAppear:_,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),A=QC(n,e),O=(E,M)=>{E&&ti(E,o,9,M)},$=(E,M)=>{const L=M[1];O(E,M),yt(E)?E.every(S=>S.length<=1)&&L():E.length<=1&&L()},k={mode:r,persisted:l,beforeEnter(E){let M=a;if(!n.isMounted)if(i)M=b||a;else return;E[Ks]&&E[Ks](!0);const L=A[y];L&&ci(e,L)&&L.el[Ks]&&L.el[Ks](),O(M,[E])},enter(E){if(A[y]===e)return;let M=c,L=u,S=d;if(!n.isMounted)if(i)M=_||c,L=g||u,S=v||d;else return;let I=!1;E[zc]=D=>{I||(I=!0,D?O(S,[E]):O(L,[E]),k.delayedLeave&&k.delayedLeave(),E[zc]=void 0)};const P=E[zc].bind(null,!1);M?$(M,[E,P]):P()},leave(E,M){const L=String(e.key);if(E[zc]&&E[zc](!0),n.isUnmounting)return M();O(p,[E]);let S=!1;E[Ks]=P=>{S||(S=!0,M(),P?O(m,[E]):O(f,[E]),E[Ks]=void 0,A[L]===e&&delete A[L])};const I=E[Ks].bind(null,!1);A[L]=e,h?$(h,[E,I]):I()},clone(E){const M=Eu(E,t,n,o,s);return s&&s(M),M}};return k}function Vm(e){if(nd(e))return e=ir(e),e.children=null,e}function db(e){if(!nd(e))return VC(e.type)&&e.children?XC(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&&At(n.default))return n.default()}}function Vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Z1(e,t=!1,n){let o=[],s=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Le?(r.patchFlag&128&&s++,o=o.concat(Z1(r.children,t,l))):(t||r.type!==so)&&o.push(l!=null?ir(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function je(e,t){return At(e)?pn({name:e.name},t,{setup:e}):e}function gpe(){const e=Oo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function J1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function vpe(e){const t=Oo(),n=Ql(null);if(t){const s=t.refs===zt?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function fb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Qf=new WeakMap;function Va(e,t,n,o,s=!1){if(yt(e)){e.forEach((m,b)=>Va(m,t&&(yt(t)?t[b]:t),n,o,s));return}if(Ji(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Va(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?sd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===zt?l.refs={}:l.refs,d=l.setupState,p=Kt(d),h=d===zt?pC:m=>fb(u,m)?!1:sn(p,m),f=(m,b)=>!(b&&fb(u,b));if(c!=null&&c!==a){if(pb(t),yn(c))u[c]=null,h(c)&&(d[c]=null);else if(eo(c)){const m=t;f(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(At(a))ed(a,l,12,[r,u]);else{const m=yn(a),b=eo(a);if(m||b){const _=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:f()||!e.k?a.value:u[e.k];if(s)yt(g)&&q1(g,i);else if(yt(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];f(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):b&&(f(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{_(),Qf.delete(e)};g.id=-1,Qf.set(e,g),no(g,n)}else pb(e),_()}}}function pb(e){const t=Qf.get(e);t&&(t.flags|=8,Qf.delete(e))}let hb=!1;const ka=()=>{hb||(console.error("Hydration completed but contains mismatches."),hb=!0)},SI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",CI=e=>e.namespaceURI.includes("MathML"),jd=e=>{if(e.nodeType===1){if(SI(e))return"svg";if(CI(e))return"mathml"}},Pa=e=>e.nodeType===8;function xI(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),Xf(),y._vnode=v;return}d(y.firstChild,v,null,null,null),Xf(),y._vnode=v},d=(v,y,A,O,$,k=!1)=>{k=k||!!y.dynamicChildren;const E=Pa(v)&&v.data==="[",M=()=>m(v,y,A,O,$,E),{type:L,ref:S,shapeFlag:I,patchFlag:P}=y;let D=v.nodeType;y.el=v,P===-2&&(k=!1,y.dynamicChildren=null);let W=null;switch(L){case zr:D!==3?y.children===""?(a(y.el=s(""),r(v),v),W=v):W=M():(v.data!==y.children&&(ka(),v.data=y.children),W=i(v));break;case so:g(v)?(W=i(v),_(y.el=v.content.firstChild,v,A)):D!==8||E?W=M():W=i(v);break;case Ga:if(E&&(v=i(v),D=v.nodeType),D===1||D===3){W=v;const z=!y.children.length;for(let q=0;q<y.staticCount;q++)z&&(y.children+=W.nodeType===1?W.outerHTML:W.data),q===y.staticCount-1&&(y.anchor=W),W=i(W);return E?i(W):W}else M();break;case Le:E?W=f(v,y,A,O,$,k):W=M();break;default:if(I&1)(D!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?W=M():W=p(v,y,A,O,$,k);else if(I&6){y.slotScopeIds=$;const z=r(v);if(E?W=b(v):Pa(v)&&v.data==="teleport start"?W=b(v,v.data,"teleport end"):W=i(v),t(y,z,null,A,O,jd(z),k),Ji(y)&&!y.type.__asyncResolved){let q;E?(q=se(Le),q.anchor=W?W.previousSibling:z.lastChild):q=v.nodeType===3?qe(""):se("div"),q.el=v,y.component.subTree=q}}else I&64?D!==8?W=M():W=y.type.hydrate(v,y,A,O,$,k,e,h):I&128&&(W=y.type.hydrate(v,y,A,O,jd(r(v)),$,k,e,d))}return S!=null&&Va(S,null,O,y),W},p=(v,y,A,O,$,k)=>{k=k||!!y.dynamicChildren;const{type:E,props:M,patchFlag:L,shapeFlag:S,dirs:I,transition:P}=y,D=E==="input"||E==="option";if(D||L!==-1){I&&Mi(y,null,A,"created");let W=!1;if(g(v)){W=gx(null,P)&&A&&A.vnode.props&&A.vnode.props.appear;const q=v.content.firstChild;if(W){const Q=q.getAttribute("class");Q&&(q.$cls=Q),P.beforeEnter(q)}_(q,v,A),y.el=v=q}if(S&16&&!(M&&(M.innerHTML||M.textContent))){let q=h(v.firstChild,y,v,A,O,$,k);for(q&&!Vd(v,1)&&ka();q;){const Q=q;q=q.nextSibling,l(Q)}}else if(S&8){let q=y.children;q[0]===`
|
|
15
|
-
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(q=q.slice(1));const{textContent:Q}=v;Q!==q&&Q!==q.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(Vd(v,0)||ka(),v.textContent=y.children)}if(M){if(D||!k||L&48){const q=v.tagName.includes("-");for(const Q in M)(D&&(Q.endsWith("value")||Q==="indeterminate")||Ju(Q)&&!Bl(Q)||Q[0]==="."||q&&!Bl(Q))&&o(v,Q,null,M[Q],void 0,A)}else if(M.onClick)o(v,"onClick",null,M.onClick,void 0,A);else if(L&4&&Wr(M.style))for(const q in M.style)M.style[q]}let z;(z=M&&M.onVnodeBeforeMount)&&as(z,A,y),I&&Mi(y,null,A,"beforeMount"),((z=M&&M.onVnodeMounted)||I||W)&&bx(()=>{z&&as(z,A,y),W&&P.enter(v),I&&Mi(y,null,A,"mounted")},O)}return v.nextSibling},h=(v,y,A,O,$,k,E)=>{E=E||!!y.dynamicChildren;const M=y.children,L=M.length;let S=!1;for(let I=0;I<L;I++){const P=E?M[I]:M[I]=ds(M[I]),D=P.type===zr;v?(D&&!E&&I+1<L&&ds(M[I+1]).type===zr&&(a(s(v.data.slice(P.children.length)),A,i(v)),v.data=P.children),v=d(v,P,O,$,k,E)):D&&!P.children?a(P.el=s(""),A):(S||(S=!0,Vd(A,1)||ka()),n(null,P,A,null,O,$,jd(A),k))}return v},f=(v,y,A,O,$,k)=>{const{slotScopeIds:E}=y;E&&($=$?$.concat(E):E);const M=r(v),L=h(i(v),y,M,A,O,$,k);return L&&Pa(L)&&L.data==="]"?i(y.anchor=L):(ka(),a(y.anchor=c("]"),M,L),L)},m=(v,y,A,O,$,k)=>{if(Vd(v.parentElement,1)||ka(),y.el=null,k){const L=b(v);for(;;){const S=i(v);if(S&&S!==L)l(S);else break}}const E=i(v),M=r(v);return l(v),n(null,y,M,E,A,O,jd(M),$),A&&(A.vnode.el=y.el,uh(A,y.el)),E},b=(v,y="[",A="]")=>{let O=0;for(;v;)if(v=i(v),v&&Pa(v)&&(v.data===y&&O++,v.data===A)){if(O===0)return i(v);O--}return v},_=(v,y,A)=>{const O=y.parentNode;O&&O.replaceChild(v,y);let $=A;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const mb="data-allow-mismatch",AI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Vd(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(mb);)e=e.parentElement;const n=e&&e.getAttribute(mb);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(AI[t])}}const TI=Jp().requestIdleCallback||(e=>setTimeout(e,1)),MI=Jp().cancelIdleCallback||(e=>clearTimeout(e)),ype=(e=1e4)=>t=>{const n=TI(t,{timeout:e});return()=>MI(n)};function EI(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const kpe=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(EI(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},bpe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},_pe=(e=[])=>(t,n)=>{yn(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function II(e,t){if(Pa(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(Pa(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Ji=e=>!!e.type.__asyncLoader;function ui(e){At(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const p=()=>(d++,c=null,h()),h=()=>{let f;return c||(f=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((b,_)=>{a(m,()=>b(p()),()=>_(m),d+1)});throw m}).then(m=>f!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return je({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(f,m,b){let _=!1;(m.bu||(m.bu=[])).push(()=>_=!0);const g=()=>{_||b()},v=i?()=>{const y=i(g,A=>II(f,A));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const f=Io;if(J1(f),u)return()=>Kd(u,f);const m=v=>{c=null,gc(v,f,13,!o)};if(l&&f.suspense||Vl)return h().then(v=>()=>Kd(v,f)).catch(v=>(m(v),()=>o?se(o,{error:v}):null));const b=Z(!1),_=Z(),g=Z(!!s);return s&&setTimeout(()=>{g.value=!1},s),r!=null&&setTimeout(()=>{if(!b.value&&!_.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),_.value=v}},r),h().then(()=>{b.value=!0,f.parent&&nd(f.parent.vnode)&&f.parent.update()}).catch(v=>{m(v),_.value=v}),()=>{if(b.value&&u)return Kd(u,f);if(_.value&&o)return se(o,{error:_.value});if(n&&!g.value)return Kd(n,f)}}})}function Kd(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=se(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const nd=e=>e.type.__isKeepAlive,$I={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Oo(),o=n.ctx;if(!o.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,p=d("div");o.activate=(g,v,y,A,O)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,A,g.slotScopeIds,O),no(()=>{$.isDeactivated=!1,$.a&&qa($.a);const k=g.props&&g.props.onVnodeMounted;k&&as(k,$.parent,g)},l)},o.deactivate=g=>{const v=g.component;Jf(v.m),Jf(v.a),c(g,p,null,1,l),no(()=>{v.da&&qa(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&as(y,v.parent,g),v.isDeactivated=!0},l)};function h(g){Km(g),u(g,n,l,!0)}function f(g){s.forEach((v,y)=>{const A=Nv(Ji(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(y)})}function m(g){const v=s.get(g);v&&(!r||!ci(v,r))?h(v):r&&Km(r),s.delete(g),i.delete(g)}Ke(()=>[e.include,e.exclude],([g,v])=>{g&&f(y=>Zc(g,y)),v&&f(y=>!Zc(v,y))},{flush:"post",deep:!0});let b=null;const _=()=>{b!=null&&(ep(n.subTree.type)?no(()=>{s.set(b,Gd(n.subTree))},n.subTree.suspense):s.set(b,Gd(n.subTree)))};return hn(_),e0(_),lo(()=>{s.forEach(g=>{const{subTree:v,suspense:y}=n,A=Gd(v);if(g.type===A.type&&g.key===A.key){Km(A);const O=A.component.da;O&&no(O,y);return}h(g)})}),()=>{if(b=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Kr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=Gd(v);if(y.type===so)return r=null,y;const A=y.type,O=Nv(Ji(y)?y.type.__asyncResolved||{}:A),{include:$,exclude:k,max:E}=e;if($&&(!O||!Zc($,O))||k&&O&&Zc(k,O))return y.shapeFlag&=-257,r=y,v;const M=y.key==null?A:y.key,L=s.get(M);return y.el&&(y=ir(y),v.shapeFlag&128&&(v.ssContent=y)),b=M,L?(y.el=L.el,y.component=L.component,y.transition&&Vr(y,y.transition),y.shapeFlag|=512,i.delete(M),i.add(M)):(i.add(M),E&&i.size>parseInt(E,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,ep(v.type)?v:y}}},wpe=$I;function Zc(e,t){return yt(e)?e.some(n=>Zc(n,t)):yn(e)?e.split(",").includes(t):yE(e)?(e.lastIndex=0,e.test(t)):!1}function NI(e,t){ZC(e,"a",t)}function LI(e,t){ZC(e,"da",t)}function ZC(e,t,n=Io){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(ah(t,o,n),n){let s=n.parent;for(;s&&s.parent;)nd(s.parent.vnode)&&OI(o,t,n,s),s=s.parent}}function OI(e,t,n,o){const s=ah(t,e,o,!0);kn(()=>{q1(o[t],s)},n)}function Km(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Gd(e){return e.shapeFlag&128?e.ssContent:e}function ah(e,t,n=Io,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{nr();const l=vc(n),a=ti(t,n,e,r);return l(),or(),a});return o?s.unshift(i):s.push(i),i}}const lr=e=>(t,n=Io)=>{(!Vl||e==="sp")&&ah(e,(...o)=>t(...o),n)},PI=lr("bm"),hn=lr("m"),JC=lr("bu"),e0=lr("u"),lo=lr("bum"),kn=lr("um"),RI=lr("sp"),DI=lr("rtg"),BI=lr("rtc");function FI(e,t=Io){ah("ec",e,t)}const t0="components",HI="directives";function WI(e,t){return n0(t0,e,!0,t)||e}const ex=Symbol.for("v-ndc");function Wo(e){return yn(e)?n0(t0,e,!1)||e:e||ex}function Spe(e){return n0(HI,e)}function n0(e,t,n=!0,o=!1){const s=Lo||Io;if(s){const i=s.type;if(e===t0){const l=Nv(i,!1);if(l&&(l===t||l===vo(t)||l===Qp(vo(t))))return i}const r=gb(s[e]||i[e],t)||gb(s.appContext[e],t);return!r&&o?i:r}}function gb(e,t){return e&&(e[t]||e[vo(t)]||e[Qp(vo(t))])}function nt(e,t,n,o){let s;const i=n&&n[o],r=yt(e);if(r||yn(e)){const l=r&&Wr(e);let a=!1,c=!1;l&&(a=!Ms(e),c=sr(e),e=nh(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?sc(mi(e[u])):mi(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(rn(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function o0(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(yt(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function Cn(e,t,n={},o,s){if(Lo.ce||Lo.parent&&Ji(Lo.parent)&&Lo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ve(Le,null,[se("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&s0(i(n)),l=n.key||r&&r.key,a=ve(Le,{key:(l&&!Ps(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function s0(e){return e.some(t=>Kr(t)?!(t.type===so||t.type===Le&&!s0(t.children)):!0)?e:null}function Cpe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:wf(o)]=e[o];return n}const Cv=e=>e?xx(e)?sd(e):Cv(e.parent):null,lu=pn(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=>Cv(e.parent),$root:e=>Cv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>i0(e),$forceUpdate:e=>e.f||(e.f=()=>{Q1(e.update)}),$nextTick:e=>e.n||(e.n=ht.bind(e.proxy)),$watch:e=>vI.bind(e)}),Gm=(e,t)=>e!==zt&&!e.__isScriptSetup&&sn(e,t),xv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const p=r[t];if(p!==void 0)switch(p){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(Gm(o,t))return r[t]=1,o[t];if(s!==zt&&sn(s,t))return r[t]=2,s[t];if(sn(i,t))return r[t]=3,i[t];if(n!==zt&&sn(n,t))return r[t]=4,n[t];Av&&(r[t]=0)}}const c=lu[t];let u,d;if(c)return t==="$attrs"&&Ho(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==zt&&sn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,sn(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return Gm(s,t)?(s[t]=n,!0):o!==zt&&sn(o,t)?(o[t]=n,!0):sn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==zt&&l[0]!=="$"&&sn(e,l)||Gm(t,l)||sn(i,l)||sn(o,l)||sn(lu,l)||sn(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:sn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},zI=pn({},xv,{get(e,t){if(t!==Symbol.unscopables)return xv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!SE(t)}});function xpe(){return null}function Ape(){return null}function Tpe(e){}function Mpe(e){}function Epe(){return null}function Ipe(){}function $pe(e,t){return null}function Npe(){return tx().slots}function od(){return tx().attrs}function tx(e){const t=Oo();return t.setupContext||(t.setupContext=Mx(t))}function Iu(e){return yt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Lpe(e,t){const n=Iu(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?yt(s)||At(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function Ope(e,t){return!e||!t?e||t:yt(e)&&yt(t)?e.concat(t):pn({},Iu(e),Iu(t))}function Ppe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Rpe(e){const t=Oo(),n=Vl;let o=e();Nu(),n&&Ya(!1);const s=()=>{vc(t),n&&Ya(!0)},i=()=>{Oo()!==t&&t.scope.off(),Nu(),n&&Ya(!1)};return j1(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Av=!0;function UI(e){const t=i0(e),n=e.proxy,o=e.ctx;Av=!1,t.beforeCreate&&vb(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:h,updated:f,activated:m,deactivated:b,beforeDestroy:_,beforeUnmount:g,destroyed:v,unmounted:y,render:A,renderTracked:O,renderTriggered:$,errorCaptured:k,serverPrefetch:E,expose:M,inheritAttrs:L,components:S,directives:I,filters:P}=t;if(c&&qI(c,o,null),r)for(const z in r){const q=r[z];At(q)&&(o[z]=q.bind(n))}if(s){const z=s.call(n,n);rn(z)&&(e.data=No(z))}if(Av=!0,i)for(const z in i){const q=i[z],Q=At(q)?q.bind(n,n):At(q.get)?q.get.bind(n,n):Js,X=!At(q)&&At(q.set)?q.set.bind(n):Js,fe=F({get:Q,set:X});Object.defineProperty(o,z,{enumerable:!0,configurable:!0,get:()=>fe.value,set:ye=>fe.value=ye})}if(l)for(const z in l)nx(l[z],o,n,z);if(a){const z=At(a)?a.call(n):a;Reflect.ownKeys(z).forEach(q=>{En(q,z[q])})}u&&vb(u,e,"c");function W(z,q){yt(q)?q.forEach(Q=>z(Q.bind(n))):q&&z(q.bind(n))}if(W(PI,d),W(hn,p),W(JC,h),W(e0,f),W(NI,m),W(LI,b),W(FI,k),W(BI,O),W(DI,$),W(lo,g),W(kn,y),W(RI,E),yt(M))if(M.length){const z=e.exposed||(e.exposed={});M.forEach(q=>{Object.defineProperty(z,q,{get:()=>n[q],set:Q=>n[q]=Q,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===Js&&(e.render=A),L!=null&&(e.inheritAttrs=L),S&&(e.components=S),I&&(e.directives=I),E&&J1(e)}function qI(e,t,n=Js){yt(e)&&(e=Tv(e));for(const o in e){const s=e[o];let i;rn(s)?"default"in s?i=Ut(s.from||o,s.default,!0):i=Ut(s.from||o):i=Ut(s),eo(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function vb(e,t,n){ti(yt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function nx(e,t,n,o){let s=o.includes(".")?qC(n,o):()=>n[o];if(yn(e)){const i=t[e];At(i)&&Ke(s,i)}else if(At(e))Ke(s,e.bind(n));else if(rn(e))if(yt(e))e.forEach(i=>nx(i,t,n,o));else{const i=At(e.handler)?e.handler.bind(n):t[e.handler];At(i)&&Ke(s,i,e)}}function i0(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>Zf(a,c,r,!0)),Zf(a,t,r)),rn(t)&&i.set(t,a),a}function Zf(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Zf(e,i,n,!0),s&&s.forEach(r=>Zf(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=jI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const jI={data:yb,props:kb,emits:kb,methods:Jc,computed:Jc,beforeCreate:Ko,created:Ko,beforeMount:Ko,mounted:Ko,beforeUpdate:Ko,updated:Ko,beforeDestroy:Ko,beforeUnmount:Ko,destroyed:Ko,unmounted:Ko,activated:Ko,deactivated:Ko,errorCaptured:Ko,serverPrefetch:Ko,components:Jc,directives:Jc,watch:KI,provide:yb,inject:VI};function yb(e,t){return t?e?function(){return pn(At(e)?e.call(this,this):e,At(t)?t.call(this,this):t)}:t:e}function VI(e,t){return Jc(Tv(e),Tv(t))}function Tv(e){if(yt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ko(e,t){return e?[...new Set([].concat(e,t))]:t}function Jc(e,t){return e?pn(Object.create(null),e,t):t}function kb(e,t){return e?yt(e)&&yt(t)?[...new Set([...e,...t])]:pn(Object.create(null),Iu(e),Iu(t??{})):t}function KI(e,t){if(!e)return t;if(!t)return e;const n=pn(Object.create(null),e);for(const o in t)n[o]=Ko(e[o],t[o]);return n}function ox(){return{app:null,config:{isNativeTag:pC,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 GI=0;function YI(e,t){return function(o,s=null){At(o)||(o=pn({},o)),s!=null&&!rn(s)&&(s=null);const i=ox(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:GI++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:x$,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&At(u.install)?(r.add(u),u.install(c,...d)):At(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,p){if(!a){const h=c._ceVNode||se(o,s);return h.appContext=i,p===!0?p="svg":p===!1&&(p=void 0),d&&t?t(h,u):e(h,u,p),a=!0,c._container=u,u.__vue_app__=c,sd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(ti(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=Hl;Hl=c;try{return u()}finally{Hl=d}}};return c}}let Hl=null;function Dpe(e,t,n=zt){const o=Oo(),s=vo(t),i=fs(t),r=sx(e,s),l=tI((a,c)=>{let u,d=zt,p;return gI(()=>{const h=e[s];Eo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const f=n.set?n.set(h):h;if(!Eo(f,u)&&!(d!==zt&&Eo(h,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=h,c()),o.emit(`update:${t}`,f),Eo(h,f)&&Eo(h,d)&&!Eo(f,p)&&c(),d=h,p=f}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||zt:l,done:!1}:{done:!0}}}},l}const sx=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${vo(t)}Modifiers`]||e[`${fs(t)}Modifiers`];function XI(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||zt;let s=n;const i=t.startsWith("update:"),r=i&&sx(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>yn(u)?u.trim():u)),r.number&&(s=n.map(Zp)));let l,a=o[l=wf(t)]||o[l=wf(vo(t))];!a&&i&&(a=o[l=wf(fs(t))]),a&&ti(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ti(c,e,6,s)}}const QI=new WeakMap;function ix(e,t,n=!1){const o=n?QI:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!At(e)){const a=c=>{const u=ix(c,t,!0);u&&(l=!0,pn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(rn(e)&&o.set(e,null),null):(yt(i)?i.forEach(a=>r[a]=null):pn(r,i),rn(e)&&o.set(e,r),r)}function ch(e,t){return!e||!Ju(t)?!1:(t=t.slice(2).replace(/Once$/,""),sn(e,t[0].toLowerCase()+t.slice(1))||sn(e,fs(t))||sn(e,t))}function Sf(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:p,setupState:h,ctx:f,inheritAttrs:m}=e,b=Mu(e);let _,g;try{if(n.shapeFlag&4){const y=s||o,A=y;_=ds(c.call(A,y,u,d,h,p,f)),g=l}else{const y=t;_=ds(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:JI(l)}}catch(y){au.length=0,gc(y,e,1),_=se(so)}let v=_;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:A}=v;y.length&&A&7&&(i&&y.some(Kp)&&(g=e$(g,i)),v=ir(v,g,!1,!0))}return n.dirs&&(v=ir(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Vr(v,n.transition),_=v,Mu(b),_}function ZI(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Kr(s)){if(s.type!==so||s.children==="v-if"){if(n)return;n=s}}else return}return n}const JI=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ju(n))&&((t||(t={}))[n]=e[n]);return t},e$=(e,t)=>{const n={};for(const o in e)(!Kp(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function t$(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?bb(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const p=u[d];if(rx(r,o,p)&&!ch(c,p))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?bb(o,r,c):!0:!!r;return!1}function bb(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(rx(t,e,i)&&!ch(n,i))return!0}return!1}function rx(e,t,n){const o=e[n],s=t[n];return n==="style"&&rn(o)&&rn(s)?!tr(o,s):o!==s}function uh({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const lx={},ax=()=>Object.create(lx),cx=e=>Object.getPrototypeOf(e)===lx;function n$(e,t,n,o=!1){const s={},i=ax();e.propsDefaults=Object.create(null),ux(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:QE(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function o$(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=Kt(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let p=u[d];if(ch(e.emitsOptions,p))continue;const h=t[p];if(a)if(sn(i,p))h!==i[p]&&(i[p]=h,c=!0);else{const f=vo(p);s[f]=Mv(a,l,f,h,e,!1)}else h!==i[p]&&(i[p]=h,c=!0)}}}else{ux(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!sn(t,d)&&((u=fs(d))===d||!sn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Mv(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!sn(t,d))&&(delete i[d],c=!0)}c&&Ki(e.attrs,"set","")}function ux(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Bl(a))continue;const c=t[a];let u;s&&sn(s,u=vo(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:ch(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=Kt(n),c=l||zt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Mv(s,a,d,c[d],e,!sn(c,d))}}return r}function Mv(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=sn(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&At(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=vc(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===fs(n))&&(o=!0))}return o}const s$=new WeakMap;function dx(e,t,n=!1){const o=n?s$:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!At(e)){const u=d=>{a=!0;const[p,h]=dx(d,t,!0);pn(r,p),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return rn(e)&&o.set(e,za),za;if(yt(i))for(let u=0;u<i.length;u++){const d=vo(i[u]);_b(d)&&(r[d]=zt)}else if(i)for(const u in i){const d=vo(u);if(_b(d)){const p=i[u],h=r[d]=yt(p)||At(p)?{type:p}:pn({},p),f=h.type;let m=!1,b=!0;if(yt(f))for(let _=0;_<f.length;++_){const g=f[_],v=At(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(b=!1)}else m=At(f)&&f.name==="Boolean";h[0]=m,h[1]=b,(m||sn(h,"default"))&&l.push(d)}}const c=[r,l];return rn(e)&&o.set(e,c),c}function _b(e){return e[0]!=="$"&&!Bl(e)}const r0=e=>e==="_"||e==="_ctx"||e==="$stable",l0=e=>yt(e)?e.map(ds):[ds(e)],i$=(e,t,n)=>{if(t._n)return t;const o=_e((...s)=>l0(t(...s)),n);return o._c=!1,o},fx=(e,t,n)=>{const o=e._ctx;for(const s in e){if(r0(s))continue;const i=e[s];if(At(i))t[s]=i$(s,i,o);else if(i!=null){const r=l0(i);t[s]=()=>r}}},px=(e,t)=>{const n=l0(t);e.slots.default=()=>n},hx=(e,t,n)=>{for(const o in t)(n||!r0(o))&&(e[o]=t[o])},r$=(e,t,n)=>{const o=e.slots=ax();if(e.vnode.shapeFlag&32){const s=t._;s?(hx(o,t,n),n&&mC(o,"_",s,!0)):fx(t,o)}else t&&px(e,t)},l$=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=zt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:hx(s,t,n):(i=!t.$stable,fx(t,s)),r=t}else t&&(px(e,t),r={default:1});if(i)for(const l in s)!r0(l)&&r[l]==null&&delete s[l]},no=bx;function a$(e){return mx(e)}function c$(e){return mx(e,xI)}function mx(e,t){const n=Jp();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:p,setScopeId:h=Js,insertStaticContent:f}=e,m=(H,J,ce,te=null,ue=null,j=null,Y=void 0,re=null,ge=!!J.dynamicChildren)=>{if(H===J)return;H&&!ci(H,J)&&(te=Fe(H),ye(H,ue,j,!0),H=null),J.patchFlag===-2&&(ge=!1,J.dynamicChildren=null);const{type:Ae,ref:Ie,shapeFlag:ae}=J;switch(Ae){case zr:b(H,J,ce,te);break;case so:_(H,J,ce,te);break;case Ga:H==null&&g(J,ce,te,Y);break;case Le:S(H,J,ce,te,ue,j,Y,re,ge);break;default:ae&1?A(H,J,ce,te,ue,j,Y,re,ge):ae&6?I(H,J,ce,te,ue,j,Y,re,ge):(ae&64||ae&128)&&Ae.process(H,J,ce,te,ue,j,Y,re,ge,U)}Ie!=null&&ue?Va(Ie,H&&H.ref,j,J||H,!J):Ie==null&&H&&H.ref!=null&&Va(H.ref,null,j,H,!0)},b=(H,J,ce,te)=>{if(H==null)o(J.el=l(J.children),ce,te);else{const ue=J.el=H.el;J.children!==H.children&&c(ue,J.children)}},_=(H,J,ce,te)=>{H==null?o(J.el=a(J.children||""),ce,te):J.el=H.el},g=(H,J,ce,te)=>{[H.el,H.anchor]=f(H.children,J,ce,te,H.el,H.anchor)},v=({el:H,anchor:J},ce,te)=>{let ue;for(;H&&H!==J;)ue=p(H),o(H,ce,te),H=ue;o(J,ce,te)},y=({el:H,anchor:J})=>{let ce;for(;H&&H!==J;)ce=p(H),s(H),H=ce;s(J)},A=(H,J,ce,te,ue,j,Y,re,ge)=>{if(J.type==="svg"?Y="svg":J.type==="math"&&(Y="mathml"),H==null)O(J,ce,te,ue,j,Y,re,ge);else{const Ae=H.el&&H.el._isVueCE?H.el:null;try{Ae&&Ae._beginPatch(),E(H,J,ue,j,Y,re,ge)}finally{Ae&&Ae._endPatch()}}},O=(H,J,ce,te,ue,j,Y,re)=>{let ge,Ae;const{props:Ie,shapeFlag:ae,transition:Te,dirs:Ve}=H;if(ge=H.el=r(H.type,j,Ie&&Ie.is,Ie),ae&8?u(ge,H.children):ae&16&&k(H.children,ge,null,te,ue,Ym(H,j),Y,re),Ve&&Mi(H,null,te,"created"),$(ge,H,H.scopeId,Y,te),Ie){for(const bt in Ie)bt!=="value"&&!Bl(bt)&&i(ge,bt,null,Ie[bt],j,te);"value"in Ie&&i(ge,"value",null,Ie.value,j),(Ae=Ie.onVnodeBeforeMount)&&as(Ae,te,H)}Ve&&Mi(H,null,te,"beforeMount");const tt=gx(ue,Te);tt&&Te.beforeEnter(ge),o(ge,J,ce),((Ae=Ie&&Ie.onVnodeMounted)||tt||Ve)&&no(()=>{try{Ae&&as(Ae,te,H),tt&&Te.enter(ge),Ve&&Mi(H,null,te,"mounted")}finally{}},ue)},$=(H,J,ce,te,ue)=>{if(ce&&h(H,ce),te)for(let j=0;j<te.length;j++)h(H,te[j]);if(ue){let j=ue.subTree;if(J===j||ep(j.type)&&(j.ssContent===J||j.ssFallback===J)){const Y=ue.vnode;$(H,Y,Y.scopeId,Y.slotScopeIds,ue.parent)}}},k=(H,J,ce,te,ue,j,Y,re,ge=0)=>{for(let Ae=ge;Ae<H.length;Ae++){const Ie=H[Ae]=re?Vi(H[Ae]):ds(H[Ae]);m(null,Ie,J,ce,te,ue,j,Y,re)}},E=(H,J,ce,te,ue,j,Y)=>{const re=J.el=H.el;let{patchFlag:ge,dynamicChildren:Ae,dirs:Ie}=J;ge|=H.patchFlag&16;const ae=H.props||zt,Te=J.props||zt;let Ve;if(ce&&_l(ce,!1),(Ve=Te.onVnodeBeforeUpdate)&&as(Ve,ce,J,H),Ie&&Mi(J,H,ce,"beforeUpdate"),ce&&_l(ce,!0),(ae.innerHTML&&Te.innerHTML==null||ae.textContent&&Te.textContent==null)&&u(re,""),Ae?M(H.dynamicChildren,Ae,re,ce,te,Ym(J,ue),j):Y||q(H,J,re,null,ce,te,Ym(J,ue),j,!1),ge>0){if(ge&16)L(re,ae,Te,ce,ue);else if(ge&2&&ae.class!==Te.class&&i(re,"class",null,Te.class,ue),ge&4&&i(re,"style",ae.style,Te.style,ue),ge&8){const tt=J.dynamicProps;for(let bt=0;bt<tt.length;bt++){const kt=tt[bt],Tt=ae[kt],Pt=Te[kt];(Pt!==Tt||kt==="value")&&i(re,kt,Tt,Pt,ue,ce)}}ge&1&&H.children!==J.children&&u(re,J.children)}else!Y&&Ae==null&&L(re,ae,Te,ce,ue);((Ve=Te.onVnodeUpdated)||Ie)&&no(()=>{Ve&&as(Ve,ce,J,H),Ie&&Mi(J,H,ce,"updated")},te)},M=(H,J,ce,te,ue,j,Y)=>{for(let re=0;re<J.length;re++){const ge=H[re],Ae=J[re],Ie=ge.el&&(ge.type===Le||!ci(ge,Ae)||ge.shapeFlag&198)?d(ge.el):ce;m(ge,Ae,Ie,null,te,ue,j,Y,!0)}},L=(H,J,ce,te,ue)=>{if(J!==ce){if(J!==zt)for(const j in J)!Bl(j)&&!(j in ce)&&i(H,j,J[j],null,ue,te);for(const j in ce){if(Bl(j))continue;const Y=ce[j],re=J[j];Y!==re&&j!=="value"&&i(H,j,re,Y,ue,te)}"value"in ce&&i(H,"value",J.value,ce.value,ue)}},S=(H,J,ce,te,ue,j,Y,re,ge)=>{const Ae=J.el=H?H.el:l(""),Ie=J.anchor=H?H.anchor:l("");let{patchFlag:ae,dynamicChildren:Te,slotScopeIds:Ve}=J;Ve&&(re=re?re.concat(Ve):Ve),H==null?(o(Ae,ce,te),o(Ie,ce,te),k(J.children||[],ce,Ie,ue,j,Y,re,ge)):ae>0&&ae&64&&Te&&H.dynamicChildren&&H.dynamicChildren.length===Te.length?(M(H.dynamicChildren,Te,ce,ue,j,Y,re),(J.key!=null||ue&&J===ue.subTree)&&a0(H,J,!0)):q(H,J,ce,Ie,ue,j,Y,re,ge)},I=(H,J,ce,te,ue,j,Y,re,ge)=>{J.slotScopeIds=re,H==null?J.shapeFlag&512?ue.ctx.activate(J,ce,te,Y,ge):P(J,ce,te,ue,j,Y,ge):D(H,J,ge)},P=(H,J,ce,te,ue,j,Y)=>{const re=H.component=Cx(H,te,ue);if(nd(H)&&(re.ctx.renderer=U),Ax(re,!1,Y),re.asyncDep){if(ue&&ue.registerDep(re,W,Y),!H.el){const ge=re.subTree=se(so);_(null,ge,J,ce),H.placeholder=ge.el}}else W(re,H,J,ce,ue,j,Y)},D=(H,J,ce)=>{const te=J.component=H.component;if(t$(H,J,ce))if(te.asyncDep&&!te.asyncResolved){z(te,J,ce);return}else te.next=J,te.update();else J.el=H.el,te.vnode=J},W=(H,J,ce,te,ue,j,Y)=>{const re=()=>{if(H.isMounted){let{next:ae,bu:Te,u:Ve,parent:tt,vnode:bt}=H;{const Yt=vx(H);if(Yt){ae&&(ae.el=bt.el,z(H,ae,Y)),Yt.asyncDep.then(()=>{no(()=>{H.isUnmounted||Ae()},ue)});return}}let kt=ae,Tt;_l(H,!1),ae?(ae.el=bt.el,z(H,ae,Y)):ae=bt,Te&&qa(Te),(Tt=ae.props&&ae.props.onVnodeBeforeUpdate)&&as(Tt,tt,ae,bt),_l(H,!0);const Pt=Sf(H),mt=H.subTree;H.subTree=Pt,m(mt,Pt,d(mt.el),Fe(mt),H,ue,j),ae.el=Pt.el,kt===null&&uh(H,Pt.el),Ve&&no(Ve,ue),(Tt=ae.props&&ae.props.onVnodeUpdated)&&no(()=>as(Tt,tt,ae,bt),ue)}else{let ae;const{el:Te,props:Ve}=J,{bm:tt,m:bt,parent:kt,root:Tt,type:Pt}=H,mt=Ji(J);if(_l(H,!1),tt&&qa(tt),!mt&&(ae=Ve&&Ve.onVnodeBeforeMount)&&as(ae,kt,J),_l(H,!0),Te&&ne){const Yt=()=>{H.subTree=Sf(H),ne(Te,H.subTree,H,ue,null)};mt&&Pt.__asyncHydrate?Pt.__asyncHydrate(Te,H,Yt):Yt()}else{Tt.ce&&Tt.ce._hasShadowRoot()&&Tt.ce._injectChildStyle(Pt,H.parent?H.parent.type:void 0);const Yt=H.subTree=Sf(H);m(null,Yt,ce,te,H,ue,j),J.el=Yt.el}if(bt&&no(bt,ue),!mt&&(ae=Ve&&Ve.onVnodeMounted)){const Yt=J;no(()=>as(ae,kt,Yt),ue)}(J.shapeFlag&256||kt&&Ji(kt.vnode)&&kt.vnode.shapeFlag&256)&&H.a&&no(H.a,ue),H.isMounted=!0,J=ce=te=null}};H.scope.on();const ge=H.effect=new qf(re);H.scope.off();const Ae=H.update=ge.run.bind(ge),Ie=H.job=ge.runIfDirty.bind(ge);Ie.i=H,Ie.id=H.uid,ge.scheduler=()=>Q1(Ie),_l(H,!0),Ae()},z=(H,J,ce)=>{J.component=H;const te=H.vnode.props;H.vnode=J,H.next=null,o$(H,J.props,te,ce),l$(H,J.children,ce),nr(),ab(H),or()},q=(H,J,ce,te,ue,j,Y,re,ge=!1)=>{const Ae=H&&H.children,Ie=H?H.shapeFlag:0,ae=J.children,{patchFlag:Te,shapeFlag:Ve}=J;if(Te>0){if(Te&128){X(Ae,ae,ce,te,ue,j,Y,re,ge);return}else if(Te&256){Q(Ae,ae,ce,te,ue,j,Y,re,ge);return}}Ve&8?(Ie&16&&Ue(Ae,ue,j),ae!==Ae&&u(ce,ae)):Ie&16?Ve&16?X(Ae,ae,ce,te,ue,j,Y,re,ge):Ue(Ae,ue,j,!0):(Ie&8&&u(ce,""),Ve&16&&k(ae,ce,te,ue,j,Y,re,ge))},Q=(H,J,ce,te,ue,j,Y,re,ge)=>{H=H||za,J=J||za;const Ae=H.length,Ie=J.length,ae=Math.min(Ae,Ie);let Te;for(Te=0;Te<ae;Te++){const Ve=J[Te]=ge?Vi(J[Te]):ds(J[Te]);m(H[Te],Ve,ce,null,ue,j,Y,re,ge)}Ae>Ie?Ue(H,ue,j,!0,!1,ae):k(J,ce,te,ue,j,Y,re,ge,ae)},X=(H,J,ce,te,ue,j,Y,re,ge)=>{let Ae=0;const Ie=J.length;let ae=H.length-1,Te=Ie-1;for(;Ae<=ae&&Ae<=Te;){const Ve=H[Ae],tt=J[Ae]=ge?Vi(J[Ae]):ds(J[Ae]);if(ci(Ve,tt))m(Ve,tt,ce,null,ue,j,Y,re,ge);else break;Ae++}for(;Ae<=ae&&Ae<=Te;){const Ve=H[ae],tt=J[Te]=ge?Vi(J[Te]):ds(J[Te]);if(ci(Ve,tt))m(Ve,tt,ce,null,ue,j,Y,re,ge);else break;ae--,Te--}if(Ae>ae){if(Ae<=Te){const Ve=Te+1,tt=Ve<Ie?J[Ve].el:te;for(;Ae<=Te;)m(null,J[Ae]=ge?Vi(J[Ae]):ds(J[Ae]),ce,tt,ue,j,Y,re,ge),Ae++}}else if(Ae>Te)for(;Ae<=ae;)ye(H[Ae],ue,j,!0),Ae++;else{const Ve=Ae,tt=Ae,bt=new Map;for(Ae=tt;Ae<=Te;Ae++){const Ft=J[Ae]=ge?Vi(J[Ae]):ds(J[Ae]);Ft.key!=null&&bt.set(Ft.key,Ae)}let kt,Tt=0;const Pt=Te-tt+1;let mt=!1,Yt=0;const Rn=new Array(Pt);for(Ae=0;Ae<Pt;Ae++)Rn[Ae]=0;for(Ae=Ve;Ae<=ae;Ae++){const Ft=H[Ae];if(Tt>=Pt){ye(Ft,ue,j,!0);continue}let bn;if(Ft.key!=null)bn=bt.get(Ft.key);else for(kt=tt;kt<=Te;kt++)if(Rn[kt-tt]===0&&ci(Ft,J[kt])){bn=kt;break}bn===void 0?ye(Ft,ue,j,!0):(Rn[bn-tt]=Ae+1,bn>=Yt?Yt=bn:mt=!0,m(Ft,J[bn],ce,null,ue,j,Y,re,ge),Tt++)}const Dn=mt?u$(Rn):za;for(kt=Dn.length-1,Ae=Pt-1;Ae>=0;Ae--){const Ft=tt+Ae,bn=J[Ft],Vn=J[Ft+1],ot=Ft+1<Ie?Vn.el||yx(Vn):te;Rn[Ae]===0?m(null,bn,ce,ot,ue,j,Y,re,ge):mt&&(kt<0||Ae!==Dn[kt]?fe(bn,ce,ot,2):kt--)}}},fe=(H,J,ce,te,ue=null)=>{const{el:j,type:Y,transition:re,children:ge,shapeFlag:Ae}=H;if(Ae&6){fe(H.component.subTree,J,ce,te);return}if(Ae&128){H.suspense.move(J,ce,te);return}if(Ae&64){Y.move(H,J,ce,U);return}if(Y===Le){o(j,J,ce);for(let ae=0;ae<ge.length;ae++)fe(ge[ae],J,ce,te);o(H.anchor,J,ce);return}if(Y===Ga){v(H,J,ce);return}if(te!==2&&Ae&1&&re)if(te===0)re.persisted&&!j[Ks]?o(j,J,ce):(re.beforeEnter(j),o(j,J,ce),no(()=>re.enter(j),ue));else{const{leave:ae,delayLeave:Te,afterLeave:Ve}=re,tt=()=>{H.ctx.isUnmounted?s(j):o(j,J,ce)},bt=()=>{const kt=j._isLeaving||!!j[Ks];j._isLeaving&&j[Ks](!0),re.persisted&&!kt?tt():ae(j,()=>{tt(),Ve&&Ve()})};Te?Te(j,tt,bt):bt()}else o(j,J,ce)},ye=(H,J,ce,te=!1,ue=!1)=>{const{type:j,props:Y,ref:re,children:ge,dynamicChildren:Ae,shapeFlag:Ie,patchFlag:ae,dirs:Te,cacheIndex:Ve,memo:tt}=H;if(ae===-2&&(ue=!1),re!=null&&(nr(),Va(re,null,ce,H,!0),or()),Ve!=null&&(J.renderCache[Ve]=void 0),Ie&256){J.ctx.deactivate(H);return}const bt=Ie&1&&Te,kt=!Ji(H);let Tt;if(kt&&(Tt=Y&&Y.onVnodeBeforeUnmount)&&as(Tt,J,H),Ie&6)ze(H.component,ce,te);else{if(Ie&128){H.suspense.unmount(ce,te);return}bt&&Mi(H,null,J,"beforeUnmount"),Ie&64?H.type.remove(H,J,ce,U,te):Ae&&!Ae.hasOnce&&(j!==Le||ae>0&&ae&64)?Ue(Ae,J,ce,!1,!0):(j===Le&&ae&384||!ue&&Ie&16)&&Ue(ge,J,ce),te&&Me(H)}const Pt=tt!=null&&Ve==null;(kt&&(Tt=Y&&Y.onVnodeUnmounted)||bt||Pt)&&no(()=>{Tt&&as(Tt,J,H),bt&&Mi(H,null,J,"unmounted"),Pt&&(H.el=null)},ce)},Me=H=>{const{type:J,el:ce,anchor:te,transition:ue}=H;if(J===Le){we(ce,te);return}if(J===Ga){y(H);return}const j=()=>{s(ce),ue&&!ue.persisted&&ue.afterLeave&&ue.afterLeave()};if(H.shapeFlag&1&&ue&&!ue.persisted){const{leave:Y,delayLeave:re}=ue,ge=()=>Y(ce,j);re?re(H.el,j,ge):ge()}else j()},we=(H,J)=>{let ce;for(;H!==J;)ce=p(H),s(H),H=ce;s(J)},ze=(H,J,ce)=>{const{bum:te,scope:ue,job:j,subTree:Y,um:re,m:ge,a:Ae}=H;Jf(ge),Jf(Ae),te&&qa(te),ue.stop(),j&&(j.flags|=8,ye(Y,H,J,ce)),re&&no(re,J),no(()=>{H.isUnmounted=!0},J)},Ue=(H,J,ce,te=!1,ue=!1,j=0)=>{for(let Y=j;Y<H.length;Y++)ye(H[Y],J,ce,te,ue)},Fe=H=>{if(H.shapeFlag&6)return Fe(H.component.subTree);if(H.shapeFlag&128)return H.suspense.next();const J=p(H.anchor||H.el),ce=J&&J[jC];return ce?p(ce):J};let rt=!1;const le=(H,J,ce)=>{let te;H==null?J._vnode&&(ye(J._vnode,null,null,!0),te=J._vnode.component):m(J._vnode||null,H,J,null,null,null,ce),J._vnode=H,rt||(rt=!0,ab(te),Xf(),rt=!1)},U={p:m,um:ye,m:fe,r:Me,mt:P,mc:k,pc:q,pbc:M,n:Fe,o:e};let G,ne;return t&&([G,ne]=t(U)),{render:le,hydrate:G,createApp:YI(le,G)}}function Ym({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 _l({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function gx(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function a0(e,t,n=!1){const o=e.children,s=t.children;if(yt(o)&&yt(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Vi(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&a0(r,l)),l.type===zr&&(l.patchFlag===-1&&(l=s[i]=Vi(l)),l.el=r.el),l.type===so&&!l.el&&(l.el=r.el)}}function u$(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function vx(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:vx(t)}function Jf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function yx(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?yx(t.subTree):null}const ep=e=>e.__isSuspense;let Ev=0;const d$={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)f$(t,n,o,s,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}p$(e,t,n,o,s,r,l,a,c)}},hydrate:h$,normalize:m$},Bpe=d$;function $u(e,t){const n=e.props&&e.props[t];At(n)&&n()}function f$(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),p=e.suspense=kx(e,s,o,t,d,n,i,r,l,a);c(null,p.pendingBranch=e.ssContent,d,null,o,p,i,r),p.deps>0?($u(e,"onPending"),$u(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Ka(p,e.ssFallback)):p.resolve(!1,!0)}function p$(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const p=t.ssContent,h=t.ssFallback,{activeBranch:f,pendingBranch:m,isInFallback:b,isHydrating:_}=d;if(m)d.pendingBranch=p,ci(m,p)?(a(m,p,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():b&&(_||(a(f,h,n,o,s,null,i,r,l),Ka(d,h)))):(d.pendingId=Ev++,_?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(a(null,p,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(f,h,n,o,s,null,i,r,l),Ka(d,h))):f&&ci(f,p)?(a(f,p,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,p,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(f&&ci(f,p))a(f,p,n,o,s,d,i,r,l),Ka(d,p);else if($u(t,"onPending"),d.pendingBranch=p,p.shapeFlag&512?d.pendingId=p.component.suspenseId:d.pendingId=Ev++,a(null,p,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(h)},g):g===0&&d.fallback(h)}}function kx(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:p,um:h,n:f,o:{parentNode:m,remove:b}}=c;let _;const g=g$(e);g&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const v=e.props?Uf(e.props.timeout):void 0,y=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Ev++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(O=!1,$=!1){const{vnode:k,activeBranch:E,pendingBranch:M,pendingId:L,effects:S,parentComponent:I,container:P,isInFallback:D}=A;let W=!1;if(A.isHydrating)A.isHydrating=!1;else if(!O){W=E&&M.transition&&M.transition.mode==="out-in";let Q=!1;W&&(E.transition.afterLeave=()=>{L===A.pendingId&&(p(M,P,i===y&&!Q?f(E):i,0),Yf(S),D&&k.ssFallback&&(k.ssFallback.el=null))}),E&&!A.isFallbackMountPending&&(m(E.el)===P&&(i=f(E),Q=!0),h(E,I,A,!0),!W&&D&&k.ssFallback&&no(()=>k.ssFallback.el=null,A)),W||p(M,P,i,0)}A.isFallbackMountPending=!1,Ka(A,M),A.pendingBranch=null,A.isInFallback=!1;let z=A.parent,q=!1;for(;z;){if(z.pendingBranch){z.effects.push(...S),q=!0;break}z=z.parent}!q&&!W&&Yf(S),A.effects=[],g&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),$u(k,"onResolve")},fallback(O){if(!A.pendingBranch)return;const{vnode:$,activeBranch:k,parentComponent:E,container:M,namespace:L}=A;$u($,"onFallback");const S=f(k),I=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,O,M,S,E,null,L,l,a),Ka(A,O))},P=O.transition&&O.transition.mode==="out-in";P&&(A.isFallbackMountPending=!0,k.transition.afterLeave=I),A.isInFallback=!0,h(k,E,null,!0),P||I()},move(O,$,k){A.activeBranch&&p(A.activeBranch,O,$,k),A.container=O},next(){return A.activeBranch&&f(A.activeBranch)},registerDep(O,$,k){const E=!!A.pendingBranch;E&&A.deps++;const M=O.vnode.el;O.asyncDep.catch(L=>{gc(L,O,0)}).then(L=>{if(O.isUnmounted||A.isUnmounted||A.pendingId!==O.suspenseId)return;Nu(),O.asyncResolved=!0;const{vnode:S}=O;Iv(O,L,!1),M&&(S.el=M);const I=!M&&O.subTree.el;$(O,S,m(M||O.subTree.el),M?null:f(O.subTree),A,r,k),I&&(S.placeholder=null,b(I)),uh(O,S.el),E&&--A.deps===0&&A.resolve()})},unmount(O,$){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,O,$),A.pendingBranch&&h(A.pendingBranch,n,O,$)}};return A}function h$(e,t,n,o,s,i,r,l,a){const c=t.suspense=kx(t,o,n,e.parentNode,document.createElement("div"),null,s,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function m$(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=wb(o?n.default:n),e.ssFallback=o?wb(n.fallback):se(so)}function wb(e){let t;if(At(e)){const n=jl&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=zo,_x())}return yt(e)&&(e=ZI(e)),e=ds(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function bx(e,t){t&&t.pendingBranch?yt(e)?t.effects.push(...e):t.effects.push(e):Yf(e)}function Ka(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,uh(o,s))}function g$(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Le=Symbol.for("v-fgt"),zr=Symbol.for("v-txt"),so=Symbol.for("v-cmt"),Ga=Symbol.for("v-stc"),au=[];let zo=null;function w(e=!1){au.push(zo=e?null:[])}function _x(){au.pop(),zo=au[au.length-1]||null}let jl=1;function tp(e,t=!1){jl+=e,e<0&&zo&&t&&(zo.hasOnce=!0)}function wx(e){return e.dynamicChildren=jl>0?zo||za:null,_x(),jl>0&&zo&&zo.push(e),e}function N(e,t,n,o,s,i){return wx(T(e,t,n,o,s,i,!0))}function ve(e,t,n,o,s){return wx(se(e,t,n,o,s,!0))}function Kr(e){return e?e.__v_isVNode===!0:!1}function ci(e,t){return e.type===t.type&&e.key===t.key}function Fpe(e){}const Sx=({key:e})=>e??null,Cf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?yn(e)||eo(e)||At(e)?{i:Lo,r:e,k:t,f:!!n}:e:null);function T(e,t=null,n=null,o=0,s=null,i=e===Le?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Sx(t),ref:t&&Cf(t),scopeId:rh,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Lo};return l?(u0(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=yn(n)?8:16),jl>0&&!r&&zo&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&zo.push(a),a}const se=v$;function v$(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===ex)&&(e=so),Kr(e)){const l=ir(e,t,!0);return n&&u0(l,n),jl>0&&!i&&zo&&(l.shapeFlag&6?zo[zo.indexOf(e)]=l:zo.push(l)),l.patchFlag=-2,l}if(S$(e)&&(e=e.__vccOpts),t){t=y$(t);let{class:l,style:a}=t;l&&!yn(l)&&(t.class=Re(l)),rn(a)&&(ih(a)&&!yt(a)&&(a=pn({},a)),t.style=Gt(a))}const r=yn(e)?1:ep(e)?128:VC(e)?64:rn(e)?4:At(e)?2:0;return T(e,t,n,o,s,r,i,!0)}function y$(e){return e?ih(e)||cx(e)?pn({},e):e:null}function ir(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?dn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Sx(c),ref:t&&t.ref?n&&i?yt(i)?i.concat(Cf(t)):[i,Cf(t)]:Cf(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&&ir(e.ssContent),ssFallback:e.ssFallback&&ir(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Vr(u,a.clone(u)),u}function qe(e=" ",t=0){return se(zr,null,e,t)}function c0(e,t){const n=se(Ga,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(w(),ve(so,null,e)):se(so,null,e)}function ds(e){return e==null||typeof e=="boolean"?se(so):yt(e)?se(Le,null,e.slice()):Kr(e)?Vi(e):se(zr,null,String(e))}function Vi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ir(e)}function u0(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(yt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),u0(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!cx(t)?t._ctx=Lo:s===3&&Lo&&(Lo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else At(t)?(t={default:t,_ctx:Lo},n=32):(t=String(t),o&64?(n=16,t=[qe(t)]):n=8);e.children=t,e.shapeFlag|=n}function dn(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=Re([t.class,o.class]));else if(s==="style")t.style=Gt([t.style,o.style]);else if(Ju(s)){const i=t[s],r=o[s];r&&i!==r&&!(yt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!Kp(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function as(e,t,n,o=null){ti(e,t,7,[n,o])}const k$=ox();let b$=0;function Cx(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||k$,i={uid:b$++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new kC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:dx(o,s),emitsOptions:ix(o,s),emit:null,emitted:null,propsDefaults:zt,inheritAttrs:o.inheritAttrs,ctx:zt,data:zt,props:zt,attrs:zt,slots:zt,refs:zt,setupState:zt,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=XI.bind(null,i),e.ce&&e.ce(i),i}let Io=null;const Oo=()=>Io||Lo;let np,Ya;{const e=Jp(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};np=t("__VUE_INSTANCE_SETTERS__",n=>Io=n),Ya=t("__VUE_SSR_SETTERS__",n=>Vl=n)}const vc=e=>{const t=Io;return np(e),e.scope.on(),()=>{e.scope.off(),np(t)}},Nu=()=>{Io&&Io.scope.off(),np(null)};function xx(e){return e.vnode.shapeFlag&4}let Vl=!1;function Ax(e,t=!1,n=!1){t&&Ya(t);const{props:o,children:s}=e.vnode,i=xx(e);n$(e,o,i,t),r$(e,s,n||t);const r=i?_$(e,t):void 0;return t&&Ya(!1),r}function _$(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,xv);const{setup:o}=n;if(o){nr();const s=e.setupContext=o.length>1?Mx(e):null,i=vc(e),r=ed(o,e,0,[e.props,s]),l=j1(r);if(or(),i(),(l||e.sp)&&!Ji(e)&&J1(e),l){if(r.then(Nu,Nu),t)return r.then(a=>{Iv(e,a,t)}).catch(a=>{gc(a,e,0)});e.asyncDep=r}else Iv(e,r,t)}else Tx(e,t)}function Iv(e,t,n){At(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:rn(t)&&(e.setupState=DC(t)),Tx(e,n)}let op,$v;function Hpe(e){op=e,$v=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,zI))}}const Wpe=()=>!op;function Tx(e,t,n){const o=e.type;if(!e.render){if(!t&&op&&!o.render){const s=o.template||i0(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=pn(pn({isCustomElement:i,delimiters:l},r),a);o.render=op(s,c)}}e.render=o.render||Js,$v&&$v(e)}{const s=vc(e);nr();try{UI(e)}finally{or(),s()}}}const w$={get(e,t){return Ho(e,"get",""),e[t]}};function Mx(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,w$),slots:e.slots,emit:e.emit,expose:t}}function sd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(DC(Dr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in lu)return lu[n](e)},has(t,n){return n in t||n in lu}})):e.proxy}function Nv(e,t=!0){return At(e)?e.displayName||e.name:e.name||t&&e.__name}function S$(e){return At(e)&&"__vccOpts"in e}const F=(e,t)=>iI(e,t,Vl);function cn(e,t,n){try{tp(-1);const o=arguments.length;return o===2?rn(t)&&!yt(t)?Kr(t)?se(e,null,[t]):se(e,t):se(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Kr(n)&&(n=[n]),se(e,t,n))}finally{tp(1)}}function zpe(){}function Upe(e,t,n,o){const s=n[o];if(s&&C$(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function C$(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(Eo(n[o],t[o]))return!1;return jl>0&&zo&&zo.push(e),!0}const x$="3.5.35",qpe=Js,jpe=uI,Vpe=Ta,Kpe=UC,A$={createComponentInstance:Cx,setupComponent:Ax,renderComponentRoot:Sf,setCurrentRenderingInstance:Mu,isVNode:Kr,normalizeVNode:ds,getComponentPublicInstance:sd,ensureValidVNode:s0,pushWarningContext:aI,popWarningContext:cI},Gpe=A$,Ype=null,Xpe=null,Qpe=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let Lv;const Sb=typeof window<"u"&&window.trustedTypes;if(Sb)try{Lv=Sb.createPolicy("vue",{createHTML:e=>e})}catch{}const Ex=Lv?e=>Lv.createHTML(e):e=>e,T$="http://www.w3.org/2000/svg",M$="http://www.w3.org/1998/Math/MathML",Ui=typeof document<"u"?document:null,Cb=Ui&&Ui.createElement("template"),E$={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Ui.createElementNS(T$,e):t==="mathml"?Ui.createElementNS(M$,e):n?Ui.createElement(e,{is:n}):Ui.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Ui.createTextNode(e),createComment:e=>Ui.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ui.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{Cb.innerHTML=Ex(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Cb.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},yr="transition",Uc="animation",ic=Symbol("_vtc"),Ix={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},$x=pn({},GC,Ix),I$=e=>(e.displayName="Transition",e.props=$x,e),Gr=I$((e,{slots:t})=>cn(wI,Nx(e),t)),wl=(e,t=[])=>{yt(e)?e.forEach(n=>n(...t)):e&&e(...t)},xb=e=>e?yt(e)?e.some(t=>t.length>1):e.length>1:!1;function Nx(e){const t={};for(const S in e)S in Ix||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,f=$$(s),m=f&&f[0],b=f&&f[1],{onBeforeEnter:_,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:A,onBeforeAppear:O=_,onAppear:$=g,onAppearCancelled:k=v}=t,E=(S,I,P,D)=>{S._enterCancelled=D,Mr(S,I?u:l),Mr(S,I?c:r),P&&P()},M=(S,I)=>{S._isLeaving=!1,Mr(S,d),Mr(S,h),Mr(S,p),I&&I()},L=S=>(I,P)=>{const D=S?$:g,W=()=>E(I,S,P);wl(D,[I,W]),Ab(()=>{Mr(I,S?a:i),xi(I,S?u:l),xb(D)||Tb(I,o,m,W)})};return pn(t,{onBeforeEnter(S){wl(_,[S]),xi(S,i),xi(S,r)},onBeforeAppear(S){wl(O,[S]),xi(S,a),xi(S,c)},onEnter:L(!1),onAppear:L(!0),onLeave(S,I){S._isLeaving=!0;const P=()=>M(S,I);xi(S,d),S._enterCancelled?(xi(S,p),Ov(S)):(Ov(S),xi(S,p)),Ab(()=>{S._isLeaving&&(Mr(S,d),xi(S,h),xb(y)||Tb(S,o,b,P))}),wl(y,[S,P])},onEnterCancelled(S){E(S,!1,void 0,!0),wl(v,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),wl(k,[S])},onLeaveCancelled(S){M(S),wl(A,[S])}})}function $$(e){if(e==null)return null;if(rn(e))return[Xm(e.enter),Xm(e.leave)];{const t=Xm(e);return[t,t]}}function Xm(e){return Uf(e)}function xi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ic]||(e[ic]=new Set)).add(t)}function Mr(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[ic];n&&(n.delete(t),n.size||(e[ic]=void 0))}function Ab(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let N$=0;function Tb(e,t,n,o){const s=e._endId=++N$,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=Lx(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,p),i()},p=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,p)}function Lx(e,t){const n=window.getComputedStyle(e),o=f=>(n[f]||"").split(", "),s=o(`${yr}Delay`),i=o(`${yr}Duration`),r=Mb(s,i),l=o(`${Uc}Delay`),a=o(`${Uc}Duration`),c=Mb(l,a);let u=null,d=0,p=0;t===yr?r>0&&(u=yr,d=r,p=i.length):t===Uc?c>0&&(u=Uc,d=c,p=a.length):(d=Math.max(r,c),u=d>0?r>c?yr:Uc:null,p=u?u===yr?i.length:a.length:0);const h=u===yr&&/\b(?:transform|all)(?:,|$)/.test(o(`${yr}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:h}}function Mb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>Eb(n)+Eb(e[o])))}function Eb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ov(e){return(e?e.ownerDocument:document).body.offsetHeight}function L$(e,t,n){const o=e[ic];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const sp=Symbol("_vod"),Ox=Symbol("_vsh"),Qs={name:"show",beforeMount(e,{value:t},{transition:n}){e[sp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):qc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),qc(e,!0),o.enter(e)):o.leave(e,()=>{qc(e,!1)}):qc(e,t))},beforeUnmount(e,{value:t}){qc(e,t)}};function qc(e,t){e.style.display=t?e[sp]:"none",e[Ox]=!t}function O$(){Qs.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const Px=Symbol("");function Zpe(e){const t=Oo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>ip(i,s))},o=()=>{const s=e(t.proxy);t.ce?ip(t.ce,s):Pv(t.subTree,s),n(s)};JC(()=>{Yf(o)}),hn(()=>{Ke(o,Js,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),kn(()=>s.disconnect())})}function Pv(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Pv(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ip(e.el,t);else if(e.type===Le)e.children.forEach(n=>Pv(n,t));else if(e.type===Ga){let{el:n,anchor:o}=e;for(;n&&(ip(n,t),n!==o);)n=n.nextSibling}}function ip(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=$E(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[Px]=o}}const P$=/(?:^|;)\s*display\s*:/;function R$(e,t,n){const o=e.style,s=yn(n);let i=!1;if(n&&!s){if(t)if(yn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&eu(o,l,"")}else for(const r in t)n[r]==null&&eu(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?B$(e,r,!yn(t)&&t?t[r]:void 0,l)||eu(o,r,l):eu(o,r,"")}}else if(s){if(t!==n){const r=o[Px];r&&(n+=";"+r),o.cssText=n,i=P$.test(n)}}else t&&e.removeAttribute("style");sp in e&&(e[sp]=i?o.display:"",e[Ox]&&(o.display="none"))}const Ib=/\s*!important$/;function eu(e,t,n){if(yt(n))n.forEach(o=>eu(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=D$(e,t);Ib.test(n)?e.setProperty(fs(o),n.replace(Ib,""),"important"):e[o]=n}}const $b=["Webkit","Moz","ms"],Qm={};function D$(e,t){const n=Qm[t];if(n)return n;let o=vo(t);if(o!=="filter"&&o in e)return Qm[t]=o;o=Qp(o);for(let s=0;s<$b.length;s++){const i=$b[s]+o;if(i in e)return Qm[t]=i}return t}function B$(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&yn(o)&&n===o}const Nb="http://www.w3.org/1999/xlink";function Lb(e,t,n,o,s,i=EE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Nb,t.slice(6,t.length)):e.setAttributeNS(Nb,t,n):n==null||i&&!gC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Ps(n)?String(n):n)}function Ob(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ex(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=gC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Yi(e,t,n,o){e.addEventListener(t,n,o)}function F$(e,t,n,o){e.removeEventListener(t,n,o)}const Pb=Symbol("_vei");function H$(e,t,n,o,s=null){const i=e[Pb]||(e[Pb]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=W$(t);if(o){const c=i[t]=q$(o,s);Yi(e,l,c,a)}else r&&(F$(e,l,r,a),i[t]=void 0)}}const Rb=/(?:Once|Passive|Capture)$/;function W$(e){let t;if(Rb.test(e)){t={};let o;for(;o=e.match(Rb);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):fs(e.slice(2)),t]}let Zm=0;const z$=Promise.resolve(),U$=()=>Zm||(z$.then(()=>Zm=0),Zm=Date.now());function q$(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(yt(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&ti(c,t,5,l)}}else ti(s,t,5,[o])};return n.value=e,n.attached=U$(),n}const Db=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,j$=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?L$(e,o,r):t==="style"?R$(e,n,o):Ju(t)?Kp(t)||H$(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):V$(e,t,o,r))?(Ob(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Lb(e,t,o,r,i,t!=="value")):e._isVueCE&&(K$(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!yn(o)))?Ob(e,vo(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Lb(e,t,o,r))};function V$(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Db(t)&&At(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Db(t)&&yn(n)?!1:t in e}function K$(e,t){const n=e._def.props;if(!n)return!1;const o=vo(t);return Array.isArray(n)?n.some(s=>vo(s)===o):Object.keys(n).some(s=>vo(s)===o)}const Bb={};function G$(e,t,n){let o=je(e,t);Gp(o)&&(o=pn({},o,t));class s extends d0{constructor(r){super(o,r,n)}}return s.def=o,s}const Jpe=((e,t)=>G$(e,t,d6)),Y$=typeof HTMLElement<"u"?HTMLElement:class{};class d0 extends Y${constructor(t,n={},o=ap){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==ap?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(pn({},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 d0){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,ht(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!yt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Uf(this._props[a])),(l||(l=Object.create(null)))[vo(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)sn(this,o)||Object.defineProperty(this,o,{get:()=>x(n[o])})}_resolveProps(t){const{props:n}=t,o=yt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(vo))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Bb;const s=vo(t);n&&this._numberProps&&this._numberProps[s]&&(o=Uf(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Bb?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(fs(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(fs(t),n+""):n||this.removeAttribute(fs(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),u6(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=se(this._def,pn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Gp(r[0])?pn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),fs(i)!==i&&s(fs(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function X$(e){const t=Oo(),n=t&&t.ce;return n||null}function ehe(){const e=X$();return e&&e.shadowRoot}function the(e="$style"){{const t=Oo();if(!t)return zt;const n=t.type.__cssModules;if(!n)return zt;const o=n[e];return o||zt}}const Rx=new WeakMap,Dx=new WeakMap,rp=Symbol("_moveCb"),Fb=Symbol("_enterCb"),Q$=e=>(delete e.props.mode,e),Z$=Q$({name:"TransitionGroup",props:pn({},$x,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Oo(),o=KC();let s,i;return e0(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!o6(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(e6),s.forEach(t6);const l=s.filter(n6);Ov(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;xi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[rp]=p=>{p&&p.target!==c||(!p||p.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[rp]=null,Mr(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=Kt(e),l=Nx(r);let a=r.tag||Le;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Vr(u,Eu(u,l,o,n)),Rx.set(u,Bx(u.el)))}i=t.default?Z1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Vr(u,Eu(u,l,o,n))}return se(a,null,i)}}}),J$=Z$;function e6(e){const t=e.el;t[rp]&&t[rp](),t[Fb]&&t[Fb]()}function t6(e){Dx.set(e,Bx(e.el))}function n6(e){const t=Rx.get(e),n=Dx.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function Bx(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function o6(e,t,n){const o=e.cloneNode(),s=e[ic];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=Lx(o);return i.removeChild(o),r}const Yr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return yt(t)?n=>qa(t,n):t};function s6(e){e.target.composing=!0}function Hb(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ei=Symbol("_assign");function Wb(e,t,n){return t&&(e=e.trim()),n&&(e=Zp(e)),e}const ks={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[ei]=Yr(s);const i=o||s.props&&s.props.type==="number";Yi(e,t?"change":"input",r=>{r.target.composing||e[ei](Wb(e.value,n,i))}),(n||i)&&Yi(e,"change",()=>{e.value=Wb(e.value,n,i)}),t||(Yi(e,"compositionstart",s6),Yi(e,"compositionend",Hb),Yi(e,"change",Hb))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[ei]=Yr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Zp(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},lp={deep:!0,created(e,t,n){e[ei]=Yr(n),Yi(e,"change",()=>{const o=e._modelValue,s=rc(e),i=e.checked,r=e[ei];if(yt(o)){const l=eh(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Xl(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(Hx(e,i))})},mounted:zb,beforeUpdate(e,t,n){e[ei]=Yr(n),zb(e,t,n)}};function zb(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(yt(t))s=eh(t,o.props.value)>-1;else if(Xl(t))s=t.has(o.props.value);else{if(t===n)return;s=tr(t,Hx(e,!0))}e.checked!==s&&(e.checked=s)}const Fx={created(e,{value:t},n){e.checked=tr(t,n.props.value),e[ei]=Yr(n),Yi(e,"change",()=>{e[ei](rc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[ei]=Yr(o),t!==n&&(e.checked=tr(t,o.props.value))}},Rv={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Xl(t);Yi(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Zp(rc(r)):rc(r));e[ei](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,ht(()=>{e._assigning=!1})}),e[ei]=Yr(o)},mounted(e,{value:t}){Ub(e,t)},beforeUpdate(e,t,n){e[ei]=Yr(n)},updated(e,{value:t}){e._assigning||Ub(e,t)}};function Ub(e,t){const n=e.multiple,o=yt(t);if(!(n&&!o&&!Xl(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=rc(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=eh(t,l)>-1}else r.selected=t.has(l);else if(tr(rc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function rc(e){return"_value"in e?e._value:e.value}function Hx(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const i6={created(e,t,n){Yd(e,t,n,null,"created")},mounted(e,t,n){Yd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Yd(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Yd(e,t,n,o,"updated")}};function Wx(e,t){switch(e){case"SELECT":return Rv;case"TEXTAREA":return ks;default:switch(t){case"checkbox":return lp;case"radio":return Fx;default:return ks}}}function Yd(e,t,n,o,s){const r=Wx(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function r6(){ks.getSSRProps=({value:e})=>({value:e}),Fx.getSSRProps=({value:e},t)=>{if(t.props&&tr(t.props.value,e))return{checked:!0}},lp.getSSRProps=({value:e},t)=>{if(yt(e)){if(t.props&&eh(e,t.props.value)>-1)return{checked:!0}}else if(Xl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},i6.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=Wx(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const l6=["ctrl","shift","alt","meta"],a6={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)=>l6.some(n=>e[`${n}Key`]&&!t.includes(n))},vt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=a6[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},c6={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},di=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=fs(s.key);if(t.some(r=>r===i||c6[r]===i))return e(s)}))},zx=pn({patchProp:j$},E$);let cu,qb=!1;function Ux(){return cu||(cu=a$(zx))}function qx(){return cu=qb?cu:c$(zx),qb=!0,cu}const u6=((...e)=>{Ux().render(...e)}),nhe=((...e)=>{qx().hydrate(...e)}),ap=((...e)=>{const t=Ux().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=Vx(o);if(!s)return;const i=t._component;!At(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,jx(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),d6=((...e)=>{const t=qx().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=Vx(o);if(s)return n(s,!0,jx(s))},t});function jx(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Vx(e){return yn(e)?document.querySelector(e):e}let jb=!1;const ohe=()=>{jb||(jb=!0,r6(),O$())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function f6(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const cp=typeof window<"u",tl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),p6=(e,t,n)=>h6({l:e,k:t,s:n}),h6=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),ro=e=>typeof e=="number"&&isFinite(e),Kx=e=>p0(e)==="[object Date]",lc=e=>p0(e)==="[object RegExp]",dh=e=>jt(e)&&Object.keys(e).length===0,ao=Object.assign,m6=Object.create,vn=(e=null)=>m6(e);let Vb;const Pl=()=>Vb||(Vb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:vn());function Kb(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function g6(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const v6=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,y6=/^(?:href|src|action|formaction)$/i;function f0(e){return v6.test(e)}function k6(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const p=e[l];if(c){p===c&&(c=null);continue}if(p==='"'||p==="'")c=p;else if(p==="(")a++;else if(p===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(o,i),n+=f0(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function Gb(e,t){if(y6.test(e)&&f0(t))return"about:blank";const n=e.toLowerCase()==="style"?k6(t):t;return g6(n)}function b6(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${Gb(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${Gb(o,s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,o,s)=>f0(s)?`${o}about:blank`:n),e}const _6=Object.prototype.hasOwnProperty;function Zs(e,t){return _6.call(e,t)}const Yn=Array.isArray,Pn=e=>typeof e=="function",pt=e=>typeof e=="string",Jt=e=>typeof e=="boolean",en=e=>e!==null&&typeof e=="object",w6=e=>en(e)&&Pn(e.then)&&Pn(e.catch),Gx=Object.prototype.toString,p0=e=>Gx.call(e),jt=e=>p0(e)==="[object Object]",S6=e=>e==null?"":Yn(e)||jt(e)&&e.toString===Gx?JSON.stringify(e,null,2):String(e);function h0(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Xd=e=>!en(e)||Yn(e);function xf(e,t){if(Xd(e)||Xd(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(en(o[i])&&!en(s[i])&&(s[i]=Array.isArray(o[i])?[]:vn()),Xd(s[i])||Xd(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function C6(e,t,n){return{line:e,column:t,offset:n}}function Dv(e,t,n){return{start:e,end:t}}const an={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},x6=17;function fh(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function A6(e){throw e}const Si=" ",T6="\r",Bo=`
|
|
29
|
-
`,M6="\u2028",E6="\u2029";function I6(e){const t=e;let n=0,o=1,s=1,i=0;const r=$=>t[$]===T6&&t[$+1]===Bo,l=$=>t[$]===Bo,a=$=>t[$]===E6,c=$=>t[$]===M6,u=$=>r($)||l($)||a($)||c($),d=()=>n,p=()=>o,h=()=>s,f=()=>i,m=$=>r($)||a($)||c($)?Bo:t[$],b=()=>m(n),_=()=>m(n+i);function g(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,o=1,s=1,i=0}function A($=0){i=$}function O(){const $=n+i;for(;$!==n;)g();i=0}return{index:d,line:p,column:h,peekOffset:f,charAt:m,currentChar:b,currentPeek:_,next:g,peek:v,reset:y,resetPeek:A,skipToPeek:O}}const Wi=void 0,$6=".",Yb="'",N6="tokenizer";function L6(e,t={}){const n=t.location!==!1,o=I6(e),s=()=>o.index(),i=()=>C6(o.line(),o.column(),o.index()),r=i(),l=s(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(j,Y,re,...ge){const Ae=c();if(Y.column+=re,Y.offset+=re,u){const Ie=n?Dv(Ae.startLoc,Y):null,ae=fh(j,Ie,{domain:N6,args:ge});u(ae)}}function p(j,Y,re){j.endLoc=i(),j.currentType=Y;const ge={type:Y};return n&&(ge.loc=Dv(j.startLoc,j.endLoc)),re!=null&&(ge.value=re),ge}const h=j=>p(j,13);function f(j,Y){return j.currentChar()===Y?(j.next(),Y):(d(an.EXPECTED_TOKEN,i(),0,Y),"")}function m(j){let Y="";for(;j.currentPeek()===Si||j.currentPeek()===Bo;)Y+=j.currentPeek(),j.peek();return Y}function b(j){const Y=m(j);return j.skipToPeek(),Y}function _(j){if(j===Wi)return!1;const Y=j.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function g(j){if(j===Wi)return!1;const Y=j.charCodeAt(0);return Y>=48&&Y<=57}function v(j,Y){const{currentType:re}=Y;if(re!==2)return!1;m(j);const ge=_(j.currentPeek());return j.resetPeek(),ge}function y(j,Y){const{currentType:re}=Y;if(re!==2)return!1;m(j);const ge=j.currentPeek()==="-"?j.peek():j.currentPeek(),Ae=g(ge);return j.resetPeek(),Ae}function A(j,Y){const{currentType:re}=Y;if(re!==2)return!1;m(j);const ge=j.currentPeek()===Yb;return j.resetPeek(),ge}function O(j,Y){const{currentType:re}=Y;if(re!==7)return!1;m(j);const ge=j.currentPeek()===".";return j.resetPeek(),ge}function $(j,Y){const{currentType:re}=Y;if(re!==8)return!1;m(j);const ge=_(j.currentPeek());return j.resetPeek(),ge}function k(j,Y){const{currentType:re}=Y;if(!(re===7||re===11))return!1;m(j);const ge=j.currentPeek()===":";return j.resetPeek(),ge}function E(j,Y){const{currentType:re}=Y;if(re!==9)return!1;const ge=()=>{const Ie=j.currentPeek();return Ie==="{"?_(j.peek()):Ie==="@"||Ie==="|"||Ie===":"||Ie==="."||Ie===Si||!Ie?!1:Ie===Bo?(j.peek(),ge()):L(j,!1)},Ae=ge();return j.resetPeek(),Ae}function M(j){m(j);const Y=j.currentPeek()==="|";return j.resetPeek(),Y}function L(j,Y=!0){const re=(Ae=!1,Ie="")=>{const ae=j.currentPeek();return ae==="{"||ae==="@"||!ae?Ae:ae==="|"?!(Ie===Si||Ie===Bo):ae===Si?(j.peek(),re(!0,Si)):ae===Bo?(j.peek(),re(!0,Bo)):!0},ge=re();return Y&&j.resetPeek(),ge}function S(j,Y){const re=j.currentChar();return re===Wi?Wi:Y(re)?(j.next(),re):null}function I(j){const Y=j.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36}function P(j){return S(j,I)}function D(j){const Y=j.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36||Y===45}function W(j){return S(j,D)}function z(j){const Y=j.charCodeAt(0);return Y>=48&&Y<=57}function q(j){return S(j,z)}function Q(j){const Y=j.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function X(j){return S(j,Q)}function fe(j){let Y="",re="";for(;Y=q(j);)re+=Y;return re}function ye(j){let Y="";for(;;){const re=j.currentChar();if(re==="\\"){const ge=j.peek();ge==="{"||ge==="}"||ge==="@"||ge==="|"||ge==="\\"?(Y+=re+ge,j.next(),j.next()):(j.resetPeek(),Y+=re,j.next())}else{if(re==="{"||re==="}"||re==="@"||re==="|"||!re)break;if(re===Si||re===Bo)if(L(j))Y+=re,j.next();else{if(M(j))break;Y+=re,j.next()}else Y+=re,j.next()}}return Y}function Me(j){b(j);let Y="",re="";for(;Y=W(j);)re+=Y;const ge=j.currentChar();if(ge&&ge!=="}"&&ge!==Wi&&ge!==Si&&ge!==Bo&&ge!==" "){const Ae=U(j);return d(an.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re+Ae),re+Ae}return j.currentChar()===Wi&&d(an.UNTERMINATED_CLOSING_BRACE,i(),0),re}function we(j){b(j);let Y="";return j.currentChar()==="-"?(j.next(),Y+=`-${fe(j)}`):Y+=fe(j),j.currentChar()===Wi&&d(an.UNTERMINATED_CLOSING_BRACE,i(),0),Y}function ze(j){return j!==Yb&&j!==Bo}function Ue(j){b(j),f(j,"'");let Y="",re="";for(;Y=S(j,ze);)Y==="\\"?re+=Fe(j):re+=Y;const ge=j.currentChar();return ge===Bo||ge===Wi?(d(an.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ge===Bo&&(j.next(),f(j,"'")),re):(f(j,"'"),re)}function Fe(j){const Y=j.currentChar();switch(Y){case"\\":case"'":return j.next(),`\\${Y}`;case"u":return rt(j,Y,4);case"U":return rt(j,Y,6);default:return d(an.UNKNOWN_ESCAPE_SEQUENCE,i(),0,Y),""}}function rt(j,Y,re){f(j,Y);let ge="";for(let Ae=0;Ae<re;Ae++){const Ie=X(j);if(!Ie){d(an.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${Y}${ge}${j.currentChar()}`);break}ge+=Ie}return`\\${Y}${ge}`}function le(j){return j!=="{"&&j!=="}"&&j!==Si&&j!==Bo}function U(j){b(j);let Y="",re="";for(;Y=S(j,le);)re+=Y;return re}function G(j){let Y="",re="";for(;Y=P(j);)re+=Y;return re}function ne(j){const Y=re=>{const ge=j.currentChar();return ge==="{"||ge==="@"||ge==="|"||ge==="("||ge===")"||!ge||ge===Si?re:(re+=ge,j.next(),Y(re))};return Y("")}function H(j){b(j);const Y=f(j,"|");return b(j),Y}function J(j,Y){let re=null;switch(j.currentChar()){case"{":return Y.braceNest>=1&&d(an.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),re=p(Y,2,"{"),b(j),Y.braceNest++,re;case"}":return Y.braceNest>0&&Y.currentType===2&&d(an.EMPTY_PLACEHOLDER,i(),0),j.next(),re=p(Y,3,"}"),Y.braceNest--,Y.braceNest>0&&b(j),Y.inLinked&&Y.braceNest===0&&(Y.inLinked=!1),re;case"@":return Y.braceNest>0&&d(an.UNTERMINATED_CLOSING_BRACE,i(),0),re=ce(j,Y)||h(Y),Y.braceNest=0,re;default:{let Ae=!0,Ie=!0,ae=!0;if(M(j))return Y.braceNest>0&&d(an.UNTERMINATED_CLOSING_BRACE,i(),0),re=p(Y,1,H(j)),Y.braceNest=0,Y.inLinked=!1,re;if(Y.braceNest>0&&(Y.currentType===4||Y.currentType===5||Y.currentType===6))return d(an.UNTERMINATED_CLOSING_BRACE,i(),0),Y.braceNest=0,te(j,Y);if(Ae=v(j,Y))return re=p(Y,4,Me(j)),b(j),re;if(Ie=y(j,Y))return re=p(Y,5,we(j)),b(j),re;if(ae=A(j,Y))return re=p(Y,6,Ue(j)),b(j),re;if(!Ae&&!Ie&&!ae)return re=p(Y,12,U(j)),d(an.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re.value),b(j),re;break}}return re}function ce(j,Y){const{currentType:re}=Y;let ge=null;const Ae=j.currentChar();switch((re===7||re===8||re===11||re===9)&&(Ae===Bo||Ae===Si)&&d(an.INVALID_LINKED_FORMAT,i(),0),Ae){case"@":return j.next(),ge=p(Y,7,"@"),Y.inLinked=!0,ge;case".":return b(j),j.next(),p(Y,8,".");case":":return b(j),j.next(),p(Y,9,":");default:return M(j)?(ge=p(Y,1,H(j)),Y.braceNest=0,Y.inLinked=!1,ge):O(j,Y)||k(j,Y)?(b(j),ce(j,Y)):$(j,Y)?(b(j),p(Y,11,G(j))):E(j,Y)?(b(j),Ae==="{"?J(j,Y)||ge:p(Y,10,ne(j))):(re===7&&d(an.INVALID_LINKED_FORMAT,i(),0),Y.braceNest=0,Y.inLinked=!1,te(j,Y))}}function te(j,Y){let re={type:13};if(Y.braceNest>0)return J(j,Y)||h(Y);if(Y.inLinked)return ce(j,Y)||h(Y);switch(j.currentChar()){case"{":return J(j,Y)||h(Y);case"}":return d(an.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),p(Y,3,"}");case"@":return ce(j,Y)||h(Y);default:{if(M(j))return re=p(Y,1,H(j)),Y.braceNest=0,Y.inLinked=!1,re;if(L(j))return p(Y,0,ye(j));break}}return re}function ue(){const{currentType:j,offset:Y,startLoc:re,endLoc:ge}=a;return a.lastType=j,a.lastOffset=Y,a.lastStartLoc=re,a.lastEndLoc=ge,a.offset=s(),a.startLoc=i(),o.currentChar()===Wi?p(a,13):te(o,a)}return{nextToken:ue,currentOffset:s,currentPosition:i,context:c}}const O6="parser",P6=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,R6=/\\([\\@{}|])/g;function D6(e,t){return t}function B6(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function F6(e={}){const t=e.location!==!1,{onError:n}=e;function o(_,g,v,y,...A){const O=_.currentPosition();if(O.offset+=y,O.column+=y,n){const $=t?Dv(v,O):null,k=fh(g,$,{domain:O6,args:A});n(k)}}function s(_,g,v){const y={type:_};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(_,g,v,y){t&&(_.end=g,_.loc&&(_.loc.end=v))}function r(_,g){const v=_.context(),y=s(3,v.offset,v.startLoc);return y.value=g.replace(R6,D6),i(y,_.currentOffset(),_.currentPosition()),y}function l(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:A}=v,O=s(5,y,A);return O.index=parseInt(g,10),_.nextToken(),i(O,_.currentOffset(),_.currentPosition()),O}function a(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:A}=v,O=s(4,y,A);return O.key=g,_.nextToken(),i(O,_.currentOffset(),_.currentPosition()),O}function c(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:A}=v,O=s(9,y,A);return O.value=g.replace(P6,B6),_.nextToken(),i(O,_.currentOffset(),_.currentPosition()),O}function u(_){const g=_.nextToken(),v=_.context(),{lastOffset:y,lastStartLoc:A}=v,O=s(8,y,A);return g.type!==11?(o(_,an.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),O.value="",i(O,y,A),{nextConsumeToken:g,node:O}):(g.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ci(g)),O.value=g.value||"",i(O,_.currentOffset(),_.currentPosition()),{node:O})}function d(_,g){const v=_.context(),y=s(7,v.offset,v.startLoc);return y.value=g,i(y,_.currentOffset(),_.currentPosition()),y}function p(_){const g=_.context(),v=s(6,g.offset,g.startLoc);let y=_.nextToken();if(y.type===8){const A=u(_);v.modifier=A.node,y=A.nextConsumeToken||_.nextToken()}switch(y.type!==9&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(y)),y=_.nextToken(),y.type===2&&(y=_.nextToken()),y.type){case 10:y.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(y)),v.key=d(_,y.value||"");break;case 4:y.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(y)),v.key=a(_,y.value||"");break;case 5:y.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(y)),v.key=l(_,y.value||"");break;case 6:y.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(y)),v.key=c(_,y.value||"");break;default:{o(_,an.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const A=_.context(),O=s(7,A.offset,A.startLoc);return O.value="",i(O,A.offset,A.startLoc),v.key=O,i(v,A.offset,A.startLoc),{nextConsumeToken:y,node:v}}}return i(v,_.currentOffset(),_.currentPosition()),{node:v}}function h(_){const g=_.context(),v=g.currentType===1?_.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,A=s(2,v,y);A.items=[];let O=null;do{const E=O||_.nextToken();switch(O=null,E.type){case 0:E.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(E)),A.items.push(r(_,E.value||""));break;case 5:E.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(E)),A.items.push(l(_,E.value||""));break;case 4:E.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(E)),A.items.push(a(_,E.value||""));break;case 6:E.value==null&&o(_,an.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Ci(E)),A.items.push(c(_,E.value||""));break;case 7:{const M=p(_);A.items.push(M.node),O=M.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const $=g.currentType===1?g.lastOffset:_.currentOffset(),k=g.currentType===1?g.lastEndLoc:_.currentPosition();return i(A,$,k),A}function f(_,g,v,y){const A=_.context();let O=y.items.length===0;const $=s(1,g,v);$.cases=[],$.cases.push(y);do{const k=h(_);O||(O=k.items.length===0),$.cases.push(k)}while(A.currentType!==13);return O&&o(_,an.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i($,_.currentOffset(),_.currentPosition()),$}function m(_){const g=_.context(),{offset:v,startLoc:y}=g,A=h(_);return g.currentType===13?A:f(_,v,y,A)}function b(_){const g=L6(_,ao({},e)),v=g.context(),y=s(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=_),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(_)),v.currentType!==13&&o(g,an.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,_[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:b}}function Ci(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 H6(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Xb(e,t){for(let n=0;n<e.length;n++)m0(e[n],t)}function m0(e,t){switch(e.type){case 1:Xb(e.cases,t),t.helper("plural");break;case 2:Xb(e.items,t);break;case 6:{m0(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 W6(e,t={}){const n=H6(e);n.helper("normalize"),e.body&&m0(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function z6(e){const t=e.body;return t.type===2?Qb(t):t.cases.forEach(n=>Qb(n)),e}function Qb(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=h0(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function Ma(e){switch(e.t=e.type,e.type){case 0:{const t=e;Ma(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)Ma(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)Ma(n[o]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Ma(t.key),t.k=t.key,delete t.key,t.modifier&&(Ma(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 U6(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,b){r.code+=m}function c(m,b=!0){const _=b?o:"";a(s?_+" ".repeat(m):_)}function u(m=!0){const b=++r.indentLevel;m&&c(b)}function d(m=!0){const b=--r.indentLevel;m&&c(b)}function p(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:p,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function q6(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),ac(e,t.key),t.modifier?(e.push(", "),ac(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function j6(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(ac(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function V6(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(ac(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function K6(e,t){t.body?ac(e,t.body):e.push("null")}function ac(e,t){const{helper:n}=e;switch(t.type){case 0:K6(e,t);break;case 1:V6(e,t);break;case 2:j6(e,t);break;case 6:q6(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 G6=(e,t={})=>{const n=pt(t.mode)?t.mode:"normal",o=pt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=U6(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${h0(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),ac(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 Y6(e,t={}){const n=ao({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=F6(n).parse(e);return o?(i&&z6(l),s&&Ma(l),{ast:l,code:""}):(W6(l,n),G6(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function X6(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Pl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Pl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function $i(e){return en(e)&&g0(e)===0&&(Zs(e,"b")||Zs(e,"body"))}const Yx=["b","body"];function Q6(e){return nl(e,Yx)}const Xx=["c","cases"];function Z6(e){return nl(e,Xx,[])}const Qx=["s","static"];function J6(e){return nl(e,Qx)}const Zx=["i","items"];function eN(e){return nl(e,Zx,[])}const Jx=["t","type"];function g0(e){return nl(e,Jx)}const eA=["v","value"];function Qd(e,t){const n=nl(e,eA);if(n!=null)return n;throw Lu(t)}const tA=["m","modifier"];function tN(e){return nl(e,tA)}const nA=["k","key"];function nN(e){const t=nl(e,nA);if(t)return t;throw Lu(6)}function nl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(Zs(e,s)&&e[s]!=null)return e[s]}return n}const oA=[...Yx,...Xx,...Qx,...Zx,...nA,...tA,...eA,...Jx];function Lu(e){return new Error(`unhandled node type: ${e}`)}function Jm(e){return n=>oN(n,e)}function oN(e,t){const n=Q6(t);if(n==null)throw Lu(0);if(g0(n)===1){const i=Z6(n);return e.plural(i.reduce((r,l)=>[...r,Zb(e,l)],[]))}else return Zb(e,n)}function Zb(e,t){const n=J6(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=eN(t).reduce((s,i)=>[...s,Bv(e,i)],[]);return e.normalize(o)}}function Bv(e,t){const n=g0(t);switch(n){case 3:return Qd(t,n);case 9:return Qd(t,n);case 4:{const o=t;if(Zs(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(Zs(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw Lu(n)}case 5:{const o=t;if(Zs(o,"i")&&ro(o.i))return e.interpolate(e.list(o.i));if(Zs(o,"index")&&ro(o.index))return e.interpolate(e.list(o.index));throw Lu(n)}case 6:{const o=t,s=tN(o),i=nN(o);return e.linked(Bv(e,i),s?Bv(e,s):void 0,e.type)}case 7:return Qd(t,n);case 8:return Qd(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const sN=e=>e;let Zd=vn();function iN(e,t={}){let n=!1;const o=t.onError||A6;return t.onError=s=>{n=!0,o(s)},{...Y6(e,t),detectError:n}}function rN(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&pt(e)){Jt(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||sN)(e),s=Zd[o];if(s)return s;const{ast:i,detectError:r}=iN(e,{...t,location:!1,jit:!0}),l=Jm(i);return r?l:Zd[o]=l}else{const n=e.cacheKey;if(n){const o=Zd[n];return o||(Zd[n]=Jm(e))}else return Jm(e)}}let Ou=null;function lN(e){Ou=e}function aN(e,t,n){Ou&&Ou.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const cN=uN("function:translate");function uN(e){return t=>Ou&&Ou.emit(e,t)}const Xi={INVALID_ARGUMENT:x6,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},dN=24;function Qi(e){return fh(e,null,void 0)}function v0(e,t){return t.locale!=null?Jb(t.locale):Jb(e.locale)}let eg;function Jb(e){if(pt(e))return e;if(Pn(e)){if(e.resolvedOnce&&eg!=null)return eg;if(e.constructor.name==="Function"){const t=e();if(w6(t))throw Qi(Xi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return eg=t}else throw Qi(Xi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Qi(Xi.NOT_SUPPORT_LOCALE_TYPE)}function fN(e,t,n){return[...new Set([n,...Yn(t)?t:en(t)?Object.keys(t):pt(t)?[t]:[n]])]}function Fv(e,t,n){const o=pt(n)?n:Pu,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;Yn(r);)r=e_(i,r,t);const l=Yn(t)||!jt(t)?t:t.default?t.default:null;r=pt(l)?[l]:l,Yn(r)&&e_(i,r,!1),s.__localeChainCache.set(o,i)}return i}function e_(e,t,n){let o=!0;for(let s=0;s<t.length&&Jt(o);s++){const i=t[s];pt(i)&&(o=pN(e,t[s],n))}return o}function pN(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=hN(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function hN(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(Yn(n)||jt(n))&&n[s]&&(o=n[s])}return o}const ol=[];ol[0]={w:[0],i:[3,0],"[":[4],o:[7]};ol[1]={w:[1],".":[2],"[":[4],o:[7]};ol[2]={w:[2],i:[3,0],0:[3,0]};ol[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};ol[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};ol[5]={"'":[4,0],o:8,l:[5,0]};ol[6]={'"':[4,0],o:8,l:[6,0]};const mN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function gN(e){return mN.test(e)}function vN(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 yN(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 kN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:gN(t)?vN(t):"*"+t}function bN(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const p=[];p[0]=()=>{r===void 0?r=l:r+=l},p[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),s++},p[3]=()=>{if(s>0)s--,o=4,p[0]();else{if(s=0,r===void 0||(r=kN(r),r===!1))return!1;p[1]()}};function h(){const f=e[n+1];if(o===5&&f==="'"||o===6&&f==='"')return n++,l="\\"+f,p[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=yN(i),d=ol[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=p[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const t_=new Map;function _N(e,t){return en(e)?e[t]:null}function wN(e,t){if(!en(e))return null;let n=t_.get(t);if(n||(n=bN(t),n&&t_.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(oA.includes(r)&&$i(s)||!en(s)||!Zs(s,r))return null;const l=s[r];if(l===void 0||Pn(s))return null;s=l,i++}return s}const SN="11.4.5",ph=-1,Pu="en-US",up="",n_=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function CN(){return{upper:(e,t)=>t==="text"&&pt(e)?e.toUpperCase():t==="vnode"&&en(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&pt(e)?e.toLowerCase():t==="vnode"&&en(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&pt(e)?n_(e):t==="vnode"&&en(e)&&"__v_isVNode"in e?n_(e.children):e}}let sA;function xN(e){sA=e}let iA;function AN(e){iA=e}let rA;function TN(e){rA=e}let lA=null;const MN=e=>{lA=e},EN=()=>lA;let aA=null;const o_=e=>{aA=e},IN=()=>aA;let s_=0;function $N(e={}){const t=Pn(e.onWarn)?e.onWarn:f6,n=pt(e.version)?e.version:SN,o=pt(e.locale)||Pn(e.locale)?e.locale:Pu,s=Pn(o)?Pu:o,i=Yn(e.fallbackLocale)||jt(e.fallbackLocale)||pt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=jt(e.messages)?e.messages:tg(s),l=jt(e.datetimeFormats)?e.datetimeFormats:tg(s),a=jt(e.numberFormats)?e.numberFormats:tg(s),c=ao(vn(),e.modifiers,CN()),u=e.pluralRules||vn(),d=Pn(e.missing)?e.missing:null,p=Jt(e.missingWarn)||lc(e.missingWarn)?e.missingWarn:!0,h=Jt(e.fallbackWarn)||lc(e.fallbackWarn)?e.fallbackWarn:!0,f=!!e.fallbackFormat,m=!!e.unresolving,b=Pn(e.postTranslation)?e.postTranslation:null,_=jt(e.processor)?e.processor:null,g=Jt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Pn(e.messageCompiler)?e.messageCompiler:sA,A=Pn(e.messageResolver)?e.messageResolver:iA||_N,O=Pn(e.localeFallbacker)?e.localeFallbacker:rA||fN,$=en(e.fallbackContext)?e.fallbackContext:void 0,k=e,E=en(k.__datetimeFormatters)?k.__datetimeFormatters:new Map,M=en(k.__numberFormatters)?k.__numberFormatters:new Map,L=en(k.__meta)?k.__meta:{};s_++;const S={version:n,cid:s_,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:p,fallbackWarn:h,fallbackFormat:f,unresolving:m,postTranslation:b,processor:_,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:A,localeFallbacker:O,fallbackContext:$,onWarn:t,__meta:L};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=E,S.__numberFormatters=M,__INTLIFY_PROD_DEVTOOLS__&&aN(S,n,L),S}const tg=e=>({[e]:vn()});function y0(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return pt(l)?l:t}else return t}function jc(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function NN(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function LN(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(NN(e,t[o]))return!0;return!1}function i_(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!pt(t[0])&&!Kx(t[0])&&!ro(t[0]))return up;const[a,c,u,d]=Hv(...t),p=Jt(u.missingWarn)?u.missingWarn:e.missingWarn;Jt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,f=v0(e,u),m=r(e,s,f);if(!pt(a)||a===""){const O=new Intl.DateTimeFormat(f.replace(/!/g,""),d);return h?O.formatToParts(c):O.format(c)}let b={},_,g=null;const v="datetime format";for(let O=0;O<m.length&&(_=m[O],b=n[_]||{},g=b[a],!jt(g));O++)y0(e,a,_,p,v);if(!jt(g)||!pt(_))return o?ph:a;let y=`${_}__${a}`;dh(d)||(y=`${y}__${JSON.stringify(d)}`);let A=l.get(y);return A||(A=new Intl.DateTimeFormat(_,ao({},g,d)),l.set(y,A)),h?A.formatToParts(c):A.format(c)}const cA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Hv(...e){const[t,n,o,s]=e,i=vn();let r=vn(),l;if(pt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Qi(Xi.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 Qi(Xi.INVALID_ISO_DATE_ARGUMENT)}}else if(Kx(t)){if(isNaN(t.getTime()))throw Qi(Xi.INVALID_DATE_ARGUMENT);l=t}else if(ro(t))l=t;else throw Qi(Xi.INVALID_ARGUMENT);return pt(n)?i.key=n:jt(n)&&Object.keys(n).forEach(a=>{cA.includes(a)?r[a]=n[a]:i[a]=n[a]}),pt(o)?i.locale=o:jt(o)&&(r=o),jt(s)&&(r=s),[i.key||"",l,i,r]}function r_(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function l_(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!ro(t[0]))return up;const[a,c,u,d]=Wv(...t),p=Jt(u.missingWarn)?u.missingWarn:e.missingWarn;Jt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,f=v0(e,u),m=r(e,s,f);if(!pt(a)||a===""){const O=new Intl.NumberFormat(f.replace(/!/g,""),d);return h?O.formatToParts(c):O.format(c)}let b={},_,g=null;const v="number format";for(let O=0;O<m.length&&(_=m[O],b=n[_]||{},g=b[a],!jt(g));O++)y0(e,a,_,p,v);if(!jt(g)||!pt(_))return o?ph:a;let y=`${_}__${a}`;dh(d)||(y=`${y}__${JSON.stringify(d)}`);let A=l.get(y);return A||(A=new Intl.NumberFormat(_,ao({},g,d)),l.set(y,A)),h?A.formatToParts(c):A.format(c)}const uA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Wv(...e){const[t,n,o,s]=e,i=vn();let r=vn();if(!ro(t))throw Qi(Xi.INVALID_ARGUMENT);const l=t;return pt(n)?i.key=n:jt(n)&&Object.keys(n).forEach(a=>{uA.includes(a)?r[a]=n[a]:i[a]=n[a]}),pt(o)?i.locale=o:jt(o)&&(r=o),jt(s)&&(r=s),[i.key||"",l,i,r]}function a_(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const ON=e=>e,PN=e=>"",RN="text",DN=e=>e.length===0?"":h0(e),BN=S6;function ng(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function FN(e){const t=ro(e.pluralIndex)?e.pluralIndex:-1;return ro(e.named?.count)?e.named.count:ro(e.named?.n)?e.named.n:t}function HN(e={}){const t=e.locale,n=FN(e),o=pt(t)&&Pn(e.pluralRules?.[t])?e.pluralRules[t]:ng,s=o===ng?void 0:ng,i=_=>_[o(n,_.length,s)],r=e.list||[],l=_=>r[_],a=e.named||vn();ro(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=_=>a[_];function u(_,g){const v=Pn(e.messages)?e.messages(_,!!g):en(e.messages)?e.messages[_]:!1;return v||(e.parent?e.parent.message(_):PN)}const d=_=>e.modifiers?e.modifiers[_]:ON,p=Pn(e.processor?.normalize)?e.processor.normalize:DN,h=Pn(e.processor?.interpolate)?e.processor.interpolate:BN,f=pt(e.processor?.type)?e.processor.type:RN,b={list:l,named:c,plural:i,linked:(_,...g)=>{const[v,y]=g;let A="text",O="";g.length===1?en(v)?(O=v.modifier||O,A=v.type||A):pt(v)&&(O=v||O):g.length===2&&(pt(v)&&(O=v||O),pt(y)&&(A=y||A));const $=u(_,!0)(b),k=$===""||$===void 0?_:$,E=A==="vnode"&&Yn(k)&&O?k[0]:k;return O?d(O)(E,A):E},message:u,type:f,interpolate:h,normalize:p,values:ao(vn(),r,a)};return b}const c_=()=>"",Gs=e=>Pn(e);function u_(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=zv(...t),u=Jt(c.missingWarn)?c.missingWarn:e.missingWarn,d=Jt(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,p=Jt(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,f=pt(c.default)||Jt(c.default)?Jt(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||f!=null&&(pt(f)||Pn(f)),b=v0(e,c);p&&WN(c);let[_,g,v]=h?[a,b,l[b]||vn()]:dA(e,a,b,r,d,u),y=_,A=a;if(!h&&!(pt(y)||$i(y)||Gs(y))&&m&&(y=f,A=y),!h&&(!(pt(y)||$i(y)||Gs(y))||!pt(g)))return s?ph:a;let O=!1;const $=()=>{O=!0},k=Gs(y)?y:fA(e,a,g,y,A,$);if(O)return y;const E=qN(e,g,v,c),M=HN(E),L=zN(e,k,M);let S=o?o(L,a):L;if(p&&pt(S)&&(S=b6(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:pt(a)?a:Gs(y)?y.key:"",locale:g||(Gs(y)?y.locale:""),format:pt(y)?y:Gs(y)?y.source:"",message:S};I.meta=ao({},e.__meta,EN()||{}),cN(I)}return S}function WN(e){Yn(e.list)?e.list=e.list.map(t=>pt(t)?Kb(t):t):en(e.named)&&Object.keys(e.named).forEach(t=>{pt(e.named[t])&&(e.named[t]=Kb(e.named[t]))})}function dA(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=vn(),p,h=null;const f="translate";for(let m=0;m<u.length&&(p=u[m],d=r[p]||vn(),(h=a(d,t))===null&&(h=d[t]),!(pt(h)||$i(h)||Gs(h)));m++)if(!LN(p,u)){const b=y0(e,t,p,i,f);b!==t&&(h=b)}return[h,p,d]}function fA(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Gs(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,UN(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function zN(e,t,n){return t(n)}function zv(...e){const[t,n,o]=e,s=vn();if(!pt(t)&&!ro(t)&&!Gs(t)&&!$i(t))throw Qi(Xi.INVALID_ARGUMENT);const i=ro(t)?String(t):(Gs(t),t);return ro(n)?s.plural=n:pt(n)?s.default=n:jt(n)&&!dh(n)?s.named=n:Yn(n)&&(s.list=n),ro(o)?s.plural=o:pt(o)?s.default=o:jt(o)&&ao(s,o),[i,s]}function UN(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>p6(t,n,r)}}function qN(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,p={locale:t,modifiers:s,pluralRules:i,messages:(h,f)=>{let m=r(n,h);if(m==null&&(u||f)){const[b,,_]=dA(u||e,h,t,l,a,c);m=b??r(_,h)}if(pt(m)||$i(m)){let b=!1;const g=fA(e,h,t,m,h,()=>{b=!0});return b?c_:g}else return Gs(m)?m:c_}};return e.processor&&(p.processor=e.processor),o.list&&(p.list=o.list),o.named&&(p.named=o.named),ro(o.plural)&&(p.pluralIndex=o.plural),p}X6();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const jN="11.4.5";function VN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Pl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Pl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Pl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Pl().__INTLIFY_PROD_DEVTOOLS__=!1)}const Zo={UNEXPECTED_RETURN_TYPE:dN,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 ps(e,...t){return fh(e,null,void 0)}const Uv=tl("__translateVNode"),qv=tl("__datetimeParts"),jv=tl("__numberParts"),pA=tl("__setPluralRules"),hA=tl("__injectWithOption"),Ra=tl("__dispose");function Ru(e){if(!en(e)||$i(e))return e;for(const t in e)if(Zs(e,t))if(!t.includes("."))en(e[t])&&Ru(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=vn()),!en(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||($i(s)?oA.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!$i(s)){const r=s[n[o]];en(r)&&Ru(r)}}return e}function k0(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=jt(n)?n:Yn(o)?vn():{[e]:vn()};if(Yn(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||vn(),xf(c,r[a])):xf(c,r)}else pt(l)&&xf(JSON.parse(l),r)}),s==null&&i)for(const l in r)Zs(r,l)&&Ru(r[l]);return r}function mA(e){return e.type}function gA(e,t,n){let o=en(t.messages)?t.messages:vn();"__i18nGlobal"in n&&(o=k0(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(en(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(en(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function d_(e){return se(zr,null,e,0)}function Du(){return Oo()}const f_="__INTLIFY_META__",p_=()=>[],KN=()=>!1;let h_=0;function m_(e){return((t,n,o,s)=>e(n,o,Du()||void 0,s))}const GN=()=>{const e=Du();let t=null;return e&&(t=mA(e)[f_])?{[f_]:t}:null};function dp(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=cp?Z:Ql;let r=Jt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:pt(e.locale)?e.locale:Pu),a=i(t&&r?t.fallbackLocale.value:pt(e.fallbackLocale)||Yn(e.fallbackLocale)||jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(k0(l.value,e)),u=i(jt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(jt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let p=t?t.missingWarn:Jt(e.missingWarn)||lc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:Jt(e.fallbackWarn)||lc(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:Jt(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,b=Pn(e.missing)?e.missing:null,_=Pn(e.missing)?m_(e.missing):null,g=Pn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:Jt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const A=t?t.modifiers:jt(e.modifiers)?e.modifiers:{};let O=e.pluralRules||t&&t.pluralRules,$;$=(()=>{o&&o_(null);const ae={version:jN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:O,missing:_===null?void 0:_,missingWarn:p,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ae.datetimeFormats=u.value,ae.numberFormats=d.value,ae.__datetimeFormatters=jt($)?$.__datetimeFormatters:void 0,ae.__numberFormatters=jt($)?$.__numberFormatters:void 0;const Te=$N(ae);return o&&o_(Te),Te})(),jc($,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const M=F({get:()=>l.value,set:ae=>{$.locale=ae,l.value=ae}}),L=F({get:()=>a.value,set:ae=>{$.fallbackLocale=ae,a.value=ae,jc($,l.value,ae)}}),S=F(()=>c.value),I=F(()=>u.value),P=F(()=>d.value);function D(){return Pn(g)?g:null}function W(ae){g=ae,$.postTranslation=ae}function z(){return b}function q(ae){ae!==null&&(_=m_(ae)),b=ae,$.missing=_}const Q=(ae,Te,Ve,tt,bt,kt)=>{E();let Tt;try{__INTLIFY_PROD_DEVTOOLS__,o||($.fallbackContext=t?IN():void 0),Tt=ae($)}finally{__INTLIFY_PROD_DEVTOOLS__,o||($.fallbackContext=void 0)}if(Ve!=="translate exists"&&ro(Tt)&&Tt===ph||Ve==="translate exists"&&!Tt){const[Pt,mt]=Te();return t&&f?tt(t):bt(Pt)}else{if(kt(Tt))return Tt;throw ps(Zo.UNEXPECTED_RETURN_TYPE)}};function X(...ae){return Q(Te=>Reflect.apply(u_,null,[Te,...ae]),()=>zv(...ae),"translate",Te=>Reflect.apply(Te.t,Te,[...ae]),Te=>Te,Te=>pt(Te))}function fe(...ae){const[Te,Ve,tt]=ae;if(tt&&!en(tt))throw ps(Zo.INVALID_ARGUMENT);return X(Te,Ve,ao({resolvedMessage:!0},tt||{}))}function ye(...ae){return Q(Te=>Reflect.apply(i_,null,[Te,...ae]),()=>Hv(...ae),"datetime format",Te=>Reflect.apply(Te.d,Te,[...ae]),()=>up,Te=>pt(Te)||Yn(Te))}function Me(...ae){return Q(Te=>Reflect.apply(l_,null,[Te,...ae]),()=>Wv(...ae),"number format",Te=>Reflect.apply(Te.n,Te,[...ae]),()=>up,Te=>pt(Te)||Yn(Te))}function we(ae){return ae.map(Te=>pt(Te)||ro(Te)||Jt(Te)?d_(String(Te)):Te)}const Ue={normalize:we,interpolate:ae=>ae,type:"vnode"};function Fe(...ae){return Q(Te=>{let Ve;const tt=Te;try{tt.processor=Ue,Ve=Reflect.apply(u_,null,[tt,...ae])}finally{tt.processor=null}return Ve},()=>zv(...ae),"translate",Te=>Te[Uv](...ae),Te=>[d_(Te)],Te=>Yn(Te))}function rt(...ae){return Q(Te=>Reflect.apply(l_,null,[Te,...ae]),()=>Wv(...ae),"number format",Te=>Te[jv](...ae),p_,Te=>pt(Te)||Yn(Te))}function le(...ae){return Q(Te=>Reflect.apply(i_,null,[Te,...ae]),()=>Hv(...ae),"datetime format",Te=>Te[qv](...ae),p_,Te=>pt(Te)||Yn(Te))}function U(ae){O=ae,$.pluralRules=O}function G(ae,Te){return Q(()=>{if(!ae)return!1;const Ve=pt(Te)?Te:l.value,tt=pt(Te)?[Ve]:Fv($,a.value,Ve);for(let bt=0;bt<tt.length;bt++){const kt=J(tt[bt]);let Tt=$.messageResolver(kt,ae);if(Tt===null&&(Tt=kt[ae]),$i(Tt)||Gs(Tt)||pt(Tt))return!0}return!1},()=>[ae],"translate exists",Ve=>Reflect.apply(Ve.te,Ve,[ae,Te]),KN,Ve=>Jt(Ve))}function ne(ae){let Te=null;const Ve=Fv($,a.value,l.value);for(let tt=0;tt<Ve.length;tt++){const bt=c.value[Ve[tt]]||{},kt=$.messageResolver(bt,ae);if(kt!=null){Te=kt;break}}return Te}function H(ae){const Te=ne(ae);return Te??(t?t.tm(ae)||{}:{})}function J(ae){return c.value[ae]||{}}function ce(ae,Te){if(s){const Ve={[ae]:Te};for(const tt in Ve)Zs(Ve,tt)&&Ru(Ve[tt]);Te=Ve[ae]}c.value[ae]=Te,$.messages=c.value}function te(ae,Te){c.value[ae]=c.value[ae]||{};const Ve={[ae]:Te};if(s)for(const tt in Ve)Zs(Ve,tt)&&Ru(Ve[tt]);Te=Ve[ae],xf(Te,c.value[ae]),$.messages=c.value}function ue(ae){return u.value[ae]||{}}function j(ae,Te){u.value[ae]=Te,$.datetimeFormats=u.value,r_($,ae,Te)}function Y(ae,Te){u.value[ae]=ao(u.value[ae]||{},Te),$.datetimeFormats=u.value,r_($,ae,Te)}function re(ae){return d.value[ae]||{}}function ge(ae,Te){d.value[ae]=Te,$.numberFormats=d.value,a_($,ae,Te)}function Ae(ae,Te){d.value[ae]=ao(d.value[ae]||{},Te),$.numberFormats=d.value,a_($,ae,Te)}h_++,t&&cp&&(Ke(t.locale,ae=>{r&&(l.value=ae,$.locale=ae,jc($,l.value,a.value))}),Ke(t.fallbackLocale,ae=>{r&&(a.value=ae,$.fallbackLocale=ae,jc($,l.value,a.value))}));const Ie={id:h_,locale:M,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(ae){r=ae,ae&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,jc($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return O||{}},get isGlobal(){return o},get missingWarn(){return p},set missingWarn(ae){p=ae,$.missingWarn=p},get fallbackWarn(){return h},set fallbackWarn(ae){h=ae,$.fallbackWarn=h},get fallbackRoot(){return f},set fallbackRoot(ae){f=ae},get fallbackFormat(){return m},set fallbackFormat(ae){m=ae,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(ae){v=ae,$.warnHtmlMessage=ae},get escapeParameter(){return y},set escapeParameter(ae){y=ae,$.escapeParameter=ae},t:X,getLocaleMessage:J,setLocaleMessage:ce,mergeLocaleMessage:te,getPostTranslationHandler:D,setPostTranslationHandler:W,getMissingHandler:z,setMissingHandler:q,[pA]:U};return Ie.datetimeFormats=I,Ie.numberFormats=P,Ie.rt=fe,Ie.te=G,Ie.tm=H,Ie.d=ye,Ie.n=Me,Ie.getDateTimeFormat=ue,Ie.setDateTimeFormat=j,Ie.mergeDateTimeFormat=Y,Ie.getNumberFormat=re,Ie.setNumberFormat=ge,Ie.mergeNumberFormat=Ae,Ie[hA]=n,Ie[Uv]=Fe,Ie[qv]=le,Ie[jv]=rt,Ie}function YN(e){const t=pt(e.locale)?e.locale:Pu,n=pt(e.fallbackLocale)||Yn(e.fallbackLocale)||jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Pn(e.missing)?e.missing:void 0,s=Jt(e.silentTranslationWarn)||lc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Jt(e.silentFallbackWarn)||lc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Jt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=jt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Pn(e.postTranslation)?e.postTranslation:void 0,d=pt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,p=!!e.escapeParameterHtml,h=Jt(e.sync)?e.sync:!0;let f=e.messages;if(jt(e.sharedMessages)){const A=e.sharedMessages;f=Object.keys(A).reduce(($,k)=>{const E=$[k]||($[k]={});return ao(E,A[k]),$},f||{})}const{__i18n:m,__root:b,__injectWithOption:_}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:y,datetimeFormats:g,numberFormats:v,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:p,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:b,__injectWithOption:_}}function Vv(e={}){const t=dp(YN(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return Jt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=Jt(s)?!s:s},get silentFallbackWarn(){return Jt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=Jt(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function XN(e,t,n){return{beforeCreate(){const o=Du();if(!o)throw ps(Zo.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=g_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Vv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=g_(e,s);else{this.$i18n=Vv({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&gA(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=Du();if(!o)throw ps(Zo.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function g_(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[pA](t.pluralizationRules||e.pluralizationRules);const n=k0(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const b0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function QN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Le?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},vn())}function vA(){return Le}const ZN=je({name:"i18n-t",props:ao({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ro(e)||!isNaN(e)}},b0),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||It({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=vn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=pt(e.plural)?+e.plural:e.plural);const u=QN(t,a);return s[Uv](e.keypath,u,c)},r=ao(vn(),o),l=pt(e.tag)||en(e.tag)?e.tag:vA();return en(l)?cn(l,r,{default:i}):cn(l,r,i())}}}),v_=ZN;function JN(e){return Yn(e)&&!pt(e[0])}function yA(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=vn();e.locale&&(c.locale=e.locale),pt(e.format)?c.key=e.format:en(e.format)&&(pt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,f)=>n.includes(f)?ao(vn(),h,{[f]:e.format[f]}):h,vn()));const d=o(e.value,c,u);let p=[c.key];return Yn(d)?p=d.map((h,f)=>{const m=s[h.type],b=m?m({[h.type]:h.value,index:f,parts:d}):[h.value];return JN(b)&&(b[0].key=`${h.type}-${f}`),b}):pt(d)&&(p=[d]),p},l=ao(vn(),i),a=pt(e.tag)||en(e.tag)?e.tag:vA();return en(a)?cn(a,l,{default:r}):cn(a,l,r())}}const e5=je({name:"i18n-n",props:ao({value:{type:Number,required:!0},format:{type:[String,Object]}},b0),setup(e,t){const n=e.i18n||It({useScope:e.scope,__useComponent:!0});return yA(e,t,uA,(...o)=>n[jv](...o))}}),y_=e5;function t5(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function n5(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw ps(Zo.UNEXPECTED_ERROR);const c=t5(e,l.$),u=k_(a);return[Reflect.apply(c.t,c,[...b_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);cp&&(r.__i18nWatcher=Ke(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{cp&&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=k_(l);r.textContent=Reflect.apply(a.t,a,[...b_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function k_(e){if(pt(e))return{path:e};if(jt(e)){if(!("path"in e))throw ps(Zo.REQUIRED_VALUE,"path");return e}else throw ps(Zo.INVALID_VALUE)}function b_(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return pt(n)&&(r.locale=n),ro(s)&&(r.plural=s),ro(i)&&(r.plural=i),[t,l,r]}function o5(e,t,...n){const o=jt(n[0])?n[0]:{};(Jt(o.globalInstall)?o.globalInstall:!0)&&([v_.name,"I18nT"].forEach(i=>e.component(i,v_)),[y_.name,"I18nN"].forEach(i=>e.component(i,y_)),[S_.name,"I18nD"].forEach(i=>e.component(i,S_))),e.directive("t",n5(t))}const s5=tl("global-vue-i18n");function i5(e={}){const t=__VUE_I18N_LEGACY_API__&&Jt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Jt(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=r5(e,t),r=tl("");function l(d){return o.get(d)||null}function a(d,p){o.set(d,p)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...p){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),jt(p[0])){const m=p[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=p5(d,u.global)),__VUE_I18N_FULL_INSTALL__&&o5(d,u,...p),__VUE_I18N_LEGACY_API__&&t&&d.mixin(XN(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),f()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function It(e={}){const t=Du();if(t==null)throw ps(Zo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw ps(Zo.NOT_INSTALLED);const n=l5(t),o=c5(n),s=mA(t),i=a5(e,s);if(i==="global")return gA(o,e,s),o;if(i==="parent"){let a=__(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw ps(Zo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=ao({},e),u=__(n,t);c.__root=u||o;const d=dp(c);return a.__composerExtend&&(d[Ra]=a.__composerExtend(d)),V1()&&K1(()=>{const h=d[Ra];h&&(h(),delete d[Ra])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=ao({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=dp(a),r.__composerExtend&&(l[Ra]=r.__composerExtend(l)),d5(r,t,l),r.__setInstance(t,l)}return l}function r5(e,t){const n=NE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Vv(e)):n.run(()=>dp(e));if(o==null)throw ps(Zo.UNEXPECTED_ERROR);return[n,o]}function l5(e){const t=Ut(e.isCE?s5:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw ps(e.isCE?Zo.NOT_INSTALLED_WITH_PROVIDE:Zo.UNEXPECTED_ERROR);return t}function a5(e,t){return dh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function c5(e){return e.mode==="composition"?e.global:e.global.__composer}function __(e,t,n=!1){let o=null;const s=t.root;let i=u5(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[hA]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function u5(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function d5(e,t,n){hn(()=>{},t),kn(()=>{const o=n;e.__deleteInstance(t);const s=o[Ra];s&&(s(),delete o[Ra])},t)}const f5=["locale","fallbackLocale","availableLocales"],w_=["t","rt","d","n","tm","te"];function p5(e,t){const n=Object.create(null);return f5.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw ps(Zo.UNEXPECTED_ERROR);const r=eo(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,w_.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw ps(Zo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,w_.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const h5=je({name:"i18n-d",props:ao({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},b0),setup(e,t){const n=e.i18n||It({useScope:e.scope,__useComponent:!0});return yA(e,t,cA,(...o)=>n[qv](...o))}}),S_=h5;VN();xN(rN);AN(wN);TN(Fv);if(__INTLIFY_PROD_DEVTOOLS__){const e=Pl();e.__INTLIFY__=!0,lN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const m5="modulepreload",g5=function(e){return"/"+e},C_={},Qo=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");s=r(n.map(c=>{if(c=g5(c),c in C_)return;C_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":m5,u||(p.as="script"),p.crossOrigin="",p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((h,f)=>{p.addEventListener("load",h),p.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 s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Et={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",showWorkspacePaths:"kimi-web.show-workspace-paths",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function x_(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function Qn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function to(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function cc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function id(e){const t=Qn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function yc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function _0(){const e=Qn(Et.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function w0(e){const n={..._0()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];to(Et.unread,JSON.stringify(n))}function v5(){const e=id(Et.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function og(e){yc(Et.collapsedWorkspaces,Array.from(e))}function y5(){return id(Et.showWorkspacePaths)===!0}function k5(e){yc(Et.showWorkspacePaths,e)}function b5(){const e=id(Et.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kA(e){yc(Et.workspaceOrder,Array.from(e))}function Jd(){const e=id(Et.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function A_(e){yc(Et.workspaceNameOverrides,e)}function _5(){return Qn(Et.workspaceSort)}function bA(e){to(Et.workspaceSort,e)}const T_=Et.clientId,w5="kimi-code-web",S5="web";function C5(){return{serverHttpUrl:A5(),clientId:I5(),clientName:w5,clientVersion:$5(),clientUiMode:S5}}function x5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function A5(e){const t=x5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function T5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function M5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return T5(e)}function uu(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function E5(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 I5(){const e=Qn(T_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return to(T_,t),t}function $5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function Uo(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return N5(e)}function N5(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function L5(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function O5(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function P5(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function R5(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const D5={"&":"&","<":"<",">":">",'"':""","'":"'"};function M_(e){return e.replace(/[&<>"']/g,t=>D5[t]??t)}function B5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F5(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return E_(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return E_(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function E_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function sg(e,t){const n=M_(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(B5(M_(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const Ea=Z(0),H5=["type","disabled","aria-label"],W5=je({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Z();return t({el:n}),(o,s)=>(w(),N("button",{ref_key:"el",ref:n,class:Re(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Cn(o.$slots,"default",{},void 0,!0)],10,H5))}}),ut=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},gn=ut(W5,[["__scopeId","data-v-321e56e3"]]),z5=Object.freeze({left:0,top:0,width:16,height:16}),_A=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),wA=Object.freeze({...z5,..._A}),she=Object.freeze({...wA,body:"",hidden:!1}),U5=Object.freeze({width:null,height:null}),q5=Object.freeze({...U5,..._A}),j5=/(-?[0-9.]*[0-9]+[0-9.]*)/g,V5=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function I_(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const o=e.split(j5);if(o===null||!o.length)return e;const s=[];let i=o.shift(),r=V5.test(i);for(;;){if(r){const l=parseFloat(i);isNaN(l)?s.push(i):s.push(Math.ceil(l*t*n)/n)}else s.push(i);if(i=o.shift(),i===void 0)return s.join("");r=!r}}function K5(e,t="defs"){let n="";const o=e.indexOf("<"+t);for(;o>=0;){const s=e.indexOf(">",o),i=e.indexOf("</"+t);if(s===-1||i===-1)break;const r=e.indexOf(">",i);if(r===-1)break;n+=e.slice(s+1,i).trim(),e=e.slice(0,o).trim()+e.slice(r+1)}return{defs:n,content:e}}function G5(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Y5(e,t,n){const o=K5(e);return G5(o.defs,t+o.content+n)}const X5=e=>e==="unset"||e==="undefined"||e==="none";function Q5(e,t){const n={...wA,...e},o={...q5,...t},s={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,o].forEach(m=>{const b=[],_=m.hFlip,g=m.vFlip;let v=m.rotate;_?g?v+=2:(b.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),b.push("scale(-1 1)"),s.top=s.left=0):g&&(b.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),b.push("scale(1 -1)"),s.top=s.left=0);let y;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:y=s.height/2+s.top,b.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:b.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:y=s.width/2+s.left,b.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}v%2===1&&(s.left!==s.top&&(y=s.left,s.left=s.top,s.top=y),s.width!==s.height&&(y=s.width,s.width=s.height,s.height=y)),b.length&&(i=Y5(i,'<g transform="'+b.join(" ")+'">',"</g>"))});const r=o.width,l=o.height,a=s.width,c=s.height;let u,d;r===null?(d=l===null?"1em":l==="auto"?c:l,u=I_(d,a/c)):(u=r==="auto"?a:r,d=l===null?I_(u,c/a):l==="auto"?c:l);const p={},h=(m,b)=>{X5(b)||(p[m]=b.toString())};h("width",u),h("height",d);const f=[s.left,s.top,a,c];return p.viewBox=f.join(" "),{attributes:p,viewBox:f,body:i}}const SA={plus:{body:'<path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/>',width:24,height:24},"chat-new":{body:'<path fill="currentColor" d="M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3z"/>',width:24,height:24},close:{body:'<path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/>',width:24,height:24},check:{body:'<path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/>',width:24,height:24},search:{body:'<path fill="currentColor" d="m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"/>',width:24,height:24},copy:{body:'<path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/>',width:24,height:24},link:{body:'<path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/>',width:24,height:24},"external-link":{body:'<path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/>',width:24,height:24},download:{body:'<path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/>',width:24,height:24},undo:{body:'<path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/>',width:24,height:24},send:{body:'<path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/>',width:24,height:24},image:{body:'<path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/>',width:24,height:24},settings:{body:'<path fill="currentColor" d="M3.34 17a10 10 0 0 1-.979-2.326a3 3 0 0 0 .003-5.347a10 10 0 0 1 2.5-4.337a3 3 0 0 0 4.632-2.674a10 10 0 0 1 5.007.003a3 3 0 0 0 4.632 2.671a10.06 10.06 0 0 1 2.503 4.336a3 3 0 0 0-.002 5.347a10 10 0 0 1-2.501 4.337a3 3 0 0 0-4.632 2.674a10 10 0 0 1-5.007-.002a3 3 0 0 0-4.631-2.672A10 10 0 0 1 3.339 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.07 1.499.002a5 5 0 0 1 2.25-2.772a5 5 0 0 1 3.526-.564q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.5-.001A5 5 0 0 1 9 6.804a5 5 0 0 1-3.526.564q-.436.614-.747 1.298A5 5 0 0 1 6 12c0 1.26-.471 2.437-1.273 3.334a8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},sliders:{body:'<path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},"log-in":{body:'<path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/>',width:24,height:24},"chevron-down":{body:'<path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/>',width:24,height:24},"chevron-right":{body:'<path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/>',width:24,height:24},"arrow-up":{body:'<path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/>',width:24,height:24},"arrow-down":{body:'<path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/>',width:24,height:24},"arrow-right":{body:'<path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/>',width:24,height:24},minus:{body:'<path fill="currentColor" d="M5 11v2h14v-2z"/>',width:24,height:24},"panel-collapse":{body:'<path fill="currentColor" d="m15.071 4.929l1.414 1.414L11.83 11H21v2h-9.17l4.656 4.657l-1.414 1.414L8.001 12zm-11.07 14.07V5h2v14z"/>',width:24,height:24},"panel-expand":{body:'<path fill="currentColor" d="m17.172 11l-4.657-4.657l1.414-1.414L21 12l-7.071 7.071l-1.414-1.414L17.172 13H8v-2zM4 19V5h2v14z"/>',width:24,height:24},expand:{body:'<path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/>',width:24,height:24},collapse:{body:'<path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/>',width:24,height:24},list:{body:'<path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/>',width:24,height:24},sort:{body:'<path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/>',width:24,height:24},grip:{body:'<path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/>',width:24,height:24},folder:{body:'<path fill="currentColor" d="M3 21a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2H20a1 1 0 0 1 1 1v3h-2V7h-7.414l-2-2H4v11.998L5.5 11h17l-2.31 9.243a1 1 0 0 1-.97.757zm16.938-8H7.062l-1.5 6h12.876z"/>',width:24,height:24},"folder-closed":{body:'<path fill="currentColor" d="M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/>',width:24,height:24},"folder-plus":{body:'<path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/>',width:24,height:24},"folder-solid":{body:'<path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/>',width:24,height:24},file:{body:'<path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/>',width:24,height:24},"file-text":{body:'<path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/>',width:24,height:24},"file-plus":{body:'<path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/>',width:24,height:24},"file-off":{body:'<path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/>',width:24,height:24},"image-off":{body:'<path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/>',width:24,height:24},code:{body:'<path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/>',width:24,height:24},terminal:{body:'<path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/>',width:24,height:24},pencil:{body:'<path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/>',width:24,height:24},glob:{body:'<path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/>',width:24,height:24},globe:{body:'<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/>',width:24,height:24},"check-list":{body:'<path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/>',width:24,height:24},bolt:{body:'<path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/>',width:24,height:24},"git-pull-request":{body:'<path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},message:{body:'<path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/>',width:24,height:24},mail:{body:'<path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/>',width:24,height:24},user:{body:'<path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/>',width:24,height:24},info:{body:'<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/>',width:24,height:24},"help-circle":{body:'<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/>',width:24,height:24},"alert-triangle":{body:'<path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/>',width:24,height:24},clock:{body:'<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/>',width:24,height:24},sparkles:{body:'<path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/>',width:24,height:24},play:{body:'<path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/>',width:24,height:24},stop:{body:'<path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/>',width:24,height:24},star:{body:'<path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/>',width:24,height:24},"star-outline":{body:'<path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/>',width:24,height:24},"dots-horizontal":{body:'<path fill="currentColor" d="M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"/>',width:24,height:24}},CA={sm:14,md:16,lg:20};function Z5(e){return`0 0 ${e.width??24} ${e.height??24}`}const J5=Object.fromEntries(Object.entries(SA).map(([e,t])=>[e,{body:t.body,viewBox:Z5(t),fill:!0}]));function e8(e){return J5[e]}function Ia(e,t="md"){const n=CA[t],o=Q5(SA[e],{width:n,height:n}),s=o.attributes.viewBox;return`<svg class="kw-icon" width="${n}" height="${n}" viewBox="${s}" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">${o.body}</svg>`}const t8=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],n8=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],Je=je({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=F(()=>e8(t.name)),o=F(()=>CA[t.size]),s=F(()=>n.value.viewBox??"0 0 16 16");return(i,r)=>n.value.fill?(w(),N("svg",{key:0,class:"kw-icon",width:o.value,height:o.value,viewBox:s.value,fill:"currentColor","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,t8)):(w(),N("svg",{key:1,class:"kw-icon",width:o.value,height:o.value,viewBox:s.value,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,n8))}}),o8={key:0,class:"ui-dialog__head"},s8={class:"ui-dialog__titles"},i8={key:0,class:"ui-dialog__title"},r8={key:1,class:"ui-dialog__desc"},l8={class:"ui-dialog__body"},a8={key:1,class:"ui-dialog__foot"},c8='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',u8=je({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=Z(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(c8)):[]}function a(u){if(!n.open)return;if(u.key==="Escape"&&n.closeOnEsc){u.preventDefault(),r();return}if(u.key!=="Tab")return;const d=l(),p=d[0],h=d[d.length-1];if(!p||!h){u.preventDefault(),s.value?.focus();return}const f=document.activeElement;u.shiftKey&&f===p?(u.preventDefault(),h.focus()):!u.shiftKey&&f===h&&(u.preventDefault(),p.focus())}function c(u){n.closeOnOverlay&&u.target===u.currentTarget&&r()}return Ke(()=>n.open,async u=>{u?(Ea.value+=1,i=document.activeElement,await ht(),(l()[0]??s.value)?.focus()):(Ea.value=Math.max(0,Ea.value-1),i instanceof HTMLElement&&(i.focus(),i=null))},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",a),lo(()=>{typeof window<"u"&&window.removeEventListener("keydown",a),n.open&&(Ea.value=Math.max(0,Ea.value-1))}),(u,d)=>(w(),ve(lh,{to:"body"},[e.open?(w(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:c},[T("div",{ref_key:"panel",ref:s,class:Re(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||u.$slots.head?(w(),N("div",o8,[Cn(u.$slots,"head",{},()=>[T("div",s8,[e.title?(w(),N("div",i8,R(e.title),1)):ie("",!0),e.description?(w(),N("div",r8,R(e.description),1)):ie("",!0)])],!0),se(gn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:_e(()=>[se(Je,{name:"close",size:"md"})]),_:1})])):ie("",!0),T("div",l8,[Cn(u.$slots,"default",{},void 0,!0)]),u.$slots.foot?(w(),N("div",a8,[Cn(u.$slots,"foot",{},void 0,!0)])):ie("",!0)],2)],32)):ie("",!0)]))}}),ar=ut(u8,[["__scopeId","data-v-7904ff48"]]),d8={class:"sd-head"},f8=["placeholder","aria-label"],p8=["aria-selected","onClick","onMousemove"],h8={class:"sd-meta"},m8=["innerHTML"],g8={class:"sd-time"},v8=["innerHTML"],y8=["innerHTML"],k8={key:1,class:"sd-empty"},b8={class:"sd-hint"},_8=200,w8=je({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t,i=Z(!0),r=Z(""),l=Z(null),a=Z(null),c=F(()=>{const _=r.value.trim().toLowerCase(),g=[];for(const v of o.sessions){const y=v.title??"",A=v.lastPrompt??"",O=v.workspaceName??"",$=_.length>0&&y.toLowerCase().includes(_),k=_.length>0&&A.toLowerCase().includes(_),E=_.length>0&&O.toLowerCase().includes(_);if(!(_.length>0&&!$&&!k&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:A?F5(A,r.value):""}),g.length>=_8))break}return g}),u=Z(0);Ke(r,()=>{u.value=0});function d(_){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,_))}async function p(){await ht(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(_){u.value=d(u.value+_),p()}function f(_){s("select",_),s("close")}function m(){const _=c.value[u.value];_&&f(_.session.id)}function b(_){_.key==="ArrowDown"?(_.preventDefault(),h(1)):_.key==="ArrowUp"?(_.preventDefault(),h(-1)):_.key==="Enter"&&(_.preventDefault(),m())}return hn(()=>{l.value?.focus()}),(_,g)=>(w(),ve(ar,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>s("close"))},{head:_e(()=>[T("div",d8,[se(Je,{class:"sd-search-icon",name:"search",size:"md"}),Mn(T("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:x(n)("sidebar.searchPlaceholder"),"aria-label":x(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,f8),[[ks,r.value]])])]),foot:_e(()=>[T("span",b8,R(x(n)("sidebar.searchHint")),1)]),default:_e(()=>[T("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),N(Le,{key:0},nt(c.value,(v,y)=>(w(),N("button",{key:v.session.id,class:Re(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:A=>f(v.session.id),onMousemove:A=>u.value=y},[T("span",h8,[se(Je,{class:"sd-folder",name:"folder-closed",size:"sm"}),T("span",{class:"sd-ws",innerHTML:x(sg)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,m8),T("span",g8,R(v.session.time),1)]),T("span",{class:"sd-title",innerHTML:x(sg)(v.session.title,v.inTitle?r.value:"")},null,8,v8),v.snippetText?(w(),N("span",{key:0,class:"sd-snippet",innerHTML:x(sg)(v.snippetText,r.value)},null,8,y8)):ie("",!0)],42,p8))),128)):(w(),N("div",k8,R(x(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),S8=ut(w8,[["__scopeId","data-v-a678f802"]]),C8=["aria-label"],x8=je({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),N("span",{class:Re(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[T("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[T("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),T("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,C8))}}),ni=ut(x8,[["__scopeId","data-v-e5c5b17d"]]),A8={key:0,class:"ui-badge__dot","aria-hidden":"true"},T8=je({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),N("span",{class:Re(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),N("span",A8)):ie("",!0),Cn(t.$slots,"default",{},void 0,!0)],2))}}),$o=ut(T8,[["__scopeId","data-v-5bc5cd6d"]]),Bu=Z(null);function xA(e){const t=Bu.value;t&&(Bu.value=null,t.resolve(e))}function M8(e){return Bu.value&&xA(!1),new Promise(t=>{Bu.value={...e,resolve:t}})}function sl(){return{current:Bu,confirm:M8,settle:xA}}const E8=je({__name:"Menu",setup(e,{expose:t}){const n=Z();return t({el:n}),(o,s)=>(w(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Cn(o.$slots,"default",{},void 0,!0)],512))}}),Wl=ut(E8,[["__scopeId","data-v-60e6cd8d"]]),I8={key:0,class:"ui-menu-sep",role:"separator"},$8=["disabled"],N8=je({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(w(),N("div",I8)):(w(),N("button",{key:1,class:Re(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[Cn(t.$slots,"default",{},void 0,!0)],10,$8))}}),fn=ut(N8,[["__scopeId","data-v-eab8e277"]]),kr=6,br=8,L8=150,O8=je({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Z(),o=Z(),s=Z(!1),i=Z(!1),r=Z({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=o.value;if(!a||!m)return;const b=a.getBoundingClientRect(),_=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let A=t.placement;A==="top"&&b.top-kr-g<br?A="bottom":A==="bottom"&&b.bottom+kr+g>y-br?A="top":A==="left"&&b.left-kr-_<br?A="right":A==="right"&&b.right+kr+_>v-br&&(A="left");let O=0,$=0;A==="top"?(O=b.top-kr-g,$=b.left+b.width/2-_/2):A==="bottom"?(O=b.bottom+kr,$=b.left+b.width/2-_/2):A==="left"?(O=b.top+b.height/2-g/2,$=b.left-kr-_):(O=b.top+b.height/2-g/2,$=b.right+kr),$=Math.min(Math.max($,br),v-br-_),O=Math.min(Math.max(O,br),y-br-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(O)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,ht(()=>{u(),i.value=!0})},L8))}function p(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&p()}function f(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",p),a.removeEventListener("focusin",d),a.removeEventListener("focusout",p)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",p),a.addEventListener("focusin",d),a.addEventListener("focusout",p)))}return hn(()=>{const m=n.value??null;f(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const b=m.firstElementChild??null;b!==a&&(p(),f(b??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),lo(()=>{window.clearTimeout(l),c?.disconnect(),f(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,b)=>(w(),N(Le,null,[T("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Cn(m.$slots,"default",{},void 0,!0)],512),(w(),ve(lh,{to:"body"},[Mn(T("div",{ref_key:"bubble",ref:o,class:Re(["ui-tip__bubble",{positioned:i.value}]),style:Gt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},R(e.text),7),[[Qs,s.value]])]))],64))}}),Ht=ut(O8,[["__scopeId","data-v-4c261eb6"]]),P8={class:"row"},R8={class:"lead","aria-hidden":"true"},D8={key:1,class:"unread-dot"},B8={class:"left"},F8=["onKeydown"],H8={class:"act"},W8={class:"ts"},z8={class:"menu-time"},U8=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:o}=It(),{confirm:s}=sl(),i=e,r=n;function l(S){const I=new Date(S);if(Number.isNaN(I.getTime()))return S;const P=D=>String(D).padStart(2,"0");return`${I.getFullYear()}-${P(I.getMonth()+1)}-${P(I.getDate())} ${P(I.getHours())}:${P(I.getMinutes())}`}const a=F(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Z(!1),u=Z(null),d=Z(null),p=Z({});function h(S){const I=S.target;d.value?.el?.contains(I)||u.value?.el?.contains(I)||b()}function f(){const S=u.value?.el;if(!S)return;const I=d.value?.el,P=S.getBoundingClientRect(),D=4,W=8,z=I?.offsetHeight??0,q=I?.offsetWidth??0;let Q=P.bottom+D;Q+z>window.innerHeight-W&&(Q=Math.max(W,P.top-z-D));let X=P.right-q;X<W&&(X=W),p.value={top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`}}async function m(S){if(S.stopPropagation(),c.value){b();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",b),await ht(),f()}function b(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)}kn(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)});const _=Z(!1),g=Z(""),v=Z(null);async function y(){b(),_.value=!0,g.value=i.session.title,await ht();try{v.value?.focus(),v.value?.select()}catch{}}function A(){const S=g.value.trim();S&&r("rename",i.session.id,S),_.value=!1}function O(){_.value=!1}const $=Z(!1),k=Z(!1);async function E(){const S=await Uo(i.session.id);$.value=S,k.value=!S,setTimeout(()=>{$.value=!1,k.value=!1,b()},1500)}function M(){b(),r("fork",i.session.id)}async function L(){b(),await s({title:o("sidebar.archive"),message:o("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:b}),(S,I)=>(w(),N("div",{class:Re(["se",{on:e.active}]),onClick:I[4]||(I[4]=P=>r("select",e.session.id))},[T("div",P8,[T("span",R8,[e.session.busy?(w(),ve(ni,{key:0,size:"sm"})):e.unread?(w(),N("span",D8)):ie("",!0)]),T("div",B8,[_.value?Mn((w(),N("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":I[0]||(I[0]=P=>g.value=P),class:"rename-input",onClick:I[1]||(I[1]=vt(()=>{},["stop"])),onKeydown:[di(vt(A,["stop"]),["enter"]),di(vt(O,["stop"]),["esc"])],onBlur:A},null,40,F8)),[[ks,g.value]]):(w(),N("span",{key:1,class:"t",onDblclick:vt(y,["stop"])},R(e.session.title),33))]),se(Ht,{text:x(o)("workspace.awaitingAnswerTitle")},{default:_e(()=>[!_.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(w(),ve($o,{key:0,variant:"info",size:"sm"},{default:_e(()=>[qe(R(x(o)("workspace.awaitingAnswer")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),se(Ht,{text:x(o)("workspace.awaitingPermissionTitle")},{default:_e(()=>[!_.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(w(),ve($o,{key:0,variant:"warning",size:"sm"},{default:_e(()=>[qe(R(x(o)("workspace.awaitingPermission")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),se(Ht,{text:x(o)("workspace.abortedTitle")},{default:_e(()=>[!_.value&&e.session.status==="aborted"?(w(),ve($o,{key:0,variant:"danger",size:"sm"},{default:_e(()=>[qe(R(x(o)("workspace.aborted")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),T("span",H8,[T("span",W8,R(e.session.time),1),_.value?ie("",!0):(w(),ve(gn,{key:0,ref_key:"kebabRef",ref:u,class:Re(["kebab",{open:c.value}]),size:"sm",label:x(o)("sidebar.options"),onClick:I[2]||(I[2]=vt(P=>m(P),["stop"]))},{default:_e(()=>[se(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))])]),(w(),ve(lh,{to:"body"},[c.value?(w(),ve(Wl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Gt(p.value),onClick:I[3]||(I[3]=vt(()=>{},["stop"]))},{default:_e(()=>[se(fn,{danger:k.value,onClick:E},{default:_e(()=>[qe(R(k.value?x(o)("sidebar.copyFailed"):$.value?x(o)("sidebar.copied"):x(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),se(fn,{separator:""}),se(fn,{onClick:y},{default:_e(()=>[qe(R(x(o)("sidebar.rename")),1)]),_:1}),se(fn,{onClick:M},{default:_e(()=>[qe(R(x(o)("sidebar.fork")),1)]),_:1}),se(fn,{danger:"",onClick:L},{default:_e(()=>[qe(R(x(o)("sidebar.archive")),1)]),_:1}),se(fn,{separator:""}),T("div",z8,R(a.value),1)]),_:1},8,["style"])):ie("",!0)]))],2))}}),q8=ut(U8,[["__scopeId","data-v-be68e943"]]),j8={class:"gh-top"},V8={key:2,class:"gh-name"},K8={class:"gh-path"},G8=["inert"],Y8=["disabled"],X8={class:"show-more-label"},Q8={class:"show-more-label"},Z8={key:2,class:"group-empty"},J8=je({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},showPath:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t,i=F({get:()=>o.renameValue,set:p=>s("updateRenameValue",p)}),r=F(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const p=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!p.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(f=>f.id===o.activeId);if(h)return[...p,h]}return p}),l=F(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(p){o.renameInputRef.value=p instanceof HTMLInputElement?p:null}function d(p){p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(p,h)=>(w(),N("div",{class:Re(["group",{dragging:e.dragging}])},[T("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id),"show-path":e.showPath}]),draggable:"true",onClick:h[7]||(h[7]=vt(f=>s("groupClick",e.group.workspace.id,f),["stop"])),onContextmenu:h[8]||(h[8]=f=>s("groupContextmenu",e.group.workspace,f)),onDragstart:d,onDragend:h[9]||(h[9]=f=>s("wsDragend"))},[T("div",j8,[e.isCollapsed(e.group.workspace.id)?(w(),ve(Je,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(w(),ve(Je,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(w(),N("span",V8,R(e.group.workspace.name),1)):Mn((w(),N("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=f=>i.value=f),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=di(f=>s("confirmRename"),["enter"])),h[2]||(h[2]=di(f=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=f=>s("cancelRename")),onClick:h[4]||(h[4]=vt(()=>{},["stop"]))},null,544)),[[ks,i.value]]),se(gn,{class:Re(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:x(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=vt(f=>s("toggleWsMenu",e.group.workspace,f),["stop"]))},{default:_e(()=>[se(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"]),se(gn,{class:"gh-add",size:"sm",label:x(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=vt(f=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:_e(()=>[se(Je,{name:"chat-new"})]),_:1},8,["label"])]),se(Ht,{text:e.group.workspace.root},{default:_e(()=>[T("div",K8,R(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),T("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),N(Le,null,nt(r.value,f=>(w(),ve(q8,{key:f.id,session:f,active:f.id===e.activeId,"approval-count":e.pendingBySession[f.id]?.approvals??0,"question-count":e.pendingBySession[f.id]?.questions??0,unread:e.unreadBySession[f.id]??!1,onSelect:h[10]||(h[10]=m=>s("selectSession",m)),onRename:h[11]||(h[11]=(m,b)=>s("renameSession",m,b)),onArchive:h[12]||(h[12]=m=>s("archiveSession",m)),onFork:h[13]||(h[13]=m=>s("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[14]||(h[14]=vt(f=>s("loadMore",e.group.workspace.id),["stop"]))},[h[16]||(h[16]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",X8,R(e.group.loadingMore?x(n)("sidebar.loadingMore"):x(n)("sidebar.showMore",{count:a()})),1)],8,Y8)):ie("",!0),l.value?(w(),N("button",{key:1,class:"show-more",onClick:h[15]||(h[15]=vt(f=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",Q8,R(e.isExpanded(e.group.workspace.id)?x(n)("sidebar.showLess"):x(n)("sidebar.showAll",{count:c()})),1)])):ie("",!0),e.group.sessions.length===0?(w(),N("div",Z8,R(x(n)("sidebar.noSessions")),1)):ie("",!0)],10,G8)],2))}}),eL=ut(J8,[["__scopeId","data-v-81fdc08d"]]),tL="kimi_desktop",nL="platform",$_="kimi-desktop",N_="kimi-desktop-platform";function oL(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(tL)?(sessionStorage.setItem($_,"1"),e=!0):e=e||sessionStorage.getItem($_)==="1";const o=n.get(nL);o?(sessionStorage.setItem(N_,o),t=o):t=sessionStorage.getItem(N_)}catch{}return{isDesktop:e,platform:t}}const Kv=oL(),sL=Kv.isDesktop,AA=Kv.isDesktop&&Kv.platform==="darwin",iL=["aria-label"],rL=je({__name:"InternalBuildBanner",setup(e){const{t}=It(),n=sL;return(o,s)=>x(n)?(w(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":x(t)("app.internalBuildBanner")},[s[0]||(s[0]=T("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("path",{d:"M8 2 14 13H2L8 2Z"}),T("path",{d:"M8 6v3.5"}),T("path",{d:"M8 11.5h.01"})],-1)),T("span",null,R(x(t)("app.internalBuildBanner")),1)],8,iL)):ie("",!0)}}),lL=ut(rL,[["__scopeId","data-v-b5e70a09"]]),aL={class:"ch"},cL={class:"ch-brand"},uL={class:"ch-name"},dL={key:0,class:"ch-endpoint"},fL={class:"search-input"},pL={key:0,class:"empty"},hL={class:"side-section-label"},mL={class:"side-section-title"},gL={class:"side-section-actions"},vL=["onDragover","onDrop"],yL={class:"section-menu-check"},kL={class:"section-menu-check"},bL={class:"section-menu-check"},_L=1e3,wL=je({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=It(),{confirm:o}=sl(),s=!1,i="",r=e,l=t,a=Z(!1);function c(){l("loadAllSessions"),a.value=!0}function u(Ge){(Ge.metaKey||Ge.ctrlKey)&&Ge.key.toLowerCase()==="k"&&(Ge.preventDefault(),c())}hn(()=>window.addEventListener("keydown",u)),lo(()=>window.removeEventListener("keydown",u));const d=Z(!1);function p(Ge){d.value=Ge.target.scrollTop>0}const h=Z(new Set(v5()));function f(Ge){return h.value.has(Ge)}function m(Ge){const Ye=new Set(h.value);Ye.has(Ge)?Ye.delete(Ge):Ye.add(Ge),h.value=Ye,og(Ye)}function b(){const Ge=new Set(r.groups.map(Ye=>Ye.workspace.id));h.value=Ge,og(Ge)}function _(){const Ge=new Set;h.value=Ge,og(Ge)}const g=F(()=>r.groups.length>0&&r.groups.every(Ge=>h.value.has(Ge.workspace.id))),v=Z(new Set);function y(Ge){return v.value.has(Ge)}function A(Ge){const Ye=new Set(v.value);Ye.has(Ge)?Ye.delete(Ge):Ye.add(Ge),v.value=Ye}function O(Ge){if(!v.value.has(Ge)){const Ye=new Set(v.value);Ye.add(Ge),v.value=Ye}l("loadMoreSessions",Ge)}const $=Z(y5());function k(){$.value=!$.value,k5($.value)}const E=Z(null),M=Z(null);function L(Ge){E.value=Ge}function S(){E.value=null,M.value=null}function I(Ge){const Ye=Ge.currentTarget.getBoundingClientRect();return Ge.clientY<Ye.top+Ye.height/2?"before":"after"}function P(Ge,Ye){E.value===null||E.value===Ye||(Ge.preventDefault(),Ge.dataTransfer&&(Ge.dataTransfer.dropEffect="move"),M.value={id:Ye,position:I(Ge)})}function D(Ge){const Ye=E.value,Ct=M.value?.id===Ge?M.value.position:"before";if(M.value=null,E.value=null,!Ye||Ye===Ge)return;const $t=P5(r.groups.map(mn=>mn.workspace.id),Ye,Ge,Ct);l("reorderWorkspaces",$t)}function W(Ge,Ye){Ye.target.closest(".gh-more, .gh-add")||m(Ge)}function z(Ge){l("select",Ge)}const q=Z(null),Q=Z(""),X=Z(null);function fe(){return X}function ye(Ge,Ye){q.value=Ge,Q.value=Ye,ht().then(()=>X.value?.focus())}function Me(){const Ge=q.value,Ye=Q.value.trim();Ge&&Ye&&l("renameWorkspace",Ge,Ye),q.value=null}function we(){q.value=null}function ze(Ge){Q.value=Ge}const Ue=Z(!1),Fe=Z(null),rt=Z({}),le=Z(null);function U(Ge){le.value?.el&&!le.value.el.contains(Ge.target)&&ne()}function G(Ge,Ye){Ye.preventDefault(),Ye.stopPropagation(),Fe.value=Ge,rt.value={top:`${Ye.clientY}px`,left:`${Ye.clientX}px`},Ue.value=!0,document.addEventListener("mousedown",U,!0)}function ne(){Ue.value=!1,document.removeEventListener("mousedown",U,!0),Fe.value=null}function H(){Fe.value&&Uo(Fe.value.root),ne()}function J(){Fe.value&&ye(Fe.value.id,Fe.value.name),ne()}async function ce(){const Ge=Fe.value;Ge&&(ne(),await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ge.name}),variant:"danger"})&&l("deleteWorkspace",Ge.id))}const te=Z(null),ue=Z(null),j=Z({}),Y=Z(null);function re(Ge){const Ye=Ge.target;Ye.closest(".gh-more")||Ye.closest(".ws-menu")||Ae()}async function ge(Ge,Ye){if(te.value===Ge.id){Ae();return}const Ct=Ye.currentTarget;ue.value=Ge,te.value=Ge.id,document.addEventListener("mousedown",re),window.addEventListener("resize",Ae),await ht();const $t=Y.value?.el,mn=Ct.getBoundingClientRect(),Nn=4,tn=8,Ln=$t?.offsetHeight??0,Zn=$t?.offsetWidth??0;let Mt=mn.bottom+Nn;Mt+Ln>window.innerHeight-tn&&(Mt=Math.max(tn,mn.top-Ln-Nn));let uo=mn.right-Zn;uo<tn&&(uo=tn),j.value={top:`${Math.round(Mt)}px`,left:`${Math.round(uo)}px`}}function Ae(){te.value=null,ue.value=null,document.removeEventListener("mousedown",re),window.removeEventListener("resize",Ae)}function Ie(Ge){Uo(Ge.root),Ae()}function ae(Ge){ye(Ge.id,Ge.name),Ae()}async function Te(Ge){Ae(),await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ge.name}),variant:"danger"})&&l("deleteWorkspace",Ge.id)}const Ve=Z(!1),tt=Z({}),bt=Z(null);function kt(Ge){const Ye=Ge.target;Ye.closest(".side-section-kebab")||Ye.closest(".section-menu")||Pt()}async function Tt(Ge){if(Ve.value){Pt();return}const Ye=Ge.currentTarget;Ve.value=!0,document.addEventListener("mousedown",kt),window.addEventListener("resize",Pt),await ht();const Ct=bt.value?.el,$t=Ye.getBoundingClientRect(),mn=4,Nn=8,tn=Ct?.offsetHeight??0,Ln=Ct?.offsetWidth??0;let Zn=$t.bottom+mn;Zn+tn>window.innerHeight-Nn&&(Zn=Math.max(Nn,$t.top-tn-mn));let Mt=$t.right-Ln;Mt<Nn&&(Mt=Nn),tt.value={top:`${Math.round(Zn)}px`,left:`${Math.round(Mt)}px`}}function Pt(){Ve.value=!1,document.removeEventListener("mousedown",kt),window.removeEventListener("resize",Pt)}function mt(Ge){l("setWorkspaceSortMode",Ge),Pt()}function Yt(){k(),Pt()}lo(()=>{document.removeEventListener("mousedown",U,!0),document.removeEventListener("mousedown",re),document.removeEventListener("mousedown",kt),window.removeEventListener("resize",Ae),window.removeEventListener("resize",Pt)});const Rn=Z(null);let Dn;function Ft(){const Ge=Rn.value;Ge&&(Ge.classList.remove("blink-now"),Ge.getBoundingClientRect(),Ge.classList.add("blink-now"),clearTimeout(Dn),Dn=setTimeout(()=>Ge.classList.remove("blink-now"),300))}const bn=ui(()=>Qo(()=>import("./DesignSystemView-gstQZ6Dp.js"),__vite__mapDeps([0,1]))),Vn=Z(!1);let ot,In=!1;function _n(Ge){In=!1,clearTimeout(ot),Ge.currentTarget.setPointerCapture?.(Ge.pointerId),ot=setTimeout(()=>{In=!0,Vn.value=!0},_L)}function Kn(Ge){clearTimeout(ot);const Ye=Ge.currentTarget;Ye.hasPointerCapture?.(Ge.pointerId)&&Ye.releasePointerCapture(Ge.pointerId)}function $n(){if(In){In=!1;return}Ft()}return lo(()=>{clearTimeout(ot)}),(Ge,Ye)=>(w(),N(Le,null,[T("aside",{class:Re(["side",{"macos-desktop":x(AA)}])},[T("div",{class:"col",style:Gt({width:e.colWidth+"px"})},[T("div",aL,[T("div",cL,[(w(),N("svg",{ref_key:"logoRef",ref:Rn,class:Re(["ch-logo",{"is-dev":x(s)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:$n,onPointerdown:_n,onPointerup:Kn,onPointercancel:Kn},[...Ye[21]||(Ye[21]=[c0('<defs data-v-a64c5665><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-a64c5665><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-a64c5665></rect><g class="ch-eyes" fill="#000" data-v-a64c5665><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-a64c5665></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-a64c5665></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-a64c5665></rect>',2)])],34)),T("span",uL,[Ye[22]||(Ye[22]=qe("Kimi Code",-1)),x(s)?(w(),N("span",dL," · "+R(x(i)),1)):ie("",!0)]),se(lL)]),se(gn,{size:"sm",label:x(n)("sidebar.collapseSidebar"),onClick:Ye[0]||(Ye[0]=vt(Ct=>l("collapse"),["stop"]))},{default:_e(()=>[se(Je,{name:"panel-collapse"})]),_:1},8,["label"]),se(gn,{size:"sm",label:x(n)("settings.title"),onClick:Ye[1]||(Ye[1]=vt(Ct=>l("openSettings"),["stop"]))},{default:_e(()=>[se(Je,{name:"settings"})]),_:1},8,["label"])]),T("button",{class:"search",type:"button",onClick:c},[se(Je,{class:"search-icon",name:"search"}),T("span",fL,R(x(n)("sidebar.searchShortcut")),1)]),T("div",{class:Re(["btn-wrap",{"btn-wrap--scrolled":d.value}])},[T("button",{class:"btn-new-chat",type:"button",onClick:Ye[2]||(Ye[2]=vt(Ct=>l("create"),["stop"]))},[se(Je,{name:"chat-new"}),T("span",null,R(x(n)("sidebar.newChat")),1)]),ie("",!0)],2),T("div",{class:"sessions",onScroll:p},[e.groups.length===0?(w(),N("div",pL,R(x(n)("workspace.noWorkspace")),1)):(w(),N(Le,{key:1},[T("div",hL,[T("span",mL,R(x(n)("sidebar.workspaces")),1),T("div",gL,[se(gn,{class:"side-section-toggle",size:"sm",label:g.value?x(n)("sidebar.expandAll"):x(n)("sidebar.collapseAll"),onClick:Ye[4]||(Ye[4]=vt(Ct=>g.value?_():b(),["stop"]))},{default:_e(()=>[g.value?(w(),ve(Je,{key:0,name:"expand"})):(w(),ve(Je,{key:1,name:"collapse"}))]),_:1},8,["label"]),se(gn,{class:"side-section-toggle side-section-kebab",size:"sm",label:x(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Ve.value,onClick:Ye[5]||(Ye[5]=vt(Ct=>Tt(Ct),["stop"]))},{default:_e(()=>[se(Je,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),N(Le,null,nt(e.groups,Ct=>(w(),N("div",{key:Ct.workspace.id,class:Re(["ws-drop-target",{"drop-before":M.value?.id===Ct.workspace.id&&M.value.position==="before","drop-after":M.value?.id===Ct.workspace.id&&M.value.position==="after"}]),onDragover:$t=>P($t,Ct.workspace.id),onDrop:$t=>D(Ct.workspace.id)},[se(eL,{group:Ct,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":q.value,"rename-value":Q.value,"rename-input-ref":fe(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":te.value,dragging:E.value===Ct.workspace.id,"is-collapsed":f,"is-expanded":y,"show-path":$.value,onGroupClick:W,onGroupContextmenu:G,onToggleWsMenu:ge,onCreateInWorkspace:Ye[6]||(Ye[6]=$t=>l("createInWorkspace",$t)),onSelectSession:z,onRenameSession:Ye[7]||(Ye[7]=($t,mn)=>l("rename",$t,mn)),onArchiveSession:Ye[8]||(Ye[8]=$t=>l("archive",$t)),onForkSession:Ye[9]||(Ye[9]=$t=>l("fork",$t)),onLoadMore:O,onToggleExpand:A,onConfirmRename:Me,onCancelRename:we,onUpdateRenameValue:ze,onWsDragstart:L,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","show-path"])],42,vL))),128))],64))],32)],4),Ue.value?(w(),ve(Wl,{key:0,ref_key:"ghMenuRef",ref:le,class:"gh-menu",style:Gt(rt.value),onClick:Ye[10]||(Ye[10]=vt(()=>{},["stop"]))},{default:_e(()=>[se(fn,{onClick:H},{default:_e(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1}),se(fn,{onClick:J},{default:_e(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1}),se(fn,{danger:"",onClick:ce},{default:_e(()=>[qe(R(x(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),te.value!==null&&ue.value?(w(),ve(Wl,{key:1,ref_key:"wsMenuRef",ref:Y,class:"ws-menu",style:Gt(j.value),onClick:Ye[14]||(Ye[14]=vt(()=>{},["stop"]))},{default:_e(()=>[se(fn,{onClick:Ye[11]||(Ye[11]=Ct=>Ie(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1}),se(fn,{separator:""}),se(fn,{onClick:Ye[12]||(Ye[12]=Ct=>ae(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1}),se(fn,{separator:""}),se(fn,{danger:"",onClick:Ye[13]||(Ye[13]=Ct=>Te(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),Ve.value?(w(),ve(Wl,{key:2,ref_key:"sectionMenuRef",ref:bt,class:"section-menu",style:Gt(tt.value),onClick:Ye[18]||(Ye[18]=vt(()=>{},["stop"]))},{default:_e(()=>[se(fn,{onClick:Ye[15]||(Ye[15]=Ct=>mt("manual"))},{default:_e(()=>[T("span",yL,[e.workspaceSortMode==="manual"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.sortManual")),1)]),_:1}),se(fn,{onClick:Ye[16]||(Ye[16]=Ct=>mt("recent"))},{default:_e(()=>[T("span",kL,[e.workspaceSortMode==="recent"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.sortRecent")),1)]),_:1}),se(fn,{separator:""}),se(fn,{onClick:Ye[17]||(Ye[17]=Ct=>Yt())},{default:_e(()=>[T("span",bL,[$.value?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),a.value?(w(),ve(S8,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:z,onClose:Ye[19]||(Ye[19]=Ct=>a.value=!1)},null,8,["sessions","active-id"])):ie("",!0)],2),(w(),ve(lh,{to:"body"},[Vn.value?(w(),ve(x(bn),{key:0,onClose:Ye[20]||(Ye[20]=Ct=>Vn.value=!1)})):ie("",!0)]))],64))}}),SL=ut(wL,[["__scopeId","data-v-a64c5665"]]);function CL(e){try{const t=Qn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function xL(e,t){try{to(e,String(t))}catch{}}function AL(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(RC(s),Math.max(o,Math.round(_))):n}const l=Z(r(CL(t)??n)),a=Z(!1);function c(_){const g=r(_);l.value=g,xL(t,g)}let u=0,d=0,p=null,h=-1;function f(_){if(!a.value)return;const g=_.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),p){try{p.releasePointerCapture(h)}catch{}p.removeEventListener("pointermove",f),p.removeEventListener("pointerup",m),p.removeEventListener("pointercancel",m)}p=null,h=-1}}function b(_){_.preventDefault(),a.value=!0,u=_.clientX,d=r(l.value),p=_.currentTarget,h=_.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{p.setPointerCapture(h)}catch{}p.addEventListener("pointermove",f),p.addEventListener("pointerup",m),p.addEventListener("pointercancel",m)}return lo(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const TL=["aria-label"],ML=je({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It(),{width:i,dragging:r,onPointerDown:l}=AL({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),Ke(i,a=>o("update:width",a)),Ke(r,a=>o("update:dragging",a)),(a,c)=>(w(),N("div",{class:Re(["rh",{dragging:x(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??x(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>x(l)&&x(l)(...u))},[...c[1]||(c[1]=[T("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,TL))}}),L_=ut(ML,[["__scopeId","data-v-ad762f1c"]]),EL={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},IL={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…",internalBuildBanner:"Internal testing only"},$L={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",showWorkspacePaths:"Show workspace paths",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load more ({count})",showLess:"Show less",showAll:"Show all ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchShortcut:"Search sessions (⌘K)",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},NL={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",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.",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search 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"},LL={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?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},OL={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",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"},PL={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",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",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},RL={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"},DL={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?",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"},BL={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"},FL={justNow:"just now"},HL={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit"},WL={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},zL={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",collapse:"Collapse",expand:"Expand"},UL={panelTitle:"Thinking",close:"Close"},qL={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"},jL={},VL={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",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},KL={searching:"Searching…",noMatch:"No matches"},GL={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"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."}},YL={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},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"}},XL={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"}},QL={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},ZL={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},JL={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},eO={preview:"预览",confirm:"确认",cancel:"取消"},tO={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},nO={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",showWorkspacePaths:"显示工作区路径",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 ({count})",showLess:"收起",showAll:"展开 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchShortcut:"搜索会话 (⌘K)",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},oO={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},sO={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:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},iO={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",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:"进行中"},rO={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},lO={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 后重试"},aO={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",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 关闭"},cO={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},uO={justNow:"刚刚"},dO={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},fO={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},pO={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},hO={panelTitle:"思考过程",close:"关闭"},mO={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},gO={},vO={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:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},yO={searching:"搜索中…",noMatch:"无匹配"},kO={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"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:"目标描述太长了,请精简后重试。"}},bO={help:{desc:"显示可用命令列表"},new:{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:"撤销上一条消息"}},_O={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"}},wO={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},SO={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式"},CO={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},xO={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},AO={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},TO={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",notifyQuestionBody:"A question is waiting for your answer",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages"},MO={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",notifyQuestionBody:"有提问等待你回答",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录"},EO={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"},IO={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},$O={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"},NO={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},LO={en:{common:EL,app:IL,sidebar:$L,workspace:NL,conversation:LL,status:OL,composer:PL,login:RL,providers:DL,model:BL,sessions:FL,approval:HL,question:WL,tasks:zL,thinking:UL,diff:qL,fileTree:jL,filePreview:VL,mention:KL,warnings:GL,commands:YL,tools:XL,layout:QL,mobile:ZL,theme:JL,onboarding:xO,settings:TO,header:EO,sideChat:$O},zh:{common:eO,app:tO,sidebar:nO,workspace:oO,conversation:sO,status:iO,composer:rO,login:lO,providers:aO,model:cO,sessions:uO,approval:dO,question:fO,tasks:pO,thinking:hO,diff:mO,fileTree:gO,filePreview:vO,mention:yO,warnings:kO,commands:bO,tools:_O,layout:wO,mobile:SO,theme:CO,onboarding:AO,settings:MO,header:IO,sideChat:NO}},TA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function OO(){const e=Qn(Et.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Un=i5({legacy:!1,locale:OO(),fallbackLocale:"en",messages:LO});function MA(e){Un.global.locale.value=e,to(Et.locale,e)}const Xa=Un.global.t,PO={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"},RO={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 Zl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return RO[t]??t}function rd(e){const t=PO[Zl(e)];return t?Xa(t):e}const DO={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles"};function S0(e){const t=Zl(e);let n=DO[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n?Ia(n,"sm"):""}const EA=80;function BO(e,t=EA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function FO(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function HO(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function on(e){return typeof e=="string"&&e.length>0?e:void 0}function Sl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function WO(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 ig(e){return on(e.path)??on(e.file_path)??on(e.filePath)??on(e.filename)}const zO=64;function Fu(e,t,n=!1){const o=(s,i=EA)=>n?s.trim():BO(s,i);try{const s=HO(t);if(!n&&FO(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(Zl(e)){case"read":{const r=ig(s);if(!r)return i();const l=Sl(s.offset)??Sl(s.line_start)??Sl(s.start_line),a=Sl(s.limit)??Sl(s.length),c=Sl(s.line_end)??Sl(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=ig(s);return r?o(`${r} ${Xa("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=ig(s);return r?o(r):i()}case"bash":{const r=on(s.command)??on(s.cmd)??on(s.script);return r?o(r,zO):i()}case"grep":case"search":{const r=on(s.pattern)??on(s.query)??on(s.regex),l=on(s.path)??on(s.glob)??on(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=on(s.pattern)??on(s.glob)??on(s.query),l=on(s.path)??on(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):on(s.path)?o(on(s.path)):i()}case"ls":{const r=on(s.path)??on(s.dir)??on(s.directory)??on(s.cwd);return r?o(r):i()}case"web_fetch":{const r=on(s.url)??on(s.uri);return r?o(WO(r)):i()}case"todo":case"task":{const r=on(s.description)??on(s.title)??on(s.prompt)??on(s.name)??on(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(Xa("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function UO(e){try{switch(Zl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Xa("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return Xa("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Xa("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const qO=je({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=F(()=>n(t.status));return(s,i)=>(w(),N("span",{class:Re(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),Hu=ut(qO,[["__scopeId","data-v-e36198e5"]]),jO=["innerHTML"],VO={class:"a"},KO={key:0,class:"p"},GO={class:"rt"},YO=["aria-label"],XO={key:0,class:"tm"},QO=["inert"],ZO={class:"bb-pad"},JO=je({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e){return(t,n)=>(w(),N("div",{class:Re(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[T("div",{class:"bh",onClick:n[0]||(n[0]=o=>t.$emit("toggle"))},[e.icon?(w(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,jO)):ie("",!0),T("span",VO,R(e.name),1),se(Ht,{text:e.arg},{default:_e(()=>[e.arg?(w(),N("span",KO,R(e.arg),1)):ie("",!0)]),_:1},8,["text"]),T("span",GO,[T("span",{class:Re(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),ve(Je,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),ve(Hu,{key:2,status:"suspended"})):(w(),ve(Hu,{key:3,status:"running"}))],10,YO),Cn(t.$slots,"trailing"),e.time?(w(),N("span",XO,R(e.time),1)):ie("",!0)]),e.expandable?(w(),ve(Je,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ie("",!0)]),T("div",{class:Re(["bb",{open:e.open}]),inert:!e.open},[T("div",ZO,[Cn(t.$slots,"default")])],10,QO)],2))}}),C0=ut(JO,[["__scopeId","data-v-92e82f68"]]),eP={key:0,class:"at-type"},tP={key:1,class:"at-task"},nP={key:2,class:"bb-code"},oP=je({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t;function i(_){if(!_)return{};try{const g=JSON.parse(_);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=F(()=>i(o.tool.arg)),l=F(()=>!!o.tool.output&&o.tool.output.length>0),a=F(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Z(o.tool.defaultExpanded===!0&&a.value),u=F(()=>o.tool.status),d=F(()=>rd(o.tool.name)),p=F(()=>S0(o.tool.name)),h=F(()=>r.value.description||r.value.subagentType||""),f=Ut("resolveAgentTaskId"),m=F(()=>f?f(o.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Ke(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(_,g)=>(w(),ve(C0,{status:u.value,icon:p.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:b},{trailing:_e(()=>[m.value?(w(),N("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=vt(v=>s("openAgent",e.tool.id),["stop"]))},R(x(n)("tasks.openDetail")),1)):ie("",!0)]),default:_e(()=>[r.value.subagentType?(w(),N("div",eP,R(r.value.subagentType),1)):ie("",!0),r.value.prompt?(w(),N("div",tP,R(r.value.prompt),1)):ie("",!0),l.value?(w(),N("div",nP,[(w(!0),N(Le,null,nt(e.tool.output??[],(v,y)=>(w(),N("div",{key:y},R(v),1))),128))])):ie("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),sP=ut(oP,[["__scopeId","data-v-14ef8750"]]),iP=1e6,O_=5e3;function P_(e){if(e==="")return[];const t=e.split(`
|
|
39
|
-
`);return t.at(-1)===""&&t.pop(),t}function rP(e,t){const n=P_(e),o=P_(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>O_||i>O_||(s+1)*(i+1)>iP)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let f=1;f<=i;f++)r[h][f]=n[h-1]===o[f-1]?r[h-1][f-1]+1:Math.max(r[h-1][f],r[h][f-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,p=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:p}),d++,p++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:p}),p++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function lP(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function IA(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 $A(e){const t=Zl(e.name);if(t!=="edit"&&t!=="write")return null;const n=IA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:rP(o,s)}return null}function aP(e){const t=IA(e);return t&&typeof t.path=="string"?t.path:void 0}function cP(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const uP={key:0,class:"chip"},dP={key:0,class:"bb-summary"},fP={class:"bb-code"},pP={key:0,class:"bb-empty"},hP=je({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=F(()=>n.tool.status),i=F(()=>rd(n.tool.name)),r=F(()=>S0(n.tool.name)),l=F(()=>Fu(n.tool.name,n.tool.arg)),a=F(()=>Fu(n.tool.name,n.tool.arg,!0)),c=F(()=>$A(n.tool)),u=F(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:b,removed:_}=lP(m);if(b||_)return`+${b} −${_}`}return""}),d=F(()=>!!n.tool.output&&n.tool.output.length>0),p=Z(!1),h=F(()=>d.value&&!n.toolDiffPanel);function f(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(p.value=!p.value)}return(m,b)=>(w(),ve(C0,{status:s.value,icon:r.value,name:i.value,arg:p.value?"":l.value,time:e.tool.timing,open:p.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:_e(()=>[u.value?(w(),N("span",uP,R(u.value),1)):ie("",!0)]),default:_e(()=>[a.value?(w(),N("div",dP,R(a.value),1)):ie("",!0),T("div",fP,[d.value?ie("",!0):(w(),N("div",pP,"Waiting for output…")),(w(!0),N(Le,null,nt(e.tool.output??[],(_,g)=>(w(),N("div",{key:g},R(_),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),mP=ut(hP,[["__scopeId","data-v-69861679"]]),gP={key:0,class:"chip"},vP={key:0,class:"bb-summary"},yP={class:"bb-code"},kP={key:0,class:"bb-empty"},bP=je({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=F(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=F(()=>!!t.tool.output&&t.tool.output.length>0),s=F(()=>o.value||n.value),i=Z(t.tool.defaultExpanded===!0&&s.value),r=F(()=>t.tool.status),l=F(()=>rd(t.tool.name)),a=F(()=>S0(t.tool.name)),c=F(()=>Fu(t.tool.name,t.tool.arg)),u=F(()=>Fu(t.tool.name,t.tool.arg,!0)),d=F(()=>UO({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function p(){s.value&&(i.value=!i.value)}return Ke(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,f)=>(w(),ve(C0,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:_e(()=>[d.value?(w(),N("span",gP,R(d.value),1)):ie("",!0)]),default:_e(()=>[u.value?(w(),N("div",vP,R(u.value),1)):ie("",!0),T("div",yP,[o.value?ie("",!0):(w(),N("div",kP,"Waiting for output…")),(w(!0),N(Le,null,nt(e.tool.output??[],(m,b)=>(w(),N("div",{key:b},R(m),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),_P=ut(bP,[["__scopeId","data-v-f3c4ee38"]]),wP={class:"media-title"},SP=["src","alt"],CP=["src"],xP=["src"],AP=je({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=F(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=F(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(w(),N("div",{key:0,class:Re(["media-tool",{mob:e.mobile}])},[se(Ht,{text:s.value.path||l.value},{default:_e(()=>[T("div",wP,R(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(w(),ve(Ht,{key:0,text:s.value.path||l.value},{default:_e(()=>[T("button",{type:"button",class:"media-image-button",onClick:a},[T("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,SP)])]),_:1},8,["text"])):s.value.kind==="video"?(w(),N("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,CP)):(w(),N("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,xP))],2)):ie("",!0)}}),TP=ut(AP,[["__scopeId","data-v-bec13b73"]]);function MP(e){if(e.media&&e.status==="ok")return TP;const t=Zl(e.name);return t==="edit"||t==="write"||t==="multi_edit"?mP:t==="task"?sP:_P}const NA=je({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=F(()=>MP(n.tool));return(i,r)=>(w(),ve(Wo(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel"]))}});function R_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function EP(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function hh(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function IP(e){return!(e.tool.status==="ok"&&e.tool.media)}function $P(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function NP(e){const t=hh(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(IP(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function LP(e){return hh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
40
|
-
|
|
41
|
-
`)}function OP(e){const t=[];for(const n of hh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
42
|
-
> ${n.thinking.split(`
|
|
43
|
-
`).join(`
|
|
44
|
-
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
|
|
45
|
-
`);t.push(`\`\`\`
|
|
46
|
-
[${n.tool.name}]
|
|
47
|
-
${o}
|
|
48
|
-
\`\`\``)}return t.join(`
|
|
49
|
-
|
|
50
|
-
`)}function LA(e){return e.tool.id||`tool-${e.sourceIndex}`}function PP(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?LA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const RP=["aria-expanded"],DP={class:"tg-title"},BP={class:"tg-meta"},FP={class:"tool-group-body"},HP=je({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=Z(!0),i=F(()=>n.tools.length),r=F(()=>n.tools.some(u=>u.tool.status==="running")?"running":n.tools.some(u=>u.tool.status==="error")?"error":"done"),{t:l}=It(),a=F(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}return(u,d)=>(w(),N("div",{class:Re(["tool-group",{open:s.value}])},[T("button",{class:"tool-group-head",type:"button","aria-expanded":s.value,onClick:c},[se(Hu,{status:r.value},null,8,["status"]),se(Je,{class:"tg-ic",name:"list",size:"sm"}),T("span",DP,R(x(l)("tools.group.title",i.value)),1),T("span",BP,"· "+R(a.value),1),se(Je,{class:"tg-car",name:"chevron-right",size:"sm"})],8,RP),Mn(T("div",FP,[(w(!0),N(Le,null,nt(e.tools,(p,h)=>(w(),ve(NA,{key:x(LA)(p),tool:p.tool,mobile:e.mobile,"stack-position":x($P)(h,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:d[0]||(d[0]=f=>o("openMedia",f)),onOpenFile:d[1]||(d[1]=f=>o("openFile",f)),onOpenToolDiff:d[2]||(d[2]=f=>o("openToolDiff",f)),onOpenAgent:d[3]||(d[3]=f=>o("openAgent",f))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))],512),[[Qs,s.value]])],2))}}),WP=ut(HP,[["__scopeId","data-v-79e21bc7"]]);var zP=Object.create,x0=Object.defineProperty,UP=Object.getOwnPropertyDescriptor,OA=Object.getOwnPropertyNames,qP=Object.getPrototypeOf,jP=Object.prototype.hasOwnProperty,PA=(e,t)=>function(){return t||(0,e[OA(e)[0]])((t={exports:{}}).exports,t),t.exports},RA=e=>{let t={};for(var n in e)x0(t,n,{get:e[n],enumerable:!0});return t},VP=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=OA(t),i=0,r=s.length,l;i<r;i++)l=s[i],!jP.call(e,l)&&l!==n&&x0(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=UP(t,l))||o.enumerable});return e},DA=(e,t,n)=>(n=e!=null?zP(qP(e)):{},VP(x0(n,"default",{value:e,enumerable:!0}),e));function KP(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function GP(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function YP(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function XP(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
51
|
-
`:`<hr class="footnotes-sep">
|
|
52
|
-
`)+`<section class="footnotes">
|
|
53
|
-
<ol class="footnotes-list">
|
|
54
|
-
`}function QP(){return`</ol>
|
|
55
|
-
</section>
|
|
56
|
-
`}function ZP(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function JP(){return`</li>
|
|
57
|
-
`}function eR(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function tR(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=YP,e.renderer.rules.footnote_block_open=XP,e.renderer.rules.footnote_block_close=QP,e.renderer.rules.footnote_open=ZP,e.renderer.rules.footnote_close=JP,e.renderer.rules.footnote_anchor=eR,e.renderer.rules.footnote_caption=GP,e.renderer.rules.footnote_anchor_name=KP;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],p=l.eMarks[a];if(d+4>p||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<p;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=p||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const f=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${f}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:f},m.level=l.level++,l.tokens.push(m);const b=l.bMarks[a],_=l.tShift[a],g=l.sCount[a],v=l.parentType,y=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let O=A;for(;h<p;){const k=l.src.charCodeAt(h);if(n(k))k===9?O+=4-O%4:O++;else break;h++}l.tShift[a]=h-y,l.sCount[a]=O-A,l.bMarks[a]=y,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]=g,l.bMarks[a]=b;const $=new l.Token("footnote_reference_close","",-1);return $.level=--l.level,l.tokens.push($),!0}function s(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,p=t(l,u+1);if(p<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,f=[];l.md.inline.parse(l.src.slice(d,p),l.md,l.env,f);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,p),tokens:f}}return l.pos=p+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 p=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${p}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${p}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:p,count:0},l.env.footnotes.refs[`:${p}`]=h):h=l.env.footnotes.refs[`:${p}`];const f=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:f,label:p}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const p={};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,p[":"+u]=c,!1):(d&&c.push(f),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let f=0,m=h.length;f<m;f++){const b=new l.Token("footnote_open","",1);if(b.meta={id:f,label:h[f].label},l.tokens.push(b),h[f].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const y=new l.Token("inline","",0);y.children=h[f].tokens,y.content=h[f].content,a.push(y);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[f].label&&(a=p[`:${h[f].label}`]);a&&(l.tokens=l.tokens.concat(a));let _;l.tokens[l.tokens.length-1].type==="paragraph_close"?_=l.tokens.pop():_=null;const g=h[f].count>0?h[f].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:f,subId:v,label:h[f].label},l.tokens.push(y)}_&&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",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function nR(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function oR(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const sR=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function iR(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(sR,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function rR(e){e.inline.ruler.after("emphasis","sub",iR)}const lR=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function aR(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(lR,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function cR(e){e.inline.ruler.after("emphasis","sup",aR)}var uR=PA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),m.core.ruler.after("inline","github-task-lists",function(_){for(var g=_.tokens,v=0,y=2;y<g.length;y++)s(g,y)&&(i(g[y],v,b,_.Token),v+=1,n(g[y-2],"class",b.liClass),n(g[o(g,y-2)],"class",b.ulClass))})};function n(m,b,_){var g=m.attrIndex(b),v=[b,_];g<0?m.attrPush(v):m.attrs[g]=v}function o(m,b){for(var _=m[b].level-1,g=b-1;g>=0;g--)if(m[g].level===_)return g;return-1}function s(m,b){return d(m[b])&&p(m[b-1])&&h(m[b-2])&&f(m[b])}function i(m,b,_,g){var v=_.idPrefix+b;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,_,g)),_.divWrap&&(m.children.unshift(c(_,g)),m.children.push(u(g)))}function r(m,b,_,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),_.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,b){var _=new b("label_open","label",1);return _.attrs=[["for",m]],_}function a(m){return new m("label_close","label",-1)}function c(m,b){var _=new b("checkbox_open","div",0);return _.attrs=[["class",m.divClass]],_}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function p(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function f(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),dR=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))),fR=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),rg;const pR=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]]),hR=(rg=String.fromCodePoint)!==null&&rg!==void 0?rg: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 mR(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=pR.get(e))!==null&&t!==void 0?t:e}var bo;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(bo||(bo={}));const gR=32;var Br;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Br||(Br={}));function Gv(e){return e>=bo.ZERO&&e<=bo.NINE}function vR(e){return e>=bo.UPPER_A&&e<=bo.UPPER_F||e>=bo.LOWER_A&&e<=bo.LOWER_F}function yR(e){return e>=bo.UPPER_A&&e<=bo.UPPER_Z||e>=bo.LOWER_A&&e<=bo.LOWER_Z||Gv(e)}function kR(e){return e===bo.EQUALS||yR(e)}var ko;(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"})(ko||(ko={}));var Pr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Pr||(Pr={}));var bR=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ko.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Pr.Strict}startEntity(e){this.decodeMode=e,this.state=ko.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ko.EntityStart:return e.charCodeAt(t)===bo.NUM?(this.state=ko.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ko.NamedEntity,this.stateNamedEntity(e,t));case ko.NumericStart:return this.stateNumericStart(e,t);case ko.NumericDecimal:return this.stateNumericDecimal(e,t);case ko.NumericHex:return this.stateNumericHex(e,t);case ko.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|gR)===bo.LOWER_X?(this.state=ko.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ko.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(Gv(o)||vR(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(Gv(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===bo.SEMI)this.consumed+=1;else if(this.decodeMode===Pr.Strict)return 0;return this.emitCodePoint(mR(this.result),this.consumed),this.errors&&(e!==bo.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&Br.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=_R(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===Pr.Attribute&&(s===0||kR(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&Br.VALUE_LENGTH)>>14,s!==0){if(i===bo.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Pr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&Br.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~Br.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case ko.NamedEntity:return this.result!==0&&(this.decodeMode!==Pr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ko.NumericDecimal:return this.emitNumericEntity(0,2);case ko.NumericHex:return this.emitNumericEntity(0,3);case ko.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ko.EntityStart:return 0}}};function BA(e){let t="";const n=new bR(e,o=>t+=hR(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function _R(e,t,n,o){const s=(t&Br.BRANCH_LENGTH)>>7,i=t&Br.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const wR=BA(dR);BA(fR);function A0(e,t=Pr.Legacy){return wR(e,t)}var SR=DA(uR());const D_={};function CR(e){let t=D_[e];if(t)return t;t=D_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function mh(e,t){typeof t!="string"&&(t=mh.defaultChars);const n=CR(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}mh.defaultChars=";/?:@&=+$,#";mh.componentChars="";var Yv=mh;const B_={};function xR(e){let t=B_[e];if(t)return t;t=B_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function gh(e,t,n){typeof t!="string"&&(n=t,t=gh.defaultChars),typeof n>"u"&&(n=!0);const o=xR(t);let s="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}gh.defaultChars=";/?:@&=+$,-_.!~*'()#";gh.componentChars="-_.!~*'()";var FA=gh;function T0(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 fp(){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 AR=/^([a-z0-9.+-]+:)/i,TR=/:[0-9]*$/,MR=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ER=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
58
|
-
`," "]),IR=["'"].concat(ER),F_=["%","/","?",";","#"].concat(IR),H_=["/","?","#"],$R=255,W_=/^[+a-z0-9A-Z_-]{0,63}$/,NR=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,z_={javascript:!0,"javascript:":!0},U_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function LR(e,t){if(e&&e instanceof fp)return e;const n=new fp;return n.parse(e,t),n}fp.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=MR.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=AR.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&z_[r])&&(i=i.substr(2),this.slashes=!0)),!z_[r]&&(s||r&&!U_[r])){let c=-1;for(let f=0;f<H_.length;f++)o=i.indexOf(H_[f]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let f=0;f<F_.length;f++)o=i.indexOf(F_[f]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const p=i.slice(0,c);i=i.slice(c),this.parseHost(p),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const f=this.hostname.split(/\./);for(let m=0,b=f.length;m<b;m++){const _=f[m];if(_&&!_.match(W_)){let g="";for(let v=0,y=_.length;v<y;v++)_.charCodeAt(v)>127?g+="x":g+=_[v];if(!g.match(W_)){const v=f.slice(0,m),y=f.slice(m+1),A=_.match(NR);A&&(v.push(A[1]),y.unshift(A[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>$R&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),U_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};fp.prototype.parseHost=function(e){let t=TR.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 M0=LR,HA=RA({decode:()=>Yv,encode:()=>FA,format:()=>T0,parse:()=>M0}),WA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zA=/[\0-\x1F\x7F-\x9F]/,OR=/[\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]/,UA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,PR=/[\$\+<->\^`\|~\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]/,qA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,RR=RA({Any:()=>WA,Cc:()=>zA,Cf:()=>OR,P:()=>UA,S:()=>PR,Z:()=>qA}),DR=Object.defineProperty,jA=e=>{let t={};for(var n in e)DR(t,n,{get:e[n],enumerable:!0});return t},io=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n<o;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},BR=jA({arrayReplaceAt:()=>jR,assign:()=>UR,countLines:()=>Gn,escapeHtml:()=>e7,escapeRE:()=>n7,fromCodePoint:()=>zu,has:()=>zR,isMdAsciiPunct:()=>mp,isPunctChar:()=>hp,isPunctCode:()=>Xv,isSpace:()=>qR,isString:()=>HR,isValidEntityCode:()=>yh,isWhiteSpace:()=>Wu,lib:()=>o7,mdurl:()=>HA,normalizeReference:()=>vh,ucmicro:()=>pp,unescapeAll:()=>Uu,unescapeMd:()=>YR});const pp=RR;function FR(e){return Object.prototype.toString.call(e)}function HR(e){return FR(e)==="[object String]"}const WR=Object.prototype.hasOwnProperty;function zR(e,t){return WR.call(e,t)}function UR(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function qR(e){return e===9||e===32}function Wu(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 hp(e){return pp.P.test(e)||pp.S.test(e)}const q_=new Map;function Xv(e){if(mp(e))return!0;const t=q_.get(e);if(t!==void 0)return t;const n=hp(String.fromCharCode(e));return q_.set(e,n),n}function mp(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 vh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function jR(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function yh(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 zu(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 VA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,VR=new RegExp(`${VA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),KR=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function GR(e,t){if(t.charCodeAt(0)===35&&KR.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return yh(o)?zu(o):e}const n=A0(e);return n!==e?n:e}function YR(e){return e.includes("\\")?e.replace(VA,"$1"):e}function Uu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(VR,(t,n,o)=>n||GR(t,o))}const XR=/[&<>"]/,QR=/[&<>"]/g,ZR={"&":"&","<":"<",">":">",'"':"""};function JR(e){return ZR[e]}function e7(e){return XR.test(e)?e.replace(QR,JR):e}const t7=/[.?*+^$[\]\\(){}|-]/g;function n7(e){return e.replace(t7,"\\$&")}const o7={mdurl:HA,ucmicro:pp};function Gn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
59
|
-
`,n+1))!==-1;)t++;return t}const s7=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,i7=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,r7=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,E0=["references","footnotes","abbreviations","abbr","abbrs"],I0=Symbol.for("markdown-it-ts.global-state"),$0=Object.prototype.hasOwnProperty;function j_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function fi(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ur(e){if(Array.isArray(e))return e.map(t=>Ur(t));if(fi(e)){const t={};for(const n of Object.keys(e))t[n]=Ur(e[n]);return t}return e}function gp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):fi(e)?Object.keys(e):[]}function Qv(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(!Qv(e[n],t[n]))return!1;return!0}if(fi(e)||fi(t)){if(!fi(e)||!fi(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!$0.call(t,s)||!Qv(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function KA(e,t){if(Array.isArray(e))return e[Number(t)];if(fi(e))return e[t]}function l7(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Ur(t[n]);return e}if(fi(e)&&fi(t)){for(const n of Object.keys(e))$0.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Ur(t[n]);return e}return Ur(t)}function a7(e,t,n){const o=n.ownedKeys??[],s=e[t];if(fi(s)||Array.isArray(s)){const i=new Set(gp(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=Ur(KA(n.value,r)):delete s[r];!n.existed&&gp(s).length===0&&delete e[t];return}n.existed?e[t]=Ur(n.value):delete e[t]}function N0(e){const t=e[I0];return j_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&j_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function c7(e,t){Object.defineProperty(e,I0,{value:t,enumerable:!1,configurable:!0,writable:!0})}function cs(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:s7.test(e)?"footnote-definition":i7.test(e)?"abbreviation-definition":r7.test(e)?"reference-definition":null}function ld(e){return N0(e)?.reason??null}function Qa(e,t,n){if(ld(e)&&rr(e),!t)return n();L0(e,t);try{const o=n();return O0(e),o}catch(o){throw rr(e),o}}function L0(e,t){try{rr(e);const n={};for(const o of E0)n[o]=$0.call(e,o)?{existed:!0,value:Ur(e[o])}:{existed:!1};c7(e,{reason:t,snapshot:n})}catch{}}function O0(e){const t=N0(e);if(t)for(const n of E0){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!fi(s)&&!Array.isArray(s))continue;const i=new Set(gp(o.existed?o.value:void 0));o.ownedKeys=gp(s).filter(r=>i.has(r)?!Qv(s[r],KA(o.value,r)):!0)}}function rr(e){const t=N0(e);if(t){for(const n of E0){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){a7(e,n,o);continue}o.existed?e[n]=l7(e[n],o.value):delete e[n]}delete e[I0]}}const Zv=Symbol.for("markdown-it-ts.diagnostics");function kh(e,t){if(e)try{const n=e[Zv];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[Zv]=o,o}catch{return}}function qi(e){return kh(e,!1)}function u7(e){if(e)try{const t=e[Zv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function Go(e){u7(e)}function oo(e,t){const n=kh(e,!0);n&&(n.strategy=t)}function lg(e,t){const n=kh(e,!0);n&&(n.chunk=t)}function GA(e,t){const n=kh(e,!0);n&&(n.unbounded=t)}function d7(e){const t={};e=e||{},t.src_Any=WA.source,t.src_Cc=zA.source,t.src_Z=qA.source,t.src_P=UA.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 Jv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function bh(e){return Object.prototype.toString.call(e)}function f7(e){return bh(e)==="[object String]"}function p7(e){return bh(e)==="[object Object]"}function h7(e){return bh(e)==="[object RegExp]"}function V_(e){return bh(e)==="[object Function]"}function m7(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const YA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function g7(e){return Object.keys(e||{}).reduce(function(t,n){return t||YA.hasOwnProperty(n)},!1)}const v7={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},y7="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]",k7="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function b7(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function K_(){return function(e,t){t.normalize(e)}}function vp(e){const t=e.re=d7(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(y7),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,p7(a)){h7(a.validate)?c.validate=b7(a.validate):V_(a.validate)?c.validate=a.validate:i(l,a),V_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=K_();return}if(f7(a)){s.push(l);return}i(l,a)}),s.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:K_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(m7).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function XA(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function Rs(e,t){if(!(this instanceof Rs))return new Rs(e,t);t||g7(e)&&(t=e,e={}),this.__opts__=Jv({},YA,t),this.__schemas__=Jv({},v7,e),this.__compiled__={},this.__tlds__=k7,this.__tlds_replaced__=!1,this.re={},vp(this)}Rs.prototype.add=function(t,n){return this.__schemas__[t]=n,vp(this),this};Rs.prototype.set=function(t){return this.__opts__=Jv(this.__opts__,t),this};Rs.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};Rs.prototype.pretest=function(t){return this.re.pretest.test(t)};Rs.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};Rs.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(p,h){return p?h?p.index!==h.index?p.index<h.index?p:h:p.lastIndex>=h.lastIndex?p:h:p:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const p=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(p[0],p[1]),p[2]);if(!h)break;if(h===p[0]?u[0]++:h===p[1]?u[1]++:u[2]++,h.index<d)continue;const f=new XA(t,h.schema,h.index,h.lastIndex);this.__compiled__[f.schema].normalize(f,this),n.push(f),d=h.lastIndex}return n.length?n:null};Rs.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new XA(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};Rs.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),vp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,vp(this),this)};Rs.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Rs.prototype.onCompile=function(){};var QA=Rs,_7=PA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,p=/[^\0-\x7F]/,h=/[\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"},m=35,b=Math.floor,_=String.fromCharCode;function g(D){throw new RangeError(f[D])}function v(D,W){const z=[];let q=D.length;for(;q--;)z[q]=W(D[q]);return z}function y(D,W){const z=D.split("@");let q="";z.length>1&&(q=z[0]+"@",D=z[1]),D=D.replace(h,".");const Q=v(D.split("."),W).join(".");return q+Q}function A(D){const W=[];let z=0;const q=D.length;for(;z<q;){const Q=D.charCodeAt(z++);if(Q>=55296&&Q<=56319&&z<q){const X=D.charCodeAt(z++);(X&64512)==56320?W.push(((Q&1023)<<10)+(X&1023)+65536):(W.push(Q),z--)}else W.push(Q)}return W}const O=D=>String.fromCodePoint(...D),$=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},k=function(D,W){return D+22+75*(D<26)-((W!=0)<<5)},E=function(D,W,z){let q=0;for(D=z?b(D/700):D>>1,D+=b(D/W);D>m*26>>1;q+=36)D=b(D/m);return b(q+(m+1)*D/(D+38))},M=function(D){const W=[],z=D.length;let q=0,Q=128,X=72,fe=D.lastIndexOf("-");fe<0&&(fe=0);for(let ye=0;ye<fe;++ye)D.charCodeAt(ye)>=128&&g("not-basic"),W.push(D.charCodeAt(ye));for(let ye=fe>0?fe+1:0;ye<z;){const Me=q;for(let ze=1,Ue=36;;Ue+=36){ye>=z&&g("invalid-input");const Fe=$(D.charCodeAt(ye++));Fe>=36&&g("invalid-input"),Fe>b((2147483647-q)/ze)&&g("overflow"),q+=Fe*ze;const rt=Ue<=X?1:Ue>=X+26?26:Ue-X;if(Fe<rt)break;const le=36-rt;ze>b(2147483647/le)&&g("overflow"),ze*=le}const we=W.length+1;X=E(q-Me,we,Me==0),b(q/we)>2147483647-Q&&g("overflow"),Q+=b(q/we),q%=we,W.splice(q++,0,Q)}return String.fromCodePoint(...W)},L=function(D){const W=[];D=A(D);const z=D.length;let q=128,Q=0,X=72;for(const Me of D)Me<128&&W.push(_(Me));const fe=W.length;let ye=fe;for(fe&&W.push("-");ye<z;){let Me=2147483647;for(const ze of D)ze>=q&&ze<Me&&(Me=ze);const we=ye+1;Me-q>b((2147483647-Q)/we)&&g("overflow"),Q+=(Me-q)*we,q=Me;for(const ze of D)if(ze<q&&++Q>2147483647&&g("overflow"),ze===q){let Ue=Q;for(let Fe=36;;Fe+=36){const rt=Fe<=X?1:Fe>=X+26?26:Fe-X;if(Ue<rt)break;const le=Ue-rt,U=36-rt;W.push(_(k(rt+le%U,0))),Ue=b(le/U)}W.push(_(k(Ue,0))),X=E(Q,we,ye===fe),Q=0,++ye}++Q,++q}return W.join("")},P={version:"2.3.1",ucs2:{decode:A,encode:O},decode:M,encode:L,toASCII:function(D){return y(D,function(W){return p.test(W)?"xn--"+L(W):W})},toUnicode:function(D){return y(D,function(W){return d.test(W)?M(W.slice(4).toLowerCase()):W})}};t.exports=P})}),ZA=DA(_7());function P0(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=Uu(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=Uu(e.slice(t,s)),i.pos=s,i.ok=!0),i}var JA=P0;const Af=-2;function w7(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return Af}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return Af;if(r===91){s++,i++;continue}i++}return-1}function R0(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const p=w7(l,t,a,n);if(p!==Af)return p;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var yp=R0;function D0(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=Uu(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Uu(e.slice(t,i)),r}var eT=D0;function _h(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 B0(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function S7(e,t,n){const o=_h(e,t),s=[t,n];o<0?B0(e,s):e.attrs[o]=s}function C7(e,t){const n=_h(e,t);return n>=0?e.attrs[n][1]:null}function x7(e,t,n){const o=_h(e,t);o<0?B0(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var A7=jA({attrGet:()=>C7,attrIndex:()=>_h,attrJoin:()=>x7,attrPush:()=>B0,attrSet:()=>S7,parseLinkDestination:()=>P0,parseLinkLabel:()=>R0,parseLinkTitle:()=>D0});function T7(e){return e.includes("\r")||e.includes("\0")}function tT(e){return typeof e=="string"?e:e.toString()}function M7(e){if(e.inlineMode){const t=new io("inline","",0);t.content=tT(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 E7=/^([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])?)*)$/,I7=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function $7(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(I7.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(E7.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 N7=$7;function L7(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let p=n.slice(o,c);p.includes(`
|
|
60
|
-
`)&&(p=p.replace(/\n/g," ")),p.length>2&&p.charCodeAt(0)===32&&p.charCodeAt(p.length-1)===32&&(p=p.slice(1,-1)),d.content=p}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var O7=L7;function G_(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let p=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(p=!0),!p){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function P7(e){const t=e.tokens_meta,n=e.tokens_meta.length;G_(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&G_(t[o].delimiters)}var R7=P7;function D7(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);if(!s||s.length===0)return!1;for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function Y_(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.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[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function B7(e){const t=e.tokens_meta,n=e.tokens_meta.length;Y_(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Y_(e,t[o].delimiters)}const X_={tokenize:D7,postProcess:B7};function nT(e){return A0(e)}function F0(e){return e>=48&&e<=57}function F7(e){const t=e|32;return F0(e)||t>=97&&t<=102}function oT(e){const t=e|32;return t>=97&&t<=122}function H7(e){return oT(e)||F0(e)}function W7(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?F7(l):F0(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function z7(e,t,n){let o=t+1;if(o>=n||!oT(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&H7(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return nT(s)!==s?s:null}function U7(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=W7(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=yh(i)?zu(i):zu(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=z7(e.src,n,o);if(s){const i=nT(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var q7=U7;const sT=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),e1=new Array(128),iT=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);e1[e]=`\\${t}`,iT[e]=sT[e]?t:e1[e]}function Q_(e,t,n){e.pending&&e.pushPending();const o=new io("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function j7(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Q_(e,iT[i],e1[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return Q_(e,i<256&&sT[i]?r:l,l),e.pos=n+1,!0}var V7=j7;function K7(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var G7=K7;const rT=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,lT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Y7=new RegExp(`^(?:${rT}|${lT}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),X7=new RegExp(`^(?:${rT}|${lT})`);function aT(e){return e===32||e===9||e===10||e===12||e===13}function Q7(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||aT(t)}function Z7(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(!aT(n))return!1}return!1}function J7(e){const t=e|32;return t>=97&&t<=122}function eD(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!J7(i))return!1;const r=s.slice(o).match(Y7);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,Q7(l)&&e.linkLevel++,Z7(l)&&e.linkLevel--}return e.pos+=l.length,!0}var tD=eD;function nD(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,p=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,f=yp(e,e.pos+1,!1);if(f<0)return!1;if(i=f+1,i<p&&e.src.charCodeAt(i)===40){for(i++;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=p)return!1;if(l=JA(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<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=eT(e.src,i,e.posMax),i<p&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=p||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<p&&e.src.charCodeAt(i)===91?(c=i+1,i=yp(e,i),i>=0?s=e.src.slice(c,i++):i=f+1):i=f+1,s||(s=e.src.slice(h,f)),r=e.env.references[vh(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,f);const m=[];e.md.inline.parse(o,e.md,e.env,m);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=m,b.content=o,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=p,!0}var oD=nD;function sD(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,p=e.pos+1,h=yp(e,e.pos,!0);if(h<0)return!1;let f=h+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(s=JA(e.src,f,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?f=s.pos:r="",a=f;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(s=eT(e.src,f,e.posMax),f<d&&a!==f&&s.ok)for(l=s.str,f=s.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=yp(e,f),f>=0?o=e.src.slice(a,f++):f=h+1):f=h+1,o||(o=e.src.slice(p,h)),i=e.env.references[vh(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=p,e.posMax=h;const m=e.push("link_open","a",1),b=[["href",r]];m.attrs=b,l&&b.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 iD=sD;function cT(e){const t=e|32;return t>=97&&t<=122}function rD(e){return e>=48&&e<=57}function lD(e){return cT(e)||rD(e)||e===43||e===45||e===46}function aD(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&lD(e.charCodeAt(t));)t--;return t++,t>=e.length||!cT(e.charCodeAt(t))?null:e.slice(t)}function cD(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function uD(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=aD(e.pending);if(!s)return!1;const i=cD(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-s.length,!0}function dD(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var fD=dD;function pD(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function Z_(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function hD(e){const t=e.delimiters;Z_(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&Z_(e,n[o].delimiters)}const J_={tokenize:pD,postProcess:hD};function ew(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 mD(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||ew(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!ew(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var gD=mD;function H0(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function vD(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function yD(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 uT(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:H0(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function Za(e,t,n,o,s,i){const r=uT(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=yD(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=H0()}function kD(e){const t=uT(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=vD(s.samples)}return t.completedAt=H0(),t}var tw=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},dT=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new io("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 io(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const o=new io(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=Wu(l),u=Wu(a),d=Xv(l),p=Xv(a),h=!u&&(!p||c||d),f=!c&&(!d||u||p);return{can_open:h&&(t||!f||d),can_close:f&&(t||!h||p),length:r}}};dT.prototype.Token=io;const bD=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function fT(e){return!bD.test(e)}var _D=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new tw,this.ruler2=new tw,this.ruler.push("text",gD),this.ruler.push("linkify",uD),this.ruler.push("newline",fD),this.ruler.push("escape",V7),this.ruler.push("backticks",O7),this.ruler.push("strikethrough",J_.tokenize),this.ruler.push("emphasis",X_.tokenize),this.ruler.push("link",iD),this.ruler.push("image",oD),this.ruler.push("autolink",N7),this.ruler.push("html_inline",tD),this.ruler.push("entity",q7),this.ruler2.push("balance_pairs",R7),this.ruler2.push("strikethrough",J_.postProcess),this.ruler2.push("emphasis",X_.postProcess),this.ruler2.push("fragments_join",G7),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<o;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Za(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<o;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Za(e.env,"inline",s[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&fT(e)){const a=new io("text","",0);a.content=e,o.push(a);return}const s=new dT(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Za(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function wD(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&fT(i.content)){const r=new io("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const SD=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,CD=/[0-9a-z]/i;function xD(e){return/^<a[>\s]/i.test(e)}function AD(e){return/^<\/a\s*>/i.test(e)}function TD(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!SD.test(o)||!CD.test(s))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function MD(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(xD(l.content)&&i>0&&i--,AD(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(h=>TD(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,p=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const f=c[h],m=e.md.normalizeLink(f.url);if(!e.md.validateLink(m))continue;let b=f.text;f.schema?f.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const _=f.index;if(_>p){const A=new io("text","",0);A.content=a.slice(p,_),A.level=d,u.push(A)}const g=new io("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new io("text","",0);v.content=b,v.level=d,u.push(v);const y=new io("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),p=f.lastIndex}if(p!==0){if(p<a.length){const h=new io("text","",0);h.content=a.slice(p),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const ED=/\r\n?|\n/g,ID=/\0/g;function $D(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(ED,`
|
|
61
|
-
`)),o&&(s=s.replace(ID,"�")),e.src=s}const pT=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ND=/\((?:c|tm|r)\)/i,LD=/\((c|tm|r)\)/gi,OD={c:"©",r:"®",tm:"™"};function PD(e,t){return OD[t.toLowerCase()]}function RD(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(LD,PD)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function DD(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&pT.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function BD(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");ND.test(o)&&RD(n.children||[]),pT.test(o)&&DD(n.children||[])}}var FD=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(o=>o.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(o=>o.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const HD=/['"]/,nw=/['"]/g,ow="’";function ef(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function WD(e,t){let n;const o=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){nw.lastIndex=c;const d=nw.exec(a);if(!d)break;let p=!0,h=!0;c=d.index+1;const f=d[0]==="'";let m=32;if(d.index-1>=0)m=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const _=mp(m)||hp(String.fromCharCode(m)),g=mp(b)||hp(String.fromCharCode(b)),v=Wu(m),y=Wu(b);if(y?p=!1:g&&(v||_||(p=!1)),v?h=!1:_&&(y||g||(h=!1)),b===34&&d[0]==='"'&&m>=48&&m<=57&&(h=p=!1),p&&h&&(p=_,h=g),!p&&!h){f&&(r.content=ef(r.content,d.index,ow));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level<l)break;if(A.single===f&&o[n].level===l){A=o[n];let O,$;f?(O=s[2]||"‘",$=s[3]||"’"):(O=s[0]||"“",$=s[1]||"”"),r.content=ef(r.content,d.index,$),e[A.token].content=ef(e[A.token].content,A.pos,O),c+=$.length-1,A.token===i&&(c+=O.length-1),a=r.content,u=a.length,o.length=n;continue e}}p?o.push({token:i,pos:d.index,single:f,level:l}):h&&f&&(r.content=ef(r.content,d.index,ow))}}}function zD(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!HD.test(o)||!n.children||WD(n.children,e)}}function UD(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const qD=/^(?:vbscript|javascript|file|data):/,jD=/^data:image\/(?:gif|png|jpeg|webp);/,hT=["http:","https:","mailto:"];function mT(e){const t=e.trim().toLowerCase();return qD.test(t)?jD.test(t):!0}function gT(e){const t=M0(e,!0);if(t.hostname&&(!t.protocol||hT.includes(t.protocol)))try{t.hostname=ZA.default.toASCII(t.hostname)}catch{}return FA(T0(t))}function vT(e){const t=M0(e,!0);if(t.hostname&&(!t.protocol||hT.includes(t.protocol)))try{t.hostname=ZA.default.toUnicode(t.hostname)}catch{}return Yv(T0(t),`${Yv.defaultChars}%`)}function VD(e){switch(e){case 9:case 32:return!0}return!1}function KD(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const p=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],f=[],m=[],b=[],_=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const E=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(s.charCodeAt(u++)===62&&!E){let L=a[y]+1,S,I;s.charCodeAt(u)===32?(u++,L++,I=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[y]+L)%4===3?(u++,L++,I=!1):I=!0):S=!1;let P=L;for(h.push(i[y]),i[y]=u;u<d;){const D=s.charCodeAt(u);if(VD(D))D===9?P+=4-(P+c[y]+(I?1:0))%4:P++;else break;u++}v=u>=d,f.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=P-L,b.push(l[y]),l[y]=u-i[y];continue}if(v)break;let M=!1;for(let L=0,S=_.length;L<S;L++)if(_[L](e,y,n,!0)){M=!0;break}if(M){e.lineMax=y,e.blkIndent!==0&&(h.push(i[y]),f.push(c[y]),b.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}h.push(i[y]),f.push(c[y]),b.push(l[y]),m.push(a[y]),a[y]=-1}const A=e.blkIndent;e.blkIndent=0;const O=e.push("blockquote_open","blockquote",1);O.markup=">";const $=[t,0];O.map=$,e.md.block.tokenize(e,t,y);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=p,e.parentType=g,$[1]=e.line;for(let E=0;E<b.length;E++)i[E+t]=h[E],l[E+t]=b[E],a[E+t]=m[E],c[E+t]=f[E];return e.blkIndent=A,!0}function GD(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
|
|
62
|
-
`,i.map=[t,e.line],!0}function YD(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,p=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){p=!0;break}a=e.sCount[t],e.line=d+(p?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const sw=["","h1","h2","h3","h4","h5","h6"],iw=["","#","##","###","####","#####","######"];function rw(e){switch(e){case 9:case 32:return!0}return!1}function XD(e,t,n,o){const s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!rw(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const p=e.skipCharsBack(c,35,a);p>a&&rw(s.charCodeAt(p-1))&&(c=p),e.line=t+1;const h=e.push("heading_open",sw[d],1);h.markup=iw[d],h.map=[t,e.line];const f=e.push("inline","",0);f.content=s.slice(a,c).trim(),f.map=[t,e.line],f.children=[];const m=e.push("heading_close",sw[d],-1);return m.markup=iw[d],!0}function QD(e){switch(e){case 9:case 32:return!0}return!1}function ZD(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!QD(c))return!1;c===r&&l++}if(l<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const ba=[[/^<(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(`${X7.source}\\s*$`),/^$/,!1]];function JD(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<ba.length&&!ba[l][0].test(r);l++);if(l===ba.length)return!1;if(o)return ba[l][2];let a=t+1;if(!ba[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),ba[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 lw(e){switch(e){case 9:case 32:return!0}return!1}const du={Pipe:1,ParagraphTerminator:2};function e9(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var yT=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const p=s.charCodeAt(u);if(p===124&&(c|=du.Pipe|du.ParagraphTerminator),!a)if(lw(p)){i++,p===9?r+=4-r%4:r++;continue}else a=!0,e9(p)&&(c|=du.ParagraphTerminator);(p===10||u===d-1)&&(p!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new io(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new io(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let p=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let f=0;const m=this.src,b=this.bsCount,_=this.tShift;for(;p<h&&f<n;){const g=m.charCodeAt(p);if(g===9||g===32)g===9?f+=4-(f+b[u])%4:f++;else if(p-d<_[u])f++;else break;p++}return f>n?new Array(f-n+1).join(" ")+m.slice(p,h):m.slice(p,h)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let p=0;const h=r[d];let f=h,m;for(d+1<t||o?m=l[d]+1:m=l[d];f<m&&p<n;){const b=i.charCodeAt(f);if(lw(b))b===9?p+=4-(p+a[d])%4:p++;else if(f-h<c[d])p++;else break;f++}p>n?s[u]=new Array(p-n+1).join(" ")+i.slice(f,m):s[u]=i.slice(f,m)}return s.join("")}};yT.prototype.Token=io;function t9(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function kT(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function bT(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&du.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:t9(n,o,s)}const aw=["","h1","h2"];function n9(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=kT(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let p=0,h,f=t+1;for(;f<n;f++){const y=i[f]+r[f],A=l[f];if(y>=A)break;if(a[f]-c>3)continue;if(a[f]>=c&&(h=s.charCodeAt(y),h===45||h===61)){let $=y+1,k=$;for(;$<A&&s.charCodeAt($)===h;)$++;for(k=$;$<A;){const E=s.charCodeAt($);if(E!==9&&E!==32)break;$++}if($>=A){p=h===61?1:2;break}if(k-y>1)continue}if(a[f]<0||u&&!bT(e,f,s,y,A))continue;let O=!1;for(let $=0,k=o.length;$<k;$++)if(o[$](e,f,n,!0)){O=!0;break}if(O)break}if(!p)return!1;let m;if(f===t+1){const y=i[t]+r[t];let A=l[t];for(;A>y;){const O=s.charCodeAt(A-1);if(O!==9&&O!==32)break;A--}m=s.slice(y,A)}else m=e.getLines(t,f,c,!1).trim();e.line=f+1;const b=h===61?"=":"-",_=e.push("heading_open",aw[p],1);_.markup=b,_.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",aw[p],-1);return v.markup=b,e.parentType=d,!0}function _T(e){switch(e){case 9:case 32:return!0}return!1}function cw(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!_T(i.charCodeAt(l))?-1:l}function uw(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!_T(c))?-1:a}function o9(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const s9=["0","1","2","3","4","5","6","7","8","9"];function i9(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function r9(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,p;const h=e.src,f=e.bMarks,m=e.tShift,b=e.eMarks,_=e.sCount,g=e.bsCount,v=f[l]+m[l];if(v>=b[l])return!1;const y=h.charCodeAt(v);if(y>=48&&y<=57){if(p=uw(e,l),p<0||(u=!0,r=v,d=o9(e,l,p),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(p=cw(e,l),p<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(p)>=b[l])return!1;if(o)return!0;const A=h.charCodeAt(p-1),O=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const $=[l,0];e.tokens[e.tokens.length-1].map=$,e.tokens[e.tokens.length-1].markup=O;let k=!1;const E=e.tokens.length-1,M=e.md.block.ruler.getRulesForState(e,"list"),L=e.parentType;for(e.parentType="list";l<n;){i=p,s=b[l];const S=_[l]+p-(f[l]+m[l]);let I=S;for(;i<s;){const we=h.charCodeAt(i);if(we===9)I+=4-(I+g[l])%4;else if(we===32)I++;else break;i++}const P=i;let D;P>=s?D=1:D=I-S,D>4&&(D=1);const W=S+D,z=e.push("list_item_open","li",1);z.markup=O;const q=[l,0];z.map=q,u&&(z.info=p-r-1===1?s9[h.charCodeAt(r)-48]:h.slice(r,p-1));const Q=e.tight,X=e.tShift[l],fe=e.sCount[l],ye=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=W,e.tight=!0,e.tShift[l]=P-f[l],e.sCount[l]=I,P>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||k)&&(a=!1),k=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ye,e.tShift[l]=X,e.sCount[l]=fe,e.tight=Q,e.push("list_item_close","li",-1).markup=O,l=e.line,q[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let Me=!1;for(let we=0,ze=M.length;we<ze;we++)if(M[we](e,l,n,!0)){Me=!0;break}if(Me)break;if(u){if(p=uw(e,l),p<0)break;r=f[l]+m[l]}else if(p=cw(e,l),p<0)break;if(A!==h.charCodeAt(p-1))break}return u?e.push("ordered_list_close","ol",-1).markup=O:e.push("bullet_list_close","ul",-1).markup=O,$[1]=l,e.line=l,e.parentType=L,a&&i9(e,E),!0}function dw(e){return e===9||e===32}function l9(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=kT(e);let p=t+1;for(e.parentType="paragraph";p<n&&!e.isEmpty(p);p++){if(c[p]-u>3||c[p]<0)continue;if(s==="list"&&c[p]>=u){const v=r[p]+l[p],y=a[p];if(v<y){const A=i.charCodeAt(v);if(A===42||A===45||A===43){if(v+1>=y||dw(i.charCodeAt(v+1)))break}else if(A>=48&&A<=57&&v+1<y){let O=v+1;for(;;){if(O>=y){O=-1;break}const $=i.charCodeAt(O++);if($>=48&&$<=57){if(O-v>=10){O=-1;break}continue}if(($===41||$===46)&&(O>=y||dw(i.charCodeAt(O))))break;O=-1;break}if(O>=0)break}}}const b=r[p]+l[p],_=a[p];if(d&&!bT(e,p,i,b,_))continue;let g=!1;for(let v=0,y=o.length;v<y;v++)if(o[v](e,p,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,p,u,!1).trim();e.line=p;const f=e.push("paragraph_open","p",1);f.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function tf(e){switch(e){case 9:case 32:return!0}return!1}function a9(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(s)!==91)return!1;function a(v){const y=e.lineMax;if(v>=y||e.isEmpty(v))return null;let A=!1;if(e.sCount[v]-e.blkIndent>3&&(A=!0),e.sCount[v]<0&&(A=!0),!A){const k=e.parentType;e.parentType="reference";let E=!1;for(let M=0,L=l.length;M<L;M++)if(l[M](e,v,y,!0)){E=!0;break}if(e.parentType=k,E)return null}const O=e.bMarks[v]+e.tShift[v],$=e.eMarks[v];return e.src.slice(O,$+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const v=c.charCodeAt(s);if(v===91)return!1;if(v===93){u=s;break}else if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(v===92&&(s++,s<i&&c.charCodeAt(s)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const v=c.charCodeAt(s);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!tf(v))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const p=e.md.normalizeLink(d.str);if(!e.md.validateLink(p))return!1;s=d.pos;const h=s,f=r,m=s;for(;s<i;s++){const v=c.charCodeAt(s);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!tf(v))break}let b=e.md.helpers.parseLinkTitle(c,s,i);for(;b.can_continue;){const v=a(r);if(v===null)break;c+=v,s=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,s,i,b)}let _;for(s<i&&m!==s&&b.ok?(_=b.str,s=b.pos):(_="",s=h,r=f);s<i&&tf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&_)for(_="",s=h,r=f;s<i&&tf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const g=vh(c.slice(1,u));return g?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:_,href:p}),e.line=r),!0):!1}function ag(e){switch(e){case 9:case 32:return!0}return!1}const c9=65536;function cg(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function u9(e,t){if(e.lineFlags)return(e.lineFlags[t]&du.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function fw(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function d9(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!ag(l)||r===45&&ag(l)||!u9(e,t))return!1;for(;i<e.eMarks[s];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!ag(y))return!1;i++}let a=cg(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const A=c[y].trim();if(!A){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=cg(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=fw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const p=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),f=e.push("table_open","table",1),m=[t,0];f.map=m;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let y=0;y<c.length;y++){const A=e.push("th_open","th",1);u[y]&&(A.attrs=[["style",`text-align:${u[y]}`]]);const O=e.push("inline","",0);O.content=c[y].trim(),O.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let y=!1;for(let O=0,$=h.length;O<$;O++)if(h[O](e,s,n,!0)){y=!0;break}if(y||(a=cg(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=fw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>c9))break;if(s===t+2){const O=e.push("tbody_open","tbody",1);O.map=g=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let O=0;O<d;O++){const $=e.push("td_open","td",1);u[O]&&($.attrs=[["style",`text-align:${u[O]}`]]);const k=e.push("inline","",0);k.content=c[O]?c[O].trim():"",k.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=p,e.line=s,!0}var f9=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Za(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const nf=[["table",d9,["paragraph","reference"]],["code",GD],["fence",YD,["paragraph","reference","blockquote","list"]],["blockquote",KD,["paragraph","reference","blockquote","list"]],["hr",ZD,["paragraph","reference","blockquote","list"]],["list",r9,["paragraph","reference","blockquote"]],["reference",a9],["html_block",JD,["paragraph","reference","blockquote"]],["heading",XD,["paragraph","reference","blockquote"]],["lheading",n9],["paragraph",l9]];var p9=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new f9;for(let e=0;e<nf.length;e++)this.ruler.push(nf[e][0],nf[e][1],{alt:(nf[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let f=!1;for(let m=0;m<s;m++)if(f=o[m](e,u,n,!1),f){if(h>=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 p=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let f=!1;for(let m=0;m<s;m++){const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();f=p[m].fn(e,u,n,!1);const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Za(e.env,"block",p[m].name,_-b,f,!1),f){if(h>=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,o){if(!e||e.length===0)return;const s=new yT(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},wT=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}};wT.prototype.Token=io;const pw=[["normalize",$D],["block",M7],["inline",wD],["linkify",MD],["replacements",BD],["smartquotes",zD],["text_join",UD]],h9={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},m9={parseLinkLabel:R0,parseLinkDestination:P0,parseLinkTitle:D0};function g9(){return{...h9}}function v9(){return{...m9}}var y9=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new p9,this.inline=new _D,this.ruler=new FD;for(let e=0;e<pw.length;e++){const[t,n]=pw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:g9(),helpers:v9(),normalizeLink:gT,normalizeLinkText:vT,validateLink:mT,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new QA),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 wT(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Za(e.env,"core",t[n].name,s-o,!0,!1)}kD(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&T7(e))return this.parse(tT(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const k9=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function kp(e){return!k9.test(e)}function tu(e,t){const n=e.indexOf(`
|
|
63
|
-
`,t);return n===-1?e.length:n}function Tf(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function hw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function ug(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function b9(e){if(e.length>3)return kp(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}const _9=["","h1","h2","h3","h4","h5","h6"],w9=["","#","##","###","####","#####","######"],mw=0,dg=1,fg=2;function Ts(e,t,n,o){const s=new io(e,t,n);return s.level=o,s.block=!0,s}function ST(e,t,n){const o=Ts("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new io("text","",0);return s.content=e,o.children=[s],o}function S9(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!kp(u))return!1;const d=_9[i],p=w9[i],h=Ts("heading_open",d,1,0);h.map=[s,s+1],h.markup=p,e.push(h),e.push(ST(u,s,1));const f=Ts("heading_close",d,-1,0);return f.markup=p,e.push(f),!0}function C9(e,t,n){const o=Ts("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(ST(t,n,1)),e.push(Ts("paragraph_close","p",-1,0))}function x9(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function pg(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function A9(e,t){const n=Ts("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function T9(e,t,n){const o=Ts("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Ts("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Ts("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new io("text","",0);r.content=t,i.children=[r],e.push(i);const l=Ts("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Ts("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function M9(e){const t=Ts("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function E9(e,t,n,o){if(!hw(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=tu(e,l);if(hw(e,l,c)&&Tf(e,l+3,c)){const u=Ts("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function I9(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?mw:fg,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=tu(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!Tf(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!S9(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=pg(e,h),l+=1+r-h;continue}if(c===45){if(!ug(e,r,a))return null;const h=l;let f=r,m=l,b=null,_=null;for(;f<e.length;){const y=tu(e,f);if(!ug(e,f,y))break;const A=f+2,O=y===A+1?e[A]:e.slice(A,y);if(!b9(O))return null;b===null&&(b=A9(t,h)),_=T9(t,O,m),f=y<e.length?y+1:y,m++}if(b===null||_===null)return null;let g=f,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=tu(e,g);if(!Tf(e,g,y)){if(ug(e,g,y))return null;break}g=y<e.length?y+1:y,v++}b.map[1]=v,_.map[1]=v,M9(t),r=g,l=v;continue}if(c===96){const h=E9(e,r,a,l);if(!h)return null;t.push(h.token),r=pg(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=x9(e,r,a);let d;if(n===fg?d=kp(u):n===dg&&u===o?d=s:(d=kp(u),n===mw?(i&&(n=u===o?dg:fg),o=u,s=d,i=!0):n===dg&&(o=u,s=d)),!d)return null;const p=a<e.length?a+1:a;if(p<e.length&&e.charCodeAt(p)!==10&&!Tf(e,p,tu(e,p)))return null;C9(t,u,l),r=pg(e,p),l+=1+r-p}return t}const $9=/[&<>"]/,gw=/[&<>"]/g,N9=/&/g,L9=/[<>"]/g,O9={"&":"&","<":"<",">":">",'"':"""};function hg(e){return O9[e]||e}function Sn(e){if(e.length===0)return"";if(e.length<32)return $9.test(e)?e.replace(gw,hg):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(N9,"&"):t?e.replace(gw,hg):e.replace(L9,hg)}const P9=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),R9=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function CT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(P9,(t,n,o)=>{if(n)return n;if(R9.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return yh(i)?zu(i):"�"}const s=A0(t);return s!==t?s:t})}const D9=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,B9=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,F9=/"/g;function Da(e,t){const n=e.indexOf(`
|
|
64
|
-
`,t);return n===-1?e.length:n}function bp(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function of(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function H9(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!bp(e,t,Da(e,t))}function vw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function W9(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function W0(e){return B9.test(e)?D9.test(e)?null:e.replace(F9,"""):e}function z9(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=W0(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
|
|
65
|
-
`}function yw(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function U9(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
66
|
-
`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
|
|
67
|
-
`}function q9(e,t,n){const o=t+2;if(n===o+1)return U9(e,o);const s=W0(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
|
|
68
|
-
`}function j9(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function V9(e,t,n,o){if(!vw(e,t,n))return null;const s=j9(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=Da(e,l);if(vw(e,l,a)&&bp(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${Sn(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${Sn(c)}</code></pre>
|
|
69
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function kw(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=Da(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!bp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=z9(e,t,u);if(m===null)return null;o?s.push(m):n+=m,t=of(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=Da(e,m);if(!yw(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const b=e.slice(t,m);let _;if(b===r)_=l;else{let v=t;for(_=`<ul>
|
|
70
|
-
`;v<m;){const y=Da(e,v),A=q9(e,v,y);if(A===null)return null;_+=A,v=y<e.length?y+1:y}_+=`</ul>
|
|
71
|
-
`,r=b,l=_}let g=of(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=Da(e,g);if(!bp(e,g,v)){if(yw(e,g,v))return null;break}g=v<e.length?v+1:v}o?s.push(_):n+=_,t=g;continue}if(d===96){const m=V9(e,t,u,i);if(!m)return null;o?s.push(m.html):n+=m.html,t=of(e,m.nextPos);continue}const p=W9(e,t,u);let h;if(p===a)h=c;else{const m=W0(p);if(m===null)return null;h=`<p>${m}</p>
|
|
72
|
-
`,a=p,c=h}const f=u<e.length?u+1:u;if(f<e.length&&e.charCodeAt(f)!==10&&H9(e,f))return null;o?s.push(h):n+=h,t=of(e,f)}return o?s.join(""):n}const K9={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function _p(e,t,n={},o){Go(n);const s={...K9,...o||{}},i=cs(t);if(s.fallbackOnGlobalState!==!1&&i)return lg(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Qa(n,i,()=>e.core.parse(t,n,e).tokens);let r=Mf(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=Q9(r,s.maxChunks)),Ef(t,r))return lg(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Qa(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return lg(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),Qa(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),p=e.core.parse(d,n,e).tokens;l!==0&&p.length&&Y9(p,l),X9(a,p),l+=u.lineCount}return a})}function Mf(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(p){p<=r||(o.push({start:r,end:p,lineCount:l}),r=p,s=0,i=0,l=0)}for(let p=0;p<e.length;){let h=e.indexOf(`
|
|
73
|
-
`,p),f=h;h===-1?(h=e.length,f=e.length):f=h+1;const m=Z9(e,p,h);if(t.fenceAware){let g=p;for(;g<h;){const y=e.charCodeAt(g);if(y===32||y===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let y=g;for(;y<h&&e[y]===v;)y++;const A=y-g;A>=3&&(u?u.marker===v&&A>=u.length&&(u=null):u={marker:v,length:A})}}const b=f-p;s+=b,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=b);const _=m;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(_)d(f);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(f)}p=f}return n&&d(e.length),o}function Ef(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!G9(e,t[s].end))return!0;return!1}function G9(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function Y9(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function X9(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Q9(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),o+=l}return n}function Z9(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const xT=4e6,AT=8e4,J9=1e4,eB=200,tB=1e4,nB=200;function TT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function oB(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function _r(e){return e.length===0?0:Gn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function sB(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function iB(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
|
|
74
|
-
`,o);s===-1&&(s=e.length);let i=o;for(;i<s;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function rB(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 sB(e,n+1,e.length-1)?!iB(e,t):!1}function lB(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??tB:e.options.fullChunkSizeChars??J9),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??nB:e.options.fullChunkSizeLines??eB);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var ad=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=_r(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=Mf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(Ef(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,_r(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!rB(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,_r(this.pending)),null;const n=Mf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,_r(this.pending)),null;const o=Ef(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:_r(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=Mf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=Ef(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:_r(this.pending)}]:n;this.commitRanges(o,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:_r(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+_r(this.pending);return lB(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(ld(e)&&rr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=cs(t);n&&(L0(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&oB(r,a),this.options.retainTokens!==!1&&TT(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&O0(t),n}catch(o){throw this.markedGlobalStateReason&&(rr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){GA(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 aB(e,t,n={},o={}){Go(n);const s=new ad(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function cB(e,t,n={},o={}){Go(n);const s=new ad(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function uB(e,t,n,o={},s={}){Go(o);const i=new ad(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function dB(e,t,n,o={},s={}){Go(o);const i=new ad(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function MT(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??xT,s=e.options.autoUnboundedThresholdLines??AT;return t>=o||n>=s}function ET(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??xT))return"yes";const o=e.options.autoUnboundedThresholdLines??AT;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function fu(e,t,n={},o={}){Go(n);const s=cs(t);if(ld(n)&&rr(n),o.fallbackOnGlobalState!==!1&&s)return GA(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:Gn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),Qa(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new ad(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){TT(i,l)}});if(s&&L0(n,s),r.feed(t),r.flushForce(n),s&&(O0(n),o.fallbackOnGlobalState===!1)){const l=qi(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Ja=(e,t,n)=>e<t?t:e>n?n:e;function IT(e){return e.experimental?{...e,...e.experimental}:e}const bw=[{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"}],_w=[{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 $T(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function fB(e,t=Math.max(0,e/40|0),n={}){const o=IT(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<bw.length;l++){const a=bw[l];if(e<=a.max){if(a.strategy!=="adaptive")return $T(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ja(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ja(Math.ceil(t/i),150,700),maxChunks:Ja(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function ww(e,t=Math.max(0,e/40|0),n={}){const o=IT(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<_w.length;l++){const a=_w[l];if(e<=a.max){if(a.strategy!=="adaptive")return $T(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ja(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ja(Math.ceil(t/i),150,700),maxChunks:Ja(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var pB={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"]}}},hB={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},mB={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function wh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function If(e,t){if(wh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const Sw=e=>wh(e)?e:Promise.resolve(e);function pu(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 Sn(e)}}function Xr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${pu(t[0])}="${Sn(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${pu(s[0])}="${Sn(s[1])}"`}return n}function NT(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function hu(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
|
|
75
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Sn(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
|
|
76
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Xr(r)}>${t}</code></pre>
|
|
77
|
-
`}return`<pre><code${Xr(e.attrs)}>${t}</code></pre>
|
|
78
|
-
`}function wp(e){return!e.attrs||e.attrs.length===0?`<code>${Sn(e.content)}</code>`:`<code${Xr(e.attrs)}>${Sn(e.content)}</code>`}function t1(e){const t=Sn(e.content);return e.attrs?`<pre${Xr(e.attrs)}><code>${t}</code></pre>
|
|
79
|
-
`:`<pre><code>${t}</code></pre>
|
|
80
|
-
`}function gB(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="${Sn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Sn(n[0][1])}">`}return null}function Cw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${pu(t[0][0])}="${Sn(t[0][1])}">`:t.length===2?`<a ${pu(t[0][0])}="${Sn(t[0][1])}" ${pu(t[1][0])}="${Sn(t[1][1])}">`:`<a${Xr(t)}>`}function vB(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 xw(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 Sp(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+Xr(n);return o===0&&t&&(i+=" /"),`${i}>`}const yB={langPrefix:"language-",xhtmlOut:!1,breaks:!1},sf=Object.prototype.hasOwnProperty,wn={code_inline(e,t){return wp(e[t])},code_block(e,t){return t1(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?CT(i.info).trim():"",{langName:l,langAttrs:a}=NT(r),c=n.highlight,u=Sn(i.content);if(!c)return hu(i,u,r,l,n);const d=c(i.content,l,a);return wh(d)?d.then(p=>hu(i,p||u,r,l,n)):hu(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],Sp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
81
|
-
`:`<br>
|
|
82
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
83
|
-
`:`<br>
|
|
84
|
-
`:`
|
|
85
|
-
`},text(e,t){return Sn(e[t].content)},text_special(e,t){return Sn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Aw(e,t,n){const o=e.info?CT(e.info).trim():"",{langName:s,langAttrs:i}=NT(o),r=t.highlight,l=Sn(e.content);if(!r)return hu(e,l,o,s,t);const a=r(e.content,s,i);if(wh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return hu(e,a||l,o,s,t)}function rf(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===wn.text)return l.content.length===0?"":Sn(l.content);break;case"text_special":if(s.text_special===wn.text_special)return l.content.length===0?"":Sn(l.content);break;case"softbreak":if(s.softbreak===wn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===wn.hardbreak)return i;break;case"html_inline":if(s.html_inline===wn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===wn.code_inline)return wp(l);break}const a=s[l.type];if(!a)return Sp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:If(c,l.type)}var kB=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...wn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,p,h="",f="",m=!1,b="";for(let _=0;_<e.length;_++){const g=e[_],v=g.type,y=_>0&&e[_-1].hidden?`
|
|
86
|
-
`:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&_+3<e.length){const $=e[_+1],k=e[_+2],E=e[_+3];if($.type==="paragraph_open"&&$.hidden&&k.type==="inline"&&E.type==="paragraph_close"&&E.hidden){b+=`${y}<li>${this.renderInlineTokens(k.children||[],o,s)}`,_+=3;continue}}if(_+2<e.length){const $=e[_+1],k=e[_+2];if($.type==="inline"&&k.nesting===-1&&k.tag===g.tag&&!k.hidden){const E=gB(g,y);if(E!==null){b+=`${E+this.renderInlineTokens($.children||[],o,s)}</${g.tag}>
|
|
87
|
-
`,_+=2;continue}}}if(v==="inline"){const $=g.children||[];if($.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,p=i.code_inline,h=o.xhtmlOut?`<br />
|
|
88
|
-
`:`<br>
|
|
89
|
-
`,f=o.breaks?h:`
|
|
90
|
-
`,m=!0);const k=$[0];switch(k.type){case"text":if(l===wn.text){b+=Sn(k.content);continue}break;case"text_special":if(a===wn.text_special){b+=Sn(k.content);continue}break;case"softbreak":if(c===wn.softbreak){b+=f;continue}break;case"hardbreak":if(u===wn.hardbreak){b+=h;continue}break;case"html_inline":if(d===wn.html_inline){b+=k.content;continue}break;case"code_inline":if(p===wn.code_inline){b+=wp(k);continue}break}}b+=this.renderInlineTokens($,o,s);continue}const A=i[v];if(!A){const $=g.attrs;if(!g.hidden){if(!$||$.length===0)switch(v){case"hr":b+=r?`<hr />
|
|
91
|
-
`:`<hr>
|
|
92
|
-
`;continue;case"heading_open":b+=`<${g.tag}>`;continue;case"heading_close":b+=`</${g.tag}>
|
|
93
|
-
`;continue;case"paragraph_open":b+=`${y}<p>`;continue;case"paragraph_close":b+=`</p>
|
|
94
|
-
`;continue;case"list_item_open":{const k=e[_+1];b+=y+(k&&(k.type==="inline"||k.hidden||k.nesting===-1&&k.tag==="li")?"<li>":`<li>
|
|
95
|
-
`);continue}case"list_item_close":b+=`</li>
|
|
96
|
-
`;continue;case"bullet_list_open":b+=`${y}<ul>
|
|
97
|
-
`;continue;case"bullet_list_close":b+=`</ul>
|
|
98
|
-
`;continue;case"blockquote_open":b+=y+(e[_+1]&&e[_+1].nesting===-1&&e[_+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
99
|
-
`);continue;case"blockquote_close":b+=`</blockquote>
|
|
100
|
-
`;continue;case"ordered_list_open":b+=`${y}<ol>
|
|
101
|
-
`;continue;case"ordered_list_close":b+=`</ol>
|
|
102
|
-
`;continue;case"table_open":b+=`${y}<table>
|
|
103
|
-
`;continue;case"table_close":b+=`</table>
|
|
104
|
-
`;continue;case"thead_open":b+=`${y}<thead>
|
|
105
|
-
`;continue;case"thead_close":b+=`</thead>
|
|
106
|
-
`;continue;case"tbody_open":b+=`${y}<tbody>
|
|
107
|
-
`;continue;case"tbody_close":b+=`</tbody>
|
|
108
|
-
`;continue;case"tr_open":b+=`${y}<tr>
|
|
109
|
-
`;continue;case"tr_close":b+=`</tr>
|
|
110
|
-
`;continue;case"td_open":b+=`${y}<td>`;continue;case"td_close":b+=`</td>
|
|
111
|
-
`;continue;case"th_open":b+=`${y}<th>`;continue;case"th_close":b+=`</th>
|
|
112
|
-
`;continue}else if($.length===1){const k=$[0];if(v==="ordered_list_open"&&k[0]==="start"){b+=`${y}<ol start="${Sn(k[1])}">
|
|
113
|
-
`;continue}if(v==="td_open"&&k[0]==="style"){b+=`${y}<td style="${Sn(k[1])}">`;continue}if(v==="th_open"&&k[0]==="style"){b+=`${y}<th style="${Sn(k[1])}">`;continue}}}b+=this.renderToken(e,_,o);continue}if(v==="code_block"&&A===wn.code_block){b+=t1(g);continue}if(v==="fence"&&A===wn.fence){b+=Aw(g,o);continue}if(v==="html_block"&&A===wn.html_block){b+=g.content;continue}const O=A(e,_,o,s,this);typeof O=="string"?b+=O:b+=If(O,g.type)}return b}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],o,s);continue}const c=i[a.type];c?r+=await Sw(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return Xr(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const p=e[t+1];(p.type==="inline"||p.hidden||p.nesting===-1&&p.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
114
|
-
`:"",u=a?`>
|
|
115
|
-
`:">";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+Xr(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const o=()=>(n||(n={...t}),n);if(sf.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),sf.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(sf.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(sf.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...yB,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===wn.code_block)return t1(t);if(i==="html_block"&&s.html_block===wn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):Sp(t,r.xhtmlOut===!0);if(i==="fence"&&a===wn.fence)return Aw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:If(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,p=o.em_open,h=o.em_close,f=o.strong_open,m=o.strong_close,b=t.xhtmlOut===!0,_=b?`<br />
|
|
116
|
-
`:`<br>
|
|
117
|
-
`,g=t.breaks?_:`
|
|
118
|
-
`;if(e.length===1)return rf(e,t,n,this,o,_,g);let v="";for(let y=0;y<e.length;y++){const A=e[y];if(A.type==="link_open"&&!u&&!d&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="link_close"&&vB(k)){const E=`${Cw(A)+rf([k],t,n,this,o,_,g)}</a>`;if(r===wn.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=E+g,y+=3;continue}v+=E,y+=2;continue}}if(A.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${Cw(A)}</a>`,y+=1;continue}if(A.type==="em_open"&&!p&&!h&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="em_close"&&xw(k)){v+=`<em>${rf([k],t,n,this,o,_,g)}</em>`,y+=2;continue}}if(A.type==="strong_open"&&!f&&!m&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="strong_close"&&xw(k)){v+=`<strong>${rf([k],t,n,this,o,_,g)}</strong>`,y+=2;continue}}switch(A.type){case"text":if(s===wn.text){const k=A.content.length===0?"":Sn(A.content);if(a===wn.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=k+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=k;continue}break;case"text_special":if(i===wn.text_special){A.content.length!==0&&(v+=Sn(A.content));continue}break;case"softbreak":if(r===wn.softbreak){v+=g;continue}break;case"hardbreak":if(l===wn.hardbreak){v+=_;continue}break;case"html_inline":if(a===wn.html_inline){for(v+=A.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===wn.code_inline){v+=wp(A);continue}break}const O=o[A.type];if(!O){v+=A.block?this.renderToken(e,y,t):Sp(A,b);continue}const $=O(e,y,t,n,this);typeof $=="string"?v+=$:v+=If($,A.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await Sw(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
|
|
119
|
-
`;break}}return o}},bB=kB;const _B=[],mg=4096;function wB(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
|
|
120
|
-
`,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function SB(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function CB(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!LT(e[n],t[n]))return!1;return!0}function LT(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!SB(e.attrs,t.attrs)||!CB(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function Tw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var xB=class{core;cache=null;stats=Tw();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=Tw(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(Go(o??s?.env),!s||o&&o!==s.env){const I=o??{},P=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,W=!!n.options?.streamChunkedFallback,z=!P&&D,q=W||z,Q=n.options?.streamChunkAdaptive!==!1,X=n.options?.streamChunkTargetChunks??8,fe=n.options?.streamChunkSizeChars,ye=n.options?.streamChunkSizeLines,Me=n.options?.streamChunkMaxChunks,we=!!n.__explicitStreamChunkConfig,ze=n.options?.autoTuneChunks!==!1,Ue=n.options?.streamChunkFenceAware??!0,Fe=n.options?.streamLargeCachePolicy??"retain",rt=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,le=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let U,G=!1;if(Fe==="skip"&&(G=e.length>=rt,!G&&le!==void 0&&(U=Gn(e),G=U>=le)),G){const H=this.parseFullDocument(e,I,n,U,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",oo(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!qi(I)?.unbounded}),H.tokens}else if(q){const H=(re,ge,Ae)=>re<ge?ge:re>Ae?Ae:re;U===void 0&&(U=Gn(e));const J=ze&&!we?ww(e.length,U,n.options):null,ce=J?.maxChunkChars??(Q?H(Math.ceil(e.length/X),8e3,64e3):fe??1e4),te=J?.maxChunkLines??(Q?H(Math.ceil(U/X),150,700):ye??200),ue=J?.maxChunks??(Q?H(Math.ceil(e.length/64e3),X,32):Me),j=e.length>0&&e.charCodeAt(e.length-1)===10,Y=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&J?.strategy!=="plain";if((W||Y)&&(e.length>=ce*2||U>=te*2)&&j){const re=_p(n,e,I,{maxChunkChars:ce,maxChunkLines:te,fenceAware:J?.fenceAware??Ue,maxChunks:ue});return this.cache={src:e,tokens:re,env:I,lineCount:U,lastSegment:void 0,globalStateReason:cs(e)},this.updateCacheLineCount(this.cache,U),this.recordChunkedParseResult(I,W?"explicit-initial-large-doc":"default-initial-large-doc"),re}}const ne=this.parseFullDocument(e,I,n,U);return U=ne.lineCount,this.cache={src:e,tokens:ne.tokens,env:I,lineCount:U,lastSegment:void 0,globalStateReason:cs(e)},this.updateCacheLineCount(this.cache,U),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",oo(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!qi(I)?.unbounded}),ne.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",oo(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=cs(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):cs(e),a=r||l;if(a){const I=o??s.env;rr(I);const P=cs(e),D=this.parseFullDocument(e,I,n),W=D.tokens,z=D.lineCount;return this.cache={src:e,tokens:W,env:I,lineCount:z,lastSegment:void 0,globalStateReason:P},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",oo(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!qi(I)?.unbounded}),W}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const I=o??s.env,P=this.parseFullDocument(e,I,n),D=P.tokens,W=P.lineCount;return this.cache={src:e,tokens:D,env:I,lineCount:W,lastSegment:void 0,globalStateReason:cs(e)},this.updateCacheLineCount(this.cache,W),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",oo(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!qi(I)?.unbounded}),D}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const I=s.lineCount??Gn(s.src);let P=3;u.length>5e3?P=8:u.length>1e3?P=6:u.length>200&&(P=4),P=Math.min(P,I);let D=null;const W=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,q=n.options?.streamContextParseMinLines??2;let Q;const X=()=>(Q===void 0&&(Q=Gn(u)),Q),fe=this.canDirectlyParseAppend(s),ye=fe&&this.shouldUseUnboundedAppend(e,s,u);let Me=!1;if(!fe)switch(W){case"lines":Me=X()>=q;break;case"constructs":if(u.length>=z){Me=!0;break}if(wB(u)){Me=!0;break}Me=X()>=q;break;case"chars":default:Me=u.length>=z}if(P>0&&Me){const Ue=this.getTailLines(s.src,P)+u;try{const Fe=this.core.parse(Ue,s.env,n).tokens,rt=Fe.findIndex(le=>le.map&&typeof le.map[1]=="number"&&le.map[1]>P);if(rt!==-1){const le=Fe.slice(rt),U=I-P;U!==0&&this.shiftTokenLines(le,U),D={tokens:le}}}catch{D=null}}else D=null;if(!D){const Ue=I;if(ye)D={tokens:fu(n,u,s.env,{mode:"stream"})},Ue>0&&this.shiftTokenLines(D.tokens,Ue);else{const Fe=this.core.parse(u,s.env,n);Ue>0&&this.shiftTokenLines(Fe.tokens,Ue),D=Fe}}let we=0;if(s.tokens.length>0&&D.tokens.length>0){const Ue=s.tokens[s.tokens.length-1],Fe=D.tokens[0];try{Ue.type==="inline"&&Fe.type==="inline"&&(Fe.children&&Fe.children.length>0&&(Ue.children||(Ue.children=[]),this.appendTokens(Ue.children,Fe.children)),Ue.content=(Ue.content||"")+(Fe.content||""),we=1)}catch{we=0}}const ze=s.tokens.length;if(D.tokens.length>we){const Ue=s.tokens,Fe=D.tokens,rt=Math.min(Ue.length,Fe.length-we);let le=0;for(let U=rt;U>0;U--){let G=!0;for(let ne=0;ne<U;ne++){const H=Ue[Ue.length-U+ne],J=Fe[we+ne];if(!LT(H,J)){G=!1;break}}if(G){le=U;break}}le>0&&(we+=le),Fe.length>we&&this.appendTokens(s.tokens,Fe,we)}if(s.src=e,s.globalStateReason=null,s.lineCount=I+(Q??X()),s.tokens.length>ze){const Ue=this.getLastSegment(s.tokens,e,ze,s.tokens.length,e.length-u.length,I);Ue?s.lastSegment=Ue:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ye&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",oo(s.env,{area:"stream",path:ye?"stream-unbounded-append":"stream-append",reason:ye?"large-delta":"safe-append",unbounded:ye}),s.tokens}const d=o??s.env,p=this.tryTailSegmentReparse(e,s,d,n);if(p)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",oo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),p;const h=!!n.__explicitStreamChunkFallbackSetting,f=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,b=!h&&!u&&f,_=m||b,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,O=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,k=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let M=u&&s.lineCount!==void 0?s.lineCount+Gn(u):void 0;if(_){M===void 0&&(M=Gn(e));const I=(X,fe,ye)=>X<fe?fe:X>ye?ye:X,P=k&&!$?ww(e.length,M,n.options):null,D=P?.maxChunkChars??(g?I(Math.ceil(e.length/v),8e3,64e3):y??1e4),W=P?.maxChunkLines??(g?I(Math.ceil(M/v),150,700):A??200),z=P?.maxChunks??(g?I(Math.ceil(e.length/64e3),v,32):O),q=e.length>0&&e.charCodeAt(e.length-1)===10,Q=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&P?.strategy!=="plain";if((m||Q)&&(e.length>=D*2||M>=W*2)&&q){const X=_p(n,e,d,{maxChunkChars:D,maxChunkLines:W,fenceAware:P?.fenceAware??E,maxChunks:z});return this.cache={src:e,tokens:X,env:d,lineCount:M,lastSegment:void 0,globalStateReason:cs(e)},this.updateCacheLineCount(this.cache,M),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),X}}const L=this.parseFullDocument(e,d,n,M),S=L.tokens;return M=L.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:M,lastSegment:void 0,globalStateReason:cs(e)},this.updateCacheLineCount(this.cache,M),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",oo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!qi(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=qi(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",oo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!qi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",oo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=cs(e);ld(t)&&rr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?ET(n,e.length,o):"no";if(r==="yes"){const a=fu(n,e,t);return oo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?Gn(e):0)}}let l=o;if(r==="need-lines"&&(l=Gn(e),MT(n,e.length,l))){const a=fu(n,e,t);return oo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?Gn(e):0),{tokens:Qa(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:Gn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
121
|
-
`))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
122
|
-
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+Gn(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
|
|
123
|
-
`,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??_B}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??Gn(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-mg))+t,o=cs(n);return e.globalStateCarry=n.length>mg?n.slice(n.length-mg):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,p=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:p,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,p=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:p,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
|
|
124
|
-
`,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
|
|
125
|
-
`,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const p=t.lineCount??Gn(t.src);p>0&&this.shiftTokenLines(d,p);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),f=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||f==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=p+Gn(i);t.lineCount=m;const b=this.getDocLineCount(e,m);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const p=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!p||!h||p.tbodyOpenIndex<0||p.tbodyCloseIndex<0)return null;const f=h.tbodyOpenIndex>=0?d.slice(p.tbodyOpenIndex+1,p.tbodyCloseIndex):d.slice(p.tbodyOpenIndex,p.tbodyCloseIndex+1);if(f.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(f,m);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,_=t.lineCount??Gn(t.src);t.tokens.splice(b,0,...f),t.src=e,t.env=n,t.globalStateReason=null;const g=_+Gn(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const y=t.tokens[h.tbodyOpenIndex];y?.map&&(y.map[1]=v)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:v,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
126
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
127
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=s)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=Gn(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const Mw={default:hB,zero:mB,commonmark:pB};function AB(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function TB(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 Ew(e){return e.experimental?{...e,...e.experimental}:e}function js(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 Iw(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(js(t,s)||js(e,s))return!0}return!1}function $w(e,t,n){return js(t,n)||js(e,n)}function Nw(e,t){const n=qi(e)?.chunk;if(n?.fallback){oo(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}oo(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function MB(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:"retain",streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=Mw[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=Ew(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=Iw(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Iw(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=$w(i?.options,s,"fullChunkedFallback"),c=$w(i?.options,s,"streamChunkedFallback"),u=!1,d=null,p=null;const h=new y9;let f=null;const m=()=>(f||(f=new bB(n)),f);let b=null;const _=()=>(b||(b=new xB(h)),b);let g=null;const v=()=>(g||(g=new QA),g),y=k=>!u&&!!d&&!TB(k,d),A=(k,E)=>o==="default"&&!u&&f===null&&p!==null&&k.parse===p&&y(k)&&!k.stream.enabled&&E<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.xhtmlOut===!1&&k.options.breaks===!1&&k.options.langPrefix==="language-"&&k.options.linkify===!1&&k.options.typographer===!1&&k.options.highlight===null,O=(k,E)=>o==="default"&&!u&&y(k)&&!k.stream.enabled&&!k.options.fullChunkedFallback&&E<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.linkify===!1&&k.options.typographer===!1,$={core:h,block:h.block,inline:h.inline,get linkify(){const k=v();return Object.defineProperty(this,"linkify",{value:k,writable:!0,configurable:!0}),k},get renderer(){const k=m();return Object.defineProperty(this,"renderer",{value:k,writable:!0,configurable:!0}),k},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(k){const E=Ew(k);return this.options={...this.options,...E},(js(k,"fullChunkSizeChars")||js(k,"fullChunkSizeLines")||js(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(js(k,"streamChunkSizeChars")||js(k,"streamChunkSizeLines")||js(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),js(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),js(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),f&&f.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,b&&(b.reset(),b.resetStats())),this},configure(k){const E=typeof k=="string"?Mw[k]:k;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const M=E.components;M.core?.rules&&this.core.ruler.enableOnly(M.core.rules),M.block?.rules&&this.block.ruler.enableOnly(M.block.rules),M.inline?.rules&&this.inline.ruler.enableOnly(M.inline.rules),M.inline2?.rules&&this.inline.ruler2.enableOnly(M.inline2.rules)}return this},enable(k,E){const M=Array.isArray(k)?k:[k],L=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of L){if(!I)continue;const P=I.enable(M,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!E){const I=M.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(k,E){const M=Array.isArray(k)?k:[k],L=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of L){if(!I)continue;const P=I.disable(M,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!E){const I=M.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(k,...E){const M=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!M)throw new TypeError("MarkdownIt.use: plugin must be a function");const L=[this,...E],S=k;return u=!0,M.apply(S,L),this},render(k,E){if(A(this,k.length)){E!==void 0&&Go(E);const S=kw(k);if(S!==null)return E!==void 0&&oo(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const M=E??{},L=this.parse(k,M);return m().render(L,this.options,M)},async renderAsync(k,E){if(A(this,k.length)){E!==void 0&&Go(E);const S=kw(k);if(S!==null)return E!==void 0&&oo(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const M=E??{},L=this.parse(k,M);return m().renderAsync(L,this.options,M)},renderIterable(k,E={}){const M=this.parseIterable(k,E);return m().render(M,this.options,E)},async renderAsyncIterable(k,E={}){const M=await this.parseAsyncIterable(k,E);return m().renderAsync(M,this.options,E)},renderInline(k,E={}){const M=this.parseInline(k,E);return m().render(M,this.options,E)},validateLink:mT,normalizeLink:gT,normalizeLinkText:vT,utils:BR,helpers:{...A7},parse(k,E){if(typeof k!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&Go(E),O(this,k.length)){const I=I9(k);if(I!==null)return E!==void 0&&oo(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const M=E??{};let L;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const I=ET(this,k.length);if(I==="yes"){const P=fu(this,k,M);return oo(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),P}I==="need-lines"&&(L=Gn(k))}if(!this.stream.enabled){const I=k.length,P=this.options.autoTuneChunks!==!1,D=r,W=!a&&y(this),z=!!this.options.fullChunkedFallback,q=W&&I>=2e5;let Q;(z||q||L!==void 0)&&(Q=L??Gn(k));const X=(z||q)&&P&&!D?fB(I,Q,this.options):null;if(z||q){const fe=Q??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||fe>=(this.options.fullChunkThresholdLines??400):q){if(X&&X.strategy!=="plain"){const ye=_p(this,k,M,{maxChunkChars:X.maxChunkChars,maxChunkLines:X.maxChunkLines,fenceAware:X.fenceAware,maxChunks:X.maxChunks});return E&&Nw(E,z?"explicit-full-chunk":"default-large-string"),ye}if(z){const ye=(G,ne,H)=>G<ne?ne:G>H?H:G,Me=this.options.fullChunkAdaptive!==!1,we=this.options.fullChunkTargetChunks??8,ze=ye(Math.ceil(I/we),8e3,64e3),Ue=ye(Math.ceil(fe/we),150,700),Fe=Me?ze:this.options.fullChunkSizeChars??1e4,rt=Me?Ue:this.options.fullChunkSizeLines??200,le=Me?ye(Math.ceil(I/64e3),we,32):this.options.fullChunkMaxChunks,U=_p(this,k,M,{maxChunkChars:Fe,maxChunkLines:rt,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:le});return E&&Nw(E,"explicit-full-chunk"),U}}}if(L!==void 0&&y(this)&&MT(this,I,Q??L)){const fe=fu(this,k,M);return oo(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),fe}}const S=cs(k);return oo(E,{area:"parse",path:"plain",reason:"default-plain"}),Qa(M,S,()=>h.parse(k,M,this).tokens)},parseIterable(k,E={}){return Go(E),aB(this,k,E)},parseAsyncIterable(k,E={}){return Go(E),cB(this,k,E)},parseIterableToSink(k,E,M={}){return Go(M),uB(this,k,E,M)},parseAsyncIterableToSink(k,E,M={}){return Go(M),dB(this,k,E,M)},parseInline(k,E={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Go(E),ld(E)&&rr(E);const M=h.createState(k,E,this);return M.inlineMode=!0,h.process(M),M.tokens}};if($.stream={enabled:!!n.stream,parse(k,E){return $.stream.enabled?_().parse(k,E,$):$.parse(k,E??{})},reset(){_().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const k=i.components;k.core?.rules&&$.core.ruler.enableOnly(k.core.rules),k.block?.rules&&$.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&$.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&$.inline.ruler2.enableOnly(k.inline2.rules)}return d=AB($),p=$.parse,$}var EB=MB;const OT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],IB=["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"],PT=["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"],$B=["svg","g","path"],NB=["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"],LB=["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"],OB=["action","data","href","src","srcset","poster","xlink:href","formaction"],PB=["script"],RB=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Jl=new Set(OT),DB=new Set(PT),qu=new Set([...OT,...IB,...PT,...$B]),RT=new Set([...qu,...NB]),BB=new Set(LB),FB=new Set(OB),cd=new Set(PB),DT=new Set(RB);function BT(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const HB={amp:"&",bsol:"\\",colon:":",newline:`
|
|
128
|
-
`,sol:"/",tab:" "};function FT(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return HB[String(s??"").toLowerCase()]??t})}const lf=new Set(["http","https","mailto","tel"]),WB=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Cl=new Set(["http","https"]);function HT(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function zB(e,t,n){if(!mu(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function mu(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function UB(e,t){return t==="href"||t==="xlink:href"?mu(e,t)?lf:Cl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Cl:(mu(e,t),lf)}function zl(e,t={}){const n=BT(FT(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=HT(n);return i?i==="file"?!zB(n,o,s):mu(o,s)?WB.has(i):!UB(o,s).has(i):!1}function qB(e){const t=FT(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=HT(BT(t).toLowerCase());return n==="http"||n==="https"}function jB(e,t={}){const n=String(e??"").trim();return n?zl(n,t)?"":n:""}function Lw(e){return jB(e,{tagName:"img",attrName:"src"})}function VB(e,t,n){function o(p){return p.trim().split(" ",2)[0]===t}function s(p,h,f,m,b){return p[h].nesting===1&&p[h].attrJoin("class",t),b.renderToken(p,h,f,m,b)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(p,h,f,m){let b,_=!1,g=p.bMarks[h]+p.tShift[h],v=p.eMarks[h];if(l!==p.src.charCodeAt(g))return!1;for(b=g+1;b<=v&&r[(b-g)%a]===p.src[b];b++);const y=Math.floor((b-g)/a);if(y<i)return!1;b-=(b-g)%a;const A=p.src.slice(g,b),O=p.src.slice(b,v);if(!c(O,A))return!1;if(m)return!0;let $=h;for(;$++,!($>=f||(g=p.bMarks[$]+p.tShift[$],v=p.eMarks[$],g<v&&p.sCount[$]<p.blkIndent));)if(l===p.src.charCodeAt(g)&&!(p.sCount[$]-p.blkIndent>=4)){for(b=g+1;b<=v&&r[(b-g)%a]===p.src[b];b++);if(!(Math.floor((b-g)/a)<y)&&(b-=(b-g)%a,b=p.skipSpaces(b),!(b<v))){_=!0;break}}const k=p.parentType,E=p.lineMax;p.parentType="container",p.lineMax=$;const M=p.push("container_"+t+"_open","div",1);M.markup=A,M.block=!0,M.info=O,M.map=[h,$],p.md.block.tokenize(p,h+1,$);const L=p.push("container_"+t+"_close","div",-1);return L.markup=p.src.slice(g,b),L.block=!0,p.parentType=k,p.lineMax=E,p.line=$+(_?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 KB(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let b=0;b<a.length;b++){const _=a[b];if(_==="\\"){b++;continue}if(!u&&_==="'"){c=!c;continue}if(!c&&_==='"'){u=!u;continue}if(!c&&!u&&_===":"){d=b;break}}if(d===-1)return null;const p=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!p)return null;let f=p;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 m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;l[f]=m}return l}function GB(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(VB,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
129
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let p,h;const f=d.indexOf("{"),m=f>=0?d.slice(f).trimStart():void 0;if(f===-1)p=d||void 0;else{if(p=d.slice(0,f).trim()||void 0,m?.startsWith("{")){let A=0,O=-1;for(let $=0;$<m.length;$++)if(m[$]==="{"?A++:m[$]==="}"&&A--,A===0){O=$+1;break}O>0&&(h=m.slice(0,O))}h||(p=d||void 0)}if(s)return!0;const b=!!i.env.__markstreamFinal;let _=n+1,g=!1;for(;_<=o;){const A=i.bMarks[_]+i.tShift[_],O=i.eMarks[_];if(i.src.slice(A,O).trim()===":::"){g=!0;break}_++}g||(_=o);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!g&&!b},p&&v.attrSet("data-args",p),h)try{const A=JSON.parse(h);for(const[O,$]of Object.entries(A)){const k=$!=null&&typeof $=="object";v.attrSet(`data-${O}`,k?JSON.stringify($):String($))}}catch{const A=KB(h);if(A)for(const[O,$]of Object.entries(A)){const k=$!=null&&typeof $=="object";v.attrSet(`data-${O}`,k?JSON.stringify($):String($))}else v.attrSet("data-attrs",h)}const y=[];for(let A=n+1;A<_;A++){const O=i.bMarks[A]+i.tShift[A],$=i.eMarks[A];y.push(i.src.slice(O,$))}if(y.some(A=>A.trim().length>0)){let A=y.join(`
|
|
130
|
-
`);A.endsWith(`
|
|
131
|
-
`)||(A+=`
|
|
132
|
-
`),A.endsWith(`
|
|
133
|
-
|
|
134
|
-
`)||(A+=`
|
|
135
|
-
`);const O=i.tokens[i.tokens.length-1];O&&(O.raw=A);const $=[];i.md.block.parse(A,i.md,i.env,$),i.tokens.push(...$)}return g&&i.push("vmr_container_close","div",-1),i.line=g?_+1:_,!0},{alt:["paragraph","reference","blockquote","list"]})}function Es(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qn(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function Sh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const YB=/^[a-z][a-z0-9_-]*$/;function Ow(e){return YB.test(String(e??"").trim().toLowerCase())}function oi(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Ow(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":Ow(s)?s:""}function kc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=oi(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function XB(...e){const t=new Set,n=[];for(const o of e)for(const s of kc(o))t.has(s)||(t.add(s),n.push(s));return n}function QB(e){const t=kc(e);return{key:t.join(","),tags:t}}function WT(e){return oi(e)}function ZB(e,t){const n=String(e??""),o=oi(t);if(!o)return!1;const s=Es(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function zT(e,t){const n=oi(t);return!!n&&!qu.has(n)&&!ZB(e,n)}function JB(e,t){const n=String(e??""),o=oi(t);if(!o)return n;const s=Es(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const UT=Jl,eF=qu,qT=new Set(DB);qT.delete("details");const tF=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,nF=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,n1=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,oF=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Cp(e){return(e.match(n1)?.[1]??"").toLowerCase()}function z0(e){return/^\s*<\s*\//.test(e)}function U0(e,t){return UT.has(t)||/\/\s*>\s*$/.test(e)}function sF(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=Cp(i);if(r===t){if(z0(i)){if(n===0)return o;n--;continue}U0(i,r)||n++}}return-1}function iF(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=Cp(s);if(i===t){if(z0(s)){n>0&&n--;continue}U0(s,i)||n++}}return n}function Pw(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Es(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function rF(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Es(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function xp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function lF(e){const t=e;return t.meta||(t.meta={}),t.meta}function gg(e,t,n){const o=lF(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function aF(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Es(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(f=>f.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const f of o)f.raw+=h,f.inner+=h},l=()=>{!o.length||!s||(r(`
|
|
136
|
-
`),s=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<o.length;m++)o[m].raw+=h,m<o.length-1&&(o[m].inner+=h);const f=o.pop();gg(f.token,f.raw,f.inner)},u=h=>{const f=o[o.length-1]?.tag;if(!f)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Es(f)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),p=(h,f,m)=>{const b=m??(h.type==="html_inline"?Cp(f):"");if(!(b&&t.has(b))){r(f);return}const _=z0(f),g=!_&&U0(f,b);if(_){if(!o.length||o[o.length-1].tag!==b){r(f);return}c(f);return}if(r(f),g){gg(h,f,"");return}o.push({tag:b,token:h,raw:f,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const f=String(h.content??"");if(d(f)?s=!1:l(),!o.length&&!i(f)){s=!1;continue}let m=0,b=!0;for(const _ of h.children){const g=xp(_),v=_.type==="html_inline"?Cp(g):"",y=v&&t.has(v);let A=g;if(b&&f&&g&&(o.length||y)){const O=f.indexOf(g,m);if(O!==-1)a(f.slice(m,O)),A=f.slice(O,O+g.length),m=O+g.length;else{if(o.length&&!y)continue;b=!1}}p(_,A,v)}b&&f&&m<f.length&&o.length&&a(f.slice(m)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const f=xp(h),m=h.type==="html_block"?u(f):null;if(m){c(`${s?`
|
|
137
|
-
`:""}${m}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)gg(h.token,h.raw,h.inner)}function cF(e){return/^\s*<\s*[!?]/.test(e)}function uF(e){const t=new Set(eF);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function Rw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function dF(e,t){let n=null;for(const i of e.matchAll(tF)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Rw(l,t)&&qn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(nF)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Rw(l,t)&&qn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function fF(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function pF(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(fF(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 p=a.slice(d),h=p.match(n1);if(!h){i("<",c),u=d+1;continue}const f=qn(p);if(f===-1){i("<",c),u=d+1;continue}const m=p.slice(0,f+1),b=(h[1]??"").toLowerCase();t.has(b)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=dF(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=xp(a),s=o.buffer;const c=qn(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=xp(a),u=(c.match(n1)?.[1]??"").toLowerCase();if(u&&t.has(u)&&qn(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:s??void 0}}const hF=["a","span","strong","em","b","i","u"];function mF(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const p of t.customHtmlTags){const h=oi(p);h&&n.add(h)}const o=p=>{const h=p,f=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const v of m){const y=oi(String(v??""));y&&f.add(y)}const b=uF(Array.from(f)),_=new Set(hF);for(const v of f)_.add(v);return{autoCloseInlineTagSet:_,commonHtmlTags:b,customTagSet:f,shouldMergeHtmlBlockTag:v=>f.has(v)||!b.has(v)||qT.has(v)}},s=p=>{if(p.type==="html_block")return String(p.content??"");if(p.type!=="inline"||!Array.isArray(p.children)||p.children.length!==1)return"";const h=p.children[0];return h?.type!=="html_block"?"":String(p.content??h.content??"")},i=(p,h)=>{p.type="html_block",p.content=h,p.raw=h,p.children=[]},r=p=>p.replace(/^(?:\r?\n)+/,""),l=p=>/^(?: {4}|\t)/.test(p),a=p=>p.replace(/^(?: {4}|\t)/gm,""),c=(p,h)=>{const f=r(p);if(!/\S/.test(f))return[];if(l(f))return[{type:"code_block",content:a(f),raw:f}];const m=f.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const b={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[b]},u=(p,h,f)=>p[h-1]?.type==="paragraph_open"&&p[h+1]?.type==="paragraph_close"?"inline":f,d=(p,h)=>{const f=r(h);return!/\S/.test(f)||p.type!=="inline"||!Array.isArray(p.children)?!1:(p.content=`${String(p.content??"")}${f}`,p.children.push({type:"text",content:f,raw:f}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",p=>{const h=p.tokens??[],{commonHtmlTags:f,customTagSet:m}=o(p);for(const b of h){const _=b;if(_.type!=="inline"||!Array.isArray(_.children))continue;const g=String(_.content??""),v=_.children.length?_.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=pF(v,f);if(_.children=y.children,y.pendingBuffer){const A=g.lastIndexOf(y.pendingBuffer);if(A!==-1){const O=g.slice(0,A);_.content=O,typeof _.raw=="string"&&(_.raw=O)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}aF(h,m)}),e.core.ruler.push("fix_html_inline_tokens",p=>{const h=p.tokens??[],{autoCloseInlineTagSet:f,customTagSet:m,shouldMergeHtmlBlockTag:b}=o(p),_=[];for(let g=0;g<h.length;g++){const v=h[g];if(_.length>0){const[A,O]=_[_.length-1];if(g!==O){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const $=String(v.content??v.raw??"");if($){const k=h[O],E=`${String(k.content||"")}
|
|
138
|
-
${$}`,M=qn(E),L=M===-1?null:Pw(E,A,M+1);if(L){const S=E.slice(0,L.end),I=E.slice(L.end);k.content=S,k.loading=!1,h.splice(g,1),_.pop();const P=d(k,I)?[]:c(I,u(h,g,"paragraph"));P.length&&h.splice(g,0,...P),g--;continue}k.content=E,k.loading!==!1&&(k.loading=!0)}h.splice(g,1),g--;continue}}const y=s(v);if(y){if(cF(y))continue;const A=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),O=/^\s*<\s*\//.test(y);if(!A||!b(A))continue;if(i(v,y),!O)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(y)&&rF(y,A)>0&&_.push([A,g]);else if(_.length>0&&A&&_[_.length-1][0]===A){const[,$]=_[_.length-1],k=h[$];k.content=`${String(k.content||"")}
|
|
139
|
-
${y}`,k.loading=!1,_.pop(),h.splice(g,1),g--}continue}else if(_.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const A=v.content||"",O=new RegExp(`<\\s*\\/\\s*${_[_.length-1][0]}\\s*>`,"i").test(A);if(A){const[,$]=_[_.length-1],k=h[$];k.content=`${k.content||""}
|
|
140
|
-
${A}`,k.loading!==!1&&(k.loading=!O)}O&&_.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=$=>{let k=g.get($);return k||(k=new RegExp(`<\\s*${$}\\b`,"i"),g.set($,k)),k},A=$=>{let k=v.get($);return k||(k=new RegExp(`<\\s*\\/\\s*${$}\\s*>`,"i"),v.set($,k)),k},O=[];for(let $=0;$<h.length;$++){const k=h[$],E=String(k.content??"");if(O.length>0){const L=O[O.length-1],S=h[L.index],I=k.type==="html_block"?A(L.tag).exec(E):null;if(I){const W=I.index+I[0].length,z=E.slice(0,W),q=E.slice(W);S.content=`${String(S.content??"")}
|
|
141
|
-
${z}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${L.tag}>`,raw:`</${L.tag}>`}),O.pop();const Q=d(S,q)?[]:c(q,u(h,$,"paragraph"));Q.length?h.splice($,1,...Q):(h.splice($,1),$--);continue}if(k.type!=="inline")continue;const P=Array.isArray(k.children)?k.children:[],D=sF(P,L.tag);if(D!==-1){const W=P.slice(0,D+1),z=P.slice(D+1),q=W.map(Q=>String(Q?.content??Q?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
142
|
-
${q}`,Array.isArray(S.children)&&S.children.push(...W),z.length){const Q=z.map(X=>String(X.content??X.raw??"")).join("");if(Q.trim()){const X=Q.replace(/^\s+/,"");if(d(S,Q))h.splice($,1),$--;else if(X.startsWith("<"))h.splice($,1,{type:"html_block",content:X});else{const fe=c(Q,u(h,$,"paragraph"));h.splice($,1,...fe)}}else h.splice($,1),$--}else h.splice($,1),$--;O.pop();continue}S.content=`${String(S.content??"")}
|
|
143
|
-
${E}`,Array.isArray(S.children)&&S.children.push(...P),h.splice($,1),$--;continue}if(k.type!=="inline")continue;const M=Array.isArray(k.children)?k.children:[];for(const L of m)if((M.length?iF(M,L):y(L).test(E)&&!A(L).test(E)?1:0)>0){O.push({tag:L,index:$});break}}}{let g=0;for(let v=0;v<h.length;v++){const y=h[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const k=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(k.startsWith("!")||k.startsWith("?")){v.loading=!1;continue}if(m.has(k)){const D=String(v.content??""),W=qn(D),z=W===-1?null:Pw(D,k,W+1);v.loading=z?!1:v.loading!==void 0?v.loading:!0;const q=z?.start??-1,Q=z?z.end-z.start:0;if(q!==-1){const X=D.slice(0,q+Q);let fe="";W!==-1&&W<q&&(fe=D.slice(W+1,q)),v.children=[{type:k,content:fe,raw:X,attrs:[],tag:k,loading:!1}],v.content=X,v.raw=X;const ye=c(D.slice(q+Q)||"","text");ye.length&&h.splice(g+1,0,...ye)}else v.children=[{type:k,content:"",raw:D,attrs:[],tag:k,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(k))continue;v.type="inline";const E=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let M;for(;(M=E.exec(v.content||""))!==null;)M[1],M[2]||M[3]||M[4];const L=String(v.content??""),S=new RegExp(`<\\/\\s*${k}\\s*>`,"i").exec(L),I=S?S.index:-1,P=S?S[0].length:0;if(I!==-1){const D=L.slice(0,I+P),W=(L.slice(I+P)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:D,tag:k,loading:!1}],v.content=D,v.raw=D,W&&h.splice(g+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:k,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const k=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=v.children[1],M=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&M===k)continue;f.has(k)?(v.children[0].loading=!0,v.children[0].tag=k,v.children.push({type:"html_inline",tag:k,loading:!0,content:`</${k}>`})):v.children=[{type:"html_block",loading:!0,tag:k,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 k=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(f.has(k))continue;v.children=[{type:"html_block",loading:!1,tag:k,content:v.children.map(E=>E.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),A=v,O=A.children[0];if(O?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(A.children.length=0);continue}const $=String(O.content??y).match(oF)?.[1]?.toLowerCase()??"";if($){if(/\/\s*>\s*$/.test(y)||UT.has($)){A.children=[{type:"html_inline",content:y}];continue}A.children.length=0}}})}function gF(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 vF(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!gF(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const jT=/\.([a-z0-9]{1,15})$/i,yF=/[_()[\]{}<>]/u,kF=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,bF=/[?#@]/u,_F=/[\\/]/u,wF=/^[\p{L}\p{N}./\\-]+$/u,SF=/^[A-Za-z0-9-]{1,63}$/u,CF=/^xn--[a-z0-9-]{2,59}$/i,xF=/^(?:[A-Z]{1,6}|\d{1,8})$/u,AF=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,TF=/文件名\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,MF=/文件名\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,EF=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,IF=new Set(["ai","md","py","rs","sh","zip"]),VT=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),$F=new Set([...VT,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),NF=new Set(["com","dev","io","page","site"]),LF=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),OF=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 ju(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function vg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return ju(n)?n:void 0}function Dw(e,t){if(!ju(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 Bw(e){const t=ud(e);return ju(t)?t:void 0}function PF(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Fw(e,t){if(!ju(t))return;const n=String(e??"").trim().split(/\s+/u).map(PF).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>Ap(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>Ap(s,{marketTicker:!0}))&&(o.marketTicker=!0),ju(o)?o:void 0}function il(e,t=!1){let n;return{options(o){return t||o==null?Dw(e,n):Dw(e,vg(Bw(o),Fw(o,n)))},remember(o){const s=Bw(o);n=t?vg(n,s):vg(s,Fw(o,n))},reset(){n=void 0}}}function Hw(e){return SF.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function RF(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Hw(n)||CF.test(n)?t.every(Hw):!1}function KT(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function DF(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function BF(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function GT(e,t,n){const o=DF(t);return KT(e)&&BF(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function ud(e){const t=String(e??"");return{explicitFilename:TF.test(t),filename:MF.test(t),marketTicker:EF.test(t)}}function FF(e){return RF(e.split(/[\\/]/)[0]??"")}function HF(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function WF(e){if(yF.test(e)||!wF.test(e))return!0;if(_F.test(e))return!FF(e);const t=e.replace(jT,"");return KT(t)?!0:t.split(".").filter(Boolean).some(HF)}function zF(e,t,n){if(!(n?$F:VT).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?AF:xF).test(o)}function Ap(e,t={}){if(!e||kF.test(e)||bF.test(e))return!1;const n=e.match(jT);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return zF(e,o,t.marketTicker===!0)?!0:OF.has(o)?!IF.has(o)||t.filename?!0:WF(e):!!(t.explicitFilename&&NF.has(o)||t.filename&&LF.has(o))}const Ww=["!"];function ls(e){return{type:"text",content:e,raw:e}}function xl(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 Al(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 wr(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function UF(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(ls(t))}}function zw(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function qF(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function jF(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function VF(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function KF(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=GF(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function GF(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=ud(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=VF(e,o,i),l=qF(s);if(s.markup==="linkify"&&r&&!GT(r,l,t)&&Ap(r,n)){e.splice(o,i-o+1,ls(r));continue}const a=zw(l,Ww);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=zw(u.content,Ww);if(d===-1)continue;const p=u.content[d],h=u.content.slice(0,d);let f=u.content.slice(d);for(let _=c+1;_<i;_++){const g=e[_];g?.type==="text"&&typeof g.content=="string"&&(f+=g.content)}u.content=h,u.raw=h;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(f){const _=encodeURI(f);if(_&&l.endsWith(_))b=l.slice(0,l.length-_.length);else{const g=p?encodeURI(p):"",v=g?l.indexOf(g):-1;v!==-1&&(b=l.slice(0,v))}}b!==l&&jF(s,b),f&&e.splice(i+1,0,ls(f));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(ls(r));const c=i[1],u=l[1].length;xl(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(wr(c,d,!e[o+4]?.content?.startsWith(")"))),Al(a,u),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)\**/,"");p&&a.push(ls(p)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(ls(r));let c=i[1];const u=c.match(/^\*+/);if(u){const p=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(h+=e[o+4]?.content||"",e[o+4].content=""),xl(a,p),a.push(wr(c,h,!e[o+4]?.content?.startsWith(")"))),Al(a,p),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(ls(f)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(wr(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(ls(p)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(wr(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(ls(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(f=>f[0]==="href")?.[1]||"",a=r.find(f=>f[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),p=[];if(d){u+=1;const f=d[1].length;xl(p,f)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let f=o+1;f<e.length;f++){const m=d?d[1].length:e[o-3].markup.length,b=e[f];if(m===1&&b.type==="em_close")break;if(m===2&&b.type==="strong_close")break;if(m===3&&(b.type==="em_close"||b.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(p.push(h),d){const f=d[1].length;Al(p,f)}e.splice(o-u,c,...p),o-=p.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(ls(l)),xl(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(wr(a,c,u)),Al(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(ls(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(ls(r)),xl(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(wr(l,a,c)),Al(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(ls(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(ls(r)),xl(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const p=e[o+2].attrs?.find(h=>h[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(p||c)+e[o+5].content,e[o+5].content=""):c=p||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const p=(e[o+2]?.content??"").indexOf(")");d=p===-1,p===-1&&(c+=e[o+2]?.content?.slice(0,p)||"",e[o+2].content="")}i.push(wr(a,c,d)),Al(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];xl(a,2),a.push(wr(r,l,!1)),Al(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;UF(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function YF(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=XF(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function XF(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 QF(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=ZF(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function ZF(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],p=d.type;if(p==="strong_open"){t++;const h=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const m=e[f];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const _=e[b];h==="__"&&(m?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(p==="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(p==="em_open"){s++;const h=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const m=e[f];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const _=e[b];h==="_"&&(m?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else p==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,p=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&p.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...p)}return l=JF(l),l}function JF(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const p=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),p&&t.push({...c,type:"text",content:p,raw:p}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=eH(e,n+6);if(u){t.push(o),t.push(s),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(o)}return t}function eH(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function tH(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=lH(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function Uw(){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 qw(){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 jw(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 YT(e,t){if(!e.startsWith("|")||e.includes(`
|
|
144
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function yg(e){return YT(e)!==null}function XT(e){return/^:?-+:?$/.test(e.trim())}function nH(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(XT)}function oH(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function sH(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(XT)&&oH(n)}function iH(e){return e==="|"||e==="|:"}function rH(e){const t=YT(e);return t!==null&&t.every(n=>!n.includes(":"))}function lH(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
145
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
146
|
-
`),d=!t&&!r.includes(`
|
|
147
|
-
`)&&/\r?\n$/.test(n)&&yg(r);if(!t&&(r.includes(`
|
|
148
|
-
`)&&u.length===0&&yg(a)&&sH(c)||d)){const p=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>jw(f)),h=[...Uw(),...p,...qw()];o.splice(s-1,3,...h)}else if(r.includes(`
|
|
149
|
-
`)&&u.length===0&&yg(a)&&nH(c)){const p=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>jw(f)),h=[...Uw(),...p,...qw()];o.splice(s-1,3,...h)}else r.includes(`
|
|
150
|
-
`)&&u.length===0&&rH(a)&&iH(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function aH(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=o;let l=0,a=t;for(;a<s;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var cH=aH;const uH=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Tp=uH.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),dH=/\\[a-z]+/i,QT="(?:\\\\|\\u0008)",fH=new RegExp(String.raw`${QT}(?:${Tp})\s*\{[^}]+\}`,"i"),pH=new RegExp(String.raw`(?:${QT})?(?:${Tp})\s*\{`,"i"),hH=/\\(?:text|frac|left|right|times)/,mH=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,gH=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,vH=/[A-Z]+\s*\([^)]+\)/i,yH=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,kH=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,bH=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,_H={"\b":"\\b","\v":"\\v","\f":"\\f"};function wH(e){let t="";for(const n of e)t+=_H[n]??n;return t}function Ba(e){if(!e)return!1;const t=wH(e),n=t.trim();if(bH.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=dH.test(t),s=fH.test(t),i=pH.test(t),r=hH.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=mH.test(t)&&!gH.test(t),c=vH.test(t),u=yH.test(n),d=kH.test(t),p=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||p||h}const ZT="__markstreamMathPluginApplied",o1=80,JT=2e4,Vw=JT+4096;function eM(e){return!!e[ZT]}function SH(e){e[ZT]=!0}const tM=["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"],CH=["cdot","mathbf{","partial","mu_{"],nM=tM.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),oM="[ \r\b\f\v]",xH=new RegExp(`([^\\\\])(${CH.map(e=>e).join("|")})+`,"g"),AH=/span\{([^}]+)\}/,TH=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,MH=/(^|[^\\])\\\r?\n/g,EH=/(^|[^\\])\\$/g,IH=new RegExp(`(${oM})|(${nM})\\b`,"g"),Kw=new Map,Gw=new Map;function $H(e){if(!e)return IH;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=Kw.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${oM})|(${s})\\b`,"g");return Kw.set(n,i),i}function NH(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=Gw.get(o);if(s)return s;const i=e?[Tp,nM].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Tp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Gw.set(o,r),r}const Yw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Xw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Qw(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function Sr(e,t){const n=t?.commands??tM,o=t?.escapeExclamation??!0,s=t?.commands==null,i=$H(s?void 0:n);let r=e.replace(i,(c,u,d,p,h)=>{if(u!==void 0&&Yw[u]!==void 0)return`\\${Yw[u]}`;if(d&&n.includes(d)){const f=h&&typeof p=="number"?h[p-1]:void 0;return f==="\\"||f&&/\w/.test(f)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=NH(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(AH,"span\\{$1\\}").replace(TH,"\\operatorname{span}\\{$1\\}"),l=l.replace(MH,`$1\\\\
|
|
151
|
-
`),l=l.replace(EH,"$1\\\\"),l=l.replace(xH,"$1\\$2"),l}function Zw(e){const t=e.trim();return!(!Ba(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 sM(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Mp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function LH(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function dd(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function s1(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(dd(e,o)){n=o+1;continue}return o}return-1}function kg(e,t){let n=t;for(;n<e.length;){const o=s1(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function nu(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!dd(e,s))return s;o=s+Math.max(1,t.length)}return-1}function Jw(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Mp(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}dd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function q0(e,t,n){const o=Ku(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Ku(o.slice(0,s)).trim()||dd(o,s))return-1;const i=sM(o);if(Mp(i,s))return-1;const r=Jw(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Jw(o,n,0,s,i))return-1;return s}function Vu(e){return e===" "||e===" "}function Ku(e){let t=e.length;for(;t>0&&Vu(e[t-1]);)t--;return e.slice(0,t)}function e2(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
152
|
-
`&&t++;return t}function t2(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function OH(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!Vu(s))return!1}return n>=3}function PH(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function RH(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(PH)}function DH(e){let t=0;if(!t2(e[t]))return!1;for(;t2(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Vu(e[t+1])}function iM(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Vu(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Vu(t[1])||DH(t)||OH(t)||RH(t))}function n2(e,t){return e?t?`${e}
|
|
153
|
-
${t}`:e:t}function i1(e){const t=String(e??"").trim();return t?Ba(t):!1}function o2(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function rM(e){if(e.length<=Vw)return{source:e,lineOffset:0};let t=e.length-Vw;const n=e.indexOf(`
|
|
154
|
-
`,t);return n===-1?{source:"",lineOffset:e2(e)}:(t=n+1,{source:e.slice(t),lineOffset:e2(e.slice(0,t))})}function lM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=rM(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-o1-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=Ku(o[r]);if(l&&!iM(l)){for(const[a,c]of i)if(q0(l,a,c)!==-1)return!0}}return!1}function BH(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=rM(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-o1-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=Ku(s[l]);for(const[c,u]of r){const d=q0(a,c,u);if(d===-1)continue;let p="",h=!1;for(let f=l+1;f<s.length;f++){if(f-l>o1){h=!0;break}const m=s[f],b=nu(m,u);if(b!==-1){const _=n2(p,m.slice(0,b));if(!i1(_)){h=!0;break}const g=m.slice(b+u.length),v=g.trim()?`suffix:${o2(g)}`:"nosuffix";return["closed",c,o+l,d,o+f,b,o2(_),v].join(":")}if(iM(m)){h=!0;break}if(p=n2(p,m),p.length>JT){h=!0;break}}if(!h&&i1(p))return["pending",c,o+l,d].join(":")}}return null}function bg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function FH(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function _g(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function HH(e,t){SH(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(g,v)=>{let y=v;for(;y<g.length&&(g[y]===" "||g[y]===" ");)y++;if(y===v||!(g[y]===`
|
|
155
|
-
`||g[y]==="\r"&&g[y+1]===`
|
|
156
|
-
`))return v;const A=g.slice(v,y),O=a.push("text","",0);return O.content=A,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,y=a.src[g];if(v>=3&&(!y||/\s/.test(y))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,g),a.pos=g,!0}}const p=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),f=Math.max(0,a.pos-h.length);let m=f,b=f;const _=f;for(const[g,v]of p){const y=a.src,A=sM(y),O=LH(y,u);let $=!1;g==="$$"&&m!==_&&(m=_);let k=-1,E=-1,M=0;const L=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const D=a.push("text_special","",0);D.content=S==="\\)"?")":"(",D.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let D=0;for(;D<S.length;){const W=s1(S,D);if(W===-1){const Ue=S.slice(D);if(Ue){const Fe=a.push("text","",0);Fe.content=Ue,a.pos=a.pos+Ue.length,m=a.pos}break}if(W>0&&S[W-1]==="$"||W+1<S.length&&S[W+1]==="$"){const Ue=S.slice(D,W+1);if(Ue){const Fe=a.push("text","",0);Fe.content=Ue,a.pos=a.pos+Ue.length,m=a.pos}D=W+1;continue}const z=S.slice(D,W);if(z){const Ue=a.push("text","",0);Ue.content=z,a.pos=a.pos+z.length,m=a.pos}const q=kg(S,W+1);if(q===-1){const Ue=S.slice(W),Fe=a.push("text","",0);Fe.content=Ue,a.pos=a.pos+Ue.length,m=a.pos;break}const Q=S.slice(W+1,q),X=Q.includes("`"),fe=!Q||!Q.trim(),ye=S[q+1],Me=bg(Q,ye),we=_g(Q);if(!X&&!fe&&!Me&&!we){const Ue=a.push("math_inline","math",0);Ue.content=Sr(Q,t),Ue.markup="$",Ue.raw=`$${Q}$`,Ue.loading=!1,a.pos=a.pos+(q-W+1),m=a.pos,D=q+1;continue}const ze=a.push("text","",0);ze.content="$",a.pos=a.pos+1,m=a.pos,D=W+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const z=S.slice(0,I),q=a.push("text","",0);q.content=z,a.pos=a.pos+z.length,m=a.pos}const D=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,z,q]=D,Q=q.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),X=Q?Q[1]:q,fe=Q&&Q[2]?Q[2]:null,ye=a.push("image","img",0);ye.attrs=[["src",X],["alt",z]],fe&&ye.attrs.push(["title",fe]),ye.content=z,ye.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+D[0].length,m=a.pos;const Me=S.slice(I+D[0].length);Me&&L(Me);return}const W=a.push("text","",0);W.content=S,a.pos=a.pos+S.length,m=a.pos;return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=y.length);){const S=y.indexOf(g,m);if(S===-1)break;if(dd(y,S)){m=S+Math.max(1,g.length);continue}const I=Mp(A,S);if(I){m=I[1];continue}const P=Mp(O,S);if(P){m=P[1];continue}if(S===k&&m===E){if(M++,M>2){m=S+Math.max(1,g.length);continue}}else M=0,k=S,E=m;if(g==="("&&S>0){let Me=S-1;for(;Me>=0&&y[Me]===" ";)Me--;if(Me>=0&&y[Me]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&y[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<y.length-1&&y[S+1]==="$"){m=S+2;continue}const D=g==="$"?kg(y,S+g.length):cH(y,S+g.length,g,v);if(D===-1){const Me=y.slice(S+g.length);if(Me.includes(g)){m=y.indexOf(g,S+g.length);continue}if(D===-1){const we=g==="$"&&FH(Me);if(u&&!c&&!we&&Ba(Me)&&!Me.includes("`")){if(m=S+g.length,$=!0,!l){a.pending="";const ze=b?y.slice(b,m):y.slice(0,m),Ue=Xw(ze)%2===1;if(b)L(y.slice(b,m));else{let Fe=y.slice(0,m);Fe.endsWith(g)&&(Fe=Fe.slice(0,Fe.length-g.length)),L(Fe)}if(Ue){const Fe=Qw(ze)?.marker??"**",rt=a.push("strong_open","",0);rt.markup=Fe;const le=a.push("math_inline","math",0);le.content=Sr(Me,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${Me}${v}`,le.loading=!0,rt.content=Me,a.push("strong_close","",0)}else{const Fe=a.push("math_inline","math",0);Fe.content=Sr(Me,t),Fe.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Fe.raw=`${g}${Me}${v}`,Fe.loading=!0}a.pos=y.length}m=y.length,b=m}break}}const W=y.slice(S+g.length,D),z=W.includes("`"),q=!W||!W.trim(),Q=g==="$",X=y[D+v.length],fe=Q&&bg(W,X),ye=Q&&_g(W);if(c?z||q||fe||ye:z||q||fe||ye||!Q&&!Ba(W)){m=D+v.length;const Me=y.slice(a.pos,m);a.pending||(L(Me),b=m);continue}if($=!0,!l){const Me=y.slice(a.pos-(a.pending??"").length,S);let we=y.slice(0,m)?y.slice(b,S):Me;const ze=Xw(we)%2===1;S!==a.pos&&ze&&(we=a.pending+y.slice(a.pos,S));const Ue=ze?Qw(we):null,Fe=Ue?.marker??"**";if(a.pending!==we)if(a.pending="",ze)if(Ue){const rt=we.slice(Ue.index+Fe.length);L(we.slice(0,Ue.index));const le=a.push("strong_open","",0);le.markup=Fe;const U=a.push("text","",0);U.content=rt,a.push("strong_close","",0)}else L(we);else L(we);if(ze){const rt=a.push("strong_open","",0);rt.markup=Fe;const le=a.push("math_inline","math",0);le.content=Sr(W,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${W}${v}`,le.loading=!1;const U=y.slice(D+v.length).startsWith(Fe);return U&&a.push("strong_close","",0),a.pos=d(y,D+v.length),m=a.pos,b=m,U||a.push("strong_close","",0),!0}else{const rt=a.push("math_inline","math",0);rt.content=Sr(W,t),rt.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",rt.raw=`${g}${W}${v}`,rt.loading=!1}}return m=d(y,D+v.length),b=m,a.pos=m,!0}if($){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let S=m;for(;!(S>=y.length);){const I=s1(y,S);if(I===-1)break;if(I+1<y.length&&y[I+1]==="$"){S=I+2;continue}if(I>0&&y[I-1]==="$"){S=I+1;continue}const P=kg(y,I+1);if(P===-1)break;const D=y.slice(I+1,P),W=D.includes("`"),z=!D||!D.trim(),q=y[P+1],Q=bg(D,q),X=_g(D);if(!W&&!z&&!Q&&!X){const fe=y.slice(m,I);fe&&L(fe);const ye=a.push("math_inline","math",0);ye.content=Sr(D,t),ye.markup="$",ye.raw=`$${D}$`,ye.loading=!1,m=P+1,S=P+1}else L("$"),S=I+1}S<y.length&&L(y.slice(S))}else m<y.length&&L(y.slice(m));a.pos=y.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,p=t?.strictDelimiters,h=p?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],f=u.bMarks[l]+u.tShift[l];let m=u.src.slice(f,u.eMarks[l]).trim(),b=!1,_="",g="",v=!1,y="",A=!1;for(const[fe,ye]of h)if(m.startsWith(fe))if(fe.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){b=!0,_=fe,g=ye;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){b=!0,_=fe,g=ye;break}continue}else{const Me=u.tokens[u.tokens.length-1];if(Me&&Me.type==="list_item_open"&&Me.mark==="-"&&m.slice(fe.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const we=m.indexOf("]");if(m.slice(we).trim()!=="]")continue;const ze=m.slice(fe.length,we);if(fe==="["?Zw(ze):Ba(ze)){b=!0,_=fe,g=ye;break}continue}}else{b=!0,_=fe,g=ye;break}else if((fe==="$$"||fe==="\\[")&&m.endsWith(fe)&&l+1<a){const Me=q0(m,fe,ye);if(Me===-1)continue;y=Ku(m.slice(0,Me)),A=!0;const we=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(we,u.eMarks[l+1]).trim(),v=!0,b=!0,_=fe,g=ye;break}if(!b)return!1;if(c&&!A)return!0;const O=m.indexOf(_),$=O+_.length,k=!p&&_==="["?m.indexOf("\\]",$):-1,E=k>=0?"\\]":g,M=k>=0?k:nu(m,g,$);if(!v&&M>_.length){const fe=m.slice(O+_.length,M),ye=u.push("math_block","math",0);ye.content=Sr(fe),ye.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",ye.map=[l,l+1],ye.raw=`${_}${fe}${E}`,ye.block=!0,ye.loading=!1,u.line=l+1;const Me=m.slice(M+E.length);return Me.trim()&&n(u,Me,l),!0}let L=l,S="",I=!1,P="",D=l;const W=v?m:m===_?"":m.slice(_.length),z=!p&&_==="\\["?"]":"",q=nu(W,g);if(q!==-1){const fe=q;S=W.slice(0,fe),P=W.slice(fe+g.length),D=v?l+1:l,I=!0,L=D}else for(W&&!v&&(S=W),L=l+1;L<a;L++){const fe=u.bMarks[L]+u.tShift[L],ye=u.eMarks[L],Me=u.src.slice(fe,ye),we=Me.trim();if(!p&&_==="["&&we==="\\]"){g="\\]",I=!0;break}if(z&&Me.trim()===z){g=z,I=!0;break}if(we===g){I=!0;break}else if(!p&&_==="["&&Me.includes("\\]")){I=!0;const ze=Me.indexOf("\\]");g="\\]";const Ue=Me.slice(0,ze);Ue&&(S+=(S?`
|
|
157
|
-
`:"")+Ue),P=Me.slice(ze+g.length),D=L;break}else if(nu(Me,g)!==-1){I=!0;const ze=nu(Me,g),Ue=Me.slice(0,ze);Ue&&(S+=(S?`
|
|
158
|
-
`:"")+Ue),P=Me.slice(ze+g.length),D=L;break}S+=(S?`
|
|
159
|
-
`:"")+Me}if((!d||p)&&!I)return!1;const Q=/^\s*!\[/.test(S);if(!(A?!Q&&i1(S):_==="$$"?!Q:_==="["?Zw(S):Ba(S)))return!1;if(c)return!0;y&&n(u,y,l);const X=u.push("math_block","math",0);return X.content=Sr(S),X.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",X.raw=`${_}${S}${S.startsWith(`
|
|
160
|
-
`)?`
|
|
161
|
-
`:""}${g}`,X.map=[l,L+1],X.block=!0,X.loading=!I,u.line=L+1,P.trim()&&n(u,P,D),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],p=u.src.slice(d,u.eMarks[l]).trim();return!p.startsWith("$$")&&!p.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function WH(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}function zH(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new EB({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!zl(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&HH(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&GB(i),e.enableFixIndentedCodeBlock!==!1&&vF(i),KF(i),QF(i),YF(i),tH(i),WH(i),mF(i,{customHtmlTags:e.customHtmlTags}),i}function Ul(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=>Ul(n))),t}function UH(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function qH(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function jH(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function af(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...jn(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const s2=/\r?\n[ \t]*`+\s*$/,aM=["diff ","index ","--- ","+++ ","@@ "],VH=/\r?\n/;function KH(e){const t=String(e??"");return t?aM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function i2(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function GH(e,t){const n=[],o=[],s=[],i=[],r=e.split(VH),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const f=h;if(!aM.some(m=>f.startsWith(m)))if(f.startsWith("-")){const m=f.slice(1);s.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(f.startsWith("+")){const m=f.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{i2(n,o,s,i);const m=a&&f.startsWith(" ")?f.slice(1):f;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const f=r[h]??"";!t&&!l&&h===u-1&&KH(f)||c(f)}(t||s.length>0||i.length>0)&&i2(n,o,s,i);const d=n.join(`
|
|
162
|
-
`),p=o.join(`
|
|
163
|
-
`);return{original:t&&l&&d?`${d}
|
|
164
|
-
`:d,updated:t&&l&&p?`${p}
|
|
165
|
-
`:p}}function j0(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(s2.test(a)&&(a=a.replace(s2,"")),r){const{original:c,updated:u}=GH(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function YH(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function XH(){return{type:"hardbreak",raw:`\\
|
|
166
|
-
`}}function QH(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...jn(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let wg=null;const Sg=new WeakMap;function r2(){return wg||(wg={customTagSet:null,allowedTagSet:Ah()}),wg}function cM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function uM(e){return/^<\s*\//.test(e)}function dM(e,t){return/\/\s*>\s*$/.test(t)||Jl.has(e)}function ZH(e){if(!e||e.length===0)return r2();const t=Sg.get(e);if(t)return t;const n=e.map(oi).filter(Boolean);if(!n.length){const s=r2();return Sg.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Ah({customHtmlTags:e})};return Sg.set(e,o),o}function fM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function JH(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Ep(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function eW(e,t,n){const o=e.slice();return Ep(o,"href")||o.push(["href",t]),n!=null&&!Ep(o,"title")&&o.push(["title",n]),o}function r1(e){return e.map(fM).join("")}function $f(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:$f(o.children)});continue}t.push(o)}return t}function tW(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=cM(r),a=uM(r),c=dM(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function Cg(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?tW(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:r1(o),innerTokens:s,nextIndex:i}}function nW(e,t,n,o,s,i,r){const l=String(e.content??""),a=cM(l),{customTagSet:c,allowedTagSet:u}=ZH(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Cg(t,n,a).closed){const A=fM(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=uM(l),p=dM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=Cg(t,n,a),O=Sh(l),$=A.innerTokens,k=String(Ep(O,"href")??""),E=Ep(O,"title"),M=E==null?null:String(E),L=eW(O,k,M),S=$f($.length?o($,s,i,r):[]),I=$.length?r1($):k||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:k,title:M,text:I,attrs:L,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(p)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=Cg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:$f(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const f=$f(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let m=h.html||l,b=!h.closed,_=!1;if(!h.closed){const A=`</${a}>`;m.toLowerCase().includes(A.toLowerCase())||(m+=A),_=!0,b=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const A=y[1],O=y[2]||y[3]||y[4]||"";g.push([A,O])}if(c?.has(a)){const A=JH(e);return[{type:a,tag:a,attrs:g,content:A?A.inner:h.innerTokens.length?r1(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??m,loading:e.loading||b,autoClosed:_},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:f,raw:m,loading:b,autoClosed:_},h.nextIndex]}function pM(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=>pM(t)).join(""):String(e.content??"")}function oW(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>pM(t)).join("")}function l2(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const p=d.attrs;if(Array.isArray(p)&&p.length>0){n=p,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=oW(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function sW(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function iW(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...jn(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function rW(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function Ip(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function lW(e,t,n){const o=e.slice();return Ip(o,"href")||o.push(["href",t]),n!=null&&!Ip(o,"title")&&o.push(["title",n]),o}function cf(e,t,n){const o=e[t],s=rW(o.attrs),i=String(Ip(s,"href")??""),r=Ip(s,"title"),l=r==null?null:String(r),a=lW(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let p=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(b=>b.type==="strong_open")){const b=String(h.content??""),_=String(h.raw??b),g=Ul(h);g.content=b.slice(0,-2),g.raw=_.replace(/\*\*$/,""),p=u.slice(),p[p.length-1]=g}const f=jn(p,void 0,void 0,n),m=f.map(b=>{const _=b;return"content"in b?String(_.content??""):String(_.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:f,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function a2(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 aW(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function c2(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...jn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const cW=/\\([\\()[\]`$|*_\-!])/g;function uW(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(cW,"$1")===t))return n}function Vc(e,t,n,o){const s=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...o,__insideStrong:!0};return s.push(...jn(l,uW(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function dW(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...jn(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function fW(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...jn(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function pW(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const hW=/[^~]*~{2,}[^~]+/,mW=/\*\*/,gW=/[[_*^~]/,vW=/\\([\\()[\]`$|*_\-!])/g,V0=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),yW=/\s/u,kW=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,bW=/\p{P}/u,_W=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,wW=/:\/\//;function SW(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 hM(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&V0.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Qr(e){return!!e&&yW.test(e)}function Zr(e){return!!e&&(kW.test(e)||bW.test(e))}function CW(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Qr(o)?!1:!(Zr(o)&&n&&!Qr(n)&&!Zr(n))}function xW(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Qr(n)?!1:!(Zr(n)&&o&&!Qr(o)&&!Zr(o))}function AW(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?hM(e,o):t.indexOf("*",o);if(i===-1)break;if(xW(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function TW(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Qr(o)?!1:!(Zr(o)&&n&&!Qr(n)&&!Zr(n))}function MW(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Qr(n)?!1:!(Zr(n)&&o&&!Qr(o)&&!Zr(o))}function EW(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(MW(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function IW(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&V0.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function $W(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&V0.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function NW(e,t,n){const o=$W(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const LW=/[\p{L}\p{N}]/u,OW=/^[\p{L}\p{N}]+$/u;function l1(e){return e?LW.test(e):!1}function mM(e){return e?OW.test(e):!1}function gu(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:l1(o)&&l1(s)}}function PW(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=gu(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!mM(e.slice(o.end,s.start)))return s.end}return-1}function RW(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function DW(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=gu(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function BW(e){return e?_W.test(e)||wW.test(e):!1}function FW(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function jn(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=ud(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,p=e;function h(){return e===p&&(e=e.slice()),e}function f(){c=null}function m(U,G){const ne=e.length===1?t:String(G.content??""),H=[],J=PW(U);if(J!==-1){A(U.slice(0,J),U.slice(0,J));const te=U.slice(J);return te&&(M({type:"text",content:te,raw:te}),u--),u++,!0}if(hW.test(U)){const te=U.indexOf("~~");te!==-1&&H.push({type:"strikethrough",index:te})}if(mW.test(U)){const te=U.indexOf("**");te!==-1&&H.push({type:"strong",index:te})}if(/[^*]*\*[^*]+/.test(U)){const te=ne?hM(ne,0):U.indexOf("*");if(ne&&te===-1)return!1;te!==-1&&H.push({type:"emphasis",index:te})}H.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 ce=H[0];if(!ce)return!1;if(ce.type==="strikethrough"){const te=ce.index,ue=te>-1?U.slice(0,te):"";if(ue&&A(ue,ue),te===-1)return u++,!0;const j=U.indexOf("~~",te+2),Y=j===-1?U.slice(te+2):U.slice(te+2,j),re=j===-1?"":U.slice(j+2),{node:ge}=c2([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:Y,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return f(),y(ge),re&&(M({type:"text",content:re,raw:re}),u--),u++,!0}if(ce.type==="strong"){const te=ce.index,ue=te>-1?U.slice(0,te):"";if(ue&&A(ue,ue),te===-1)return u++,!0;if(t&&te===0){let Ie=!1,ae=0;for(;ae<U.length&&U[ae]==="*";)ae++;if(t.startsWith("\\*")&&(Ie=!0),Ie){let Te=0,Ve=0;for(;Ve<t.length&&Te<ae;)if(t[Ve]==="\\"&&Ve+1<t.length&&t[Ve+1]==="*")Te+=1,Ve+=2;else{if(t[Ve]==="*")break;Ve++}if(Te>=2)return A(U,U),u++,!0}}if(t&&(U.match(/\*/g)||[]).length>SW(t))return A(U.slice(ue.length),U.slice(ue.length)),u++,!0;const j=gu(U,te);if(j.len>=3){const Ie=DW(U,te+j.len);if(Ie!==-1){const ae=U.slice(te+j.len,Ie);if(RW(ae)){const{node:Te}=Vc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ae,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);f(),y(Te);const Ve=U.slice(Ie+3);return Ve&&(M({type:"text",content:Ve,raw:Ve}),u--),u++,!0}}}if(!TW(U,te)){const Ie=U.slice(te,te+j.len);A(Ie,Ie);const ae=U.slice(te+j.len);return ae&&(M({type:"text",content:ae,raw:ae}),u--),u++,!0}const Y=EW(U,te+2);let re="",ge="";if(Y.index!==-1){re=U.slice(te+2,Y.index),ge=U.slice(Y.index+2);const Ie=Y.index,ae=gu(U,Ie);if(j.intraword&&ae.intraword&&!mM(re)||!re&&j.len>=4&&j.intraword)return A(U.slice(ue.length),U.slice(ue.length)),u++,!0}else{if(d||Y.sawInvalidClose||j.intraword)return A(U.slice(ue.length),U.slice(ue.length)),u++,!0;re=U.slice(te+2),ge=""}if(!re&&/^\*+$/.test(ge))return A(U,U),u++,!0;const{node:Ae}=Vc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:re,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return f(),y(Ae),ge&&(M({type:"text",content:ge,raw:ge}),u--),u++,!0}if(ce.type==="emphasis"){let te=ce.index;te===-1&&(te=0);const ue=U.slice(0,te);if(ue&&A(ue,ue),!CW(U,te)){A(U[te],U[te]);const Ie=U.slice(te+1);return Ie&&(M({type:"text",content:Ie,raw:Ie}),u--),u++,!0}const j=gu(U,te),Y=AW(ne,U,te+1),re=Y.index,ge=e[u+1];if(o?.final&&ge?.type==="em_open"&&re!==-1&&U.slice(te+1,re).trim()!==U.slice(te+1,re)||re===-1&&(Y.sawInvalidClose||o?.final||j.intraword||!l1(U[te+1])))return A(U.slice(te),U.slice(te)),u++,!0;const{node:Ae}=af([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re>-1?U.slice(te+1,re):U.slice(te+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(f(),y(Ae),re!==-1&&re<U.length-1){const Ie=U.slice(re+1);Ie&&(M({type:"text",content:Ie,raw:Ie}),u--)}return u++,!0}return!1}function b(U,G){if(!U.includes("`"))return!1;const H=(ge=>{for(let Ae=0;Ae<ge.length;Ae++){if(ge[Ae]!=="`")continue;let Ie=0;for(let ae=Ae-1;ae>=0&&ge[ae]==="\\";ae--)Ie++;if(Ie%2===0)return Ae}return-1})(U);if(H===-1)return!1;let J=1;for(let ge=H+1;ge<U.length&&U[ge]==="`";ge++)J++;const ce="`".repeat(J),te=H+J,ue=U.indexOf(ce,te);if(ue===-1){if(J===1){const Ae=U.slice(0,H),Ie=U.slice(H+1);return Ae&&(m(Ae,G)?u--:A(Ae,Ae)),g({type:"inline_code",code:Ie,raw:String(Ie)}),u++,!0}let ge=U;for(let Ae=u+1;Ae<e.length;Ae++)ge+=String((e[Ae].content??"")+(e[Ae].markup??""));return u=e.length-1,A(ge,ge),u++,!0}f();const j=U.slice(0,H),Y=U.slice(H+J,ue),re=U.slice(ue+J);return j&&(m(j,G)?u--:A(j,j)),g({type:"inline_code",code:Y,raw:String(Y??"")}),re&&(M({type:"text",content:re,raw:re}),u--),u++,!0}function _(U){const G=l?.__markdownIt;if(!G||e.length<=1||!e.some(ce=>ce?.type==="math_inline")||!gW.test(U))return null;const ne=G.parseInline(U,{__markstreamFinal:!!o?.final});if(!Array.isArray(ne)||ne.length===0)return null;const H=(ne.find(ce=>ce?.type==="inline")?.children??[]).filter(ce=>!(ce?.type==="text"&&String(ce.content??"")===""));if(!H.length||!H.some(ce=>ce?.type!=="text")||H.length===1&&H[0]?.type==="text"&&String(H[0].content??"")===U)return null;const J=jn(H,U,n,o);return J.length?J:null}function g(U){f(),a.push(U)}function v(U){f();const G=Ul(U);a.push(G)}function y(U){g(U)}function A(U,G){c?(c.content+=U,c.raw+=G??U):(c={type:"text",content:String(U??""),raw:String(G??U??"")},a.push(c))}function O(U,G){if(!U)return;const ne=jn([{...G,type:"text",content:U,raw:U}],U,n,o);if(ne.length===1&&ne[0]?.type==="text"){const H=ne[0];A(String(H.content??""),String(H.raw??H.content??""));return}for(const H of ne)y(H)}function $(U,G){return String(U.markup??"").startsWith(G)}function k(U){return U.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 E(U,G){let ne=U;const H=String(G.content??"");return ne.endsWith("\\")&&!$(G,"\\\\")&&!H.endsWith("\\\\")&&(ne=ne.slice(0,-1)),ne.endsWith("(")&&!$(G,"\\(")&&!H.endsWith("\\(")&&(ne=ne.slice(0,-1)),/\*+$/.test(ne)&&!$(G,"\\*")&&!H.endsWith("\\*")&&(ne=ne.replace(/\*+$/,"")),ne}for(;u<e.length;){const U=e[u];M(U)}function M(U){switch(U.type){case"text":S(U);break;case"softbreak":c?(c.content+=`
|
|
167
|
-
`,c.raw+=`
|
|
168
|
-
`):(c={type:"text",content:`
|
|
169
|
-
`,raw:`
|
|
170
|
-
`},a.push(c)),u++;break;case"code_inline":y(sW(U)),u++;break;case"html_inline":{const[G,ne]=nW(U,e,u,jn,t,n,o);y(G),u=ne;break}case"link_open":I(U);break;case"image":Me(U)||(f(),y(l2(U)),u++);break;case"strong_open":{f();const{node:G,nextIndex:ne}=Vc(e,u,U.content,o);y(G),u=ne;break}case"em_open":{f();const{node:G,nextIndex:ne}=af(e,u,o);y(G),u=ne;break}case"s_open":{f();const{node:G,nextIndex:ne}=c2(e,u,o);y(G),u=ne;break}case"mark_open":{f();const{node:G,nextIndex:ne}=QH(e,u,o);y(G),u=ne;break}case"ins_open":{f();const{node:G,nextIndex:ne}=iW(e,u,o);y(G),u=ne;break}case"sub_open":{f();const{node:G,nextIndex:ne}=dW(e,u,o);y(G),u=ne;break}case"sup_open":{f();const{node:G,nextIndex:ne}=fW(e,u,o);y(G),u=ne;break}case"sub":f(),y({type:"subscript",children:[{type:"text",content:String(U.content??""),raw:String(U.content??"")}],raw:`~${String(U.content??"")}~`}),u++;break;case"sup":f(),y({type:"superscript",children:[{type:"text",content:String(U.content??""),raw:String(U.content??"")}],raw:`^${String(U.content??"")}^`}),u++;break;case"emoji":{f();const G=e[u-1];G?.type==="text"&&/\|:-+/.test(String(G.content??""))?A("",""):y(jH(U)),u++;break}case"checkbox":f(),y(UH(U)),u++;break;case"checkbox_input":f(),y(qH(U)),u++;break;case"footnote_ref":f(),y(YH(U)),u++;break;case"footnote_anchor":{f();const G=U.meta??{};g({type:"footnote_anchor",id:String(G.label??U.content??""),raw:String(U.content??"")}),u++;break}case"hardbreak":f(),y(XH()),u++;break;case"fence":f(),y(j0(e[u])),u++;break;case"math_inline":f(),!U.content&&U.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(a2({...U,content:e[u+1].content})),u+=2):y(a2(U)),u++;break;case"reference":D(U);break;case"text_special":A(String(U.content??""),String(U.content??"")),u++;break;default:{const G=U;if(U.type==="link"&&G.href!=null&&o?.validateLink&&!o.validateLink(String(G.href))){f();const ne=String(G.text??"");A(ne,ne),u++}else we(U)||z(U)||Q(U)||W(U)||v(U),u++;break}}}function L(U,G,ne,H){const J=pW({...G,content:U});if(c){c.content+=E(J.content,G),c.raw+=J.raw;return}const ce=ne?.tag==="br"&&e[u-2]?.content==="[";H||(J.content=E(J.content,G)),c=J,c.center=ce,a.push(c)}function S(U){const G=String(U.content??""),ne=e.length===1&&G.includes("\\")&&typeof t=="string"?String(t):"";let H=ne?IW(ne):G.replace(vW,"$1");if(U.content==="<"||H==="1"&&e[u-1]?.tag==="br"){u++;return}const J=H.indexOf("$");J!==-1&&J===H.lastIndexOf("$")&&H.endsWith("$")&&(H=H.slice(0,-1)),H.endsWith("undefined")&&!t?.endsWith("undefined")&&(H=H.slice(0,-9));let ce=a.length,te="";for(let re=a.length-1;re>=0;re--){const ge=a[re];if(ge.type!=="text")break;ce=re,te=String(ge.content??"")+te}ce<a.length&&(H.startsWith(te)?(c=null,a.length=ce):c=a[a.length-1]);const ue=e[u+1];if((H==="`"||H==="|"||H==="$")&&!$(U,`\\${H}`)||/^\*+$/.test(H)&&!$(U,"\\*")){u++;return}if(!ue&&/[^\]]\s*\(\s*$/.test(H)&&(H=H.replace(/\(\s*$/,"")),!H){u++;return}if(ye(H)||ze(H))return;if(!(H.includes("*")||H.includes("_")||H.includes("~")||H.includes("`")||H.includes("[")||H.includes("!")||H.includes("$")||H.includes("|")||H.includes("("))){L(H,U,e[u-1],ue),u++;return}if(le(H))return;const j=e[u-1];if(H==="["&&!ue?.markup?.includes("*")&&!$(U,"\\[")||H==="]"&&!j?.markup?.includes("*")&&!$(U,"\\]")){u++;return}if(b(G,U)||rt(H)||(e[u+1]?.type!=="link_open"||k(H))&&Fe(H,U))return;const Y=_(G);if(Y){f();for(const re of Y)y(re);u++;return}m(H,U)||(L(H,U,j,ue),u++)}function I(U){if(P(U))return;if(Ue()){const{node:ue,nextIndex:j}=cf(e,u,o),Y=String(ue.text||ue.href||"");A(Y,Y),u=j;return}f();const{node:G,nextIndex:ne}=cf(e,u,o);u=ne;const H=G.text||G.href||"";if(U.markup==="linkify"&&!GT(H,G.href,t)&&Ap(H,l?.__linkifyDemotionContext)){A(H,H);return}const J=G.children.length===1&&G.children[0]?.type==="text";if(G.loading&&t&&G.text===G.href&&J){const ue=FW(t,G.href);ue&&(G.text=ue,G.children=[{type:"text",content:ue,raw:ue}],G.raw=`[${ue}](${G.href}${G.title?` "${G.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(G.href)){A(G.text,G.text);return}const ce=U.attrs?.find(([ue])=>ue==="href")?.[1],te=String(ce??"");if(t&&te){const ue=t.indexOf("](");if(ue!==-1){const j=t.indexOf(")",ue+2);j===-1?G.loading=!0:G.loading&&t.slice(ue+2,j).includes(te)&&(G.loading=!1)}}W(G)||g(G)}function P(U){if(U.markup!=="linkify")return!1;const{node:G,nextIndex:ne}=cf(e,u,o);return q(G,ne)?(u=ne,!0):!1}function D(U){f(),y(aW(U)),u++}function W(U){if(U.type!=="link")return!1;const G=a[a.length-1];if(!G||G.type!=="text")return!1;const ne=String(G.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ne)return!1;const H=U,J=String(H.href??""),ce=String(H.text??""),te=String(ne[2]??""),ue=J.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!J||!(ce===J||ce===ue||BW(ce)))return!1;const j=String(ne[1]??"");return j?(G.content=j,G.raw=j):a.pop(),g({...U,text:te,children:[{type:"text",content:te,raw:te}],raw:`[${te}](${J}${H.title?` "${H.title}"`:""})`}),!0}function z(U){if(U.type!=="link")return!1;const G=U,ne=String(G.href??"");return ne?q({href:ne,title:G.title==null||G.title===""?null:String(G.title),loading:!!G.loading},u+1):!1}function q(U,G){const ne=a[a.length-1];if(ne?.type!=="image"||ne.src||!ne.loading||!String(ne.raw??"").endsWith("]("))return!1;const H=e[G],J=String(H?.content??"");if(H?.type!=="text"||!J.startsWith(")"))return!1;a.pop(),c=null;const ce=String(ne.alt??"");g({type:"image",src:U.href,alt:ce,title:U.title,raw:``,loading:!!U.loading});const te=J.slice(1),ue=Ul(H);return ue.content=te,ue.raw=te,h()[G]=ue,!0}function Q(U){if(U.type!=="link")return!1;const G=a[a.length-1],ne=e[u-1];if(!G||G.type!=="text"||ne?.type!=="text")return!1;const H=String(G.content??""),J=String(ne.content??"");if(!H.endsWith("!")||!J.endsWith("!")||$(ne,"\\!"))return!1;const ce=H.slice(0,-1);ce?(G.content=ce,G.raw=ce,c=G):(a.pop(),c=null);const te=U,ue=String(te.text??te.children?.map(re=>String(re?.content??re?.raw??"")).join("")??""),j=String(te.href??""),Y=te.title==null||te.title===""?null:String(te.title);return g({type:"image",src:j,alt:ue,title:Y,raw:``,loading:!!te.loading}),!0}function X(U,G="",ne=null){const H=String(U.alt??U.raw??"");return{type:"link",href:G,title:ne,text:H,children:[U],raw:`[${H}](${G}${ne?` "${ne}"`:""})`,loading:!0}}function fe(U){const G=U.startsWith(";return{type:"image",src:"",alt:H===-1?ne.replace(/\]$/,""):ne.slice(0,H),title:null,raw:G,loading:!0}}function ye(U){const G=U.indexOf("[![");if(G===-1||typeof t=="string"&&e.length===1&&NW(t,G,"["))return!1;const ne=U.slice(0,G);return ne&&A(ne,ne),g(X(fe(U.slice(G+1)))),u++,!0}function Me(U){if(o?.final)return!1;const G=e[u-1];if(G?.type!=="text"||!String(G.content??"").endsWith("[")||$(G,"\\["))return!1;const ne=a[a.length-1];if(ne?.type==="text"&&ne.content.endsWith("[")){const H=ne.content.slice(0,-1);H?(ne.content=H,ne.raw=H,c=ne):(a.pop(),c=null)}return g(X(l2(U))),u++,!0}function we(U){if(U.type!=="link")return!1;const G=U,ne=String(G.raw??""),H=String(G.text??"");if(!ne.startsWith("[![")&&!H.startsWith("!["))return!1;const J=G.title==null||G.title===""?null:String(G.title);return g(X({type:"image",src:String(G.href??""),alt:H.replace(/^!\[/,"").replace(/\]$/,""),title:J,raw:ne.startsWith("[)return!1;const G=e[u-2];if(G?.type==="text"&&String(G.content??"").endsWith("[")&&$(G,"\\["))return!1;const ne=a[a.length-1];if(ne?.type!=="image"&&ne?.type!=="link")return!1;const H=ne,J=ne?.type==="link"&&Array.isArray(H.children)&&H.children.length===1&&H.children[0]?.type==="image"?a.pop():null,ce=J?J.children[0]:a.pop();if(!ce||ce.type!=="image")return!1;const te=e[u+1];let ue=String(J?.href??""),j=J?.title==null?null:String(J.title),Y=!0;if(te?.type==="link_open"){const{node:ge,nextIndex:Ae}=cf(e,u+1,o);ue=ge.href,j=ge.title,Y=!0,u=Ae}else{if(ue=U.slice(2),ue.includes('"')){const ge=ue.split('"');ue=String(ge[0]??"").trim(),j=ge[1]==null?null:String(ge[1]).trim()}u++}const re=X(ce,ue,j);return re.loading=Y,g(re),!0}function Ue(){const U=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&U?.type==="text"&&String(U.content??"").endsWith("[")&&$(U,"\\[")}function Fe(U,G){const ne=U.indexOf("[");if(ne===-1)return!1;let H=U.slice(0,ne);const J=U.indexOf("](",ne);if(J!==-1){const ce=e[u+2];let te=U.slice(ne+1,J);if(te.includes("[")){const Ie=te.indexOf("[");H+=U.slice(0,ne+Ie+1);const ae=ne+Ie+1;te=U.slice(ae+1,J)}const ue=e[u+1];if(U.endsWith("](")&&ue?.type==="link_open"&&ce){const Ie=e[u+4];let ae=4,Te=!0;if(Ie?.type==="text"){const tt=String(Ie.content??"");if(tt.startsWith(")")){Te=!1;const bt=tt.slice(1);if(bt){const kt=Ul(Ie);kt.content=bt,kt.raw=bt,h()[u+4]=kt}else ae++}else tt==="."&&ae++}O(H,G);const Ve=String(ce.content??"");return o?.validateLink&&!o.validateLink(Ve)?A(te,te):g({type:"link",href:Ve,title:null,text:te,children:[{type:"text",content:te,raw:te}],loading:Te}),u+=ae,!0}const j=U.indexOf(")",J),Y=j!==-1?U.slice(J+2,j):"",re=j===-1;let ge=H.match(/\*+$/);if(ge&&(H=H.replace(/\*+$/,"")),O(H,G),ge||(ge=te.match(/^\*+/)),!d&&ge){const Ie=ge[0].length;te=te.replace(/^\*+/,"").replace(/\*+$/,"");const ae=[];if(Ie===1?ae.push({type:"em_open",tag:"em",nesting:1}):Ie===2?ae.push({type:"strong_open",tag:"strong",nesting:1}):Ie===3&&(ae.push({type:"strong_open",tag:"strong",nesting:1}),ae.push({type:"em_open",tag:"em",nesting:1})),ae.push({type:"link",href:Y,title:null,text:te,children:[{type:"text",content:te,raw:te}],loading:re}),Ie===1){ae.push({type:"em_close",tag:"em",nesting:-1});const{node:Te}=af(ae,0,o);y(Te)}else if(Ie===2){ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Te}=Vc(ae,0,void 0,o);y(Te)}else if(Ie===3){ae.push({type:"em_close",tag:"em",nesting:-1}),ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Te}=Vc(ae,0,void 0,o);y(Te)}else{const{node:Te}=af(ae,0,o);y(Te)}}else o?.validateLink&&!o.validateLink(Y)?A(te,te):g({type:"link",href:Y,title:null,text:te,children:[{type:"text",content:te,raw:te}],loading:re});const Ae=j!==-1?U.slice(j+1):"";return Ae&&(M({type:"text",content:Ae,raw:Ae}),u--),u++,!0}return!1}function rt(U){const G=U.indexOf("![");if(G===-1)return!1;const ne=U.slice(0,G);return ne&&!c?c={type:"text",content:ne,raw:ne}:ne&&c&&(c.content+=ne),c&&(a.push(c),c=null),g(fe(U.slice(G))),u++,!0}function le(U){if(!(U?.startsWith("[")&&n?.type==="list_item_open"))return!1;const G=U.slice(1).match(/[^\s\]]/);if(G===null)return u++,!0;if(G&&/x/i.test(G[0])){const ne=G[0]==="x"||G[0]==="X";return g({type:"checkbox_input",checked:ne,raw:ne?"[x]":"[ ]"}),u++,!0}return!1}return a}function HW(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function WW(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function zW(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function bc(e,t,n){const o=e[t],s=[],i=il(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=zW(c)?Ul(c):c,d=e[a-1];u!==c&&(WW(u),HW(u));const p=String(u.content??"");l.push({type:"paragraph",children:jn(u.children||[],p,d,i.options()),raw:p}),i.remember(p),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=_c(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]=bc(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=G0(e,a,i.options(),K0);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}s.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(`
|
|
171
|
-
`)},r+1]}function UW(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=il(o,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:jn(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]=bc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=_c(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Ch(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
|
|
172
|
-
${r.map(c=>c.raw).join(`
|
|
173
|
-
`)}
|
|
174
|
-
:::`},a+1]}const qW=new Set(["warning","info","note","tip","danger","caution"]);function jW(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return qW.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function VW(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const p=d.slice(s.length).trim();p&&(i=p)}}else{const d=jW(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=il(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const p=d.children||[];let h=-1;for(let m=p.length-1;m>=0;m--){const b=p[m];if(b.type==="text"&&/:+/.test(b.content)){h=m;break}}const f={type:"paragraph",children:jn((h!==-1?p.slice(0,h):p)||[],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,p]=bc(e,c,a.options());l.push(d),a.remember(d.raw),c=p}else if(e[c].type==="blockquote_open"){const[d,p]=_c(e,c,a.options());l.push(d),a.remember(d.raw),c=p}else{const d=Ch(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
|
|
175
|
-
${l.map(d=>d.raw).join(`
|
|
176
|
-
`)}
|
|
177
|
-
:::`},c+1]}const KW=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function GW(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=KW.exec(String(o.info??""));return s?UW(e,t,s,n):null}const K0={parseContainer:(e,t,n)=>VW(e,t,n),matchAdmonition:GW};function _c(e,t,n){const o=[],s=il(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:jn(r.children||[],String(r.content??""),void 0,s.options()),raw:String(r.content??"")};o.push(l),s.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=bc(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=_c(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=G0(e,i,s.options(),K0);r?(o.push(r[0]),s.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:o,raw:o.map(r=>r.raw).join(`
|
|
178
|
-
`)},i+1]}function YW(e){if(e.info?.startsWith("diff"))return j0(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function XW(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=il(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=jn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:jn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
179
|
-
`)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
|
|
180
|
-
`)},s+1]}function QW(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=il(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:jn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
|
|
181
|
-
`)}`},l+1]}function ZW(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(o.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:jn(a.children||[],c,void 0,n),raw:c}}function JW(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=qn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=qn(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 gM(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const o=qn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Jl.has(n),l=Sh(s),a=(o===-1?-1:JW(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
182
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function ez(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 tz(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function vM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function yM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return vM(n)?n:void 0}function nz(e,t,n){const o=yM(ud(t),n);if(!vM(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function oz(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const p=e[c].type==="th_open",h=e[c+1],f=String(h.content??""),m=tz(e[c].attrs),b=a.length,_=!p&&!r,g=_?s?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:p||r,children:jn(h.children||[],f,void 0,nz(n,g,_?u:void 0)),raw:f,align:m}),_&&(u=yM(u,ud(f))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(p=>p.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
|
|
183
|
-
`)},o+1]}function sz(){return{type:"thematic_break",raw:"---"}}let xg=null;const Ag=new WeakMap;function u2(){return xg||(xg={allowedTagSet:Ah(),customTagSet:null}),xg}function iz(e){if(!e||e.length===0)return u2();const t=Ag.get(e);if(t)return t;const n=e.map(oi).filter(Boolean);if(!n.length){const s=u2();return Ag.set(e,s),s}const o={allowedTagSet:Ah({customHtmlTags:e}),customTagSet:new Set(n)};return Ag.set(e,o),o}function rz(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,f]of s)if(h==="class"){const m=f.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(f)}catch{r[m]=f}}}const l=[],a=il(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const f={type:"paragraph",children:jn(h.children||[],void 0,void 0,a.options()),raw:String(h.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[h,f]=bc(e,c,a.options());l.push(h),a.remember(h.raw),c=f}else if(e[c].type==="blockquote_open"){const[h,f]=_c(e,c,a.options());l.push(h),a.remember(h.raw),c=f}else{const h=Ch(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let p=`::: ${i}`;return Object.keys(r).length>0&&(p+=` ${JSON.stringify(r)}`),p+=`
|
|
184
|
-
`,l.length>0&&(p+=o.raw??l.map(h=>h.raw).join(`
|
|
185
|
-
`),p+=`
|
|
186
|
-
`),p+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:p},u?c+1:c]}function lz(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function az(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function cz(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Es(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Es(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=qn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=qn(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 uz(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=qn(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 p=f=>{const m=e.slice(f);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},h=f=>{const m=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),end:e.length};if(h(f)){const m=e.indexOf(">",f);if(m===-1)return null;if(u--,u===0){const b=m+1;return{raw:e.slice(r,b),end:b}}d=m+1;continue}if(p(f)){const m=qn(e.slice(f));if(m===-1)return null;u++,d=f+m+1;continue}d=f+1}return{raw:e.slice(r),end:e.length}}function a1(e){return Number.isFinite(e)&&e>0?e:0}function dz(e,t){const n=a1(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
|
|
187
|
-
`&&(o++,o===n))return s+1;return e.length}function Ch(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[ZW(e,t,n),t+3];case"code_block":return[YW(o),t+1];case"fence":return[j0(o),t+1];case"math_block":return[ez(o),t+1];case"html_block":{const s=gM(o),i=s.tag?iz(n?.customHtmlTags):null;if(s.tag&&s.loading&&i&&!i.allowedTagSet.has(s.tag)){const r=String(o.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(s.tag&&i?.customTagSet?.has(s.tag)){const r=s.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(o.map)?dz(l,Number(o.map?.[0]??0)):0,u=uz(l,r,Math.max(a1(a),a1(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),p=qn(d),h=p!==-1?d.slice(0,p+1):d,f=p!==-1&&/\/\s*>\s*$/.test(h),m=p===-1?null:cz(d,r,p+1),b=m?.start??-1;let _="";p!==-1&&(b!==-1&&p<b?_=d.slice(p+1,b):_=d.slice(p+1)),b===-1&&(_=az(_,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(h))!==null;){const O=y[1];if(!O||O.toLowerCase()===r)continue;const $=y[2]||y[3]||y[4]||"";g.push([O,$])}const A=!n?.final&&!f&&m==null;return[{type:r,tag:r,content:lz(_),raw:String(u?.raw??s.raw??d),loading:A,attrs:g.length?g:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=oz(e,t,n);return[s,i]}case"dl_open":{const[s,i]=XW(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=QW(e,t,n);return[s,i]}case"hr":return[sz(),t+1]}return null}function G0(e,t,n,o){const s=Ch(e,t,n);if(s)return s;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(o?.parseContainer)return o.parseContainer(e,t,n);break;case"container_open":if(o?.matchAdmonition){const i=o.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return rz(e,t,n)}return null}function fz(){return{type:"hardbreak",raw:`\\
|
|
188
|
-
`}}function pz(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:jn(o.children||[],s,void 0,n),raw:s}}const d2=new WeakMap,xh=new WeakMap,hz=["$$","\\["];function uc(){return typeof performance<"u"?performance.now():Date.now()}function Y0(e,t,n){e&&(e[t]=(e[t]??0)+n)}function kM(e){return e.__timing}function Tg(e,t,n){return t&&Y0(t,"parseMarkdownToStructureTotalMs",uc()-n),e}function f2(e,t,n){if(!n)return b2(e,t);const o=uc(),s=b2(e,t);return Y0(n,"processTokensMs",uc()-o),s}function mz(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=kc(t);return n.length?new Set(n):null}function gz(e,t){const n=e;let o=d2.get(n);o||(o=new Map,d2.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function vz(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function uf(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=$l(s.value,n))}}function $l(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push($l(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set($l(l,t),$l(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add($l(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),uf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),uf(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),uf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!vz(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),uf(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=$l(i[r],t);return s}function bM(e,t=!0){if(!t)return Ul(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>bM(a,t)):t&&r&&typeof r=="object"&&(l=$l(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function p2(e,t=!0){return e.map(n=>bM(n,t))}function _M(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function yz(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function kz(e){xh.delete(e)}function bz(e,t,n){xh.set(e,{source:t,key:n,pendingCandidate:n===null&&lM(t)})}function _z(e){return e.endsWith("$")||e.endsWith("\\")}function wz(e){const t=Math.max(e.lastIndexOf(`
|
|
189
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return hz.some(o=>n.endsWith(o))}function Sz(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||wz(e)&&/[\r\n]/.test(t)):!1}function Cz(e,t){if(!eM(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=xh.get(o);if(s?.source===t)return;if(s&&t.startsWith(s.source)){const l=t.slice(s.source.length);if(s.key===null&&s.pendingCandidate===!1&&!Sz(s.source,l)&&!_z(t)){s.source=t;return}}const i=BH(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),bz(e,t,i)}function xz(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function Az(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function Mg(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&Az(e,t)}function h2(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function Tz(e){for(let t=0;t+5<e.length;t++)if(h2(e,t)&&h2(e,t+3)&&Mg(e[t],e[t+3])&&Mg(e[t+1],e[t+4])&&Mg(e[t+2],e[t+5]))return!0;return!1}function Mz(e,t,n){return eM(e)&&lM(t)&&Tz(n)}function Ez(e){const t=xh.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function m2(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!_M(e,o)||(Cz(e,t),Ez(e)))return e.parse(t,n);const s=e.stream.parse(t,gz(e,n));if(Mz(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!xz(o))return s;const i=kM(o);if(!i)return p2(s,!0);const r=uc(),l=p2(s,!0);return Y0(i,"tokenCloneMs",uc()-r),l}function Ah(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return qu;const n=new Set(qu);for(const o of kc(t))o&&n.add(o);return n}function Iz(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 g2(e){return{type:"paragraph",children:e,raw:e.map(Iz).join("")}}function v2(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=mz(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const p=o.slice(0,u);if(String(d.content??"").trim()&&p.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(g2(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(g2(c)),a}function $z(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function vu(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function Nz(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*${Es(t)}\s*>\s*$`,"i").test(n)}function X0(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${Es(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=qn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Jl.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const p=f=>{const m=e.slice(f);return new RegExp(String.raw`^<\s*${Es(o)}(?=\s|>|/)`,"i").test(m)},h=f=>{const m=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${Es(o)}(?=\s|>)`,"i").test(m)};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(h(f)){const m=qn(e.slice(f));if(m===-1)return null;u--;const b=f+m+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(p(f)){const m=qn(e.slice(f));if(m===-1)return null;const b=e.slice(f,f+m+1);/\/\s*>$/.test(b)||u++,d=f+m+1;continue}d=f+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function Lz(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
|
|
190
|
-
`){n++;continue}return-1}return o===t.length?n:-1}function Oz(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
191
|
-
</${t}>`}function y2(e){return e.replace(/\r\n/g,`
|
|
192
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function Pz(e,t,n){return n?e.includes(n,t)?!0:y2(e.slice(Math.max(0,t))).includes(y2(n)):!1}function Rz(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
193
|
-
`&&n++,n):e[n]===`
|
|
194
|
-
`?n+1:t}function k2(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 Dz(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Q0(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Es(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function wM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const Bz=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),Fz=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function Hz(e){return/\n\s*\n/.test(e)||Fz.test(e)}function Wz(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>Bz.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!Hz(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function zz(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||DT.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=qn(l);if(a===-1)return s;const c=Q0(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=yu(u,t,wM(n,o));return Wz(u,d)?{...s,children:d}:s})}function yu(e,t,n){return e.trim()?CM(e,t,{...n,__disableStreamParse:!0}):[]}function Uz(e,t,n){const o=yu(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function qz(e,t,n){const o=gM({content:e}),s=qn(e),i=Q0(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=Uz(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function jz(e,t,n){const o=qn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=X0(s,"summary",0);if(!i)return yu(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...yu(r,t,n),qz(i.raw,t,n),...yu(l,t,n)]}function SM(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=vu(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!k2(c)){r.push(c);continue}const p=String(c.raw??vu(c)??""),h=d!==-1?d:t.indexOf(p,Math.max(0,l-p.length));if(h===-1){r.push(c);continue}let f=1,m=-1;for(let Q=a+1;Q<e.length;Q++){const X=e[Q];if(k2(X)){f++;continue}if(Dz(X)&&(f--,f===0)){m=Q;break}}const b=X0(t,"details",h),_=m===-1&&b?.closed===!0,g=_?(()=>{const Q=Q0(p,"details");return Q!==-1?p.slice(0,Q):p})():p,[v]=SM(_?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,h+p.length),y=jz(g,n,wM(o,s)),A=m===-1?"</details>":String(e[m].raw??vu(e[m])??"</details>"),O=_||m!==-1&&b?.closed===!0,$=A.replace(/[\t\r\n ]+$/,""),k=O?(()=>{const Q=(b?.raw??"").lastIndexOf($);return Q===-1?t.length:h+Q})():t.length,E=qn(p),M=_&&E!==-1?h+E+1:h+p.length,L=t.slice(M,k===-1?t.length:k),S=n.parse(L,{__markstreamFinal:s}),I=n.renderer.render(S,n.options,{__markstreamFinal:s}),P=k+$.length,D=O?Math.max(k+A.length,Rz(t,P)):t.length,W=O?t.slice(k,D):A,z=O?t.slice(h,D):t.slice(h),q=_&&E!==-1?p.slice(0,E+1):p;if(r.push({...c,tag:"details",attrs:Sh(p.slice(0,E+1)),raw:z,content:`${q}${I}${W}`,children:[...y,...v],loading:!s&&!O}),l=O?D:t.length,m===-1&&!_)break;m!==-1&&(a=m)}return[r,l]}function Vz(e,t,n){if(!n)return e;const o=e.slice();let s=0;for(let i=0;i<o.length;i++){const r=o[i],l=vu(r),a=l?n.indexOf(l,s):-1;if(r?.type!=="html_block"){a!==-1&&(s=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(s=a+l.length);continue}const u=X0(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),p=String(r.raw??d),h=Oz(u.raw,c,u.closed),f=!t&&!u.closed,m=d!==h||p!==u.raw||!!r.loading!==f,b=qn(u.raw),_=b===-1?"":u.raw.slice(0,b+1),g=_?Sh(_):[];if(r.content=h,r.raw=u.raw,r.loading=f,r.attrs=g.length?g:void 0,!m)continue;let v=Lz(u.raw,p);v===-1&&(v=0);const y=i+1;for(;y<o.length;){if(u.closed&&Nz(o[y],c)){o.splice(y,1);continue}const A=vu(o[y]);if(!A)break;const O=u.raw.indexOf(A,v);if(O===-1){if(Pz(n,u.end,A))break;o.splice(y,1);continue}v=O+A.length,o.splice(y,1)}}return o}function Kz(e){const t=l=>l===" "||l===" "||l===`
|
|
195
|
-
`||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=m=>{const b=m.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=m=>{const b=m.charCodeAt(0);return b>=48&&b<=57},d=m=>m==="!"||c(m),p=m=>c(m)||u(m)||m===":"||m==="-",h=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",f=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!h(l[a]))return!1;for(a++;a<l.length&&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 m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const p=g=>g===" "||g===" ",h=g=>{let v=0;for(;v<g.length&&p(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let A=v;for(;A<g.length&&g[A]===y;)A++;const O=A-v;return O<3?null:{markerChar:y,markerLen:O,rest:g.slice(A)}},f=g=>{let v=0;for(;v<g.length&&p(g[v]);)v++;let y=!1;for(;v<g.length&&g[v]===">";)for(y=!0,v++;v<g.length&&p(g[v]);)v++;return y?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const y=f(g);return y==null?null:h(y)};let b=0;const _=l.split(/\r?\n/);for(const g of _){const v=b,y=b+g.length;if(a<v)break;const A=m(g);if(A){const O=A.markerChar,$=A.markerLen;c?O===u&&$>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=O,d=$)}if(a<=y)break;b=y+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
|
|
196
|
-
`||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
197
|
-
`||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function Gz(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 o=f=>f===" "||f===" ",s=f=>{const m=f.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||f==="_"||f==="-"||f===":"},i=f=>{if(!f)return!1;if(f[0]===" ")return!0;let m=0;for(let b=0;b<f.length;b++){const _=f[b];if(_===" "){if(m++,m>=4)return!0;continue}if(_===" ")return!0;break}return!1},r=f=>{let m=!1,b=!1;for(let _=0;_<f.length;_++){const g=f[_];if(g==="\\"){_++;continue}if(!b&&g==="'"){m=!m;continue}if(!m&&g==='"'){b=!b;continue}if(!m&&!b&&g===">")return _}return-1},l=f=>{let m=0;for(;m<f.length&&o(f[m]);)m++;const b=f[m];if(b!=="`"&&b!=="~")return null;let _=m;for(;_<f.length&&f[_]===b;)_++;const g=_-m;return g<3?null:{markerChar:b,markerLen:g,rest:f.slice(_)}},a=(f,m)=>{if(i(f))return-1;const b=f.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let _=!1,g=0;for(;g<f.length;){const v=f[g];if(v!=="<"){o(v)||(_=!0),g++;continue}const y=r(f.slice(g));if(y===-1){_=!0,g++;continue}const A=f.slice(g,g+y+1);let O=1;for(;O<A.length&&o(A[O]);)O++;if(O>=A.length){_=!0,g++;continue}const $=A[O];if($==="!"||$==="?"){_=!0,g+=y+1;continue}if($==="/"){_=!0,g+=y+1;continue}const k=O;for(;O<A.length&&s(A[O]);)O++;if(O===k){_=!0,g++;continue}const E=A.slice(k,O).toLowerCase(),M=A[O];if(M&&M!==" "&&M!==" "&&M!==">"&&M!=="/"){_=!0,g++;continue}const L=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),S=/\/\s*>$/.test(A),I=L.test(f.slice(g+y+1)),P=L.test(e.slice(m+g+y+1)),D=/[\r\n]/.test(e.slice(m+g+y+1));if(_&&n.has(E)&&!S&&!I&&(P||D))return g;_=!0,g+=y+1}return-1};let c=!1,u="",d=0,p="",h=0;for(;h<e.length;){const f=e.indexOf(`
|
|
198
|
-
`,h),m=f!==-1,b=m&&f>h&&e[f-1]==="\r",_=m?b?f-1:f:e.length,g=e.slice(h,_),v=m?b?`\r
|
|
199
|
-
`:`
|
|
200
|
-
`:"",y=l(g);let A=g;if(!c&&!y){const O=a(g,h);if(O!==-1){const $=v||`
|
|
201
|
-
`;A=`${g.slice(0,O).replace(/[ \t]+$/,"")}${$}${$}${g.slice(O).replace(/^[ \t]+/,"")}`}}p+=A,p+=v,y&&(c?y.markerChar===u&&y.markerLen>=d&&/^\s*$/.test(y.rest)&&(c=!1,u="",d=0):(c=!0,u=y.markerChar,d=y.markerLen)),h=m?f+1:e.length}return p}function Yz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const p=d.charCodeAt(0);return p>=65&&p<=90||p>=97&&p<=122||p>=48&&p<=57||d==="_"||d==="-"},i=d=>{let p=0;for(;p<d.length&&o(d[p]);)p++;return d.slice(p)},r=d=>{let p=!1,h=!1;for(let f=0;f<d.length;f++){const m=d[f];if(m==="\\"){f++;continue}if(!h&&m==="'"){p=!p;continue}if(!p&&m==='"'){h=!h;continue}if(!p&&!h&&m===">")return f}return-1},l=(d,p,h)=>{const f=h.toLowerCase();let m=d.indexOf("<",p);for(;m!==-1;){let b=m+1;for(;b<d.length&&o(d[b]);)b++;if(b>=d.length||d[b]!=="/"){m=d.indexOf("<",m+1);continue}for(b++;b<d.length&&o(d[b]);)b++;if(b+f.length>d.length){m=d.indexOf("<",m+1);continue}let _=!0;for(let v=0;v<f.length;v++){const y=d[b+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==f[v]){_=!1;break}}if(!_){m=d.indexOf("<",m+1);continue}let g=b+f.length;if(g<d.length&&s(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&o(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let p=0;for(;p<d.length&&o(d[p]);)p++;if(p>=d.length||d[p]!=="<")return d;for(p++;p<d.length&&o(d[p]);)p++;if(p>=d.length||d[p]==="/")return d;const h=p;for(;p<d.length&&s(d[p]);)p++;if(p===h)return d;const f=d.slice(h,p).toLowerCase();if(!n.has(f))return d;const m=r(d.slice(p));if(m===-1)return d;const b=p+m;if(l(d,b+1,f))return d;const _=i(d.slice(b+1));return _?`${d.slice(0,b+1)}
|
|
202
|
-
${_}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
203
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const p=d>u&&e[d-1]==="\r",h=p?d-1:d,f=e.slice(u,h);c+=a(f),c+=p?`\r
|
|
204
|
-
`:`
|
|
205
|
-
`,u=d+1}return c}function Xz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{let h=0,f=!1,m=0;for(;h<p.length;){for(;h<p.length&&o(p[h]);)h++;if(h>=p.length||p[h]!==">")break;for(f=!0,h++;h<p.length&&o(p[h]);)h++;m=h}return f?{prefix:p.slice(0,m),content:p.slice(m)}:null},i=p=>{let h=0;for(;h<p.length&&o(p[h]);)h++;const f=p[h];if(f!=="`"&&f!=="~")return null;let m=h;for(;m<p.length&&p[m]===f;)m++;const b=m-h;return b<3?null:{markerChar:f,markerLen:b,rest:p.slice(m)}},r=Array.from(n).map(p=>new RegExp(String.raw`(<\s*\/\s*${p}\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 p=e.indexOf(`
|
|
206
|
-
`,d),h=p!==-1,f=h&&p>d&&e[p-1]==="\r",m=h?f?p-1:p:e.length,b=e.slice(d,m),_=h?f?`\r
|
|
207
|
-
`:`
|
|
208
|
-
`:"",g=s(b),v=g?.prefix??"",y=g?.content??b,A=i(y);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let O=y;if(!l&&O.includes("</"))for(const $ of r)O=O.replace($,(k,E,M,L)=>{if(L.replace(/^[\t ]+/,"").startsWith("|"))return k;const S=L.slice(0,M).replace(/^[\t ]+/,"");if(S.length>0){const I=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",P=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!P||I!==P)return k}return`${E}
|
|
209
|
-
|
|
210
|
-
`});if(v){const $=v+O.split(`
|
|
211
|
-
`).join(`
|
|
212
|
-
${v}`);u+=$}else u+=O;u+=_,d=h?p+1:e.length}return u}function Qz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let I=0;for(let P=0;P<S.length;P++){const D=S[P];if(D===" "){if(I++,I>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=S=>{const I=S.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||S==="_"||S==="-"||S===":"},r=S=>{let I=0;for(;I<S.length&&o(S[I]);)I++;return S.slice(I)},l=S=>{let I=0,P=!1,D=0;for(;I<S.length;){for(;I<S.length&&o(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(P=!0,I++;I<S.length&&o(S[I]);)I++;D=I}if(!P)return null;const W=S.slice(0,D);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:S.slice(D)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const P=S[I];if(P!==" "&&P!==" ")return!1}return!0},u=S=>{if(s(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let P=1;for(;P<I.length&&o(I[P]);)P++;if(P>=I.length||I[P]==="/"||I[P]==="!"||I[P]==="?")return"";const D=P;for(;P<I.length&&i(I[P]);)P++;if(P===D)return"";const W=I.slice(D,P).toLowerCase();if(!n.has(W))return"";const z=I[P];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":W},d=S=>{if(s(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let P=1;for(;P<I.length&&o(I[P]);)P++;if(P>=I.length)return null;const D=I[P]==="/";if(D)for(P++;P<I.length&&o(I[P]);)P++;const W=I[P];if(!W||W==="!"||W==="?")return null;const z=P;for(;P<I.length&&i(I[P]);)P++;if(P===z)return null;const q=I.slice(z,P).toLowerCase();if(!n.has(q))return null;const Q=I[P];if(Q&&Q!==" "&&Q!==" "&&Q!==">"&&Q!=="/")return null;if(D)return{type:"close",name:q};if(/\/\s*>\s*$/.test(I))return{type:"open",name:q,complete:!0};const X=I.indexOf(">",P);if(X!==-1){const fe=I.slice(X+1);if(new RegExp(`<\\s*\\/\\s*${q}\\s*>`,"i").test(fe))return{type:"open",name:q,complete:!0}}return{type:"open",name:q,complete:!1}},p=S=>{if(s(S))return null;const I=r(S).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const P=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P?.[1])return P[1].toLowerCase();const D=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const W=D[1].toLowerCase();return W===D[2].toLowerCase()?W:null};let h=!1,f="",m=0;const b=S=>{let I=0;for(;I<S.length&&o(S[I]);)I++;const P=S[I];if(P!=="`"&&P!=="~")return null;let D=I;for(;D<S.length&&S[D]===P;)D++;const W=D-I;return W<3?null:{markerChar:P,markerLen:W,rest:S.slice(D)}},_=S=>b(S),g=S=>{const I=r(S);return I?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},v=(S,I,P)=>{let D=S,W=0;for(;D<e.length;){const z=e.indexOf(`
|
|
213
|
-
`,D),q=z!==-1,Q=q&&z>D&&e[z-1]==="\r",X=q?Q?z-1:z:e.length,fe=e.slice(D,X),ye=l(fe),Me=ye?.key??"";if(W>0&&I&&Me!==I)break;const we=ye?.content??fe,ze=d(we);if(ze?.name===P){if(ze.type==="open")ze.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(c(we)||g(we)))return!0;if(q)D=z+1;else break}return!1};let y="",A=0,O=!0,$=!1,k=!1,E=`
|
|
214
|
-
`;const M=[];let L="";for(;A<e.length;){const S=e.indexOf(`
|
|
215
|
-
`,A),I=S!==-1,P=I&&S>A&&e[S-1]==="\r",D=I?P?S-1:S:e.length,W=e.slice(A,D),z=I?P?`\r
|
|
216
|
-
`:`
|
|
217
|
-
`:"",q=l(W),Q=q?.key??"",X=q?.content??W,fe=_(X);fe&&(h?fe.markerChar===f&&fe.markerLen>=m&&/^\s*$/.test(fe.rest)&&(h=!1,f="",m=0):(h=!0,f=fe.markerChar,m=fe.markerLen));const ye=M.length>0;if(!h&&!ye){const we=u(X),ze=!!we&&!O&&$&&k&&v(A,Q,we);we&&!O&&(!$||ze)&&(Q&&L&&Q===L?y+=`${Q}${E}`:Q||(y+=E))}if(y+=W,y+=z,z&&(E=z),!h){const we=d(X);if(we){if(we.type==="open")we.complete||M.push(we.name);else for(let ze=M.length-1;ze>=0;ze--)if(M[ze]===we.name){M.length=ze;break}}}const Me=c(X);O=Me,$=!Me&&a(X),k=!Me&&!!p(X),L=Q,A=I?S+1:e.length}return y}function CM(e,t,n={}){const o=kM(n),s=o?uc():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(yz(t,n)&&(t.stream.reset(),kz(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
|
|
218
|
-
`)?`
|
|
219
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
|
|
220
|
-
`)?`
|
|
221
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
|
|
222
|
-
`)?`
|
|
223
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
224
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
|
|
225
|
-
`)?`
|
|
226
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,_,g)=>`${_}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
|
|
227
|
-
`)?`
|
|
228
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
229
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const b=kc(n.customHtmlTags);if(b.length&&(r=Gz(r,b),r=Yz(r,b),r=Qz(r,b),r=Xz(r,b),r.includes("</")))for(const _ of b){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${_}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=Kz(r));const l=$z(r);if(l){const b=n.preTransformTokens,_=n.postTransformTokens;if(_M(t,n)||typeof b=="function"||typeof _=="function"){const g=m2(t,r,{__markstreamFinal:i},n),v=typeof b=="function"&&b(g)||g;typeof _=="function"&&_(v)}return Tg(l,o,s)}const a=m2(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Tg([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const p=t,h=n.validateLink??p.options?.validateLink??(typeof p.validateLink=="function"?p.validateLink:void 0),f={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=f2(d,f,o);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const _=b[0],g=_?.type;_&&typeof g=="string"?m=f2(b,void 0,o):m=b}}if(m=Vz(m,i,r),m=SM(m,r,t,n,i)[0],m=zz(m,t,n,i),i){const b=new WeakSet,_=g=>{if(!g||typeof g!="object"||b.has(g))return;if(b.add(g),Array.isArray(g)){for(const y of g)_(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))_(y)};_(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),Tg(m,o,s)}function b2(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=il(t);let s=0;for(;s<e.length;){const i=G0(e,s,o.options(),K0);if(i){n.push(i[0]),o.remember(i[0].raw),s=i[1];continue}const r=e[s];switch(r.type){case"paragraph_open":{const l=String(e[s+1]?.content??""),a=pz(e,s,o.options(l)),c=v2(a,t);c?n.push(...c):n.push(a),o.remember(a.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=bc(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=_c(e,s,o.options());n.push(l),o.remember(l.raw),s=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??"")}),o.remember(String(r.content??"")),s++;break}case"hardbreak":n.push(fz()),o.reset(),s++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),o.remember(l),s++;break}case"inline":{const l=String(r.content??""),a=jn(r.children||[],l,void 0,o.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=v2(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const Zz=new Set([...cd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),Jz=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"]),_2=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function w2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function eU(e){return typeof e=="string"?e:e==null?"":String(e)}function xM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Rr(e){return eU(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function AM(e){return Rr(e).replace(/`/g,"`")}function Th(e){return String(e??"").trim().toLowerCase()}function Z0(e,t="safe"){const n=Th(e);return n?t==="escape"?!0:t==="trusted"?cd.has(n):!Jz.has(n):!1}function TM(e,t="safe"){const n=Th(e);return n?t==="escape"?!0:t==="trusted"?cd.has(n):Zz.has(n):!1}function S2(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${AM(o)}"`).join("")}function tU(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||zl(s,{tagName:t,attrName:"srcset"})})}function MM(e,t,n,o){return BB.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?tU(t,o):!!(FB.has(e)&&t&&zl(t,{tagName:o,attrName:e}))}function Nl(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function EM(e,t,n,o=!1){if(t!=="safe"||Th(n)!=="a")return e;const s=Nl(e,"href");if(o&&(!s||!e[s])){const a=Nl(e,"target"),c=Nl(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Nl(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Nl(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 C2(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!xM(r)||MM(l,i,t,n)||(o[r]=i)}return EM(o,t,n,!!Nl(e,"href"))}function IM(e,t){const n=e.toLowerCase();return RT.has(n)?!1:w2(t,n)||w2(t,e)}function J0(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!xM(r)||MM(l,i,t,n)||(o[r]=i)}return EM(o,t,n,!!Nl(e,"href"))}function $p(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function c1(e,t="safe",n){const o=J0($p(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function nU(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function oU(e){const t={};for(const[n,o]of Object.entries(e))t[n]=nU(o,n);return t}function x2(e){return e.trim().length>0}function sU(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 o=e.indexOf("<",n);if(o===-1){if(n<e.length){const a=e.slice(n);x2(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);x2(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).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 p=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=p.exec(u))!==null;){const f=h[1],m=h[2]??h[3]??h[4]??"";f&&!f.endsWith("/")&&(d[f]=m)}}t.push({type:l||Jl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function iU(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const p=e.indexOf("-->",n);if(p!==-1){n=p+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const p=e.indexOf("]]>",o);if(p!==-1){t.push({type:"text",content:e.slice(o,p+3)}),n=p+3;continue}break}if(e.startsWith("!",o+1)){const p=e.indexOf(">",o);if(p!==-1){n=p+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const p=i.slice(1).trim();t.push({type:"tag_close",tagName:p}),n=s+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 p=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=p.exec(u))!==null;){const f=h[1],m=h[2]??h[3]??h[4]??"";f&&!f.endsWith("/")&&(d[f]=m)}}t.push({type:l||Jl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function rU(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Rr(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${Rr(o)}`:` ${Rr(o)}="${AM(s)}"`).join("");return e.type==="self_closing"?`<${Rr(t)}${n} />`:`<${Rr(t)}${n}>`}function lU(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;_2.lastIndex=0;let n;for(;(n=_2.exec(e))!==null;)if(IM(n[1],t))return!0;return!1}function ec(e,t="safe"){if(!e)return"";if(t==="escape")return Rr(e);const n=iU(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(Rr(r.content??""));continue}const l=Th(r.tagName);if(!l)continue;if(TM(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"&&Z0(l,t)){s.push(rU(r));continue}if(r.type==="self_closing"){s.push(`<${l}${S2(C2(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${S2(C2(r.attrs??{},t,l))}>`),Jl.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const aU=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],A2="http://www.w3.org/2000/svg",cU=new Set(["script","style","iframe","object","embed","link","meta"]),uU=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"]),dU=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),fU=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),pU=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function hU(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function mU(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function gU(e){const t=e.nodeName.toLowerCase();return t==="use"?hU(e):t==="image"?mU(e):t==="text"||t==="tspan"?!!e.textContent?.trim():pU.has(t)}function vU(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 yU(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?zl(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?zl(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":zl(i,{tagName:o,attrName:s})?"":i:""}function kU(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function $M(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function NM(e){const t=$M(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=kU(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function T2(e){const t=$M(e);return aU.some(n=>n.test(t))||NM(t)}function bU(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 df(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function LM(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!cU.has(o)){if(o==="br"){t.push(`
|
|
230
|
-
`);return}for(const s of Array.from(n.childNodes))LM(s,t)}}function _U(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];LM(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=df(t.getAttribute("width")),i=df(t.getAttribute("height")),r=df(t.getAttribute("x")),l=df(t.getAttribute("y")),a=e.ownerDocument.createElementNS(A2,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,p]of o.entries()){const h=e.ownerDocument.createElementNS(A2,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=p,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function wU(e){_U(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!uU.has(o)){n.remove();continue}if(o==="style"&&T2(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&T2(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(dU.has(r)&&i.value){const l=yU(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(fU.has(r)&&i.value&&NM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=vU(i.value);l!==i.value&&n.setAttribute(i.name,l)}}bU(n)}}function ihe(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 wU(n),SU(n)?null:n}catch{return null}}function SU(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){gU(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const M2=[];function Eg(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function CU(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function xU(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function E2(e=`editor-${Date.now()}`,t={}){const n=zH(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;s=h=>p[h]??o[h]??h}else s=p=>o[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const h=p;if(Array.isArray(h)){const[f,...m]=h;typeof f=="function"&&n.use(f,...m)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const p of t.apply)try{p(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(M2.length)for(const p of M2)if(Array.isArray(p)){const[h,...f]=p;typeof h=="function"&&n.use(h,...f)}else typeof p=="function"&&n.use(p);n.use(rR),n.use(cR),n.use(oR);const i=SR,r=i.default??i;n.use(r),n.use(nR),n.use(tR),n.core.ruler.after("block","mark_fence_closed",p=>{const h=p,f=h.src,m=!!h.env?.__markstreamFinal,b=f.split(/\r?\n/);for(const _ of h.tokens){if(_.type!=="fence"||!_.map||!_.markup)continue;const g=_.map[0],v=_.map[1],y=_.markup,A=y[0],O=y.length,$=b[Math.max(0,v-1)]??"";let k=0;for(;k<$.length&&($[k]===" "||$[k]===" ");)k++;let E=0;for(;k+E<$.length&&$[k+E]===A;)E++;let M=k+E;for(;M<$.length&&($[M]===" "||$[M]===" ");)M++;const L=m?!0:v>g+1&&E>=O&&M===$.length,S=_;S.meta=S.meta??{},S.meta.unclosed=!L,S.meta.closed=!!L}});const l=(p,h)=>{const f=p,m=f.pos;if(f.src[m]!=="~")return!1;const b=f.src[m-1],_=f.src[m+1];if(/\d/.test(b)&&/\d/.test(_)){if(!h){const g=f.push("text","",0);g.content="~"}return f.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(p,h)=>{const f=p[h],m=String(f.info??"").trim(),b=String(f.content??""),_=btoa(unescape(encodeURIComponent(b))),g=CU(m),v=Eg(g),y=xU(`editor-${e}-${h}-${g}`),A=Eg(s("common.copy"));return`<div class="code-block" data-code="${_}" data-lang="${v}" id="${y}">
|
|
231
|
-
<div class="code-header">
|
|
232
|
-
<span class="code-lang">${Eg(g.toUpperCase())}</span>
|
|
233
|
-
<button class="copy-button" data-code="${_}">${A}</button>
|
|
234
|
-
</div>
|
|
235
|
-
<div class="code-editor"></div>
|
|
236
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=p=>{if(!p.startsWith("["))return!1;const h=c.exec(p);if(!h)return p!=="["&&!/^\[\d+$/.test(p);const f=String(h[1]??"");return p.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(p,h)=>{const f=p;if(f.src[f.pos]!=="[")return!1;const m=a.exec(f.src.slice(f.pos));if(!m)return!1;const b=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const _=f.src.slice(f.pos+m[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))return!1;if(!h){const g=m[1],v=f.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return f.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(p,h)=>{const m=String(p[h].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function AU({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 OM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:AU({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const I2=new WeakMap;function TU(e){let t=I2.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},I2.set(e,t)),t}function $2(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function ey(e){return!!(e.themes?.length||e.langs?.length)}function PM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function MU(e,t){return!t?.length||e.registeredAllLangs?!0:PM(e.registeredLangs,t)}function Ig(e,t){return ey(t)&&PM(e.registeredThemes,t.themes)&&MU(e,t.langs)}function EU(e,t){if(!ey(t))return t;const n=$2(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:$2(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const IU={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function $U(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function RM(e){const t=$U(e);return IU[t]??t}function DM(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>RM(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function BM(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function NU(e){return BM(e)?.join("\0")??""}function FM(e,t){const n=BM(e),o=DM(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function Np(e,t){return`${NU(e)}\0\0${DM(t)?.join("\0")??""}`}function rhe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=FM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:Np(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function lhe(e,t={},n){if(!e)return"ready";const o=FM(t.themes,t.langs),s=Np(o.themes,o.langs),i=n&&n===s?n:s,r=TU(e);if(r.completed.has(i))return"ready";if(Ig(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||Ig(r,o))return r.completed.add(i),"ready";const c=EU(r,o),u=Np(c.themes,c.langs);return r.completed.has(u)||Ig(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(ey(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function _a(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function N2(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var LU=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 p=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const f=L2();this.startedAt=p&&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=L2();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 p=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<p){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,m=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=DU(f/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=RU(this.source.slice(this.visible.length),_,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=_a(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,_a(o,1e3,1)),this.normalizedTargetLatencyMs=_a(s,900,1),this.normalizedCatchUpLatencyMs=_a(i,350,1),this.normalizedCatchUpThreshold=N2(r,600),this.normalizedStartDelayMs=N2(a,80),this.maxCommitFps=Math.trunc(_a(l,30,1)),this.maxCharsPerCommit=Math.trunc(_a(c,80,1)),this.flushOnFinish=u,this.segmenter=PU(),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 OU(e={},t){const n=new LU(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 PU(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function RU(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function L2(){return typeof performance<"u"?performance.now():Date.now()}function DU(e,t,n){return Math.min(n,Math.max(t,e))}var BU=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const u1=Symbol.for("markstream-vue:node-lifecycle"),O2='<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>',P2='<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>',FU={id:"material",core:{"":P2,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:P2,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:O2,csharp:O2,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:()=>Qo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},d1=new Map;let R2="material";const Fa=new Map,D2=new Map;let f1=null;function HU(e){d1.set(e.id,e)}function WU(e){return BU(this,null,function*(){var t,n,o;if(Fa.has(e.id))return(t=Fa.get(e.id))!=null?t:null;let s=D2.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Fa.set(e.id,i),f1?.(),i)).catch(()=>(Fa.set(e.id,null),null)),D2.set(e.id,s)),s})}const zU=Ql(0);f1=()=>{zU.value++},HU(FU);const UU={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function ty(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=UU[n])!=null?t:n}function ahe(e){const t=ty(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function che(e){return(function(o){const s=d1.get(R2);if(!s)return;const i=s.core[o];if(i)return i;const r=Fa.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!Fa.has(s.id)&&WU(s)})(ty(e))||((n=(t=d1.get(R2))==null?void 0:t.fallback)!=null?n:"");var t,n}const uhe={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let HM=!1;function dhe(){return HM}function fhe(){HM=!0}var Mh=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let As=null,Nf=!1,Eh=oy;function Ih(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function ny(){try{const e=globalThis;return Ih(e?.katex)}catch{return null}}function oy(){return Mh(null,null,function*(){const e=ny();if(e)return e;const t=yield Qo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Qo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Ih(t)})}function qU(e){Eh=e,As=null,Nf=!1}function jU(e){qU(oy)}function WM(){return typeof Eh=="function"}function phe(){var e;const t=Eh;if(!t||t===oy)return null;if(As)return As;const n=ny();if(n)return As=n,As;try{const o=t();return o&&typeof o?.then!="function"?(As=(e=Ih(o))!=null?e:o,As):null}catch{return null}}function sy(){return Mh(this,null,function*(){var e;const t=ny();if(t)return As=t,As;if(As)return As;if(Nf)return null;const n=Eh;if(!n)return Nf=!0,null;try{const o=yield n();if(o)return As=(e=Ih(o))!=null?e:o,As}catch{}return Nf=!0,null})}function zM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Fr=null,$r=null;const Ys=new Map,Zi=new Map;let Lp=5;const Rl=new Set;function Gu(){if(Ys.size<Lp&&Rl.size){const e=Array.from(Rl);Rl.clear();for(const t of e)try{t()}catch{}}}function VU(e){Fr=e,$r=null,Fr.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=Ys.get(n);if(i)if(Ys.delete(n),clearTimeout(i.timeoutId),Gu(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Zi.set(a,o),Zi.size>200){const c=Zi.keys().next().value;Zi.delete(c)}}i.resolve(o)}},Fr.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of Ys.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));Ys.clear(),Gu()}}function KU(){var e;Fr&&((e=Fr.terminate)==null||e.call(Fr)),Fr=null,$r=null}function GU(e,t=!0,n=2e3,o){return Mh(this,null,function*(){performance.now();const s=zM(e);if(!WM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if($r)return Promise.reject($r);const i=`${t?"d":"i"}:${s}`,r=Zi.get(i);if(r)return Promise.resolve(r);const l=Fr||($r=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$r.name="WorkerInitError",$r.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject($r);if(Ys.size>=Lp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Ys.size,a.max=Lp,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const f=new Error("Aborted");return f.name="AbortError",void c(f)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{Ys.delete(u);const f=new Error("Worker render timed out");f.name="WorkerTimeout",f.code="WORKER_TIMEOUT",c(f),Gu()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),Ys.has(u)&&Ys.delete(u);const f=new Error("Aborted");f.name="AbortError",c(f),Gu()},{once:!0});const p=a,h=c;Ys.set(u,{resolve:f=>{p(f)},reject:f=>{h(f)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function hhe(e,t=!0,n){const o=`${t?"d":"i"}:${zM(e)}`;if(Zi.set(o,n),Zi.size>200){const s=Zi.keys().next().value;Zi.delete(s)}}const YU="WORKER_BUSY";function XU(e=2e3,t){return Ys.size<Lp?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),Rl.delete(r),n())};if(Rl.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,Rl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>Gu()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),Rl.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Kc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function mhe(e){return Mh(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!WM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:Kc.timeout,c=(i=o.waitTimeout)!=null?i:Kc.waitTimeout,u=(r=o.backoffMs)!=null?r:Kc.backoffMs,d=(l=o.maxRetries)!=null?l:Kc.maxRetries,p=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Kc.maxRetries,h=o.signal;let f=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield GU(t,n,a,h)}catch(m){if(m?.code!==YU||f>=p)throw m;if(f++,yield XU(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*f)))}}})}function Ha(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function QU(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function p1(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=QU(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function h1(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 UM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function m1(e,t=360,n=500){return UM(e,t,n)}function g1(e,t=360,n=500){return UM(e,t,n)}var ZU=Object.defineProperty,JU=Object.defineProperties,eq=Object.getOwnPropertyDescriptors,B2=Object.getOwnPropertySymbols,tq=Object.prototype.hasOwnProperty,nq=Object.prototype.propertyIsEnumerable,F2=(e,t,n)=>t in e?ZU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qM=(e,t)=>{for(var n in t||(t={}))tq.call(t,n)&&F2(e,n,t[n]);if(B2)for(var n of B2(t))nq.call(t,n)&&F2(e,n,t[n]);return e},iy=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const ry=()=>Qo(()=>import("./mermaid.core-CmwZMEVS.js").then(e=>e.bn),[]);let zi=null,ly=ry;function oq(e){ly=e,zi=null}function sq(e){oq(ry)}function iq(){return typeof ly=="function"}function H2(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=qM({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},JU(n,eq(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function W2(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=qM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function ghe(){return iy(this,null,function*(){if(zi)return zi;const e=(function(){try{const o=globalThis;return H2(o?.mermaid)}catch{return null}})();if(e)return zi=e,W2(zi),zi;const t=ly;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===ry?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(zi=H2(n),W2(zi),zi):null})}let Yo=null,Nr=null;const Mo=new Map;let z2=5,U2=!1;const rq="WORKER_BUSY",lq="MERMAID_DISABLED";function aq(e){Yo=e,Nr=null;const t=e;Yo.onmessage=n=>{if(Yo!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Mo.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Yo.onerror=n=>{var o,s;if(Yo===t)if(Mo.size!==0){try{U2?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Mo.entries())r.reject(new Error(`Worker error: ${n.message}`));Mo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Yo.onmessageerror=n=>{var o,s;if(Yo===t)if(Mo.size!==0){try{U2?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Mo.entries())r.reject(new Error("Worker messageerror"));Mo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function cq(){var e;if(Yo)try{for(const[t,n]of Mo.entries())n.reject(new Error("Worker cleared"));Mo.clear(),(e=Yo.terminate)==null||e.call(Yo)}catch{}Yo=null,Nr=null}function jM(e,t,n=1400){if(!iq()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=lq,Promise.reject(s)}if(Nr)return Promise.reject(Nr);const o=Yo||(Nr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Nr.name="WorkerInitError",Nr.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Nr);if(Mo.size>=z2){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=rq,s.inFlight=Mo.size,s.max=z2,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Mo.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};Mo.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return Mo.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const p=Mo.get(r);p&&p.reject(d)},n)})}function vhe(e,t,n=1400){return iy(this,null,function*(){try{return yield jM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function yhe(e,t,n=1400){return iy(this,null,function*(){try{return yield jM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function khe(){if(Yo)try{for(const[e,t]of Mo.entries())t.reject(new Error("Worker terminated"));Mo.clear(),Yo.terminate()}finally{Yo=null}}var uq=Object.defineProperty,dq=Object.defineProperties,fq=Object.getOwnPropertyDescriptors,q2=Object.getOwnPropertySymbols,pq=Object.prototype.hasOwnProperty,hq=Object.prototype.propertyIsEnumerable,j2=(e,t,n)=>t in e?uq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))pq.call(t,n)&&j2(e,n,t[n]);if(q2)for(var n of q2(t))hq.call(t,n)&&j2(e,n,t[n]);return e},Lt=(e,t)=>dq(e,fq(t)),zn=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const mq="__global__",$g="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",v1=(()=>{const e=globalThis;if(e[$g])return e[$g];const t={scopedCustomComponents:{},revision:Ql(0)};return e[$g]=t,t})(),V2=v1.revision,gq=Symbol("markstreamCustomComponents"),vq=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 fd(e){return vq.has(String(e).trim().toLowerCase())}function yq(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Ng(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([oi(n),oi(yq(n))]))!s||fd(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function co(e){const t=Ut(gq,null);return F(()=>{var n;return V2.value,(function(o,s={}){return V2.value,it(it(it({},Ng(v1.scopedCustomComponents[mq]||{})),Ng(s)),Ng((function(i){return i&&v1.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const kq=["aria-label"],bq={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"},_q={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"},un=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Is=un(je({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),N("svg",_q,[...n[1]||(n[1]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),T("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),N("svg",bq,[...n[0]||(n[0]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,kq))}),[["__scopeId","data-v-be21ab83"]]);Is.install=e=>{e.component(Is.__name,Is)};const wq={class:"emoji-node"},hs=un(je({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",wq,R(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);hs.install=e=>{e.component(hs.__name,hs)};const Sq=["id"],Cq=["title"],$s=un(je({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(w(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[T("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+R(e.node.id)+"]",9,Cq)],8,Sq))}}),[["__scopeId","data-v-c1463a29"]]);$s.install=e=>{e.component($s.__name,$s)};const VM=(()=>{try{return!1}catch{}return!1})();function Lg(e){VM&&console.warn(e)}function K2(e,t="safe",n){return J0(e,t,n)}function KM(e){return oU(e)}function Og(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function ay(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=c1((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),Og(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Og(r.value)]):Object.entries(s).map(([r,l])=>[r,Og(l)]):null,t,n);var s;if(!o)return;const i=KM($p(o));return Object.keys(i).length>0?i:void 0}function G2(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function Gc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Pg(e,t,n,o,s,i,r=!1){const l=(function(d,p){return IM(d,p)})(e,o);if(cd.has(e.toLowerCase())||!l&&TM(e,i))return null;if(!l&&Z0(e,i))return r?[G2(e,t,!0)]:[G2(e,t),...n,`</${e}>`];const a=J0(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],p=KM(a);return cn(d,Lt(it({},p),{key:u}),n.length>0?n:void 0)}return cn(e,Lt(it({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function GM(e,t){return lU(e,t)}function Op(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 p=Pg(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Gc(c.length>0?c[c.length-1].children:u,p)}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 p=d.tagName.toLowerCase();let h=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===p){h=f;break}if(h!==-1)for(;c.length>h;){const f=c.pop(),m=Pg(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?Gc(c[c.length-1].children,m):Gc(u,m),f.tagName.toLowerCase()!==p&&c.length>h&&Lg(`Auto-closing unclosed tag: <${f.tagName}>`)}else Lg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),p=Pg(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Gc(c[c.length-1].children,p):Gc(u,p),Lg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(sU(e),t,n)}catch(s){return o=s,VM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const xq=["innerHTML"],Ns=un(je({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),o=F(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=co(()=>t.customId),i=je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=F(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:ec(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Op(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!GM(l,s.value))return{mode:"html",content:ec(l,o.value)};const a=Op(l,s.value,o.value);return a===null?{mode:"html",content:ec(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),N("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[se(x(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),N("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},R(r.value.content),3)):(w(),N("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,xq))}}),[["__scopeId","data-v-d17f12b0"]]);Ns.install=e=>{e.component(Ns.__name,Ns)};const Aq={class:"inline-code"},Tq={key:0},qo=un(je({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=od(),o=Ut("markstreamFade",void 0),s=Ut("markstreamTextStreamState",void 0),i=Ut("markstreamStreamVersion",void 0),r=F(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=F(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=F(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=F(()=>!l.value),u=F(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Z(t.node.code),p=Z("");let h=i?.value;const f=Z(0);function m(){return d.value+p.value}function b(){p.value&&(d.value=m(),p.value="")}Ke([()=>t.node.code,u,l,()=>i?.value],([g,v,y,A])=>{const O=String(g??""),$=u.value,k=A!==h;h=A;const E=OM({nextContent:O,persistedContent:$?s?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:p.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=E.settledContent,p.value=E.streamedDelta,E.appended&&(f.value+=1),$&&s?.set($,O)},{immediate:!0}),Ke(l,g=>{var v;g||(v=m(),d.value=v,p.value="")});const _=F(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(w(),N("code",Aq,[c.value?(w(),N(Le,{key:0},[qe(R(a.value),1)],64)):(w(),N(Le,{key:1},[d.value?(w(),N("span",Tq,R(d.value),1)):ie("",!0),p.value?(w(),N("span",{key:1,class:Re(["inline-code-stream-delta",[_.value]]),onAnimationend:b},R(p.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);qo.install=e=>{e.component(qo.__name,qo)};const y1=Z(!1),Y2=Z(""),X2=Z("top"),ku=Z(null),bu=Z(null),k1=Z(null),b1=Z(null),Q2=Z(null);let Lf=null,Of=null,_1=0;function YM(){Lf&&(clearTimeout(Lf),Lf=null),Of&&(clearTimeout(Of),Of=null)}let ff=!1,pf=null,Z2=!1;function Mq(e,t,n="top",o=!1,s,i){if(!e)return;const r=++_1;YM();const l=()=>zn(null,null,function*(){var a,c;if(yield(function(){return zn(this,null,function*(){if(!ff&&!Z2&&typeof document<"u"){pf!=null||(pf=zn(null,null,function*(){const[{createApp:u,h:d},{default:p}]=yield Promise.all([Qo(()=>import("./vue.runtime.esm-bundler-BJW6XsQa.js"),[]),Qo(()=>import("./Tooltip-sFOhW5c-.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var f;return d(p,{visible:y1.value,"anchor-el":ku.value,content:Y2.value,placement:X2.value,id:bu.value,originX:k1.value,originY:b1.value,isDark:(f=Q2.value)!=null?f:void 0})}}).mount(h),ff=!0}));try{yield pf}catch(u){ff=!1,pf=null,Z2=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),ff&&r===_1){bu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,ku.value=e,Y2.value=t,X2.value=n,k1.value=(a=s?.x)!=null?a:null,b1.value=(c=s?.y)!=null?c:null,Q2.value=typeof i=="boolean"?i:null,y1.value=!0;try{e.setAttribute("aria-describedby",bu.value)}catch{}}});o?l():Lf=setTimeout(l,80)}function Eq(e=!1){_1+=1,YM();const t=()=>{if(ku.value&&bu.value)try{ku.value.removeAttribute("aria-describedby")}catch{}y1.value=!1,ku.value=null,bu.value=null,k1.value=null,b1.value=null};e?t():Of=setTimeout(t,120)}const w1={"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..."},S1=e=>{var t;return(t=w1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function J2(e){return{t(t){if(e.te&&w1[t]&&!e.te(t))return S1(t);const n=e.t(t);return n===t&&w1[t]?S1(t):n}}}function Iq(){const e=(function(){var t,n;try{const o=Oo(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.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 J2(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return J2({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:S1}}function $q(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const Nq=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Lq={key:1,class:"image-placeholder"},Oq={key:1,class:"image-node__raw-text"},Pq={key:0,class:"image-shimmer-overlay"},Rq={key:1,class:"image-node__raw-text"},Dq={key:2,class:"image-error"},qr=un(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,o=t,s=Z(!1),i=Z(!1),r=Z(""),l=Z("primary"),a=Z(null),c=od(),u=Ut(u1,null);let d="",p=null;const h=F(()=>Lw(n.node.src)),f=F(()=>Lw(n.fallbackSrc)),m=F(()=>r.value),b=F(()=>!n.lazy),_=F(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=F(()=>l.value==="failed"),v=F(()=>!b.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=F(()=>$q(n,c));function A(P=y.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function O(P=y.value){P&&ht(()=>{A(P)})}function $(){p&&(clearTimeout(p),p=null)}function k(){const P=y.value;P&&d!==P&&(d&&u?.markSettled(d),$(),d=P,u?.markPending(P),typeof window<"u"&&(p=window.setTimeout(()=>{d===P&&(O(P),E())},8e3)))}function E(){return zn(this,null,function*(){const P=d;P&&($(),d="",yield ht(),A(P),u?.markSettled(P))})}function M(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,s.value=!1,i.value=!1,void O();l.value="failed",i.value=!0,o("error",r.value),O()}function L(){s.value=!0,i.value=!1,o("load",m.value),O()}function S(P){P.preventDefault(),s.value&&!i.value&&o("click",[P,m.value])}const{t:I}=Iq();return Ke([h,f,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.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}),Ke([_,s,i,m,()=>n.lazy],([P,D,W,z,q])=>P&&z&&!W?D?(E(),void O()):q?(k(),void O()):void(D||W||k()):(E(),void O()),{flush:"post",immediate:!0}),lo(()=>{(function(){const P=d;P&&($(),d="",u?.markSettled(P))})()}),(P,D)=>{var W,z,q,Q,X;return w(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(w(),N("img",{key:0,src:m.value,alt:String((z=(W=n.node.alt)!=null?W:n.node.title)!=null?z:""),title:String((Q=(q=n.node.title)!=null?q:n.node.alt)!=null?Q:""),class:Re(["image-node__img",{"is-loading":!b.value&&!s.value,"is-loaded":b.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(X=n.node.alt)!=null?X:x(I)("image.preview"),onError:M,onLoad:L,onClick:S},null,42,Nq)):ie("",!0),e.node.loading&&!i.value?(w(),N("span",Lq,[n.usePlaceholder?Cn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Oq,R(e.node.raw),1))])):ie("",!0),se(Gr,{name:"shimmer-fade"},{default:_e(()=>[v.value&&!e.node.loading?(w(),N("span",Pq,[n.usePlaceholder?Cn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Rq,R(e.node.raw),1))])):ie("",!0)]),_:3}),g.value?(w(),N("span",Dq,[Cn(P.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=T("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[T("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)),T("span",null,R(x(I)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);qr.install=e=>{e.component(qr.__name,qr)};const Bq={key:2},Ni=je({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=co(()=>t.customId),o=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamNestedRendererProps",void 0),i=F(()=>{var f;return(f=o?.value)!=null?f:"safe"}),r=F(()=>{var f,m;const b=(f=s?.value)!=null?f:{};return Lt(it({},b),{customId:(m=t.customId)!=null?m:b.customId,htmlPolicy:i.value})}),l=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1}),a=F(()=>t.components[String(t.node.type)]),c=F(()=>!!(a.value&&n.value[t.node.type]&&!fd(String(t.node.type)))),u=F(()=>c.value?ay(t.node,i.value):void 0),d=F(()=>Array.isArray(t.node.children)&&t.node.children.length>0),p=F(()=>{var f;return String((f=t.node.content)!=null?f:"")}),h=F(()=>{var f,m;return String((m=(f=t.node.content)!=null?f:t.node.raw)!=null?m:"")});return(f,m)=>a.value&&c.value?(w(),ve(Wo(a.value),dn({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:_e(()=>[d.value?(w(),ve(x(l),dn({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"])):p.value?(w(),ve(x(l),dn({key:1},r.value,{content:p.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"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),ve(Wo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),N("span",Bq,R(h.value),1)):ie("",!0)}}),Fq=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Hq={key:0,translate:"no",class:"markstream-pre__diff-code"},Wq={class:"markstream-pre__diff-number","aria-hidden":"true"},zq={class:"markstream-pre__diff-content"},Uq={class:"markstream-pre__diff-content-inner"},qq={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},jq=["textContent"],xs=je({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=F(()=>{var S,I,P;const D=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((P=String(D).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=F(()=>`language-${n.value}`),s=F(()=>{var S,I,P,D,W;return((S=t.node)==null?void 0:S.diff)===!0?String((P=(I=t.node)==null?void 0:I.code)!=null?P:""):(function(z,q){const Q=String(z??"");return q?Q:Q.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((W=t.node)==null?void 0:W.loading)===!0)}),i=F(()=>s.value.split(/\r\n|\n|\r/)),r=F(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=F(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=F(()=>l.value&&t.diffInline===!0),c=F(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",P={}){const D=u(S);return{code:S,kind:D&&I!=="hunk"&&!P.preserveBlankKind?"context":I,empty:D}}function p(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function f(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,I){const P=p(S),D=p(I),W=(function(ye,Me){const we=ye.length,ze=Me.length;if((we+1)*(ze+1)>15e5)return null;const Ue=ze+1,Fe=new Uint32Array((we+1)*(ze+1));for(let G=1;G<=we;G++)for(let ne=1;ne<=ze;ne++){const H=G*Ue+ne;if(ye[G-1]===Me[ne-1])Fe[H]=Fe[(G-1)*Ue+(ne-1)]+1;else{const J=Fe[(G-1)*Ue+ne],ce=Fe[G*Ue+(ne-1)];Fe[H]=J>=ce?J:ce}}const rt=[];let le=we,U=ze;for(;le>0&&U>0;)ye[le-1]===Me[U-1]?(rt.push({originalIndex:le-1,modifiedIndex:U-1}),le--,U--):Fe[(le-1)*Ue+U]>=Fe[le*Ue+(U-1)]?le--:U--;return rt.reverse(),rt})(P,D);if(W){const ye=[];let Me=0,we=0;for(const ze of W){for(;Me<ze.originalIndex;)ye.push(Lt(it({},d(P[Me],"removed",{preserveBlankKind:h(P,Me)})),{key:`inline-removed-source-${Me}`,number:""})),Me++;for(;we<ze.modifiedIndex;)ye.push(Lt(it({},d(D[we],"added",{preserveBlankKind:h(D,we)})),{key:`inline-added-source-${we}`,number:we+1})),we++;ye.push(Lt(it({},d(D[ze.modifiedIndex])),{key:`inline-context-source-${ze.originalIndex}-${ze.modifiedIndex}`,number:ze.modifiedIndex+1})),Me=ze.originalIndex+1,we=ze.modifiedIndex+1}for(;Me<P.length;)ye.push(Lt(it({},d(P[Me],"removed",{preserveBlankKind:h(P,Me)})),{key:`inline-removed-source-${Me}`,number:""})),Me++;for(;we<D.length;)ye.push(Lt(it({},d(D[we],"added",{preserveBlankKind:h(D,we)})),{key:`inline-added-source-${we}`,number:we+1})),we++;return ye}const z=[];let q=0,Q=P.length-1,X=D.length-1;for(;q<=Q&&q<=X&&P[q]===D[q];)z.push(Lt(it({},d(D[q])),{key:`inline-prefix-${q}`,number:q+1})),q++;const fe=[];for(;Q>=q&&X>=q&&P[Q]===D[X];)fe.unshift(Lt(it({},d(D[X])),{key:`inline-suffix-${X}`,number:X+1})),Q--,X--;for(let ye=q;ye<=Q;ye++)z.push(Lt(it({},d(P[ye],"removed",{preserveBlankKind:h(P,ye)})),{key:`inline-removed-source-${ye}`,number:""}));for(let ye=q;ye<=X;ye++)z.push(Lt(it({},d(D[ye],"added",{preserveBlankKind:h(D,ye)})),{key:`inline-added-source-${ye}`,number:ye+1}));return z.concat(fe)}const _=F(()=>{var S,I,P,D;const W=(function(X){const fe=X.some(Me=>f(Me)),ye=X.some(Me=>m(Me));return fe&&ye||(function(){var Me,we,ze,Ue;if(n.value==="diff")return!0;const Fe=(Ue=(ze=String((we=(Me=t.node)==null?void 0:Me.raw)!=null?we:"").split(/\r?\n/,1)[0])==null?void 0:ze.trim())!=null?Ue:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Fe)})()&&(fe||ye)})(i.value),z=(function(){var X,fe;return((X=t.node)==null?void 0:X.originalCode)!=null||((fe=t.node)==null?void 0:fe.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:W?(function(X){const fe=[];let ye=1;for(const[Me,we]of X.entries())if(we.startsWith("@@"))fe.push(Lt(it({},d(we,"hunk")),{key:`inline-hunk-${Me}`,number:""}));else if(f(we))fe.push(Lt(it({},d(we.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Me}`,number:""}));else if(m(we))fe.push(Lt(it({},d(we.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${Me}`,number:ye++}));else{const ze=we.startsWith(" ")?we.slice(1):we;fe.push(Lt(it({},d(ze)),{key:`inline-context-${Me}`,number:ye})),ye++}return fe})(i.value):b((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!W&&z){const X=p((P=t.node)==null?void 0:P.originalCode),fe=p((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:X.map((ye,Me)=>{const we=fe[Me]===ye?"context":"removed";return Lt(it({},d(ye,we,{preserveBlankKind:h(X,Me)})),{key:`original-${Me}`,number:Me+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:fe.map((ye,Me)=>{const we=X[Me]===ye?"context":"added";return Lt(it({},d(ye,we,{preserveBlankKind:h(fe,Me)})),{key:`modified-${Me}`,number:Me+1})})}]}const q=[],Q=[];for(const X of i.value)if(X.startsWith("@@"))q.push(d(X,"hunk")),Q.push(d(X,"hunk"));else if(X.startsWith("-")&&!X.startsWith("---"))q.push(d(X.slice(1),"removed",{preserveBlankKind:!0}));else if(X.startsWith("+")&&!X.startsWith("+++"))Q.push(d(X.slice(1),"added",{preserveBlankKind:!0}));else{const fe=X.startsWith(" ")?X.slice(1):X;q.push(d(fe)),Q.push(d(fe))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:q.map((X,fe)=>Lt(it({},X),{key:`original-${fe}`,number:fe+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((X,fe)=>Lt(it({},X),{key:`modified-${fe}`,number:fe+1}))}]}),g=F(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Z(null),y=Z([]);let A=null,O=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function k(S,I){var P;if(!S)return I;const D=S.querySelector(".markstream-pre__diff-content"),W=D?.getBoundingClientRect(),z=(P=W?.height)!=null?P:0;return Math.max(I,Math.ceil(z))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,I;A=null;const P=v.value;if(!P||!l.value)return void(y.value.length&&(y.value=[]));const D=(function(ye){const Me=window.getComputedStyle(ye),we=$(Me.getPropertyValue("--markstream-pre-diff-line-height"));if(we>0)return we;const ze=$(Me.lineHeight);return ze>0?ze:18})(P),W=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),q=Math.max(W.length,z.length),Q=[];for(let ye=0;ye<q;ye++){const Me=k((S=W[ye])!=null?S:null,D),we=k((I=z[ye])!=null?I:null,D),ze=Math.max(D,Me,we);Q.push({rowHeight:ze,originalHeight:Me,modifiedHeight:we})}var X,fe;X=y.value,fe=Q,X.length===fe.length&&X.every((ye,Me)=>{const we=fe[Me];return we&&Math.abs(ye.rowHeight-we.rowHeight)<=.5&&Math.abs(ye.originalHeight-we.originalHeight)<=.5&&Math.abs(ye.modifiedHeight-we.modifiedHeight)<=.5})||(y.value=Q)})()}))}function M(S){O?.disconnect(),O=null,S&&l.value&&typeof ResizeObserver<"u"&&(O=new ResizeObserver(()=>{E()}),O.observe(S))}function L(S,I){const P=y.value[S];if(!P)return;const D=I==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Ke(v,S=>{M(S),ht(()=>E())},{flush:"post"}),Ke([l,_],()=>{M(v.value),ht(()=>E())},{flush:"post",immediate:!0}),lo(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),O?.disconnect(),O=null}),(S,I)=>(w(),N("pre",{ref_key:"preRef",ref:v,style:Gt(c.value),class:Re([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),N("code",Hq,[(w(!0),N(Le,null,nt(_.value,P=>(w(),N("span",{key:P.key,class:Re(["markstream-pre__diff-pane",P.className])},[(w(!0),N(Le,null,nt(P.lines,(D,W)=>(w(),N("span",{key:D.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Gt(L(W,P.key))},[I[0]||(I[0]=T("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),T("span",Wq,R(D.number),1),T("span",zq,[T("span",Uq,R(D.code),1)])],6))),128))],2))),128))])):(w(),N(Le,{key:1},[t.showLineNumbers?(w(),N("span",qq,[(w(!0),N(Le,null,nt(r.value,P=>(w(),N("span",{key:P,class:"markstream-pre__line-number"},R(P),1))),128))])):ie("",!0),T("code",{translate:"no",class:"markstream-pre__code",textContent:R(s.value)},null,8,jq)],64))],14,Fq))}});xs.install=e=>{e.component(xs.__name,xs)};const Rg=Ql(!1);let eS=null;const Vq={key:0},Xn=un(je({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(eS||(eS=sy().then(_=>{Rg.value=!!_}).catch(()=>{Rg.value=!1})),Vf(Rg)),o=od(),s=Ut("markstreamFade",void 0),i=Ut("markstreamTextStreamState",void 0),r=Ut("markstreamStreamVersion",void 0),l=F(()=>{const _=o.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=F(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=F(()=>{var _;const g=(_=o["index-key"])!=null?_:o.indexKey;return g==null||g===""?"":String(g)}),u=Z(t.node.content),d=Z("");let p=r?.value;const h=Z(0);function f(){return u.value+d.value}function m(){d.value&&(u.value=f(),d.value="")}Ke([()=>t.node.content,c,a,()=>r?.value],([_,g,v,y])=>{const A=String(_??""),O=c.value,$=y!==p;p=y;const k=OM({nextContent:A,persistedContent:O?i?.get(O):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(h.value+=1),O&&i?.set(O,A)},{immediate:!0}),Ke(a,_=>{var g;_||(g=f(),u.value=g,d.value="")});const b=F(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,g)=>(w(),N("span",{class:Re([[x(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),N("span",Vq,R(u.value),1)):ie("",!0),d.value?(w(),N("span",{key:1,class:Re(["text-node-stream-delta",[b.value]]),onAnimationend:m},R(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Xn.install=e=>{e.component(Xn.__name,Xn)};const XM=je({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return cn(xs,Lt(it({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Dg=ui({loader:()=>zn(null,null,function*(){try{return(yield Qo(()=>import("./CodeBlockNode--K4eRmNh.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),xs}}),loadingComponent:XM,delay:0,suspensible:!1}),gi=ui(()=>zn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,i;return cn(Xn,Lt(it({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{if(yield sy())return(yield Qo(()=>import("./index6-DeBB3wcO.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return cn(Xn,Lt(it({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),QM=ui(()=>zn(null,null,function*(){try{if(yield sy())return(yield Qo(()=>import("./index5-DCmdgd-c.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return cn(Xn,Lt(it({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),Jo=un(je({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},R(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Jo.install=e=>{e.component(Jo.__name,Jo)};const Kq={class:"superscript-node"},ms=un(je({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=co(()=>t.customId),o=F(()=>it({text:Xn,inline_code:qo,link:ns,html_inline:Ns,strong:es,emphasis:os,footnote_reference:$s,strikethrough:ts,highlight:Ls,insert:vs,subscript:gs,emoji:hs,math_inline:gi,reference:Jo},n.value));return(s,i)=>(w(),N("sup",Kq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);ms.install=e=>{e.component(ms.__name,ms)};const Gq={class:"subscript-node"},gs=un(je({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=co(()=>t.customId),o=F(()=>it({text:Xn,inline_code:qo,link:ns,html_inline:Ns,strong:es,emphasis:os,footnote_reference:$s,strikethrough:ts,highlight:Ls,insert:vs,superscript:ms,emoji:hs,math_inline:gi,reference:Jo},n.value));return(s,i)=>(w(),N("sub",Gq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);gs.install=e=>{e.component(gs.__name,gs)};const Yq={class:"strong-node"},es=un(je({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=co(()=>t.customId),o=F(()=>it({text:Xn,inline_code:qo,link:ns,html_inline:Ns,emphasis:os,strikethrough:ts,highlight:Ls,insert:vs,subscript:gs,superscript:ms,emoji:hs,footnote_reference:$s,math_inline:gi,reference:Jo},n.value));return(s,i)=>(w(),N("strong",Yq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);es.install=e=>{e.component(es.__name,es)};const Xq={class:"strikethrough-node"},ts=un(je({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=co(()=>t.customId),o=F(()=>it({text:Xn,inline_code:qo,link:ns,html_inline:Ns,strong:es,emphasis:os,highlight:Ls,insert:vs,subscript:gs,superscript:ms,emoji:hs,footnote_reference:$s,math_inline:gi,reference:Jo},n.value));return(s,i)=>(w(),N("del",Xq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);ts.install=e=>{e.component(ts.__name,ts)};const Qq=["href","title","aria-label","aria-hidden","target","rel"],Zq=["aria-hidden"],Jq={class:"link-text-wrapper relative inline-flex"},ej={class:"leading-[normal] link-text"},ns=un(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=Ut("markstreamShowTooltips",void 0),o=F(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),s=F(()=>{var _,g,v,y,A;const O=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(_=t.animationOpacity)!=null?_:.35,k=Math.max(.12,Math.min(.5*$,$)),E={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":O,"--underline-opacity":String($),"--underline-rest-opacity":String(k),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=co(()=>t.customId),r=F(()=>it({text:Xn,strong:es,strikethrough:ts,emphasis:os,image:qr,html_inline:Ns,inline_code:qo},i.value)),l=od(),a=F(()=>{var _,g;const v=(_=t.node)==null?void 0:_.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(y[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,O]of Object.entries(v))A&&O!=null&&O!==!1&&(y[A]=O===!0?"":String(O));return K2(y,"safe","a")}),c=F(()=>it(it({},l),a.value)),u=F(()=>{var _,g;return K2({href:String((g=(_=t.node)==null?void 0:_.href)!=null?g:"")},"safe","a").href}),d=F(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(qB(u.value)?"_blank":void 0)}),p=F(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),h=F(()=>{if(!u.value)return;const _=c.value.rel,g=new Set((typeof _=="string"?_:String(_??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return p.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),f=F(()=>{const _=it({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function m(){o.value&&Eq()}const b=F(()=>{var _,g;const v=(_=t.node)==null?void 0:_.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(_,g)=>{var v,y;return e.node.loading?(w(),N("span",dn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},x(l),{style:s.value}),[T("span",Jq,[T("span",ej,[se(x(Xn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=T("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Zq)):(w(),N("a",dn({key:0,class:"link-node",href:u.value,title:o.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},f.value,{style:s.value,onMouseenter:g[0]||(g[0]=A=>(function(O){var $,k,E,M;if(!o.value)return;const L=O,S=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,I=(($=t.node)==null?void 0:$.title)||((k=u.value)!=null&&k.includes("xn--")&&((M=(E=t.node)==null?void 0:E.text)!=null&&M.includes("://"))?t.node.text:u.value)||"";Mq(O.currentTarget,I,"top",!1,S)})(A)),onMouseleave:m}),[(w(!0),N(Le,null,nt(e.node.children,(A,O)=>(w(),ve(x(Ni),{key:`${e.indexKey||"emphasis"}-${O}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${O}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Qq))}}}),[["__scopeId","data-v-367e6ca4"]]);ns.install=e=>{e.component(ns.__name,ns)};const tj={class:"insert-node"},vs=un(je({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=co(()=>t.customId),o=F(()=>it({text:Xn,inline_code:qo,link:ns,html_inline:Ns,strong:es,emphasis:os,strikethrough:ts,highlight:Ls,subscript:gs,superscript:ms,emoji:hs,footnote_reference:$s,math_inline:gi,reference:Jo},n.value));return(s,i)=>(w(),N("ins",tj,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);vs.install=e=>{e.component(vs.__name,vs)};const nj={class:"highlight-node"},Ls=un(je({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=co(()=>t.customId),o=F(()=>it({text:Xn,inline_code:qo,link:ns,html_inline:Ns,strong:es,emphasis:os,strikethrough:ts,insert:vs,subscript:gs,superscript:ms,emoji:hs,footnote_reference:$s,math_inline:gi,reference:Jo},n.value));return(s,i)=>(w(),N("mark",nj,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Ls.install=e=>{e.component(Ls.__name,Ls)};const oj={class:"emphasis-node"},os=un(je({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=co(()=>t.customId),o=F(()=>it({text:Xn,inline_code:qo,link:ns,html_inline:Ns,strong:es,strikethrough:ts,highlight:Ls,insert:vs,subscript:gs,superscript:ms,emoji:hs,footnote_reference:$s,math_inline:gi,reference:Jo},n.value));return(s,i)=>(w(),N("em",oj,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);os.install=e=>{e.component(os.__name,os)};const sj={class:"hard-break"},jr=un(je({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("br",sj))}),[["__scopeId","data-v-50c58f70"]]);jr.install=e=>{e.component(jr.__name,jr)};const Yu=je({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Dr({checkbox:Is,checkbox_input:Is,emoji:hs,emphasis:os,hardbreak:jr,highlight:Ls,inline_code:qo,insert:vs,link:ns,reference:Jo,strikethrough:ts,strong:es,subscript:gs,superscript:ms,text:Xn}),o=co(()=>t.customId),s=F(()=>{const i=o.value;return Object.keys(i).length>0?it(it({},n),i):n});return(i,r)=>(w(!0),N(Le,null,nt(e.nodes,(l,a)=>(w(),ve(x(Ni),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function C1(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(C1)}function Pp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(C1))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(C1)?s:null}function dc(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const ij=["cite"],rj={key:0,dir:"auto",class:"paragraph-node"},lj=["custom-id"],Pf=un(je({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=co(()=>t.customId),o=F(()=>!!n.value.paragraph),s=F(()=>!!n.value.text),i=F(()=>Pp(t.node.children,!o.value)),r=F(()=>t.fade!==!1||s.value?null:dc(i.value));return En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade)),(l,a)=>(w(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),N("p",rj,[r.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(r.value),9,lj)):(w(),ve(x(Yu),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),ve(x(ys),{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,ij))}}),[["__scopeId","data-v-abfecebc"]]);Pf.install=e=>{e.component(Pf.__name,Pf)};const aj={class:"definition-list"},cj={class:"definition-term"},uj={class:"definition-desc"},Rf=un(je({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),N("dl",aj,[(w(!0),N(Le,null,nt(t.node.items,(s,i)=>(w(),N(Le,{key:i},[T("dt",cj,[se(x(ys),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),T("dd",uj,[se(x(ys),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Rf.install=e=>{e.component(Rf.__name,Rf)};const dj=["href","title"],_u=un(je({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(w(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,dj))}}),[["__scopeId","data-v-e1eb37b6"]]);_u.install=e=>{e.component(_u.__name,_u)};const fj=["id"],pj={class:"flex-1"},Df=je({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[T("div",pj,[se(x(ys),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,fj))}});Df.install=e=>{e.component(Df.__name,Df)};const hj=["custom-id"],x1=un(je({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=co(()=>t.customId),o=Ut("markstreamFade",void 0),s=F(()=>o?.value!==!1||n.value.text?null:dc(t.node.children)),i=F(()=>it({text:Xn,inline_code:qo,link:ns,image:qr,strong:es,emphasis:os,strikethrough:ts,highlight:Ls,insert:vs,subscript:gs,superscript:ms,emoji:hs,checkbox:Is,checkbox_input:Is,footnote_reference:$s,hardbreak:jr,math_inline:gi,reference:Jo},n.value));return(r,l)=>(w(),ve(Wo(`h${e.node.level}`),dn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:_e(()=>[s.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(s.value),9,hj)):(w(!0),N(Le,{key:1},nt(e.node.children,(a,c)=>(w(),ve(x(Ni),{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"]]),Rp=x1;Rp.install=e=>{e.component(x1.__name,x1)};const mj={key:0,dir:"auto",class:"paragraph-node"},gj=["custom-id"],vj={dir:"auto",class:"paragraph-node"},yj=["custom-id"],tc=un(je({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=F(()=>{var h;return(h=t.node)!=null?h:t.item}),o=co(()=>t.customId),s=F(()=>!!o.value.paragraph),i=F(()=>!!o.value.text),r=F(()=>{var h;return Pp((h=n.value)==null?void 0:h.children,!s.value)}),l=F(()=>{var h;if(s.value)return null;const f=(h=n.value)==null?void 0:h.children;if(!Array.isArray(f)||f.length<2)return null;const m=f[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const b=f.slice(1);if(!b.every(g=>g?.type==="list"))return null;const _=Pp([m]);return _?{paragraphChildren:_,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=F(()=>a()?dc(r.value):null),u=F(()=>{var h;return a()?dc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),p=F(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade)),(h,f)=>{var m,b;return w(),N("li",dn({class:"list-item",dir:"auto"},p.value),[r.value?(w(),N("p",mj,[c.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(c.value),9,gj)):(w(),ve(x(Yu),{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?(w(),N(Le,{key:1},[T("p",vj,[u.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(u.value),9,yj)):(w(),ve(x(Yu),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),N(Le,null,nt(l.value.nestedLists,(_,g)=>(w(),ve(x(ys),{key:g,nodes:[_],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:f[0]||(f[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),ve(x(ys),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(m=n.value)==null?void 0:m.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:f[1]||(f[1]=_=>h.$emit("copy",_))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);tc.install=e=>{e.component(tc.__name,tc)};const nc=un(je({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=co(()=>e.customId),n=F(()=>t.value.list_item||tc);return(o,s)=>(w(),ve(Wo(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:_e(()=>[(w(!0),N(Le,null,nt(e.node.items,(i,r)=>{var l;return w(),ve(Wo(n.value),dn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);nc.install=e=>{e.component(nc.__name,nc)};const ZM=Symbol("ViewportPriority");function kj(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Z(t):t,r=s?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let p=null;function h(){if(p!=null){try{l?.(p)}catch{}p=null}}function f(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),f()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&p==null&&d.size&&(p=r(()=>{p=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&b())},{timeout:1200}))}Ke(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const _=(g,v)=>{const y=Z(!1);let A,O=!1;const $=new Promise(M=>{A=()=>{O||(O=!0,M())}}),k=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),f()};if(!s||!i.value)return y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:k};const E=(function(M,L){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,W){var z,q,Q;return{root:(z=e?.(D??null))!=null?z:null,rootMargin:(q=W?.rootMargin)!=null?q:"300px",threshold:(Q=W?.threshold)!=null?Q:0}})(M,L);if(a&&(P=S,(I=c)&&I.root===P.root&&I.rootMargin===P.rootMargin&&I.threshold===P.threshold))return a;var I,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const W of D)(W.isIntersecting||W.intersectionRatio>0)&&m(W.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(g,v);return E?(u.set(g,{resolve:A,visible:y}),E.observe(g),d.add(g),b(),{isVisible:y,whenVisible:$,destroy:k}):(y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:k})};return En(ZM,_),_}function bj(){var e,t;const n=Ut(ZM,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:p=>window.setTimeout(()=>p({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:p=>window.clearTimeout(p):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=p=>{const h=o.get(p);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{s?.unobserve(p)}catch{}o.delete(p),i.delete(p),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const p=i.values().next().value;p&&(i.delete(p),u(p),i.size&&d())},{timeout:1200}))};return p=>{const h=Z(!1);let f,m=!1;const b=new Promise(v=>{f=()=>{m||(m=!0,v())}}),_=()=>{try{s?.unobserve(p)}catch{}o.delete(p),i.delete(p),i.size||c()},g=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),s));return g?(o.set(p,{resolve:f,visible:h}),g.observe(p),i.add(p),d(),{isVisible:h,whenVisible:b,destroy:_}):(h.value=!0,f(),{isVisible:h,whenVisible:b,destroy:_})}}const _j={key:2,class:"html-block-node__raw"},wj=["innerHTML"],Sj={key:1,class:"html-block-node__placeholder"},wu=un(je({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamNestedRendererProps",void 0),s=F(()=>{var O,$;return($=(O=t.htmlPolicy)!=null?O:n?.value)!=null?$:"safe"}),i=F(()=>{var O,$;const k=(O=o?.value)!=null?O:{};return Lt(it({},k),{customId:($=t.customId)!=null?$:k.customId,htmlPolicy:s.value})}),r=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1}),l=F(()=>{const O=c1(t.node.attrs,s.value);if(!O)return;const $=$p(O);return Object.keys($).length>0?$:void 0}),a=F(()=>{const O=String(t.node.tag||"").trim(),$=c1(t.node.attrs,s.value,O);if(!$)return;const k=$p($);return Object.keys(k).length>0?k:void 0}),c=co(()=>t.customId),u=je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),p=Z(typeof window>"u"),h=Z(t.node.content),f=F(()=>Array.isArray(t.node.children)?t.node.children:[]),m=F(()=>String(t.node.tag||"div")),b=F(()=>{const O=m.value.trim().toLowerCase();return DT.has(O)||Z0(O,s.value)}),_=F(()=>f.value.length>0&&!!t.node.tag&&!b.value),g=F(()=>{var O,$,k;if(_.value)return{mode:"structured"};if(!p.value)return{mode:"html",content:(O=h.value)!=null?O:""};const E=($=h.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:ec(E,s.value)};if(t.node.loading){const L=Op(E,c.value,s.value);return L===null?{mode:"text",content:(k=t.node.raw)!=null?k:E}:{mode:"dynamic",nodes:L}}if(!GM(E,c.value))return{mode:"html",content:ec(E,s.value)};const M=Op(E,c.value,s.value);return M===null?{mode:"html",content:ec(E,s.value)}:{mode:"dynamic",nodes:M}}),v=bj(),y=Z(null),A=!!t.node.loading;return typeof window<"u"?(Ke(d,O=>{var $,k;if((k=($=y.value)==null?void 0:$.destroy)==null||k.call($),y.value=null,!A)return p.value=!0,void(h.value=t.node.content);if(!O)return void(p.value=!1);const E=v(O,{rootMargin:"400px"});y.value=E,p.value=E.isVisible.value,E.whenVisible.then(()=>{p.value=!0})},{immediate:!0}),Ke(()=>t.node.content,O=>{A&&!p.value||(h.value=O)})):p.value=!0,lo(()=>{var O,$;($=(O=y.value)==null?void 0:O.destroy)==null||$.call(O),y.value=null}),(O,$)=>(w(),ve(Wo(_.value?m.value:"div"),dn({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:_e(()=>[p.value?(w(),N(Le,{key:0},[g.value.mode==="structured"?(w(),ve(x(r),dn({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(w(),ve(x(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(w(),N("pre",_j,R(g.value.content),1)):(w(),N("div",dn({key:3},l.value,{innerHTML:g.value.content}),null,16,wj))],64)):(w(),N("div",Sj,[Cn(O.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=T("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=T("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=T("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);wu.install=e=>{e.component(wu.__name,wu)};const Cj={dir:"auto",class:"paragraph-node"},xj=["custom-id"],ql=un(je({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=co(()=>t.customId),o=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamFade",void 0),i=Ut("markstreamParseOptions",void 0),r=Ut("markstreamCustomMarkdownIt",void 0),l=Ut("markstreamNestedRendererProps",void 0),a=F(()=>{var k;return(k=o?.value)!=null?k:"safe"}),c=F(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=F(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=F(()=>{var k,E;return(E=t.customHtmlTags)!=null?E:(k=l?.value)==null?void 0:k.customHtmlTags}),p=F(()=>{var k,E;const M=(k=l?.value)!=null?k:{};return Lt(it({},M),{customId:(E=t.customId)!=null?E:M.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1});function f(k){var E;return k.type==="text"&&String((E=k.content)!=null?E:"").trim()===""}const m=F(()=>t.node.children.filter(k=>!f(k))),b=F(()=>m.value.length>0&&m.value.every(k=>k.type==="image"||(function(E){var M;const L=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!f(I)):[]})(E);return L.length===1&&((M=L[0])==null?void 0:M.type)==="image"})(k))),_=F(()=>new Set(kc(d.value))),g=F(()=>{if(!b.value||m.value.length<=1)return t.node.children;const k=[];for(let E=0;E<t.node.children.length;E++){const M=t.node.children[E];if(!f(M)){k.push(M);continue}const L=k.length>0,S=t.node.children.slice(E+1).some(I=>!f(I));L&&S&&k.push(Lt(it({},M),{content:" ",raw:" "}))}return k}),v=F(()=>s?.value===!1&&!n.value.text),y=F(()=>v.value?dc(g.value):null);function A(k,E){return{node:k,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const O=F(()=>it({inline_code:qo,image:qr,link:ns,hardbreak:jr,emphasis:os,strong:es,strikethrough:ts,highlight:Ls,insert:vs,subscript:gs,superscript:ms,html_inline:Ns,html_block:wu,emoji:hs,checkbox:Is,math_inline:gi,checkbox_input:Is,reference:Jo,footnote_anchor:_u,footnote_reference:$s,text:Xn},n.value)),$=F(()=>g.value.map((k,E)=>{var M;const L=(function(S){var I,P,D,W;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||WT(S.content);if(z&&!_.value.has(z)&&zT((P=S.content)!=null?P:S.raw,z)){const q=String((W=(D=S.content)!=null?D:S.raw)!=null?W:"");return{child:{type:"text",content:q,raw:q},component:Xn,isCustomComponent:!1}}}return{child:S,component:O.value[S.type],isCustomComponent:!!(n.value[S.type]&&!fd(String(S.type)))}})(k);return Lt(it({},L),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:L.isCustomComponent?ay(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String((M=L.child.content)!=null?M:""),originalChild:k})}));return(k,E)=>(w(),N("p",Cj,[y.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(y.value),9,xj)):(w(!0),N(Le,{key:1},nt($.value,M=>{return w(),N(Le,{key:M.key},[b.value&&f(M.originalChild)?(w(),N(Le,{key:0},[qe(R((L=M.originalChild,String((S=L.content)!=null?S:""))),1)],64)):M.isCustomComponent?(w(),ve(Wo(M.component),dn({key:1,ref_for:!0},M.customAttrs,{node:M.child,loading:M.child.loading,"index-key":M.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":p.value.isDark}),{default:_e(()=>[M.hasSlotChildren?(w(),ve(x(h),dn({key:0,ref_for:!0},p.value,{nodes:M.child.children,"index-key":M.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):M.slotContent?(w(),ve(x(h),dn({key:1,ref_for:!0},p.value,{content:M.slotContent,final:!M.child.loading,"index-key":`${M.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),ve(Wo(M.component),dn({key:2,ref_for:!0},A(M.child,M.index)),null,16))],64);var L,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);ql.install=e=>{e.component(ql.__name,ql)};const Aj={class:"table-node-wrapper"},Tj=["aria-busy"],Mj={key:0},Ej=["custom-id"],Ij=["aria-label","onPointerdown"],$j=["custom-id"],Nj={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Su=un(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=F(()=>{var _;return(_=t.node.loading)!=null&&_}),o=F(()=>{var _;return(_=t.node.rows)!=null?_:[]}),s=Z(null),i=Z([]);let r=null;const l=F(()=>t.node.header.cells.length),a=F(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=F(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade));const u=co(()=>t.customId),d=F(()=>!!u.value.text),p=F(()=>!!u.value.paragraph),h=new WeakMap;function f(_){const g=t.fade===!1&&!d.value,v=!p.value,y=h.get(_);if(y?.children===_.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const A=Pp(_.children,v,!0),O={simpleChildren:A,plainText:A&&g?dc(A):null};return h.set(_,{children:_.children,textFastPath:g,paragraphFastPath:v,info:O}),O}function m(_){if(!r)return;_.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+_.clientX-r.startX))),A=[...r.widths];A[r.index]=y,A[r.index+1]=g-y,i.value=A}function b(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Ke(l,()=>{b(),i.value=[]}),lo(b),(_,g)=>(w(),N("div",Aj,[T("table",{ref_key:"tableRef",ref:s,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),N("colgroup",Mj,[(w(!0),N(Le,null,nt(e.node.header.cells,(v,y)=>(w(),N("col",{key:y,style:Gt(c.value[y])},null,4))),128))])):ie("",!0),T("thead",null,[T("tr",null,[(w(!0),N(Le,null,nt(e.node.header.cells,(v,y)=>(w(),N("th",{key:y,dir:"auto",class:Re([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[f(v).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(f(v).plainText),9,Ej)):f(v).simpleChildren?(w(),ve(x(Yu),{key:1,nodes:f(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(w(),ve(x(ys),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>_.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(w(),N("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:A=>(function(O,$){if($.button!==0)return;const k=(function(){var L;const S=(L=s.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),E=k[O],M=k[O+1];E&&M&&($.preventDefault(),r={index:O,startX:$.clientX,startWidth:E,nextStartWidth:M,widths:k},i.value=k,window.addEventListener("pointermove",m),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(y,A)},null,40,Ij)):ie("",!0)],2))),128))])]),T("tbody",null,[(w(!0),N(Le,null,nt(o.value,(v,y)=>(w(),N("tr",{key:y},[(w(!0),N(Le,null,nt(v.cells,(A,O)=>(w(),N("td",{key:O,class:Re([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(A).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(f(A).plainText),9,$j)):f(A).simpleChildren?(w(),ve(x(Yu),{key:1,nodes:f(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${O}`},null,8,["nodes","custom-id","index-key"])):(w(),ve(x(ys),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=$=>_.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Tj),se(Gr,{name:"table-node-fade"},{default:_e(()=>[n.value?(w(),N("div",Nj,[Cn(_.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=T("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=T("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Su.install=e=>{e.component(Su.__name,Su)};const Lj={class:"hr-node"},Bf=un({},[["render",function(e,t){return w(),N("hr",Lj)}],["__scopeId","data-v-39b2349c"]]);Bf.install=e=>{e.component(Bf.__name,Bf)};const Oj={class:"unknown-node"},A1=je({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),N("div",Oj,R(e.node.raw),1))}),Ff=un(je({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=F(()=>`vmr-container vmr-container-${t.node.name}`),o=co(()=>t.customId),s=F(()=>it({text:Xn,paragraph:ql,heading:Rp,inline_code:qo,link:ns,image:qr,strong:es,emphasis:os,strikethrough:ts,insert:vs,subscript:gs,superscript:ms,checkbox:Is,checkbox_input:Is,hardbreak:jr,math_inline:gi,reference:Jo,list:nc,math_block:QM,table:Su},o.value));return(i,r)=>(w(),N("div",dn({class:n.value},e.node.attrs),[(w(!0),N(Le,null,nt(e.node.children,(l,a)=>{return w(),ve(Wo((c=l.type,s.value[c]||A1)),{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"]]);Ff.install=e=>{e.component(Ff.__name,Ff)};const Pj=["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"],tS=[[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 Rj(e){if(e<=255)return Pj[e];let t=0,n=tS.length-1;for(;t<=n;){const o=t+n>>1,s=tS[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const Dj=/[ \t\n\r\f]+/g,Bj=/[\t\n\r\f]| {2,}|^ | $/;let Bg=null;const Fj=new RegExp("\\p{Script=Arabic}","u"),$h=new RegExp("\\p{M}","u"),JM=new RegExp("\\p{Nd}","u");function nS(e){return Fj.test(e)}function oS(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 er(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(oS(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(oS(n))return!0}}return!1}const Hj=new Set([" "," ","","\uFEFF"]);function Wj(e){return er(e)}function T1(e){return!(function(t){const n=Dp(t);return n!==null&&(cy.has(n)||Kl.has(n))})(e)&&!(function(t){const n=Dp(t);return n!==null&&Hj.has(n)})(e)}const cy=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Nh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),uy=new Set(["'","’"]),Kl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),zj=new Set([":",".","،","؛"]),Uj=new Set(["၏"]),qj=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function jj(e){if(dy(e))return!0;let t=!1;for(const n of e)if(Kl.has(n))t=!0;else if(!t||!$h.test(n))return!1;return t}function Vj(e){for(const t of e)if(!cy.has(t)&&!Kl.has(t))return!1;return e.length>0}function Kj(e){if(dy(e))return!0;for(const t of e)if(!Nh.has(t)&&!uy.has(t)&&!$h.test(t))return!1;return e.length>0}function dy(e){let t=!1;for(const n of e)if(n!=="\\"&&!$h.test(n)){if(!(Nh.has(n)||Kl.has(n)||uy.has(n)))return!1;t=!0}return t}function e3(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Dp(e){if(e.length===0)return null;const t=e3(e,e.length);return e.slice(t)}function Gj(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if($h.test(o))n--;else{if(!Nh.has(o)&&!uy.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Yj(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function sS(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function iS(e,t){return e&&t!==null&&zj.has(t)}function Xj(e){const t=Dp(e);return t!==null&&Uj.has(t)}function Qj(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 M1(e){let t=e.length;for(;t>0;){const n=e3(e,t),o=e.slice(n,t);if(qj.has(o))return!0;if(!Kl.has(o))return!1;t=n}return!1}function Zj(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
237
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const Jj=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Vs(e){return e.length===1?e[0]:e.join("")}function eV(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Vs(n)}function tV(e,t,n,o){if(!Jj.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Zj(u,o),p=d==="text"&&t;i===null||d!==i||p!==a?(i!==null&&s.push({text:Vs(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=p,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Vs(r),isWordLike:a,kind:i,start:l}),s}function Fg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const nV=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function oV(e,t){const n=e.texts[t];return!!n.startsWith("www.")||nV.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function sV(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const iV=new Set([":","-","/","×",",",".","+","–","—"]),rS=/^[A-Za-z0-9_]+[,:;]*$/,lS=/[,:;]+$/;function aS(e){for(const t of e)if(JM.test(t))return!0;return!1}function Hf(e){if(e.length===0)return!1;for(const t of e)if(!JM.test(t)&&!iV.has(t))return!1;return!0}function cS(e,t,n){var o,s,i;const r=(Bg===null&&(Bg=new Intl.Segmenter(void 0,{granularity:"word"})),Bg);let l=0;const a=[],c=[],u=[],d=[],p=[],h=[],f=[],m=[],b=[],_=[],g=[],v=[];for(const k of r.segment(e))for(const E of tV(k.segment,(o=k.isWordLike)!=null&&o,k.index,n)){let M=function(){h[q]!==null&&(c[q]=[sS(a,h,f,q)],h[q]=null),c[q].push(E.text),u[q]=u[q]||E.isWordLike,m[q]=m[q]||I,b[q]=b[q]||P,_[q]=W,g[q]=z,v[q]=iS(b[q],D)};const L=E.kind==="text",S=Yj(E.text,E.isWordLike,E.kind),I=er(E.text),P=nS(E.text),D=Dp(E.text),W=M1(E.text),z=Xj(E.text),q=l-1;t.carryCJKAfterClosingQuote&&L&&l>0&&d[q]==="text"&&I&&m[q]&&_[q]||L&&l>0&&d[q]==="text"&&Vj(E.text)&&m[q]||L&&l>0&&d[q]==="text"&&g[q]?M():L&&l>0&&d[q]==="text"&&E.isWordLike&&P&&v[q]?(M(),u[q]=!0):S!==null&&l>0&&d[q]==="text"&&h[q]===S?f[q]=((s=f[q])!=null?s:1)+1:L&&!E.isWordLike&&l>0&&d[q]==="text"&&(jj(E.text)||E.text==="-"&&u[q])?M():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,p[l]=E.start,h[l]=S,f[l]=S===null?0:1,m[l]=I,b[l]=P,_[l]=W,g[l]=z,v[l]=iS(P,D),l++)}for(let k=0;k<l;k++)h[k]===null?a[k]=Vs(c[k]):a[k]=sS(a,h,f,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&dy(a[k])&&d[k-1]==="text"&&(a[k-1]+=a[k],u[k-1]=u[k-1]||u[k],a[k]="");const y=Array.from({length:l},()=>null);let A=-1;for(let k=l-1;k>=0;k--){const E=a[k];if(E.length!==0){if(d[k]==="text"&&!u[k]&&Kj(E)&&A>=0&&d[A]==="text"){const M=(i=y[A])!=null?i:[];M.push(E),y[A]=M,p[A]=p[k],a[k]="";continue}A=k}}for(let k=0;k<l;k++){const E=y[k];E!=null&&(a[k]=eV(E,a[k]))}let O=0;for(let k=0;k<l;k++){const E=a[k];E.length!==0&&(O!==k&&(a[O]=E,u[O]=u[k],d[O]=d[k],p[O]=p[k]),O++)}a.length=O,u.length=O,d.length=O,p.length=O;const $=(function(k){const E=k.texts.slice(),M=k.isWordLike.slice(),L=k.kinds.slice(),S=k.starts.slice();for(let I=0;I<E.length-1;I++){if(L[I]!=="text"||L[I+1]!=="text"||!er(E[I])||!er(E[I+1]))continue;const P=Gj(E[I]);P!==null&&(E[I]=P.head,E[I+1]=P.tail+E[I+1],S[I+1]=S[I]+P.head.length)}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I],D=k.kinds[I],W=k.isWordLike[I];if(D==="text"&&W&&rS.test(P)){const z=[P];let q=lS.test(P),Q=I+1;for(;q&&Q<k.len&&k.kinds[Q]==="text"&&k.isWordLike[Q]&&rS.test(k.texts[Q]);){const X=k.texts[Q];z.push(X),q=lS.test(X),Q++}E.push(Vs(z)),M.push(!0),L.push("text"),S.push(k.starts[I]),I=Q-1;continue}E.push(P),M.push(W),L.push(D),S.push(k.starts[I])}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I];if(k.kinds[I]==="text"&&P.includes("-")){const D=P.split("-");let W=D.length>1;for(let z=0;z<D.length;z++){const q=D[z];if(!W)break;q.length!==0&&aS(q)&&Hf(q)||(W=!1)}if(W){let z=0;for(let q=0;q<D.length;q++){const Q=D[q],X=q<D.length-1?`${Q}-`:Q;E.push(X),M.push(!0),L.push("text"),S.push(k.starts[I]+z),z+=X.length}continue}}E.push(P),M.push(k.isWordLike[I]),L.push(k.kinds[I]),S.push(k.starts[I])}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I],D=k.kinds[I];if(D==="text"&&Hf(P)&&aS(P)){const W=[P];let z=I+1;for(;z<k.len&&k.kinds[z]==="text"&&Hf(k.texts[z]);)W.push(k.texts[z]),z++;E.push(Vs(W)),M.push(!0),L.push("text"),S.push(k.starts[I]),I=z-1;continue}E.push(P),M.push(k.isWordLike[I]),L.push(D),S.push(k.starts[I])}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I];if(E.push(P),M.push(k.isWordLike[I]),L.push(k.kinds[I]),S.push(k.starts[I]),!sV(P))continue;const D=I+1;if(D>=k.len||Fg(k.kinds[D]))continue;const W=[],z=k.starts[D];let q=D;for(;q<k.len&&!Fg(k.kinds[q]);)W.push(k.texts[q]),q++;W.length>0&&(E.push(Vs(W)),M.push(!0),L.push("text"),S.push(z),I=q-1)}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=k.texts.slice(),M=k.isWordLike.slice(),L=k.kinds.slice(),S=k.starts.slice();for(let P=0;P<k.len;P++){if(L[P]!=="text"||!oV(k,P))continue;const D=[E[P]];let W=P+1;for(;W<k.len&&!Fg(L[W]);){D.push(E[W]),M[P]=!0;const z=E[W].includes("?");if(L[W]="text",E[W]="",W++,z)break}E[P]=Vs(D)}let I=0;for(let P=0;P<E.length;P++){const D=E[P];D.length!==0&&(I!==P&&(E[I]=D,M[I]=M[P],L[I]=L[P],S[I]=S[P]),I++)}return E.length=I,M.length=I,L.length=I,S.length=I,{len:I,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];let I=0;for(;I<k.len;){const P=[k.texts[I]];let D=k.isWordLike[I],W=k.kinds[I],z=k.starts[I];if(W==="glue"){const q=[P[0]],Q=z;for(I++;I<k.len&&k.kinds[I]==="glue";)q.push(k.texts[I]),I++;const X=Vs(q);if(!(I<k.len&&k.kinds[I]==="text")){E.push(X),M.push(!1),L.push("glue"),S.push(Q);continue}P[0]=X,P.push(k.texts[I]),D=k.isWordLike[I],W="text",z=Q,I++}else I++;if(W==="text")for(;I<k.len&&k.kinds[I]==="glue";){const q=[];for(;I<k.len&&k.kinds[I]==="glue";)q.push(k.texts[I]),I++;const Q=Vs(q);I<k.len&&k.kinds[I]==="text"?(P.push(Q,k.texts[I]),D=D||k.isWordLike[I],I++):P.push(Q)}E.push(Vs(P)),M.push(D),L.push(W),S.push(z)}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})({len:O,texts:a,isWordLike:u,kinds:d,starts:p})))))));for(let k=0;k<$.len-1;k++){const E=Qj($.texts[k]);E!==null&&($.kinds[k]!=="space"&&$.kinds[k]!=="preserved-space"||$.kinds[k+1]!=="text"||!nS($.texts[k+1])||($.texts[k]=E.space,$.isWordLike[k]=!1,$.kinds[k]=$.kinds[k]==="preserved-space"?"preserved-space":"space",$.texts[k+1]=E.marks+$.texts[k+1],$.starts[k+1]=$.starts[k]+E.space.length))}return $}function rV(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let wa=null;const uS=new Map;let Sa=null;const lV=new RegExp("\\p{Emoji_Presentation}","u"),aV=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Hg=null;const dS=new Map;function E1(){if(wa!==null)return wa;if(typeof OffscreenCanvas<"u")return wa=new OffscreenCanvas(1,1).getContext("2d"),wa;if(typeof document<"u")return wa=document.createElement("canvas").getContext("2d"),wa;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Cr(e,t){let n=t.get(e);return n===void 0&&(n={width:E1().measureText(e).width,containsCJK:er(e)},t.set(e,n)),n}function Lh(){if(Sa!==null)return Sa;if(typeof navigator>"u")return Sa={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Sa;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 Sa={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Sa}function t3(){return Hg===null&&(Hg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Hg}function cV(e){return lV.test(e)||e.includes("️")}function Tl(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=t3();for(const a of l.segment(i))cV(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function uV(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 dV(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function fS(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+Lh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,p=-1,h=0;function f(y=u,A=d,O=a){l++,a=0,c=!1,p=-1,h=0}function m(y,A){c=!0,u=y+1,d=0,a=A}function b(y,A,O){c=!0,u=y,d=A+1,a=O}function _(y,A){c?(a+=A,u=y+1,d=0):m(y,A)}function g(y,A){const O=i[y];for(let $=A;$<O.length;$++){const k=O[$];c?a+k>r?(f(),b(y,$,k)):(a+=k,u=y,d=$+1):b(y,$,k)}c&&u===y&&d===O.length&&(u=y+1,d=0)}let v=0;for(;v<o.length&&(c||(v=uV(e,v),!(v>=o.length)));){const y=o[v],A=s[v],O=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+y>r){if(O){_(v,y),f(v+1,0,a-y),v++;continue}if(p>=0){if(u>p||u===p&&d>0){f();continue}f(p,0,h);continue}if(y>t&&i[v]!==null){f(),g(v,0),v++;continue}f()}else _(v,y),O&&(p=v+1,h=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),O&&(p=v+1,h=a-y),v++}return c&&f(),l}let Wg=null;function fV(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,p,h){o=[d],s=p,i=h,r=M1(d),l=Nh.has(d)}function u(d,p){o.push(d),i=i||p;const h=M1(d);r=d.length===1&&Kl.has(d)&&r||h,l=!1}for(const d of(Wg===null&&(Wg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Wg).segment(e)){const p=d.segment,h=er(p);o.length!==0?l||cy.has(p)||Kl.has(p)||t.carryCJKAfterClosingQuote&&h&&r?u(p,h):i||h?(a(),c(p,d.index,h)):u(p,h):c(p,d.index,h)}return a(),n}function pV(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=er(e[0].text),i=T1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;l<e.length;l++){const a=e[l],c=er(a.text),u=T1(a.text);s&&i?(n.push(a.text),s=s||c,i=u):(r(),n=[a.text],o=a.start,s=c,i=u)}return r(),t}function hV(e,t,n,o){const s=Lh(),{cache:i,emojiCorrection:r}=(function($,k){E1().font=$;const E=(function(S){let I=uS.get(S);return I||(I=new Map,uS.set(S,I)),I})($),M=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})($),L=k?(function(S,I){let P=dS.get(S);if(P!==void 0)return P;const D=E1();D.font=S;const W=D.measureText("😀").width;if(P=0,W>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const q=z.getBoundingClientRect().width;document.body.removeChild(z),W-q>.5&&(P=W-q)}return dS.set(S,P),P})($,M):0;return{cache:E,fontSize:M,emojiCorrection:L}})(t,(l=e.normalized,aV.test(l)));var l;const a=Tl("-",Cr("-",i),r),c=8*Tl(" ",Cr(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],p=[],h=[];let f=e.chunks.length<=1;const m=null,b=[],_=n?[]:null,g=Array.from({length:e.len});function v($,k,E,M,L,S,I){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(f=!1),u.push(k),d.push(E),p.push(M),h.push(L),b.push(I),_!==null&&_.push($)}function y($,k,E,M,L){const S=Cr($,i),I=Tl($,S,r),P=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:I,D=k==="space"||k==="zero-width-break"?0:I;if(L&&M&&$.length>1){let W="sum-graphemes";Hf($)?W="pair-context":s.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const z=(function(q,Q,X,fe,ye){if(Q.breakableFitAdvances!==void 0)return Q.breakableFitAdvances;const Me=t3(),we=[];for(const rt of Me.segment(q))we.push(rt.segment);if(we.length<=1)return Q.breakableFitAdvances=null,Q.breakableFitAdvances;if(ye==="sum-graphemes"){const rt=[];for(const le of we){const U=Cr(le,X);rt.push(Tl(le,U,fe))}return Q.breakableFitAdvances=rt,Q.breakableFitAdvances}if(ye==="pair-context"||we.length>96){const rt=[];let le=null,U=0;for(const G of we){const ne=Tl(G,Cr(G,X),fe);if(le===null)rt.push(ne);else{const H=le+G,J=Cr(H,X);rt.push(Tl(H,J,fe)-U)}le=G,U=ne}return Q.breakableFitAdvances=rt,Q.breakableFitAdvances}const ze=[];let Ue="",Fe=0;for(const rt of we){Ue+=rt;const le=Tl(Ue,Cr(Ue,X),fe);ze.push(le-Fe),Fe=le}return Q.breakableFitAdvances=ze,Q.breakableFitAdvances})($,S,i,r,W);return void v($,I,P,D,k,E,z)}v($,I,P,D,k,E,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const k=e.texts[$],E=e.isWordLike[$],M=e.kinds[$],L=e.starts[$];if(M==="soft-hyphen"){v(k,0,a,a,M,L,null);continue}if(M==="hard-break"){v(k,0,0,0,M,L,null);continue}if(M==="tab"){v(k,0,0,0,M,L,null);continue}const S=Cr(k,i);if(M==="text"&&S.containsCJK){const I=fV(k,s),P=o==="keep-all"?pV(I):I;for(let D=0;D<P.length;D++){const W=P[D];y(W.text,"text",L+W.start,E,o==="keep-all"||!er(W.text))}continue}y(k,M,L,E,!0)}const A=(function($,k,E){const M=[];for(let L=0;L<$.length;L++){const S=$[L],I=S.startSegmentIndex<k.length?k[S.startSegmentIndex]:E,P=S.endSegmentIndex<k.length?k[S.endSegmentIndex]:E,D=S.consumedEndSegmentIndex<k.length?k[S.consumedEndSegmentIndex]:E;M.push({startSegmentIndex:I,endSegmentIndex:P,consumedEndSegmentIndex:D})}return M})(e.chunks,g,u.length),O=m===null?null:(function($,k){const E=(function(L){const S=L.length;if(S===0)return null;const I=new Array(S);let P=!1;for(let X=0;X<S;){const fe=L.charCodeAt(X);let ye=fe,Me=1;if(fe>=55296&&fe<=56319&&X+1<S){const ze=L.charCodeAt(X+1);ze>=56320&&ze<=57343&&(ye=ze-56320+(fe-55296<<10)+65536,Me=2)}const we=Rj(ye);we!=="R"&&we!=="AL"&&we!=="AN"||(P=!0);for(let ze=0;ze<Me;ze++)I[X+ze]=we;X+=Me}if(!P)return null;let D=0;for(let X=0;X<S;X++){const fe=I[X];if(fe==="L"){D=0;break}if(fe==="R"||fe==="AL"){D=1;break}}const W=new Int8Array(S);for(let X=0;X<S;X++)W[X]=D;const z=1&D?"R":"L",q=z;let Q=q;for(let X=0;X<S;X++)I[X]==="NSM"?I[X]=Q:Q=I[X];Q=q;for(let X=0;X<S;X++){const fe=I[X];fe==="EN"?I[X]=Q==="AL"?"AN":"EN":fe!=="R"&&fe!=="L"&&fe!=="AL"||(Q=fe)}for(let X=0;X<S;X++)I[X]==="AL"&&(I[X]="R");for(let X=1;X<S-1;X++)I[X]==="ES"&&I[X-1]==="EN"&&I[X+1]==="EN"&&(I[X]="EN"),I[X]!=="CS"||I[X-1]!=="EN"&&I[X-1]!=="AN"||I[X+1]!==I[X-1]||(I[X]=I[X-1]);for(let X=0;X<S;X++){if(I[X]!=="EN")continue;let fe;for(fe=X-1;fe>=0&&I[fe]==="ET";fe--)I[fe]="EN";for(fe=X+1;fe<S&&I[fe]==="ET";fe++)I[fe]="EN"}for(let X=0;X<S;X++){const fe=I[X];fe!=="WS"&&fe!=="ES"&&fe!=="ET"&&fe!=="CS"||(I[X]="ON")}Q=q;for(let X=0;X<S;X++){const fe=I[X];fe==="EN"?I[X]=Q==="L"?"L":"EN":fe!=="R"&&fe!=="L"||(Q=fe)}for(let X=0;X<S;X++){if(I[X]!=="ON")continue;let fe=X+1;for(;fe<S&&I[fe]==="ON";)fe++;const ye=(X>0?I[X-1]:q)!=="L"?"R":"L";if(ye===((fe<S?I[fe]:q)!=="L"?"R":"L"))for(let Me=X;Me<fe;Me++)I[Me]=ye;X=fe-1}for(let X=0;X<S;X++)I[X]==="ON"&&(I[X]=z);for(let X=0;X<S;X++){const fe=I[X];1&W[X]?fe!=="L"&&fe!=="AN"&&fe!=="EN"||W[X]++:fe==="R"?W[X]++:fe!=="AN"&&fe!=="EN"||(W[X]+=2)}return W})($);if(E===null)return null;const M=new Int8Array(k.length);for(let L=0;L<k.length;L++)M[L]=E[k[L]];return M})(e.normalized,m);return _!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:h,simpleLineWalkFastPath:f,segLevels:O,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:_}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:h,simpleLineWalkFastPath:f,segLevels:O,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function mV(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return hV((function(c,u,d="normal",p="normal"){const h=(function(b){const _=b??"normal";return _==="pre-wrap"?{mode:_,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:_,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),f=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
|
|
238
|
-
`).replace(/[\r\f]/g,`
|
|
239
|
-
`):b.replace(/\r\n/g,`
|
|
240
|
-
`)})(c):(function(b){if(!Bj.test(b))return b;let _=b.replace(Dj," ");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 m=p==="keep-all"?(function(b){if(b.len<=1)return b;const _=[],g=[],v=[],y=[];let A=null,O=!1,$=0,k=!1,E=!1;function M(){A!==null&&(_.push(Vs(A)),g.push(O),v.push("text"),y.push($),A=null)}for(let L=0;L<b.len;L++){const S=b.texts[L],I=b.kinds[L],P=b.isWordLike[L],D=b.starts[L];if(I==="text"){const W=Wj(S),z=T1(S);if(A!==null&&k&&E){A.push(S),O=O||P,k=k||W,E=z;continue}M(),A=[S],O=P,$=D,k=W,E=z;continue}M(),_.push(S),g.push(P),v.push(I),y.push(D)}return M(),{len:_.length,texts:_,isWordLike:g,kinds:v,starts:y}})(cS(f,u,h)):cS(f,u,h);return it({normalized:f,chunks:rV(m,h)},m)})(o,Lh(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const zg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",mo=(()=>{const e=globalThis;if(e[zg])return e[zg];const t={configs:{},controllers:{},revision:Ql(0),preparedCache:new Map,blockEstimateCache:new Map};return e[zg]=t,t})();let Yc=null;const pS=mo.revision;function hS(e){var t;return e&&(t=mo.configs[e])!=null?t:null}function mS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function gV(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Ug(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!gV(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
|
|
241
|
-
`)}return s.length>0?s:null}function qg(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Yc!=null)return Yc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Yc=!!((i=r.getContext)!=null&&i.call(r,"2d")),Yc}catch{return Yc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=mo.blockEstimateCache.get(r);if(l)return mo.blockEstimateCache.delete(r),mo.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,f,m){const b=`${m}\0${f}\0${h}`,_=mo.preparedCache.get(b);if(_)return mo.preparedCache.delete(b),mo.preparedCache.set(b,_),_.prepared;const g=mV(h,f,{whiteSpace:m});for(mo.preparedCache.set(b,{prepared:g});mo.preparedCache.size>240;){const v=mo.preparedCache.keys().next().value;if(!v)break;mo.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,f,m){const b=(function(_,g){return _.simpleLineWalkFastPath?fS(_,g):(function(v,y){if(v.simpleLineWalkFastPath)return fS(v,y);const{widths:A,lineEndFitAdvances:O,lineEndPaintAdvances:$,kinds:k,breakableFitAdvances:E,discretionaryHyphenWidth:M,tabStopAdvance:L,chunks:S}=v;if(A.length===0||S.length===0)return 0;const I=Lh(),P=I.lineFitEpsilon,D=y+P;let W=0,z=0,q=!1,Q=0,X=0,fe=-1,ye=0,Me=0,we=null;function ze(){fe=-1,ye=0,Me=0,we=null}function Ue(J=Q,ce=X,te=z){W++,z=0,q=!1,ze()}function Fe(J,ce){q=!0,Q=J+1,X=0,z=ce}function rt(J,ce,te){q=!0,Q=J,X=ce+1,z=te}function le(J,ce){q?(z+=ce,Q=J+1,X=0):Fe(J,ce)}function U(J,ce,te,ue){if(!ce)return;const j=J==="tab"?0:O[te],Y=J==="tab"?ue:$[te];fe=te+1,ye=z-ue+j,Me=z-ue+Y,we=J}function G(J,ce){const te=E[J];for(let ue=ce;ue<te.length;ue++){const j=te[ue];q?z+j>D?(Ue(),rt(J,ue,j)):(z+=j,Q=J,X=ue+1):rt(J,ue,j)}q&&Q===J&&X===te.length&&(Q=J+1,X=0)}function ne(J){if(we!=="soft-hyphen")return!1;const ce=E[J];if(ce==null)return!1;const{fitCount:te,fittedWidth:ue}=(function(j,Y,re,ge,Ae){let Ie=0,ae=Y;for(;Ie<j.length;){const Te=ae+j[Ie];if((Ie+1<j.length?Te+Ae:Te)>re+ge)break;ae=Te,Ie++}return{fitCount:Ie,fittedWidth:ae}})(ce,z,y,P,M);return te!==0&&(z=ue,Q=J,X=te,ze(),te===ce.length?(Q=J+1,X=0,!0):(Ue(J,te,ue+M),G(J,te),!0))}function H(J){W++,ze()}for(let J=0;J<S.length;J++){const ce=S[J];if(ce.startSegmentIndex===ce.endSegmentIndex){H();continue}q=!1,z=0,ce.startSegmentIndex,Q=ce.startSegmentIndex,X=0,ze();let te=ce.startSegmentIndex;for(;te<ce.endSegmentIndex;){const ue=k[te],j=ue==="space"||ue==="preserved-space"||ue==="tab"||ue==="zero-width-break"||ue==="soft-hyphen",Y=ue==="tab"?dV(z,L):A[te];if(ue!=="soft-hyphen")if(q){if(z+Y>D){const re=z+(ue==="tab"?0:O[te]),ge=z+(ue==="tab"?Y:$[te]);if(we==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&ye<=D){Ue(fe,0,Me);continue}if(we==="soft-hyphen"&&ne(te)){te++;continue}if(j&&re<=D){le(te,Y),Ue(te+1,0,ge),te++;continue}if(fe>=0&&ye<=D){if(Q>fe||Q===fe&&X>0){Ue();continue}const Ae=fe;Ue(Ae,0,Me),te=Ae;continue}if(Y>y&&E[te]!==null){Ue(),G(te,0),te++;continue}Ue();continue}le(te,Y),U(ue,j,te,Y),te++}else Y>y&&E[te]!==null?G(te,0):Fe(te,Y),U(ue,j,te,Y),te++;else q&&(Q=te+1,X=0,fe=te+1,ye=z+M,Me=z+M,we=ue),te++}if(q){const ue=fe===ce.consumedEndSegmentIndex?Me:z;Ue(ce.consumedEndSegmentIndex,0,ue)}}return W})(_,g)})(h,f);return{lineCount:b,height:b*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),p=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(mo.blockEstimateCache.set(r,{height:p,contentHeight:Math.round(d)});mo.blockEstimateCache.size>4e3;){const h=mo.blockEstimateCache.keys().next().value;if(!h)break;mo.blockEstimateCache.delete(h)}return{kind:"simple-text",height:p,contentHeight:Math.round(d)}}catch{return null}}function n3(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Ug(e.children);return i&&n.paragraph?qg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Ug(e.children),l=n.headings[i];return r&&l?qg(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=Ug((s=i[0])==null?void 0:s.children);return r?qg(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=n3(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 hf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function vV(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,p,h;return u.diff?Math.max(hf(String((d=u.originalCode)!=null?d:"")),hf(String((p=u.updatedCode)!=null?p:"")),hf(String((h=u.code)!=null?h:""))):hf((function(f,m){const b=String(f??"");return m?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,f){const m=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:f?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:f?30:Math.round(1.5*m)})(u,r),p=(function(h,f){var m,b;if(!f)return 0;const _=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,_)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+p:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function yV(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function jg(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=mS(o.lineHeight,1.5*mS(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:yV(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const kV=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function gS(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))kV.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const bV=!1;function bhe(){return bV}function vS(e,t,n,o){var s;const i=(function(p){return Math.max(0,Math.ceil(p.scrollHeight||0)-Math.ceil(p.clientHeight||0))})(e),r=(function(p,h){return Number.isFinite(p)?Math.min(Math.max(0,p),h):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const p of a){e.scrollTop=p;const h=o.getNormalizedScrollTop(e,t,!1),f=Math.abs(h-r);f<u&&(u=f,c=p)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const o3=Symbol("MarkstreamMathBlockMinHeightCache");function _he(){return Ut(o3,null)}const _V=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],wV=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],SV=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),s3=["raw","content","code","originalCode","updatedCode"],yS=new WeakMap,kS=new WeakMap;let CV=1;function ai(){return typeof performance<"u"?performance.now():Date.now()}function bS(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Xs(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=yS.get(t);return n||(n=CV++,yS.set(t,n)),String(n)}function _S(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:Xs(t),customMarkdownIt:Xs(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:Xs(e.validateLink),preTransformTokens:Xs(e.preTransformTokens),postTransformTokens:Xs(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function wS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
242
|
-
`,t-1)+1;return e.slice(n,t).trim()}function SS(e){const t=i3(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function i3(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function r3(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 fy(e){const t=String(e??"");return`${t.length}:${r3(t)}`}function I1(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?fy(r):`${r.length}:${r3(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Xs(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${Xs(o)}`;const i=Xs(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>I1(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}:${I1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Bp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function l3(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Bp(o)?Jr(o,t,n+1):l3(o,t,n+1)).join(",")}`:Bp(e)?Jr(e,t,n):I1(e,t,n)}function xV(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!s3.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${fy(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${Xs(s)}`:SV.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${l3(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${Xs(s)}`:""}).filter(Boolean).join(";")}function AV(e){return s3.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${fy(n)}`:""}).filter(Boolean).join(";")}function Jr(e,t=new WeakMap,n=0){const o=kS.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Xs(s)}`;const r=Xs(s);t.set(s,r);const l=(function(a,c,u){const d=a,p=Array.isArray(d.children)?d.children:[],h=p.length?p.slice(0,200).map(f=>Jr(f,c,u+1)).join("|"):"";return[a.type,AV(d),xV(d,c,u),p.length,h].join(":")})(e,t,n);return kS.set(s,l),l}function a3(e,t){return Jr(e)===Jr(t)}function py(e,t,n){const o=ai(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ai()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function CS(e,t,n){return py(t,n,()=>Jr(e))}function c3(e,t,n){return CS(e,n,"stabilizeSignatureMs")===CS(t,n,"stabilizeSignatureMs")}function Vg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function xS(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function TV(e,t){return e.length===t.length&&e===t}function hy(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const p=o[d],h=s[d];if(typeof p!=typeof h)return!1;if(typeof p!="string"){if(typeof p!="number"&&typeof p!="boolean"&&p!=null)return null;if(!Object.is(p,h))return!1}else if(typeof h!="string"||!TV(p,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],p=c[u];if(!Bp(d)||!Bp(p))return null;const h=hy(d,p,n+1);if(h==null)return null;if(!h)return!1}return!0}function MV(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=hy(e,t);return n??a3(e,t)}function EV(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return py(n,"stabilizeSignatureMs",()=>{o=hy(e,t)}),o??c3(e,t,n)}function IV(e,t){const n={};for(const o of _V){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function $V(e,t){var n;const o=E2(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:F(()=>!1),r=Z(t.renderContent.value);let l,a=[],c="",u="",d="",p=0,h=0,f=ai();function m(){l&&(clearTimeout(l),l=void 0)}function b(){m();const E=t.renderContent.value;r.value!==E&&(r.value=E),f=ai()}Ke([t.renderContent,t.effectiveFinal,i],([E,M,L])=>{r.value!==E&&(!L||M||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const P=I.slice(S.length);return!!P&&(!!SS(wS(I))||!(!P.includes(`
|
|
243
|
-
|
|
244
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
|
|
245
|
-
`)&&!(function(D){const W=wS(D);if(SS(W))return!1;const z=i3(W);return z.length>=2&&z.some(q=>q.trim())})(I))})(r.value,E)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const P=I.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(ai()-f));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),K1(m);const _=F(()=>{var E,M,L,S;return XB(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(L=(M=t.customComponentsMap)==null?void 0:M.value)!=null?L:{},Object.entries(S).map(([I,P])=>{const D=oi(I);return P==null||!D||fd(D)||RT.has(D)||cd.has(D)?"":D}).filter(Boolean)))}),g=F(()=>{const{key:E,tags:M}=QB(_.value);if(!E)return o;const L=s.get(E);if(L)return L;const S=E2(t.instanceMsgId,{customHtmlTags:M});return s.set(E,S),S}),v=F(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=F(()=>{var E,M;const L=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,I=_.value,P=S!=null,D=I.length>0;return P||D||L.streamParse==null?it(it(Lt(it({},L),{streamParse:(M=L.streamParse)==null||M}),P?{final:S}:{}),D?{customHtmlTags:I}:{}):L}),A=F(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(M=>String(M).trim().toLowerCase()).filter(Boolean))}),O=F(()=>_S(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=F(()=>_S(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ke([O,$],([E,M],[L,S])=>{L&&(E===L&&M===S||(b(),M!==S&&(a=[],d="")))},{flush:"sync"});const k=F(()=>{var E,M,L,S,I,P,D,W;if((E=e.nodes)!=null&&E.length)return a=[],d="",Dr(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const q=t.debugPerformanceEnabled.value,Q=q?ai():0,X=v.value,fe=O.value,ye=$.value;c&&fe!==c&&(function(ce){var te,ue;(ue=(te=ce.stream)==null?void 0:te.reset)==null||ue.call(te)})(X),u&&ye!==u&&(a=[],d="");const Me=a.length>0&&z.startsWith(d)&&ye===u,we=q?bS(X):null,ze=q?{}:void 0,Ue=ze?Lt(it({},y.value),{__timing:ze}):y.value,Fe=CM(z,X,Ue),rt=q?ai():0,le=q?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let U,G=q?Vg(Fe.length):void 0,ne=0,H=0;if(Me){const ce=q?ai():0;if(le){const te=(function(ue,j,Y){if(!j.length)return{nodes:ue,metrics:Vg(ue.length)};const re=(function(Ie,ae,Te){const Ve=Math.min(Ie.length,ae.length);for(let tt=0;tt<Ve;tt++)if(!EV(ae[tt],Ie[tt],Te))return tt;return Ie.length===ae.length?-1:Ve})(ue,j,Y);if(re<0)return{nodes:j,metrics:{reusedNodeCount:ue.length,dirtyStartIndex:re,stablePrefixNodeCount:ue.length,dirtyTailNodeCount:0}};const ge=ue.slice();let Ae=re;for(let Ie=0;Ie<re;Ie++)ge[Ie]=j[Ie];for(let Ie=re;Ie<ue.length;Ie++){const ae=j[Ie],Te=ue[Ie];ae&&c3(ae,Te,Y)&&(ge[Ie]=ae,Ae+=1)}return{nodes:ge,metrics:{reusedNodeCount:Ae,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:xS(re,ue,j)}}})(Fe,a,le);U=te.nodes,G=te.metrics}else{const te=(function(ue,j){if(!j.length)return{nodes:ue,metrics:Vg(ue.length)};const Y=(function(Ae,Ie){const ae=Math.min(Ae.length,Ie.length);for(let Te=0;Te<ae;Te++)if(!MV(Ie[Te],Ae[Te]))return Te;return Ae.length===Ie.length?-1:ae})(ue,j);if(Y<0)return{nodes:j,metrics:{reusedNodeCount:ue.length,dirtyStartIndex:Y,stablePrefixNodeCount:ue.length,dirtyTailNodeCount:0}};const re=ue.slice();let ge=Y;for(let Ae=0;Ae<Y;Ae++)re[Ae]=j[Ae];for(let Ae=Y;Ae<ue.length;Ae++){const Ie=j[Ae],ae=ue[Ae];Ie&&a3(Ie,ae)&&(re[Ae]=Ie,ge+=1)}return{nodes:re,metrics:{reusedNodeCount:ge,dirtyStartIndex:Y,stablePrefixNodeCount:Y,dirtyTailNodeCount:xS(Y,ue,j)}}})(Fe,a);U=te.nodes,G=te.metrics}ne=q?ai()-ce:0,H=G?.dirtyStartIndex==null||G.dirtyStartIndex<0?U.length:G.dirtyStartIndex}else U=Fe;le?(function(ce,te,ue=0){for(let j=Math.max(0,ue);j<ce.length;j++)py(te,"primeSignatureMs",()=>Jr(ce[j]))})(U,le,H):(function(ce,te=0){for(let ue=Math.max(0,te);ue<ce.length;ue++)Jr(ce[ue])})(U,H);const J=q?ai()-rt:0;if(p+=1,d=z,c=fe,u=ye,a=U,q){const ce=bS(X),te=typeof ce?.total=="number"&&ce.total>((M=we?.total)!=null?M:0);t.logPerf(te?"parse(stream)":"parse(sync)",it(it(it({rendererId:t.instanceMsgId,ms:Math.round(ai()-Q),nodes:U.length,contentLength:z.length,parseCommitCount:p,parseCoalescedCount:h,nodeReuseMs:J,signatureMs:(L=le?.signatureMs)!=null?L:0,stabilizeSignatureMs:(S=le?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=le?.primeSignatureMs)!=null?I:0,signatureCallCount:(P=le?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(D=le?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(W=le?.primeSignatureCallCount)!=null?W:0,stabilizeMs:ne},G??{}),ze?Object.fromEntries(wV.map(ue=>{var j;return[ue,(j=ze[ue])!=null?j:0]})):{}),ce?{streamMode:ce.lastMode,streamDelta:IV(ce,we),streamStats:ce}:{}))}return Dr(U)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:A,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:k}}function NV(e){const{isClient:t}=e,n=Z(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(p,h){if((m=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!m)return;var f,m;const b=n.value,_=b.has(p);if(h){if(_)return;const v=new Set(b);return v.add(p),void(n.value=v)}if(!_)return;const g=new Set(b);g.delete(p),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[p,h]of s.entries())p<c||(h(),s.delete(p));for(const[p,h]of o.entries())p<c||(h.destroy(),o.delete(p),r(p),(u=e.onNodeVisibilityCleaned)==null||u.call(e,p));for(const p of Array.from(i.keys()))p<c||r(p);if(!n.value.size)return;const d=new Set;for(const p of n.value)p<c&&d.add(p);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function LV(e={}){const t=Z(""),n=Z(""),o=Z(!1),s=OU(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=F(()=>Math.max(0,t.value.length-n.value.length)),a=F(()=>l.value===0),c=F(()=>o.value&&a.value);return V1()&&K1(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const AS=/auto|scroll|overlay/i;function OV(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return AS.test(t)||AS.test(n)}function PV(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 RV=je({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,o;return g1((o=Ha(e.estimatedPreviewHeightPx))!=null?o:h1(String((n=e.node.code)!=null?n:"")))});return()=>cn("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?cn("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)"}},[cn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[cn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),cn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),cn("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},()=>cn("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,cn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[cn("div",{class:"absolute inset-0"},[cn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),DV=je({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,o;return m1((o=Ha(e.estimatedPreviewHeightPx))!=null?o:p1(String((n=e.node.code)!=null?n:"")))});return()=>cn("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?cn("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)"}},[cn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[cn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),cn("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},()=>cn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[cn("span",{class:"action-icon block"})])))]):null,cn("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)"}},[cn("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"}})])])}}),BV=["data-custom-id"],FV={class:"m-0 p-0"},HV=["data-probe"],WV=["data-node-index","data-node-type"],u3=un(je(Lt(it({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=Oo(),r=Ut("markstreamNestedRendererProps",void 0);function l(C){var B,V;const K=o[C];return(function(ee){const he=i?.vnode.props;return!!he&&(Object.prototype.hasOwnProperty.call(he,ee)||Object.prototype.hasOwnProperty.call(he,String(ee).replace(/[A-Z]/g,ke=>`-${ke.toLowerCase()}`)))})(C)?K:(V=(B=r?.value)==null?void 0:B[C])!=null?V:K}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=F(()=>{return(C=l("mode"))==="chat"||C==="minimal"||C==="docs"?C:"docs";var C}),u=F(()=>{const C=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return C===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:C===!1||c.value==="docs"?"monaco":"pre"}),d=F(()=>a[c.value]),p=F(()=>{var C;return(C=l("showTooltips"))!=null?C:d.value.showTooltips}),h=F(()=>{var C;return(C=l("fade"))!=null?C:d.value.fade}),f=F(()=>{var C;return(C=l("batchRendering"))!=null?C:d.value.batchRendering}),m=F(()=>{var C;return(C=l("initialRenderBatchSize"))!=null?C:d.value.initialRenderBatchSize}),b=F(()=>{var C;return(C=l("renderBatchSize"))!=null?C:d.value.renderBatchSize}),_=F(()=>{var C;return(C=l("renderBatchDelay"))!=null?C:d.value.renderBatchDelay}),g=F(()=>{var C;return(C=l("renderBatchBudgetMs"))!=null?C:d.value.renderBatchBudgetMs}),v=F(()=>{var C;return(C=l("renderBatchIdleTimeoutMs"))!=null?C:d.value.renderBatchIdleTimeoutMs}),y=F(()=>{var C;return(C=l("deferNodesUntilVisible"))!=null?C:d.value.deferNodesUntilVisible}),A=F(()=>{var C;return(C=l("maxLiveNodes"))!=null?C:d.value.maxLiveNodes}),O=F(()=>{var C;return(C=l("liveNodeBuffer"))!=null?C:d.value.liveNodeBuffer}),$=F(()=>{var C;return(C=l("nodeVirtual"))!=null?C:d.value.nodeVirtual}),k={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return p.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return f.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return _.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return O.value},get nodeVirtual(){return $.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function E(C){s("height-change",C)}function M(C){s("virtual-state-change",C)}function L(C){s("anchor-change",C)}const S=Z(),I=Z(null),P=Z(null),D=Z(null),W=No({1:null,2:null,3:null,4:null,5:null,6:null}),z=Z(!1),q=new Map,Q=Z(0),X=Z(0),fe=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ye(){var C,B;if(((C=o.virtualScroll)==null?void 0:C.enabled)!==!0)return null;const V=(B=o.virtualScroll)==null?void 0:B.scrollRoot;return Me(typeof V=="function"?V():V)}function Me(C){return C?typeof HTMLElement<"u"&&C instanceof HTMLElement?C:typeof C=="object"&&"value"in C?Me(C.value):typeof C=="object"&&"$el"in C?Me(C.$el):null:null}const{isClient:we,renderAsFragment:ze,debugPerformanceEnabled:Ue,resolvedShowTooltips:Fe,resolvedHtmlPolicy:rt,inheritedSmoothStreaming:le,ownsTypewriterCursor:U}=(function(C){const B=typeof window<"u",V=od(),K=Ut("markstreamHtmlPolicy",void 0),ee=Ut("markstreamTypewriterCursor",void 0),he=Ut("markstreamSmoothStreaming",void 0),ke=F(()=>C.renderAsFragment===!0),Se=F(()=>!!(C.debugPerformance&&B&&typeof console<"u")),Pe=F(()=>{var De;if(typeof C.showTooltips=="boolean")return C.showTooltips;const $e=(De=V.showTooltips)!=null?De:V["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Ee=F(()=>{var De,$e;return($e=(De=C.htmlPolicy)!=null?De:K?.value)!=null?$e:"safe"}),We=F(()=>ee?.value!==!0);return{isClient:B,renderAsFragment:ke,debugPerformanceEnabled:Se,resolvedShowTooltips:Pe,resolvedHtmlPolicy:Ee,inheritedSmoothStreaming:he,inheritedTypewriterCursor:ee,ownsTypewriterCursor:We}})(k),{resolveViewportRoot:G,resolveScrollContainer:ne,isReverseFlexScrollRoot:H,getNormalizedScrollTop:J,getOffsetTopWithinRoot:ce}=(function(C,B){function V(){var Se,Pe;return(Pe=(Se=B.scrollRoot)==null?void 0:Se.call(B))!=null?Pe:null}function K(Se){if(typeof window>"u")return null;const Pe=V();if(Pe)return Pe;const Ee=Se??C.value;if(!Ee)return null;const We=Ee.ownerDocument||document,De=We.scrollingElement||We.documentElement;let $e=Ee;for(;$e&&$e!==We.body&&$e!==De;){if(OV(window.getComputedStyle($e))&&PV($e))return $e;$e=$e.parentElement}return null}function ee(Se){if(!B.isClient)return!1;try{const Pe=window.getComputedStyle(Se);return!!(Pe.display||"").toLowerCase().includes("flex")&&(Pe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function he(Se,Pe,Ee){var We,De;if(Ee)return ke(Pe);const $e=Se.scrollTop;if(!ee(Se))return $e;const He=$e<0?-$e:$e;return Math.max(0,((We=Se.scrollHeight)!=null?We:0)-((De=Se.clientHeight)!=null?De:0))-He}function ke(Se){var Pe,Ee,We,De,$e;const He=Number((Pe=Se.scrollingElement)==null?void 0:Pe.scrollTop),Qe=Number((We=(Ee=Se.documentElement)==null?void 0:Ee.scrollTop)!=null?We:0),Ze=Number(($e=(De=Se.body)==null?void 0:De.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Qe)?Qe:0,Number.isFinite(Ze)?Ze:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(Se){var Pe,Ee,We,De;const $e=V();if($e)return $e;const He=K((Pe=Se??C.value)!=null?Pe:null);if(He)return He;const Qe=(De=(We=Se?.ownerDocument)!=null?We:(Ee=C.value)==null?void 0:Ee.ownerDocument)!=null?De:typeof document<"u"?document:null;return Qe?.scrollingElement||Qe?.documentElement||null},isReverseFlexScrollRoot:ee,getNormalizedScrollTop:he,getOffsetTopWithinRoot:function(Se,Pe){const Ee=Pe.ownerDocument||Se.ownerDocument||document;if((function(He,Qe){return He===Qe.documentElement||He===Qe.body||He===Qe.scrollingElement})(Pe,Ee))return Se.getBoundingClientRect().top+ke(Ee);const We=Pe.getBoundingClientRect(),De=Se.getBoundingClientRect(),$e=he(Pe,Ee,!1);return De.top-We.top+$e}}})(S,{isClient:we,scrollRoot:ye});En("markstreamShowTooltips",Fe),En("markstreamHtmlPolicy",rt),En("markstreamTypewriter",F(()=>k.typewriter!==!1)),En("markstreamFade",F(()=>k.fade!==!1)),En("markstreamTypewriterCursor",F(()=>!0)),En("markstreamTextStreamState",q),En("markstreamStreamVersion",Q),En("markstreamParseOptions",F(()=>k.parseOptions)),En("markstreamCustomMarkdownIt",F(()=>k.customMarkdownIt));const{smoothStreamingEnabled:te,renderContent:ue,effectiveFinal:j}=(function(C,B){const V=LV(C.smoothStreamingOptions),K=F(()=>{var Ee,We,De;return C.smoothStreaming!==!1&&!((Ee=C.nodes)!=null&&Ee.length)&&(C.smoothStreaming===!0||!((We=B.inheritedSmoothStreaming)!=null&&We.value))&&(C.smoothStreaming===!0||C.typewriter===!0||((De=C.maxLiveNodes)!=null?De:0)<=0)}),ee=Z(!B.isClient||C.smoothStreaming===!0);hn(()=>{ee.value=!0});const he=F(()=>ee.value&&K.value),ke=F(()=>{var Ee;return he.value?V.visible.value:(Ee=C.content)!=null?Ee:""}),Se=F(()=>{var Ee,We;const De=(Ee=C.parseOptions)!=null?Ee:{};return(We=C.final)!=null?We:De.final}),Pe=F(()=>{const Ee=Se.value;return he.value&&Ee!=null?!!Ee&&V.caughtUp.value:Ee});return Ke([()=>C.content,()=>C.nodes,he,Se],([Ee,We,De,$e])=>{if(We?.length)return void V.reset("");const He=Ee??"";if(!De)return V.reset(He),void($e&&V.finish({flush:!0}));const Qe=V.source.value;He?He===Qe||(He.startsWith(Qe)?V.enqueue(He.slice(Qe.length)):V.reset(He)):V.reset(""),$e&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:he,renderContent:ke,requestedFinal:Se,effectiveFinal:Pe}})(k,{isClient:we,inheritedSmoothStreaming:le});En("markstreamSmoothStreaming",te);const Y=Z(!1);let re="",ge=!1,Ae=null;function Ie(){we&&Ae!=null&&(window.clearTimeout(Ae),Ae=null)}function ae(){Y.value=!1,Ie()}function Te(C,B){if(!Ue.value)return;const V=(function(){if(!Ue.value)return null;const K=Tt(Ve),ee=Tt(tt),he=Math.max(kt,ee);if(K<=0&&he<=0)return null;const ke={total:K,maxPerFrame:he,byLabel:(Se=Ve,Object.fromEntries(Array.from(Se.entries()).sort((Pe,Ee)=>Ee[1]-Pe[1]||Pe[0].localeCompare(Ee[0]))))};var Se;return Ve.clear(),tt.clear(),kt=0,ke})();console.info(`[markstream-vue][perf] ${C}`,V?Lt(it({},B),{layoutReads:V}):B)}Ke([ue,()=>o.nodes,j],([C,B,V])=>{const K=C??"";return B?.length||V===!0?(ae(),re=K,void(ge=!0)):ge?(re&&K.length>re.length&&K.startsWith(re)?(Y.value=!0,we&&(Ie(),Ae=window.setTimeout(()=>{var ee;Ae=null,j.value===!0||(ee=o.nodes)!=null&&ee.length||(fa(),Y.value=!1,Pi())},1200))):(K.length<re.length||!K.startsWith(re))&&ae(),void(re=K)):(re=K,void(ge=!0))},{flush:"sync",immediate:!0});const Ve=new Map,tt=new Map;let bt=!1,kt=0;function Tt(C){let B=0;for(const V of C.values())B+=V;return B}function Pt(){kt=Math.max(kt,Tt(tt)),tt.clear(),bt=!1}function mt(C,B){return(function(V){var K,ee;Ue.value&&(Ve.set(V,((K=Ve.get(V))!=null?K:0)+1),tt.set(V,((ee=tt.get(V))!=null?ee:0)+1),bt||(bt=!0,we&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Pt):typeof queueMicrotask!="function"?setTimeout(Pt,0):queueMicrotask(Pt)))})(C),B()}const Yt=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Rn=(function(C){const B=new Map;return{scope:C,cache:B,clear:()=>B.clear()}})(Yt),Dn=F(()=>`${Yt}:${Q.value}`);En(o3,Rn);const Ft=co(()=>k.customId),{effectiveCustomHtmlTagsSet:bn,mergedParseOptions:Vn,parsedNodes:ot}=$V(k,{instanceMsgId:Yt,renderContent:ue,effectiveFinal:j,smoothStreamingEnabled:te,debugPerformanceEnabled:Ue,customComponentsMap:Ft,logPerf:Te});Ke(ot,()=>{Rn.clear(),Q.value+=1},{immediate:!0});const In=F(()=>({customId:k.customId,customHtmlTags:Vn.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:rt.value,viewportPriority:k.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:k.codeBlockDarkTheme,codeBlockLightTheme:k.codeBlockLightTheme,codeBlockMonacoOptions:k.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:k.codeBlockMinWidth,codeBlockMaxWidth:k.codeBlockMaxWidth,codeBlockProps:k.codeBlockProps,mermaidProps:k.mermaidProps,d2Props:k.d2Props,infographicProps:k.infographicProps,showTooltips:Fe.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));En("markstreamNestedRendererProps",In);const _n=F(()=>ot.value),Kn=F(()=>ot.value.length),$n=Z(null),Ge=Z(null),Ye=Z(null),Ct=Z(null),$t=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),mn=!$t&&k.customId?hS(k.customId):null,Nn=F(()=>mn?(pS.value,hS(k.customId)):null),tn=F(()=>{var C;return!!(we&&!ze.value&&k.customId&&!$t&&((C=Nn.value)!=null&&C.enabled))}),Ln=F(()=>{var C;return!!(!ze.value&&((C=o.virtualScroll)!=null&&C.enabled))}),Zn=Z(!1);hn(()=>{Zn.value=!0});const Mt=F(()=>!!(we&&Ln.value));En("markstreamHostScrollManaged",Mt);const uo=F(()=>!!(Zn.value&&Mt.value)),Xt=F(()=>tn.value||Mt.value),si=F(()=>tn.value||uo.value),_o=F(()=>{var C;return Xt.value&&((C=Nn.value)==null?void 0:C.textEstimation)!==!1}),Ds=F(()=>{var C;return Xt.value&&((C=Nn.value)==null?void 0:C.codeBlockEstimation)!==!1});function ss(){const C=X.value||mt("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=S.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(C)&&C>0?C:0}const jo=F(()=>{const C=ss();return C>0?Math.max(1,Math.round(C)):640}),is=F(()=>{var C;return Math.max(1,(C=k.maxLiveNodes)!=null?C:320)}),Nt=F(()=>{var C;return!ze.value&&k.nodeVirtual!==!1&&!(((C=k.maxLiveNodes)!=null?C:0)<=0)&&(k.nodeVirtual===!0?ot.value.length>0:ot.value.length>is.value)}),Xe=F(()=>Nt.value||tn.value||Mt.value),st=F(()=>k.viewportPriority!==!1&&!z.value),de=kj(C=>{var B;return G((B=C??S.value)!=null?B:null)},st),{requestFrame:pe,cancelFrame:Oe,hasIdleCallback:Qt,isTestEnv:Wt}=(function(C){const B=C.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=C.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=C.isClient&&typeof window.requestIdleCallback=="function",ee=(function(){var he;if(typeof globalThis>"u"||!("process"in globalThis))return;const ke=(he=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:he.value;return ke?.env})();return{requestFrame:B,cancelFrame:V,hasIdleCallback:K,isTestEnv:ee?.NODE_ENV==="test"}})({isClient:we}),{resolvedBatchSize:fo,resolvedInitialBatch:Bn,batchingEnabled:bs,incrementalRenderingActive:ii,renderedCount:wo,previousRenderContext:ta,adaptiveBatchSize:ll,previousBatchConfig:al}=(function(C,B){var V;const K=F(()=>{var De;const $e=Math.trunc((De=C.renderBatchSize)!=null?De:80);return Number.isFinite($e)?Math.max(0,$e):0}),ee=F(()=>{var De;const $e=Math.trunc((De=C.initialRenderBatchSize)!=null?De:K.value);return Number.isFinite($e)?Math.max(0,$e):K.value}),he=F(()=>!B.renderAsFragment.value&&C.batchRendering!==!1&&K.value>0&&B.isClient&&!B.isTestEnv),ke=Z(0),Se=Z({key:C.indexKey,total:0}),Pe=Z(Math.max(1,K.value||1)),Ee=F(()=>{var De;return he.value&&((De=C.maxLiveNodes)!=null?De:0)<=0}),We=Z({batchSize:K.value,initial:ee.value,delay:(V=C.renderBatchDelay)!=null?V:16,enabled:Ee.value});return{resolvedBatchSize:K,resolvedInitialBatch:ee,batchingEnabled:he,incrementalRenderingActive:Ee,renderedCount:ke,previousRenderContext:Se,adaptiveBatchSize:Pe,previousBatchConfig:We}})(k,{isClient:we,isTestEnv:Wt,renderAsFragment:ze}),Po=new Map,ft=new Map,me=new WeakMap;let Ne=null;const xn=new WeakMap,So=new Map,oe=Z(0),Ce=F(()=>(oe.value,Array.from(Po.entries()).sort((C,B)=>C[0]-B[0]))),xe=Z(null),Be=Z(null);let et=null,at=0,Ot=null;const{activeRestoreAnchor:Vt,getRelativeScrollTopWithinContainer:qt,setRelativeScrollTopWithinContainer:Bs,resolveAnchorOffset:Fs,clearRestoreReconcile:nn,scheduleRestoreReconcile:Jn,captureRestoreAnchor:Fn,restoreAnchor:Co,getAnchorDrift:Ro}=(function(C){const{isClient:B,containerRef:V,parsedNodeCount:K,requestFrame:ee,cancelFrame:he,resolveScrollContainer:ke,getNormalizedScrollTop:Se,getOffsetTopWithinRoot:Pe,isReverseFlexScrollRoot:Ee,estimateIndexForOffset:We,estimateHeightRange:De,getFallbackNodeHeight:$e,clamp:He}=C,Qe=Z(null);let Ze=null,_t=[];function lt(){const xt=ke(),Bt=V.value;if(!xt||!Bt)return null;const Dt=xt.ownerDocument||Bt.ownerDocument||document;if(xt===Dt.documentElement||xt===Dt.body||xt===Dt.scrollingElement){const ln=Bt.getBoundingClientRect();return Math.max(0,-ln.top)}return Math.max(0,Se(xt,Dt,!1)-Pe(Bt,xt))}function ct(xt){var Bt;const Dt=ke(),ln=V.value;if(!Dt||!ln)return;const Cs=Math.max(0,xt),Vo=Dt.ownerDocument||ln.ownerDocument||document,ri=Vo.defaultView||(typeof window<"u"?window:null);if(Dt===Vo.documentElement||Dt===Vo.body||Dt===Vo.scrollingElement){const hr=Se(Dt,Vo,!0)+ln.getBoundingClientRect().top;return void((Bt=ri?.scrollTo)==null||Bt.call(ri,0,Math.max(0,hr+Cs)))}vS(Dt,Vo,Pe(ln,Dt)+Cs,{isReverseFlexScrollRoot:hr=>{var mr;return(mr=Ee?.(hr))!=null&&mr},getNormalizedScrollTop:Se})}function St(xt){const Bt=K.value,Dt=He(xt.nodeIndex,0,Math.max(0,Bt-1));return De(0,Dt)+Math.max(0,xt.offsetWithinNodePx)}function wt(){if(Ze!=null&&(he?.(Ze),Ze=null),B)for(const xt of _t)window.clearTimeout(xt);_t=[]}function Zt(xt){const Bt=St(xt),Dt=lt();Dt!=null&&Math.abs(Dt-Bt)<=.5||ct(Bt)}return{activeRestoreAnchor:Qe,getRelativeScrollTopWithinContainer:lt,setRelativeScrollTopWithinContainer:ct,resolveAnchorOffset:St,clearRestoreReconcile:wt,applyRestoreAnchor:Zt,scheduleRestoreReconcile:function(){Qe.value&&B&&Ze==null&&(Ze=ee?ee(()=>{Ze=null,Qe.value&&Zt(Qe.value)}):null,Ze==null&&Qe.value&&Zt(Qe.value))},captureRestoreAnchor:function(){const xt=lt(),Bt=K.value;if(xt==null||Bt<=0)return null;const Dt=He(We(xt+1),0,Bt-1),ln=De(0,Dt),Cs=$e(Dt);return{nodeIndex:Dt,offsetWithinNodePx:He(xt-ln,0,Math.max(0,Cs-1))}},restoreAnchor:function(xt){const Bt=K.value;if(Qe.value={nodeIndex:He(xt.nodeIndex,0,Math.max(0,Bt-1)),offsetWithinNodePx:Math.max(0,xt.offsetWithinNodePx)},wt(),Zt(Qe.value),B)for(const Dt of[0,120,280,480])_t.push(window.setTimeout(()=>{Qe.value&&Zt(Qe.value)},Dt))},getAnchorDrift:function(xt){const Bt=lt();return Bt==null?null:Bt-St(xt)}}})({isClient:we,containerRef:S,parsedNodeCount:Kn,requestFrame:pe,cancelFrame:Oe,resolveScrollContainer:()=>xe.value||ne(),getNormalizedScrollTop:J,getOffsetTopWithinRoot:ce,isReverseFlexScrollRoot:H,estimateIndexForOffset:Em,estimateHeightRange:pr,getFallbackNodeHeight:xd,clamp:To}),{nodeHeights:po,heightStats:xo,heightTreeSize:cl,heightSumTree:jh,heightKnownTree:Vh,averageNodeHeight:yi,resetHeightMeasurements:M4,pruneHeightMeasurements:E4,rebuildHeightTrees:gd,recordNodeHeight:I4,removeNodeHeights:$4,exportHeightCache:N4,importHeightCache:L4,fenwickRangeSum:vd}=(function(C={}){const B=No({}),V=No({total:0,count:0}),K=Z(0),ee=Z([]),he=Z([]);function ke(){for(const $e of Object.keys(B))delete B[Number($e)];V.total=0,V.count=0,K.value=0,ee.value=[],he.value=[]}function Se($e,He,Qe){for(let Ze=He+1;Ze<$e.length;Ze+=Ze&-Ze)$e[Ze]+=Qe}function Pe($e,He){let Qe=0;for(let Ze=He+1;Ze>0;Ze-=Ze&-Ze)Qe+=$e[Ze];return Qe}function Ee($e){K.value=$e;const He=new Array($e+1).fill(0),Qe=new Array($e+1).fill(0);for(const[Ze,_t]of Object.entries(B)){const lt=Number(Ze),ct=Number(_t);!Number.isFinite(lt)||lt<0||lt>=$e||!Number.isFinite(ct)||ct<=0||(Se(He,lt,ct),Se(Qe,lt,1))}ee.value=He,he.value=Qe}function We($e){if(!Number.isInteger($e)||$e<0)return!1;const He=B[$e];if(!Number.isFinite(He)||He<=0)return!1;if(delete B[$e],V.total=Math.max(0,V.total-He),V.count=Math.max(0,V.count-1),K.value>$e){const Qe=ee.value,Ze=he.value;Qe.length&&Ze.length&&(Se(Qe,$e,-He),Se(Ze,$e,-1))}return!0}const De=F(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:B,heightStats:V,heightTreeSize:K,heightSumTree:ee,heightKnownTree:he,averageNodeHeight:De,resetHeightMeasurements:ke,pruneHeightMeasurements:function($e){if($e<=0)return void ke();let He=0,Qe=0;for(const[Ze,_t]of Object.entries(B)){const lt=Number(Ze),ct=Number(_t);!Number.isFinite(lt)||lt<0||lt>=$e||!Number.isFinite(ct)||ct<=0?delete B[lt]:(He+=ct,Qe++)}V.total=He,V.count=Qe},rebuildHeightTrees:Ee,recordNodeHeight:function($e,He,Qe={}){(function(Ze,_t,lt={}){var ct;if(!Number.isFinite(_t)||_t<=0)return!1;const St=B[Ze];if(St&&(lt.allowShrink===!1&&_t<St||Math.abs(_t-St)<=1))return!1;if(B[Ze]=_t,St?V.total+=_t-St:(V.total+=_t,V.count++),K.value>Ze){const wt=ee.value,Zt=he.value;if(wt.length&&Zt.length)if(St){const xt=_t-St;xt!==0&&Se(wt,Ze,xt)}else Se(wt,Ze,_t),Se(Zt,Ze,1)}lt.notify!==!1&&((ct=C.onHeightRecorded)==null||ct.call(C))})($e,He,Lt(it({},Qe),{notify:!0}))},removeNodeHeight:function($e,He={}){var Qe;const Ze=We($e);return Ze&&He.notify!==!1&&((Qe=C.onHeightRecorded)==null||Qe.call(C)),Ze},removeNodeHeights:function($e,He={}){var Qe;let Ze=0;for(const _t of $e)We(Number(_t))&&Ze++;return Ze>0&&He.notify!==!1&&((Qe=C.onHeightRecorded)==null||Qe.call(C)),Ze},exportHeightCache:function(){return Object.entries(B).map(([$e,He])=>({index:Number($e),height:Number(He)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,He)=>$e.index-He.index)},importHeightCache:function($e,He={}){var Qe;if(!Array.isArray($e))return;const Ze=K.value;let _t=!1;if(He.mode!=="merge"){const lt=Object.keys(B);if(lt.length>0){for(const ct of lt)delete B[Number(ct)];_t=!0}}for(const lt of $e){const ct=Number(lt.index),St=Number(lt.height);if(!Number.isInteger(ct)||ct<0||Ze>0&&ct>=Ze||!Number.isFinite(St)||St<=0)continue;const wt=B[ct];wt&&Math.abs(wt-St)<=1||(B[ct]=St,_t=!0)}_t&&((function(){let lt=0,ct=0;const St=K.value;for(const[wt,Zt]of Object.entries(B)){const xt=Number(wt),Bt=Number(Zt);!Number.isFinite(xt)||xt<0||St>0&&xt>=St||!Number.isFinite(Bt)||Bt<=0?delete B[xt]:(lt+=Bt,ct++)}V.total=lt,V.count=ct})(),Ze>0&&Ee(Ze),(Qe=C.onHeightRecorded)==null||Qe.call(C))},fenwickRangeSum:function($e,He,Qe){if(Qe<=He)return 0;const Ze=Pe($e,Qe-1);return He<=0?Ze:Ze-Pe($e,He-1)}}})({onHeightRecorded:()=>{Ws(),Mt.value&&Dc(),Vt.value&&Jn(),Be.value&&ca(),An("node-resize")}});function yd(){M4(),So.clear()}function By(C){!Number.isInteger(C)||C<0||C>=ot.value.length||So.set(C,Ac(C))}function Fy(C,B,V={}){const K=po[C];I4(C,B,V);const ee=po[C];ee&&ee>0?By(C):K&&So.delete(C)}function Hy(C,B){const V=mt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,ee;return(ee=(K=Po.get(C))==null?void 0:K.offsetHeight)!=null?ee:0});return V>0?V:mt("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function Wy(C,B={}){L4(C,B),bm()}const cr=F(()=>{var C;return!ze.value&&k.deferNodesUntilVisible!==!1&&!(((C=k.maxLiveNodes)!=null?C:0)<=0)&&!Nt.value&&!(ot.value.length>900)&&st.value}),zy=F(()=>!!de&&(cr.value||Nt.value)),Uy=F(()=>Nt.value||Mt.value),{liveNodeBufferResolved:wc,focusIndex:Hs,liveRange:Ao,updateLiveRange:ul}=(function(C,B){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:ee,clamp:he}=B,ke=F(()=>{var Ee;return Math.max(0,(Ee=C.liveNodeBuffer)!=null?Ee:60)}),Se=Z(0),Pe=No({start:0,end:0});return{liveNodeBufferResolved:ke,focusIndex:Se,liveRange:Pe,updateLiveRange:function(){const Ee=V.value;if(!K.value||Ee===0)return Pe.start=0,void(Pe.end=Ee);const We=Math.min(ee.value,Ee),De=ke.value,$e=he(Se.value-De,0,Math.max(0,Ee-We));Pe.start=$e,Pe.end=Math.min(Ee,$e+We)}}})(k,{parsedNodeCount:Kn,virtualizationEnabled:Nt,maxLiveNodesResolved:is,clamp:To}),ki=new Map,dl=new Map,ur=new Map,kd=[],Li=new Map,dr=new Set,qy=Z(0);let Kh=!1;const jy=F(()=>(qy.value,dr.size)),_s=new Map,bi=new Map,Vy=Z(0),Gh=F(()=>{Vy.value;let C=0;for(const B of _s.values())C+=Math.max(0,B);return C});let ws=null,Yh=!0,Ky=[0],Gy="";function Ws(){Yh=!0}const bd=F(()=>{if(!Nt.value)return ot.value.length;const C=wc.value,B=Math.max(Ao.end+C,Bn.value),V=Math.min(ot.value.length,B);return Math.max(wo.value,V)});function _d(){Kh||(Kh=!0,queueMicrotask(()=>{Kh=!1,qy.value+=1}))}function Yy(C,B,V="node-resize"){if(!we||typeof window>"u")return null;const K=window.setTimeout(()=>{dr.delete(K)&&_d();try{B()}finally{An(V)}},Math.max(0,C));return dr.add(K),_d(),K}function wd(C){we&&C!=null&&(dr.delete(C)&&_d(),window.clearTimeout(C))}function Xy(){if(we&&typeof window<"u")for(const C of dr)window.clearTimeout(C);dr.size&&(dr.clear(),_d()),kd.length=0,ur.clear()}function O4(C){var B,V;return(V=(B=Ct.value)==null?void 0:B[C])!=null?V:null}const{cancelScheduledFocusSync:Xh,scheduleFocusSync:_i}=(function(C){const{isClient:B,containerRef:V,virtualizationEnabled:K,requestFrame:ee,cancelFrame:he,syncFocusToScroll:ke}=C;let Se=null;function Pe(){var We,De,$e;return($e=(De=(We=V.value)==null?void 0:We.ownerDocument)==null?void 0:De.defaultView)!=null?$e:typeof window<"u"?window:null}function Ee(){if(!Se)return;const We=Pe();Se.viaTimeout?We?We.clearTimeout(Se.id):clearTimeout(Se.id):he?.(Se.id),Se=null}return{cancelScheduledFocusSync:Ee,scheduleFocusSync:function(We={}){if(!K.value)return;if(!B)return void ke(!0);if(We.immediate)return Ee(),void ke(!0);if(Se)return;const De=()=>{Se=null,ke()};if(ee)return void(Se={id:ee(De),viaTimeout:!1});const $e=Pe();Se={id:$e?$e.setTimeout(De,16):setTimeout(De,16),viaTimeout:!0}}}})({isClient:we,containerRef:S,virtualizationEnabled:Nt,requestFrame:pe,cancelFrame:Oe,syncFocusToScroll:function(C=!1){var B;if(!Nt.value)return;const V=xe.value||ne();if(!V)return;const K=V.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,ee=K?.defaultView||(typeof window<"u"?window:null),he=V===K?.documentElement||V===K?.body,ke=ot.value.length;if(!he&&ke>0&&H(V)){const Qe=mt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),Ze=mt("syncFocusToScroll.scrollTop",()=>V.scrollTop),_t=Ze<0?-Ze:Ze,lt=(function(St){var wt,Zt;const xt=ot.value;if(!xt.length)return 0;if(St<=0)return Math.max(0,xt.length-1);if(Xt.value){const Dt=(wt=tm()[xt.length])!=null?wt:0;return sk(Math.max(0,Dt-St))}if(cl.value===xt.length){const Dt=pr(0,xt.length);return Em(Math.max(0,Dt-St))}let Bt=St;for(let Dt=xt.length-1;Dt>=0;Dt--){const ln=(Zt=po[Dt])!=null?Zt:yi.value;if(Bt<=ln)return Dt;Bt-=ln}return 0})(Math.max(0,_t)+.5*Math.max(0,Qe)),ct=To(lt,0,Math.max(0,ke-1));return void((C||Math.abs(ct-Hs.value)>1)&&(Hs.value=ct,ul()))}const Se=he?null:mt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Pe=he?0:Se.top,Ee=he?mt("syncFocusToScroll.viewport.clientHeight",()=>{var Qe,Ze;return(Ze=(Qe=ee?.innerHeight)!=null?Qe:V.clientHeight)!=null?Ze:0}):Se.bottom,We=Ce.value;let De=null,$e=null;for(const[Qe,Ze]of We){if(!Ze)continue;const _t=mt("syncFocusToScroll.slot.getBoundingClientRect",()=>Ze.getBoundingClientRect());_t.bottom<=Pe||_t.top>=Ee||(De==null&&(De=Qe),$e=Qe)}if(De==null||$e==null){const Qe=S.value;if(!Qe)return;const Ze=he?{top:0}:mt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),_t=mt("syncFocusToScroll.fallback.scrollTop",()=>J(V,K,he)),lt=he?(()=>{const wt=mt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Qe.getBoundingClientRect()),Zt=(he?0:Ze.top)-wt.top;return Math.max(0,Zt)})():(()=>{const wt=ce(Qe,V);return Math.max(0,_t-wt)})(),ct=he?mt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var wt,Zt,xt,Bt;return(Bt=(xt=(Zt=ee?.innerHeight)!=null?Zt:(wt=K?.documentElement)==null?void 0:wt.clientHeight)!=null?xt:V.clientHeight)!=null?Bt:0}):mt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),St=Em(lt+.5*Math.max(0,ct));return Hs.value=To(St,0,Math.max(0,ot.value.length-1)),void ul()}const He=Math.round((De+$e)/2);!C&&Math.abs(He-Hs.value)<=1||(Hs.value=To(He,0,Math.max(0,ot.value.length-1)),ul())}}),{visibleNodeIndices:Qh,nodeVisibilityHandles:na,nodeVisibilityWatchStops:Sd,nodeVisibilityFallbackTimers:Qy,clearVisibilityFallback:Cd,markNodeVisible:fr,cleanupNodeVisibility:P4,destroyNodeVisibilityState:Zh}=NV({isClient:we,shouldTrackVisibleNodeIndices:()=>cr.value,shouldCleanupNodeVisibility:()=>Nt.value,onNodeMarkedVisible:C=>{Nt.value?_i():Hs.value=To(C,0,Math.max(0,ot.value.length-1))},onNodeVisibilityCleaned:C=>{Po.delete(C)&&Ak()}}),{cleanupScrollListener:Zy,setupScrollListener:R4}=(function(C){const{isClient:B,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:ee,resolveScrollContainer:he,scheduleFocusSync:ke,onScroll:Se}=C;let Pe=null,Ee=null;function We(){Pe&&(Pe(),Pe=null),Ee=null,ee.value=null}function De($e){const He=C.getScrollTop?C.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:We,setupScrollListener:function(){if(!B)return;if(!(($e=K?.value)!=null?$e:V.value))return void We();var $e;const He=he();if(!He)return void We();if(ee.value===He&&Pe)return;We(),Ee=De(He);const Qe=()=>{if(Se?.(),V.value){const Ze=(function(_t){const lt=De(_t),ct=Ee;Ee=lt;const St=Math.max(480,.75*(_t.clientHeight||0));return ct==null?lt>St?{immediate:!0}:void 0:Math.abs(lt-ct)>St?{immediate:!0}:void 0})(He);Ze?ke(Ze):ke()}};He.addEventListener("scroll",Qe,{passive:!0}),ee.value=He,Pe=()=>{He.removeEventListener("scroll",Qe)}}}})({isClient:we,virtualizationEnabled:Nt,listenerEnabled:Uy,scrollRootElement:xe,resolveScrollContainer:ne,scheduleFocusSync:_i,onScroll:function(){const C=Be.value;if(!C)return;const B=xc();if(!B||(function(K){if($c()>=at)return Ot=null,!1;const ee=Ot;if(ee==null)return!0;const he=Math.abs(K.scrollTop-ee)<=2;return he||(Ot=null),he})(B))return;const V=pk(B);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,C.distanceFromBottomPx))>32)&&aa("restore"):aa("restore")},getScrollTop:C=>{var B;const V=C.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,K=C===V.documentElement||C===V.body||C===V.scrollingElement;return mt("scrollListener.getScrollTop",()=>J(C,V,K))}});function To(C,B,V){return Math.min(Math.max(C,B),V)}function Jh(C){return C?.firstElementChild}function Jy(C,B){var V;return C?(V=C.matches)!=null&&V.call(C,B)?C:C.querySelector(B):null}function ek(){if(!Xt.value)return void(X.value=0);const C=mt("updateExperimentContainerWidth.clientWidth",()=>{var B,V;return(V=(B=S.value)==null?void 0:B.clientWidth)!=null?V:0});X.value=C>0?C:0}let Sc=null;function em(){Sc?.disconnect(),Sc=null}const tk=ui({loader:()=>zn(null,null,function*(){return(yield Qo(()=>import("./index8-ByeMRBS0.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:XM,delay:0,suspensible:!1});function nk(C){return C===tk}const ok=F(()=>u.value==="pre"?xs:u.value==="shiki"?tk:Dg),fl=F(()=>{const C=ot.value;if(!C.length||!Xt.value)return C.map(()=>null);const B=X.value||mt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(B)||B<=0?C.map(()=>null):C.map((V,K)=>{const ee=po[K],he=typeof ee=="number"&&ee>0;if(_o.value&&!he){const Se=n3(V,B,fe.value);if(Se)return Se}if(Ds.value&&V.type==="code_block"){const Se=(function(Pe){if(Pe.type!=="code_block")return null;const Ee=Fk(Pe,Nd(Pe));return nk(Ee)?"markdown":Ee===xs?"pre":Ee===ok.value||Ee===Dg?"monaco":null})(V);if(Se==="monaco"||Se==="markdown"||Se==="pre")return vV(V,{rendererKind:Se,monacoOptions:k.codeBlockMonacoOptions,showHeader:((ke=k.codeBlockProps)==null?void 0:ke.showHeader)!==!1})}var ke;return null})});function xd(C){var B;const V=po[C];if(Number.isFinite(V)&&V>0)return V;const K=(B=fl.value[C])==null?void 0:B.height;return Number.isFinite(K)&&K>0?K:Math.max(yi.value,(function(ee){var he,ke,Se,Pe,Ee,We,De,$e,He,Qe,Ze,_t,lt;const ct=ot.value[ee];if(!ct||typeof ct!="object")return 32;const St=String((he=ct.type)!=null?he:""),wt=ss()||640;switch(St){case"heading":return 44;case"paragraph":return oa(String((Se=(ke=ct.raw)!=null?ke:ct.content)!=null?Se:""),wt,34);case"list":{const Zt=Array.isArray(ct.items)?ct.items.length:1;return Math.max(48,30*Zt+12)}case"list_item":return oa(String((Ee=(Pe=ct.raw)!=null?Pe:ct.content)!=null?Ee:""),wt,34);case"blockquote":return oa(String((De=(We=ct.raw)!=null?We:ct.content)!=null?De:""),wt,56);case"table":{const Zt=Array.isArray(ct.rows)?ct.rows.length:Array.isArray(ct.children)?ct.children.length:3;return Math.max(120,38*Zt+48)}case"code_block":return oa(String((He=($e=ct.code)!=null?$e:ct.raw)!=null?He:""),wt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return oa(String((Ze=(Qe=ct.raw)!=null?Qe:ct.content)!=null?Ze:""),wt,96);case"thematic_break":return 24;default:return oa(String((lt=(_t=ct.raw)!=null?_t:ct.content)!=null?lt:""),wt,40)}})(C))}function oa(C,B,V,K=22){const ee=String(C??"");if(!ee)return V;const he=Math.max(18,Math.floor(Math.max(320,B)/8)),ke=ee.split(/\r?\n/).length,Se=Math.ceil(ee.length/he),Pe=Math.max(1,ke,Se);return Math.max(V,Math.ceil(Pe*K+12))}function Cc(C){const B=Number(C);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function tm(){var C,B;const V=ot.value.length,K=Cc(X.value||mt("getFallbackHeightPrefix.clientWidth",()=>{var Se;return((Se=S.value)==null?void 0:Se.clientWidth)||0})),ee=((C=o.virtualScroll)==null?void 0:C.measurementKey)==null?"":String(o.virtualScroll.measurementKey),he=[V,xo.count,Math.round(xo.total),Math.round(100*yi.value),ee,K,Xt.value?1:0,pS.value,Q.value].join(":");if(!Yh&&Gy===he)return Ky;const ke=new Array(V+1);ke[0]=0;for(let Se=0;Se<V;Se++)ke[Se+1]=ke[Se]+(Xt.value?xd(Se):(B=po[Se])!=null?B:yi.value);return Ky=ke,Gy=he,Yh=!1,ke}function sk(C){var B,V;const K=ot.value.length;if(K<=0||C<=0)return 0;const ee=tm();if(C>=((B=ee[K])!=null?B:0))return K-1;let he=0,ke=K-1,Se=K-1;for(;he<=ke;){const Pe=he+ke>>1;((V=ee[Pe+1])!=null?V:0)>=C?(Se=Pe,ke=Pe-1):he=Pe+1}return Se}function pr(C,B){var V,K;if(C>=B)return 0;if(Xt.value)return(function(ke,Se){var Pe,Ee;const We=ot.value.length,De=To(Math.trunc(ke),0,We),$e=To(Math.trunc(Se),De,We);if(De>=$e)return 0;const He=tm();return((Pe=He[$e])!=null?Pe:0)-((Ee=He[De])!=null?Ee:0)})(C,B);if(cl.value!==ot.value.length){let ke=0;for(let Se=C;Se<B;Se++)ke+=(V=po[Se])!=null?V:yi.value;return ke}const ee=jh.value,he=Vh.value;if(!ee.length||!he.length){let ke=0;for(let Se=C;Se<B;Se++)ke+=(K=po[Se])!=null?K:yi.value;return ke}return vd(ee,C,B)+(B-C-vd(he,C,B))*yi.value}Ke(()=>ot.value.length,C=>{Ws(),C<=0?yd():(C<cl.value&&E4(C),C!==cl.value&&gd(C))},{immediate:!0});const D4=F(()=>{if(!Nt.value)return ot.value.map((K,ee)=>({node:K,index:ee}));const C=ot.value.length,B=To(Ao.start,0,C),V=To(Ao.end,B,C);return ot.value.slice(B,V).map((K,ee)=>({node:K,index:B+ee}))}),nm=F(()=>Nt.value?pr(0,Math.min(Ao.start,ot.value.length)):0),om=F(()=>{if(!Nt.value)return 0;const C=ot.value.length;return pr(Math.min(Ao.end,C),C)});function ik(){if(!Xt.value)return 0;let C=0;const B=fl.value;for(let V=0;V<B.length;V++){if(!B[V])continue;const K=po[V];Number.isFinite(K)&&K>0||C++}return C}function rk(){const C=ot.value.length;return{totalNodes:C,measuredCount:xo.count,estimatedCount:ik(),averageNodeHeight:yi.value,topSpacerHeight:nm.value,bottomSpacerHeight:om.value,estimatedTotalHeight:pr(0,C),width:pl()}}function B4(){const C=ot.value,B=rk();return Lt(it({},B),{probe:{paragraphReady:!!fe.value.paragraph,listItemReady:!!fe.value.listItem,listWrapperOverhead:fe.value.listWrapperOverhead,headingReadyLevels:Object.entries(fe.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:C.map((V,K)=>{var ee,he,ke,Se,Pe,Ee,We,De,$e;return{index:K,type:V.type,estimateKind:(he=(ee=fl.value[K])==null?void 0:ee.kind)!=null?he:null,rendererKind:(Se=(ke=fl.value[K])==null?void 0:ke.rendererKind)!=null?Se:null,estimatedHeight:(Ee=(Pe=fl.value[K])==null?void 0:Pe.height)!=null?Ee:null,estimatedContentHeight:(De=(We=fl.value[K])==null?void 0:We.contentHeight)!=null?De:null,measuredHeight:($e=po[K])!=null?$e:null}})})}function sm(){return o.indexKey!=null?String(o.indexKey):Ln.value?`virtual-${On()}`:"markdown-renderer"}function lk(C){const B=String(C),V=`${sm()}-`;if(!B.startsWith(V))return null;const K=B.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const ee=Number(K[1]);return!Number.isInteger(ee)||ee<0||ee>=ot.value.length?null:ee}function On(){var C,B,V;const K=(C=o.virtualScroll)==null?void 0:C.sessionKey;return String(K!=null&&K!==""?K:(V=(B=o.indexKey)!=null?B:k.customId)!=null?V:Yt)}function ho(){var C;const B=(C=o.virtualScroll)==null?void 0:C.threadKey;return B==null||B===""?void 0:String(B)}function im(C){var B;return(C??"")===((B=ho())!=null?B:"")}function F4(){var C;const B=(C=o.virtualScroll)==null?void 0:C.measurementKey;return B==null?"":String(B)}function H4(){var C,B;const V=u.value,K=V==="monaco"?k.codeBlockMonacoOptions:void 0,ee=k.codeBlockProps,he=V==="shiki";return[k.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",yo(k.codeBlockMinWidth),yo(k.codeBlockMaxWidth),...he?[Np((C=ee?.themes)!=null?C:k.themes,(B=ee?.langs)!=null?B:k.langs)]:[],yo(K?.fontSize),yo(K?.lineHeight),yo(K?.fontFamily),yo(K?.tabSize),yo(K?.MAX_HEIGHT),yo(K?.wordWrap),yo(K?.wrappingIndent),yo(K?.padding),yo(ee?.showHeader),yo(ee?.showCopyButton),yo(ee?.showExpandButton),yo(ee?.showPreviewButton),yo(ee?.showCollapseButton),yo(ee?.showFontSizeButtons)].join("\0")}function Oi(){return[F4(),H4()].join("\0")}function pl(){return ss()}const Ad=F(()=>Cc(pl())),Ss=F(()=>[Oi(),Ad.value].join("\0")),W4=F(()=>{var C;return Ln.value?["virtual",(C=ho())!=null?C:"",On(),Ss.value].join("\0"):o.indexKey});function sa(){Vy.value+=1}function rm(C){return!(!C||!Number.isInteger(C.index)||C.index<0||C.index>=ot.value.length||C.sessionKey!==On()||C.threadKey!==ho()||C.layoutEpochKey!==Ss.value)}function ak(C){const B=String(C),V=bi.get(B);return V?rm(V)?V.index:null:lk(B)}function ck(C="async-node"){(_s.size||bi.size)&&(_s.clear(),bi.clear(),sa(),An(C))}const ia=Ut(u1,null),lm={reportHeight(C,B){if(!Mt.value)return;const V=ak(C);if(V==null)return;const K=ki.get(V);if(!K)return;const ee=Number(B),he=Hy(V,K);Fy(V,Number.isFinite(ee)&&ee>0?Math.max(ee,he||0):he)},markPending(C){if(!Mt.value)return;const B=lk(C);B!=null&&(function(V,K){var ee;const he=bi.get(V);if(he&&rm(he))return _s.set(V,Math.max(0,(ee=_s.get(V))!=null?ee:0)+1),sa(),void An("async-node");_s.set(V,1),bi.set(V,(function(ke){return{index:ke,sessionKey:On(),threadKey:ho(),layoutEpochKey:Ss.value}})(K)),sa(),An("async-node")})(String(C),B)},markSettled(C){if(!Mt.value)return;const B=String(C),V=ak(C);(V!=null||(function(K){return _s.has(String(K))})(B))&&(function(K){var ee;const he=(ee=_s.get(K))!=null?ee:0;return!(he<=0||(he<=1?(_s.delete(K),bi.delete(K)):_s.set(K,he-1),sa(),he===1&&An("async-node"),0))})(B)&&V!=null&&Pi()}};function z4(){let C=0;for(const B of ki.values())C+=mt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=B?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,C))}En(u1,{reportHeight(C,B){lm.reportHeight(C,B),ia?.reportHeight(C,B)},markPending(C){lm.markPending(C),ia?.markPending(C)},markSettled(C){lm.markSettled(C),ia?.markSettled(C)}});let am,cm=null,ra=null;function Td(C){return C!==!1&&C!=null&&C!==""}function uk(){return Nt.value?(function(){if(!Nt.value)return!0;const C=ot.value.length,B=To(Ao.start,0,C),V=To(Ao.end,B,C);if(B>=V)return!0;for(let K=B;K<V;K++)if(!Po.has(K)||Im(K)&&!ki.has(K))return!1;return!0})():wo.value>=bd.value}function um(){return j.value===!0&&!Y.value&&Gh.value===0&&dr.size===0&&Li.size===0&&ws==null&&uk()}function dk(){var C,B;if(((C=o.virtualScroll)==null?void 0:C.settleMode)!=="manual"||cm===On()&&am===ho())return!0;const V=(B=o.virtualScroll)==null?void 0:B.settledToken;return!!Td(V)&&ra===Bc(V)}function dm(){return um()&&dk()}function U4(C,B){return B.totalNodes<=0?C==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?C==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function hl(C="manual",B){const V=rk(),K=(function(ee){return ee||(j.value!==!0?ot.value.length>0?"streaming":"estimating":!uk()||Li.size>0||ws!=null?"measuring":dm()?"settled":"settling")})(B);return{sessionKey:On(),threadKey:ho(),phase:K,nodeCount:V.totalNodes,liveRange:{start:Ao.start,end:Ao.end},renderedCount:wo.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:z4(),totalHeight:fk(),width:V.width,final:j.value===!0,stable:dm(),confidence:U4(K,V),reason:C}}function xc(){const C=xe.value||ne(),B=S.value;if(!C||!B)return null;const V=C.ownerDocument||B.ownerDocument||document,K=C===V.documentElement||C===V.body||C===V.scrollingElement,ee=mt("getScrollBox.scrollTop",()=>J(C,V,K)),he=mt("getScrollBox.scrollHeight",()=>{var Se,Pe,Ee,We,De;return K?Math.max((Pe=(Se=V.documentElement)==null?void 0:Se.scrollHeight)!=null?Pe:0,(We=(Ee=V.body)==null?void 0:Ee.scrollHeight)!=null?We:0,(De=C.scrollHeight)!=null?De:0):C.scrollHeight}),ke=mt("getScrollBox.clientHeight",()=>{var Se;return K?((Se=V.documentElement)==null?void 0:Se.clientHeight)||C.clientHeight||0:C.clientHeight});return{root:C,doc:V,isViewportRoot:K,scrollTop:ee,scrollHeight:he,clientHeight:ke}}function fk(){const C=ot.value.length,B=Math.max(0,pr(0,C)),V=mt("getRendererLogicalHeight.offsetHeight",()=>{var ee,he;return(he=(ee=S.value)==null?void 0:ee.offsetHeight)!=null?he:0}),K=Math.max(0,V>0?V:mt("getRendererLogicalHeight.scrollHeight",()=>{var ee,he;return(he=(ee=S.value)==null?void 0:ee.scrollHeight)!=null?he:0}));return C<=0?Math.ceil(V):Nt.value?B>0?Math.max(1,Math.ceil(B),(function(){let ee=nm.value+om.value;for(const he of Po.values())he&&(ee+=Math.max(0,mt("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})(B,K)):Math.max(1,Math.ceil(K)):Mt.value?B>0||xo.count>0||ik()>0?(ii.value&&wo.value,Math.max(1,Math.ceil(K),Math.ceil(B))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(B))}function pk(C){const B=S.value;if(!B)return null;const V=mt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(ee){return ee.isViewportRoot?ee.clientHeight:mt("getViewportBottomInRoot.getBoundingClientRect",()=>ee.root.getBoundingClientRect().bottom)})(C)-V.bottom}function q4(C={}){const B=C.requireViewport!==!1,V=(function(he=64){const ke=xc(),Se=S.value;if(!ke||!Se)return!1;const Pe=(function(We){if(We.isViewportRoot)return{top:0,bottom:We.clientHeight};const De=mt("getVirtualViewportRect.getBoundingClientRect",()=>We.root.getBoundingClientRect());return{top:De.top,bottom:De.bottom}})(ke),Ee=mt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Se.getBoundingClientRect());return Ee.bottom>=Pe.top-he&&Ee.top<=Pe.bottom+he})();if(B&&!V)return null;const K=(function(){const he=xc(),ke=S.value;if(!he||!ke||Math.max(0,he.scrollHeight-he.scrollTop-he.clientHeight)>64)return null;const Se=pk(he);return Se==null?null:Se>=-8&&Se<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Se)}:null})();if(K)return{anchor:K,captured:!0};const ee=Fn();if(ee)return{anchor:{type:"node",nodeIndex:ee.nodeIndex,offsetWithinNodePx:ee.offsetWithinNodePx},captured:V};if(C.allowFallback===!0){const he=(function(){const ke=ot.value.length;return ke<=0?null:{type:"node",nodeIndex:To(Hs.value,0,Math.max(0,ke-1)),offsetWithinNodePx:0}})();return he?{anchor:he,captured:!1}:null}return null}function fm(C){let B=2166136261;for(let V=0;V<C.length;V++)B^=C.charCodeAt(V),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function j4(C,B){let V=C;for(let K=0;K<B.length;K++)V^=B.charCodeAt(K),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const V4=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Md(C,B=new WeakSet,V=0){if(C==null||typeof C=="number"||typeof C=="boolean")return String(C);if(typeof C=="string")return`s:${(function(K){const ee=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${fm(ee)}`})(C)}`;if(typeof C=="function")return"fn";if(typeof C!="object")return typeof C;if(B.has(C))return"cycle";if(V>=6)return"max-depth";B.add(C);try{if(Array.isArray(C)){if(C.length<=160){const Ee=[];for(let We=0;We<C.length;We++)Ee.push(Md(C[We],B,V+1));return`a:${C.length}:${Ee.join(",")}`}const he=[],ke=[],Se=Math.max(0,C.length-32);let Pe=2166136261;for(let Ee=0;Ee<C.length;Ee++){const We=Md(C[Ee],B,V+1);Pe=j4(Pe,We),Ee<32&&he.push(We),Ee>=Se&&ke.push(We)}return[`a:${C.length}`,`h=${he.join(",")}`,`t=${ke.join(",")}`,`all=${(Pe>>>0).toString(36)}`].join(":")}const K=C,ee=Object.keys(K).filter(he=>{const ke=K[he];return he!=="parent"&&he!=="el"&&he!=="component"&&(ke==null||typeof ke=="string"||typeof ke=="number"||typeof ke=="boolean"||V4.has(he))}).sort();return`o:${ee.length}:${ee.map(he=>`${he}=${Md(K[he],B,V+1)}`).join(";")}`}finally{B.delete(C)}}let hk=-1,pm="";function Ac(C){const B=ot.value[C];return B?fm(Md(B)):""}function hm(){const C=Q.value;if(hk===C)return pm;let B=2166136261;for(let V=0;V<ot.value.length;V++){const K=Ac(V);for(let ee=0;ee<K.length;ee++)B^=K.charCodeAt(ee),B=Math.imul(B,16777619)}return pm=(B>>>0).toString(36),hk=C,pm}function la(C,B={}){var V;const K=B.includeHeightCache===!0,ee=(V=B.includeContentHash)!=null?V:K,he=K?(function(Se){const Pe=(function(){var Ze,_t;const lt=Number((_t=(Ze=o.virtualScroll)==null?void 0:Ze.heightCacheLimit)!=null?_t:5e3);return!Number.isFinite(lt)||lt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(lt))})();if(!Number.isFinite(Pe)||Se.length<=Pe)return Se;const Ee=new Map,We=Ze=>{!Ze||Ee.size>=Pe||Ee.set(Ze.index,Ze)},De=ot.value.length,$e=To(Ao.start-2*wc.value,0,De),He=To(Ao.end+2*wc.value,$e,De);for(const Ze of Se)Ze.index>=$e&&Ze.index<He&&We(Ze);const Qe=Math.max(1,Math.ceil(Se.length/Pe));for(let Ze=0;Ze<Se.length&&Ee.size<Pe;Ze+=Qe)We(Se[Ze]);for(let Ze=Se.length-1;Ze>=0&&Ee.size<Pe;Ze-=Qe)We(Se[Ze]);return Array.from(Ee.values()).sort((Ze,_t)=>Ze.index-_t.index).slice(0,Pe)})(N4().map(Se=>{var Pe;const Ee=ot.value[Se.index];return Ee?Lt(it({},Se),{nodeType:String((Pe=Ee.type)!=null?Pe:""),signature:Ac(Se.index)}):null}).filter(Se=>!!Se)):[],ke=q4({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ke||he.length||B.includeEmptyState===!0?Lt(it({sessionKey:C.sessionKey,threadKey:C.threadKey},ke?{anchor:ke.anchor,anchorCaptured:ke.captured}:{anchorCaptured:!1}),{metrics:C,width:C.width,contentHash:ee?hm():void 0,measurementKey:Oi()||void 0,heightCache:he.length?he:void 0}):null}function mm(C){var B,V;const K=xc();if(!K)return;const ee=(function(Se){const Pe=S.value;if(!Pe)return null;const Ee=ce(Pe,Se.root),We=ot.value.length,De=mt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Pe.offsetHeight||0),$e=Math.max(0,De>0?De:We>0?mt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Pe.scrollHeight||0):0),He=fk();return Ee+Math.max($e,He)})(K);if(ee==null)return;const he=Math.max(0,C.distanceFromBottomPx),ke=Math.max(0,ee-K.clientHeight-he);(function(Se){at=$c()+120,Ot=Se})(ke),K.isViewportRoot?(V=(B=K.doc.defaultView)==null?void 0:B.scrollTo)==null||V.call(B,0,ke):vS(K.root,K.doc,ke,{isReverseFlexScrollRoot:H,getNormalizedScrollTop:J})}const gm=[];function mk(){if(we)for(et!=null&&(Oe?.(et),et=null);gm.length;){const C=gm.pop();C!=null&&window.clearTimeout(C)}}function aa(C){const B=!!Be.value;Be.value=null,at=0,Ot=null,mk(),B&&C&&An(C)}function ca(){if(!Be.value||!we||et!=null)return;const C=()=>{et=null;const B=Be.value;B&&mm(B)};et=pe?pe(C):null,et==null&&C()}function gk(C,B={}){const V=ot.value.length;return V<=0?[]:C.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=V)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(B.requireSignature&&!K.signature)&&!(B.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(ee){var he;const ke=ot.value[ee.index];return!(!ke||ee.nodeType&&ee.nodeType!==String((he=ke.type)!=null?he:"")||ee.signature&&ee.signature!==Ac(ee.index))})(K))}function vk(C){const B=Cc(pl()),V=Cc(C);return B!==-1&&V!==-1&&B===V}function vm(C){var B;const V=Number(C?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((B=C?.metrics)==null?void 0:B.width);return Number.isFinite(K)&&K>0?K:null}function yk(C){var B;return C.sessionKey===On()&&!!im(C.threadKey)&&((B=C.measurementKey)!=null?B:"")===Oi()&&!!vk(vm(C))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(kk(V)?K.some(ee=>!!(ee.nodeType||ee.signature)):K.some(ee=>!!ee.signature))})(C)}function kk(C){return!!(C.contentHash&&C.contentHash===hm())}function K4(C){return!kk(C)}let ml=null,gl=null,Ed=null,Tc=null,Mc=null;function ym(C){var B;const V=C.map(ee=>{var he,ke;return[ee.index,Math.round(10*ee.height),(he=ee.nodeType)!=null?he:"",(ke=ee.signature)!=null?ke:""].join("")}).join(""),K=Cc(pl());return[(B=ho())!=null?B:"",On(),Oi(),ot.value.length,K,C.length,fm(V)].join(":")}function bk(C=(B=>(B=o.virtualScroll)==null?void 0:B.heightCache)()){if(!Mt.value||!C?.length||ot.value.length<=0||!vk((B=o.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const V=gk(C,{requireSignature:!0});if(!V.length)return!1;const K=ym(V);return K===ml?(gl="standalone",!0):(Wy(V,{mode:"merge"}),Ws(),ml=K,gl="standalone",Lc(),An("restore"),!0)}function km(C,B={}){var V,K,ee;if(!Mt.value||!C||C.sessionKey!==On()||!im(C.threadKey)||ot.value.length<=0)return!1;const he=!!((V=C.heightCache)!=null&&V.length)&&!Id(),ke=!C.anchor||C.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:C.anchor,Se=B.restoreAnchor===!0&&!!ke&&!Id()&&Number(vm(C))>0;let Pe=!1;if((K=C.heightCache)!=null&&K.length&&yk(C)){const We=gk(C.heightCache,{requireCompatibilityMetadata:!C.contentHash,requireSignature:K4(C)});We.length&&(Wy(We,{mode:"merge"}),Ws(),ml=ym(We),gl="restore",Lc(),Pe=!0)}if(he||Se)return!1;if(!B.restoreAnchor||!ke)return Pe&&An("restore"),!0;const Ee=(function(We,De){var $e;const He=We.anchor,Qe=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[($e=ho())!=null?$e:"",On(),Oi(),Ad.value,De,Qe].join(":")})(C,(ee=B.restoreToken)!=null?ee:"imperative");return Ed===Ee?(Pe&&An("restore"),!0):(Ed=Ee,(function(We){const De=()=>{if(We.type==="node")return aa(),void Co({nodeIndex:We.nodeIndex,offsetWithinNodePx:We.offsetWithinNodePx});if(nn(),Vt.value=null,Be.value=We,mk(),mm(We),we)for(const $e of[0,120,280,480])gm.push(window.setTimeout(()=>{const He=Be.value;He&&mm(He)},$e))};(function($e){if(!Nt.value)return!1;const He=ot.value.length;return!(He<=0||(Hs.value=$e.type==="node"?To($e.nodeIndex,0,He-1):He-1,ul(),0))})(We)?ht(De):De()})(ke),An("restore"),!0)}function Id(){const C=pl();return Number.isFinite(C)&&C>0}function _k(C){var B;return C.sessionKey===On()&&!!im(C.threadKey)&&(ot.value.length<=0||!(!((B=C.heightCache)!=null&&B.length)||Id())||!(!(C.anchor&&Number(vm(C))>0)||Id()))}function bm(){So.clear();for(const C of Object.keys(po)){const B=Number(C);Number.isInteger(B)&&B>=0&&B<ot.value.length&&By(B)}}function Ec(){ws!=null&&(Oe?.(ws),ws=null),$m()}function wk(){return!we||Wt?Promise.resolve():new Promise(C=>{let B=!1,V=null;const K=()=>{B||(B=!0,V!=null&&window.clearTimeout(V),C())};if(pe)return pe(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function _m(C,B=ho(),V=Ss.value){return On()===C&&ho()===B&&Ss.value===V}function wm(){return zn(this,arguments,function*(C={}){var B,V,K,ee,he;const ke=On(),Se=ho(),Pe=Ss.value,Ee=(B=C.frames)!=null?B:2,We=(V=C.timeoutMs)!=null?V:120,De=(K=C.reason)!=null?K:"manual",$e=C.expectedSettledTokenKey,He=C.flushPendingTimers===!0,Qe=hl(De),Ze=()=>Lt(it({},Qe),{phase:Qe.final?"settling":Qe.phase,stable:!1,confidence:Qe.confidence==="final"?"mixed":Qe.confidence,reason:De}),_t=()=>_m(ke,Se,Pe)&&($e==null||Nc()===$e);for(let wt=0;wt<Ee;wt++){if(yield ht(),!_t()||(yield wk(),!_t()))return Ze();Pi(),Ec()}if(yield(function(wt){return!we||wt<=0?Promise.resolve():new Promise(Zt=>window.setTimeout(Zt,wt))})(We),!_t()||(He&&Xy(),Pi(),Ec(),!_t()))return Ze();const lt=um();lt&&(cm=ke,am=Se,((ee=o.virtualScroll)==null?void 0:ee.settleMode)==="manual"&&$e!=null&&Td((he=o.virtualScroll)==null?void 0:he.settledToken)&&Nc()===$e&&(ra=Bc(o.virtualScroll.settledToken)));const ct=_t()&<&&dk(),St=hl(De,ct?"final":void 0);return Tm(St,!0),St})}let Sm="content",vl=null,yl=null,Cm=0,Ic=null,ua=null,xm=null,Am=null;function $c(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Sk(C){var B,V;const K=Ic;if(!K)return!0;const ee=(V=(B=o.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?V:1;return Math.abs(C.totalHeight-K.totalHeight)>ee||C.sessionKey!==K.sessionKey||C.phase!==K.phase||C.stable!==K.stable||C.final!==K.final||C.threadKey!==K.threadKey||C.nodeCount!==K.nodeCount||C.measuredCount!==K.measuredCount||C.width!==K.width}function yo(C){if(C==null)return"";if(typeof C=="string"||typeof C=="number"||typeof C=="boolean")return String(C);try{return JSON.stringify(C)}catch{return String(C)}}function Nc(C=(B=>(B=o.virtualScroll)==null?void 0:B.settledToken)()){return yo(C)}function Ck(C,B){var V,K;return[C,B.sessionKey,(V=B.threadKey)!=null?V:"",Oi(),hm(),yo((K=o.virtualScroll)==null?void 0:K.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Lc(){xm=null,Am=null,ua=null}function G4(C){const B=C.heightCache;return B?.length?ym(B):""}function Oc(C){var B,V,K;const ee=C.metrics,he=C.anchor?(ke=C.anchor).type==="bottom"?`bottom:${Math.round(ke.distanceFromBottomPx)}`:`node:${ke.nodeIndex}:${Math.round(ke.offsetWithinNodePx)}`:"none";var ke;return[C.sessionKey,(B=C.threadKey)!=null?B:"",(V=C.measurementKey)!=null?V:Oi(),(K=C.contentHash)!=null?K:"",G4(C),he,C.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 Tm(C,B=!1){if(!Mt.value||(function(ke=!1){return!ke&&Ln.value&&!uo.value})(B))return;const V=B||Sk(C),K=(function(ke,Se=!1){return Se||ke.stable||ke.phase==="final"?{state:la(ke,{includeHeightCache:!0})}:{state:la(ke)}})(C,B),ee=K.state,he=!!(ee&&(V||(function(ke,Se=!1){return!!Se||Oc(ke)!==ua})(ee,B)));if(V&&(E(C),Ic=C,Cm=$c()),ee&&he&&(M(ee),ee.anchor&&L(ee.anchor),ua=Oc(ee)),C.stable){const ke=Ck("settled",C);if(ke!==xm){xm=ke;const Se=la(C,{includeHeightCache:!0});Se&&(M(Se),ua=Oc(Se)),(function(Pe){s("render-settled",Pe)})(C)}}if(C.phase==="final"){const ke=Ck("final",C);if(ke!==Am){Am=ke;const Se=la(C,{includeHeightCache:!0});Se&&(M(Se),ua=Oc(Se)),(function(Pe){s("render-final",Pe)})(C)}}}function Mm(){vl!=null&&(Oe?.(vl),vl=null),yl!=null&&we&&(window.clearTimeout(yl),yl=null)}function xk(){vl=null,yl=null,(function(C){if(Li.size>0||ws!=null)return!0;switch(C){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Sm)&&(Pi(),Ec()),Tm(hl(Sm))}function An(C){var B,V;if(!Mt.value||(Sm=C,vl!=null||yl!=null))return;const K=Math.max(0,(V=(B=o.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?V:32),ee=Math.max(0,K-($c()-Cm)),he=()=>{yl=null,vl=pe?pe(xk):null,vl==null&&xk()};we&&ee>0?yl=window.setTimeout(he,ee):he()}function Em(C){var B;if(C<=0)return 0;const V=ot.value;if(Xt.value)return sk(C);if(cl.value===V.length&&jh.value.length&&Vh.value.length){const ee=yi.value,he=jh.value,ke=Vh.value,Se=De=>De<=0?0:vd(he,0,De)+(De-vd(ke,0,De))*ee;let Pe=0,Ee=V.length-1,We=V.length-1;for(;Pe<=Ee;){const De=Pe+Ee>>1;Se(De+1)>=C?(We=De,Ee=De-1):Pe=De+1}return We}let K=C;for(let ee=0;ee<V.length;ee++){const he=(B=po[ee])!=null?B:yi.value;if(K<=he)return ee;K-=he}return Math.max(0,V.length-1)}function Ak(){oe.value+=1}function Im(C){return!(ii.value&&C>=wo.value)&&(!cr.value||C<Bn.value||Qh.value.has(C))}function da(C){const B=Sd.get(C);B&&(B(),Sd.delete(C));const V=na.get(C);V&&(V.destroy(),na.delete(C)),Cd(C)}function Tk(C,B){let V=!1;if(B){const he=Po.get(C);Po.set(C,B),he!==B&&(V=!0)}else Po.delete(C)&&(V=!0);if(V&&Ak(),B||Cd(C),!zy.value||!de||!Nt.value&&cr.value&&!z.value&&na.size>=640&&(z.value||(z.value=!0,Zh()),!zy.value||!de))return da(C),void(B&&fr(C,!0));if(C<Bn.value&&!Nt.value||Qh.value.has(C))return da(C),void fr(C,!0);if(!B)return void da(C);da(C);const K=de(B,{rootMargin:"400px"});if(!K)return;na.set(C,K),fr(C,K.isVisible.value),cr.value&&(function(he){if(!we||!cr.value)return;Cd(he);const ke=he%17*23,Se=window.setTimeout(()=>{if(Qy.delete(he),!cr.value||Qh.value.has(he))return;const Pe=Po.get(he);if(!Pe)return;const Ee=ne(Pe),We=Pe.ownerDocument||document,De=We.defaultView||window,$e=!Ee||Ee===We.documentElement||Ee===We.body,He=!$e&&Ee?mt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ee.getBoundingClientRect()):null,Qe=$e?0:He.top,Ze=$e?mt("nodeVisibilityFallback.clientHeight",()=>{var lt,ct;return(ct=(lt=De.innerHeight)!=null?lt:Ee?.clientHeight)!=null?ct:0}):He.bottom,_t=mt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Pe.getBoundingClientRect());_t.bottom>=Qe-500&&_t.top<=Ze+500&&fr(he,!0)},1800+ke);Qy.set(he,Se)})(C);let ee=null;ee=Ke(()=>K.isVisible.value,he=>{if(he){Cd(C),fr(C,!0),ee?.(),Sd.delete(C),na.get(C)===K&&na.delete(C);try{K.destroy()}catch{}}},{immediate:!0}),Sd.set(C,ee),Nt.value&&_i()}function $m(){ws=null;for(const[C,B]of Li)Li.delete(C),ki.get(C)===B.el&&dl.get(C)===B.version&&Fy(C,B.height,{allowShrink:B.allowShrink})}function fa(){ws!=null&&(Oe?.(ws),ws=null),Li.clear()}function $d(C,B){(function(V,K,ee){var he;if(!Number.isFinite(ee)||ee<=0||ki.get(V)!==K)return;const ke=dl.get(V);if(ke==null)return;const Se=ot.value[V],Pe=Y.value&&j.value!==!0&&!((he=o.nodes)!=null&&he.length)&&V>=ot.value.length-2,Ee=!(Se?.loading===!0||Pe),We=Li.get(V),De=We?We.allowShrink&&Ee:Ee,$e=We&&!De?Math.max(We.height,ee):ee;Li.set(V,{height:$e,allowShrink:De,version:ke,el:K}),ws==null&&(ws=pe?pe($m):null,ws==null&&$m())})(C,B,Hy(C,B))}function Pi(){for(const[C,B]of ki)B&&$d(C,B)}function Mk(){Ne?.disconnect(),Ne=null,ft.clear()}function Nm(){for(;kd.length;)wd(kd.pop())}Ke(uo,C=>{C&&An("content")},{flush:"post"}),t({getVirtualMetrics:hl,captureVirtualState:function(C={}){var B;return la(hl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:C.allowFallbackAnchor===!0,requireViewport:C.requireViewport===!0,includeEmptyState:(B=C.includeEmptyState)==null||B})},restoreVirtualState:function(C,B={}){const V=B.restoreAnchor===!0,K=B.restoreToken==null?"imperative":String(B.restoreToken);Tc=C,Mc={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!km(C,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&_k(C)||(Tc=null,Mc=null)},forceMeasure:function(C="manual"){return zn(this,null,function*(){yield ht(),yield wk(),Pi(),Ec(),yield ht();const B=hl(C);return Tm(B,!0),B})},settle:wm,scrollToNode:function(C,B="start"){aa(),nn();const V=ot.value.length;if(V<=0)return;const K=To(C,0,V-1),ee=()=>{var he;const ke=Fs({nodeIndex:K,offsetWithinNodePx:0}),Se=xd(K),Pe=xc(),Ee=(he=Pe?.clientHeight)!=null?he:0,We=qt();let De=ke;if(B==="center")De=ke-Ee/2+Se/2;else if(B==="end")De=ke-Ee+Se;else if(B==="nearest"&&We!=null){if(ke>=We&&ke+Se<=We+Ee)return;De=ke<We?ke:ke-Ee+Se}Bs(Math.max(0,De)),_i({immediate:!0}),Nt.value&&(Hs.value=K,ul())};if(Nt.value)return Hs.value=K,ul(),void ht(ee);ee()}}),Ke(()=>Xe.value,C=>{if(!C){Mk();for(const B of ur.values())for(const V of B)wd(V);ur.clear(),dl.clear(),Nm(),fa()}},{immediate:!0}),Ke(j,C=>{C&&(function(){if(we&&j.value&&ki.size){Nm();for(const B of[80,240,640]){const V=Yy(B,()=>{for(const[K,ee]of ki)ee&&$d(K,ee)},"final");V!=null&&kd.push(V)}}})(),An(C?"final":"content")}),Ke([()=>ot.value.length,()=>wo.value],()=>{Be.value&&ca(),An("content")},{flush:"post",immediate:!0}),Ke([()=>Ao.start,()=>Ao.end],()=>{An("batch")},{flush:"post"});const{cleanupBatchScheduler:Y4}=(function(C){const{props:B,isClient:V,isTestEnv:K,parsedNodesIdentity:ee,parsedNodeCount:he,desiredRenderedCount:ke,datasetKey:Se,batchingEnabled:Pe,incrementalRenderingActive:Ee,resolvedBatchSize:We,resolvedInitialBatch:De,renderedCount:$e,adaptiveBatchSize:He,previousRenderContext:Qe,previousBatchConfig:Ze,requestFrame:_t,cancelFrame:lt,hasIdleCallback:ct,cleanupNodeVisibility:St,onDatasetKeyChanged:wt,onDatasetChanged:Zt}=C;let xt=null,Bt=null,Dt=!1,ln=null,Cs=null,Vo=0,ri=!1,hr=!1;const mr=new Set,bl=new Set;function Vk(){if(V){xt!=null&&(lt?.(xt),xt=null),Bt!=null&&(window.clearTimeout(Bt),Bt=null),Cs!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Cs),Cs=null),Vo+=1;for(const Do of mr)lt?.(Do);mr.clear();for(const Do of bl)window.clearTimeout(Do);bl.clear(),Dt=!1,ln=null,ri=!1,hr=!1}}function Bd(){return typeof performance<"u"?performance.now():Date.now()}function Kk(Do){(function(Ri){var gr;if(!Ee.value)return;const Di=Math.max(2,(gr=B.renderBatchBudgetMs)!=null?gr:6),Bi=Math.max(1,We.value||1),li=Math.max(1,Math.floor(Bi/4));Ri>1.2*Di?He.value=Math.max(li,Math.floor(.7*He.value)):Ri<.5*Di&&He.value<Bi&&(He.value=Math.min(Bi,Math.ceil(1.2*He.value)))})(Do),ri=!1;const rs=hr||$e.value<ke.value;hr=!1,rs&&Xk()}function Gk(Do,rs={}){var Ri,gr;if(!Ee.value)return;const Di=ke.value;if($e.value>=Di)return;const Bi=Math.max(1,Do),li=()=>{const ma=Bd();let ga=0;xt=null,Bt=null,Cs=null,Dt=!1;const va=ln??Bi;ln=null;const Hm=Bd();$e.value=Math.min(Di,$e.value+va),St($e.value),ga=Bd()-Hm,(function(Wm,Qk){if(!V)return void Kk(Qk);ri=!0;const Zk=++Vo;ht().then(()=>{var Jk;if(Zk!==Vo)return;const mE=Bd(),gE=Math.max(Qk,mE-Wm),eb=()=>{Zk===Vo&&Kk(gE)};if(_t){let nb=!1,Fi=null;const ob=()=>{nb||(nb=!0,eb())},Fd=_t(()=>{mr.delete(Fd),Fi!=null&&(window.clearTimeout(Fi),bl.delete(Fi),Fi=null),ob()});return mr.add(Fd),Fi=window.setTimeout(()=>{Fi!=null&&bl.delete(Fi),Fi=null,lt?.(Fd),mr.delete(Fd),ob()},Math.max(32,(Jk=B.renderBatchIdleTimeoutMs)!=null?Jk:120)),void bl.add(Fi)}const tb=window.setTimeout(()=>{bl.delete(tb),eb()},0);bl.add(tb)})})(ma,ga)};if(!V||rs.immediate)return void li();const vr=Math.max(0,(Ri=B.renderBatchDelay)!=null?Ri:16);if(ln=ln!=null?Math.max(ln,Bi):Bi,!Dt){if(Dt=!0,!K&&ct&&window.requestIdleCallback){const ma=Math.max(0,(gr=B.renderBatchIdleTimeoutMs)!=null?gr:120);return void(Cs=window.requestIdleCallback(()=>li(),{timeout:ma}))}_t&&!K?xt=_t(()=>{vr!==0?Bt=window.setTimeout(()=>li(),vr):li()}):Bt=window.setTimeout(()=>li(),vr)}}function Yk(Do,rs={}){ri?hr=!0:Do==null?Xk():Gk(Do,rs)}function Xk(){Ee.value&&Gk(Pe.value?Math.max(1,Math.round(He.value)):Math.max(1,We.value))}return Ke([ee,he,Se,Ee,We,De,()=>B.renderBatchDelay],()=>{var Do;const rs=he.value,Ri=Qe.value,gr=Se.value,Di=!Object.is(gr,Ri.key),Bi=rs!==Ri.total,li=Di||Bi;Qe.value={key:gr,total:rs};const vr=Ze.value,ma=(Do=B.renderBatchDelay)!=null?Do:16,ga=vr.batchSize!==We.value||vr.initial!==De.value||vr.delay!==ma||vr.enabled!==Ee.value;Ze.value={batchSize:We.value,initial:De.value,delay:ma,enabled:Ee.value},Di&&wt(rs),(li||ga||!Ee.value)&&Vk(),(li||ga)&&(He.value=Math.max(1,We.value||1)),li&&Zt();const va=ke.value;if(!rs)return $e.value=0,void St(0);if(!Ee.value)return $e.value=va,void St($e.value);const Hm=Di||Ri.total===0;$e.value=Hm||ga?Math.min(va,De.value):Math.min($e.value,va);const Wm=Math.max(1,De.value||We.value||rs);$e.value<va?Yk(Wm,{immediate:!V}):St($e.value)},{immediate:!0}),Ke(ke,(Do,rs)=>{Ee.value&&(typeof rs=="number"&&Do<=rs||Do>$e.value&&Yk())}),{cleanupBatchScheduler:Vk}})({props:k,isClient:we,isTestEnv:Wt,parsedNodesIdentity:_n,parsedNodeCount:Kn,desiredRenderedCount:bd,datasetKey:W4,batchingEnabled:bs,incrementalRenderingActive:ii,resolvedBatchSize:fo,resolvedInitialBatch:Bn,renderedCount:wo,adaptiveBatchSize:ll,previousRenderContext:ta,previousBatchConfig:al,requestFrame:pe,cancelFrame:Oe,hasIdleCallback:Qt,cleanupNodeVisibility:P4,onDatasetKeyChanged:C=>{fa(),yd(),Ws(),Lc(),C>0&&gd(C)},onDatasetChanged:()=>{Nt.value&&_i({immediate:!0})}});Ke([Uy,Nt,()=>S.value,()=>ye()],([C,B])=>{if(!C)return Zy(),void Xh();R4(),B?_i({immediate:!0}):Xh()},{flush:"post",immediate:!0}),Ke([()=>ot.value.length,()=>Nt.value],C=>zn(null,[C],function*([B,V]){V&&B&&we&&(yield ht(),_i({immediate:!0}))}),{flush:"post"}),Ke(Xt,C=>{C&&(function(){var B;if($n.value&&Ge.value&&Ye.value&&((B=Ct.value)!=null&&B[1]))return;const V=Dr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=Dr({type:"list_item",children:[V],raw:"- Probe paragraph text"}),ee=Dr({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});$n.value=V,Ge.value=K,Ye.value=ee;const he={1:null,2:null,3:null,4:null,5:null,6:null};for(let ke=1;ke<=6;ke++)he[ke]=Dr({type:"heading",level:ke,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ke)} Probe heading`});Ct.value=he})()},{immediate:!0}),Ke([()=>S.value,Xt],()=>{if(!Xt.value)return em(),void(X.value=0);ek(),em(),Xt.value&&S.value&&typeof ResizeObserver<"u"&&(Sc=new ResizeObserver(()=>{ek(),Vt.value&&Jn(),Be.value&&ca(),An("resize")}),Sc.observe(S.value))},{immediate:!0}),Ke([Xt,jo,Ss],()=>zn(null,null,function*(){if(!Xt.value)return fe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ws();yield ht(),(function(){if(!Xt.value||typeof window>"u")return fe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ws();const C={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=Jy(Jh(I.value),".paragraph-node");C.paragraph=jg(I.value,B,"pre-wrap");const V=Jh(P.value),K=V?.querySelector(".paragraph-node");C.listItem=jg(P.value,K,"pre-wrap");const ee=mt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ke,Se;return(Se=(ke=D.value)==null?void 0:ke.offsetHeight)!=null?Se:0}),he=mt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ke,Se;return(Se=(ke=P.value)==null?void 0:ke.offsetHeight)!=null?Se:0});C.listWrapperOverhead=Math.max(0,ee-he);for(let ke=1;ke<=6;ke++){const Se=Jy(Jh(W[ke]),`h${ke}`);C.headings[ke]=jg(W[ke],Se,"pre-wrap")}fe.value=C,Ws()})()}),{flush:"post",immediate:!0}),Ke(()=>ot.value.length,()=>{Nt.value&&_i({immediate:!0})}),Ke([Xt,X],()=>{Ws(),Nt.value&&_i({immediate:!0}),Vt.value&&Jn(),Be.value&&ca(),An("resize")},{immediate:!1}),Ke(()=>cr.value,C=>{if(C)for(const[B,V]of Po)Tk(B,V);else{Zh();for(const[B,V]of Po)V&&fr(B,!0)}},{immediate:!1}),Ke([()=>k.viewportPriority,()=>ot.value.length],([C,B])=>{C!==!1?z.value&&B<=200&&(z.value=!1):z.value=!1}),Ke(()=>wo.value,()=>{Nt.value&&_i({immediate:!0})}),Ke([Hs,is,wc,()=>ot.value.length,Nt],()=>{ul()},{immediate:!0});let Pc=null,Rc=!1,pa=null;function Dc(){Pc=null,cm=null,am=void 0,ra=null,Lc()}function Lm(){fa(),yd(),Ws(),So.clear();const C=ot.value.length;C>0&&gd(C),bm()}function Om(){Mm(),Xy(),Ic=null,ml=null,gl=null,Ed=null,Tc=null,Mc=null,Rc=!1,Dc(),ck("restore"),nn(),aa()}function Bc(C){var B;return[(B=ho())!=null?B:"",On(),Oi(),Ad.value,Nc(C),ot.value.length,Math.round(pr(0,ot.value.length)),Math.round(pl()),xo.count,Math.round(xo.total)].join(":")}function Ek(){return zn(this,null,function*(){var C,B,V,K;const ee=(C=o.virtualScroll)==null?void 0:C.settledToken,he=Nc(ee),ke=On(),Se=ho(),Pe=Ss.value;if(Mt.value&&((B=o.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Td(ee))if(um()){if(Bc(ee)!==ra&&!Rc){Rc=!0;try{const Ee=yield wm({reason:"manual",expectedSettledTokenKey:he}),We=Nc()===he;_m(ke,Se,Pe)&&Ee.sessionKey===ke&&Ee.threadKey===Se&&We&&Ee.stable&&Ee.phase==="final"&&(ra=Bc((V=o.virtualScroll)==null?void 0:V.settledToken))}finally{Rc=!1,yield ht();const Ee=(K=o.virtualScroll)==null?void 0:K.settledToken,We=Td(Ee)?Bc(Ee):"";_m(ke,Se,Pe)&&We&&ra!==We&&Ek()}}}else An("manual")})}Ke(Mt,(C,B)=>{if(C!==B){if(!C)return Om(),void Mm();Om(),Lm(),pa=Ss.value,An("content")}},{flush:"post"}),Ke([Mt,Ss],([C,B])=>{C?pa!=null?pa!==B&&(pa=B,(function(V="resize"){fa(),yd(),Ws(),So.clear();const K=ot.value.length;K>0&&gd(K),bm(),ml=null,gl=null,Ed=null,Ic=null,Rc=!1,Dc(),bk(),ht(()=>{Pi(),Vt.value&&Jn(),Be.value&&ca(),An(V)})})("resize")):pa=B:pa=null},{flush:"post",immediate:!0}),Ke([Mt,()=>On(),()=>ho()],([C])=>{C&&(Om(),Lm(),ck("content"),An("content"))}),Ke([Mt,()=>On(),()=>ho(),Ss,()=>ot.value.length],([C])=>{C&&(function(B="async-node"){let V=!1;for(const[K,ee]of Array.from(bi.entries()))rm(ee)||(bi.delete(K),_s.delete(K),V=!0);V&&(sa(),An(B))})("async-node")},{flush:"post"}),Ke([Mt,()=>{var C;return(C=o.virtualScroll)==null?void 0:C.sessionKey},()=>{var C;return(C=o.virtualScroll)==null?void 0:C.measurementKey},()=>o.indexKey,()=>Q.value],([C])=>{C&&(Lc(),(function(B="content"){if(!Mt.value)return;const V=[],K=ot.value.length;for(const ee of Array.from(So.keys())){if(ee>=K){V.push(ee);continue}const he=Ac(ee),ke=So.get(ee);ke!=null&&ke!==he&&V.push(ee),So.set(ee,he)}for(const ee of Array.from(So.keys()))ee>=K&&So.delete(ee);V.length&&((function(ee,he={}){const ke=Array.from(ee,Number);$4(ke,he)>0&&(function(Pe){for(const Ee of Pe)So.delete(Ee)})(ke)})(V,{notify:!1}),Ws(),Dc(),Vt.value&&Jn(),Be.value&&ca(),An(B))})("content"))},{flush:"post",immediate:!0}),Ke([Mt,()=>ot.value.length,()=>On(),()=>ho()],([C,B,V,K],[ee,he,ke,Se])=>{C&&ee&&V===ke&&K===Se&&B!==he&&Dc()},{flush:"post"}),Ke([Mt,()=>{var C;return(C=o.virtualScroll)==null?void 0:C.heightCache},()=>{var C;return(C=o.virtualScroll)==null?void 0:C.heightCacheWidth},()=>{var C;return(C=o.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=o.virtualScroll)==null?void 0:C.measurementKey},()=>ot.value.length,()=>On(),X],()=>{bk()},{flush:"post",immediate:!0}),Ke([Mt,()=>{var C;return(C=o.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=o.virtualScroll)==null?void 0:C.restoreAnchor},()=>{var C;return(C=o.virtualScroll)==null?void 0:C.measurementKey},()=>ot.value.length,()=>On(),X],C=>zn(null,[C],function*([B,V]){if(!B||!V)return;yield ht();const K=(function(){var ee;const he=(ee=o.virtualScroll)==null?void 0:ee.restoreAnchor;return he==null||he===!1?null:he===!0?"true":String(he)})();km(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ke([Mt,X,()=>{var C;return(C=o.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=o.virtualScroll)==null?void 0:C.measurementKey}],([C])=>{var B;if(!C)return;const V=(B=o.virtualScroll)==null?void 0:B.restoreState;V&&ml&&gl==="restore"&&(yk(V)||(Lm(),ml=null,gl=null,An("resize")))},{flush:"post"}),Ke([Mt,()=>ot.value.length,()=>On(),X],C=>zn(null,[C],function*([B]){var V;const K=Tc,ee=Mc;B&&K&&(yield ht(),!km(K,{restoreAnchor:ee?.restoreAnchor===!0,restoreToken:(V=ee?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:ee?.allowUncapturedAnchor===!0})&&_k(K)||(Tc=null,Mc=null))}),{flush:"post",immediate:!0}),Ke([Mt,j,()=>{var C;return(C=o.virtualScroll)==null?void 0:C.settleMode},()=>On(),()=>ho(),Ss,Gh,jy,()=>wo.value,bd,()=>xo.count,()=>xo.total],([C,B,V])=>{if(!C||B!==!0||V==="manual"||!dm())return;const K=(function(){var ee;const he=ot.value.length;return[(ee=ho())!=null?ee:"",On(),Oi(),Ad.value,he,Math.round(pr(0,he)),Math.round(pl()),xo.count,Math.round(xo.total)].join(":")})();Pc!==K&&(Pc=K,wm({reason:"final"}).then(ee=>{ee.stable||Pc!==K||(Pc=null)}))},{flush:"post",immediate:!0}),Ke([Mt,j,()=>{var C;return(C=o.virtualScroll)==null?void 0:C.settleMode},()=>{var C;return(C=o.virtualScroll)==null?void 0:C.settledToken},()=>On(),()=>ho(),Ss,Gh,jy,()=>wo.value,bd,()=>ot.value.length,()=>xo.count,()=>xo.total],()=>{Ek()},{flush:"post",immediate:!0}),Ke([()=>ot.value.length,Nt,is,wc,()=>Ao.start,()=>Ao.end],([C,B,V,K,ee,he])=>{Ue.value&&Te("virtualization",{nodes:C,virtualization:B,maxLiveNodes:V,buffer:K,focusIndex:Hs.value,scroll:B?(()=>{const ke=xe.value||ne();return ke?{reverse:H(ke),scrollTop:Math.round(ke.scrollTop),scrollTopAbs:Math.round(Math.abs(ke.scrollTop)),scrollHeight:Math.round(ke.scrollHeight),clientHeight:Math.round(ke.clientHeight)}:null})():null,liveRange:{start:ee,end:he},rendered:wo.value})}),Ke([()=>k.customId],([C],B,V)=>{if(!C||$t)return;const K=(function(ee,he){return ee?(mo.controllers[ee]=he,()=>{mo.controllers[ee]===he&&delete mo.controllers[ee]}):()=>{}})(C,{captureRestoreAnchor:Fn,restoreAnchor:Co,getAnchorDrift:Ro,getReport:B4});V(()=>{K()})},{immediate:!0}),lo(()=>{(function(){if(Mt.value)try{Pi(),Ec();const C=hl("manual");Sk(C)&&(E(C),Ic=C,Cm=$c());const B=la(C,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(M(B),B.anchor&&L(B.anchor),ua=Oc(B))}catch{}})(),Y4(),Zh(),Ie(),Mk();for(const C of ur.values())for(const B of C)wd(B);ur.clear(),dl.clear(),So.clear(),Nm(),fa(),em(),nn(),aa(),Mm(),Zy(),Xh()});const X4=ui({loader:()=>zn(null,null,function*(){try{return(yield Qo(()=>import("./index11-C3vBSelg.js"),__vite__mapDeps([8,5]))).default}catch(C){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".',C),xs}}),loadingComponent:DV,delay:0}),Q4=ui({loader:()=>zn(null,null,function*(){try{return(yield Qo(()=>import("./index10-CizaPNSY.js"),[])).default}catch(C){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.',C),xs}}),loadingComponent:RV,delay:0}),Z4=ui(()=>zn(null,null,function*(){try{return(yield Qo(()=>import("./index7-D0RS__NS.js"),[])).default}catch(C){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".',C),xs}})),Ik={text:Xn,paragraph:ql,heading:Rp,code_block:Dg,list:nc,list_item:tc,blockquote:Pf,table:Su,definition_list:Rf,footnote:Df,footnote_reference:$s,footnote_anchor:_u,admonition:Wf,vmr_container:Ff,hardbreak:jr,link:ns,image:qr,thematic_break:Bf,math_inline:gi,math_block:QM,strong:es,emphasis:os,strikethrough:ts,highlight:Ls,insert:vs,subscript:gs,superscript:ms,emoji:hs,checkbox:Is,checkbox_input:Is,inline_code:qo,html_inline:Ns,reference:Jo,html_block:wu},J4=F(()=>sm()),$k=F(()=>gS(k.codeBlockProps)),eE=F(()=>gS(k.codeBlockProps,{omit:["langs"]})),Nk=F(()=>it(it({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,monacoOptions:k.codeBlockMonacoOptions,themes:k.themes,langs:u.value==="shiki"?k.langs:void 0,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),eE.value)),Lk=F(()=>it(Lt(it({},Nk.value),{langs:k.langs}),$k.value));function Ok(C){return typeof C=="boolean"?C:void 0}const tE=F(()=>{const C=k.codeBlockProps||{},B={},V=Ok(C.showLineNumbers);V!==void 0&&(B.showLineNumbers=V);const K=Ok(C.diffInline);K!==void 0&&(B.diffInline=K);const ee=(function(he){const ke=Number(he);return Number.isFinite(ke)&&ke>0?ke:void 0})(C.reservedHeightPx);return ee!==void 0&&(B.reservedHeightPx=ee),B}),nE=F(()=>it(it({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),$k.value)),oE=F(()=>it({},k.mermaidProps||{})),Pk=F(()=>it({},k.d2Props||{})),sE=F(()=>it({},k.infographicProps||{})),Fc=F(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:Vn.value.customHtmlTags})),iE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltip:Fe.value}:{})),rE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),lE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),aE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}));function cE(C){return Array.isArray(C.children)&&C.children.length>0}const Pm=F(()=>D4.value.map(C=>{var B,V,K,ee,he,ke,Se,Pe;let Ee=(function(lt){var ct,St,wt,Zt,xt,Bt,Dt;if(lt.type!=="code_block")return lt;const ln=lt,Cs=[String((ct=ln.language)!=null?ct:""),String((St=ln.loading)!=null?St:""),String((wt=ln.diff)!=null?wt:""),String((Zt=ln.code)!=null?Zt:""),String((xt=ln.originalCode)!=null?xt:""),String((Bt=ln.updatedCode)!=null?Bt:""),String((Dt=ln.raw)!=null?Dt:"")].join("\0"),Vo=xn.get(ln);if(Vo&&Vo.signature===Cs)return Vo.node;const ri=it({},ln);return xn.set(ln,{signature:Cs,node:ri}),ri})(C.node);const We=Nd(Ee);let De=Fk(Ee,We);if((Ee.type==="html_block"||Ee.type==="html_inline")&&De===Ik[Ee.type]){const lt=Ee,ct=String((B=lt.tag)!=null?B:"").trim().toLowerCase()||WT(lt.content);if(ct){const St=Ft.value[ct];if(bn.value.has(ct)&&St)De=St,Ee=Lt(it({},lt),{type:ct,tag:ct,content:JB(lt.content,ct)});else if(zT((V=lt.content)!=null?V:lt.raw,ct)){const wt=String((ee=(K=lt.content)!=null?K:lt.raw)!=null?ee:"");Ee.type==="html_inline"?(De=Xn,Ee={type:"text",content:wt,raw:wt}):(De=ql,Ee={type:"paragraph",children:[{type:"text",content:wt,raw:wt}],raw:wt})}}}const $e=Ee.type==="code_block"&&u.value==="pre"&&De===xs&&!Rm(Ft.value,We);let He=it({},(function(lt,ct,St){const wt=ct??Nd(lt);if(lt.type==="code_block"){const Zt=wt?Rm(Ft.value,wt):void 0;if(St&&u.value==="pre"&&!Zt&&St===xs)return tE.value;if(St&&wt&&St===Zt)return wt==="mermaid"?Dk(lt):wt==="infographic"?Bk(lt):wt==="d2"||wt==="d2lang"?Pk.value:Lk.value;if(St&&St===Ft.value.code_block)return Lk.value;if(nk(St))return nE.value}return wt==="mermaid"?Dk(lt):wt==="infographic"?Bk(lt):wt==="d2"||wt==="d2lang"?Pk.value:lt.type==="link"?iE.value:lt.type==="list"?rE.value:lt.type==="blockquote"?lE.value:lt.type==="table"?aE.value:lt.type==="code_block"?Nk.value:Fc.value})(Ee,We,De));const Qe=fl.value[C.index];Ee.type==="code_block"&&Qe?.kind==="code-block"&&(He=Lt(it({},He),$e?{reservedHeightPx:(he=Qe.height)!=null?he:Qe.contentHeight}:{estimatedHeightPx:Qe.height,estimatedContentHeightPx:Qe.contentHeight})),$e||Ee.type!=="code_block"||We!=="mermaid"||Ha(He.estimatedPreviewHeightPx)!=null||(He=Lt(it({},He),{estimatedPreviewHeightPx:m1(p1(String((ke=Ee.code)!=null?ke:"")))})),$e||Ee.type!=="code_block"||We!=="infographic"||Ha(He.estimatedPreviewHeightPx)!=null||(He=Lt(it({},He),{estimatedPreviewHeightPx:g1(h1(String((Se=Ee.code)!=null?Se:"")))})),Ee.type==="math_block"&&(He=Lt(it({},He),{cacheScope:Dn.value}));const Ze=(function(lt,ct){const St=String(lt.type);return!fd(St)&&Ft.value[St]===ct})(Ee,De),_t=Ze?ay(Ee,rt.value):void 0;return Lt(it({},C),{node:Ee,component:De,bindings:He,customBindings:it(it({},_t??{}),He),rendersCustomNode:Ze,hasSlotChildren:cE(Ee),slotContent:String((Pe=Ee.content)!=null?Pe:""),isCodeBlock:Ee.type==="code_block",indexKey:`${J4.value}-${C.index}`})}));function Nd(C){var B;return C?.type==="code_block"?String((B=C.language)!=null?B:"").trim().toLowerCase():""}function Rm(C,B){const V=B.trim().toLowerCase();if(V)for(const K of[V,ty(V),RM(V)]){const ee=K&&C[K];if(ee)return ee}}function Rk(C,B,V,K){var ee,he;const ke=it({},C.value);return Ha(ke.estimatedPreviewHeightPx)==null&&(ke.estimatedPreviewHeightPx=K(V(String((ee=B?.code)!=null?ee:"")),void 0,ke.maxHeight==="none"?null:(he=Ha(ke.maxHeight))!=null?he:void 0)),ke}function Dk(C){return Rk(oE,C,p1,m1)}function Bk(C){return Rk(sE,C,h1,g1)}function Fk(C,B){if(!C)return A1;const V=Ft.value,K=V[String(C.type)];if(C.type==="code_block"){const ee=B??Nd(C),he=ee?Rm(V,ee):void 0;return he||(u.value==="pre"?V.code_block||xs:ee==="mermaid"?V.mermaid||X4:ee==="infographic"?V.infographic||Q4:ee==="d2"||ee==="d2lang"?V.d2||Z4:K||V.code_block||ok.value)}return K||Ik[String(C.type)]||A1}function Dm(C){s("click",C)}function uE(C){var B;(B=C.target)!=null&&B.closest("[data-node-index]")&&s("mouseover",C)}function dE(C){var B;(B=C.target)!=null&&B.closest("[data-node-index]")&&s("mouseout",C)}function Hk(C){s("mouseover",C)}function Wk(C){s("mouseout",C)}const kl=Z(null),wi=Z(!1);let Hc,ha=null,Bm=0,Ld=0,Od=0;const zk=["code_block","admonition","table","math_block","html_block","image","thematic_break"],fE=new Set(zk),Uk=[".typewriter-cursor",".height-estimation-probes",...zk.map(C=>`[data-node-type="${C}"]`),"script","style"].join(",");function qk(C){if(!C||typeof C!="object")return!1;const B=C.type;return typeof B=="string"&&fE.has(B)}function Pd(C){var B,V;if(!C||typeof C!="object")return 0;const K=C,ee=(V=(B=K.raw)!=null?B:K.content)!=null?V:K.code;if(typeof ee=="string")return ee.length;const he=K.children;if(Array.isArray(he))return he.reduce((Se,Pe)=>Se+Pd(Pe),0);const ke=K.items;return Array.isArray(ke)?ke.reduce((Se,Pe)=>Se+Pd(Pe),0):0}function Rd(){Hc&&(clearTimeout(Hc),Hc=void 0)}function jk(){Bm+=1,ha!=null&&(Oe?.(ha),ha=null)}function Dd(){jk(),kl.value&&(kl.value.style.visibility="hidden")}function pE(C){var B;if(C.nodeType!==Node.TEXT_NODE||!((B=C.textContent)!=null?B:"").trim())return!1;const V=C.parentElement;return!!V&&!V.closest(Uk)}function hE(C){let B=C.lastChild;for(;B;){if(pE(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const V=B;if(!V.matches(Uk)&&V.lastChild){B=V.lastChild;continue}}for(;B&&B!==C&&!B.previousSibling;)B=B.parentNode;if(!B||B===C)break;B=B.previousSibling}return null}function Fm(){if(!we||!wi.value||ha!=null)return;const C=Bm,B=()=>{ha=null,C===Bm&&(function(){var V,K;if(!(we&&wi.value&&S.value&&kl.value))return;const ee=S.value,he=kl.value;he.style.visibility="hidden";const ke=(function(){const De=Pm.value;for(let $e=De.length-1;$e>=0;$e--){const He=De[$e];if(!He||qk(He.node)||!Im(He.index))continue;const Qe=Po.get(He.index);if(!Qe)continue;const Ze=hE(Qe);if(Ze)return Ze}return null})();if(!ke)return;let Se=0,Pe=0,Ee=20,We=!1;if(ke?.textContent){const De=ke.textContent.length,$e=document.createRange();$e.setStart(ke,Math.max(0,De-1)),$e.setEnd(ke,De);const He=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Qe=(K=He?.[He.length-1])!=null?K:(V=ke.parentElement)==null?void 0:V.getBoundingClientRect();if(Qe){const Ze=mt("typewriterCursor.root.getBoundingClientRect",()=>ee.getBoundingClientRect());Se=Qe.right-Ze.left+ee.scrollLeft,Pe=Qe.top-Ze.top+ee.scrollTop,Ee=Qe.height||Ee,We=!0}$e.detach()}We&&(he.style.transform=`translate(${Math.max(0,Se)}px, ${Math.max(0,Pe)}px)`,he.style.height=`${Ee}px`,he.style.visibility="visible")})()};pe?ha=pe(B):B()}return Ke([ue,()=>o.content,()=>o.nodes,()=>k.typewriter,j],()=>zn(null,null,function*(){var C,B;if(!we||ze.value||!U.value)return;if(j.value)return wi.value=!1,Rd(),void Dd();if((C=o.nodes)!=null&&C.length)return wi.value=!1,Rd(),Dd(),Ld=((B=o.content)!=null?B:"").length,void(Od=ue.value.length);const V=(function(){var Se,Pe;return(Se=o.nodes)!=null&&Se.length?o.nodes.reduce((Ee,We)=>Ee+Pd(We),0):((Pe=o.content)!=null?Pe:"").length})(),K=(function(){var Se;return(Se=o.nodes)!=null&&Se.length?o.nodes.reduce((Pe,Ee)=>Pe+Pd(Ee),0):ue.value.length})(),ee=!qk(ot.value[ot.value.length-1]),he=V>Ld,ke=K>Od;if(k.typewriter===!1||!ee||!he&&!ke)return k.typewriter!==!1&&ee||(wi.value=!1,Dd()),Ld=V,void(Od=K);Ld=V,Od=K,wi.value=!0,kl.value&&(kl.value.style.visibility="hidden"),Rd(),yield ht(),Fm(),Hc=setTimeout(()=>{Hc=void 0,wi.value=!1},3e3)}),{flush:"post",immediate:!0}),Ke(wi,C=>zn(null,null,function*(){C?(yield ht(),Fm()):Dd()}),{flush:"post"}),Ke([()=>wo.value,()=>Ao.start,()=>Ao.end],()=>zn(null,null,function*(){we&&!ze.value&&U.value&&wi.value&&(yield ht(),Fm())}),{flush:"post"}),lo(()=>{Rd(),jk(),Rn.clear()}),(C,B)=>{const V=WI("NodeRenderer",!0);return x(ze)?(w(!0),N(Le,{key:0},nt(Pm.value,K=>(w(),N(Le,{key:K.index},[K.rendersCustomNode?(w(),ve(Wo(K.component),dn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onClick:Dm,onMouseover:Hk,onMouseout:Wk,onCopy:B[0]||(B[0]=ee=>s("copy",ee)),onHandleArtifactClick:B[1]||(B[1]=ee=>s("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Wo(K.component),dn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onClick:Dm,onMouseover:Hk,onMouseout:Wk,onCopy:B[2]||(B[2]=ee=>s("copy",ee)),onHandleArtifactClick:B[3]||(B[3]=ee=>s("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),N("div",{key:1,ref_key:"containerRef",ref:S,class:Re(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:Nt.value},{"virtual-scroll-coordinated":uo.value}]]),"data-custom-id":k.customId,onClick:Dm,onMouseover:uE,onMouseout:dE},[si.value||Nt.value?(w(),N(Le,{key:0},[si.value?(w(),N("div",{key:0,class:"height-estimation-probes",style:Gt({width:`${jo.value}px`}),"aria-hidden":"true"},[T("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[se(x(ql),{node:$n.value,"index-key":"probe-paragraph"},null,8,["node"])],512),T("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[T("ul",FV,[se(x(tc),{node:Ge.value,"index-key":"probe-list-item"},null,8,["node"])])],512),T("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[se(x(nc),{node:Ye.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),N(Le,null,nt(6,K=>T("div",{key:`probe-heading-${K}`,ref_for:!0,ref:ee=>(function(he,ke){he<1||he>6||(W[he]=ke)})(K,ee),class:"node-content","data-probe":`heading-${K}`},[se(x(Rp),{node:O4(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,HV)),64))],4)):ie("",!0),Nt.value?(w(),N("div",{key:1,class:"node-spacer",style:Gt({height:`${nm.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(w(!0),N(Le,null,nt(Pm.value,K=>(w(),N("div",{key:K.index,ref_for:!0,ref:ee=>Tk(K.index,ee),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[Im(K.index)?(w(),N("div",{key:0,ref_for:!0,ref:ee=>(function(he,ke){var Se;ke||(function(De){const $e=`${sm()}-${De}`;let He=!1;for(const Qe of Array.from(_s.keys())){const Ze=bi.get(Qe);(Ze?.index===De||Qe===$e||Qe.startsWith(`${$e}-`))&&(_s.delete(Qe),bi.delete(Qe),He=!0)}He&&(sa(),An("async-node"))})(he),Li.delete(he),(function(De){var $e;const He=(($e=dl.get(De))!=null?$e:0)+1;dl.set(De,He)})(he);const Pe=ur.get(he);if(Pe){for(const De of Pe)wd(De);ur.delete(he)}if((function(De){const $e=ft.get(De);$e&&(Ne?.unobserve($e),me.delete($e),ft.delete(De))})(he),!ke||!Xe.value)return ki.delete(he),void dl.delete(he);ki.set(he,ke);const Ee=()=>{$d(he,ke)};queueMicrotask(Ee);const We=(Ne||typeof ResizeObserver>"u"||(Ne=new ResizeObserver(De=>{if(De.length)for(const $e of De){const He=me.get($e.target),Qe=ft.get(He??-1);He!=null&&Qe&&$d(He,Qe)}else Pi()})),Ne);if(We&&(ft.set(he,ke),me.set(ke,he),We.observe(ke)),typeof window<"u"){const De=((Se=ot.value[he])==null?void 0:Se.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(De.length){const $e=De.map(He=>Yy(He,Ee,"node-resize")).filter(He=>He!=null);$e.length&&ur.set(he,$e)}}})(K.index,ee),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(w(),ve(Wo(K.component),dn({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[8]||(B[8]=ee=>s("copy",ee)),onHandleArtifactClick:B[9]||(B[9]=ee=>s("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Wo(K.component),dn({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[10]||(B[10]=ee=>s("copy",ee)),onHandleArtifactClick:B[11]||(B[11]=ee=>s("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Gr,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:_e(()=>[K.rendersCustomNode?(w(),ve(Wo(K.component),dn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[4]||(B[4]=ee=>s("copy",ee)),onHandleArtifactClick:B[5]||(B[5]=ee=>s("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Wo(K.component),dn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[6]||(B[6]=ee=>s("copy",ee)),onHandleArtifactClick:B[7]||(B[7]=ee=>s("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),N("div",{key:1,class:"node-placeholder",style:Gt({height:`${xd(K.index)}px`})},null,4))],8,WV))),128)),wi.value?(w(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:kl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),Nt.value?(w(),N("div",{key:2,class:"node-spacer",style:Gt({height:`${om.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,BV))}}})),[["__scopeId","data-v-2e8e6e17"]]),ys=u3;ys.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",ys.__name,ys.name].filter(n=>!!n));for(const n of t)e.component(n,u3)};const my=Object.freeze(Object.defineProperty({__proto__:null,default:ys},Symbol.toStringTag,{value:"Module"})),zV={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"},UV={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"},qV={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"},jV={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"},VV={class:"admonition-title"},KV=["aria-expanded","aria-controls"],GV=["id"],Wf=un(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 o=e,s=t,i=F(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Z(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(w(),N("div",{class:Re(["admonition",[`admonition-${o.node.kind}`]])},[T("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(w(),N("svg",zV,[...u[1]||(u[1]=[T("circle",{cx:"12",cy:"12",r:"10"},null,-1),T("path",{d:"M12 16v-4"},null,-1),T("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(w(),N("svg",UV,[...u[2]||(u[2]=[T("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),T("path",{d:"M9 18h6"},null,-1),T("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(w(),N("svg",qV,[...u[3]||(u[3]=[T("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),T("path",{d:"M12 9v4"},null,-1),T("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(w(),N("svg",jV,[...u[4]||(u[4]=[T("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),T("path",{d:"M12 8v4"},null,-1),T("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),T("span",VV,R(i.value),1),o.node.collapsible?(w(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),N("svg",{style:Gt({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]=[T("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,KV)):ie("",!0)]),Mn(T("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[se(x(ys),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,GV),[[Qs,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Wf.install=e=>{e.component(Wf.__name,Wf)};const d3=()=>Qo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let mf=null,YV=d3;function whe(){return zn(this,null,function*(){if(mf)return mf;const e=YV;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===d3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(mf=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),mf):null})}function She(){return!1}function Che(){return zn(this,null,function*(){return null})}const gf=Z(!1);let TS=!1;function Kg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function XV(){return!TS&&typeof window<"u"&&typeof document<"u"&&(TS=!0,gf.value=Kg(),new MutationObserver(()=>{gf.value=Kg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{gf.value=Kg()})),gf}const f3=["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"],QV=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),$1=[...f3].sort((e,t)=>t.length-e.length).join("|"),Gg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${$1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${$1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),p3=/[),.;!?,。;!?)]+$/;function ZV(e){const t=e.toLowerCase();return f3.some(n=>t.endsWith(`.${n}`))}function JV(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${$1}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function eK(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(p3,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=QV.has(i),a=ZV(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function tK(e,t={}){const n=[];Gg.lastIndex=0;let o;for(;(o=Gg.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(p3,""),u=a.length-c.length;a=c;const d=eK(a,t);if(!d)continue;const p=o.index+r,h=p+a.length;n.push({...d,start:p,end:h,text:a}),u>0&&(Gg.lastIndex-=u)}return n}const nK=12e4,oK=6e4,sK=32,iK=3e4,MS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function rK(e){let t=0,n=0,o=0;MS.lastIndex=0;let s;for(;(s=MS.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=nK||n>=oK||t>=sK||o>=iK?"pre":"shiki",codeFenceCount:t,codeChars:n}}function lK(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function aK(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const cK={key:1,class:"diff-wrap"},uK={class:"diff-bar"},dK=["onClick"],fK={class:"diff-pre"},pK="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ES="github-light",IS="github-dark",hK=je({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){jU(),sq(),KU(),cq(),VU(new lK),aq(new aK);function t(P){return P.inline.ruler.disable("math"),P}const{t:n}=It(),o=Ut("resolveImage"),s=Z(null),i=e,r=F(()=>!i.streaming),l=F(()=>JV(i.text??"")),a=F(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:rK(i.text??"")),c=XV(),u=F(()=>!i.streaming),d=No(new Map),p=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,f=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(P){return!/^(https?:|data:|blob:)/i.test(P)}function b(P){if(!o)return;const D=[];for(const W of[h,f]){W.lastIndex=0;let z;for(;(z=W.exec(P))!==null;)D.push(z[2]??"")}for(const W of D)!W||!m(W)||d.has(W)||p.has(W)||(p.add(W),o(W).then(z=>{d.set(W,z!==W?z:"")}).catch(()=>{d.set(W,"")}).finally(()=>{p.delete(W)}))}function _(P){if(!o)return P;const D=W=>{if(!m(W))return null;const z=d.get(W);return z===void 0?pK:z===""?null:z};return P.replace(h,(W,z,q,Q)=>{const X=D(q);return X===null?W:`${z}${X}${Q}`}).replace(f,(W,z,q,Q)=>{const X=D(q);return X===null?W:`${z}${X}${Q}`})}Ke(()=>i.text,P=>b(P??""),{immediate:!0});function g(){if(!s.value||!i.openFile||i.streaming)return;const P=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),D=[];let W=P.nextNode();for(;W;){const z=W,q=z.parentElement;q&&!q.closest("a, pre, .md-file-link, svg")&&z.data.trim().length>0&&D.push(z),W=P.nextNode()}for(const z of D){const q=tK(z.data,{aliases:l.value});if(q.length===0||!z.parentNode)continue;const Q=document.createDocumentFragment();let X=0;for(const fe of q){fe.start>X&&Q.append(document.createTextNode(z.data.slice(X,fe.start)));const ye=document.createElement("button");ye.type="button",ye.className="md-file-link",ye.textContent=fe.text,ye.title=fe.line?`${fe.path}:${fe.line}`:fe.path,ye.addEventListener("click",Me=>{Me.preventDefault(),Me.stopPropagation(),i.openFile?.({path:fe.path,line:fe.line})}),Q.append(ye),X=fe.end}X<z.data.length&&Q.append(document.createTextNode(z.data.slice(X))),z.parentNode.replaceChild(Q,z)}}function v(P){return!(!P||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(P))}function y(P){let D=P.length;for(const W of["#","?"]){const z=P.indexOf(W);z!==-1&&z<D&&(D=z)}return P.slice(0,D)}function A(){if(!s.value||!i.openFile||i.streaming)return;const P=s.value.querySelectorAll("a[href]");for(const D of P){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const W=D.getAttribute("href")??"";v(W)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(W)})}))}}function O(){ht().then(()=>{g(),A()})}Ke(()=>i.text,O),Ke(()=>i.streaming,O);let $=null;hn(()=>{O(),s.value&&($=new MutationObserver(O),$.observe(s.value,{childList:!0,subtree:!0}))}),kn(()=>{$?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,M=F(()=>{const P=_(i.text??""),D=[];let W=0;E.lastIndex=0;let z;for(;(z=E.exec(P))!==null;){const Q=z[1]??"",X=P.slice(W,z.index)+(Q||"");X.trim()&&D.push({kind:"md",text:X}),D.push({kind:"diff",code:z[2]??""}),W=E.lastIndex}const q=P.slice(W);return(q.trim()||D.length===0)&&D.push({kind:"md",text:q}),D});function L(P){return P.split(`
|
|
246
|
-
`).map(D=>/^\+(?!\+\+)/.test(D)?{cls:"diff-add",text:D}:/^-(?!--)/.test(D)?{cls:"diff-del",text:D}:D.startsWith("@@")?{cls:"diff-hunk",text:D}:{cls:"diff-ctx",text:D})}const S=Z(null);function I(P,D){Uo(P).then(W=>{W&&(S.value=D,setTimeout(()=>{S.value=null},1400))})}return(P,D)=>(w(),N("div",{ref_key:"mdRef",ref:s,class:"md"},[(w(!0),N(Le,null,nt(M.value,(W,z)=>(w(),N(Le,{key:z},[W.kind==="md"?(w(),ve(x(ys),{key:0,content:W.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":x(c),"code-block-light-theme":ES,"code-block-dark-theme":IS,themes:[ES,IS],"code-block-props":k,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(w(),N("div",cK,[T("div",uK,[D[0]||(D[0]=T("span",{class:"diff-lang"},"diff",-1)),se(Ht,{text:x(n)("filePreview.copyCode")},{default:_e(()=>[T("button",{class:"diff-copy",onClick:q=>I(W.code,z)},R(S.value===z?"✓":"⧉"),9,dK)]),_:2},1032,["text"])]),T("pre",fK,[T("code",null,[(w(!0),N(Le,null,nt(L(W.code),(q,Q)=>(w(),N("span",{key:Q,class:Re(q.cls)},R(q.text),3))),128))])])]))],64))),128))],512))}}),Oh=ut(hK,[["__scopeId","data-v-8b684052"]]),mK={class:"tc-anim"},gK={class:"prev-anim"},vK={class:"prev"},yK=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,o=t,s=F(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=F(()=>n.foldable&&s.value.length>1),r=F(()=>n.streaming||!i.value),l=F(()=>s.value.pop()??""),a=Z(null);return hn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ke(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||ht(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),N("div",{class:Re(["think",{mob:e.mobile}])},[i.value?(w(),N("div",{key:0,class:Re(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[T("div",mK,[T("pre",{ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513)]),T("div",gK,[T("span",vK,R(l.value),1)])],2)):(w(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513))],2))}}),kK=ut(yK,[["__scopeId","data-v-5f6e61ba"]]),bK={class:"activity-notice",role:"status"},_K={"aria-hidden":"true"},wK={class:"an-label"},SK=je({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),N("div",bK,[T("span",_K,[se(ni,{size:"sm"})]),T("span",wK,R(e.label),1)]))}}),CK=ut(SK,[["__scopeId","data-v-0d497074"]]);function h3(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 N1(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 xK(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function Ti(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:N1(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:h3(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 Cu(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 $S(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 gy(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:$S(e.source)};case"video":return{type:"video",source:$S(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 L1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(gy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function AK(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 TK(e){return{content:e.content.map(AK),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 MK(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function m3(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 EK(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function IK(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(EK),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function g3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(IK),createdAt:e.created_at}}function $K(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 NK(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=$K(o);return{answers:t,method:e.method,note:e.note}}function O1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.kind==="subagent"?!0:void 0}}function NS(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 xr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Ca(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Us(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function LK(e){if(!e||typeof e!="object")return null;const t=e,n=xr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:xr(t,"goalId")??xr(t,"goal_id")??"goal",objective:xr(t,"objective")??"",completionCriterion:xr(t,"completionCriterion")??xr(t,"completion_criterion"),status:n,turnsUsed:Ca(t,"turnsUsed")??Ca(t,"turns_used")??0,tokensUsed:Ca(t,"tokensUsed")??Ca(t,"tokens_used")??0,wallClockMs:Ca(t,"wallClockMs")??Ca(t,"wall_clock_ms")??0,terminalReason:xr(t,"terminalReason")??xr(t,"terminal_reason"),budget:{tokenBudget:Us(s,"tokenBudget")??Us(s,"token_budget"),remainingTokens:Us(s,"remainingTokens")??Us(s,"remaining_tokens"),turnBudget:Us(s,"turnBudget")??Us(s,"turn_budget"),remainingTurns:Us(s,"remainingTurns")??Us(s,"remaining_turns"),wallClockBudgetMs:Us(s,"wallClockBudgetMs")??Us(s,"wall_clock_budget_ms"),remainingWallClockMs:Us(s,"remainingWallClockMs")??Us(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function OK(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ti(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ti(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:Cu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Cu(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:N1(t.payload.status),previousStatus:N1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:h3(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=LK(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:L1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(gy),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:m3(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:g3(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:O1(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:P1(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function PK(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function LS(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 P1(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.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,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 RK(e){return e.session_id}function DK(e){return e.seq}const BK="main",FK=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 Lr(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 HK(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 OS(){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 us(e,t){const n=e[t];return typeof n=="string"?n:void 0}function El(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function qs(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function WK(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=us(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=us(t,"goalId")??us(t,"goal_id")??"goal",r=us(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:us(t,"completionCriterion")??us(t,"completion_criterion"),status:s,turnsUsed:El(t,"turnsUsed")??El(t,"turns_used")??0,tokensUsed:El(t,"tokensUsed")??El(t,"tokens_used")??0,wallClockMs:El(t,"wallClockMs")??El(t,"wall_clock_ms")??0,terminalReason:us(t,"terminalReason")??us(t,"terminal_reason"),budget:{tokenBudget:qs(o,"tokenBudget")??qs(o,"token_budget"),remainingTokens:qs(o,"remainingTokens")??qs(o,"remaining_tokens"),turnBudget:qs(o,"turnBudget")??qs(o,"turn_budget"),remainingTurns:qs(o,"remainingTurns")??qs(o,"remaining_turns"),wallClockBudgetMs:qs(o,"wallClockBudgetMs")??qs(o,"wall_clock_budget_ms"),remainingWallClockMs:qs(o,"remainingWallClockMs")??qs(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Wa(e,t,n,o){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function zK(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=us(t,"name")??us(t,"toolName")??"tool",o=rd(UK(n)),s=qK(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=us(n,"text");if(s)return Yg(s);const i=us(n,"message");if(i)return Yg(i)}const o=us(t,"message");if(o)return Yg(o)}return null}function UK(e){return e.replace(/_\d+$/,"")}const PS=2e3;function Yg(e){return e.length>PS?`${e.slice(0,PS)}…`:e}function qK(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Fu(e,n)}function jK(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=us(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),p=Wa(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return p&&h.push({type:"taskCreated",sessionId:t,task:p}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=zK(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Wa(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 vf(e){return{...e,content:e.content.map(t=>({...t}))}}function RS(e,t,n){const o={id:Lr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function VK(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function KK(e){return Array.isArray(e)?e.map(t=>gy(t)):[]}function DS(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function GK(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function YK(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:s}:null}function BS(e,t){e.messages.find(n=>n.id===t)}function XK(e,t,n,o,s,i){const r={id:Lr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Xg(e,t){return e.messages.find(n=>n.id===t)}function FS(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 QK(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=OS(),e.set(u,d)),d}function o(u){e.set(u,OS())}function s(u){t.add(u)}function i(u,d){const p=n(u);p.currentPromptId=d}function r(u,d){o(u);const p=n(u),h=d.promptId??Lr("pr_");p.currentPromptId=h,p.turnPromptId.set(d.turnId,h);const f=RS(p,u,h);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 m of d.runningTools){const b=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;f.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:b}),p.toolStartTimes.set(m.toolCallId,Date.now())}return p.currentAssistantMsgId=f.id,p.turnTextLen=d.assistantText.length,p.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:h},{type:"messageCreated",message:vf(f)}]}function l(u,d,p,h){try{return c(u,d,p,h)}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,p,h){const f=n(p),m=d,b=[],_=m?.agentId;if(typeof _=="string"&&_!==BK){const g=t.has(_);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:p,agentId:_,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:p,agentId:_,reason:m?.reason}];if(FK.has(u))return jK(f,p,_,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:p,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=KK(m?.content);if(y.length===0)break;f.currentPromptId=g;const A=VK(f,p,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:vf(A)});break}case"turn.started":{const g=m?.turnId,v=f.currentPromptId??Lr("pr_");f.currentPromptId=v,g!==void 0&&f.turnPromptId.set(g,v),f.turnTextLen=0,f.turnThinkLen=0,b.push({type:"sessionStatusChanged",sessionId:p,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=f.turnPromptId.get(g)??f.currentPromptId;v||(v=Lr("pr_"),f.currentPromptId=v,g!==void 0&&f.turnPromptId.set(g,v));const y=RS(f,p,v);f.currentAssistantMsgId=y.id,b.push({type:"messageCreated",message:vf(y)});break}case"thinking.delta":{const g=f.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&f.turnThinkLen>0&&(f.turnThinkLen=0);const y=a(f.turnThinkLen,h?.offset);if(y==="skip")break;if(y==="gap"){b.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const A=DS(f,g,"thinking",v);if(A<0)break;f.turnThinkLen+=v.length,b.push({type:"assistantDelta",sessionId:p,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=f.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&f.turnTextLen>0&&(f.turnTextLen=0);const y=a(f.turnTextLen,h?.offset);if(y==="skip")break;if(y==="gap"){b.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const A=DS(f,g,"text",v);if(A<0)break;f.turnTextLen+=v.length,b.push({type:"assistantDelta",sessionId:p,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=f.currentAssistantMsgId,v=m?.turnId,y=f.turnPromptId.get(v)??f.currentPromptId;if(!g||!y)break;const A=m?.toolCallId,O=m?.name??m?.toolName??"",$=m?.args??m?.input??{};GK(f,g,A,O,$);const k=Xg(f,g);k&&k.content.length-1,f.toolStartTimes.set(A,Date.now()),k&&b.push({type:"messageUpdated",sessionId:p,messageId:g,content:k.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=YK(m??{});g&&v&&b.push({type:"toolOutput",sessionId:p,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=f.turnPromptId.get(g)??f.currentPromptId;v||(v=Lr("pr_"),f.currentPromptId=v,g!==void 0&&f.turnPromptId.set(g,v));const y=m?.toolCallId,A=m?.output,O=m?.isError??!1;f.toolStartTimes.get(y)??Date.now(),f.toolStartTimes.delete(y);const $=XK(f,p,y,A,O,v);b.push({type:"messageCreated",message:vf($)}),f.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=f.currentAssistantMsgId,v=HK(m?.usage);if(f.totalInput+=v.input,f.totalOutput+=v.output,f.totalCacheRead+=v.cacheRead,f.totalCacheCreate+=v.cacheCreate,g){BS(f,g);const y=Xg(f,g);y&&b.push({type:"messageUpdated",sessionId:p,messageId:g,content:y.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(f.model=m.model),m?.contextTokens!==void 0&&(f.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(f.contextLimit=m.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:p,usage:FS(f),model:f.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=f.currentAssistantMsgId,v=m?.reason??"completed",y=El(m??{},"durationMs");if(g){BS(f,g);const $=Xg(f,g);$&&b.push({type:"messageUpdated",sessionId:p,messageId:g,content:$.content.map(k=>({...k})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}f.turnCount++;const A=FS(f);b.push({type:"sessionUsageUpdated",sessionId:p,usage:A});const O=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";b.push({type:"sessionStatusChanged",sessionId:p,status:O,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 m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Lr("task_"),sessionId:p,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};f.subagentMeta.set(v.id,v),b.push({type:"taskCreated",sessionId:p,task:v});break}case"subagent.started":{const g=Wa(f,p,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&b.push({type:"taskCreated",sessionId:p,task:g});break}case"subagent.suspended":{const g=Wa(f,p,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&b.push({type:"taskCreated",sessionId:p,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Wa(f,p,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&b.push({type:"taskCreated",sessionId:p,task:v}),b.push({type:"taskCompleted",sessionId:p,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Wa(f,p,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&b.push({type:"taskCreated",sessionId:p,task:v}),b.push({type:"taskCompleted",sessionId:p,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):Lr("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:Un.global.t("tasks.defaultDescription"),O=typeof g.command=="string"?g.command:void 0;b.push({type:"taskCreated",sessionId:p,task:{id:y,sessionId:p,kind:"bash",description:A,command:O,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:O!==void 0?`$ ${O}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;b.push({type:"taskCompleted",sessionId:p,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};b.push({type:"compactionCompleted",sessionId:p,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),b.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:p,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:p});break}case"goal.updated":{const g=WK(m?.snapshot??null);b.push({type:"goalUpdated",sessionId:p,goal:g?.status==="complete"?null:g});break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const ZK=new Set(["server_hello","ack","ping","resync_required","error","pong"]),HS=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"]),JK=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),eG=new Set(["assistant.delta","thinking.delta"]);function tG(e,t){if(ZK.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return eG.has(o)?nG(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?JK.has(o)?{route:"protocol"}:HS.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:HS.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function nG(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 zf extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class $a extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function el(e){return e instanceof zf||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function v3(e){return e instanceof $a||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const WS=1e3,Qg=16384,Zg=500,Jg=50,oG=6,sG=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,iG=/^[A-Za-z0-9+/=_-]{200,}$/;let ev=null;function vi(){if(ev!==null)return ev;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=Qn(Et.debug)==="1"),ev=e,e}const Hr=[];let rG=1;const vy=Z(0),ou=Ql(!1);function lG(){return Hr}function aG(){Hr.length=0,vy.value++}function rl(e){ou.value||(Hr.push({id:rG++,ts:Date.now(),...e}),Hr.length>WS&&Hr.splice(0,Hr.length-WS),vy.value++)}function R1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const s=e;return iG.test(s)?`[base64-like, ${s.length} chars omitted]`:s.length>Zg?`${s.slice(0,Zg)}… [+${s.length-Zg} chars]`:s}if(n!=="object")return String(e);if(t>=oG)return"[max depth]";if(Array.isArray(e)){const s=e.slice(0,Jg).map(i=>R1(i,t+1));return e.length>Jg&&s.push(`[+${e.length-Jg} more items]`),s}const o={};for(const[s,i]of Object.entries(e))o[s]=sG.test(s)?"[redacted]":R1(i,t+1);return o}function ea(e){if(e===void 0)return;const t=R1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Qg)return{_truncated:`detail JSON was ${n.length} chars; first ${Qg} kept`,preview:n.slice(0,Qg)}}catch{return"[unserializable detail]"}return t}function tv(e){vi()&&rl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:ea(e.body)}})}function yf(e){if(!vi())return;const t=e.code!==0;rl({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:ea(e.data)}})}function Xc(e){vi()&&rl({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 xa(e,t){vi()&&rl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:ea(t)})}function cG(e){if(!vi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;rl({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:ea(e)})}function uG(e){if(!vi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);rl({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:ea(t.payload)})}const dG={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function nv(e,t,n){vi()&&rl({source:"client",kind:`client:${e}`,label:`${dG[e]} ${t}`,detail:ea(n)})}function Or(e,t){vi()&&rl({source:"client",kind:"client:event",label:`· ${e}`,detail:ea(t)})}let zS=!1;function fG(){if(!(zS||!vi())){zS=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{nv("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;nv("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{nv(e,n.map(pG).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function pG(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 y3(e=Hr){if(typeof document>"u")return;const t=new Blob([hG(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}function hG(e=Hr){return e.map(t=>JSON.stringify(t)).join(`
|
|
247
|
-
`)}const yy="kimi-web.server-credential",mG="token";let Xu;const D1=new Set;function gG(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(mG);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function vG(){try{return globalThis.sessionStorage?.getItem(yy)??void 0}catch{return}}function yG(){const e=gG();return e?(b3(e),!0):(Xu=vG(),Xu!==void 0)}function k3(){return Xu}function b3(e){Xu=e;try{globalThis.sessionStorage?.setItem(yy,e)}catch{}}function kG(){Xu=void 0;try{globalThis.sessionStorage?.removeItem(yy)}catch{}}function bG(e){return D1.add(e),()=>{D1.delete(e)}}function _G(){kG();for(const e of D1)try{e()}catch{}}const Na=3e4,_3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",US=500,wG=40101;function ov(){try{return AbortSignal.timeout(Na)}catch{return}}function SG(e,t){let n="",o=e;for(let s=0;s<t;s++)n=_3[o%32]+n,o=Math.floor(o/32);return n}function CG(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=>_3[n%32]).join("")}function sv(){return`${SG(Date.now(),10)}${CG(16)}`}function xG(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function qS(e){try{const t=await e.text();return t?t.length>US?`${t.slice(0,US)}...`:t:void 0}catch{return}}class AG{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=uu(this.origin,t),o=sv(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();tv({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:ov()})}catch(a){throw Xc({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new $a({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:Na,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return yf({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),yf({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new zf({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postForm(t,n){const o=uu(this.origin,t),s=sv(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();tv({method:"POST",path:t,url:o,requestId:s,body:xG(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:ov()})}catch(u){throw Xc({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new $a({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Na,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw Xc({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new $a({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Na,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await qS(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(yf({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new zf({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,o,s,i=[]){let r=uu(this.origin,n);if(s){const h=new URLSearchParams;for(const[m,b]of Object.entries(s))b!==void 0&&h.set(m,String(b));const f=h.toString();f&&(r=`${r}?${f}`)}const l=sv(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();tv({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:ov()})}catch(h){throw Xc({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new $a({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Na,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const p=u.clone();try{d=await u.json()}catch(h){throw Xc({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new $a({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Na,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await qS(p),timestamp:Date.now(),durationMs:Date.now()-c})}if(yf({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new zf({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=k3();n!==void 0&&(t.Authorization=`Bearer ${n}`),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)}checkAuthRequired(t,n){(t.status===401||n===wG)&&_G()}}const TG="kimi-code.bearer.";class MG{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;xa("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=k3(),n=t!==void 0?[`${TG}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{xa("open")},o.onmessage=s=>{try{const i=JSON.parse(String(s.data));uG(i),this.handleFrame(i)}catch(i){xa("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{xa("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{xa("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,xa("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=kf(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(kf(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(kf(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 o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,i=n.seq,r=kf(o,s),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=tG(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),cG(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function kf(e,t){return`${e}\0${t}`}function iv(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 jS(e){return e==="auto_compact"||e==="manual_compact"}class EG{http;config;constructor(t){this.config=t,this.http=new AG(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?xK(t.status):void 0,include_archive:t?.includeArchive,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Ti),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return Ti(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ti(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Ti(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(L1),hasMore:s.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:Ti(n.session),messages:n.messages.items.map(L1),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(o=>({toolCallId:o.tool_call_id,name:o.name,args:o.args,description:o.description,lastProgress:o.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(m3),pendingQuestions:n.pending_questions.map(g3)}}async submitPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,TK(n));return{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Ti(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Ti(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ti)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,MK(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,NK(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(O1)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return O1(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(iv)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return iv(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return iv(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(NS)])):void 0;return{items:s.items.map(NS),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return uu(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Cu)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return Cu(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Cu(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir,isGitRepo:o.is_git_repo,branch:o.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(PK)}async listProviders(){return(await this.http.get("/providers")).items.map(LS)}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 o=await this.http.post("/providers",n);return LS(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return rv(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return rv(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return rv(t)}async getConfig(){const t=await this.http.get("/config");return P1(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return P1(s)}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 o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return uu(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=E5(this.config.serverHttpUrl,this.config.clientId),o=QK(),s=new MG(n,this.config.clientId,{onWireEvent:i=>{const r=RK(i),l=DK(i),a=OK(i);a.type==="historyCompacted"&&!jS(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const p of d)p.type==="historyCompacted"&&!jS(p.reason)&&t.onResync(a,l),t.onEvent(p,{sessionId:a,seq:l})},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},close(){s.close()}}}}function rv(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let VS;function dt(){return VS??=new EG(C5()),VS}const IG=["src","controls","muted"],$G=["src","alt"],lv=je({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=Z(t.fileId?"":t.url),o=Z(null),s=Z(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const p=await dt().getFileBlob(t.fileId),h=URL.createObjectURL(p);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ke(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),hn(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),lo(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,p)=>e.kind==="video"?(w(),N("video",{key:0,ref_key:"mediaEl",ref:o,class:Re(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,IG)):(w(),N("img",{key:1,ref_key:"mediaEl",ref:o,class:Re(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,$G))}}),NG=["aria-label"],LG=120,OG=60,PG=je({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*LG}ms`,"--moon-frame-fast-delay":`${o*OG}ms`}}return(o,s)=>(w(),N("span",{class:Re(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),N(Le,null,nt(t,(i,r)=>T("span",{key:i,class:"ui-moon__frame",style:Gt(n(r)),"aria-hidden":"true"},R(i),5)),64))],10,NG))}}),w3=ut(PG,[["__scopeId","data-v-a6b7ec07"]]);function RG(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const DG={class:"chat"},BG={key:0,class:"chat-loading"},FG={class:"chat-loading-text"},HG={key:1,class:"chat-empty"},WG={key:1,class:"top-sentinel-text"},zG=["data-turn-id"],UG={key:0,class:"u-imgs"},qG=["aria-label","onClick"],jG={key:1,class:"skill-act"},VG={class:"skill-act-head"},KG={key:0,class:"skill-act-args"},GG={key:2,class:"skill-act"},YG={class:"skill-act-head"},XG={key:0,class:"skill-act-args"},QG={key:3,class:"u-text"},ZG={key:0,class:"u-meta"},JG=["aria-label","onClick"],eY=["aria-label","onClick"],tY=["onClick"],nY=["data-turn-id"],oY=["onClick"],sY={class:"cd-view"},iY={key:1,class:"cd-label"},rY=["data-turn-id"],lY={key:1,class:"msg"},aY={key:0,class:"a-msg-ft"},cY={key:0,class:"a-duration"},uY=["aria-label","onClick"],dY={key:4,class:"sending-placeholder"},fY={key:5,class:"q-stack"},pY={class:"q-head"},hY={class:"q-title"},mY={class:"q-hint"},gY=["onDragover","onDrop"],vY={class:"u-bub q-bub"},yY=["title","onDragstart"],kY=["title","disabled","onClick"],bY={key:0,class:"u-text q-text"},_Y={key:1,class:"q-text q-text-placeholder"},wY={key:0,class:"q-imgs"},SY={key:1,class:"q-tag q-tag-next"},CY={key:2,class:"q-tag q-tag-idx"},xY=["aria-label","onClick"],AY=2500,TY=je({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},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},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=It(),{confirm:s}=sl();kn(()=>{we!==null&&(clearTimeout(we),we=null),z!==null&&(clearTimeout(z),z=null),E!==null&&(clearTimeout(E),E=null)});const i=e,r=Z(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(le=>{le[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}hn(a),kn(()=>{l?.disconnect(),l=null}),Ke(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{ht().then(a)});const c=F(()=>{if(!i.running||i.turns.length===0)return null;const le=i.turns.at(-1);return le.role==="assistant"?le.id:null}),u=F(()=>i.sending||i.running),d=n,p=Z(null),h=Z(null);function f(le){return(le.attachments?.length??0)>0}function m(le,U){f(U)||d("editQueued",le)}function b(le,U){if(p.value=le,!U.dataTransfer)return;U.dataTransfer.effectAllowed="move",U.dataTransfer.setData("text/plain",String(le));const G=U.currentTarget?.closest(".q-turn");G&&U.dataTransfer.setDragImage(G,24,24)}function _(le,U){if(p.value===null)return;U.preventDefault(),U.dataTransfer&&(U.dataTransfer.dropEffect="move");const G=U.currentTarget.getBoundingClientRect(),ne=U.clientY<G.top+G.height/2?"before":"after";h.value={index:le,position:ne}}function g(le,U){U.preventDefault();const G=p.value,ne=h.value?.position??"before";if(p.value=null,h.value=null,G===null)return;let H=ne==="before"?le:le+1;G<H&&(H-=1),G!==H&&d("reorderQueue",{from:G,to:H})}function v(){p.value=null,h.value=null}const y=F(()=>{for(let le=i.turns.length-1;le>=0;le--)if(i.turns[le].role==="user")return i.turns[le].id;return null});function A(le){return le.role==="user"&&le.id===y.value&&!i.running&&!i.sending&&!le.skillActivation&&!le.pluginCommand}function O(le){const U=le.compaction,G=U?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof U?.tokensBefore=="number"&&typeof U?.tokensAfter=="number"?G+o("conversation.compactedTokens",{before:R_(U.tokensBefore),after:R_(U.tokensAfter)}):G}const $=Z(null),k=Z(null);let E=null;const M=Z(new Set);function L(le){return M.value.has(le)}function S(le){const U=new Set(M.value);U.has(le)?U.delete(le):U.add(le),M.value=U}function I(le,U){if(L(U)){const G=new Date(le);if(Number.isNaN(G.getTime()))return le;const ne=H=>String(H).padStart(2,"0");return`${G.getFullYear()}-${ne(G.getMonth()+1)}-${ne(G.getDate())} ${ne(G.getHours())}:${ne(G.getMinutes())}`}return RG(le,o("conversation.yesterday"))}async function P(le){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&D(le)}function D(le){k.value===null&&(k.value=le.id,d("editMessage",le.text),E=setTimeout(()=>{E=null,k.value=null},AY))}Ke(()=>i.turns,le=>{k.value!==null&&(le.some(U=>U.id===k.value)||(k.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const W=Z(!1);let z=null;function q(){if(i.turns.length===0)return;const le=[];for(const G of i.turns){if(G.role==="compaction")continue;const ne=G.role==="user"?"User":"Assistant",H=OP(G);H.trim()&&le.push(`**${ne}**
|
|
248
|
-
|
|
249
|
-
${H}`)}const U=le.join(`
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
`);Uo(U).then(G=>{G&&(W.value=!0,d("copyConversationCopied"),z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,W.value=!1},2e3))}).catch(()=>{})}function Q(le){const U=[];for(let G=le;G>=0;G--){const ne=i.turns[G];if(!ne||ne.role!=="assistant")break;U.unshift(ne)}return U}function X(le){return Q(le).map(U=>LP(U)).filter(Boolean).join(`
|
|
254
|
-
|
|
255
|
-
`)}function fe(){for(let le=i.turns.length-1;le>=0;le-=1)if(i.turns[le]?.role==="assistant")return X(le);return""}function ye(){const le=fe();le.trim()&&Uo(le).then(U=>{U&&(W.value=!0,d("copyConversationCopied"),z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,W.value=!1},2e3))}).catch(()=>{})}t({copyConversation:q,copyFinalSummary:ye});function Me(le){const U=i.turns[le];if(!U||U.role!=="assistant")return!1;const G=i.turns[le+1];return!G||G.role!=="assistant"}let we=null;function ze(le){const U=i.turns[le];if(!U)return;const G=X(le);G.trim()&&Uo(G).then(ne=>{ne&&($.value=U.id,we!==null&&clearTimeout(we),we=setTimeout(()=>{we=null,$.value=null},1400))}).catch(()=>{})}function Ue(le){const U=le.text;U.trim()&&Uo(U).then(G=>{G&&($.value=le.id,we!==null&&clearTimeout(we),we=setTimeout(()=>{we=null,$.value=null},1400))}).catch(()=>{})}function Fe(le){return{kind:"image",url:le.url,path:le.alt,fileId:le.fileId}}function rt(le,U){return le.id!==c.value?!1:U.sourceIndex===hh(le).length-1}return(le,U)=>(w(),N("div",DG,[e.sessionLoading?(w(),N("div",BG,[se(ni,{size:"sm"}),T("span",FG,R(x(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),N("div",HG)):ie("",!0),e.hasMoreMessages||e.loadingMore?(w(),N("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Re(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),N("span",WG,[se(ni,{size:"sm"}),qe(" "+R(x(o)("conversation.loadingOlder")),1)])):(w(),N("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:U[0]||(U[0]=G=>d("loadOlderMessages"))},R(x(o)("conversation.loadOlder")),1))],2)):ie("",!0),(w(!0),N(Le,null,nt(e.turns,(G,ne)=>(w(),N(Le,{key:G.id},[G.role==="user"?(w(),N("div",{key:0,class:Re(["u-turn",{"is-latest-user":G.id===y.value}])},[T("div",{class:Re(["u-bub turn-anchor",{undoing:k.value===G.id}]),"data-turn-id":G.id},[G.images&&G.images.length>0?(w(),N("div",UG,[(w(!0),N(Le,null,nt(G.images,(H,J)=>(w(),N(Le,{key:J},[H.kind==="video"?(w(),ve(lv,{key:0,url:H.url,kind:"video","file-id":H.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(w(),N("button",{key:1,type:"button",class:"u-img-btn","aria-label":x(o)("filePreview.enlargeImage"),onClick:ce=>d("openMedia",Fe(H))},[se(lv,{url:H.url,kind:"image",alt:H.alt,"file-id":H.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,qG))],64))),128))])):ie("",!0),G.skillActivation?(w(),N("div",jG,[T("div",VG,[U[9]||(U[9]=T("span",{class:"skill-act-arrow"},"▶",-1)),T("span",null,R(x(o)("conversation.activatedSkill",{name:G.skillActivation.name})),1)]),G.skillActivation.args?(w(),N("div",KG,R(G.skillActivation.args),1)):ie("",!0)])):G.pluginCommand?(w(),N("div",GG,[T("div",YG,[U[10]||(U[10]=T("span",{class:"skill-act-arrow"},"▶",-1)),T("span",null,"/"+R(G.pluginCommand.pluginId)+":"+R(G.pluginCommand.commandName),1)]),G.pluginCommand.args?(w(),N("div",XG,R(G.pluginCommand.args),1)):ie("",!0)])):(w(),N("div",QG,R(G.text),1))],10,zG),G.createdAt||A(G)?(w(),N("div",ZG,[A(G)?(w(),N("div",{key:0,class:Re(["u-edit-wrap",{undoing:k.value===G.id}])},[T("button",{type:"button",class:"u-edit","aria-label":x(o)("conversation.undoTooltip"),onClick:H=>P(G)},[se(Je,{name:"undo",size:"sm"})],8,JG)],2)):ie("",!0),G.text.trim().length>0?(w(),N("button",{key:1,type:"button",class:"u-copy","aria-label":x(o)("filePreview.copy"),onClick:vt(H=>Ue(G),["stop"])},[$.value!==G.id?(w(),ve(Je,{key:0,name:"copy",size:"sm"})):(w(),ve(Je,{key:1,name:"check",size:"sm"}))],8,eY)):ie("",!0),G.createdAt?(w(),N("button",{key:2,type:"button",class:"u-time",onClick:vt(H=>S(G.id),["stop"])},R(I(G.createdAt,G.id)),9,tY)):ie("",!0)])):ie("",!0)],2)):G.role==="compaction"?(w(),N("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":G.id,role:"separator"},[U[11]||(U[11]=T("span",{class:"cd-line","aria-hidden":"true"},null,-1)),G.text?(w(),N("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:H=>d("openCompaction",{turnId:G.id})},[T("span",null,R(O(G)),1),T("span",sY,R(x(o)("conversation.viewSummary")),1)],8,oY)):(w(),N("span",iY,R(O(G)),1)),U[12]||(U[12]=T("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,nY)):(w(),N("div",{key:2,class:"a-msg turn-anchor","data-turn-id":G.id},[(w(!0),N(Le,null,nt(x(NP)(G),(H,J)=>(w(),N(Le,{key:x(PP)(H,J)},[H.kind==="thinking"?(w(),ve(kK,{key:0,text:H.thinking,mobile:"",streaming:rt(G,H),onOpen:ce=>d("openThinking",{turnId:G.id,blockIndex:H.sourceIndex})},null,8,["text","streaming","onOpen"])):H.kind==="text"&&H.text?(w(),N("div",lY,[se(Oh,{text:H.text,streaming:rt(G,H),"open-file":ce=>d("openFile",ce)},null,8,["text","streaming","open-file"])])):H.kind==="tool-stack"?(w(),ve(WP,{key:2,tools:H.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:U[1]||(U[1]=ce=>d("openMedia",ce)),onOpenFile:U[2]||(U[2]=ce=>d("openFile",ce)),onOpenToolDiff:U[3]||(U[3]=ce=>d("openToolDiff",ce)),onOpenAgent:U[4]||(U[4]=ce=>d("openAgent",ce))},null,8,["tools","tool-diff-panel"])):H.kind==="tool"?(w(),ve(NA,{key:3,tool:H.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:U[5]||(U[5]=ce=>d("openMedia",ce)),onOpenFile:U[6]||(U[6]=ce=>d("openFile",ce)),onOpenToolDiff:U[7]||(U[7]=ce=>d("openToolDiff",ce)),onOpenAgent:U[8]||(U[8]=ce=>d("openAgent",ce))},null,8,["tool","tool-diff-panel"])):ie("",!0)],64))),128)),G.id!==c.value&&Me(ne)&&(X(ne).trim().length>0||G.durationMs!==void 0)?(w(),N("div",aY,[se(Ht,{text:`${G.durationMs} ms`},{default:_e(()=>[G.durationMs!==void 0?(w(),N("span",cY,R(x(EP)(G.durationMs)),1)):ie("",!0)]),_:2},1032,["text"]),X(ne).trim().length>0?(w(),N("button",{key:0,class:"a-cpbtn","aria-label":x(o)("filePreview.copy"),onClick:H=>ze(ne)},[$.value!==G.id?(w(),ve(Je,{key:0,name:"copy",size:"sm"})):(w(),ve(Je,{key:1,name:"check",size:"sm"}))],8,uY)):ie("",!0)])):ie("",!0)],8,rY))],64))),128)),e.compaction?(w(),ve(CK,{key:3,label:x(o)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(w(),N("div",dY,[se(w3,{fast:e.fastMoon},null,8,["fast"])])):ie("",!0),e.queued.length>0?(w(),N("div",fY,[T("div",pY,[T("span",hY,[se(Je,{name:"mail",size:"sm"}),qe(" "+R(x(o)("composer.queueLabel"))+" · ",1),T("b",null,R(e.queued.length),1)]),T("span",mY,R(x(o)("composer.queueAutoDrain")),1)]),(w(!0),N(Le,null,nt(e.queued,(G,ne)=>(w(),N("div",{key:ne,class:Re(["u-turn q-turn",{"q-dragging":p.value===ne,"drop-before":h.value?.index===ne&&h.value.position==="before","drop-after":h.value?.index===ne&&h.value.position==="after"}]),onDragover:H=>_(ne,H),onDrop:H=>g(ne,H)},[T("div",vY,[T("span",{class:"q-grip",title:x(o)("composer.queueDragTitle"),draggable:"true",onDragstart:H=>b(ne,H),onDragend:v},[se(Je,{name:"grip",size:"sm"})],40,yY),T("button",{type:"button",class:"q-body",title:f(G)?x(o)("composer.queuedHasImage",{n:G.attachments?.length??0}):x(o)("composer.editQueued"),disabled:f(G),onClick:H=>m(ne,G)},[G.text?(w(),N("span",bY,R(G.text),1)):(w(),N("span",_Y,[se(Je,{name:"image",size:"sm"}),qe(" "+R(x(o)("composer.queuedImageOnly",{n:G.attachments?.length??0})),1)]))],8,kY),f(G)?(w(),N("div",wY,[(w(!0),N(Le,null,nt(G.attachments,(H,J)=>(w(),ve(lv,{key:J,url:H.url,kind:H.kind,"file-id":H.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):ie("",!0),ne===0?(w(),N("span",SY,R(x(o)("composer.queueNext")),1)):(w(),N("span",CY,"#"+R(ne+1),1)),T("button",{type:"button",class:"q-rm","aria-label":x(o)("composer.remove"),onClick:vt(H=>d("unqueue",ne),["stop"])},[se(Je,{name:"close",size:"sm"})],8,xY)])],42,gY))),128))])):ie("",!0)]))}}),S3=ut(TY,[["__scopeId","data-v-98b30134"]]),MY={class:"ch-id"},EY={key:0,class:"ch-ws"},IY={key:1,class:"ch-sep"},$Y=["onKeydown"],NY={class:"ch-ses"},LY={key:0,class:"ch-pill ch-sync-pill"},OY={key:0,class:"ch-ahead"},PY={key:1,class:"ch-behind"},RY={key:1,class:"ch-pill ch-diff-pill"},DY={key:0,class:"ch-add"},BY={key:1,class:"ch-del"},FY=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}=It(),{confirm:o}=sl(),s=e,i=t,r=F(()=>s.ahead??0),l=F(()=>s.behind??0),a=F(()=>s.gitDiffStats?.totalAdditions??0),c=F(()=>s.gitDiffStats?.totalDeletions??0),u=F(()=>a.value>0||c.value>0),d=Z(!1),p=Z(null),h=Z(null),f=Z({});function m(D){const W=D.target;h.value?.el?.contains(W)||p.value?.el?.contains(W)||g()}function b(){g()}async function _(D){if(D.stopPropagation(),d.value){g();return}d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",b),await ht();const W=p.value?.el,z=h.value?.el;if(!W||!z)return;const q=W.getBoundingClientRect(),Q=4,X=8,fe=z.offsetWidth,ye=z.offsetHeight;let Me=q.bottom+Q;Me+ye>window.innerHeight-X&&(Me=Math.max(X,q.top-ye-Q));let we=q.left;we+fe>window.innerWidth-X&&(we=Math.max(X,q.right-fe)),f.value={top:`${Math.round(Me)}px`,left:`${Math.round(we)}px`}}function g(){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",b)}kn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",b)});function v(){i("copyAll"),g()}function y(){i("copyFinalSummary"),g()}const A=Z(!1);function O(){s.sessionId&&Uo(s.sessionId).then(D=>{D&&(A.value=!0,setTimeout(()=>{A.value=!1},1200))})}const $=Z(!1),k=Z(""),E=Z(null);async function M(){if(g(),!!s.sessionId){$.value=!0,k.value=s.sessionTitle??"",await ht();try{E.value?.focus(),E.value?.select()}catch{}}}function L(){const D=k.value.trim();D&&s.sessionId&&D!==(s.sessionTitle??"").trim()&&i("renameSession",s.sessionId,D),$.value=!1}function S(){$.value=!1}function I(){s.sessionId&&(g(),i("forkSession",s.sessionId))}async function P(){s.sessionId&&(g(),await o({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",s.sessionId))}return(D,W)=>(w(),N("header",{class:Re(["chat-header",{"macos-desktop":x(AA)}])},[T("div",MY,[e.workspaceName?(w(),N("span",EY,R(e.workspaceName),1)):ie("",!0),e.workspaceName&&e.sessionTitle?(w(),N("span",IY,"/")):ie("",!0),$.value?Mn((w(),N("input",{key:2,ref_key:"renameInputRef",ref:E,"onUpdate:modelValue":W[0]||(W[0]=z=>k.value=z),class:"ch-rename",type:"text",onKeydown:[di(vt(L,["stop"]),["enter"]),di(vt(S,["stop"]),["esc"])],onBlur:L,onClick:W[1]||(W[1]=vt(()=>{},["stop"]))},null,40,$Y)),[[ks,k.value]]):e.sessionTitle?(w(),ve(Ht,{key:3,text:e.sessionTitle},{default:_e(()=>[T("span",NY,R(e.sessionTitle),1)]),_:1},8,["text"])):ie("",!0)]),se(gn,{ref_key:"kebabRef",ref:p,class:Re(["ch-act-more",{open:d.value}]),label:x(n)("header.options"),"aria-expanded":d.value,"aria-haspopup":"menu",onClick:W[2]||(W[2]=vt(z=>_(z),["stop"]))},{default:_e(()=>[se(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),d.value?(w(),ve(Wl,{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Gt(f.value),onClick:W[3]||(W[3]=vt(()=>{},["stop"]))},{default:_e(()=>[se(fn,{onClick:v},{default:_e(()=>[qe(R(e.copied?x(n)("header.copied"):x(n)("header.copyAll")),1)]),_:1}),se(fn,{onClick:y},{default:_e(()=>[qe(R(x(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),N(Le,{key:0},[se(fn,{separator:""}),se(fn,{onClick:O},{default:_e(()=>[qe(R(A.value?x(n)("header.copied"):x(n)("header.copySessionId")),1)]),_:1}),se(fn,{onClick:M},{default:_e(()=>[qe(R(x(n)("header.renameSession")),1)]),_:1}),se(fn,{onClick:I},{default:_e(()=>[qe(R(x(n)("header.forkSession")),1)]),_:1}),se(fn,{danger:"",onClick:P},{default:_e(()=>[qe(R(x(n)("header.archiveSession")),1)]),_:1})],64)):ie("",!0)]),_:1},8,["style"])):ie("",!0),W[6]||(W[6]=T("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),N("button",{key:1,type:"button",class:"ch-git",onClick:W[4]||(W[4]=z=>i("openChanges"))},[T("span",{class:Re(["ch-branch",{"ch-detached":!e.branch}])},R(e.branch||x(n)("header.detached")),3),r.value>0||l.value>0?(w(),N("span",LY,[r.value>0?(w(),N("span",OY,"↑"+R(r.value),1)):ie("",!0),l.value>0?(w(),N("span",PY,"↓"+R(l.value),1)):ie("",!0)])):ie("",!0),u.value?(w(),N("span",RY,[a.value>0?(w(),N("span",DY,"+"+R(a.value),1)):ie("",!0),c.value>0?(w(),N("span",BY,"-"+R(c.value),1)):ie("",!0)])):ie("",!0)])):ie("",!0),e.pr?(w(),N("button",{key:2,type:"button",class:Re(["ch-pill ch-pr",`pr-${e.pr.state}`]),onClick:W[5]||(W[5]=z=>e.pr&&i("openPr",e.pr.url))},[se(Je,{name:"git-pull-request",size:"sm"}),T("span",null,"PR #"+R(e.pr.number)+" · "+R(e.pr.state),1)],2)):ie("",!0)],2))}}),HY=ut(FY,[["__scopeId","data-v-39760f19"]]),WY={key:0,class:"slash-menu",role:"listbox"},zY=["aria-selected","onMouseenter","onMousedown"],UY={class:"slash-name"},qY={class:"slash-desc"},jY=je({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t,i=Z([]);return Ke(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),N("div",WY,[(w(!0),N(Le,null,nt(e.items,(a,c)=>(w(),N("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Re(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:vt(u=>s("select",a),["prevent"])},[T("span",UY,R(a.name),1),T("span",qY,R(a.isSkill?a.desc:x(n)(a.desc)),1)],42,zY))),128))])):ie("",!0)}}),VY=ut(jY,[["__scopeId","data-v-f60b70d9"]]),KY={class:"mention-menu",role:"listbox"},GY={key:0,class:"mention-state dim"},YY={key:1,class:"mention-state dim"},XY=["aria-selected","onMouseenter","onMousedown"],QY=["innerHTML"],ZY={class:"mention-name"},JY={class:"mention-path"},eX=je({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It(),i=Ia("folder","sm"),r=Ia("code","sm"),l=Ia("file-text","sm"),a=Ia("image","sm"),c=Ia("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),p=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(f){const m=f.path;if(m.endsWith("/"))return i;const b=f.name||m.split("/").pop()||m,_=b.lastIndexOf("."),g=_>0?b.slice(_+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:p.has(g)?a:c:c}return(f,m)=>(w(),N("div",KY,[n.loading?(w(),N("div",GY,R(x(s)("mention.searching")),1)):n.items.length===0?(w(),N("div",YY,R(x(s)("mention.noMatch")),1)):(w(!0),N(Le,{key:2},nt(n.items,(b,_)=>(w(),N("div",{key:b.path,class:Re(["mention-item",{active:_===n.activeIndex}]),role:"option","aria-selected":_===n.activeIndex,onMouseenter:g=>o("hover",_),onMousedown:vt(g=>o("select",b),["prevent"])},[T("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,QY),T("span",ZY,R(b.name),1),T("span",JY,R(b.path),1)],42,XY))),128))]))}}),tX=ut(eX,[["__scopeId","data-v-f4d6b958"]]),C3=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.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 nX(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 x3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...C3,...t]}function oX(e,t=C3){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function pd(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 ky(e){return e?.supportEfforts??[]}function sX(e){return e[Math.floor(e.length/2)]}function B1(e){if(pd(e)==="unsupported")return"off";const t=ky(e);return t.length>0?e?.defaultEffort??sX(t):"on"}function by(e){const t=ky(e),n=pd(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function F1(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function iX(e){return e!=="off"}function fc(e,t){if(e===void 0)return t;const n=pd(e);if(n==="unsupported")return"off";if(t==="off")return n==="always-on"?B1(e):"off";const o=ky(e);return o.length>0?o.includes(t)?t:B1(e):"on"}function _y(e,t){return t==="off"?"off":t==="on"?B1(e):t}const Fp=100;function rX(e){const t=id(Et.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Fp?n.slice(-Fp):n,s={[e]:o};return yc(Et.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function lX(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=Z(rX(s())),r=F(()=>i.value[s()??""]??[]);let l=-1,a="";function c(_){const g=s();if(l=-1,!g)return;const v=_.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const A=[...y,v],O=A.length>Fp?A.slice(-Fp):A;i.value={...i.value,[g]:O},yc(Et.inputHistory,i.value)}function u(){const _=n.value;return _?(_.selectionStart??0)===0:!1}function d(_){t.value=_,ht(()=>{const g=n.value;if(!g)return;o();const v=_.length;g.setSelectionRange(v,v)})}function p(){const _=r.value;if(_.length!==0){if(l===-1)a=t.value,l=_.length-1;else if(l>0)l-=1;else return;d(_[l])}}function h(){if(l===-1)return;const _=r.value;l<_.length-1?(l+=1,d(_[l])):(l=-1,d(a))}function f(){l=-1}function m(){return l!==-1}function b(){return r.value.length>0}return Ke(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:p,recallNewer:h,resetBrowsing:f,isBrowsing:m,hasHistory:b}}function aX(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Z(!1),c=Z([]),u=Z(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=oX(h,x3(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function p(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,ht(()=>{const f=n.value;if(!f)return;const m=t.value.length;f.setSelectionRange(m,m),f.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:p}}function cX(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=Z(!1),r=Z([]),l=Z(0),a=Z(!1);let c=null;function u(){const h=t.value,f=n.value?.selectionStart??h.length;let m=f-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const b=h.slice(m,f);return b.startsWith("@")?{token:b.slice(1),start:m,end:f}:null}function d(){const h=u(),f=s();if(!h||!f){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await f(m)}catch{r.value=[]}finally{a.value=!1}},200)}function p(h){const f=u();if(!f)return;const m=t.value;t.value=m.slice(0,f.start)+h.path+m.slice(f.end),i.value=!1,ht(()=>{const b=n.value;if(!b)return;const _=f.start+h.path.length;b.setSelectionRange(_,_),b.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:p}}function uX(e){const{sessionId:t}=e;function n(c){return Qn(x_(c))??""}function o(c,u){const d=x_(c);u?to(d,u):cc(d)}const s=Z(n(t())),i=Z(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ke(s,c=>{ht(r),o(t(),c)}),Ke(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),ht(r))});function l(c){s.value=c,ht(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function dX(e){const{uploadImage:t,sessionId:n}=e,o=Z({}),s=F(()=>o.value[n()??""]??[]),i=Z(null),r=Z(null),l=Z(!1);let a=0;function c(){return`att_${++a}`}function u(k,E){o.value={...o.value,[k]:E}}function d(k){try{URL.revokeObjectURL(k.previewUrl)}catch{}}function p(k){return k.startsWith("image/")?"image":k.startsWith("video/")?"video":null}async function h(k){const E=t();if(!E)return;const M=n()??"",L=k.map(S=>({file:S,kind:p(S.type)})).filter(S=>S.kind!==null);if(L.length!==0)for(const{file:S,kind:I}of L){const P=c(),D=URL.createObjectURL(S),W={localId:P,name:S.name,kind:I,previewUrl:D,uploading:!0};u(M,[...o.value[M]??[],W]),E(S,S.name).then(z=>{const q=o.value[M]??[];u(M,q.map(Q=>Q.localId===P?{...Q,uploading:!1,fileId:z?.fileId,error:z===null}:Q))}).catch(()=>{const z=o.value[M]??[];u(M,z.map(q=>q.localId===P?{...q,uploading:!1,error:!0}:q))})}}function f(k){const E=n()??"",M=o.value[E]??[],L=M.find(S=>S.localId===k);i.value?.localId===k&&(i.value=null),L&&d(L),u(E,M.filter(S=>S.localId!==k))}function m(k){i.value=k}function b(){i.value=null}function _(){r.value?.click()}function g(k){const E=k.target,M=Array.from(E.files??[]);h(M),E.value=""}function v(k){if(!t())return;const E=k.clipboardData;if(!E)return;const M=[],L=new Set,S=(I,P)=>{const D=`${I.size}:${I.type}:${P}`;if(L.has(D))return;L.add(D);const W=I.type.split("/")[1]??"png",z=P.includes(".")?P:`paste-${Date.now()}.${W}`;M.push(I instanceof File?I:new File([I],z,{type:I.type}))};for(const I of Array.from(E.items))if(I.kind==="file"&&p(I.type)){const P=I.getAsFile();P&&S(P,P.name||`paste-${Date.now()}.${I.type.split("/")[1]??"png"}`)}for(const I of Array.from(E.files))p(I.type)&&S(I,I.name);M.length!==0&&(k.preventDefault(),h(M))}function y(k){!t()||!Array.from(k.dataTransfer?.items??[]).some(M=>M.kind==="file")||(k.preventDefault(),l.value=!0)}function A(){l.value=!1}function O(k){if(l.value=!1,!t())return;k.preventDefault();const E=Array.from(k.dataTransfer?.files??[]);h(E)}function $(){const k=n()??"";for(const E of o.value[k]??[])d(E);u(k,[])}return Ke(n,()=>{i.value=null}),hn(()=>{document.addEventListener("paste",v)}),kn(()=>{document.removeEventListener("paste",v);for(const k of Object.values(o.value))for(const E of k)d(E);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:f,openAttachmentPreview:m,closeAttachmentPreview:b,openFilePicker:_,handleFileInputChange:g,handleDragOver:y,handleDragLeave:A,handleDrop:O,clearAfterSubmit:$}}const fX={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},pX=["stroke-dasharray","stroke-dashoffset"],av=7,hX=je({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*av;return(o,s)=>(w(),N("svg",fX,[T("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:av,fill:"none","stroke-width":"2.5"}),T("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:av,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,pX)]))}}),mX=ut(hX,[["__scopeId","data-v-a364f1f1"]]),gX={key:0,class:"att-strip"},vX=["onClick"],yX=["src"],kX=["src","alt"],bX={key:2,class:"att-video-badge","aria-hidden":"true"},_X={class:"att-name"},wX={class:"att-err-icon"},SX=["onClick"],CX={class:"att-lightbox-card"},xX=["src"],AX=["src","alt"],TX={class:"att-lightbox-name"},MX={class:"composer-card"},EX={class:"cin-wrap"},IX={class:"input-row"},$X=["placeholder"],NX=["aria-label"],LX={class:"toolbar-left"},OX=["onKeydown"],PX=["onClick"],RX={class:"pd-check"},DX={class:"pd-info"},BX={class:"pd-desc"},FX={class:"mode-label"},HX={key:0,class:"mode-tag"},WX={key:1,class:"mode-tag"},zX={key:2,class:"mode-tag"},UX={class:"mode-row-name"},qX={class:"mode-row-name"},jX={class:"mode-row-name"},VX={key:0,class:"mode-row-actions"},KX={class:"toolbar-right"},GX={key:0,class:"ctx-group"},YX={class:"ctx-num"},XX=["onKeydown"],QX={key:0,class:"think-suffix"},ZX=["aria-label"],JX=["aria-label"],eQ={key:0,class:"md-section"},tQ=["onClick"],nQ={class:"md-check"},oQ={class:"md-name"},sQ={class:"md-provider"},iQ={key:1,class:"md-divider"},rQ={key:2,class:"md-section"},lQ=["onClick"],aQ={class:"md-check"},cQ={class:"md-name"},uQ={key:3,class:"md-divider"},dQ={class:"md-name"},fQ={key:0,class:"md-note"},pQ=["aria-label"],hQ=["disabled","onClick"],mQ={class:"md-name"},KS=36,gQ=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 o=e,s=F(()=>o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=It(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=uX({sessionId:()=>o.sessionId}),p=Z(!1);function h(){p.value=!p.value,ht(()=>{c(),_(),a.value?.focus()})}function f(){p.value&&(p.value=!1,ht(c))}function m(Xe){if(typeof getComputedStyle>"u")return KS;const st=Number.parseFloat(getComputedStyle(Xe).minHeight);return Number.isFinite(st)&&st>0?st:KS}const b=Z(!1);function _(){const Xe=a.value;b.value=!!Xe&&Xe.scrollHeight>m(Xe)}Ke(l,()=>{ht(_)}),Ke(()=>o.sessionId,()=>{p.value=!1});const g=lX({text:l,textareaRef:a,autosize:c,sessionId:()=>o.sessionId}),{open:v,items:y,active:A,update:O,select:$}=aX({text:l,textareaRef:a,autosize:c,skills:()=>o.skills,emitCommand:Xe=>i("command",Xe),historyPush:Xe=>g.push(Xe),clearDraft:d}),{open:k,items:E,active:M,loading:L,update:S,select:I}=cX({text:l,textareaRef:a,autosize:c,searchFiles:()=>o.searchFiles});function P(){g.resetBrowsing(),O(),S()}const{attachments:D,previewAttachment:W,fileInputRef:z,isDragOver:q,removeAttachment:Q,openAttachmentPreview:X,closeAttachmentPreview:fe,openFilePicker:ye,handleFileInputChange:Me,handleDragOver:we,handleDragLeave:ze,handleDrop:Ue,clearAfterSubmit:Fe}=dX({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});hn(()=>{l.value&&ht(()=>{c(),_()})}),kn(()=>{document.removeEventListener("mousedown",Ln),H()});function rt(){a.value?.focus({preventScroll:!0})}t({loadForEdit:u,focus:rt});function le(){const Xe=l.value.trim();if(D.value.some(pe=>pe.uploading))return;const st=D.value.filter(pe=>!pe.uploading&&!pe.error&&pe.fileId);if(!Xe&&st.length===0)return;if(g.push(Xe),Xe){const pe=nX(Xe),Oe=pe?x3(o.skills).some(Qt=>Qt.name===pe.cmd):!1;if(pe&&Oe){l.value="",d(),v.value=!1,f(),i("command",pe.arg?`${pe.cmd} ${pe.arg}`:pe.cmd);return}}const de={text:Xe,attachments:st.map(pe=>({fileId:pe.fileId,kind:pe.kind}))};W.value=null,Fe(),l.value="",d(),v.value=!1,k.value=!1,f(),i("submit",de)}function U(){if(!o.running||D.value.some(pe=>pe.uploading))return;const Xe=l.value.trim(),st=D.value.filter(pe=>!pe.uploading&&!pe.error&&pe.fileId);if(!Xe&&st.length===0&&o.queued.length===0)return;const de={text:Xe,attachments:st.map(pe=>({fileId:pe.fileId,kind:pe.kind}))};Fe(),g.push(Xe),l.value="",d(),v.value=!1,k.value=!1,f(),i("steer",de)}let G=!1,ne=null;function H(){ne!==null&&(clearTimeout(ne),ne=null)}function J(){H(),G=!0}function ce(){H(),ne=setTimeout(()=>{ne=null,G=!1},0)}function te(Xe){return G||Xe.isComposing||Xe.keyCode===229}function ue(Xe){if(!te(Xe)){if(Xe.key==="Escape"){if(re.value){Xe.preventDefault(),ae();return}if(ge.value){Xe.preventDefault(),Ve();return}}if(v.value){if(Xe.key==="ArrowDown"){Xe.preventDefault(),A.value=(A.value+1)%y.value.length;return}if(Xe.key==="ArrowUp"){Xe.preventDefault(),A.value=(A.value-1+y.value.length)%y.value.length;return}if(Xe.key==="Enter"||Xe.key==="Tab"){Xe.preventDefault();const st=y.value[A.value];st&&$(st);return}if(Xe.key==="Escape"){Xe.preventDefault(),v.value=!1;return}}if(k.value&&!L.value){if(Xe.key==="ArrowDown"){Xe.preventDefault(),M.value=(M.value+1)%Math.max(1,E.value.length);return}if(Xe.key==="ArrowUp"){Xe.preventDefault(),M.value=(M.value-1+Math.max(1,E.value.length))%Math.max(1,E.value.length);return}if(Xe.key==="Enter"||Xe.key==="Tab"){Xe.preventDefault();const st=E.value[M.value];st&&I(st);return}if(Xe.key==="Escape"){Xe.preventDefault(),k.value=!1;return}}if(Xe.key==="s"&&(Xe.ctrlKey||Xe.metaKey)&&!Xe.shiftKey&&!Xe.altKey){o.running&&(Xe.preventDefault(),U());return}if(!p.value&&!v.value&&!k.value&&!Xe.shiftKey&&!Xe.altKey&&!Xe.metaKey&&!Xe.ctrlKey){const st=g.isBrowsing();if(Xe.key==="ArrowUp"&&g.hasHistory()&&(st||g.caretAtTextStart())){Xe.preventDefault(),g.recallOlder();return}if(Xe.key==="ArrowDown"&&st){Xe.preventDefault(),g.recallNewer();return}}if(Xe.key==="Enter"&&!Xe.shiftKey){if(p.value&&!(Xe.metaKey||Xe.ctrlKey))return;Xe.preventDefault(),le()}}}const j=F(()=>r("composer.send")),Y=F(()=>!!o.uploadImage),re=Z(!1),ge=Z(!1),Ae=Z(null);function Ie(){re.value=!re.value,re.value?(ge.value=!1,tn(),document.addEventListener("click",tt,!0)):document.removeEventListener("click",tt,!0)}function ae(){re.value=!1,ge.value||document.removeEventListener("click",tt,!0)}function Te(){ge.value=!ge.value,ge.value?(re.value=!1,tn(),document.addEventListener("click",tt,!0)):document.removeEventListener("click",tt,!0)}function Ve(){ge.value=!1,re.value||document.removeEventListener("click",tt,!0)}function tt(Xe){Ae.value&&!Ae.value.contains(Xe.target)&&(ae(),Ve())}kn(()=>{document.removeEventListener("click",tt,!0)});const bt=Xe=>`${Math.round(Xe/1e3)}k`,kt=F(()=>{const Xe=o.status?.ctxMax??0;return Xe<=0?0:Math.min(100,Math.max(0,Math.round((o.status?.ctxUsed??0)/Xe*100)))}),Tt=F(()=>{const Xe=(o.status?.ctxUsed??0).toLocaleString(),st=(o.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Xe,max:st,pct:kt.value})}),Pt=F(()=>kt.value>=80),mt=F(()=>{const Xe=o.status?.modelId??o.status?.model??"";return o.models?.find(st=>st.id===Xe||st.model===Xe||st.displayName===o.status?.model)}),Yt=F(()=>pd(mt.value)),Rn=F(()=>by(mt.value)),Dn=F(()=>fc(mt.value,o.thinking??"off")),Ft=F(()=>{const Xe=Rn.value,st=Dn.value;return Xe.includes(st)?st:Xe.includes("on")?"on":Xe[0]??"off"}),bn=F(()=>Yt.value==="always-on"?!0:Yt.value==="unsupported"?!1:iX(Dn.value)),Vn=F(()=>Yt.value==="unsupported"||Rn.value.length<=1),ot=F(()=>{if(!bn.value)return"";const Xe=(mt.value?.supportEfforts?.length??0)>0,st=Dn.value;return Xe&&st!=="on"?r("composer.thinkingSuffixEffort",{level:st}):r("composer.thinkingSuffix")});function In(Xe){Vn.value||i("setThinking",_y(mt.value,Xe))}const _n=F(()=>o.planMode===!0),Kn=F(()=>o.swarmMode===!0),$n=F(()=>o.activationBadges?.goal!==null),Ge=F(()=>$n.value||o.goalMode===!0),Ye=Z(!1),Ct=Z(null),$t=Z(null),mn=Z({}),Nn=F(()=>_n.value||Kn.value||Ge.value);function tn(){Ye.value=!1,document.removeEventListener("mousedown",Ln)}function Ln(Xe){const st=Xe.target;Ct.value?.contains(st)||$t.value?.contains(st)||tn()}function Zn(){if(Ye.value){tn();return}ae(),Ve();const Xe=Ct.value?.getBoundingClientRect();Xe&&(mn.value={left:`${Math.round(Xe.left)}px`,bottom:`${Math.round(window.innerHeight-Xe.top+8)}px`}),Ye.value=!0,setTimeout(()=>document.addEventListener("mousedown",Ln),0)}const Mt=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function uo(Xe){i("setPermission",Xe),Ve()}const Xt=F(()=>Mt.find(Xe=>Xe.mode===o.status?.permission)),si=F(()=>Xt.value?r(Xt.value.labelKey):""),_o=F(()=>mt.value?.provider??""),Ds=F(()=>!_o.value||!o.models?.length?[]:o.models.filter(Xe=>Xe.provider===_o.value)),ss=F(()=>new Set(o.starredIds??[]));function jo(Xe){return ss.value.has(Xe)}const is=F(()=>o.models?.length?o.models.filter(Xe=>jo(Xe.id)&&Xe.provider!==_o.value):[]);function Nt(Xe){i("selectModel",Xe),ae()}return(Xe,st)=>(w(),N("div",{class:Re(["composer",{"drag-over":x(q),expanded:p.value}]),onDragover:st[17]||(st[17]=(...de)=>x(we)&&x(we)(...de)),onDragleave:st[18]||(st[18]=(...de)=>x(ze)&&x(ze)(...de)),onDrop:st[19]||(st[19]=(...de)=>x(Ue)&&x(Ue)(...de))},[x(D).length>0?(w(),N("div",gX,[(w(!0),N(Le,null,nt(x(D),de=>(w(),N("div",{key:de.localId,class:Re(["att-chip",{"att-error":de.error}])},[se(Ht,{text:x(r)("composer.previewAttachment",{name:de.name})},{default:_e(()=>[T("button",{type:"button",class:"att-preview",onClick:pe=>x(X)(de)},[de.kind==="video"?(w(),N("video",{key:0,class:"att-thumb",src:de.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,yX)):(w(),N("img",{key:1,class:"att-thumb",src:de.previewUrl,alt:de.name},null,8,kX)),de.kind==="video"?(w(),N("span",bX,[se(Je,{name:"play",size:"sm"})])):ie("",!0)],8,vX)]),_:2},1032,["text"]),T("span",_X,R(de.name),1),de.uploading?(w(),ve(ni,{key:0,size:"sm",label:x(r)("composer.uploading")},null,8,["label"])):de.error?(w(),ve(Ht,{key:1,text:x(r)("composer.uploadFailed")},{default:_e(()=>[T("span",wX,[se(Je,{name:"info",size:"sm"})])]),_:1},8,["text"])):ie("",!0),se(Ht,{text:x(r)("composer.removeNamed",{name:de.name})},{default:_e(()=>[T("button",{class:"att-rm",onClick:pe=>x(Q)(de.localId)},[se(Je,{name:"close",size:"sm"})],8,SX)]),_:2},1032,["text"])],2))),128))])):ie("",!0),x(W)?(w(),N("div",{key:1,class:"att-lightbox",onClick:st[1]||(st[1]=vt((...de)=>x(fe)&&x(fe)(...de),["self"]))},[T("div",CX,[se(Ht,{text:x(r)("model.close")},{default:_e(()=>[T("button",{type:"button",class:"att-lightbox-close",onClick:st[0]||(st[0]=(...de)=>x(fe)&&x(fe)(...de))},"✕")]),_:1},8,["text"]),x(W).kind==="video"?(w(),N("video",{key:0,class:"att-lightbox-media",src:x(W).previewUrl,controls:"",playsinline:""},null,8,xX)):(w(),N("img",{key:1,class:"att-lightbox-media",src:x(W).previewUrl,alt:x(W).name},null,8,AX)),T("div",TX,R(x(W).name),1)])])):ie("",!0),T("div",MX,[T("div",EX,[x(v)?(w(),ve(VY,{key:0,items:x(y),"active-index":x(A),onSelect:x($),onHover:st[2]||(st[2]=de=>A.value=de)},null,8,["items","active-index","onSelect"])):ie("",!0),x(k)?(w(),ve(tX,{key:1,items:x(E),"active-index":x(M),loading:x(L),onSelect:x(I),onHover:st[3]||(st[3]=de=>M.value=de)},null,8,["items","active-index","loading","onSelect"])):ie("",!0),T("div",IX,[Mn(T("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":st[4]||(st[4]=de=>eo(l)?l.value=de:null),class:"ph",placeholder:s.value,rows:"1",onKeydown:ue,onCompositionstart:J,onCompositionend:ce,onInput:P},null,40,$X),[[ks,x(l)]]),p.value||b.value?(w(),N("button",{key:0,class:"expand-btn",type:"button","aria-label":p.value?x(r)("composer.collapseTitle"):x(r)("composer.expandTitle"),onClick:h},[p.value?(w(),ve(Je,{key:0,name:"collapse",size:"sm"})):(w(),ve(Je,{key:1,name:"expand",size:"sm"}))],8,NX)):ie("",!0)])]),Y.value?(w(),N("input",{key:0,ref_key:"fileInputRef",ref:z,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:st[5]||(st[5]=(...de)=>x(Me)&&x(Me)(...de))},null,544)):ie("",!0),T("div",{ref_key:"toolbarRef",ref:Ae,class:"toolbar"},[T("div",LX,[Y.value?(w(),ve(gn,{key:0,size:"md",label:x(r)("composer.attachImage"),onClick:x(ye)},{default:_e(()=>[se(Je,{name:"image"})]),_:1},8,["label","onClick"])):ie("",!0),e.status?(w(),N("span",{key:1,class:Re(["perm-pill",["perm-"+e.status.permission,{open:ge.value}]]),role:"button",tabindex:"0",onClick:vt(Te,["stop"]),onKeydown:[di(Te,["enter"]),di(vt(Te,["prevent"]),["space"])]},R(si.value),43,OX)):ie("",!0),ge.value&&e.status?(w(),N("div",{key:2,class:"perm-dropdown",role:"menu",onClick:st[6]||(st[6]=vt(()=>{},["stop"]))},[(w(),N(Le,null,nt(Mt,de=>T("button",{key:de.mode,class:Re(["pd-row",{"is-current":de.mode===e.status.permission}]),role:"menuitem",onClick:pe=>uo(de.mode)},[T("span",RX,[de.mode===e.status.permission?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",DX,[T("span",{class:"pd-name",style:Gt({color:de.color})},R(x(r)(de.labelKey)),5),T("span",BX,R(x(r)(de.descKey)),1)])],10,PX)),64))])):ie("",!0),e.status?(w(),N("div",{key:3,ref_key:"modesRef",ref:Ct,class:"modes"},[T("button",{type:"button",class:Re(["mode-pill",{on:Nn.value,open:Ye.value}]),onClick:vt(Zn,["stop"])},[T("span",FX,R(x(r)("status.modesLabel")),1),_n.value?(w(),N("span",HX,R(x(r)("status.planLabel")),1)):ie("",!0),Kn.value?(w(),N("span",WX,R(x(r)("status.swarmLabel")),1)):ie("",!0),Ge.value?(w(),N("span",zX,R(x(r)("status.goalLabel")),1)):ie("",!0)],2),Ye.value?(w(),N("div",{key:0,ref_key:"modesMenuRef",ref:$t,class:"modes-menu",style:Gt(mn.value)},[T("button",{type:"button",class:Re(["mode-row",{on:_n.value}]),onClick:st[7]||(st[7]=de=>i("togglePlan"))},[T("span",UX,R(x(r)("status.planLabel")),1),T("span",{class:Re(["mode-switch",{on:_n.value}])},[...st[20]||(st[20]=[T("span",{class:"mode-knob"},null,-1)])],2)],2),T("button",{type:"button",class:Re(["mode-row",{on:Kn.value}]),onClick:st[8]||(st[8]=de=>i("toggleSwarm"))},[T("span",qX,R(x(r)("status.swarmLabel")),1),T("span",{class:Re(["mode-switch",{on:Kn.value}])},[...st[21]||(st[21]=[T("span",{class:"mode-knob"},null,-1)])],2)],2),T("div",{class:Re(["mode-row mode-row-goal",{on:$n.value||o.goalMode}])},[T("button",{type:"button",class:"mode-row-main",onClick:st[9]||(st[9]=de=>$n.value?i("controlGoal","cancel"):i("toggleGoal"))},[T("span",jX,R(x(r)("status.goalLabel")),1),$n.value?ie("",!0):(w(),N("span",{key:0,class:Re(["mode-switch",{on:o.goalMode}])},[...st[22]||(st[22]=[T("span",{class:"mode-knob"},null,-1)])],2))]),$n.value?(w(),N("div",VX,[T("button",{type:"button",class:"mode-row-action",onClick:st[10]||(st[10]=de=>i("controlGoal","pause"))},R(x(r)("status.goalPause")),1),T("button",{type:"button",class:"mode-row-action",onClick:st[11]||(st[11]=de=>i("controlGoal","resume"))},R(x(r)("status.goalResume")),1)])):ie("",!0)],2)],4)):ie("",!0)],512)):ie("",!0)]),T("div",KX,[Pt.value?(w(),N("button",{key:0,class:"compact-chip",onClick:st[12]||(st[12]=vt(de=>i("compact"),["stop"]))},"/compact")):ie("",!0),se(Ht,{text:Tt.value},{default:_e(()=>[e.status&&!e.hideContext?(w(),N("span",GX,[se(mX,{pct:kt.value},null,8,["pct"]),T("span",YX,R(bt(e.status.ctxUsed))+"/"+R(bt(e.status.ctxMax)),1)])):ie("",!0)]),_:1},8,["text"]),e.status?(w(),N("span",{key:1,class:Re(["model-pill",{open:re.value}]),role:"button",tabindex:"0",onClick:vt(Ie,["stop"]),onKeydown:[di(Ie,["enter"]),di(vt(Ie,["prevent"]),["space"])]},[T("b",null,R(e.status.model),1),ot.value?(w(),N("span",QX,R(ot.value),1)):ie("",!0),se(Je,{class:"cv",name:"chevron-down",size:"sm"})],42,XX)):ie("",!0),e.running?(w(),ve(Ht,{key:2,text:x(r)("composer.interruptTitle")},{default:_e(()=>[T("button",{class:"stop","aria-label":x(r)("composer.interrupt"),onClick:st[13]||(st[13]=de=>i("interrupt"))},[se(Je,{name:"stop",size:"sm"})],8,ZX)]),_:1},8,["text"])):ie("",!0),T("button",{class:"send","aria-label":j.value,onClick:st[14]||(st[14]=de=>le())},[se(Je,{name:"send",size:"sm"})],8,JX)]),re.value&&e.status?(w(),N("div",{key:0,class:"model-dropdown",role:"menu",onClick:st[16]||(st[16]=vt(()=>{},["stop"]))},[is.value.length>0?(w(),N("div",eQ,R(x(r)("status.starredModels")),1)):ie("",!0),(w(!0),N(Le,null,nt(is.value,de=>(w(),N("button",{key:de.id,class:Re(["md-row",{"is-current":de.id===e.status.modelId}]),role:"menuitem",onClick:pe=>Nt(de.id)},[T("span",nQ,[de.id===e.status.model||de.model===e.status.model||de.displayName===e.status.model?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",oQ,R(de.displayName??de.model),1),T("span",sQ,R(de.provider),1),se(Je,{class:"md-star",name:"star",size:"sm"})],10,tQ))),128)),is.value.length>0?(w(),N("div",iQ)):ie("",!0),Ds.value.length>0?(w(),N("div",rQ,R(_o.value),1)):ie("",!0),(w(!0),N(Le,null,nt(Ds.value,de=>(w(),N("button",{key:de.id,class:Re(["md-row",{"is-current":de.id===e.status.modelId}]),role:"menuitem",onClick:pe=>Nt(de.id)},[T("span",aQ,[de.id===e.status.model||de.model===e.status.model||de.displayName===e.status.model?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",cQ,R(de.displayName??de.model),1),jo(de.id)?(w(),ve(Je,{key:0,class:"md-star",name:"star",size:"sm"})):ie("",!0)],10,lQ))),128)),Ds.value.length>0?(w(),N("div",uQ)):ie("",!0),T("div",{class:Re(["md-thinking",{"is-readonly":Vn.value}])},[T("span",dQ,R(x(r)("status.thinkingLabel")),1),Yt.value==="unsupported"?(w(),N("span",fQ,R(x(r)("status.modeNotSupported")),1)):(w(),N("div",{key:1,class:"effort-segments",role:"group","aria-label":x(r)("status.thinkingLabel")},[(w(!0),N(Le,null,nt(Rn.value,de=>(w(),N("button",{key:de,type:"button",class:Re(["effort-seg",{"is-active":de===Ft.value}]),disabled:Vn.value,onClick:pe=>In(de)},R(x(F1)(de)),11,hQ))),128))],8,pQ))],2),st[23]||(st[23]=T("div",{class:"md-divider"},null,-1)),T("button",{class:"md-row md-row-more",role:"menuitem",onClick:st[15]||(st[15]=de=>{ae(),i("pickModel")})},[T("span",mQ,R(x(r)("status.moreModels")),1)])])):ie("",!0)],512)])],34))}}),A3=ut(gQ,[["__scopeId","data-v-e6aad57a"]]),vQ=["id"],yQ=["aria-expanded"],kQ={class:"swarm-meta"},bQ={class:"swarm-meta"},_Q={class:"swarm-body"},wQ={class:"row-name"},SQ={key:0,class:"row-type"},CQ={key:0,class:"row-activity"},xQ={class:"row-phase"},AQ=je({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=Z(!0),o=F(()=>t.group.members.length),s=F(()=>t.group.counts.completed+t.group.counts.failed),i=F(()=>t.group.counts.working+t.group.counts.queued+t.group.counts.suspended),r=F(()=>i.value>0?"running":t.group.counts.failed>0?"error":"done"),l=F(()=>{switch(r.value){case"running":return`${i.value} running`;case"error":return"has failures";default:return"completed"}});function a(p){switch(p){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(p){return p.outputLines?.map(h=>h.trimEnd()).filter(Boolean).at(-1)}function u(p){return p.suspendedReason||c(p)||p.summary}function d(){n.value=!n.value}return(p,h)=>(w(),N("section",{class:Re(["swarm-card",{open:n.value}]),id:`swarm-${e.group.id}`},[T("button",{class:"swarm-head",type:"button","aria-expanded":n.value,onClick:d},[se(Hu,{status:r.value},null,8,["status"]),se(Je,{class:"swarm-ic",name:"git-pull-request",size:"sm"}),h[0]||(h[0]=T("span",{class:"swarm-title"},"Swarm",-1)),T("span",kQ,"· "+R(s.value)+"/"+R(o.value),1),T("span",bQ,"· "+R(l.value),1),se(Je,{class:"swarm-car",name:"chevron-right",size:"sm"})],8,yQ),Mn(T("div",_Q,[(w(!0),N(Le,null,nt(e.group.members,f=>(w(),N("div",{key:f.id,class:Re(["swarm-row",`phase-${f.phase}`])},[se(Hu,{class:"row-dot",status:f.phase},null,8,["status"]),se(Ht,{text:f.name},{default:_e(()=>[T("span",wQ,R(f.name),1)]),_:2},1032,["text"]),f.subagentType?(w(),N("span",SQ,R(f.subagentType),1)):ie("",!0),se(Ht,{text:u(f)},{default:_e(()=>[u(f)?(w(),N("span",CQ,R(u(f)),1)):ie("",!0)]),_:2},1032,["text"]),T("span",xQ,R(a(f.phase)),1)],2))),128))],512),[[Qs,n.value]])],10,vQ))}}),TQ=ut(AQ,[["__scopeId","data-v-e56cfe7c"]]),MQ={key:0,class:"ui-card__head"},EQ={class:"ui-card__body"},IQ={key:1,class:"ui-card__foot"},$Q=je({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),N("div",{class:Re(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),N("div",MQ,[Cn(t.$slots,"head",{},void 0,!0)])):ie("",!0),T("div",EQ,[Cn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),N("div",IQ,[Cn(t.$slots,"foot",{},void 0,!0)])):ie("",!0)],2))}}),wy=ut($Q,[["__scopeId","data-v-9c9f9a9a"]]),NQ=["type","disabled"],LQ={class:"ui-button__content"},OQ=je({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(w(),N("button",{class:Re(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(w(),ve(ni,{key:0,size:"sm",class:"ui-button__spinner"})):ie("",!0),T("span",LQ,[Cn(t.$slots,"default",{},void 0,!0)])],10,NQ))}}),Rt=ut(OQ,[["__scopeId","data-v-e58393a8"]]),PQ={class:"goal-progress","aria-hidden":"true"},RQ={class:"goal-full"},DQ={key:0,class:"goal-criterion"},BQ={class:"goal-stats"},FQ={class:"goal-actions"},HQ=je({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It(),i=Z(!1);Ke(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=F(()=>{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)=>(w(),ve(wy,{class:Re(["goal-strip",{expanded:i.value}])},o0({head:_e(()=>[T("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[4]||(c[4]=T("span",{class:"goal-kicker"},"Goal",-1)),T("span",{class:Re(["goal-objective",{"expanded-hidden":i.value}])},R(e.goal.objective),3),se($o,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:_e(()=>[qe(R(e.goal.status),1)]),_:1},8,["variant"]),T("span",PQ,[T("span",{class:"goal-progress-fill",style:Gt({width:`${r.value}%`})},null,4)]),se(Je,{class:Re(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:_e(()=>[T("div",RQ,R(e.goal.objective),1),e.goal.completionCriterion?(w(),N("div",DQ,[c[5]||(c[5]=T("span",null,"Done when",-1)),T("p",null,R(e.goal.completionCriterion),1)])):ie("",!0),T("div",BQ,[se($o,{variant:"neutral",size:"sm"},{default:_e(()=>[qe(R(e.goal.turnsUsed)+" turns",1)]),_:1}),se($o,{variant:"neutral",size:"sm"},{default:_e(()=>[qe(R(e.goal.tokensUsed.toLocaleString())+" tokens",1)]),_:1}),se($o,{variant:"neutral",size:"sm"},{default:_e(()=>[qe(R(l(e.goal.wallClockMs)),1)]),_:1}),e.goal.budget.tokenBudget!==null?(w(),ve($o,{key:0,variant:"neutral",size:"sm"},{default:_e(()=>[qe(R(r.value)+"% token budget",1)]),_:1})):ie("",!0)])]),key:"0"}:void 0,i.value?{name:"foot",fn:_e(()=>[T("div",FQ,[e.goal.status!=="paused"?(w(),ve(Rt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:c[1]||(c[1]=vt(u=>o("controlGoal","pause"),["stop"]))},{default:_e(()=>[qe(R(x(s)("status.goalPause")),1)]),_:1})):ie("",!0),e.goal.status==="paused"?(w(),ve(Rt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:c[2]||(c[2]=vt(u=>o("controlGoal","resume"),["stop"]))},{default:_e(()=>[qe(R(x(s)("status.goalResume")),1)]),_:1})):ie("",!0),se(Rt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:c[3]||(c[3]=vt(u=>o("controlGoal","cancel"),["stop"]))},{default:_e(()=>[qe(R(x(s)("status.goalCancel")),1)]),_:1})])]),key:"1"}:void 0]),1032,["class"]))}}),WQ=ut(HQ,[["__scopeId","data-v-eaeefe1e"]]),zQ={class:"qh"},UQ={class:"qtitle"},qQ={key:0,class:"qstep"},jQ={key:1,class:"qmin-peek"},VQ={class:"qbody"},KQ=["aria-label"],GQ=["aria-selected","aria-label","onClick"],YQ={class:"qstep-num"},XQ={key:1,class:"qheader-chip"},QQ={class:"qtext"},ZQ={class:"qopts"},JQ=["onClick"],eZ={class:"qopt-key"},tZ={class:"qopt-glyph"},nZ={key:0,class:"chk"},oZ={key:1,class:"rad"},sZ={class:"qopt-text"},iZ={class:"qopt-label"},rZ={key:0,class:"qopt-desc"},lZ={class:"qopt-glyph"},aZ={key:0,class:"chk"},cZ={key:1,class:"rad"},uZ={class:"qopt-label"},dZ=["placeholder"],fZ={class:"qfoot"},pZ=je({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=It(),s=t,i=Z(0),r=Z(!1),l=F(()=>n.question.questions[i.value]),a=F(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(W){W>=0&&W<a.value&&(i.value=W)}function p(W){const z=f.value[W];return z?z.kind==="multi"?z.optionIds.length>0:z.kind==="multiWithOther"?z.optionIds.length>0||z.otherText.trim().length>0:z.kind==="other"?z.text.trim().length>0:!0:!1}function h(){return p(l.value.id)}const f=Z({});function m(W){return W.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${W.label} ${W.description??""}`.toLowerCase())}function b(){const W={...f.value};let z=!1;for(const q of n.question.questions){if(W[q.id])continue;const Q=q.options.filter(m);Q.length!==0&&(W[q.id]=q.multiSelect?{kind:"multi",optionIds:Q.map(X=>X.id)}:{kind:"single",optionId:Q[0].id},z=!0)}z&&(f.value=W)}Ke(()=>n.question.questionId,()=>{i.value=0,r.value=!1,f.value={},v.value={}}),Ke(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function _(W,z){const q=f.value[W];if(q&&q.kind==="single"&&q.optionId===z){const Q={...f.value};delete Q[W],f.value=Q}else f.value={...f.value,[W]:{kind:"single",optionId:z}}}function g(W,z){const q=f.value[W],Q=q&&(q.kind==="multi"||q.kind==="multiWithOther")?q.kind==="multi"?[...q.optionIds]:[...q.optionIds]:[],X=Q.indexOf(z);X>=0?Q.splice(X,1):Q.push(z);const fe=f.value[W],ye=fe&&fe.kind==="multiWithOther"?fe.otherText:"";ye?f.value={...f.value,[W]:{kind:"multiWithOther",optionIds:Q,otherText:ye}}:f.value={...f.value,[W]:{kind:"multi",optionIds:Q}}}const v=Z({}),y=Z(null);function A(W){const z=n.question.questions.find(Q=>Q.id===W),q=v.value[W]??"";if(z.multiSelect){const Q=f.value[W],X=Q&&(Q.kind==="multi"||Q.kind==="multiWithOther")?Q.kind==="multi"?[...Q.optionIds]:[...Q.optionIds]:[];f.value={...f.value,[W]:{kind:"multiWithOther",optionIds:X,otherText:q}}}else f.value={...f.value,[W]:{kind:"other",text:q}}}function O(W){A(W),ht(()=>y.value?.focus())}function $(W,z){const q=f.value[W];return q?q.kind==="single"?q.optionId===z:q.kind==="multi"||q.kind==="multiWithOther"?q.optionIds.includes(z):!1:!1}function k(W){const z=f.value[W];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function E(){return n.question.questions.every(W=>p(W.id))}const M=F(()=>n.busyKind==="answer"),L=F(()=>n.busyKind==="dismiss"),S=F(()=>!!n.busyKind);function I(){if(S.value||!E())return;const W={answers:f.value,method:"click"};s("answer",n.question.questionId,W)}function P(){S.value||s("dismiss",n.question.questionId)}function D(W){const z=(document.activeElement?.tagName??"").toLowerCase(),q=z==="input"||z==="textarea";if(S.value)return;if(W.key==="Enter"){if(W.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():E()&&I();return}if(q)return;if(W.key==="Escape"){W.preventDefault(),P();return}if(r.value)return;const Q=parseInt(W.key,10);if(!isNaN(Q)&&Q>=1&&Q<=9){W.preventDefault();const X=l.value,fe=Q-1,ye=X.options[fe];ye&&(X.multiSelect?g(X.id,ye.id):_(X.id,ye.id))}}return hn(()=>document.addEventListener("keydown",D)),kn(()=>document.removeEventListener("keydown",D)),(W,z)=>(w(),ve(wy,{class:Re(["qcard",{minimized:r.value}])},o0({head:_e(()=>[T("div",zQ,[z[5]||(z[5]=T("span",{class:"qh-ic"},"?",-1)),T("span",UQ,R(x(o)("question.title")),1),a.value>1&&!r.value?(w(),N("span",qQ,R(x(o)("question.step",{current:i.value+1,total:a.value})),1)):ie("",!0),r.value?(w(),N("span",jQ,R(l.value.question),1)):ie("",!0),se(gn,{class:"qmin",size:"sm",label:r.value?x(o)("question.expand"):x(o)("question.minimize"),onClick:z[0]||(z[0]=q=>r.value=!r.value)},{default:_e(()=>[r.value?(w(),ve(Je,{key:0,name:"chevron-down",size:"md"})):(w(),ve(Je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:_e(()=>[T("div",VQ,[a.value>1?(w(),N("div",{key:0,class:"qsteps",role:"tablist","aria-label":x(o)("question.step",{current:i.value+1,total:a.value})},[(w(!0),N(Le,null,nt(n.question.questions,(q,Q)=>(w(),N("button",{key:q.id,type:"button",class:Re(["qstep-dot",{active:Q===i.value,answered:p(q.id)}]),"aria-selected":Q===i.value,"aria-label":x(o)("question.step",{current:Q+1,total:a.value}),onClick:X=>d(Q)},[T("span",YQ,R(Q+1),1)],10,GQ))),128))],8,KQ)):ie("",!0),l.value.header?(w(),N("div",XQ,[se($o,{variant:"neutral",size:"sm"},{default:_e(()=>[qe(R(l.value.header),1)]),_:1})])):ie("",!0),T("div",QQ,R(l.value.question),1),l.value.body?(w(),ve(Oh,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ie("",!0),T("div",ZQ,[(w(!0),N(Le,null,nt(l.value.options,(q,Q)=>(w(),N("label",{key:q.id,class:Re(["qopt",{selected:$(l.value.id,q.id)}]),onClick:vt(X=>l.value.multiSelect?g(l.value.id,q.id):_(l.value.id,q.id),["prevent"])},[T("span",eZ,R(Q+1),1),T("span",tZ,[l.value.multiSelect?(w(),N("span",nZ,R($(l.value.id,q.id)?"■":"□"),1)):(w(),N("span",oZ,R($(l.value.id,q.id)?"●":"○"),1))]),T("span",sZ,[T("span",iZ,R(q.label),1),q.description?(w(),N("span",rZ,R(q.description),1)):ie("",!0)])],10,JQ))),128)),l.value.allowOther?(w(),N("label",{key:0,class:Re(["qopt",{selected:k(l.value.id)}]),onClick:z[4]||(z[4]=vt(q=>O(l.value.id),["prevent"]))},[z[6]||(z[6]=T("span",{class:"qopt-key"},null,-1)),T("span",lZ,[l.value.multiSelect?(w(),N("span",aZ,R(k(l.value.id)?"■":"□"),1)):(w(),N("span",cZ,R(k(l.value.id)?"●":"○"),1))]),T("span",uZ,R(l.value.otherLabel??x(o)("question.otherDefault")),1),Mn(T("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":z[1]||(z[1]=q=>v.value[l.value.id]=q),class:"other-input",type:"text",placeholder:l.value.otherLabel??x(o)("question.otherDefault"),onInput:z[2]||(z[2]=q=>A(l.value.id)),onFocus:z[3]||(z[3]=q=>A(l.value.id))},null,40,dZ),[[ks,v.value[l.value.id]]])],2)):ie("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:_e(()=>[T("div",fZ,[i.value<a.value-1?(w(),ve(Rt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:_e(()=>[qe(R(x(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),ve(Rt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!E(),loading:M.value,onClick:I},{default:_e(()=>[qe(R(x(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),ve(Rt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:_e(()=>[qe(R(x(o)("question.back")),1)]),_:1},8,["disabled"])):ie("",!0),se(Rt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:L.value,disabled:S.value,onClick:P},{default:_e(()=>[qe(R(x(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),hZ=ut(pZ,[["__scopeId","data-v-08fbd85e"]]),mZ={class:"ah"},gZ={class:"akind"},vZ={class:"apath"},yZ={class:"ah-path"},kZ={key:1,class:"diff"},bZ={class:"dg"},_Z={class:"dc"},wZ={key:2,class:"body-shell"},SZ={class:"shell-cmd"},CZ={key:0,class:"shell-cwd"},xZ={key:1,class:"shell-danger"},AZ={key:3,class:"body-file"},TZ={class:"file-bar"},MZ={class:"file-lang"},EZ={class:"file-content"},IZ={class:"file-ln"},$Z={class:"file-text"},NZ={key:4,class:"body-chip"},LZ={class:"chip-label"},OZ={class:"chip-value"},PZ={key:0,class:"chip-detail"},RZ={key:5,class:"body-chip"},DZ={key:0,class:"chip-label"},BZ={class:"chip-value"},FZ={key:6,class:"body-chip"},HZ={class:"chip-label"},WZ={class:"chip-value"},zZ={key:0,class:"chip-detail"},UZ={key:7,class:"body-chip"},qZ={class:"chip-label"},jZ={class:"chip-value"},VZ={key:0,class:"chip-detail"},KZ={key:8,class:"body-todo"},GZ={class:"todo-glyph"},YZ={key:9,class:"body-plan"},XZ={key:10,class:"body-generic"},QZ={class:"gen-text"},ZZ={key:11,class:"feedback-wrap"},JZ=["placeholder"],eJ={class:"feedback-hint"},tJ={key:0,class:"plan-actions"},nJ={class:"k"},oJ={key:0,class:"k"},sJ={key:0,class:"k"},iJ={key:1,class:"abtn"},rJ=je({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It(),i=F(()=>{const M=n.block;return M.kind!=="plan_review"?null:{plan:M.plan,path:M.path,options:M.options??[]}}),r=Z(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const M=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${M}`)}const c=Z(!1),u=Z(""),d=Z(null);function p(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const M=u.value.trim();i.value?_("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:M||void 0}):_("feedback",{decision:"rejected",feedback:M||void 0}),c.value=!1,u.value=""}function f(){c.value=!1,u.value=""}function m(M){M.key==="Enter"&&!M.shiftKey?(M.preventDefault(),h()):M.key==="Escape"&&(M.preventDefault(),f())}const b=Z(null);Ke(()=>n.busy,M=>{M||(b.value=null)});function _(M,L){n.busy||(b.value=M,o("decide",L))}function g(){_("approve",{decision:"approved"})}function v(){_("approveSession",{decision:"approved",scope:"session"})}function y(){_("reject",{decision:"rejected"})}function A(){_("approvePlan",{decision:"approved"})}function O(M){_(`option:${M}`,{decision:"approved",selectedLabel:M})}function $(){n.busy||p()}function k(){_("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(M){const L=(document.activeElement?.tagName??"").toLowerCase();if(L==="input"||L==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){M.key==="1"?(M.preventDefault(),A()):M.key==="2"?(M.preventDefault(),$()):M.key==="3"&&(M.preventDefault(),k());return}M.key==="1"&&S.options[0]?(M.preventDefault(),O(S.options[0].label)):M.key==="2"&&S.options[1]?(M.preventDefault(),O(S.options[1].label)):M.key==="3"&&S.options[2]&&(M.preventDefault(),O(S.options[2].label));return}M.key==="1"?(M.preventDefault(),g()):M.key==="2"?(M.preventDefault(),v()):M.key==="3"?(M.preventDefault(),y()):M.key==="4"&&(M.preventDefault(),p())}return hn(()=>document.addEventListener("keydown",E)),kn(()=>document.removeEventListener("keydown",E)),(M,L)=>(w(),ve(wy,{class:Re(["appr",{minimized:r.value}])},o0({head:_e(()=>[T("div",mZ,[L[2]||(L[2]=T("span",{class:"ah-ic"},"!",-1)),T("span",gZ,R(a()),1),T("span",vZ,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),N(Le,{key:0},[qe(R(e.block.path),1)],64)):e.block.kind==="shell"?(w(),N(Le,{key:1},[qe(R(e.block.command),1)],64)):e.block.kind==="url"?(w(),N(Le,{key:2},[qe(R(e.block.url),1)],64)):e.block.kind==="search"?(w(),N(Le,{key:3},[qe(R(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),N(Le,{key:4},[qe(R(e.block.name),1)],64)):e.block.kind==="generic"?(w(),N(Le,{key:5},[qe(R(e.block.summary),1)],64)):ie("",!0)]),e.agentName&&!r.value?(w(),ve($o,{key:0,variant:"neutral",size:"sm"},{default:_e(()=>[qe(R(x(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ie("",!0),r.value?ie("",!0):(w(),ve($o,{key:1,variant:"warning",size:"sm",class:"aw"},{default:_e(()=>[qe(R(x(s)("approval.required")),1)]),_:1})),se(gn,{class:"amin",size:"sm",label:r.value?x(s)("question.expand"):x(s)("question.minimize"),onClick:L[0]||(L[0]=S=>r.value=!r.value)},{default:_e(()=>[r.value?(w(),ve(Je,{key:0,name:"chevron-down",size:"md"})):(w(),ve(Je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:_e(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),ve(Ht,{key:0,text:e.block.path},{default:_e(()=>[T("div",yZ,R(e.block.path),1)]),_:1},8,["text"])):ie("",!0),e.block.kind==="diff"?(w(),N("div",kZ,[(w(!0),N(Le,null,nt(e.block.diff,(S,I)=>(w(),N("div",{key:I,class:Re(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[T("span",bZ,R(S.gutter),1),T("span",_Z,R(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),N("div",wZ,[T("div",SZ,[L[3]||(L[3]=T("span",{class:"shell-dollar"},"$",-1)),qe(" "+R(e.block.command),1)]),e.block.cwd?(w(),N("div",CZ,"cwd: "+R(e.block.cwd),1)):ie("",!0),e.block.danger?(w(),N("div",xZ,R(x(s)("approval.danger",{detail:e.block.danger})),1)):ie("",!0)])):e.block.kind==="file"?(w(),N("div",AZ,[T("div",TZ,[T("span",MZ,R(e.block.language??""),1)]),T("div",EZ,[(w(!0),N(Le,null,nt(e.block.content.split(`
|
|
256
|
-
`),(S,I)=>(w(),N("div",{key:I,class:"file-line"},[T("span",IZ,R(I+1),1),T("span",$Z,R(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),N("div",NZ,[T("span",LZ,R(e.block.op),1),T("span",OZ,R(e.block.path),1),e.block.detail?(w(),N("span",PZ,R(e.block.detail),1)):ie("",!0)])):e.block.kind==="url"?(w(),N("div",RZ,[e.block.method?(w(),N("span",DZ,R(e.block.method),1)):ie("",!0),T("span",BZ,R(e.block.url),1)])):e.block.kind==="search"?(w(),N("div",FZ,[T("span",HZ,R(x(s)("approval.searchQueryLabel")),1),T("span",WZ,R(e.block.query),1),e.block.scope?(w(),N("span",zZ,R(x(s)("approval.searchScope",{scope:e.block.scope})),1)):ie("",!0)])):e.block.kind==="invocation"?(w(),N("div",UZ,[T("span",qZ,R(e.block.kind2),1),T("span",jZ,R(e.block.name),1),e.block.description?(w(),N("span",VZ,R(e.block.description),1)):ie("",!0)])):e.block.kind==="todo"?(w(),N("div",KZ,[(w(!0),N(Le,null,nt(e.block.items,(S,I)=>(w(),N("div",{key:I,class:"todo-item"},[T("span",GZ,R(S.status==="done"||S.status==="completed"?"✓":"○"),1),T("span",{class:Re(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},R(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),N("div",YZ,[se(Oh,{text:e.block.plan},null,8,["text"])])):(w(),N("div",XZ,[T("span",QZ,R(e.block.summary),1)])),c.value?(w(),N("div",ZZ,[Mn(T("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":L[1]||(L[1]=S=>u.value=S),class:"feedback-ta",placeholder:x(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,JZ),[[ks,u.value]]),T("div",eJ,R(x(s)("approval.feedbackHint")),1)])):ie("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:_e(()=>[i.value?(w(),N("div",tJ,[i.value.options.length>0?(w(!0),N(Le,{key:0},nt(i.value.options,(S,I)=>(w(),ve(Ht,{key:I,text:S.description},{default:_e(()=>[se(Rt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:P=>O(S.label)},{default:_e(()=>[qe(R(S.label),1),T("span",nJ,"["+R(I+1)+"]",1)]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),ve(Rt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:A},{default:_e(()=>[qe(R(x(s)("approval.approvePlan")),1),L[4]||(L[4]=T("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"])),se(Rt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:$},{default:_e(()=>[qe(R(x(s)("approval.revise")),1),i.value.options.length===0?(w(),N("span",oJ,"[2]")):ie("",!0)]),_:1},8,["disabled"]),se(Rt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:k},{default:_e(()=>[qe(R(x(s)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),N("span",sJ,"[3]")):ie("",!0)]),_:1},8,["loading","disabled"])])):(w(),N("div",iJ,[se(Rt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:g},{default:_e(()=>[qe(R(x(s)("approval.approve")),1),L[5]||(L[5]=T("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"]),se(Rt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:v},{default:_e(()=>[qe(R(x(s)("approval.approveSession")),1),L[6]||(L[6]=T("span",{class:"k"},"[2]",-1))]),_:1},8,["loading","disabled"]),se(Rt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:y},{default:_e(()=>[qe(R(x(s)("approval.reject")),1),L[7]||(L[7]=T("span",{class:"k"},"[3]",-1))]),_:1},8,["loading","disabled"]),se(Rt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:p},{default:_e(()=>[qe(R(x(s)("approval.feedback")),1),L[8]||(L[8]=T("span",{class:"k"},"[4]",-1))]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),lJ=ut(rJ,[["__scopeId","data-v-4c0c7bdb"]]),aJ=je({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(w(),N("span",{class:Re(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},R(n[t.status]),3))}}),T3=ut(aJ,[["__scopeId","data-v-f595d935"]]),cJ={class:"taskspane"},uJ={class:"tp-head"},dJ={class:"tp-title"},fJ={class:"tp-count"},pJ={class:"tp-list"},hJ={key:0,class:"tp-empty"},mJ=["role","onClick"],gJ={class:"tp-name"},vJ={class:"tp-time"},yJ=["onClick"],kJ={key:0,class:"tp-detail"},bJ={key:0,class:"tp-codebox"},_J=["onClick"],wJ={class:"tp-pre"},SJ={class:"tp-cmd"},CJ={key:1,class:"tp-codebox"},xJ=["onClick"],AJ={class:"tp-pre"},TJ=je({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=It(),s=No(new Set),i=No(new Set),r=No(new Set);function l(f){return!!(f.output&&f.output.length>0||f.meta)}function a(f){if(f.kind==="subagent"){n("open",f.id);return}l(f)&&(s.has(f.id)?s.delete(f.id):s.add(f.id))}function c(f){return f.kind==="subagent"||l(f)}function u(f){return f==="run"||f==="done"||f==="fail"?f:"pending"}async function d(f,m,b){await Uo(f)&&(b.add(m),setTimeout(()=>b.delete(m),1500))}async function p(f){f.meta&&await d(f.meta,f.id,i)}async function h(f){const m=f.output?.join(`
|
|
257
|
-
`)??"";m&&await d(m,f.id,r)}return(f,m)=>(w(),N("div",cJ,[T("div",uJ,[T("span",dJ,R(x(o)("tasks.tag")),1),T("span",fJ,R(e.tasks.length),1)]),T("div",pJ,[e.tasks.length===0?(w(),N("div",hJ,R(x(o)("tasks.emptyTasks")),1)):(w(!0),N(Le,{key:1},nt(e.tasks,b=>(w(),N("div",{key:b.id,class:Re(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[T("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:_=>a(b)},[se(T3,{status:u(b.state)},null,8,["status"]),T("span",gJ,R(b.name),1),se($o,{variant:"neutral",size:"sm"},{default:_e(()=>[qe(R(b.kind),1)]),_:2},1024),T("span",vJ,R(b.timing),1),b.state==="run"?(w(),N("button",{key:0,class:"tp-stop",onClick:vt(_=>n("cancel",b.id),["stop"])},R(x(o)("tasks.stop")),9,yJ)):ie("",!0),b.kind==="subagent"?(w(),ve(Je,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(w(),ve(Je,{key:2,class:Re(["tp-chevron",{open:s.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ie("",!0)],8,mJ),s.has(b.id)&&l(b)?(w(),N("div",kJ,[b.meta?(w(),N("div",bJ,[T("button",{class:Re(["tp-copy",{copied:i.has(b.id)}]),onClick:vt(_=>p(b),["stop"])},R(i.has(b.id)?"已复制":"复制"),11,_J),T("pre",wJ,[T("code",null,[T("span",SJ,R(b.meta),1)])])])):ie("",!0),b.output&&b.output.length>0?(w(),N("div",CJ,[T("button",{class:Re(["tp-copy",{copied:r.has(b.id)}]),onClick:vt(_=>h(b),["stop"])},R(r.has(b.id)?"已复制":"复制"),11,xJ),T("pre",AJ,[T("code",null,[m[0]||(m[0]=qe(`
|
|
258
|
-
`,-1)),(w(!0),N(Le,null,nt(b.output,(_,g)=>(w(),N("span",{key:g,class:"tp-line"},R(_),1))),128)),m[1]||(m[1]=qe(`
|
|
259
|
-
`,-1))])])])):ie("",!0)])):ie("",!0)],2))),128))])]))}}),GS=ut(TJ,[["__scopeId","data-v-28fd5fc0"]]),MJ={class:"todo-card"},EJ={key:0,class:"tc-empty"},IJ={class:"tc-name"},$J=je({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=It();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(w(),N("div",MJ,[t.todos.length===0?(w(),N("div",EJ,[i[0]||(i[0]=T("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("path",{d:"M9 11l2 2 4-4"}),T("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),T("span",null,R(x(n)("tasks.emptyTodo")),1)])):ie("",!0),(w(!0),N(Le,null,nt(t.todos,(r,l)=>(w(),N("div",{key:l,class:Re(["tc-row",`s-${r.status}`])},[se(T3,{status:o(r.status)},null,8,["status"]),T("span",IJ,R(r.title),1)],2))),128))]))}}),NJ=ut($J,[["__scopeId","data-v-5ad486e3"]]),LJ=["disabled","aria-pressed"],OJ=je({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(w(),N("button",{key:0,class:Re(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[Cn(t.$slots,"default",{},void 0,!0)],10,LJ)):(w(),N("span",{key:1,class:Re(["ui-pill",{"is-active":e.active}])},[Cn(t.$slots,"default",{},void 0,!0)],2))}}),cv=ut(OJ,[["__scopeId","data-v-317ace1a"]]),PJ={class:"dock-work-head"},RJ={key:0,class:"dock-work-tab static"},DJ={key:1,class:"dock-work-tab static"},BJ={key:2,class:"dock-work-tab static"},FJ={class:"dock-work-body"},HJ={class:"dw-count"},WJ={class:"dw-count"},zJ={class:"dw-count"},UJ=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:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=It(),r=Z(null),l=Z(null),a=Z(null);function c(p){r.value?.loadForEdit(p)}function u(){r.value?.focus()}function d(p){if(!o.dockPanel)return;const h=p.target;h&&(l.value?.contains(h)||a.value?.contains(h)||s("close-dock-panel"))}return Ke(()=>o.dockPanel,p=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),p&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),kn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c,focus:u}),(p,h)=>(w(),N("div",{class:Re(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[28]||(h[28]=vt(()=>{},["stop"]))},[se(Gr,{name:"dock-panel"},{default:_e(()=>[e.dockPanel?(w(),N("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[3]||(h[3]=vt(()=>{},["stop"]))},[T("div",PJ,[e.dockPanel==="bash"?(w(),N("span",RJ,R(x(i)("tasks.dockBash"))+" · "+R(e.bashRunning)+" "+R(x(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),N("span",DJ,R(x(i)("tasks.dockSubagent"))+" · "+R(e.subagentRunning)+" "+R(x(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),N("span",BJ,R(x(i)("tasks.dockTodos"))+" · "+R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1)):ie("",!0)]),T("div",FJ,[e.dockPanel==="bash"?(w(),ve(GS,{key:0,tasks:e.bashTasks,onCancel:h[0]||(h[0]=f=>s("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),ve(GS,{key:1,tasks:e.subagentTasks,onCancel:h[1]||(h[1]=f=>s("cancelTask",f)),onOpen:h[2]||(h[2]=f=>s("openAgent",f))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),ve(NJ,{key:2,todos:e.todos??[]},null,8,["todos"])):ie("",!0)])],512)):ie("",!0)]),_:1}),e.goal?(w(),ve(WQ,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[4]||(h[4]=f=>s("controlGoal",f))},null,8,["goal","force-expanded"])):ie("",!0),e.hasDockWork?(w(),N("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),ve(cv,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:h[5]||(h[5]=f=>s("toggle-dock-panel","bash"))},{default:_e(()=>[se(Je,{name:"clock",size:"md"}),T("span",null,R(x(i)("tasks.dockBash")),1),T("span",HJ,[h[29]||(h[29]=qe("(",-1)),T("b",null,R(e.bashTasks.length),1),h[30]||(h[30]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0),e.subagentTasks.length>0?(w(),ve(cv,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:h[6]||(h[6]=f=>s("toggle-dock-panel","subagent"))},{default:_e(()=>[se(Je,{name:"sparkles",size:"md"}),T("span",null,R(x(i)("tasks.dockSubagent")),1),T("span",WJ,[h[31]||(h[31]=qe("(",-1)),T("b",null,R(e.subagentTasks.length),1),h[32]||(h[32]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0),(e.todos?.length??0)>0?(w(),ve(cv,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:h[7]||(h[7]=f=>s("toggle-dock-panel","todos"))},{default:_e(()=>[se(Je,{name:"check-list",size:"md"}),T("span",null,R(x(i)("tasks.dockTodos")),1),T("span",zJ,[h[33]||(h[33]=qe("(",-1)),T("b",null,R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1),h[34]||(h[34]=qe(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0)],512)):ie("",!0),e.pendingQuestion?(w(),ve(hZ,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:h[8]||(h[8]=(f,m)=>s("answer",f,m)),onDismiss:h[9]||(h[9]=f=>s("dismiss",f))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),ve(lJ,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:h[10]||(h[10]=f=>s("approval",e.pendingApproval.approvalId,f))},null,8,["block","agent-name","busy"])):(w(),ve(A3,{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:h[11]||(h[11]=f=>s("submit",f)),onSteer:h[12]||(h[12]=f=>s("steer",f)),onCommand:h[13]||(h[13]=f=>s("command",f)),onInterrupt:h[14]||(h[14]=f=>s("interrupt")),onSetPermission:h[15]||(h[15]=f=>s("setPermission",f)),onSetThinking:h[16]||(h[16]=f=>s("setThinking",f)),onTogglePlan:h[17]||(h[17]=f=>s("togglePlan")),onToggleSwarm:h[18]||(h[18]=f=>s("toggleSwarm")),onToggleGoal:h[19]||(h[19]=f=>s("toggleGoal")),onOpenBtw:h[20]||(h[20]=f=>s("openBtw")),onCreateGoal:h[21]||(h[21]=f=>s("createGoal",f)),onControlGoal:h[22]||(h[22]=f=>s("controlGoal",f)),onFocusGoal:h[23]||(h[23]=f=>s("focusGoal")),onFocusSwarm:h[24]||(h[24]=f=>s("focusSwarm")),onCompact:h[25]||(h[25]=f=>s("compact")),onPickModel:h[26]||(h[26]=f=>s("pickModel")),onSelectModel:h[27]||(h[27]=f=>s("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))}}),qJ=ut(UJ,[["__scopeId","data-v-c6b691c5"]]),jJ=["aria-label","aria-hidden"],VJ={class:"toc-scroll"},KJ=["onClick"],GJ={class:"toc-label"},YJ=240,XJ=je({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It(),i=Z(null),r=Z(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const p=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-p>=YJ}const c=F(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ke(c,u=>{l?.disconnect(),l=null,u&&ht(()=>{const d=i.value,p=d?.offsetParent;!d||!p||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(p)),a())})},{immediate:!0}),lo(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),N("nav",{key:0,ref_key:"navRef",ref:i,class:Re(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":x(s)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[T("div",VJ,[(w(!0),N(Le,null,nt(e.items,p=>(w(),N("button",{key:p.id,type:"button",class:Re(["toc-row",{active:e.activeTurnId===p.id}]),onClick:h=>o("select",p.id)},[d[0]||(d[0]=T("span",{class:"toc-bar"},null,-1)),T("span",GJ,R(p.title),1)],10,KJ))),128))])],10,jJ)):ie("",!0)}}),QJ=ut(XJ,[["__scopeId","data-v-0a2a2a96"]]),ZJ=5;function JJ(e,t,n,o=ZJ){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const eee={class:"chat-layout"},tee={class:"empty-hint"},nee={class:"empty-hint-title"},oee={class:"empty-hint-text"},see={key:0,class:"ws-pick"},iee={class:"ws-pick-name"},ree={key:1,class:"ws-pick-menu"},lee=["onClick"],aee={class:"ws-pick-item-name"},cee={class:"ws-pick-item-path"},uee={key:0,class:"swarm-stack"},dee=["aria-label"],fee={key:0,class:"abort-toast",role:"status","aria-live":"polite"},pee={class:"abort-toast-text"},uv=80,YS=1e3,hee=420,mee=3e3,gee=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:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=Z(!1),r=Z(!1),l=F(()=>o.workspaces?.find(pe=>pe.id===o.activeWorkspaceId)?.name??o.workspaceName??""),a=F(()=>(o.workspaces?.length??0)>0),c=F(()=>JJ(o.workspaces??[],o.activeWorkspaceId,r.value)),u=F(()=>(o.workspaces?.length??0)-c.value.length);Ke(i,de=>{de||(r.value=!1)});const d=F(()=>o.swarms?.filter(de=>de.members.some(pe=>pe.phase!=="completed"&&pe.phase!=="failed"))??[]);function p(de){i.value=!1,de!==o.activeWorkspaceId&&s("selectWorkspace",de)}const{t:h}=It();cc(Et.contentAlign);const f=Z(null),m=Z(null),b=Z(null),_=Z(!1),g=Z(0);let v=null;function y(de){(b.value??m.value)?.loadForEdit(de)}function A(){_.value=!0,v!==null&&clearTimeout(v),v=setTimeout(()=>{v=null,_.value=!1},2e3)}function O(){g.value++}function $(){ht(()=>{Fe.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const k=F(()=>o.tasks.filter(de=>de.kind!=="subagent")),E=F(()=>o.tasks.filter(de=>de.kind==="subagent"&&de.runInBackground)),M=F(()=>k.value.filter(de=>de.state==="run").length),L=F(()=>E.value.filter(de=>de.state==="run").length);function S(de){const pe=o.tasks,Oe=pe.find(Wt=>Wt.id===de)??pe.find(Wt=>Wt.parentToolCallId===de);if(Oe)return Oe.id;const Qt=pe.filter(Wt=>Wt.kind==="subagent"&&!Wt.parentToolCallId);if(Qt.length===1)return Qt[0].id}En("resolveAgentTaskId",S);const I=F(()=>(o.todos??[]).filter(de=>de.status==="done").length),P=F(()=>k.value.length>0||E.value.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),D=Z(null),W=F(()=>o.gitInfo?o.changes?.length??0:0);function z(de){D.value=D.value===de?null:de}function q(){D.value=null}Ke(P,de=>{de||q()});function Q(de){if(de.role==="compaction")return h("conversation.compactedPlain");if(de.role==="user"){if(de.skillActivation)return`/${de.skillActivation.name}`;if(de.pluginCommand)return`/${de.pluginCommand.pluginId}:${de.pluginCommand.commandName}`;const Oe=de.text.trim().replaceAll(/\s+/g," ");return Oe.length>0?Oe:"user"}const pe=(de.text||de.thinking||"").trim().replaceAll(/\s+/g," ");return pe.length>0?pe:(de.tools?.length??0)>0?`${de.tools.length} tools`:"kimi"}const X=F(()=>o.turns.filter(de=>de.role==="user").map((de,pe)=>({id:de.id,role:de.role,no:pe+1,title:Q(de)}))),fe=Z(null);function ye(){const de=Fe.value;if(!de)return;const pe=de.querySelectorAll(".turn-anchor[data-turn-id]");if(pe.length===0)return;const Oe=X.value;if(Oe.length===0)return;const Qt=new Set(Oe.map(bs=>bs.id));if(j()<=uv){fe.value=Oe[Oe.length-1].id;return}const Wt=de.getBoundingClientRect(),fo=Wt.height/2;let Bn=null;pe.forEach(bs=>{const ii=bs.dataset.turnId;if(!ii||!Qt.has(ii))return;bs.getBoundingClientRect().top-Wt.top<=fo&&(Bn=ii)}),fe.value=Bn??Oe[0].id}const Me=F(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),we=F(()=>{const de=Me.value;if(de)return o.pendingQuestionActions?.[de.questionId]}),ze=F(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),Ue=F(()=>{const de=ze.value;return de?!!o.pendingApprovalActions?.[de.approvalId]:!1}),Fe=Z(null),rt=Z(null),le=Z(0),U=Z(0),G=F(()=>({"--panes-scrollbar-width":`${le.value}px`}));function ne(de){return de instanceof HTMLElement?de:de&&"$el"in de&&de.$el instanceof HTMLElement?de.$el:null}function H(){const de=Fe.value;le.value=de?Math.max(0,de.offsetWidth-de.clientWidth):0,U.value=rt.value?.offsetHeight??0}function J(de){const pe=ne(de);Fe.value=pe,pe&&si()}function ce(de){const pe=ne(de);rt.value=pe??null,de&&"loadForEdit"in de&&typeof de.loadForEdit=="function"&&"focus"in de&&typeof de.focus=="function"?b.value={loadForEdit:de.loadForEdit.bind(de),focus:de.focus.bind(de)}:b.value=null,Xt()}const te=Z(!0),ue=Z(!1);function j(){const de=Fe.value;return de?de.scrollHeight-de.scrollTop-de.clientHeight:0}let Y=0,re=0,ge=0,Ae=0,Ie=0,ae=0;function Te(){return Date.now()<re}function Ve(){const de=Fe.value;if(!de)return;const pe=de.scrollTop;if(performance.now()-ge<100){Y=pe;return}const Oe=j();if(Te()){te.value=!0,ue.value=!1,Y=pe;return}pe<Y-1&&Oe>1?te.value=!1:Oe<=uv&&pe>Y+1&&(te.value=!0,ue.value=!1),Y=pe,ye()}function tt(de=!1){const pe=Fe.value;te.value=!0,ue.value=!1,pe&&(!de&&performance.now()<Ae||(de&&typeof pe.scrollTo=="function"?(ge=performance.now(),Ae=performance.now()+hee,pe.scrollTo({top:pe.scrollHeight,behavior:"smooth"})):pe.scrollTop=pe.scrollHeight,Y=pe.scrollTop))}function bt(de,pe){const Oe=de.querySelectorAll(".turn-anchor");for(const Qt of Oe)if(Qt.offsetTop>=pe){const Wt=Qt.dataset.turnId;if(Wt)return{id:Wt,top:Qt.offsetTop}}return null}async function kt(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||!o.hasMoreMessages)return;const de=o.sessionId,pe=Fe.value,Oe=pe?.scrollTop??0,Qt=pe?.scrollHeight??0,Wt=pe?bt(pe,Oe):null;Zn.value=!0;try{await o.loadOlderMessages(de),await ht()}finally{Zn.value=!1}if(o.sessionId!==de)return;const fo=Fe.value;if(!fo)return;let Bn=0;if(Wt){const bs=fo.querySelector(`.turn-anchor[data-turn-id="${Tt(Wt.id)}"]`);bs&&(Bn=bs.offsetTop-Wt.top)}Bn===0&&(Bn=fo.scrollHeight-Qt),fo.scrollTop=Oe+Bn}function Tt(de){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(de):de.replaceAll(/["\\]/g,"\\$&")}function Pt(de){const pe=Fe.value;if(!pe)return;const Oe=pe.querySelector(`.turn-anchor[data-turn-id="${Tt(de)}"]`);Oe&&(te.value=!1,ue.value=j()>uv,Oe.scrollIntoView({behavior:"smooth",block:"center"}))}function mt(){const de=Fe.value;if(!de)return"none";const pe=de.firstElementChild,Oe=pe instanceof HTMLElement?pe.offsetHeight:0,Qt=rt.value?.offsetHeight??0;return`${de.scrollHeight}:${de.clientHeight}:${Oe}:${Qt}`}function Yt(de){return typeof requestAnimationFrame=="function"?requestAnimationFrame(de):setTimeout(de,16)}function Rn(de){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(de):clearTimeout(de)}function Dn(de=36){if(!te.value&&!Te())return;const pe=++ae;let Oe="",Qt=0,Wt=0;Ie&&(Rn(Ie),Ie=0);const fo=()=>{if(Ie=0,pe!==ae||!te.value&&!Te())return;tt(!1);const Bn=mt();Qt=Bn===Oe?Qt+1:0,Oe=Bn,Wt++,Qt<3&&Wt<de&&(Ie=Yt(fo))};Ie=Yt(fo)}function Ft(de,pe){return de!==void 0&&de.length>0&&pe.length>=de.length&&de.firstId!==pe.firstId&&de.lastId===pe.lastId&&de.lastTextLen===pe.lastTextLen&&de.lastThinkingLen===pe.lastThinkingLen&&de.lastToolsLen===pe.lastToolsLen&&de.approvalIds===pe.approvalIds}const bn=F(()=>{const de=(o.approvals??[]).map(fo=>fo.approvalId).join(","),pe=o.turns,Oe=pe.at(-1),Qt=Oe?.thinking?.length??0,Wt=Oe?.tools?.reduce((fo,Bn)=>fo+Bn.name.length+(Bn.arg?.length??0)+(Bn.output?.join("").length??0),0)??0;return{length:pe.length,firstId:pe[0]?.id??"",lastId:Oe?.id??"",lastTextLen:Oe?.text.length??0,lastThinkingLen:Qt,lastToolsLen:Wt,approvalIds:de}});Ke(bn,async(de,pe)=>{if(Zn.value&&Ft(pe,de)){ye();return}await ht(),te.value||Te()?tt(de.length<pe.length):ue.value=!0,ye()}),Ke(rt,()=>{Xt()}),Ke(()=>o.mobile,async()=>{await ht(),H()});const Vn=new Map;Ke(()=>o.fileReloadKey,async(de,pe)=>{const Oe=Fe.value;pe&&Oe&&Vn.set(String(pe),{top:Oe.scrollTop,following:te.value}),await ht();const Qt=Fe.value,Wt=de?Vn.get(String(de)):void 0;Wt&&Qt?(te.value=Wt.following,Qt.scrollTop=Wt.top,Y=Wt.top,Wt.following&&Dn()):(te.value=!0,Y=0,tt(!1),Dn()),ye()}),Ke(()=>o.sessionLoading,async(de,pe)=>{de||!pe||(te.value=!0,await ht(),Dn(),ye())}),Ke(()=>o.running,async(de,pe)=>{de||!pe||!te.value&&!Te()||(await ht(),Dn(48),ye())});function ot(){te.value=!0,ue.value=!1,re=Date.now()+YS,ht(()=>{tt(!0),Dn(16)})}function In(de){ot(),s("submit",de)}function _n(de){te.value=!0,ue.value=!1,re=Date.now()+YS,s("editMessage",de)}function Kn(de){const pe=o.queued?.[de]?.text??"";pe&&y(pe),s("editQueued",de)}function $n(de){s("reorderQueue",de)}function Ge(de,pe){ot(),s("answer",de,pe)}function Ye(de,pe){!de||!pe||s("approval",de,pe)}let Ct=null,$t=null,mn=null,Nn=null,tn=0,Ln=!1;const Zn=Z(!1);function Mt(de){if(Zn.value||(Ln=Ln||de,tn))return;tn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Oe=>setTimeout(Oe,16))(()=>{tn=0;const Oe=Ln;Ln=!1,te.value||Te()?tt(!1):Oe&&(ue.value=!0)})}function uo(){if(!$t)return;const de=Fe.value?.firstElementChild??null;de!==mn&&(mn&&$t.unobserve(mn),mn=de,de&&$t.observe(de))}function Xt(){if(!$t)return;const de=rt.value;de!==Nn&&(Nn&&$t.unobserve(Nn),Nn=de,de&&$t.observe(de))}function si(){const de=Fe.value;H(),Ct&&(Ct.disconnect(),de&&Ct.observe(de,{childList:!0,subtree:!0,characterData:!0})),$t&&($t.disconnect(),mn=null,Nn=null,de&&$t.observe(de),uo(),Xt())}function _o(){uo(),Mt(!0)}function Ds(){typeof document>"u"||document.visibilityState==="visible"&&te.value&&Dn()}const ss=Z(!1);let jo=null;function is(){ss.value=!0,jo!==null&&clearTimeout(jo),jo=setTimeout(()=>{ss.value=!1},mee)}function Nt(){is(),s("interrupt")}function Xe(de){de.key==="Escape"&&(o.running||o.sending)&&(de.preventDefault(),Nt())}hn(()=>{ht(()=>{typeof MutationObserver=="function"&&(Ct=new MutationObserver(_o)),typeof ResizeObserver=="function"&&($t=new ResizeObserver(()=>{H(),Mt(!1)})),si(),Dn(48),ye(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ds),document.addEventListener("keydown",Xe))})}),kn(()=>{Ct&&Ct.disconnect(),$t&&$t.disconnect(),tn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(tn),Ie&&Rn(Ie),jo!==null&&clearTimeout(jo),v!==null&&(clearTimeout(v),v=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ds),document.removeEventListener("keydown",Xe))});function st(){(b.value??m.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:st}),(de,pe)=>(w(),N("section",{class:Re(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),ve(HY,{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:pe[0]||(pe[0]=Oe=>s("openChanges")),onCopyAll:pe[1]||(pe[1]=Oe=>f.value?.copyConversation()),onCopyFinalSummary:pe[2]||(pe[2]=Oe=>f.value?.copyFinalSummary()),onOpenPr:pe[3]||(pe[3]=Oe=>e.pr&&s("openPr",e.pr.url)),onRenameSession:pe[4]||(pe[4]=(Oe,Qt)=>s("renameSession",Oe,Qt)),onForkSession:pe[5]||(pe[5]=Oe=>s("forkSession",Oe)),onArchiveSession:pe[6]||(pe[6]=Oe=>s("archiveSession",Oe))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ie("",!0),e.conversationToc?(w(),ve(QJ,{key:1,items:X.value,"active-turn-id":fe.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:Pt},null,8,["items","active-turn-id","mobile","session-loading"])):ie("",!0),T("div",eee,[T("div",{ref:J,class:"panes chat-scroll",onScrollPassive:Ve},[T("div",{class:Re(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),N(Le,{key:0},[pe[54]||(pe[54]=T("div",{class:"empty-spacer"},null,-1)),T("div",tee,[T("span",nee,R(x(h)("composer.emptyConversationTitle")),1),T("span",oee,R(x(h)("composer.emptyConversation")),1),a.value?(w(),N("div",see,[se(Ht,{text:x(h)("conversation.switchWorkspace")},{default:_e(()=>[T("button",{type:"button",class:"ws-pick-btn",onClick:pe[7]||(pe[7]=vt(Oe=>i.value=!i.value,["stop"]))},[se(Je,{name:"folder",size:"sm"}),T("span",iee,R(l.value),1),se(Je,{class:Re(["ws-pick-chev",{open:i.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),i.value?(w(),N("div",{key:0,class:"ws-pick-backdrop",onClick:pe[8]||(pe[8]=Oe=>i.value=!1)})):ie("",!0),i.value?(w(),N("div",ree,[(w(!0),N(Le,null,nt(c.value,Oe=>(w(),N("button",{key:Oe.id,type:"button",class:Re(["ws-pick-item",{on:Oe.id===e.activeWorkspaceId}]),onClick:vt(Qt=>p(Oe.id),["stop"])},[T("span",aee,R(Oe.name),1),T("span",cee,R(Oe.shortPath),1)],10,lee))),128)),u.value>0?(w(),N("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:pe[9]||(pe[9]=vt(Oe=>r.value=!r.value,["stop"]))},[T("span",null,R(x(h)("conversation.moreWorkspaces",{count:u.value})),1)])):ie("",!0),pe[53]||(pe[53]=T("div",{class:"ws-pick-divider"},null,-1)),T("button",{type:"button",class:"ws-pick-action",onClick:pe[10]||(pe[10]=vt(Oe=>{i.value=!1,s("addWorkspace")},["stop"]))},[se(Je,{name:"plus",size:"sm"}),T("span",null,R(x(h)("conversation.addWorkspace")),1)])])):ie("",!0)])):(w(),N("button",{key:1,type:"button",class:"empty-add-workspace",onClick:pe[11]||(pe[11]=Oe=>s("addWorkspace"))},[se(Je,{name:"folder-plus",size:"sm"}),T("span",null,R(x(h)("conversation.addWorkspace")),1)]))]),se(A3,{ref_key:"emptyComposerRef",ref:m,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:In,onSteer:pe[12]||(pe[12]=Oe=>s("steer",Oe)),onCommand:pe[13]||(pe[13]=Oe=>s("command",Oe)),onInterrupt:Nt,onUnqueue:pe[14]||(pe[14]=Oe=>s("unqueue",Oe)),onEditQueued:pe[15]||(pe[15]=Oe=>s("editQueued",Oe)),onSetPermission:pe[16]||(pe[16]=Oe=>s("setPermission",Oe)),onSetThinking:pe[17]||(pe[17]=Oe=>s("setThinking",Oe)),onTogglePlan:pe[18]||(pe[18]=Oe=>s("togglePlan")),onToggleSwarm:pe[19]||(pe[19]=Oe=>s("toggleSwarm")),onToggleGoal:pe[20]||(pe[20]=Oe=>s("toggleGoal")),onOpenBtw:pe[21]||(pe[21]=Oe=>s("command","/btw")),onCreateGoal:pe[22]||(pe[22]=Oe=>s("createGoal",Oe)),onControlGoal:pe[23]||(pe[23]=Oe=>s("controlGoal",Oe)),onFocusGoal:O,onFocusSwarm:$,onCompact:pe[24]||(pe[24]=Oe=>s("compact")),onPickModel:pe[25]||(pe[25]=Oe=>s("pickModel")),onSelectModel:pe[26]||(pe[26]=Oe=>s("selectModel",Oe))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),pe[55]||(pe[55]=T("div",{class:"empty-spacer"},null,-1))],64)):(w(),N(Le,{key:1},[(w(),ve(S3,{ref_key:"chatPaneRef",ref:f,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,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":te.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:pe[27]||(pe[27]=Oe=>s("openFile",Oe)),onOpenMedia:pe[28]||(pe[28]=Oe=>s("openMedia",Oe)),onCopyConversationCopied:A,onOpenThinking:pe[29]||(pe[29]=Oe=>s("openThinking",Oe)),onOpenCompaction:pe[30]||(pe[30]=Oe=>s("openCompaction",Oe)),onOpenAgent:pe[31]||(pe[31]=Oe=>s("openAgent",Oe)),onOpenToolDiff:pe[32]||(pe[32]=Oe=>s("openToolDiff",Oe)),onEditMessage:_n,onLoadOlderMessages:kt,onUnqueue:pe[33]||(pe[33]=Oe=>s("unqueue",Oe)),onEditQueued:Kn,onReorderQueue:$n},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"])),d.value.length>0?(w(),N("div",uee,[(w(!0),N(Le,null,nt(d.value,Oe=>(w(),ve(TQ,{key:Oe.id,group:Oe},null,8,["group"]))),128))])):ie("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ie("",!0):(w(),ve(qJ,{key:0,ref:ce,style:Gt(G.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":g.value,"dock-panel":D.value,"bash-tasks":k.value,"subagent-tasks":E.value,"bash-running":M.value,"subagent-running":L.value,"todo-done-count":I.value,"has-dock-work":P.value,todos:e.todos,"pending-question":Me.value,"question-busy-kind":we.value,"pending-approval":ze.value,"approval-busy":Ue.value,mobile:e.mobile,onToggleDockPanel:pe[34]||(pe[34]=Oe=>z(Oe)),onCloseDockPanel:pe[35]||(pe[35]=Oe=>q()),onOpenAgent:pe[36]||(pe[36]=Oe=>s("openAgent",Oe)),onAnswer:Ge,onDismiss:pe[37]||(pe[37]=Oe=>s("dismiss",Oe)),onApproval:Ye,onCancelTask:pe[38]||(pe[38]=Oe=>s("cancelTask",Oe)),onControlGoal:pe[39]||(pe[39]=Oe=>s("controlGoal",Oe)),onSubmit:In,onSteer:pe[40]||(pe[40]=Oe=>s("steer",Oe)),onCommand:pe[41]||(pe[41]=Oe=>s("command",Oe)),onInterrupt:Nt,onSetPermission:pe[42]||(pe[42]=Oe=>s("setPermission",Oe)),onSetThinking:pe[43]||(pe[43]=Oe=>s("setThinking",Oe)),onTogglePlan:pe[44]||(pe[44]=Oe=>s("togglePlan")),onToggleSwarm:pe[45]||(pe[45]=Oe=>s("toggleSwarm")),onToggleGoal:pe[46]||(pe[46]=Oe=>s("toggleGoal")),onOpenBtw:pe[47]||(pe[47]=Oe=>s("command","/btw")),onCreateGoal:pe[48]||(pe[48]=Oe=>s("createGoal",Oe)),onFocusGoal:O,onFocusSwarm:$,onCompact:pe[49]||(pe[49]=Oe=>s("compact")),onPickModel:pe[50]||(pe[50]=Oe=>s("pickModel")),onSelectModel:pe[51]||(pe[51]=Oe=>s("selectModel",Oe))},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","question-busy-kind","pending-approval","approval-busy","mobile"]))]),se(Gr,{name:"pill"},{default:_e(()=>[ue.value?(w(),N("button",{key:0,class:"newmsg-pill",style:Gt({bottom:`${U.value+12}px`}),"aria-label":x(h)("conversation.jumpToLatestAria"),onClick:pe[52]||(pe[52]=Oe=>tt(!0))},[se(Je,{class:"pill-chevron",name:"chevron-down",size:"md"}),qe(" "+R(x(h)("conversation.newMessages")),1)],12,dee)):ie("",!0)]),_:1}),se(Gr,{name:"abort-toast"},{default:_e(()=>[ss.value?(w(),N("div",fee,[T("span",pee,R(x(h)("conversation.manuallyAborted")),1)])):ie("",!0)]),_:1})],2))}}),vee=ut(gee,[["__scopeId","data-v-b7070e01"]]),yee=["aria-selected","onClick"],kee=je({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),N("div",{class:Re(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),N(Le,null,nt(e.options,i=>(w(),N("button",{key:i.value,class:Re(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},R(i.label),11,yee))),128))],2))}}),Os=ut(kee,[["__scopeId","data-v-d1aaccd7"]]),bee={class:"ui-panel-header__title"},_ee={key:0,class:"ui-panel-header__sub"},wee=je({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(w(),N("div",{class:Re(["ui-panel-header",{wrap:e.wrap}])},[T("span",bee,R(e.title),1),se(Ht,{text:e.subtitle},{default:_e(()=>[e.subtitle?(w(),N("span",_ee,R(e.subtitle),1)):ie("",!0)]),_:1},8,["text"]),Cn(t.$slots,"default",{},void 0,!0),e.closable?(w(),ve(gn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:_e(()=>[se(Je,{name:"close",size:"sm"})]),_:1},8,["label"])):ie("",!0)],2))}}),Gl=ut(wee,[["__scopeId","data-v-c47879ad"]]),See={key:0,class:"fp-empty fp-error"},Cee={key:1,class:"fp-empty"},xee={key:2,class:"fp-loading"},Aee={class:"fp-path"},Tee={class:"fp-meta"},Mee={key:0,class:"fp-lines"},Eee={class:"fp-size"},Iee={key:3,class:"fp-search"},$ee=["placeholder"],Nee={key:0,class:"fp-search-count"},Lee=["href","aria-label"],Oee={key:1,class:"fp-code"},Pee={class:"fp-line-table"},Ree=["data-line"],Dee={class:"fp-gutter"},Bee=["innerHTML"],Fee={key:1,class:"fp-body fp-code"},Hee={class:"fp-line-table"},Wee=["data-line"],zee={class:"fp-gutter"},Uee=["innerHTML"],qee={key:2,class:"fp-body"},jee=["srcdoc","title"],Vee={key:1,class:"fp-code"},Kee={class:"fp-line-table"},Gee=["data-line"],Yee={class:"fp-gutter"},Xee=["innerHTML"],Qee={key:3,class:"fp-body fp-pdf-wrap"},Zee=["src","title"],Jee={key:1,class:"fp-binary-card"},ete={class:"fp-binary-label"},tte={key:4,class:"fp-body fp-table-wrap"},nte={class:"fp-table"},ote=["data-line"],ste={key:5,class:"fp-body fp-image-wrap"},ite=["src","alt"],rte={key:1,class:"fp-binary-card"},lte={class:"fp-binary-icon"},ate={class:"fp-binary-label"},cte={key:6,class:"fp-body fp-code"},ute={class:"fp-line-table"},dte=["data-line"],fte={class:"fp-gutter"},pte=["innerHTML"],hte={key:7,class:"fp-body fp-binary-wrap"},mte={class:"fp-binary-card"},gte={class:"fp-binary-icon"},vte={class:"fp-binary-label"},yte=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}=It();function o(le,U){const G=U?U.split("/").filter(Boolean):[];for(const ne of le.split("/"))ne===""||ne==="."||(ne===".."?G.pop():G.push(ne));return G.join("/")}const s=Ut("resolveImage",async le=>le),i=F(()=>{const le=c.file?.path??"",U=le.lastIndexOf("/");return U>0?le.slice(0,U):""});function r(le){if(/^(https?:|data:|blob:)/i.test(le)||le.startsWith("/"))return le;const U=i.value;return U?o(le,U):le}async function l(le){const U=r(le);return s?s(U):U}En("resolveImage",l);function a(le){let U=le.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(U)||U.startsWith("/"))return le;for(const ne of["#","?"]){const H=U.indexOf(ne);H!==-1&&(U=U.slice(0,H))}const G=i.value;return{...le,path:o(U,G)}}const c=e,u=t;function d(le){c.openFile?.(a(le))}const p=Z(null),h=F(()=>{const le=c.file;if(!le)return"binary";const U=le.mime??"",G=le.languageId??"",ne=le.path.toLowerCase();return U==="text/markdown"||G==="markdown"||G==="md"||ne.endsWith(".mdx")?"markdown":U==="application/json"||G==="json"?"json":U==="text/html"||G==="html"||ne.endsWith(".html")||ne.endsWith(".htm")?"html":U==="application/pdf"||ne.endsWith(".pdf")?"pdf":U==="text/csv"||G==="csv"||ne.endsWith(".csv")?"csv":U.startsWith("image/")?"image":le.isBinary?"binary":U.startsWith("text/")||G!==""?"text":"binary"});function f(le){const U=atob(le),G=Uint8Array.from(U,ne=>ne.charCodeAt(0));return new TextDecoder().decode(G)}const m=F(()=>{const le=c.file;if(!le)return"";if(le.encoding==="base64")try{return f(le.content)}catch{return le.content}return le.content}),b=F(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),_=F(()=>c.file?(h.value==="json"?b.value:m.value).split(`
|
|
260
|
-
`):[]),g=F(()=>c.file?h.value==="json"?b.value:m.value:""),v=Z(""),y=Z(0),A=F(()=>{const le=v.value.trim().toLowerCase();if(!le)return[];const U=[];return _.value.forEach((G,ne)=>{G.toLowerCase().includes(le)&&U.push(ne+1)}),U});Ke(v,()=>{y.value=0});function O(le,U=!1){le&&ht(()=>{const G=p.value?.querySelector(".fp-body"),ne=G?.querySelector(`[data-line="${le}"]`);if(!G||!ne)return;U&&(G.scrollTop=0);const H=G.getBoundingClientRect(),J=ne.getBoundingClientRect(),ce=J.top-H.top+G.scrollTop;G.scrollTop=ce-G.clientHeight/2+J.height/2})}Ke(()=>[c.file?.path,c.line],()=>O(c.line,!0),{immediate:!0});function $(le){const U=A.value;U.length!==0&&(y.value=(y.value+le+U.length)%U.length,O(U[y.value]))}function k(le){const U=A.value;return{target:c.line===le,hit:U.includes(le),active:U[y.value]===le}}function E(le){return le<1024?`${le} B`:le<1024*1024?`${(le/1024).toFixed(1)} KB`:`${(le/(1024*1024)).toFixed(1)} MB`}const M=Z(!1),L=Z(!1);function S(){c.file&&Uo(g.value).then(le=>{le&&(M.value=!0,setTimeout(()=>{M.value=!1},1400))})}function I(){c.file&&Uo(c.file.path).then(le=>{le&&(L.value=!0,setTimeout(()=>{L.value=!1},1400))})}const P=Z("preview"),D=Z("preview"),W=Z("fit");function z(le){P.value=le}function q(le){D.value=le}function Q(le){W.value=le}Ke(h,le=>{P.value=le==="html"?"preview":"source",D.value="preview",W.value="fit"});const X=F(()=>{const le=c.file;return!le||h.value!=="image"?null:le.sourceUrl?le.sourceUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:le.mime==="image/svg+xml"?`data:${le.mime};charset=utf-8,${encodeURIComponent(le.content)}`:null}),fe=F(()=>{const le=c.file;return!le||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:null}),ye=F(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function Me(le){const U=[];let G="",ne=!1;for(let H=0;H<le.length;H++){const J=le[H];J==='"'&&le[H+1]==='"'?(G+='"',H++):J==='"'?ne=!ne:J===","&&!ne?(U.push(G),G=""):G+=J}return U.push(G),U}const we=F(()=>_.value.slice(0,200).map(Me));function ze(le){return le.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function Ue(){const le=c.file;if(!le)return"";const U=le.languageId?.toLowerCase();return U||(le.path.split(".").pop()?.toLowerCase()??"")}function Fe(le){const U=Ue();let G=ze(le);return h.value==="json"||U==="json"||U==="jsonc"?(G=G.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),G=G.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),G=G.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),G=G.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),G):h.value==="html"||U==="html"||U==="xml"||U==="svg"?(G=G.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),G=G.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),G=G.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),G):(G=G.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>'),G=G.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),G=G.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),G)}function rt(le,U=55){return!le||le.length<=U?le:"…"+le.slice(le.length-U+1)}return(le,U)=>(w(),N("div",{ref_key:"rootRef",ref:p,class:"file-preview"},[e.error&&!e.loading?(w(),N("div",See,[T("span",null,R(e.error),1),e.closable?(w(),ve(Rt,{key:0,variant:"secondary",size:"sm",onClick:U[0]||(U[0]=G=>u("close"))},{default:_e(()=>[qe(R(x(n)("filePreview.close")),1)]),_:1})):ie("",!0)])):!e.file&&!e.loading?(w(),N("div",Cee,R(x(n)("filePreview.empty")),1)):e.loading?(w(),N("div",xee,[U[7]||(U[7]=T("span",{class:"spinner"},null,-1)),T("span",null,R(x(n)("filePreview.loading")),1)])):e.file?(w(),N(Le,{key:3},[se(Gl,{wrap:"",title:x(n)("common.preview"),closable:e.closable,"close-label":x(n)("filePreview.close"),onClose:U[6]||(U[6]=G=>u("close"))},{default:_e(()=>[se(Ht,{text:e.file.path},{default:_e(()=>[T("span",Aee,R(rt(e.file.path)),1)]),_:1},8,["text"]),T("span",Tee,[e.file.lineCount?(w(),N("span",Mee,R(x(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ie("",!0),T("span",Eee,R(E(e.file.size)),1)]),h.value==="html"?(w(),ve(Os,{key:0,"model-value":P.value,size:"sm",options:[{value:"preview",label:x(n)("filePreview.preview")},{value:"source",label:x(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):ie("",!0),h.value==="markdown"?(w(),ve(Os,{key:1,"model-value":D.value,size:"sm",options:[{value:"preview",label:x(n)("filePreview.preview")},{value:"source",label:x(n)("filePreview.source")}],"onUpdate:modelValue":q},null,8,["model-value","options"])):ie("",!0),h.value==="image"?(w(),ve(Os,{key:2,"model-value":W.value,size:"sm",options:[{value:"fit",label:x(n)("filePreview.fit")},{value:"actual",label:x(n)("filePreview.actual")}],"onUpdate:modelValue":Q},null,8,["model-value","options"])):ie("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),N("div",Iee,[Mn(T("input",{"onUpdate:modelValue":U[1]||(U[1]=G=>v.value=G),class:"fp-search-input",type:"search",placeholder:x(n)("filePreview.search")},null,8,$ee),[[ks,v.value]]),v.value.trim()?(w(),N("span",Nee,R(A.value.length),1)):ie("",!0),se(gn,{size:"sm",disabled:A.value.length===0,label:x(n)("filePreview.prevMatch"),onClick:U[2]||(U[2]=G=>$(-1))},{default:_e(()=>[se(Je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),se(gn,{size:"sm",disabled:A.value.length===0,label:x(n)("filePreview.nextMatch"),onClick:U[3]||(U[3]=G=>$(1))},{default:_e(()=>[se(Je,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ie("",!0),se(gn,{size:"sm",class:Re({copied:L.value}),label:L.value?x(n)("filePreview.copied"):x(n)("filePreview.copyPath"),onClick:I},{default:_e(()=>[L.value?(w(),ve(Je,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ve(Je,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),ve(gn,{key:4,size:"sm",label:x(n)("filePreview.openInEditor"),onClick:U[4]||(U[4]=G=>u("openExternal"))},{default:_e(()=>[se(Je,{name:"external-link",size:"md"})]),_:1},8,["label"])):ie("",!0),e.externalActions?(w(),ve(gn,{key:5,size:"sm",label:x(n)("filePreview.reveal"),onClick:U[5]||(U[5]=G=>u("reveal"))},{default:_e(()=>[se(Je,{name:"folder",size:"md"})]),_:1},8,["label"])):ie("",!0),e.downloadUrl?(w(),N("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":x(n)("filePreview.download")},[se(Je,{name:"download",size:"md"})],8,Lee)):ie("",!0),!e.file.isBinary&&h.value!=="image"?(w(),ve(gn,{key:7,size:"sm",class:Re({copied:M.value}),label:M.value?x(n)("filePreview.copied"):x(n)("filePreview.copy"),onClick:S},{default:_e(()=>[M.value?(w(),ve(Je,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ve(Je,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ie("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),N("div",{key:0,class:Re(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(w(),ve(Oh,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),N("div",Oee,[T("div",Pee,[(w(!0),N(Le,null,nt(_.value,(G,ne)=>(w(),N("div",{key:ne,class:Re(["fp-line-row",k(ne+1)]),"data-line":ne+1},[T("span",Dee,R(ne+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(G)},null,8,Bee)],10,Ree))),128))])]))],2)):h.value==="json"?(w(),N("div",Fee,[T("div",Hee,[(w(!0),N(Le,null,nt(_.value,(G,ne)=>(w(),N("div",{key:ne,class:Re(["fp-line-row",k(ne+1)]),"data-line":ne+1},[T("span",zee,R(ne+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(G)},null,8,Uee)],10,Wee))),128))])])):h.value==="html"?(w(),N("div",qee,[P.value==="preview"?(w(),N("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ye.value,title:e.file.path},null,8,jee)):(w(),N("div",Vee,[T("div",Kee,[(w(!0),N(Le,null,nt(_.value,(G,ne)=>(w(),N("div",{key:ne,class:Re(["fp-line-row",k(ne+1)]),"data-line":ne+1},[T("span",Yee,R(ne+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(G)},null,8,Xee)],10,Gee))),128))])]))])):h.value==="pdf"?(w(),N("div",Qee,[fe.value?(w(),N("iframe",{key:0,class:"fp-pdf-frame",src:fe.value,title:e.file.path},null,8,Zee)):(w(),N("div",Jee,[T("span",ete,R(x(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),N("div",tte,[T("table",nte,[T("tbody",null,[(w(!0),N(Le,null,nt(we.value,(G,ne)=>(w(),N("tr",{key:ne,class:Re(k(ne+1)),"data-line":ne+1},[T("th",null,R(ne+1),1),(w(!0),N(Le,null,nt(G,(H,J)=>(w(),N("td",{key:J},R(H),1))),128))],10,ote))),128))])])])):h.value==="image"?(w(),N("div",ste,[X.value?(w(),N("img",{key:0,src:X.value,alt:e.file.path,class:Re(["fp-image",{actual:W.value==="actual"}])},null,10,ite)):(w(),N("div",rte,[T("span",lte,[se(Je,{name:"image-off",size:"lg"})]),T("span",ate,R(x(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):h.value==="text"?(w(),N("div",cte,[T("div",ute,[(w(!0),N(Le,null,nt(_.value,(G,ne)=>(w(),N("div",{key:ne,class:Re(["fp-line-row",k(ne+1)]),"data-line":ne+1},[T("span",fte,R(ne+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(G)},null,8,pte)],10,dte))),128))])])):(w(),N("div",hte,[T("div",mte,[T("span",gte,[se(Je,{name:"file-off",size:"lg"})]),T("span",vte,R(x(n)("filePreview.binaryNoPreview",{mime:e.file.mime||x(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):ie("",!0)],512))}}),kte=ut(yte,[["__scopeId","data-v-62bfaf2d"]]),bte={class:"tp"},_te=je({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It(),i=Z(null);return Ke(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ht(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(w(),N("div",bte,[se(Gl,{title:x(s)("common.preview"),subtitle:e.subtitle??x(s)("thinking.panelTitle"),"close-label":x(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),T("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},R(e.text),513)]))}}),XS=ut(_te,[["__scopeId","data-v-6af94b37"]]),wte={class:"ap"},Ste={key:0,class:"ap-type"},Cte={key:1,class:"ap-reason"},xte={key:2,class:"ap-field"},Ate={class:"ap-field-body"},Tte={key:3,class:"ap-field"},Mte={class:"ap-field-body ap-live"},Ete={key:4,class:"ap-field"},Ite={class:"ap-field-body ap-progress"},$te={key:0,class:"ap-call"},Nte={key:1,class:"ap-output"},Lte=["onClick"],Ote={key:5,class:"ap-field"},Pte={class:"ap-field-body"},Rte=8,QS=5,ZS=2,Dte=je({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It(),i=F(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=F(()=>(n.member.text??"").trimEnd());function l(m){const b=[];let _=null,g=0;for(const v of m)v.startsWith("Calling ")?(_={key:`g${g++}`,call:v,output:[]},b.push(_)):_?_.output.push(v):(_={key:`g${g++}`,call:"",output:[v]},b.push(_));return b}const a=F(()=>l(i.value)),c=Z(new Set);function u(m){return c.value.has(m)}function d(m){const b=new Set(c.value);b.has(m)?b.delete(m):b.add(m),c.value=b}function p(m){return m.output.length-QS-ZS}function h(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const f=Z(null);return Ke(()=>i.value.length+r.value.length,()=>{const m=f.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||ht(()=>{f.value&&(f.value.scrollTop=f.value.scrollHeight)})},{immediate:!0}),(m,b)=>(w(),N("div",wte,[se(Gl,{title:x(s)("common.preview"),subtitle:e.member.name,"close-label":x(s)("thinking.close"),onClose:b[0]||(b[0]=_=>o("close"))},{default:_e(()=>[se($o,{variant:"neutral",size:"sm",class:"ap-phase"},{default:_e(()=>[qe(R(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),T("div",{ref_key:"bodyEl",ref:f,class:"ap-body"},[e.member.subagentType?(w(),N("div",Ste,R(e.member.subagentType),1)):ie("",!0),e.member.suspendedReason?(w(),N("div",Cte,R(e.member.suspendedReason),1)):ie("",!0),e.member.prompt?(w(),N("div",xte,[b[1]||(b[1]=T("span",{class:"ap-field-label"},"Task",-1)),T("div",Ate,R(e.member.prompt),1)])):ie("",!0),r.value?(w(),N("div",Tte,[b[2]||(b[2]=T("span",{class:"ap-field-label"},"Output",-1)),T("div",Mte,R(r.value),1)])):ie("",!0),a.value.length>0?(w(),N("div",Ete,[b[4]||(b[4]=T("span",{class:"ap-field-label"},"Progress",-1)),T("div",Ite,[(w(!0),N(Le,null,nt(a.value,_=>(w(),N("div",{key:_.key,class:"ap-group"},[_.call?(w(),N("div",$te,[b[3]||(b[3]=T("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),qe(" "+R(_.call),1)])):ie("",!0),_.output.length>0?(w(),N("div",Nte,[_.output.length<=Rte||u(_.key)?(w(!0),N(Le,{key:0},nt(_.output,(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},R(g),1))),128)):(w(),N(Le,{key:1},[(w(!0),N(Le,null,nt(_.output.slice(0,QS),(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},R(g),1))),128)),T("button",{type:"button",class:"ap-fold",onClick:g=>d(_.key)}," … ("+R(p(_))+" more) ",9,Lte),(w(!0),N(Le,null,nt(_.output.slice(-ZS),(g,v)=>(w(),N("div",{key:"t"+v,class:"ap-out-line"},R(g),1))),128))],64))])):ie("",!0)]))),128))])])):ie("",!0),e.member.summary?(w(),N("div",Ote,[b[5]||(b[5]=T("span",{class:"ap-field-label"},"Result",-1)),T("div",Pte,R(e.member.summary),1)])):ie("",!0)],512)]))}}),Bte=ut(Dte,[["__scopeId","data-v-715bd93e"]]),Fte={class:"diff-lines"},Hte={key:0,class:"hunk-text"},Wte={class:"dl-gutter old"},zte={class:"dl-gutter new"},Ute={class:"dl-sign"},qte={class:"dl-text"},jte=je({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(w(),N("div",Fte,[(w(!0),N(Le,null,nt(e.lines,(r,l)=>(w(),N("div",{key:l,class:Re(["dl",o(r)])},[r.type==="hunk"?(w(),N("span",Hte,R(r.text),1)):(w(),N(Le,{key:1},[T("span",Wte,R(t(r)),1),T("span",zte,R(n(r)),1),T("span",Ute,R(r.type==="add"?"+":r.type==="del"?"-":" "),1),T("span",qte,R(r.text),1)],64))],2))),128))]))}}),M3=ut(jte,[["__scopeId","data-v-2f6bc1cc"]]),Vte={class:"tdp"},Kte={class:"tdp-body"},Gte={key:1,class:"tdp-output"},Yte={key:2,class:"tdp-empty"},Xte=je({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=It();return(s,i)=>(w(),N("div",Vte,[se(Gl,{title:e.target.title,subtitle:e.target.path,"close-label":x(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),T("div",Kte,[e.target.lines&&e.target.lines.length>0?(w(),ve(M3,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),N("div",Gte,[(w(!0),N(Le,null,nt(e.target.output,(r,l)=>(w(),N("div",{key:l},R(r),1))),128))])):(w(),N("div",Yte,R(x(o)("diff.noDiff")),1))])]))}}),Qte=ut(Xte,[["__scopeId","data-v-76f2fbca"]]),Zte={class:"sc"},Jte={key:0,class:"sc-empty"},ene={key:2,class:"sc-loading","aria-hidden":"true"},tne={class:"sc-composer"},nne=["placeholder"],one=["disabled"],sne=je({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It(),i=F(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=F(()=>n.title?.trim()||s("sideChat.title")),l=F(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=Z(""),c=Z(null),u=Z(null);function d(){const _=a.value.trim();_&&(o("send",_),a.value="",ht(()=>{c.value&&(c.value.style.height="auto"),p()}))}function p(){const _=u.value;_&&(_.scrollTop=_.scrollHeight)}const h=F(()=>{const _=n.turns;if(_.length===0)return"0";const g=_.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((A,O)=>A+O.name.length+(O.arg?.length??0)+(O.output?.join("").length??0),0)??0;return`${_.length}:${g.text.length}:${v}:${y}`});Ke(h,async()=>{!n.running&&!n.sending||(await ht(),p())});const f=F(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(_){_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&(_.preventDefault(),d())}function b(){const _=c.value;_&&(_.style.height="auto",_.style.height=`${Math.min(_.scrollHeight,160)}px`)}return(_,g)=>(w(),N("div",Zte,[se(Gl,{title:r.value,subtitle:l.value,"close-label":x(s)("thinking.close"),onClose:g[0]||(g[0]=v=>o("close"))},null,8,["title","subtitle","close-label"]),T("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),N("div",Jte,R(x(s)("sideChat.empty")),1)):(w(),ve(S3,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),f.value?(w(),N("div",ene,[se(w3)])):ie("",!0)],512),T("div",tne,[Mn(T("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:x(s)("sideChat.placeholder"),onInput:b,onKeydown:m},null,40,nne),[[ks,a.value]]),se(Ht,{text:x(s)("sideChat.send")},{default:_e(()=>[T("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[se(Je,{name:"arrow-right",size:"sm"})],8,one)]),_:1},8,["text"])])]))}}),ine=ut(sne,[["__scopeId","data-v-9ee5df02"]]),rne={class:"changes-pane"},lne={class:"dv-path"},ane={class:"diff-head"},cne={class:"back-label"},une={key:0,class:"empty-state"},dne={key:1,class:"dv-lines-wrap"},fne={key:2,class:"empty-state"},pne={class:"dv-change-count"},hne={class:"ch-head"},mne={class:"br-label"},gne={class:"br-name"},vne={key:0,class:"sync-info"},yne={key:0,class:"ahead"},kne={key:0,class:"behind"},bne={key:1,class:"empty-head"},_ne={key:0,class:"ch-list"},wne=["onClick"],Sne={class:"fpath"},Cne={key:1,class:"ch-list ch-tree"},xne={class:"tree-list"},Ane=["onClick"],Tne={class:"tree-name"},Mne=["onClick"],Ene={class:"tree-name"},Ine={key:2,class:"empty-state"},$ne={key:3,class:"empty-state"},Nne=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}=It(),o=e,s=t;function i(L){const S=L.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(L){return r[i(L)]??"?"}function a(L,S=60){return L.length<=S?L:"…"+L.slice(L.length-S+1)}const c=F(()=>o.gitInfo!==null),u=F(()=>o.changes.length>0),d=F(()=>(o.selectedDiffPath??null)!==null),p=F(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=F(()=>o.fileDiff??[]),f=F(()=>o.fileDiffLoading===!0);function m(L){s("open",L)}function b(){s("back")}function _(){s("close")}const g=Z("list");function v(L){g.value=L}function y(L){const S={children:[]},I=[...L].sort((P,D)=>P.path.localeCompare(D.path));for(const P of I){const D=P.path.split("/");let W=S;for(let z=0;z<D.length;z++){const q=D[z],Q=z===D.length-1,X=D.slice(0,z+1).join("/");let fe=W.children.find(ye=>ye.name===q&&ye.kind===(Q?"file":"folder"));fe||(fe={name:q,path:X,kind:Q?"file":"folder",status:Q?P.status:void 0,children:[]},W.children.push(fe)),W=fe}}return S.children}const A=F(()=>y(o.changes)),O=Z(new Set);function $(L){return!O.value.has(L)}const k=F(()=>{const L=[];function S(I,P){for(const D of I)L.push({node:D,depth:P}),D.kind==="folder"&&$(D.path)&&S(D.children,P+1)}return S(A.value,0),L});function E(L){const S=new Set(O.value);S.has(L.path)?S.delete(L.path):S.add(L.path),O.value=S}function M(L){return`${16+L*16}px`}return(L,S)=>(w(),N("div",rne,[p.value?(w(),N(Le,{key:0},[se(Gl,{title:x(n)("diff.title"),closable:e.closable,"close-label":x(n)("diff.close"),onClose:_},{default:_e(()=>[se(Ht,{text:e.selectedDiffPath??""},{default:_e(()=>[T("span",lne,R(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),T("div",ane,[e.hideBack?ie("",!0):(w(),ve(Rt,{key:0,variant:"ghost",size:"sm",onClick:b},{default:_e(()=>[S[0]||(S[0]=T("span",{"aria-hidden":"true"},"←",-1)),T("span",cne,R(x(n)("diff.back")),1)]),_:1}))]),f.value?(w(),N("div",une,R(x(n)("diff.loading")),1)):h.value.length>0?(w(),N("div",dne,[se(M3,{lines:h.value},null,8,["lines"])])):(w(),N("div",fne,R(x(n)("diff.noDiff")),1))],64)):(w(),N(Le,{key:1},[se(Gl,{title:x(n)("diff.title"),closable:e.closable,"close-label":x(n)("diff.close"),onClose:_},{default:_e(()=>[T("span",pne,R(x(n)("diff.changeCount",{count:e.changes.length})),1),se(Os,{"model-value":g.value,size:"sm",options:[{value:"list",label:x(n)("diff.list")},{value:"tree",label:x(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),T("div",hne,[c.value?(w(),N(Le,{key:0},[T("span",mne,R(x(n)("diff.branch")),1),T("span",gne,R(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),N("span",vne,[se(Ht,{text:x(n)("diff.aheadTitle")},{default:_e(()=>[e.gitInfo.ahead>0?(w(),N("span",yne,"↑"+R(e.gitInfo.ahead),1)):ie("",!0)]),_:1},8,["text"]),se(Ht,{text:x(n)("diff.behindTitle")},{default:_e(()=>[e.gitInfo.behind>0?(w(),N("span",kne,"↓"+R(e.gitInfo.behind),1)):ie("",!0)]),_:1},8,["text"])])):ie("",!0)],64)):(w(),N("span",bne,R(x(n)("diff.empty")),1))]),u.value&&g.value==="list"?(w(),N("div",_ne,[(w(!0),N(Le,null,nt(e.changes,I=>(w(),ve(Ht,{key:I.path,text:I.path},{default:_e(()=>[T("button",{type:"button",class:"ch-row",onClick:P=>m(I.path)},[T("span",{class:Re(["badge",i(I.status)])},R(l(I.status)),3),T("span",Sne,R(a(I.path)),1)],8,wne)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(w(),N("div",Cne,[T("ul",xne,[(w(!0),N(Le,null,nt(k.value,({node:I,depth:P})=>(w(),N("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(w(),N("button",{key:0,type:"button",class:"tree-row tree-folder",style:Gt({paddingLeft:M(P)}),onClick:D=>E(I)},[se(Je,{class:"tree-icon",name:"folder-solid",size:"sm"}),T("span",Tne,R(I.name),1)],12,Ane)):(w(),ve(Ht,{key:1,text:I.path},{default:_e(()=>[T("button",{type:"button",class:"tree-row tree-file",style:Gt({paddingLeft:M(P)}),onClick:D=>m(I.path)},[T("span",{class:Re(["badge",i(I.status)])},R(l(I.status)),3),T("span",Ene,R(I.name),1)],12,Mne)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),N("div",Ine,R(x(n)("diff.clean")),1)):(w(),N("div",$ne,R(x(n)("diff.empty")),1))],64))]))}}),Lne=ut(Nne,[["__scopeId","data-v-7778610a"]]);function Sy(e,t){let n=null;hn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ht(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),lo(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const One=["type","value","placeholder","disabled","readonly"],Pne=je({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=Z();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(w(),N("input",{ref_key:"el",ref:s,class:Re(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,One))}}),oc=ut(Pne,[["__scopeId","data-v-340f0da2"]]),Rne={class:"search-wrap"},Dne={key:0,class:"tab-strip"},Bne={key:1,class:"state-row"},Fne={key:2,class:"state-row unavail"},Hne={key:3,class:"model-list"},Wne=["aria-selected","onClick","onMouseenter"],zne={class:"check"},Une={class:"model-main"},qne={class:"model-name"},jne={class:"model-id"},Vne={key:0,class:"caps"},Kne={class:"model-provider"},Gne={class:"model-ctx"},Yne={key:0,class:"empty"},Xne={class:"footer-hint"},Qne=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}=It(),o=e,s=t,i=F(()=>new Set(o.starredIds??[]));function r(v){return i.value.has(v)}const l=Z(""),a=Z(null),c=Z(null),u=Z("all");Sy(c,a);const d=F(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const A of o.models)v.has(A.provider)||(v.add(A.provider),y.push({id:A.provider,label:A.provider}));return y}),p=F(()=>{const v=l.value.toLowerCase().trim(),y=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const O=(A.displayName??A.model).toLowerCase().includes(v),$=A.provider.toLowerCase().includes(v),k=A.id.toLowerCase().includes(v);return!v||O||$||k});return u.value!=="all"?y:y.sort((A,O)=>{const $=r(A.id)?1:0;return(r(O.id)?1:0)-$})}),h=F(()=>p.value),f=Z(0);Ke([l,u],()=>{f.value=0}),Ke(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ke(h,v=>{f.value=Math.min(f.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){s("close");return}if(v.key==="ArrowDown")v.preventDefault(),f.value=Math.min(f.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),f.value=Math.max(f.value-1,0);else if(v.key==="Enter"){const y=h.value[f.value];y&&s("select",y.id)}}hn(()=>{document.addEventListener("keydown",m)}),kn(()=>{document.removeEventListener("keydown",m)});function b(v){s("select",v)}function _(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(w(),ve(ar,{open:!0,"close-on-esc":!1,title:x(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=A=>s("close"))},{default:_e(()=>[T("div",{ref_key:"dialogRef",ref:c,class:"mp"},[T("div",Rne,[se(oc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=A=>l.value=A),placeholder:x(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),N("div",Dne,[(w(!0),N(Le,null,nt(d.value,A=>(w(),ve(Rt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:O=>g(A.id)},{default:_e(()=>[qe(R(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ie("",!0),e.loading?(w(),N("div",Bne,[se(ni,{size:"sm"}),T("span",null,R(x(n)("model.loading")),1)])):e.unavailable?(w(),N("div",Fne,[se(Je,{name:"alert-triangle",size:"lg"}),T("span",null,R(x(n)("model.unavailable")),1)])):(w(),N("div",Hne,[(w(!0),N(Le,null,nt(h.value,A=>(w(),N("div",{key:A.id,class:Re(["model-row",{"is-current":A.id===e.current,"is-selected":_(A)===f.value}]),role:"option","aria-selected":A.id===e.current,onClick:O=>b(A.id),onMouseenter:O=>f.value=_(A)},[T("span",zne,[A.id===e.current?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",Une,[T("span",qne,R(A.displayName??A.model),1),T("span",jne,R(A.id),1),A.capabilities&&A.capabilities.length>0?(w(),N("span",Vne,[(w(!0),N(Le,null,nt(A.capabilities,O=>(w(),ve($o,{key:O,variant:"info",size:"sm"},{default:_e(()=>[qe(R(O),1)]),_:2},1024))),128))])):ie("",!0)]),T("span",Kne,R(A.provider),1),T("span",Gne,R(x(n)("model.contextSuffix",{size:Math.round(A.maxContextSize/1e3)})),1),se(gn,{size:"sm",label:r(A.id)?x(n)("model.unstarTitle"):x(n)("model.starTitle"),onClick:vt(O=>s("toggle-star",A.id),["stop"])},{default:_e(()=>[r(A.id)?(w(),ve(Je,{key:0,name:"star",size:"md"})):(w(),ve(Je,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Wne))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),N("div",Yne,R(o.models.length===0?x(n)("model.emptyNoModels"):x(n)("model.emptyNoMatch")),1)):ie("",!0)])),T("div",Xne,R(x(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Zne=ut(Qne,[["__scopeId","data-v-e93073d7"]]),Jne={key:0,class:"ui-field__label"},eoe={key:1,class:"ui-field__error"},toe={key:2,class:"ui-field__hint"},noe=je({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),N("div",{class:Re(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),N("label",Jne,R(e.label),1)):ie("",!0),Cn(t.$slots,"default",{},void 0,!0),e.error?(w(),N("span",eoe,R(e.error),1)):e.hint?(w(),N("span",toe,R(e.hint),1)):ie("",!0)],2))}}),su=ut(noe,[["__scopeId","data-v-49bce958"]]),ooe=["value","disabled"],soe=je({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(w(),N("select",{class:Re(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[Cn(s.$slots,"default",{},void 0,!0)],42,ooe))}}),E3=ut(soe,[["__scopeId","data-v-92a040fd"]]),ioe={class:"prov-list"},roe={key:0,class:"state-row"},loe={key:1,class:"state-row unavail"},aoe={key:2,class:"empty"},coe={class:"prov-info"},uoe={class:"prov-type"},doe={key:0,class:"prov-url"},foe={class:"prov-meta"},poe={key:0},hoe={class:"prov-actions"},moe={key:0,class:"add-section"},goe={key:0,class:"add-btns"},voe={key:1,class:"add-form"},yoe=["value"],koe={key:0,class:"add-error"},boe={class:"form-btns"},_oe={class:"footer-hint"},woe=je({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=It(),{confirm:o}=sl(),s=Z(null);Sy(s);const i=t;async function r(_){await o({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",_)}const l=Z(!1),a=No({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=Z(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function p(){l.value=!1}function h(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function f(_){if(_.key==="Escape"){if(l.value){p();return}i("close")}}hn(()=>document.addEventListener("keydown",f)),kn(()=>document.removeEventListener("keydown",f));function m(_){return _==="connected"?"var(--color-success)":_==="error"?"var(--color-danger)":"var(--color-text-faint)"}function b(_){return n(_==="connected"?"providers.status.connected":_==="error"?"providers.status.error":"providers.status.unconfigured")}return(_,g)=>(w(),ve(ar,{open:!0,"close-on-esc":!1,title:x(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:_e(()=>[T("div",{ref_key:"dialogRef",ref:s,class:"pm"},[T("div",ioe,[e.loading?(w(),N("div",roe,[se(ni,{size:"sm"}),T("span",null,R(x(n)("providers.loading")),1)])):e.unavailable?(w(),N("div",loe,[se(Je,{name:"alert-triangle",size:"md"}),T("span",null,R(x(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),N("div",aoe,R(x(n)("providers.empty")),1)):(w(!0),N(Le,{key:3},nt(e.providers,v=>(w(),N("div",{key:v.id,class:"prov-row"},[se(Ht,{text:b(v.status)},{default:_e(()=>[T("span",{class:Re(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Gt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),T("div",coe,[T("span",uoe,R(v.type),1),v.baseUrl?(w(),N("span",doe,R(v.baseUrl),1)):ie("",!0),T("span",foe,[se($o,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:_e(()=>[qe(R(v.hasApiKey?x(n)("providers.keySet"):x(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(w(),N("span",poe," · "+R(x(n)("providers.modelCount",{count:v.models.length})),1)):ie("",!0)])]),T("div",hoe,[se(Ht,{text:x(n)("providers.refreshTitle",{type:v.type})},{default:_e(()=>[se(Rt,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:_e(()=>[qe(R(x(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),se(Ht,{text:x(n)("providers.deleteTitle",{type:v.type})},{default:_e(()=>[se(Rt,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:_e(()=>[qe(R(x(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ie("",!0):(w(),N("div",moe,[l.value?(w(),N("div",voe,[se(su,{label:x(n)("providers.fieldType")},{default:_e(()=>[se(E3,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:_e(()=>[(w(),N(Le,null,nt(u,v=>T("option",{key:v,value:v},R(v),9,yoe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),se(su,{label:x(n)("providers.fieldApiKey")},{default:_e(()=>[se(oc,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),se(su,{label:x(n)("providers.fieldBaseUrl")},{default:_e(()=>[se(oc,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:x(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),se(su,{label:x(n)("providers.fieldDefaultModel")},{default:_e(()=>[se(oc,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:x(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(w(),N("div",koe,R(c.value),1)):ie("",!0),T("div",boe,[se(Rt,{variant:"primary",size:"sm",onClick:h},{default:_e(()=>[qe(R(x(n)("providers.add")),1)]),_:1}),se(Rt,{variant:"secondary",size:"sm",onClick:p},{default:_e(()=>[qe(R(x(n)("common.cancel")),1)]),_:1})])])):(w(),N("div",goe,[se(Rt,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:_e(()=>[se(Je,{name:"user",size:"sm"}),qe(" "+R(x(n)("providers.loginKimi")),1)]),_:1}),se(Rt,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:_e(()=>[se(Je,{name:"user",size:"sm"}),qe(" "+R(x(n)("providers.loginAnthropic")),1)]),_:1}),se(Rt,{variant:"primary",size:"sm",onClick:d},{default:_e(()=>[se(Je,{name:"plus",size:"sm"}),qe(" "+R(x(n)("providers.enterApiKey")),1)]),_:1})]))])),T("div",_oe,R(x(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Soe=ut(woe,[["__scopeId","data-v-fb6f1365"]]),Coe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},xoe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Aoe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},dv=je({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),N("svg",Coe,[...n[0]||(n[0]=[T("circle",{cx:"18",cy:"18",r:"15"},null,-1),T("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),N("svg",xoe,[...n[1]||(n[1]=[T("circle",{cx:"14",cy:"14",r:"12"},null,-1),T("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),T("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),N("svg",Aoe,[...n[2]||(n[2]=[T("path",{d:"M14 3 L26 24 H2 Z"},null,-1),T("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),T("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Toe={key:0,class:"center-body"},Moe={class:"center-text"},Eoe={key:1,class:"nb"},Ioe={class:"nb-lead"},$oe=["href"],Noe={class:"nb-or"},Loe={class:"nb-fallback"},Ooe={class:"nb-fb-text"},Poe=["href"],Roe={class:"nb-code-row"},Doe={class:"nb-code"},Boe={class:"nb-status"},Foe={class:"nb-status-text"},Hoe={class:"nb-countdown"},Woe={key:2,class:"center-body"},zoe={class:"center-text success-text"},Uoe={class:"center-hint"},qoe={class:"center-body"},joe={class:"center-text err-text"},Voe={class:"center-hint"},Koe={class:"actions"},Goe={class:"center-body"},Yoe={class:"center-text warn-text"},Xoe={class:"center-hint"},Qoe={class:"actions"},Zoe=je({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=It(),o=Z(!0),s=t,i=e,r=Z("starting"),l=Z(null),a=Z(0),c=Z(!1);let u=null,d=null;hn(async()=>{await p()}),kn(()=>{m()});async function p(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",h(),f(y.interval)}function h(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function f(y){u&&clearTimeout(u),u=setTimeout(async()=>{const A=await i.onPollOAuthLogin();A?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):A?.status==="expired"||A?.status==="cancelled"?(m(),r.value="expired"):f(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function b(){await p()}async function _(){!l.value||!await Uo(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function v(y){const A=Math.floor(y/60),O=y%60;return`${A}:${String(O).padStart(2,"0")}`}return(y,A)=>(w(),ve(ar,{open:o.value,"onUpdate:open":A[0]||(A[0]=O=>o.value=O),title:x(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:_e(()=>[r.value==="starting"?(w(),N("div",Toe,[se(ni,{size:"md"}),T("span",Moe,R(x(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(w(),N("div",Eoe,[T("div",Ioe,R(x(n)("login.lead")),1),T("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[qe(R(x(n)("login.authorizeInBrowser"))+" ",1),se(Je,{name:"external-link",size:"sm"})],8,$oe),T("div",Noe,R(x(n)("login.orDivider")),1),T("div",Loe,[T("div",Ooe,[qe(R(x(n)("login.fallbackPrefix")),1),T("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},R(l.value.verificationUri),9,Poe),qe(R(x(n)("login.fallbackSuffix")),1)]),T("div",Roe,[T("span",Doe,R(l.value.userCode),1),se(Rt,{class:Re(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:_},{default:_e(()=>[c.value?(w(),N(Le,{key:0},[se(Je,{name:"check",size:"sm"}),qe(" "+R(x(n)("login.copied")),1)],64)):(w(),N(Le,{key:1},[se(Je,{name:"copy",size:"sm"}),qe(" "+R(x(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),T("div",Boe,[se(ni,{size:"sm",label:x(n)("login.waitingAuth")},null,8,["label"]),T("span",Foe,R(x(n)("login.waitingAutoClose")),1),T("span",Hoe,R(v(a.value)),1)])])):r.value==="success"?(w(),N("div",Woe,[se(dv,{kind:"success"}),T("span",zoe,R(x(n)("login.success")),1),T("span",Uoe,R(x(n)("login.successHint")),1)])):r.value==="expired"?(w(),N(Le,{key:3},[T("div",qoe,[se(dv,{kind:"expired"}),T("span",joe,R(x(n)("login.expiredTitle")),1),T("span",Voe,R(x(n)("login.expiredHint")),1)]),T("div",Koe,[se(Rt,{variant:"primary",onClick:b},{default:_e(()=>[qe(R(x(n)("login.retry")),1)]),_:1}),se(Rt,{variant:"secondary",onClick:g},{default:_e(()=>[qe(R(x(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),N(Le,{key:4},[T("div",Goe,[se(dv,{kind:"error"}),T("span",Yoe,R(x(n)("login.errorTitle")),1),T("span",Xoe,R(x(n)("login.errorHint")),1)]),T("div",Qoe,[se(Rt,{variant:"primary",onClick:b},{default:_e(()=>[qe(R(x(n)("login.retry")),1)]),_:1}),se(Rt,{variant:"secondary",onClick:g},{default:_e(()=>[qe(R(x(n)("login.closeBtn")),1)]),_:1})])],64)):ie("",!0)]),_:1},8,["open","title"]))}}),Joe=ut(Zoe,[["__scopeId","data-v-b228800e"]]),I3=je({__name:"LanguageSwitcher",setup(e){const{locale:t}=It(),n=TA.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&MA(s)}return(s,i)=>(w(),ve(Os,{"model-value":x(t),options:x(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),ese=["aria-checked","aria-label","disabled"],tse=je({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),N("button",{class:Re(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[T("span",{class:"ui-switch__thumb"},null,-1)])],10,ese))}}),Ar=ut(tse,[["__scopeId","data-v-dbe22dc4"]]),nse=["aria-label"],ose=["aria-selected","onClick"],sse={class:"body"},ise={class:"panel"},rse={class:"sec"},lse={class:"sec-title"},ase={class:"row"},cse={class:"rlabel"},use={class:"row"},dse={class:"rlabel"},fse={class:"row"},pse={class:"rlabel"},hse={class:"num-field"},mse=["value","aria-label"],gse={class:"row"},vse={class:"rlabel"},yse={class:"row"},kse={class:"rlabel"},bse={class:"hint"},_se={class:"sec"},wse={class:"sec-title"},Sse={class:"row"},Cse={class:"rlabel"},xse={key:0,class:"hint"},Ase={class:"row"},Tse={class:"rlabel"},Mse={key:0,class:"hint"},Ese={class:"row"},Ise={class:"rlabel"},$se={class:"panel"},Nse={class:"sec"},Lse={class:"sec-title"},Ose={class:"row"},Pse={class:"rlabel"},Rse={key:0,class:"rvalue"},Dse={class:"actions"},Bse={class:"panel"},Fse={class:"sec"},Hse={class:"sec-head"},Wse={class:"sec-title"},zse={key:0,class:"saving"},Use={class:"row"},qse={class:"rlabel"},jse={class:"hint"},Vse={key:0,class:"select-wrap"},Kse={key:0,value:"",disabled:""},Gse=["label"],Yse=["value"],Xse={key:1,class:"rvalue mono"},Qse={class:"row"},Zse={class:"rlabel"},Jse={class:"hint"},eie={class:"row"},tie={class:"rlabel"},nie={class:"hint"},oie={class:"row"},sie={class:"rlabel"},iie={class:"hint"},rie={class:"row"},lie={class:"rlabel"},aie={class:"hint"},cie={key:1,class:"empty-config"},uie={class:"panel"},die={class:"sec"},fie={class:"sec-title"},pie={class:"row"},hie={class:"rlabel"},mie={class:"rvalue mono"},gie={class:"row"},vie={class:"rlabel"},yie={class:"rvalue mono"},kie={key:0,class:"row"},bie={class:"rlabel"},_ie={class:"hint"},wie={class:"hint"},Sie={class:"row"},Cie={class:"rlabel"},xie={key:0,class:"hint"},Aie=je({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t,i=Z("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"}],l=M5(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=Z(null);Sy(u);function d(M){M.key==="Escape"&&s("close")}hn(()=>document.addEventListener("keydown",d)),kn(()=>document.removeEventListener("keydown",d));function p(){y3()}const h=F(()=>{const M=new Map;for(const L of o.models??[])M.set(L.id,{id:L.id,label:L.displayName??L.model??L.id,provider:L.provider});for(const[L,S]of Object.entries(o.config?.models??{})){if(M.has(L))continue;const I=b(S);M.set(L,{id:L,label:_(L,S,I),provider:I??L})}return Array.from(M.values())}),f=F(()=>{const M=new Map;for(const L of h.value){const S=M.get(L.provider)??[];S.push(L),M.set(L.provider,S)}for(const L of M.values())L.sort((S,I)=>S.label.localeCompare(I.label));return Array.from(M.entries()).toSorted(([L],[S])=>L.localeCompare(S)).map(([L,S])=>({provider:L,options:S}))}),m=F(()=>{const M=o.config?.defaultPermissionMode;return M==="auto"||M==="yolo"||M==="manual"?M:"manual"});function b(M){if(!M||typeof M!="object")return;const L=M;return typeof L.provider=="string"?L.provider:void 0}function _(M,L,S){if(!L||typeof L!="object")return M;const I=L,P=typeof I.model=="string"?I.model:void 0,D=S??b(L);return P&&D?`${M} (${D}/${P})`:P?`${M} (${P})`:M}function g(M){return M===!0}function v(M){!M||M===o.config?.defaultModel||s("updateConfig",{defaultModel:M})}function y(M){M!==m.value&&s("updateConfig",{defaultPermissionMode:M})}function A(M){const L=o.config?.[M];s("updateConfig",{[M]:!g(L)})}function O(){const M=o.config?.thinking;return!M||typeof M!="object"?!0:M.enabled!==!1}function $(){s("updateConfig",{thinking:{enabled:!O()}})}function k(){const M=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!M})}function E(M){i.value=M}return(M,L)=>(w(),ve(ar,{open:!0,"close-on-esc":!1,title:x(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:L[15]||(L[15]=S=>s("close"))},{default:_e(()=>[T("div",{ref_key:"dialogRef",ref:u,class:"sd"},[T("nav",{class:"settings-tabs",role:"tablist","aria-label":x(n)("settings.title")},[(w(),N(Le,null,nt(r,S=>T("button",{key:S.id,type:"button",class:Re(["tab",{on:i.value===S.id}]),role:"tab","aria-selected":i.value===S.id,onClick:I=>E(S.id)},R(x(n)(S.labelKey)),11,ose)),64))],8,nse),T("div",sse,[Mn(T("section",ise,[T("section",rse,[T("h3",lse,R(x(n)("settings.appearance")),1),T("div",ase,[T("span",cse,R(x(n)("theme.colorSchemeLabel")),1),se(Os,{"model-value":e.colorScheme,options:[{value:"light",label:x(n)("theme.light")},{value:"dark",label:x(n)("theme.dark")},{value:"system",label:x(n)("theme.system")}],"onUpdate:modelValue":L[0]||(L[0]=S=>s("setColorScheme",S))},null,8,["model-value","options"])]),T("div",use,[T("span",dse,R(x(n)("theme.accentLabel")),1),se(Os,{"model-value":e.accent,options:[{value:"blue",label:x(n)("theme.accentBlue")},{value:"mono",label:x(n)("theme.accentBlack")}],"onUpdate:modelValue":L[1]||(L[1]=S=>s("setAccent",S))},null,8,["model-value","options"])]),T("div",fse,[T("span",pse,R(x(n)("settings.uiFontSize")),1),T("label",hse,[T("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":x(n)("settings.uiFontSize"),onInput:L[2]||(L[2]=S=>s("setUiFontSize",Number(S.target.value)))},null,40,mse),L[16]||(L[16]=T("span",{class:"num-unit"},"px",-1))])]),T("div",gse,[T("span",vse,R(x(n)("sidebar.language")),1),se(I3)]),T("div",yse,[T("span",kse,[qe(R(x(n)("settings.conversationToc"))+" ",1),T("span",bse,R(x(n)("settings.conversationTocHint")),1)]),se(Ar,{"model-value":e.conversationToc??!0,label:x(n)("settings.conversationToc"),"onUpdate:modelValue":L[3]||(L[3]=S=>s("setConversationToc",S))},null,8,["model-value","label"])])]),T("section",_se,[T("h3",wse,R(x(n)("settings.notifications")),1),T("div",Sse,[T("span",Cse,[qe(R(x(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",xse,R(x(n)("settings.notifyDenied")),1)):ie("",!0)]),se(Ar,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:x(n)("settings.notifyOnComplete"),"onUpdate:modelValue":L[4]||(L[4]=S=>s("setNotify",S))},null,8,["model-value","disabled","label"])]),T("div",Ase,[T("span",Tse,[qe(R(x(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",Mse,R(x(n)("settings.notifyDenied")),1)):ie("",!0)]),se(Ar,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:x(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":L[5]||(L[5]=S=>s("setNotifyQuestion",S))},null,8,["model-value","disabled","label"])]),T("div",Ese,[T("span",Ise,R(x(n)("settings.soundOnComplete")),1),se(Ar,{"model-value":e.sound,label:x(n)("settings.soundOnComplete"),"onUpdate:modelValue":L[6]||(L[6]=S=>s("setSound",S))},null,8,["model-value","label"])])])],512),[[Qs,i.value==="general"]]),Mn(T("section",$se,[T("section",Nse,[T("h3",Lse,R(x(n)("settings.account")),1),T("div",Ose,[T("span",Pse,R(e.authReady?"managed:kimi-code":x(n)("sidebar.notSignedIn")),1),se(Ht,{text:e.accountModel},{default:_e(()=>[e.authReady&&e.accountModel?(w(),N("span",Rse,R(e.accountModel),1)):ie("",!0)]),_:1},8,["text"])]),T("div",Dse,[se(Rt,{variant:"secondary",size:"sm",onClick:L[7]||(L[7]=S=>{s("openOnboarding"),s("close")})},{default:_e(()=>[qe(R(x(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),ve(Rt,{key:0,variant:"danger-soft",size:"sm",onClick:L[8]||(L[8]=S=>s("logout"))},{default:_e(()=>[qe(R(x(n)("sidebar.signOut")),1)]),_:1})):(w(),ve(Rt,{key:1,variant:"primary",size:"sm",onClick:L[9]||(L[9]=S=>s("login"))},{default:_e(()=>[qe(R(x(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[Qs,i.value==="account"]]),Mn(T("section",Bse,[T("section",Fse,[T("div",Hse,[T("h3",Wse,R(x(n)("settings.agentDefaults")),1),e.configSaving?(w(),N("span",zse,R(x(n)("settings.saving")),1)):ie("",!0)]),e.config?(w(),N(Le,{key:0},[T("div",Use,[T("span",qse,[qe(R(x(n)("settings.defaultModel"))+" ",1),T("span",jse,R(x(n)("settings.defaultModelHint")),1)]),f.value.length>0?(w(),N("div",Vse,[se(E3,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":x(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:_e(()=>[e.config.defaultModel?ie("",!0):(w(),N("option",Kse,R(x(n)("settings.noDefaultModel")),1)),(w(!0),N(Le,null,nt(f.value,S=>(w(),N("optgroup",{key:S.provider,label:S.provider},[(w(!0),N(Le,null,nt(S.options,I=>(w(),N("option",{key:I.id,value:I.id},R(I.label),9,Yse))),128))],8,Gse))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),N("span",Xse,R(e.config.defaultModel??x(n)("settings.noDefaultModel")),1))]),T("div",Qse,[T("span",Zse,[qe(R(x(n)("settings.defaultPermission"))+" ",1),T("span",Jse,R(x(n)("settings.defaultPermissionHint")),1)]),se(Os,{"model-value":m.value,options:a.map(S=>({value:S,label:x(n)(c[S])})),"onUpdate:modelValue":L[10]||(L[10]=S=>y(S))},null,8,["model-value","options"])]),T("div",eie,[T("span",tie,[qe(R(x(n)("settings.defaultThinking"))+" ",1),T("span",nie,R(x(n)("settings.defaultThinkingHint")),1)]),se(Ar,{"model-value":O(),disabled:e.configSaving,label:x(n)("settings.defaultThinking"),"onUpdate:modelValue":L[11]||(L[11]=S=>$())},null,8,["model-value","disabled","label"])]),T("div",oie,[T("span",sie,[qe(R(x(n)("settings.defaultPlanMode"))+" ",1),T("span",iie,R(x(n)("settings.defaultPlanModeHint")),1)]),se(Ar,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:x(n)("settings.defaultPlanMode"),"onUpdate:modelValue":L[12]||(L[12]=S=>A("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),T("div",rie,[T("span",lie,[qe(R(x(n)("settings.mergeSkills"))+" ",1),T("span",aie,R(x(n)("settings.mergeSkillsHint")),1)]),se(Ar,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:x(n)("settings.mergeSkills"),"onUpdate:modelValue":L[13]||(L[13]=S=>A("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),N("div",cie,R(x(n)("settings.configUnavailable")),1))])],512),[[Qs,i.value==="agent"]]),Mn(T("section",uie,[T("section",die,[T("h3",fie,R(x(n)("settings.advanced")),1),T("div",pie,[T("span",hie,R(x(n)("sidebar.daemon")),1),T("span",mie,R(x(l)),1)]),T("div",gie,[T("span",vie,R(x(n)("settings.serverVersion")),1),T("span",yie,R(e.serverVersion||"-"),1)]),e.config?(w(),N("div",kie,[T("span",bie,[qe(R(x(n)("settings.telemetry"))+" ",1),T("span",_ie,R(x(n)("settings.telemetryHint")),1),T("span",wie,R(x(n)("settings.telemetryRestartHint")),1)]),se(Ar,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:x(n)("settings.telemetry"),"onUpdate:modelValue":L[14]||(L[14]=S=>k())},null,8,["model-value","disabled","label"])])):ie("",!0),T("div",Sie,[T("span",Cie,[qe(R(x(n)("settings.exportLog"))+" ",1),x(vi)()?ie("",!0):(w(),N("span",xie,R(x(n)("settings.logHint")),1))]),se(Rt,{variant:"secondary",size:"sm",onClick:p},{default:_e(()=>[qe(R(x(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[Qs,i.value==="advanced"]])])],512)]),_:1},8,["title"]))}}),Tie=ut(Aie,[["__scopeId","data-v-b6913864"]]),Mie={class:"aw"},Eie={class:"crumbbar"},Iie={class:"crumbs"},$ie={key:0,class:"crumb-sep"},Nie=["onClick"],Lie={key:0,class:"filterbar"},Oie=["placeholder"],Pie={class:"folder-list"},Rie={key:0,class:"fl-loading"},Die=["onClick"],Bie={class:"folder-name search-rel"},Fie={key:0,class:"git-branch"},Hie={key:0,class:"fl-empty"},Wie={key:1,class:"fl-loading"},zie=["onClick"],Uie={class:"folder-name"},qie={key:0,class:"git-branch"},jie={key:0,class:"fl-empty"},Vie={class:"paste-row"},Kie={class:"paste-input-wrap"},Gie={key:1,class:"add-error",role:"alert"},Yie={class:"actions"},Xie={class:"footer-hint"},Qie=600,Zie=6,JS=150,Jie=je({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t,i=Z(!0),r=Z(!1),l=Z(!1),a=Z(""),c=Z(null),u=Z([]),d=Z(""),p=Z(!1),h=Z([]),f=F(()=>d.value.trim().length>0);let m=0,b=null;function _(I,P){const D=I.toLowerCase(),W=P.toLowerCase();let z=0;for(let q=0;q<W.length&&z<D.length;q++)W[q]===D[z]&&z++;return z===D.length}async function g(I){const P=a.value,D=I.trim();if(!P||D===""){h.value=[],p.value=!1;return}const W=++m;p.value=!0;const z=[],q=[{path:P,depth:0}];let Q=0;for(;q.length>0&&Q<Qie&&z.length<JS;){if(W!==m)return;const X=q.shift();Q++;let fe;try{fe=await o.browseFs(X.path)}catch{continue}if(W!==m)return;for(const ye of fe.entries){if(!ye.isDir)continue;const Me=ye.path.startsWith(P)?ye.path.slice(P.length).replace(/^\/+/,""):ye.path;if(_(D,Me||ye.name)&&(z.push({path:ye.path,name:ye.name,rel:Me||ye.name,isGitRepo:ye.isGitRepo,branch:ye.branch}),z.length>=JS))break;X.depth+1<Zie&&q.push({path:ye.path,depth:X.depth+1})}W===m&&(h.value=[...z])}W===m&&(p.value=!1)}Ke(d,I=>{if(b&&clearTimeout(b),I.trim()===""){m++,h.value=[],p.value=!1;return}b=setTimeout(()=>void g(I),220)});const v=Z(!1),y=Z(""),A=F(()=>y.value.trim()),O=F(()=>{const I=a.value;if(!I)return[];const P=I.split("/").filter(Boolean),D=[{label:"/",path:"/"}];let W="";for(const z of P)W+=`/${z}`,D.push({label:z,path:W});return D}),$=F(()=>a.value.length>0);async function k(I){r.value=!0;try{const P=await o.browseFs(I);if(!P.path){l.value=!0;return}a.value=P.path,c.value=P.parent,u.value=P.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function E(I){I.isDir&&k(I.path)}function M(){c.value&&k(c.value)}function L(){$.value&&s("add",a.value)}function S(){A.value.length!==0&&s("add",A.value)}return hn(async()=>{r.value=!0;try{if(o.defaultPath&&(await k(o.defaultPath),!l.value))return;const I=await o.getFsHome();I.home?await k(I.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),kn(()=>{b&&clearTimeout(b)}),(I,P)=>(w(),ve(ar,{open:i.value,"onUpdate:open":P[5]||(P[5]=D=>i.value=D),title:x(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:P[6]||(P[6]=D=>s("close"))},{default:_e(()=>[T("div",Mie,[l.value?ie("",!0):(w(),N(Le,{key:0},[T("div",Eie,[se(gn,{size:"sm",disabled:!c.value,label:x(n)("workspace.up"),onClick:M},{default:_e(()=>[se(Je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),T("div",Iie,[(w(!0),N(Le,null,nt(O.value,(D,W)=>(w(),N(Le,{key:D.path},[W>1?(w(),N("span",$ie,"/")):ie("",!0),T("button",{class:Re(["crumb",{last:W===O.value.length-1}]),onClick:z=>k(D.path)},R(D.label),11,Nie)],64))),128))])]),r.value?ie("",!0):(w(),N("div",Lie,[se(Je,{class:"filter-icon",name:"search",size:"md"}),Mn(T("input",{"onUpdate:modelValue":P[0]||(P[0]=D=>d.value=D),class:"filter-input",type:"text",placeholder:x(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:P[1]||(P[1]=vt(()=>{},["stop"]))},null,40,Oie),[[ks,d.value]]),p.value?(w(),ve(ni,{key:0,size:"sm"})):ie("",!0)])),T("div",Pie,[r.value?(w(),N("div",Rie,R(x(n)("workspace.browsing")),1)):f.value?(w(),N(Le,{key:1},[(w(!0),N(Le,null,nt(h.value,D=>(w(),N("button",{key:D.path,class:"folder-row",onClick:W=>k(D.path)},[se(Je,{class:"dir-icon",name:"folder-closed",size:"sm"}),T("span",Bie,R(D.rel),1),D.isGitRepo?(w(),ve($o,{key:0,variant:"info",size:"sm"},{default:_e(()=>[qe(R(x(n)("workspace.gitTag")),1),D.branch?(w(),N("span",Fie,R(D.branch),1)):ie("",!0)]),_:2},1024)):ie("",!0)],8,Die))),128)),!p.value&&h.value.length===0?(w(),N("div",Hie,R(x(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):p.value&&h.value.length===0?(w(),N("div",Wie,R(x(n)("workspace.searching")),1)):ie("",!0)],64)):(w(),N(Le,{key:2},[(w(!0),N(Le,null,nt(u.value,D=>(w(),N("button",{key:D.path,class:"folder-row",onClick:W=>E(D)},[se(Je,{class:"dir-icon",name:"folder-closed",size:"sm"}),T("span",Uie,R(D.name),1),D.isGitRepo?(w(),ve($o,{key:0,variant:"info",size:"sm"},{default:_e(()=>[qe(R(x(n)("workspace.gitTag")),1),D.branch?(w(),N("span",qie,R(D.branch),1)):ie("",!0)]),_:2},1024)):ie("",!0)],8,zie))),128)),u.value.length===0?(w(),N("div",jie,R(x(n)("workspace.noSubfolders")),1)):ie("",!0)],64))])],64)),T("div",{class:Re(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(w(),ve(Rt,{key:0,variant:"ghost",size:"sm",onClick:P[2]||(P[2]=D=>v.value=!0)},{default:_e(()=>[qe(R(x(n)("workspace.pasteToggle")),1)]),_:1})):(w(),ve(su,{key:1,label:x(n)("workspace.pathLabel")},{default:_e(()=>[T("div",Vie,[T("div",Kie,[se(oc,{modelValue:y.value,"onUpdate:modelValue":P[3]||(P[3]=D=>y.value=D),placeholder:x(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:di(vt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),se(gn,{disabled:A.value.length===0,label:x(n)("workspace.add"),onClick:S},{default:_e(()=>[se(Je,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(w(),N("div",Gie,R(e.error),1)):ie("",!0),T("div",Yie,[se(Ht,{text:a.value},{default:_e(()=>[l.value?ie("",!0):(w(),ve(Rt,{key:0,variant:"primary",disabled:!$.value,onClick:L},{default:_e(()=>[qe(R(x(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),se(Rt,{variant:"secondary",onClick:P[4]||(P[4]=D=>s("close"))},{default:_e(()=>[qe(R(x(n)("workspace.cancel")),1)]),_:1})]),T("div",Xie,R(x(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),ere=ut(Jie,[["__scopeId","data-v-ad529757"]]),tre={key:0,class:"confirm-dialog__message"},nre=je({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=t,{t:o}=It();function s(){n("update:open",!1),n("cancel")}return(i,r)=>(w(),ve(ar,{open:e.open,title:e.title,height:"auto","onUpdate:open":r[1]||(r[1]=l=>n("update:open",l)),onClose:s},{foot:_e(()=>[se(Rt,{variant:"secondary",disabled:e.loading,onClick:s},{default:_e(()=>[qe(R(e.cancelLabel??x(o)("common.cancel")),1)]),_:1},8,["disabled"]),se(Rt,{variant:e.variant,loading:e.loading,onClick:r[0]||(r[0]=l=>n("confirm"))},{default:_e(()=>[qe(R(e.confirmLabel??x(o)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:_e(()=>[e.message?(w(),N("p",tre,R(e.message),1)):ie("",!0)]),_:1},8,["open","title"]))}}),ore=ut(nre,[["__scopeId","data-v-a9df9b9a"]]),sre=je({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=sl();return(o,s)=>(w(),ve(ore,{open:x(t)!==null,title:x(t)?.title??"",message:x(t)?.message,"confirm-label":x(t)?.confirmLabel,"cancel-label":x(t)?.cancelLabel,variant:x(t)?.variant,onConfirm:s[0]||(s[0]=i=>x(n)(!0)),onCancel:s[1]||(s[1]=i=>x(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),ire={class:"rows"},rre={class:"row"},lre={class:"row"},are={class:"row"},cre={class:"row"},ure={class:"row"},dre={class:"row"},fre={class:"ctx-text"},pre={key:0,class:"bar"},hre={class:"row"},mre=je({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t,i=Z(!0),r=F(()=>o.status.ctxMax>0?Math.round(o.status.ctxUsed/o.status.ctxMax*100):0),l=F(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:o.status.ctxUsed.toLocaleString(),max:o.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(f){return n(f==="yolo"?"status.permissionYolo":f==="auto"?"status.permissionAuto":"status.permissionManual")}const c=F(()=>{const f=o.status.permission;return f==="yolo"?"var(--color-danger)":f==="auto"?"var(--color-warning)":"var(--color-text)"}),u=F(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=F(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),p=F(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=F(()=>p.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(f,m)=>(w(),ve(ar,{open:i.value,"onUpdate:open":m[0]||(m[0]=b=>i.value=b),title:x(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=b=>s("close"))},{default:_e(()=>[T("dl",ire,[T("div",rre,[T("dt",null,R(x(n)("status.statusModel")),1),T("dd",null,R(e.status.model),1)]),T("div",lre,[T("dt",null,R(x(n)("status.statusThinking")),1),T("dd",null,R(e.thinking),1)]),T("div",are,[T("dt",null,R(x(n)("status.statusPermission")),1),T("dd",{style:Gt({color:c.value})},R(a(e.status.permission)),5)]),T("div",cre,[T("dt",null,R(x(n)("status.statusPlanMode")),1),T("dd",{class:Re({"plan-on":e.planMode})},R(u.value),3)]),T("div",ure,[T("dt",null,R(x(n)("status.statusSwarmMode")),1),T("dd",{class:Re({"swarm-on":e.swarmMode})},R(d.value),3)]),T("div",dre,[T("dt",null,R(x(n)("status.statusContext")),1),T("dd",null,[T("span",fre,R(l.value),1),e.status.ctxMax>0?(w(),N("span",pre,[T("i",{style:Gt({width:r.value+"%"})},null,4)])):ie("",!0)])]),T("div",hre,[T("dt",null,R(x(n)("status.statusCost")),1),T("dd",null,R(h.value),1)])])]),_:1},8,["open","title"]))}}),gre=ut(mre,[["__scopeId","data-v-59dd31f3"]]),vre={class:"ui-toast__icon","aria-hidden":"true"},yre={class:"ui-toast__body"},kre={class:"ui-toast__title"},bre={key:0,class:"ui-toast__msg"},_re=je({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),N("div",{class:Re(["ui-toast",`ui-toast--${e.variant}`])},[T("span",vre,[Cn(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),ve(Je,{key:0,name:"check"})):e.variant==="danger"?(w(),ve(Je,{key:1,name:"close"})):e.variant==="warning"?(w(),ve(Je,{key:2,name:"alert-triangle"})):(w(),ve(Je,{key:3,name:"info"}))],!0)]),T("div",yre,[T("div",kre,R(e.title),1),e.message?(w(),N("div",bre,R(e.message),1)):ie("",!0),Cn(t.$slots,"default",{},void 0,!0)]),se(gn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:_e(()=>[se(Je,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),wre=ut(_re,[["__scopeId","data-v-adc6f346"]]),Sre={key:0,class:"actions"},Cre=["onClick"],xre=["onClick"],Are={key:1,class:"details"},Tre=je({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=It();function i(k){return typeof k=="object"&&k!==null}function r(k){return i(k)?k.title:k}function l(k){return i(k)?k.message??"":""}function a(k){return i(k)?k.details:void 0}function c(k){return i(k)?k.severity==="error":k.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(k)}function u(k){return i(k)?`notice:${k.severity}:${k.title}:${k.message??""}:${JSON.stringify(k.details??[])}`:`text:${k}`}function d(k){if(!i(k))return k;const E=[k.title];k.message&&E.push(k.message);const M=k.details??[];if(M.length>0){E.push("",`${s("warnings.diagnostics")}:`);for(const L of M)E.push(`${L.label}: ${L.value}`)}return E.join(`
|
|
261
|
-
`)}let p=1;const h=Z([]),f=new Map,m=new Map;function b(k){const E=c(k)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function _(k,E){const M=f.get(k)??{handle:null,deadline:0,remaining:0};M.handle=setTimeout(()=>$(k),E),M.deadline=Date.now()+E,f.set(k,M)}function g(k){const E=f.get(k);E&&E.handle!==null&&clearTimeout(E.handle),f.delete(k)}function v(k){const E=f.get(k);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function y(k){if(h.value.find(L=>L.id===k)?.detailsOpen)return;const M=f.get(k);!M||M.handle!==null||_(k,M.remaining)}function A(k){k.detailsOpen=!k.detailsOpen,k.detailsOpen?v(k.id):y(k.id)}async function O(k){if(!await Uo(d(k.warning)))return;k.copied=!0;const M=m.get(k.id);M&&clearTimeout(M),m.set(k.id,setTimeout(()=>{k.copied=!1,m.delete(k.id)},1400))}function $(k){g(k);const E=m.get(k);E&&clearTimeout(E),m.delete(k);const M=h.value.findIndex(L=>L.id===k);M!==-1&&(h.value=h.value.filter(L=>L.id!==k),o("dismiss",M))}return Ke(()=>n.warnings,k=>{const E=[...h.value];h.value=k.map(M=>{const L=u(M),S=E.findIndex(D=>D.key===L),I=S===-1?void 0:E.splice(S,1)[0];if(I)return I.warning=M,I;const P={id:p++,key:L,warning:M,detailsOpen:!1,copied:!1};return _(P.id,b(M)),P});for(const M of E){g(M.id);const L=m.get(M.id);L&&clearTimeout(L),m.delete(M.id)}},{immediate:!0,flush:"post"}),kn(()=>{f.forEach(k=>{k.handle!==null&&clearTimeout(k.handle)}),f.clear(),m.forEach(k=>clearTimeout(k)),m.clear()}),(k,E)=>(w(),ve(J$,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:_e(()=>[(w(!0),N(Le,null,nt(h.value,M=>(w(),ve(wre,{key:M.id,variant:c(M.warning)?"danger":"warning",title:r(M.warning),message:l(M.warning),"dismiss-label":x(s)("warnings.dismiss"),onDismiss:L=>$(M.id),onPointerenter:L=>v(M.id),onPointerleave:L=>y(M.id)},{default:_e(()=>[a(M.warning)?.length?(w(),N("div",Sre,[T("button",{class:"link",type:"button",onClick:L=>A(M)},R(M.detailsOpen?x(s)("warnings.hideDetails"):x(s)("warnings.showDetails")),9,Cre),T("button",{class:"link",type:"button",onClick:L=>O(M)},R(M.copied?x(s)("warnings.copied"):x(s)("warnings.copyDetails")),9,xre)])):ie("",!0),M.detailsOpen&&a(M.warning)?.length?(w(),N("dl",Are,[(w(!0),N(Le,null,nt(a(M.warning),L=>(w(),N("div",{key:`${L.label}:${L.value}`,class:"detail-row"},[T("dt",null,R(L.label),1),T("dd",null,R(L.value),1)]))),128))])):ie("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Mre=ut(Tre,[["__scopeId","data-v-92efeff8"]]),Ere={class:"topbar"},Ire={class:"wsq"},$re=["aria-label"],Nre={class:"tb-path"},Lre={class:"ws"},Ore={class:"se"},Pre={class:"tb-sub"},Rre=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}=It(),o=e,s=t,i=F(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=F(()=>o.workspace?.name??n("workspace.noWorkspace")),l=F(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),N("div",Ere,[T("span",Ire,R(i.value),1),T("button",{type:"button",class:"tb-mid","aria-label":x(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[T("span",Nre,[T("span",Lre,R(r.value),1),e.sessionTitle?(w(),N(Le,{key:0},[c[2]||(c[2]=T("span",{class:"sl"},"/",-1)),T("span",Ore,R(e.sessionTitle),1)],64)):ie("",!0),c[3]||(c[3]=T("span",{class:"cv"},"⌄",-1))]),T("span",Pre,[T("span",{class:Re(["rd",{on:e.running}])},null,2),T("span",null,R(l.value),1),e.branch?(w(),N(Le,{key:0},[qe(" · "+R(e.branch),1)],64)):ie("",!0),e.sessionCount>0?(w(),N(Le,{key:1},[qe(" · "+R(x(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ie("",!0)])],8,$re),se(gn,{size:"lg",label:x(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:_e(()=>[se(Je,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Dre=ut(Rre,[["__scopeId","data-v-59a11935"]]),Bre={key:0,class:"sheet-root"},Fre=["aria-label"],Hre=["aria-label"],Wre={key:0,class:"sheet-head"},zre={class:"sheet-title"},Ure={class:"sheet-body"},qre=je({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Ke(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),kn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),ve(Gr,{name:"sheet"},{default:_e(()=>[e.modelValue?(w(),N("div",Bre,[T("div",{class:"sheet-scrim",onClick:i}),T("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||x(n)("mobile.sheetLabel")},[T("button",{type:"button",class:"sheet-grab","aria-label":x(n)("mobile.closeSheet"),onClick:i},null,8,Hre),e.title?(w(),N("div",Wre,[T("span",zre,R(e.title),1)])):ie("",!0),T("div",Ure,[Cn(l.$slots,"default",{},void 0,!0)])],8,Fre)])):ie("",!0)]),_:3}))}}),$3=ut(qre,[["__scopeId","data-v-4441dd70"]]),jre={class:"mlist"},Vre={key:0,class:"mempty"},Kre=["onClick"],Gre={class:"mgh-main"},Yre={class:"mgh-name"},Xre={class:"mgh-path"},Qre={key:2,class:"att"},Zre={key:0,class:"mempty small"},Jre=["onClick"],ele={class:"m"},tle={class:"s"},nle={key:0,class:"att"},ole=["disabled","onClick"],sle=["onClick"],ile=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","loadMore"],setup(e,{emit:t}){const{t:n}=It(),{confirm:o}=sl(),s=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=Z(new Set);function p(S){return d.value.has(S)}function h(S){const I=new Set(d.value);I.has(S)?I.delete(S):I.add(S),d.value=I,y.value=null,k.value=null}const f=Z(new Set);function m(S){return f.value.has(S)}function b(S){const I=new Set(f.value);I.has(S)?I.delete(S):I.add(S),f.value=I}function _(S){if(m(S.workspace.id))return S.sessions;const I=S.sessions.slice(0,S.initialCount);if(s.activeId&&!I.some(P=>P.id===s.activeId)){const P=S.sessions.find(D=>D.id===s.activeId);if(P)return[...I,P]}return I}function g(S){if(!f.value.has(S)){const I=new Set(f.value);I.add(S),f.value=I}i("loadMore",S)}function v(S){return s.attentionByWorkspace[S]??0}const y=Z(null);function A(S){y.value=y.value===S?null:S,k.value=null}function O(S){y.value=null;const P=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();P&&i("rename",S.id,P)}async function $(S){y.value=null,await o({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const k=Z(null);function E(S){k.value=k.value===S?null:S,y.value=null}function M(S){Uo(S.root),k.value=null}async function L(S){k.value=null,await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,I)=>(w(),ve($3,{"model-value":e.modelValue,"onUpdate:modelValue":I[2]||(I[2]=P=>i("update:modelValue",P))},{default:_e(()=>[T("button",{type:"button",class:"newrow",onClick:c},[se(Je,{name:"message",size:"sm"}),qe(" "+R(x(n)("sidebar.newChat")),1)]),T("button",{type:"button",class:"newrow secondary",onClick:u},[se(Je,{name:"folder",size:"sm"}),qe(" "+R(x(n)("sidebar.newWorkspace")),1)]),T("div",jre,[e.groups.length===0?(w(),N("div",Vre,R(x(n)("workspace.noWorkspace")),1)):ie("",!0),(w(!0),N(Le,null,nt(e.groups,P=>(w(),N("div",{key:P.workspace.id,class:"mgroup"},[T("div",{class:Re(["mgh",{on:P.workspace.id===e.activeWorkspaceId}]),onClick:D=>h(P.workspace.id)},[p(P.workspace.id)?(w(),ve(Je,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),ve(Je,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),T("div",Gre,[T("span",Yre,R(P.workspace.name),1),se(Ht,{text:P.workspace.root},{default:_e(()=>[T("span",Xre,R(P.workspace.branch||P.workspace.shortPath),1)]),_:2},1032,["text"])]),p(P.workspace.id)&&v(P.workspace.id)>0?(w(),N("span",Qre,R(v(P.workspace.id)),1)):ie("",!0),se(gn,{size:"lg",class:"mgh-more",label:x(n)("sidebar.options"),onClick:vt(D=>E(P.workspace.id),["stop"])},{default:_e(()=>[se(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),se(gn,{size:"lg",class:"mgh-add",label:x(n)("workspace.newInGroup"),onClick:vt(D=>a(P.workspace.id),["stop"])},{default:_e(()=>[se(Je,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),k.value===P.workspace.id?(w(),ve(Wl,{key:3,class:"kmenu wsmenu",onClick:I[0]||(I[0]=vt(()=>{},["stop"]))},{default:_e(()=>[se(fn,{size:"lg",onClick:D=>M(P.workspace)},{default:_e(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),se(fn,{size:"lg",danger:"",onClick:D=>L(P.workspace)},{default:_e(()=>[qe(R(x(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ie("",!0)],10,Kre),Mn(T("div",null,[P.sessions.length===0?(w(),N("div",Zre,R(x(n)("sidebar.noSessions")),1)):ie("",!0),(w(!0),N(Le,null,nt(_(P),D=>(w(),N("div",{key:D.id,class:Re(["srow",{cur:D.id===e.activeId}]),onClick:W=>l(D.id)},[T("div",ele,[T("div",{class:Re(["t",{run:D.busy,aborted:D.status==="aborted"}])},R(D.title),3),T("div",tle,R(D.time),1)]),(e.attentionBySession[D.id]??0)>0?(w(),N("span",nle,R(e.attentionBySession[D.id]),1)):ie("",!0),se(gn,{size:"lg",class:"kb",label:x(n)("sidebar.options"),onClick:vt(W=>A(D.id),["stop"])},{default:_e(()=>[se(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===D.id?(w(),ve(Wl,{key:1,class:"kmenu",onClick:I[1]||(I[1]=vt(()=>{},["stop"]))},{default:_e(()=>[se(fn,{size:"lg",onClick:W=>O(D)},{default:_e(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),se(fn,{size:"lg",danger:"",onClick:W=>$(D.id)},{default:_e(()=>[qe(R(x(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ie("",!0)],10,Jre))),128)),P.hasMore||P.loadingMore?(w(),N("button",{key:1,type:"button",class:"mshow-more",disabled:P.loadingMore,onClick:vt(D=>g(P.workspace.id),["stop"])},R(P.loadingMore?x(n)("sidebar.loadingMore"):x(n)("sidebar.showMore",{count:Math.max(0,P.workspace.sessionCount-P.sessions.length)})),9,ole)):ie("",!0),P.sessions.length>P.initialCount?(w(),N("button",{key:2,type:"button",class:"mshow-more",onClick:vt(D=>b(P.workspace.id),["stop"])},R(m(P.workspace.id)?x(n)("sidebar.showLess"):x(n)("sidebar.showAll",{count:P.sessions.length-P.initialCount})),9,sle)):ie("",!0)],512),[[Qs,!p(P.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),rle=ut(ile,[["__scopeId","data-v-58db7de1"]]),lle={class:"group-title"},ale={class:"srow-main"},cle={class:"srow-label"},ule={class:"srow-sub"},dle={class:"srow read-only"},fle={class:"srow-main"},ple={class:"srow-label"},hle={key:0,class:"srow-sub"},mle={class:"srow-main"},gle={class:"srow-label"},vle={class:"srow-sub"},yle=["aria-checked"],kle={class:"srow-main"},ble={class:"srow-label"},_le={class:"srow-sub"},wle=["aria-checked"],Sle={class:"srow-main"},Cle={class:"srow-label"},xle={class:"srow read-only"},Ale={class:"srow-main"},Tle={class:"srow-label"},Mle={class:"srow-sub"},Ele=["aria-label"],Ile={class:"group-title"},$le={class:"srow read-only pref"},Nle={class:"srow-main"},Lle={class:"srow-label"},Ole={class:"srow read-only pref"},Ple={class:"srow-main"},Rle={class:"srow-label"},Dle={class:"srow read-only pref"},Ble={class:"srow-main"},Fle={class:"srow-label"},Hle={class:"num-field"},Wle=["value","aria-label"],zle={class:"srow-main"},Ule={class:"srow-label"},qle={class:"srow-sub"},jle=["aria-checked"],Vle={class:"srow-main"},Kle={class:"srow-label"},Gle={class:"srow-main"},Yle={class:"srow-label"},Xle={key:2,class:"srow read-only"},Qle={class:"srow-main"},Zle={class:"srow-label"},Jle={class:"srow-val dim"},eae=je({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=It(),o=e,s=t;function i(E){s("setColorScheme",E)}const r=["manual","auto","yolo"],l=F(()=>{const E=o.status?.modelId??o.status?.model??"";return o.models?.find(M=>M.id===E||M.model===E||M.displayName===o.status?.model)}),a=F(()=>pd(l.value)),c=F(()=>by(l.value)),u=F(()=>fc(l.value,o.thinking??"off")),d=F(()=>{const E=c.value,M=u.value;return E.includes(M)?M:E.includes("on")?"on":E[0]??"off"}),p=F(()=>c.value.map(E=>({value:E,label:F1(E)}))),h=F(()=>o.planMode===!0),f=F(()=>o.swarmMode===!0),m=F(()=>{const E=o.status.permission;return E==="yolo"?"var(--color-danger)":E==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),b=F(()=>{const E=o.status.permission,M=n(E==="yolo"?"mobile.permYoloSub":E==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${E} · ${M}`}),_=E=>`${Math.round(E/1e3)}k`,g=F(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(o.status.ctxUsed/o.status.ctxMax*100))):0),v=F(()=>o.status.ctxMax>0?`${_(o.status.ctxUsed)}/${_(o.status.ctxMax)}`:n("status.statusNone"));function y(E){s("setThinking",_y(l.value,E))}function A(){const E=r.indexOf(o.status.permission),M=r[(E+1)%r.length];s("setPermission",M)}function O(){s("pickModel"),s("update:modelValue",!1)}function $(){s("login"),s("update:modelValue",!1)}function k(){s("logout"),s("update:modelValue",!1)}return(E,M)=>(w(),ve($3,{"model-value":e.modelValue,title:x(n)("mobile.settingsTitle"),"onUpdate:modelValue":M[4]||(M[4]=L=>s("update:modelValue",L))},{default:_e(()=>[T("div",lle,R(x(n)("mobile.groupSession")),1),T("button",{type:"button",class:"srow",onClick:O},[T("span",ale,[T("span",cle,R(x(n)("status.statusModel")),1),T("span",ule,R(e.status.model),1)]),M[5]||(M[5]=T("span",{class:"chev"},"›",-1))]),T("div",dle,[T("span",fle,[T("span",ple,R(x(n)("status.statusThinking")),1),a.value==="unsupported"?(w(),N("span",hle,R(x(n)("status.modeNotSupported")),1)):ie("",!0)]),c.value.length>1?(w(),ve(Os,{key:0,"model-value":d.value,options:p.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(w(),N("span",{key:1,class:Re(["srow-val",{dim:d.value==="off"}])},R(d.value==="off"?x(n)("status.planOff"):x(F1)(d.value)),3))]),T("button",{type:"button",class:"srow",onClick:M[0]||(M[0]=L=>s("togglePlan"))},[T("span",mle,[T("span",gle,R(x(n)("status.statusPlanMode")),1),T("span",vle,R(x(n)("mobile.planModeSub")),1)]),T("span",{class:Re(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,yle)]),T("button",{type:"button",class:"srow",onClick:M[1]||(M[1]=L=>s("toggleSwarm"))},[T("span",kle,[T("span",ble,R(x(n)("status.statusSwarmMode")),1),T("span",_le,R(x(n)("mobile.swarmModeSub")),1)]),T("span",{class:Re(["toggle",{on:f.value}]),role:"switch","aria-checked":f.value},null,10,wle)]),T("button",{type:"button",class:"srow",onClick:A},[T("span",Sle,[T("span",Cle,R(x(n)("status.statusPermission")),1),T("span",{class:"srow-sub",style:Gt({color:m.value})},R(b.value),5)]),M[6]||(M[6]=T("span",{class:"chev"},"›",-1))]),T("div",xle,[T("span",Ale,[T("span",Tle,R(x(n)("status.statusContext")),1),T("span",Mle,R(v.value),1)]),T("span",{class:"ctx-meter","aria-label":v.value},[T("i",{style:Gt({width:g.value+"%"})},null,4)],8,Ele)]),T("div",Ile,R(x(n)("mobile.groupApp")),1),T("div",$le,[T("span",Nle,[T("span",Lle,R(x(n)("theme.colorSchemeLabel")),1)]),se(Os,{"model-value":e.colorScheme??"system",options:[{value:"light",label:x(n)("theme.light")},{value:"dark",label:x(n)("theme.dark")},{value:"system",label:x(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),T("div",Ole,[T("span",Ple,[T("span",Rle,R(x(n)("sidebar.language")),1)]),se(I3)]),T("div",Dle,[T("span",Ble,[T("span",Fle,R(x(n)("settings.uiFontSize")),1)]),T("label",Hle,[T("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":x(n)("settings.uiFontSize"),onInput:M[2]||(M[2]=L=>s("setUiFontSize",Number(L.target.value)))},null,40,Wle),M[7]||(M[7]=T("span",{class:"num-unit"},"px",-1))])]),T("button",{type:"button",class:"srow",onClick:M[3]||(M[3]=L=>s("setConversationToc",!e.conversationToc))},[T("span",zle,[T("span",Ule,R(x(n)("settings.conversationToc")),1),T("span",qle,R(x(n)("settings.conversationTocHint")),1)]),T("span",{class:Re(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,jle)]),e.authReady?(w(),N("button",{key:0,type:"button",class:"srow acct out",onClick:k},[T("span",Vle,[T("span",Kle,R(x(n)("sidebar.signOut")),1)])])):(w(),N("button",{key:1,type:"button",class:"srow acct in",onClick:$},[T("span",Gle,[T("span",Yle,R(x(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),N("div",Xle,[T("span",Qle,[T("span",Zle,R(x(n)("settings.serverVersion")),1)]),T("span",Jle,R(e.serverVersion),1)])):ie("",!0)]),_:1},8,["model-value","title"]))}}),tae=ut(eae,[["__scopeId","data-v-99d977c3"]]),N3=["blue","mono"],L3=["light","dark","system"],O3=14,nae=12,oae=20;function sae(){const e=Qn(Et.accent);return e&&N3.includes(e)?e:"blue"}function iae(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function rae(){const e=Qn(Et.colorScheme);return e&&L3.includes(e)?e:"system"}function lae(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function Cy(e){return Number.isFinite(e)?Math.min(oae,Math.max(nae,Math.round(e))):O3}function aae(){const e=Qn(Et.uiFontSize);return e===null?O3:Cy(Number(e))}function cae(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${Cy(e)}px`)}const xy=Z(rae()),Ay=Z(sae()),Ty=Z(aae());Ke(xy,lae,{immediate:!0});Ke(Ay,iae,{immediate:!0});Ke(Ty,cae,{immediate:!0});function uae(e){L3.includes(e)&&(xy.value=e,to(Et.colorScheme,e))}function dae(e){N3.includes(e)&&(Ay.value=e,to(Et.accent,e))}function fae(e){const t=Cy(e);Ty.value=t,to(Et.uiFontSize,String(t))}const pae=600,hae=250,Ph=250,mae=1e3,gae=160,Hp=Z(!1);let Ll=[],Dl=null,Wp=-Ph;function vae(){Ll=[],Wp=-Ph,Hp.value=!1,Dl!==null&&(clearTimeout(Dl),Dl=null)}function yae(){Hp.value=!0,Dl!==null&&clearTimeout(Dl),Dl=setTimeout(()=>{Dl=null,Ll=[],Wp=-Ph,Hp.value=!1},mae)}function kae(e){if(e<=0)return;const t=Date.now();Ll.push({time:t,chars:e});const n=t-pae;if(Ll=Ll.filter(l=>l.time>=n),t-Wp<Ph)return;Wp=t;const o=Ll[0]?.time??t,s=Math.max(t-o,hae);Ll.reduce((l,a)=>l+a.chars,0)/s*1e3>=gae&&yae()}function P3(){return{colorScheme:xy,accent:Ay,uiFontSize:Ty,fastMoon:Hp,setColorScheme:uae,setAccent:dae,setUiFontSize:fae,resetFastMoon:vae,recordMoonDelta:kae}}const bae={class:"ob-brand"},_ae={class:"ob-brand-text"},wae={class:"ob-title"},Sae={class:"ob-sub"},Cae={class:"ob-sec"},xae={class:"ob-label"},Aae={class:"ob-sec"},Tae={class:"ob-label"},Mae={class:"ob-sec"},Eae={class:"ob-label"},Iae=je({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=It(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=P3();function c(d){s.value!==d&&MA(d)}function u(){n("complete")}return(d,p)=>(w(),ve(ar,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:p[3]||(p[3]=h=>n("skip"))},{head:_e(()=>[T("div",bae,[p[4]||(p[4]=T("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[T("defs",null,[T("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[T("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),T("g",{class:"ob-eyes",fill:"#000"},[T("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),T("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),T("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),T("div",_ae,[T("div",wae,R(x(o)("onboarding.title")),1),T("div",Sae,R(x(o)("onboarding.subtitle")),1)])])]),default:_e(()=>[T("section",Cae,[T("div",xae,R(x(o)("onboarding.languageLabel")),1),se(Os,{"model-value":x(s),options:x(TA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":p[0]||(p[0]=h=>c(h))},null,8,["model-value","options"])]),T("section",Aae,[T("div",Tae,R(x(o)("theme.colorSchemeLabel")),1),se(Os,{"model-value":x(i),options:[{value:"light",label:x(o)("theme.light")},{value:"dark",label:x(o)("theme.dark")},{value:"system",label:x(o)("theme.system")}],"onUpdate:modelValue":p[1]||(p[1]=h=>x(l)(h))},null,8,["model-value","options"])]),T("section",Mae,[T("div",Eae,R(x(o)("theme.accentLabel")),1),se(Os,{"model-value":x(r),options:[{value:"blue",label:x(o)("theme.accentBlue")},{value:"mono",label:x(o)("theme.accentBlack")}],"onUpdate:modelValue":p[2]||(p[2]=h=>x(a)(h))},null,8,["model-value","options"])]),se(Rt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:_e(()=>[qe(R(x(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),$ae=ut(Iae,[["__scopeId","data-v-fbdd3eab"]]),Nae=["aria-label"],Lae={class:"gload-box"},Oae={class:"gload-text"},Pae=je({__name:"GlobalLoading",setup(e){const{t}=It();return(n,o)=>(w(),N("div",{class:"gload",role:"status","aria-label":x(t)("app.connecting")},[T("div",Lae,[o[0]||(o[0]=c0('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-8d6a5c44><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-8d6a5c44></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-8d6a5c44></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-8d6a5c44></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-8d6a5c44></path></svg>',1)),se(ni,{size:"md",label:x(t)("app.connecting")},null,8,["label"]),T("div",Oae,R(x(t)("app.connecting")),1)])],8,Nae))}}),Rae=ut(Pae,[["__scopeId","data-v-8d6a5c44"]]),Dae={class:"kap-root"},Bae={class:"kap-head"},Fae={class:"kap-count"},Hae={class:"kap-head-actions"},Wae={class:"kap-filters"},zae=["value"],Uae={class:"kap-check"},qae={class:"kap-check"},jae={class:"kap-view-toggle",role:"group"},Vae={key:0,class:"kap-empty"},Kae=["onClick"],Gae={class:"kap-ts"},Yae={class:"kap-label"},Xae={key:0,class:"kap-detail"},Qae={class:"kap-detail-actions"},Zae=["onClick"],Jae={key:1,class:"kap-agg"},ece={class:"mono"},tce={class:"mono"},nce={class:"num"},oce={class:"num"},sce={key:0},ice={class:"mono"},rce={class:"num"},lce={class:"num"},ace={key:0},cce=je({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=Z("all"),s=Z(""),i=Z(""),r=Z(!1),l=Z("timeline"),a=F(()=>(vy.value,[...lG()])),c=F(()=>{const E=new Set;for(const M of a.value)M.sessionId&&E.add(M.sessionId);return[...E].sort()});function u(E){return E.kind==="rest:error"||E.code!==void 0&&E.code!==0||E.eventType==="error"||E.eventType==="parse-error"}const d=F(()=>{const E=s.value.trim().toLowerCase();return a.value.filter(M=>!(o.value!=="all"&&M.source!==o.value||i.value&&M.sessionId!==i.value||r.value&&!u(M)||E&&!`${M.label} ${M.kind} ${M.eventType??""} ${M.sessionId??""} ${M.requestId??""}`.toLowerCase().includes(E)))}),p=F(()=>{const E=new Map;for(const M of d.value){if(M.kind!=="ws:in"&&M.kind!=="ws:out")continue;const L=M.kind==="ws:in"?"←":"→",S=`${L} ${M.eventType??"?"} @ ${M.sessionId??"-"}`,I=E.get(S)??{key:S,sessionId:M.sessionId??"-",eventType:M.eventType??"?",dir:L,count:0};I.count++,M.seq!==void 0&&(I.lastSeq=M.seq),E.set(S,I)}return[...E.values()].sort((M,L)=>L.count-M.count)}),h=F(()=>{const E=new Map;for(const M of d.value){if(M.source!=="rest"||M.kind==="rest:request")continue;const L=`${M.method??"?"} ${M.path??"?"}`,S=E.get(L)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(M)&&S.errors++,M.durationMs!==void 0&&(S.totalMs+=M.durationMs,S.timed++),E.set(L,S)}return[...E.entries()].map(([M,L])=>({key:M,count:L.count,errors:L.errors,avgMs:L.timed>0?Math.round(L.totalMs/L.timed):0})).sort((M,L)=>L.count-M.count)}),f=Z(null),m=Z(!0),b=Z(null),_=Z(null);Ke(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await ht();const E=b.value;E&&(E.scrollTop=E.scrollHeight)});function g(E){f.value=f.value===E?null:E}function v(E){const M=new Date(E),L=(S,I=2)=>String(S).padStart(I,"0");return`${L(M.getHours())}:${L(M.getMinutes())}:${L(M.getSeconds())}.${L(M.getMilliseconds(),3)}`}function y(E){return JSON.stringify(E,null,2)}async function A(E){await Uo(y(E))&&(_.value=E.id,setTimeout(()=>{_.value===E.id&&(_.value=null)},1500))}function O(){y3(d.value)}function $(E){return u(E)||E.source==="client"?"b-err":E.source==="rest"?"b-rest":E.kind==="ws:lifecycle"?"b-life":E.kind==="ws:out"?"b-out":"b-in"}function k(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,M)=>(w(),N("section",Dae,[T("header",Bae,[M[11]||(M[11]=T("strong",null,"KAP debug",-1)),T("span",Fae,R(d.value.length)+"/"+R(a.value.length),1),T("div",Hae,[T("button",{type:"button",class:Re({on:x(ou)}),onClick:M[0]||(M[0]=L=>ou.value=!x(ou))},R(x(ou)?"resume":"pause"),3),T("button",{type:"button",onClick:M[1]||(M[1]=L=>x(aG)())},"clear"),T("button",{type:"button",onClick:M[2]||(M[2]=L=>O())},"export jsonl"),se(Ht,{text:"Close window"},{default:_e(()=>[T("button",{type:"button",onClick:M[3]||(M[3]=L=>n("close"))},"✕")]),_:1})])]),T("div",Wae,[Mn(T("select",{"onUpdate:modelValue":M[4]||(M[4]=L=>o.value=L),"aria-label":"Source filter"},[...M[12]||(M[12]=[T("option",{value:"all"},"rest + ws + app",-1),T("option",{value:"rest"},"rest",-1),T("option",{value:"ws"},"ws",-1),T("option",{value:"client"},"app errors",-1)])],512),[[Rv,o.value]]),Mn(T("select",{"onUpdate:modelValue":M[5]||(M[5]=L=>i.value=L),"aria-label":"Session filter"},[M[13]||(M[13]=T("option",{value:""},"all sessions",-1)),(w(!0),N(Le,null,nt(c.value,L=>(w(),N("option",{key:L,value:L},R(L),9,zae))),128))],512),[[Rv,i.value]]),Mn(T("input",{"onUpdate:modelValue":M[6]||(M[6]=L=>s.value=L),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ks,s.value]]),T("label",Uae,[Mn(T("input",{"onUpdate:modelValue":M[7]||(M[7]=L=>r.value=L),type:"checkbox"},null,512),[[lp,r.value]]),M[14]||(M[14]=qe(" errors",-1))]),T("label",qae,[Mn(T("input",{"onUpdate:modelValue":M[8]||(M[8]=L=>m.value=L),type:"checkbox"},null,512),[[lp,m.value]]),M[15]||(M[15]=qe(" follow",-1))]),T("div",jae,[T("button",{type:"button",class:Re({on:l.value==="timeline"}),onClick:M[9]||(M[9]=L=>l.value="timeline")},"timeline",2),T("button",{type:"button",class:Re({on:l.value==="aggregate"}),onClick:M[10]||(M[10]=L=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),N("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(w(),N("div",Vae," No trace entries yet. REST calls and WS frames will appear here. ")):ie("",!0),(w(!0),N(Le,null,nt(d.value,L=>(w(),N("div",{key:L.id,class:"kap-row-wrap"},[T("button",{type:"button",class:Re(["kap-row",{expanded:f.value===L.id}]),onClick:S=>g(L.id)},[T("span",Gae,R(v(L.ts)),1),T("span",{class:Re(["kap-badge",$(L)])},R(k(L)),3),T("span",Yae,R(L.label),1)],10,Kae),f.value===L.id?(w(),N("div",Xae,[T("div",Qae,[T("button",{type:"button",onClick:S=>A(L)},R(_.value===L.id?"copied ✓":"copy json"),9,Zae)]),T("pre",null,R(y(L)),1)])):ie("",!0)]))),128))],512)):(w(),N("div",Jae,[M[20]||(M[20]=T("h4",null,"WS frames by session / type",-1)),T("table",null,[M[17]||(M[17]=T("thead",null,[T("tr",null,[T("th",null,"dir"),T("th",null,"type"),T("th",null,"session"),T("th",null,"count"),T("th",null,"last seq")])],-1)),T("tbody",null,[(w(!0),N(Le,null,nt(p.value,L=>(w(),N("tr",{key:L.key},[T("td",null,R(L.dir),1),T("td",ece,R(L.eventType),1),T("td",tce,R(L.sessionId),1),T("td",nce,R(L.count),1),T("td",oce,R(L.lastSeq??"—"),1)]))),128)),p.value.length===0?(w(),N("tr",sce,[...M[16]||(M[16]=[T("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ie("",!0)])]),M[21]||(M[21]=T("h4",null,"REST by endpoint",-1)),T("table",null,[M[19]||(M[19]=T("thead",null,[T("tr",null,[T("th",null,"endpoint"),T("th",null,"count"),T("th",null,"errors"),T("th",null,"avg ms")])],-1)),T("tbody",null,[(w(!0),N(Le,null,nt(h.value,L=>(w(),N("tr",{key:L.key},[T("td",ice,R(L.key),1),T("td",rce,R(L.count),1),T("td",{class:Re(["num",{err:L.errors>0}])},R(L.errors),3),T("td",lce,R(L.avgMs),1)]))),128)),h.value.length===0?(w(),N("tr",ace,[...M[18]||(M[18]=[T("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ie("",!0)])])]))]))}}),uce=ut(cce,[["__scopeId","data-v-3cda6fe3"]]),dce=je({__name:"DebugPanel",setup(e){const t=Z(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,p=u.documentElement;for(const h of i){const f=d.getAttribute(h);f!==null?p.setAttribute(h,f):p.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const p=d.createElement("base");p.href=location.href,d.head.appendChild(p);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 h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),p=ap(uce,{onClose:()=>u.close()});p.mount(d),o=p,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return hn(()=>{c()}),lo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),ve(Ht,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:_e(()=>[T("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),fce=ut(dce,[["__scopeId","data-v-21346738"]]);function pce(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function hce(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function mce(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,activeRoot:s,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(o),a=new Map;for(const h of t)l.has(h.root)||a.has(h.root)||a.set(h.root,{...h});for(const h of n){const f=h.cwd;f&&(l.has(f)||a.has(f)||a.set(f,{id:h.workspaceId??f,root:f,name:pce(f),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const f=hce(t,h);c.set(f,(c.get(f)??0)+1)}const u=[...new Set(t.filter(h=>!l.has(h.root)).map(h=>h.root))],d=[...a.keys()].filter(h=>!u.includes(h));d.sort((h,f)=>h.localeCompare(f));const p=[];for(const h of[...u,...d]){const f=a.get(h),m=c.get(f.id)??c.get(f.root)??0,b=r[f.id]===!1?m:Math.max(f.sessionCount,m);let _=f.branch;!_&&i&&s===f.root&&(_=i),p.push({...f,sessionCount:b,branch:_})}return p}function gce(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const vce=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function yce(e){return vce.has(e.type)}function kce(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function bce(e,t,n=kce){let o=[],s=null;const i=()=>{if(s=null,o.length===0)return;const l=o;o=[];for(const a of l)e(a)},r=(l=>{if(t(l)){o.push(l),s===null&&(s=n(i));return}i(),e(l)});return r.flush=i,r}function R3(e,t){const n=Qn(e);return n===null?t:n==="1"}const My=Z(R3(Et.notifyOnComplete,!0)),Ey=Z(R3(Et.notifyOnQuestion,!1)),Iy=Z(typeof Notification<"u"?Notification.permission:"denied");async function D3(e,t,n){if(!n){e.value=!1,to(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}Iy.value=o,o==="granted"&&(e.value=!0,to(t,"1"))}function _ce(e){return D3(My,Et.notifyOnComplete,e)}function wce(e){return D3(Ey,Et.notifyOnQuestion,e)}function B3(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{Iy.value=i,i==="granted"&&eC(t,n,o)});return}eC(t,n,o)}}function eC(e,t,n){if(e.isActiveAndVisible)return;const o=e.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(o,{body:t,tag:n});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function Sce(e,t){B3(My.value,t,Un.global.t("settings.notifyBody"),`kimi-complete-${e}`)}function Cce(e,t){const n=t.questionPreview||Un.global.t("settings.notifyQuestionBody");B3(Ey.value,t,n,`kimi-question-${e}`)}function xce(){return{notifyOnComplete:My,notifyOnQuestion:Ey,notifyPermission:Iy,setNotifyOnComplete:_ce,setNotifyOnQuestion:wce,maybeNotifyCompletion:Sce,maybeNotifyQuestion:Cce}}function Ace(){return Qn(Et.soundOnComplete)==="1"}const hd=Z(Ace());function Tce(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let fv=null;function F3(){const e=Tce();if(!e)return null;if(fv===null)try{fv=new e}catch{return null}return fv}function H3(){if(!hd.value)return;const e=F3();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Or("sound: audio context resumed",{state:e.state})},t=>{Or("sound: audio context resume rejected",{error:String(t)})})}let tC=!1;function Mce(){if(tC||typeof window>"u")return;tC=!0;const e=()=>{H3()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Mce();function Ece(e){hd.value=e,to(Et.soundOnComplete,e?"1":"0"),e&&H3()}function nC(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function W3(){const e=F3();if(e===null){Or("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Or("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Or("sound: context resumed for next time",{state:e.state})},t=>{Or("sound: resume rejected",{error:String(t)})});return}try{nC(e,880,0,.16,.18),nC(e,1320,.1,.22,.16),Or("sound: chime scheduled",{state:e.state})}catch(t){Or("sound: failed to play",{error:String(t)})}}function Ice(){hd.value&&W3()}function $ce(){hd.value&&W3()}function Nce(){return{soundOnComplete:hd,setSoundOnComplete:Ece,maybePlayCompletionSound:Ice,maybePlayQuestionSound:$ce}}function oC(e,t){const n=new Set(e.map(s=>s.id)),o=t.filter(s=>s.kind==="subagent"&&!n.has(s.id));return o.length===0?e:[...e,...o]}const Lce=1e3,Oce=4096,sC=32*1024;function Pce(e,t){let n=null,o;const s=new Set;async function i(p){try{const f=await dt().listTasks(p);e.tasksBySession={...e.tasksBySession,[p]:oC(f,e.tasksBySession[p]??[])},await r(p,f)}catch{}}async function r(p,h){if(e.activeSessionId!==p)return;const f=h??e.tasksBySession[p]??[],m=dt(),b=new Map;if(await Promise.all(f.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!s.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(p,g.id,{withOutput:!0,outputBytes:sC});y.outputPreview!==void 0&&b.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{s.add(g.id)}})),b.size===0)return;const _=e.tasksBySession[p]??[];e.tasksBySession={...e.tasksBySession,[p]:_.map(g=>{const v=b.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(p){if(e.activeSessionId!==p)return;const h=dt();let f;try{f=await h.listTasks(p)}catch{return}const m=new Map;await Promise.all(f.map(async v=>{const y=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!A)&&!(A&&(s.has(v.id)||(v.outputLines?.length??0)>0)))try{const O=await h.getTask(p,v.id,{withOutput:!0,outputBytes:y?Oce:sC});O.outputPreview!==void 0&&m.set(v.id,{preview:O.outputPreview,bytes:O.outputBytes})}catch{}finally{A&&s.add(v.id)}}));const b=e.tasksBySession[p]??[],_=new Map(b.map(v=>[v.id,v])),g=f.map(v=>{const y=_.get(v.id),A=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:A?.preview??y?.outputPreview,outputBytes:A?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[p]:oC(g,b)}}function a(p){n!==null&&o===p||(c(),o=p,l(p),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===p?l(p):c())},Lce))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=Z(0);let d=null;return Ke(()=>t.value.some(p=>p.status==="running"),p=>{p&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!p&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ke(()=>{const p=e.activeSessionId;if(!p)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[p]??[];return{sid:p,hasRunning:h.some(f=>f.status==="running")}},({sid:p,hasRunning:h},f,m)=>{let b;h&&p!==void 0?a(p):p!==void 0?b=setTimeout(()=>{(e.tasksBySession[p]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:F(()=>u.value),loadTasksForSession:i}}const z3=Et.starredModels;function Rce(){try{const e=Qn(z3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Dce(e){try{to(z3,JSON.stringify(e))}catch{}}function Bce(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Z([]),d=Z(Rce()),p=Z({}),h=Z([]),f=Z(null);function m(z){if(!(z==null||z.length===0))return u.value.find(q=>q.id===z||q.model===z)}function b(){const z=e.activeSessionId?e.sessions.find(q=>q.id===e.activeSessionId):void 0;return m(z?.model??f.value??e.defaultModel)}function _(z){const q=fc(b(),z);return e.thinking=q,l(q),q}async function g(z){try{const Q=await dt().listSkills(z);p.value={...p.value,[z]:Q}}catch{}}async function v(){try{const z=dt();u.value=await z.listModels(),_(e.thinking)}catch(z){n("loadModels",z)}}async function y(){try{const z=await dt().refreshOAuthProviderModels();for(const q of z.failed)n("refreshOAuthProviderModels",new Error(q.reason),{message:q.provider})}catch{}}async function A(){try{const z=dt();h.value=await z.listProviders()}catch(z){n("loadProviders",z)}}async function O(z){const q=e.activeSessionId,Q=fc(m(z),e.thinking),X=e.thinking;if(!q){f.value=z,_(Q);return}const fe=e.sessions.find(ye=>ye.id===q)?.model;a(q,ye=>({...ye,model:z})),Q!==X&&(e.thinking=Q,l(Q));try{await dt().updateSession(q,{model:z,thinking:Q!==X?Q:void 0})}catch(ye){a(q,Me=>({...Me,model:fe??Me.model})),Q!==X&&(e.thinking=X,l(X)),n("setModel",ye,{sessionId:q});return}await o(q)}function $(z){const q=new Set(d.value);q.has(z)?q.delete(z):q.add(z),d.value=Array.from(q),Dce(d.value)}async function k(z,q){const Q=e.activeSessionId;if(!Q)return;const X=i.value==="idle"&&!r.has(Q),fe=`msg_skill_opt_${Date.now().toString(36)}`;if(X){r.add(Q),e.sendingBySession={...e.sendingBySession,[Q]:!0};const ye={id:fe,sessionId:Q,role:"user",content:[{type:"text",text:`/${z}${q?` ${q}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:z,skillArgs:q}}};c(Q,Me=>[...Me,ye])}try{await dt().activateSkill(Q,z,q)}catch(ye){X&&(r.delete(Q),e.sendingBySession={...e.sendingBySession,[Q]:!1},c(Q,Me=>Me.filter(we=>we.id!==fe))),n("activateSkill",ye,{sessionId:Q})}}async function E(z){try{await dt().addProvider(z),await Promise.all([A(),v()])}catch(q){n("addProvider",q)}}async function M(z){try{await dt().deleteProvider(z),await Promise.all([A(),v()])}catch(q){n("deleteProvider",q)}}async function L(z){try{const q=await dt().refreshProvider(z);for(const Q of q.failed)n("refreshProvider",new Error(Q.reason),{message:Q.provider});await Promise.all([A(),v()])}catch(q){n("refreshProvider",q)}}async function S(){try{const z=await dt().refreshAllProviders();for(const q of z.failed)n("refreshAllProviders",new Error(q.reason),{message:q.provider});await Promise.all([A(),v()])}catch(z){n("refreshAllProviders",z)}}async function I(){try{return await dt().startOAuthLogin()}catch{return null}}async function P(){try{return await dt().pollOAuthLogin()}catch{return null}}async function D(){try{await dt().cancelOAuthLogin()}catch{}}function W(z){const q=_(z);s({thinking:q})}return{models:u,starredModelIds:d,providers:h,draftModel:f,skillsBySession:p,loadSkillsForSession:g,loadModels:v,refreshOAuthProviderModels:y,loadProviders:A,setModel:O,toggleStarModel:$,activateSkill:k,addProvider:E,deleteProvider:M,refreshProvider:L,refreshAllProviders:S,startOAuthLogin:I,pollOAuthLogin:P,cancelOAuthLogin:D,setThinking:W}}const U3="kimiWeb.compaction",Fce=["queued","working","suspended","completed","failed"];function q3(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Hce(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Wce(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:q3(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Hce();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function zce(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of Fce)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}const Uce=/^read[_-]?media(?:file)?$/i,qce=/^data:([^;]+);base64,(.*)$/s,jce=/^<(image|video|audio)\s+path="([^"]+)">$/,Vce=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Kce=/Mime type:\s*([^.\s]+)/i,Gce=/Size:\s*(\d+)\s*bytes/i,Yce=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Xce(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Qce(e){const t=Vce.exec(e.trim());return t?{kind:t[1],path:Xce(t[2])}:null}const Zce=/^f_[A-Za-z0-9]{10,}$/;function Jce(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return Zce.test(o)?o:void 0}function eue(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 tue(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 nue(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function oue(e,t){if(!Uce.test(e))return;const n=tue(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,f=jce.exec(h);f&&(s=f[1],o=f[2]);const m=Kce.exec(h);m?.[1]&&(i=m[1]);const b=Gce.exec(h);b?.[1]&&(r=Number(b[1]));const _=Yce.exec(h);_?.[1]&&_[2]&&(l=`${_[1]}x${_[2]}`);continue}const p=nue(d);p&&(a=p)}if(a===null)return;const c=qce.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=eue(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function sue(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
262
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
263
|
-
`));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
|
|
264
|
-
`)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
|
|
265
|
-
`)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function iue(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function rue(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,o=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==o?n-o:e.createdAt.localeCompare(t.createdAt)}function lue(e,t){const n=e.split(`
|
|
266
|
-
`),o=t.split(`
|
|
267
|
-
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function aue(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:lue(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function cue(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function uue(e){return e.metadata?.origin?.kind==="compaction_summary"}function due(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function fue(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function j3(e,t,n,o=!0,s=[],i={}){const r=[];let l=1;const a=new Map;for(const f of t)a.set(f.toolCallId,f);const c=new Map;for(const f of s){if(f.kind!=="subagent")continue;const m=[f.parentToolCallId,f.id].filter(b=>typeof b=="string"&&b.length>0);for(const b of m){const _=c.get(b)??[];_.push(f),c.set(b,_)}}for(const[f,m]of c.entries())c.set(f,m.toSorted(rue));let u=null;function d(f=!1){if(!u)return;const m=u;if(u=null,!f||!o)for(let b=0;b<m.tools.length;b++){const _=m.tools[b];if(_.status!=="running")continue;const g={..._,status:"ok"};m.tools[b]=g;const v=m.blocks.find(y=>y.kind==="tool"&&y.tool.id===g.id);v&&v.kind==="tool"&&(v.tool=g)}r.push({id:m.id,role:"assistant",no:l++,text:m.textParts.join(`
|
|
268
|
-
`),thinking:m.thinkingParts.length>0?m.thinkingParts.join(`
|
|
269
|
-
`):void 0,tools:m.tools.length>0?m.tools:void 0,blocks:m.blocks.length>0?m.blocks:void 0,approval:m.approval,approvalId:m.approvalId,durationMs:m.durationMs})}function p(f,m){for(const b of m)if(b.type==="text"){if(b.text){f.textParts.push(b.text);const _=f.blocks.at(-1);_&&_.kind==="text"?_.text+=`
|
|
270
|
-
`+b.text:f.blocks.push({kind:"text",text:b.text})}}else if(b.type==="thinking"){if(b.thinking){f.thinkingParts.push(b.thinking);const _=f.blocks.at(-1);_&&_.kind==="thinking"?_.thinking+=`
|
|
271
|
-
`+b.thinking:f.blocks.push({kind:"thinking",thinking:b.thinking})}}else if(b.type==="toolUse"){const _=c.get(b.toolCallId);if(_&&_.length>0){const y=_.filter(A=>A.swarmIndex!==void 0);if(y.length>1&&y.some(O=>{const $=q3(O);return $!=="completed"&&$!=="failed"}))continue}const g=a.get(b.toolCallId),v={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),status:"running",output:b.outputLines,planPath:b.toolName==="ExitPlanMode"?i[b.toolCallId]?.path:void 0};f.tools.push(v),f.blocks.push({kind:"tool",tool:v}),g&&(f.approval=aue(g),f.approvalId=g.approvalId)}else if(b.type==="toolResult"){const _=f.tools.findIndex(g=>g.id===b.toolCallId);if(_!==-1){const g=f.tools[_],v={...g,status:b.isError?"error":"ok",output:sue(b.output),media:b.isError?void 0:oue(g.name,b.output)};v.name==="ExitPlanMode"&&!v.planPath&&(v.planPath=fue(v.output)),f.tools[_]=v;const y=f.blocks.find(A=>A.kind==="tool"&&A.tool.id===b.toolCallId);y&&y.kind==="tool"&&(y.tool=v)}}}function h(f){if(f.type==="image"||f.type==="video"){const m=f.type,b=f.source;if(b.kind==="url")return{url:b.url,kind:m};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:m};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:m,fileId:b.fileId}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image",fileId:f.fileId};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video",fileId:f.fileId}}}for(const f of e){if(f.role==="system")continue;if(uue(f)){d();const v=f.metadata?.[U3];r.push({id:f.id,role:"compaction",no:l,text:f.content.filter(y=>y.type==="text").map(y=>y.text).join(`
|
|
272
|
-
`),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(f.role==="user"){if(d(),!cue(f))continue;const v=f.metadata?.origin,y=v?.kind==="skill_activation"&&v?.trigger==="user-slash",A=v?.kind==="plugin_command"&&v?.trigger==="user-slash",O=[],$=[];for(const k of f.content){if(k.type==="text")if(y)O.push(v.skillArgs??"");else if(A)O.push(v.commandArgs??"");else{const M=Qce(k.text);if(M&&(M.kind==="video"||M.kind==="image")&&n){const L=Jce(M.path);if(L){$.push({url:n(L),kind:M.kind,alt:L,fileId:L});continue}}O.push(k.text)}const E=h(k);E&&$.push({url:E.url,kind:E.kind,alt:k.type==="file"?k.name:void 0,fileId:E.fileId})}r.push({id:f.id,role:"user",no:l++,text:O.join(`
|
|
273
|
-
`),images:$.length>0?$:void 0,skillActivation:y?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:A?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){u&&p(u,f.content);continue}const m=f.promptId;due(u,m)?u!==null&&u.promptId===void 0&&m!==void 0&&(u.promptId=m):(d(),u={id:f.id,promptId:m,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const _=u;if(_===null)continue;const g=JSON.stringify(f.content);_.promptId!==void 0&&_.seenSigs.has(g)||(_.seenSigs.add(g),p(_,f.content))}return d(!0),r}function pue(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i}=t,r=Z({}),l=F(()=>{const $=e.activeSessionId;if(!$)return null;const k=r.value[$];return k?{parentId:$,agentId:k.agentId}:null}),a=F(()=>l.value?.parentId??null),c=F(()=>l.value!==null),u=F(()=>{const $=l.value;return $?!!e.sideChatSendingByAgent[$.agentId]:!1}),d=F(()=>{const $=l.value;return $?e.sideChatSendingByAgent[$.agentId]?!0:(e.tasksBySession[$.parentId]??[]).some(k=>k.id===$.agentId&&k.status==="running"):!1}),p=F(()=>{const $=l.value;if(!$)return[];const k=e.sideChatMessagesByAgent[$.agentId]??[];return j3(k,[],E=>dt().getFileUrl(E),d.value,[])});function h($,k){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[$]:k(e.sideChatMessagesByAgent[$]??[])}}function f($,k){h($,E=>[...E,k])}function m($){h($,k=>{const E=[...k].reverse().findIndex(L=>L.role==="user");if(E===-1)return k;const M=k.length-1-E;return k.filter((L,S)=>S!==M)})}function b($,k){h($,E=>{const M=[...E];for(let L=M.length-1;L>=0;L-=1){const S=M[L];if(S.role==="user")return M[L]={...S,promptId:S.promptId??k},M}return E})}function _($,k,E){E&&h($,M=>{const L=M.at(-1);if(L?.role==="assistant"){const S=L.content[0],I=S?.type==="text"?S.text:"";return[...M.slice(0,-1),{...L,content:[{type:"text",text:`${I}${E}`}]}]}return[...M,{id:o(),sessionId:k,role:"assistant",content:[{type:"text",text:E}],createdAt:new Date().toISOString()}]})}function g($,k,E){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[$]:!1},!E)return;const L=(e.sideChatMessagesByAgent[$]??[]).at(-1);(L?.role==="assistant"&&L.content[0]?.type==="text"?L.content[0].text:"").trim().length>0||_($,k,E)}async function v($){const k=e.activeSessionId;if(k){if(!r.value[k]){let E;try{({agentId:E}=await dt().startBtw(k))}catch(M){n("openSideChat",M,{sessionId:k});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:e.sideChatMessagesByAgent[E]??[]},r.value={...r.value,[k]:{agentId:E}},s(),i()?.markSideChannelAgent(E)}$&&$.trim()&&await A($.trim())}}function y(){const $=e.activeSessionId;if(!$)return;const{[$]:k,...E}=r.value;r.value=E}async function A($){const k=l.value,E=$.trim();if(!k||!E)return;const M=k.parentId,L=k.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[L]:!0};const S={id:o(),sessionId:M,role:"user",content:[{type:"text",text:E}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};f(L,S);try{const I=await dt().submitPrompt(M,{content:[{type:"text",text:E}],agentId:L});b(L,I.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[M]:[...e.sideChatUserMessageIdsBySession[M]??[],I.userMessageId]}}catch(I){n("sendSideChatPrompt",I,{sessionId:M}),m(L),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[L]:!1}}}function O($){if(!r.value[$])return;const{[$]:k,...E}=r.value;r.value=E}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:p,appendSideChatAssistantText:_,finishSideChatAgent:g,openSideChat:v,closeSideChat:y,sendSideChatPrompt:A,clearSideChatForSession:O}}function hue(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 mue(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
|
|
274
|
-
`)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&hue(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const H1="/sessions/";function iC(e){const{pathname:t}=e;if(!t.startsWith(H1))return;const n=t.slice(H1.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function gue(e){return e===void 0||e.length===0?"/":`${H1}${encodeURIComponent(e)}`}const vue=50,W1=5,yue=40402,kue=40410,bue=40902;function pv(e){return el(e)&&e.code===bue}const _ue=40904;function wue(e){return el(e)&&e.code===_ue}const Ml=No({}),bf=No({}),hv=No({});function Sue(e,t){const{t:n}=Un.global,{confirm:o}=sl(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:p,upsertSessionFront:h,appendSession:f,forgetSession:m,setActiveSessionId:b,updateSessionMessages:_,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:A,hasLoadedMessages:O,refreshSessionStatus:$,persistSessionProfile:k,mergedWorkspaces:E,workspacesView:M,status:L,workspaceIdForSession:S,savePermissionToStorage:I,savePlanModeToStorage:P,saveSwarmModeToStorage:D,saveGoalModeToStorage:W,draftModes:z,saveUnread:q,saveActiveWorkspaceToStorage:Q,saveHiddenWorkspacesToStorage:X,goalErrorMessage:fe,resetFastMoon:ye,initialized:Me,selectedDiffPath:we,fileDiffLines:ze,fileDiffLoading:Ue}=t;async function Fe(oe){if(e.messagesLoadingMoreBySession[oe])return;const Ce=e.messagesBySession[oe];if(!Ce||Ce.length===0)return;const xe=Ce[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[oe]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[oe]:!1};try{const Be=await dt().listMessages(oe,{beforeId:xe,pageSize:vue}),et=[...Be.items].reverse();_(oe,at=>[...et,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[oe]:Be.hasMore}}catch(Be){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[oe]:!0},l("loadOlderMessages",Be,{sessionId:oe})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[oe]:!1}}}function rt(oe){s.loadTasksForSession(oe),G(oe),$(oe),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,oe)||r.loadSkillsForSession(oe)}async function le(oe){const Ce=e.activeSessionId;if(Ce){we.value=oe,ze.value=[],Ue.value=!0;try{const Be=await dt().getFileDiff(Ce,oe);if(we.value!==oe)return;ze.value=mue(Be.diff)}catch(xe){we.value===oe&&(ze.value=[]),console.warn("[loadFileDiff] diff unavailable for",oe,xe)}finally{we.value===oe&&(Ue.value=!1)}}}function U(){we.value=null,ze.value=[],Ue.value=!1}async function G(oe){try{const xe=await dt().getGitStatus(oe);e.gitStatusBySession={...e.gitStatusBySession,[oe]:xe}}catch{}}async function ne(){try{const Ce=await dt().getAuth();e.authReady=Ce.ready,e.defaultModel=Ce.defaultModel,e.managedProviderStatus=Ce.managedProvider?.status??null}catch{}}async function H(){try{const oe=dt();e.config=await oe.getConfig()}catch{}}async function J(oe){try{const xe=await dt().setConfig(oe);return e.config=xe,e.defaultModel=xe.defaultModel??null,!0}catch(Ce){return l("setConfig",Ce),!1}}const ce=100,te=30,ue=720*60*1e3;async function j(){const oe=dt(),Ce=[];let xe;for(;;){const Be=await oe.listSessions({pageSize:ce,beforeId:xe,excludeEmpty:!0});if(Ce.push(...Be.items),!Be.hasMore||Be.items.length===0)break;xe=Be.items[Be.items.length-1].id}return Ce}async function Y(oe){const Ce=dt(),xe=[],Be=Date.now(),et=qt=>Be-new Date(qt.updatedAt).getTime();let at,Ot=!1,Vt=!0;for(;;){let qt;try{qt=await Ce.listSessions({workspaceId:oe,pageSize:W1,beforeId:at,excludeEmpty:!0})}catch(nn){if(Vt)throw nn;break}if(Ot=qt.hasMore,qt.items.length===0)break;const Bs=qt.items[qt.items.length-1],Fs=et(Bs)>=ue;if(!Vt&&Fs){const nn=qt.items.findIndex(Fn=>et(Fn)>=ue),Jn=nn>=0?nn+1:qt.items.length;xe.push(...qt.items.slice(0,Jn)),Ot=qt.hasMore||Jn<qt.items.length;break}if(xe.push(...qt.items),Vt=!1,!qt.hasMore||Fs)break;at=Bs.id}return{workspaceId:oe,page:{items:xe,hasMore:Ot}}}async function re(){const oe=e.workspaces;if(oe.length===0){const Ot=await j().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Ot}const Ce=await Promise.all(oe.map(Ot=>Y(Ot.id).catch(()=>({workspaceId:Ot.id,page:{items:[],hasMore:!1}})))),xe=[],Be={},et={},at={};for(const{workspaceId:Ot,page:Vt}of Ce)xe.push(...Vt.items),Be[Ot]=Vt.hasMore,et[Ot]=Vt.items.length>0?Vt.items[Vt.items.length-1].id:void 0,at[Ot]=Math.max(Vt.items.length,W1);return e.sessionsHasMoreByWorkspace=Be,e.sessionsCursorByWorkspace=et,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,xe.sort((Ot,Vt)=>new Date(Vt.updatedAt).getTime()-new Date(Ot.updatedAt).getTime()),xe}async function ge(oe){if(e.sessionsLoadingMoreByWorkspace[oe]||e.sessionsHasMoreByWorkspace[oe]===!1)return;const Ce=e.sessionsCursorByWorkspace[oe];if(Ce!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[oe]:!0};try{const xe=await dt().listSessions({workspaceId:oe,pageSize:te,beforeId:Ce,excludeEmpty:!0}),Be=new Set(e.sessions.map(at=>at.id)),et=xe.items.filter(at=>!Be.has(at.id));et.length>0&&d([...e.sessions,...et]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[oe]:xe.items.length>0?xe.items[xe.items.length-1].id:Ce},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[oe]:xe.hasMore}}catch(xe){l("loadMoreSessions",xe)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[oe]:!1}}}}async function Ae(){if(e.sessionsFullyLoaded)return;const oe=await j().catch(()=>null);if(oe===null)return;d(oe),e.sessionsFullyLoaded=!0;const Ce={};for(const xe of e.workspaces)Ce[xe.id]=!1;e.sessionsHasMoreByWorkspace=Ce}async function Ie(){e.loading=!0;try{const oe=dt();await Promise.all([oe.getHealth().catch(()=>null),oe.getMeta().then(Ot=>{e.serverVersion=Ot.serverVersion,e.availableOpenInApps=Ot.openInApps,e.dangerousBypassAuth=Ot.dangerousBypassAuth}).catch(()=>null),r.loadModels()]),await ne(),await H(),await ae();const Ce=await re();d(Ce);const xe=Ce[0],Be=e.activeWorkspaceId;!(Be!==null&&E.value.some(Ot=>Ot.id===Be))&&xe&&Ve(S(xe)),In();const at=typeof window<"u"?iC(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(Vt=>Vt.id===at)||await bn(at))&&await _n(at,{urlMode:"replace"}),!e.activeSessionId&&Ce.length>0&&await _n(Ce[0].id,{urlMode:"replace"})}catch(oe){l("load",oe)}finally{e.loading=!1,Me.value=!0}}async function ae(){try{const oe=dt(),[Ce,xe]=await Promise.all([oe.listWorkspaces().catch(()=>[]),oe.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Te(Ce),e.fsHome=xe.home||null,e.recentRoots=xe.recentRoots}catch{}}function Te(oe){const Ce=Jd();return Object.keys(Ce).length===0?oe:oe.map(xe=>{const Be=Ce[xe.root];return Be!==void 0?{...xe,name:Be}:xe})}function Ve(oe){e.activeWorkspaceId=oe,Q(oe)}function tt(oe){Ve(oe);const Ce=e.sessions.filter(xe=>S(xe)===oe);if(Ce.length>0){const xe=Ce[0];xe&&xe.id!==e.activeSessionId&&_n(xe.id)}else b(void 0),Ft(void 0,"push")}function bt(oe){const Ce=Jd()[oe.root],xe=Ce!==void 0?{...oe,name:Ce}:oe;e.hiddenWorkspaceRoots.includes(xe.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==xe.root),X(e.hiddenWorkspaceRoots));const Be=e.workspaces.findIndex(at=>at.id===xe.id||at.root===xe.root);if(Be===-1){e.workspaces=[xe,...e.workspaces];return}const et=[...e.workspaces];et[Be]=xe,e.workspaces=et}function kt(oe){if(oe.type==="workspaceCreated"||oe.type==="workspaceUpdated"){bt(oe.workspace);return}const Ce=e.workspaces.find(Be=>Be.id===oe.workspaceId)?.root??oe.root;if(Ce&&!e.hiddenWorkspaceRoots.includes(Ce)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Ce],X(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Be=>Be.id!==oe.workspaceId&&Be.root!==Ce),e.activeWorkspaceId===oe.workspaceId||e.activeWorkspaceId===Ce){const Be=M.value[0]?.id??null;if(e.activeWorkspaceId=Be,Be)Q(Be);else try{cc(Et.activeWorkspace)}catch{}b(void 0),e.sessionLoading=!1,U(),Ft(void 0,"replace")}}function Tt(){b(void 0),Ft(void 0,"push")}function Pt(oe){Ve(oe),Tt(),U()}async function mt(oe,Ce,xe){const Be=E.value.find(et=>et.id===oe);if(Be)try{const et=dt();let at,Ot=Be.root;try{const nn=await et.addWorkspace({root:Be.root});at=nn.id,Ot=nn.root,bt(nn)}catch{}const Vt=r.draftModel.value??void 0,qt=await et.createSession({workspaceId:at,cwd:Ot,model:Vt});r.draftModel.value=null;const Bs=Vt!==void 0&&(!qt.model||qt.model.length===0)?{...qt,model:Vt}:qt;h(Bs),Ve(qt.workspaceId??at??oe),await _n(qt.id);const Fs=qt.id;z.planMode&&(e.planModeBySession={...e.planModeBySession,[Fs]:!0},P()),z.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Fs]:!0},D()),z.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Fs]:!0},W()),z.planMode=!1,z.swarmMode=!1,z.goalMode=!1,await $n(qt.id,Ce,xe)}catch(et){l("startSessionAndSendPrompt",et)}}async function Yt(oe){const Ce=oe.trim();if(!Ce)return!1;const xe=dt();try{const Be=await xe.addWorkspace({root:Ce});return bt(Be),Pt(Be.id),!0}catch{return!1}}async function Rn(oe){try{return await dt().browseFs(oe)}catch{return{path:"",parent:null,entries:[]}}}async function Dn(){try{return await dt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Ft(oe,Ce){if(Ce==="none"||typeof window>"u"||!window.history)return;const xe=gue(oe);if(window.location.pathname!==xe)try{Ce==="push"?window.history.pushState(null,"",xe):window.history.replaceState(null,"",xe)}catch{}}async function bn(oe){try{const Ce=await dt().getSession(oe);return e.sessions.some(xe=>xe.id===Ce.id)||f(Ce),!0}catch{return!1}}function Vn(){const oe=iC(window.location);if(oe===void 0){b(void 0);return}if(oe!==e.activeSessionId){if(e.sessions.some(Ce=>Ce.id===oe)){_n(oe,{urlMode:"none"});return}(async()=>{if(await bn(oe)){await _n(oe,{urlMode:"none"});return}const Ce=e.sessions[0];Ce?await _n(Ce.id,{urlMode:"replace"}):(b(void 0),Ft(void 0,"replace"))})()}}let ot=!1;function In(){ot||typeof window>"u"||(ot=!0,window.addEventListener("popstate",Vn))}async function _n(oe,Ce){const xe=O(oe),Be=!xe&&u.has(oe);u.delete(oe);try{Ft(oe,Ce?.urlMode??"push"),e.sessionLoading=!xe&&!Be,b(oe),ye(),e.unreadBySession[oe]&&(e.unreadBySession={...e.unreadBySession,[oe]:!1},q({[oe]:!1})),U();const et=e.sessions.find(at=>at.id===oe);if(et){const at=S(et);e.activeWorkspaceId!==at&&Ve(at)}if(xe){if(await A(oe)==="not-found")return}else if(await y(oe)==="not-found")return;rt(oe)}catch(et){l("selectSession",et,{sessionId:oe})}finally{e.activeSessionId===oe&&(e.sessionLoading=!1)}}function Kn(oe){const Ce=oe===void 0?void 0:r.models.value.find(xe=>xe.model===oe||xe.id===oe||xe.displayName===oe);return fc(Ce,e.thinking)}async function $n(oe,Ce,xe){c.add(oe),e.sendingBySession={...e.sendingBySession,[oe]:!0};const Be=g();try{const et=dt(),at=[];Ce&&at.push({type:"text",text:Ce});for(const Fn of xe??[])Fn.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:Fn.fileId}}):at.push({type:"image",source:{kind:"file",fileId:Fn.fileId}});if(at.length===0)return c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},!1;const Ot={id:Be,sessionId:oe,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};_(oe,Fn=>[...Fn,Ot]);const Vt=e.sessions.find(Fn=>Fn.id===oe),qt=(Vt?.model&&Vt.model.length>0?Vt.model:e.defaultModel)??void 0,Bs=e.planModeBySession[oe]??!1,Fs=e.swarmModeBySession[oe]??!1,nn=e.goalModeBySession[oe]??!1;if(nn&&Ce)try{await et.updateSession(oe,{goalObjective:Ce.trim()})}catch(Fn){return l("createGoal",Fn,{sessionId:oe}),c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},_(oe,Co=>Co.some(Ro=>Ro.id===Be)?Co.filter(Ro=>Ro.id!==Be):Co),!1}const Jn=await et.submitPrompt(oe,{content:at,model:qt,thinking:Kn(qt),permissionMode:e.permission,planMode:Bs,swarmMode:Fs});return nn&&(e.goalModeBySession={...e.goalModeBySession,[oe]:!1},W()),e.promptIdBySession={...e.promptIdBySession,[oe]:Jn.promptId},_(oe,Fn=>{const Co=Fn.findIndex(po=>po.id===Be);if(Co===-1)return Fn;const Ro=[...Fn];return Ro[Co]={...Ro[Co],promptId:Ro[Co].promptId??Jn.promptId},Ro}),v()?.bindNextPromptId(oe,Jn.promptId),!0}catch(et){return c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},_(oe,at=>at.some(Ot=>Ot.id===Be)?at.filter(Ot=>Ot.id!==Be):at),l("sendPrompt",et,{sessionId:oe}),!1}}async function Ge(oe,Ce){const xe=e.activeSessionId;if(xe){if(a.value!=="idle"||c.has(xe)){$t(oe,Ce);return}await $n(xe,oe,Ce)}}async function Ye(oe,Ce){const xe=e.activeSessionId;if(!xe)return;const Be=e.queuedBySession[xe]??[],et=[],at=[];for(const nn of Be){const Jn=nn.text.trim();Jn&&et.push(Jn),nn.attachments?.length&&at.push(...nn.attachments)}const Ot=oe.trim();if(Ot&&et.push(Ot),Ce?.length&&at.push(...Ce),et.length===0&&at.length===0)return;Be.length>0&&(e.queuedBySession={...e.queuedBySession,[xe]:[]});const Vt=et.join(`
|
|
275
|
-
|
|
276
|
-
`);if(a.value==="idle"&&!c.has(xe)){await $n(xe,Vt,at);return}const qt=[];Vt&&qt.push({type:"text",text:Vt});for(const nn of at)nn.kind==="video"?qt.push({type:"video",source:{kind:"file",fileId:nn.fileId}}):qt.push({type:"image",source:{kind:"file",fileId:nn.fileId}});const Bs=g(),Fs={id:Bs,sessionId:xe,role:"user",content:qt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};_(xe,nn=>[...nn,Fs]);try{const nn=dt(),Jn=e.sessions.find(Ro=>Ro.id===xe),Fn=(Jn?.model&&Jn.model.length>0?Jn.model:e.defaultModel)??void 0,Co=await nn.submitPrompt(xe,{content:qt,model:Fn,thinking:Kn(Fn),permissionMode:e.permission,planMode:e.planModeBySession[xe]??!1,swarmMode:e.swarmModeBySession[xe]??!1});if(_(xe,Ro=>{const po=Ro.findIndex(cl=>cl.id===Bs);if(po===-1)return Ro;const xo=[...Ro];return xo[po]={...xo[po],promptId:xo[po].promptId??Co.promptId},xo}),Co.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[xe]:Co.promptId},v()?.bindNextPromptId(xe,Co.promptId);return}try{await nn.steerPrompts(xe,[Co.promptId])}catch{}}catch(nn){_(xe,Jn=>Jn.filter(Fn=>Fn.id!==Bs)),l("steer",nn,{sessionId:xe})}}async function Ct(oe,Ce){try{const Be=await dt().uploadFile({file:oe,name:Ce});return{fileId:Be.id,name:Be.name,mediaType:Be.mediaType}}catch(xe){return l("uploadImage",xe),null}}function $t(oe,Ce){const xe=e.activeSessionId;if(!xe)return;const Be=e.queuedBySession[xe]??[];e.queuedBySession={...e.queuedBySession,[xe]:[...Be,{text:oe,attachments:Ce}]}}async function mn(){const oe=e.activeSessionId;if(!oe)return;const Ce=e.sessions.find(et=>et.id===oe);let xe=e.promptIdBySession[oe];if(xe===void 0){const et=Ce?.currentPromptId;et?.startsWith("prompt_")&&(xe=et)}const Be=dt();if(xe!==void 0)try{if((await Be.abortPrompt(oe,xe)).aborted)return;const at={...e.promptIdBySession};delete at[oe],e.promptIdBySession=at}catch(et){if(el(et)&&et.code===yue){const at={...e.promptIdBySession};delete at[oe],e.promptIdBySession=at}else{l("abortCurrentPrompt",et,{sessionId:oe});return}}try{await Be.abortSession(oe)}catch(et){l("abortCurrentPrompt",et,{sessionId:oe})}}function Nn(oe,Ce){const xe=e.approvalsBySession[oe]??[];e.approvalsBySession={...e.approvalsBySession,[oe]:xe.filter(Be=>Be.approvalId!==Ce)}}function tn(oe,Ce){const xe=e.questionsBySession[oe]??[];e.questionsBySession={...e.questionsBySession,[oe]:xe.filter(Be=>Be.questionId!==Ce)}}async function Ln(oe,Ce){const xe=e.activeSessionId;if(xe&&!bf[oe]){bf[oe]=!0;try{const Be=dt(),et={decision:Ce.decision,scope:Ce.scope,feedback:Ce.feedback,selectedLabel:Ce.selectedLabel};await Be.respondApproval(xe,oe,et),Nn(xe,oe)}catch(Be){pv(Be)?Nn(xe,oe):l("respondApproval",Be,{sessionId:xe})}finally{delete bf[oe]}}}async function Zn(oe,Ce){const xe=e.activeSessionId;if(xe&&!Ml[oe]){Ml[oe]="answer";try{await dt().respondQuestion(xe,oe,Ce),tn(xe,oe)}catch(Be){pv(Be)?tn(xe,oe):l("respondQuestion",Be,{sessionId:xe})}finally{delete Ml[oe]}}}async function Mt(oe){const Ce=e.activeSessionId;if(Ce&&!Ml[oe]){Ml[oe]="dismiss";try{await dt().dismissQuestion(Ce,oe),tn(Ce,oe)}catch(xe){pv(xe)?tn(Ce,oe):l("dismissQuestion",xe,{sessionId:Ce})}finally{delete Ml[oe]}}}async function uo(oe){const Ce=e.activeSessionId;if(Ce&&!hv[oe]){hv[oe]=!0;try{await dt().cancelTask(Ce,oe);const Be=e.tasksBySession[Ce]??[];e.tasksBySession={...e.tasksBySession,[Ce]:Be.map(et=>et.id===oe?{...et,status:"cancelled"}:et)}}catch(xe){wue(xe)||l("cancelTask",xe,{sessionId:Ce})}finally{delete hv[oe]}}}function Xt(oe){const Ce=e.activeSessionId;Ce?(e.planModeBySession={...e.planModeBySession,[Ce]:oe},P(),k({planMode:oe})):z.planMode=oe}function si(){const oe=e.activeSessionId,Ce=oe?e.planModeBySession[oe]??!1:z.planMode;Xt(!Ce)}function _o(oe){const Ce=e.activeSessionId;Ce?(e.swarmModeBySession={...e.swarmModeBySession,[Ce]:oe},D(),k({swarmMode:oe})):z.swarmMode=oe}async function Ds(){const oe=e.activeSessionId,xe=!(oe?e.swarmModeBySession[oe]??!1:z.swarmMode);xe&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||_o(xe)}function ss(oe){const Ce=e.activeSessionId;Ce?(e.goalModeBySession={...e.goalModeBySession,[Ce]:oe},W()):z.goalMode=oe}function jo(){const oe=e.activeSessionId,Ce=oe?e.goalModeBySession[oe]??!1:z.goalMode;ss(!Ce)}async function is(oe){const Ce=oe.trim();if(!Ce||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:Ce}),variant:"primary"}))return;const xe=e.activeSessionId;if(xe){try{await dt().updateSession(xe,{goalObjective:Ce})}catch(Be){l("createGoal",Be,{sessionId:xe,message:fe(Be)});return}await Ge(Ce)}}function Nt(oe){const Ce=e.activeSessionId;Ce&&Promise.resolve(dt().updateSession(Ce,{goalControl:oe})).catch(xe=>{l("controlGoal",xe,{sessionId:Ce,message:fe(xe)})})}function Xe(oe){e.permission=oe,I(oe),k({permissionMode:oe})}function st(oe){const Ce=[...e.warnings];Ce.splice(oe,1),e.warnings=Ce}async function de(oe,Ce){try{await dt().updateSession(oe,{title:Ce}),p(oe,Be=>({...Be,title:Ce}))}catch(xe){l("renameSession",xe,{sessionId:oe})}}async function pe(oe,Ce){const xe=e.workspaces.find(et=>et.id===oe)?.root,Be=()=>{e.workspaces=e.workspaces.map(et=>et.id===oe?{...et,name:Ce}:et)};try{if(await dt().updateWorkspace(oe,{name:Ce}),xe!==void 0){const et=Jd();xe in et&&(delete et[xe],A_(et))}Be()}catch(et){if(xe!==void 0&&el(et)&&et.code===kue){A_({...Jd(),[xe]:Ce}),Be();return}l("renameWorkspace",et)}}async function Oe(oe){const Ce=e.workspaces.find(at=>at.id===oe)?.root??E.value.find(at=>at.id===oe)?.root??oe,xe=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,Be=e.activeWorkspaceId===oe||e.activeWorkspaceId===Ce,et=!!(xe&&(xe.cwd===Ce||xe.workspaceId===oe||S(xe)===oe));Ce&&!e.hiddenWorkspaceRoots.includes(Ce)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Ce],X(e.hiddenWorkspaceRoots));try{await dt().deleteWorkspace(oe)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==oe&&at.root!==Ce),Be||et){const at=M.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Q(at);else try{cc(Et.activeWorkspace)}catch{}}(Be||et)&&(b(void 0),e.sessionLoading=!1,U(),Ft(void 0,"replace"))}async function Qt(oe){try{await dt().archiveSession(oe),m(oe),i.clearSideChatForSession(oe);const{[oe]:xe,...Be}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Be,e.activeSessionId===oe){const et=e.sessions[0];et?await _n(et.id,{urlMode:"replace"}):(b(void 0),Ft(void 0,"replace"))}}catch(Ce){l("archiveSession",Ce,{sessionId:oe})}}async function Wt(){try{await dt().logout(),await ne(),await Ie()}catch(oe){l("logout",oe)}}function fo(oe){const Ce=e.activeSessionId;Ce&&dt().compactSession(Ce,oe).catch(xe=>{l("compact",xe,{sessionId:Ce})})}async function Bn(oe){const Ce=oe??e.activeSessionId;if(Ce)try{const xe=await dt().forkSession(Ce);h(xe),await _n(xe.id)}catch(xe){l("fork",xe,{sessionId:Ce})}}async function bs(oe=1){const Ce=e.activeSessionId;if(!Ce)return null;const xe=(()=>{const Be=e.messagesBySession[Ce]??[];for(let et=Be.length-1;et>=0;et--){const at=Be[et];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Ot=>Ot.type==="text").map(Ot=>Ot.text).join(`
|
|
277
|
-
`)}return null})();try{return await dt().undoSession(Ce,oe),await y(Ce),xe}catch(Be){return l("undo",Be,{sessionId:Ce}),null}}function ii(oe){const Ce=e.activeSessionId;if(!Ce)return;const xe=e.queuedBySession[Ce]??[];if(oe<0||oe>=xe.length)return;const Be=[...xe];Be.splice(oe,1),e.queuedBySession={...e.queuedBySession,[Ce]:Be}}function wo(oe,Ce){const xe=e.activeSessionId;if(!xe)return;const Be=e.queuedBySession[xe]??[];if(oe===Ce||oe<0||oe>=Be.length||Ce<0||Ce>=Be.length)return;const et=[...Be],[at]=et.splice(oe,1);at!==void 0&&(et.splice(Ce,0,at),e.queuedBySession={...e.queuedBySession,[xe]:et})}async function ta(oe){const Ce=e.activeSessionId;if(!Ce)return[];try{return(await dt().listDirectory(Ce,{path:oe,includeGitStatus:!0})).items}catch{return[]}}async function ll(oe){const Ce=e.activeSessionId;if(!Ce)return null;try{const Be=await dt().readFile(Ce,{path:oe});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 al=10485760;function Po(oe){const Ce=e.activeSessionId;return Ce?dt().getFileDownloadUrl(Ce,oe):null}async function ft(oe,Ce){const xe=e.activeSessionId;if(!xe)return!1;try{return await dt().openFile(xe,{path:oe,line:Ce}),!0}catch(Be){return l("openFile",Be,{sessionId:xe}),!1}}async function me(oe){const Ce=e.activeSessionId;if(!Ce)return;const xe=L.value.cwd||".";try{await dt().openInApp(Ce,oe,xe)}catch(Be){l("openInApp",Be,{sessionId:Ce})}}async function Ne(oe){const Ce=e.activeSessionId;if(!Ce)return!1;try{return await dt().revealFile(Ce,{path:oe}),!0}catch(xe){return l("revealFile",xe,{sessionId:Ce}),!1}}async function xn(oe){if(/^(https?:|data:|blob:)/i.test(oe))return oe;const Ce=e.activeSessionId;if(!Ce)return oe;let xe=oe;if(xe.startsWith("/")){const Be=e.sessions.find(et=>et.id===Ce)?.cwd;if(Be&&(xe===Be||xe.startsWith(Be.endsWith("/")?Be:`${Be}/`))){if(xe=xe.slice(Be.length).replace(/^\//,""),!xe)return oe}else return oe}try{const et=await dt().readFile(Ce,{path:xe,length:al});return!et.isBinary||et.encoding!=="base64"||et.truncated?oe:`data:${et.mime};base64,${et.content}`}catch{return oe}}async function So(oe){const Ce=e.activeSessionId;if(!Ce)return[];try{return(await dt().searchFiles(Ce,{query:oe,limit:20})).items.map(et=>({path:et.path,name:et.name}))}catch{return[]}}return{loadFileDiff:le,clearFileDiff:U,loadGitStatus:G,checkAuth:ne,loadConfig:H,updateConfig:J,listAllSessionsGlobal:j,load:Ie,loadWorkspaces:ae,loadMoreSessions:ge,loadAllSessions:Ae,selectWorkspace:Ve,openWorkspace:tt,upsertWorkspacePreserveOrder:bt,applyWorkspaceEvent:kt,clearActiveSession:Tt,openWorkspaceDraft:Pt,startSessionAndSendPrompt:mt,addWorkspaceByPath:Yt,browseFs:Rn,getFsHome:Dn,writeSessionUrl:Ft,fetchSessionIntoList:bn,onSessionRoutePopState:Vn,bindSessionRoute:In,selectSession:_n,submitPromptInternal:$n,sendPrompt:Ge,steerPrompt:Ye,uploadImage:Ct,enqueue:$t,unqueue:ii,reorderQueue:wo,abortCurrentPrompt:mn,respondApproval:Ln,respondQuestion:Zn,dismissQuestion:Mt,pendingQuestionActions:Ml,pendingApprovalActions:bf,cancelTask:uo,setPlanMode:Xt,togglePlanMode:si,setSwarmMode:_o,toggleSwarmMode:Ds,setGoalMode:ss,toggleGoalMode:jo,createGoal:is,controlGoal:Nt,setPermission:Xe,dismissWarning:st,renameSession:de,renameWorkspace:pe,deleteWorkspace:Oe,archiveSession:Qt,logout:Wt,compact:fo,forkSession:Bn,undo:bs,listDir:ta,readFileContent:ll,getFileDownloadUrl:Po,openWorkspaceFile:ft,openInApp:me,revealWorkspaceFile:Ne,resolveImageUrl:xn,searchFiles:So,loadOlderMessages:Fe,refreshSessionSidecars:rt}}const Cue="kimiWeb.optimisticUserMessage";function xue(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Aue(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Tue(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function mv(e){return e.role==="user"&&e.metadata?.[Cue]===!0}function Mue(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const Eue=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function rC(e){let t="",n=0;for(const o of e.content)o.type==="text"?Eue.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function Iue(e,t){const n=rC(e),o=rC(t);return n.text===o.text&&n.media===o.media}function $ue(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(mv(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(mv(s)&&Mue(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(mv(s)&&Iue(s,t))return o}return-1}function Nue(e,t,n){let o=!1;const s=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(o=!0,{...i,content:l}):i});return o?s:e}function Lue(e,t,n){const o=Aue(e);switch(Tue(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionStatusChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[U3]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"){const a=$ue(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=Nue(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i];l[r]={...t.task,outputLines:i[r].outputLines,text:i[r].text},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&(s._agentError||s._agentWarning)){const i=s._agentError?Un.global.t("warnings.errorLabel"):Un.global.t("warnings.noteLabel"),r=s.message??s.code??"agent error";o.warnings=[...o.warnings,`${i}: ${r}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function Oue(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Pue(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||Zl(s.toolName)!=="todo")continue;let i=s.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:Oue(a.status)}]:[]})}}return[]}const Ei=P3(),Ol=xce(),zp=Nce(),V3=Et.permission,K3=Et.activeWorkspace,G3=Et.thinking,Y3=Et.planMode,X3=Et.swarmMode,Q3=Et.goalMode,lC=40401,Z3=Et.onboarded,Rue=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;cc(Et.codeFont);cc(Et.theme);function Due(){try{const e=Qn(V3);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Bue(e){try{to(V3,e)}catch{}}function Fue(){try{const e=Qn(G3);if(e&&Rue.test(e))return e}catch{}return"high"}function Hue(e){try{to(G3,e)}catch{}}function gv(e){const t=Qn(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function $y(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);to(e,JSON.stringify(n))}catch{}}function J3(){$y(Y3,be.planModeBySession)}function e4(){$y(X3,be.swarmModeBySession)}function t4(){$y(Q3,be.goalModeBySession)}function Wue(){try{return Qn(K3)}catch{return null}}const n4=Et.hiddenWorkspaces;function zue(){try{const e=Qn(n4);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Uue(e){try{to(n4,JSON.stringify(e))}catch{}}function que(e){try{to(K3,e)}catch{}}function jue(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const be=No({...xue(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"kimi-web",connection:"disconnected",permission:Due(),thinking:Fue(),planModeBySession:gv(Y3),swarmModeBySession:gv(X3),goalModeBySession:gv(Q3),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:_0(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Wue(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:zue(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Rh=No({planMode:!1,swarmMode:!1,goalMode:!1});function o4(e){be.sessions=e}function Dh(e,t){be.sessions=be.sessions.map(n=>n.id===e?t(n):n)}function Vue(e){be.sessions=[e,...be.sessions.filter(t=>t.id!==e.id)]}function Kue(e){be.sessions=[...be.sessions,e]}function Gue(e){be.sessions=be.sessions.filter(t=>t.id!==e)}function s4(){const e=be.activeSessionId;e&&be.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(be.unreadBySession={...be.unreadBySession,[e]:!1},w0({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Et.unread&&(be.unreadBySession=_0(),s4())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&s4()});function Ny(e){be.activeSessionId=e}function Yue(e){be.messagesBySession=e}function Xue(e,t){be.messagesBySession={...be.messagesBySession,[e]:t}}function i4(e,t){be.messagesBySession={...be.messagesBySession,[e]:t(be.messagesBySession[e]??[])}}function Que(e){const{[e]:t,...n}=be.messagesBySession;be.messagesBySession=n}function r4(e){hi?.unsubscribe(e),kde(e),Qu.flush(),Gue(e),Que(e),delete be.approvalsBySession[e],delete be.questionsBySession[e],delete be.tasksBySession[e],delete be.goalBySession[e],delete be.gitStatusBySession[e],delete be.lastSeqBySession[e],delete be.compactionBySession[e],delete be.messagesLoadingMoreBySession[e],delete be.messagesHasMoreBySession[e],delete be.messagesLoadMoreErrorBySession[e],delete Hh[e],g4.delete(e),Fh.delete(e),delete be.queuedBySession[e],delete be.promptIdBySession[e],delete be.sendingBySession[e],delete be.planModeBySession[e],delete be.swarmModeBySession[e],delete be.goalModeBySession[e],J3(),e4(),t4()}const l4=Z(null),a4=Z([]),c4=Z(!1),u4=Z(!1);async function Bh(e){let t;try{t=await dt().getSessionStatus(e)}catch{return}Dh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),be.swarmModeBySession={...be.swarmModeBySession,[e]:t.swarmMode},be.planModeBySession={...be.planModeBySession,[e]:t.planMode}}function d4(e){const t=be.activeSessionId;t&&Promise.resolve(dt().updateSession(t,e)).then(()=>Bh(t)).catch(()=>{})}const f4=Et.conversationToc;function Zue(){try{const e=Qn(f4);return e===null?!0:e==="true"}catch{return!0}}function Jue(e){try{to(f4,e?"true":"false")}catch{}}const p4=Z(Zue());function ede(e){p4.value=e,Jue(e)}function tde(e){try{return Qn(e)??""}catch{return""}}const h4=Z(tde(Z3)==="1");function nde(e){h4.value=e;try{to(Z3,e?"1":"0")}catch{}}let hi=null,aC=0;function m4(){return aC+=1,`msg_opt_${Date.now().toString(36)}_${aC}`}const Fh=new Set;function ode(e,t,n){const o={sessions:be.sessions,activeSessionId:be.activeSessionId,messagesBySession:be.messagesBySession,approvalsBySession:be.approvalsBySession,planReviewByToolCallId:be.planReviewByToolCallId,questionsBySession:be.questionsBySession,tasksBySession:be.tasksBySession,goalBySession:be.goalBySession,lastSeqBySession:be.lastSeqBySession,compactionBySession:be.compactionBySession,config:be.config,warnings:be.warnings},s=Lue(o,e,{sessionId:t,seq:n});o4(s.sessions),Ny(s.activeSessionId),Yue(s.messagesBySession),be.approvalsBySession=s.approvalsBySession,be.planReviewByToolCallId=s.planReviewByToolCallId,be.questionsBySession=s.questionsBySession,be.tasksBySession=s.tasksBySession,be.goalBySession=s.goalBySession,be.lastSeqBySession=s.lastSeqBySession,be.compactionBySession=s.compactionBySession,be.config=s.config??null,be.warnings=s.warnings,e.type==="configChanged"&&(be.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Wn.loadModels(),Wn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(be.swarmModeBySession={...be.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(be.planModeBySession={...be.planModeBySession,[e.sessionId]:e.planMode}))}function sde(e,t){ode(e,t.sessionId,t.seq);const n=Fo.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:o}=n,s=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&Fo.appendSideChatAssistantText(o,s,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?Fo.finishSideChatAgent(o,s):e.type==="taskProgress"&&e.taskId===o?Fo.appendSideChatAssistantText(o,s,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&Fo.finishSideChatAgent(o,s,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;be.promptIdBySession[o]!==e.message.promptId&&(be.promptIdBySession={...be.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===be.activeSessionId&&Ei.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&wfe(e.sessionId,e.status),e.type==="questionRequested"&&Sfe(e.sessionId,e.question)}const Qu=bce(({appEvent:e,meta:t})=>sde(e,t),({appEvent:e})=>yce(e));function Ly(){if(hi!==null||typeof WebSocket>"u")return;be.connection="connecting",hi=dt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){gt.applyWorkspaceEvent(t);return}Qu({appEvent:t,meta:n})},onResync(t,n,o){Qu.flush(),o!==void 0&&(Hh[t]=o),gde.request(t)},onError(t,n,o){Oy({severity:"error",title:Un.global.t("warnings.wsTitle"),message:n,details:[Hn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){be.connected=t,be.connection=t?"connected":"disconnected"}})}const Hh={},g4=new Set;function ide(e){return el(e)&&e.code===lC?!0:typeof e=="object"&&e!==null&&e.code===lC}function Hn(e,t){if(!(t==null||t===""))return{label:Un.global.t(`warnings.details.${e}`),value:v4(t)}}function v4(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function rde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function lde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function ade(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function cde(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function cC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function ude(e,t,n){const o=v3(t),s=el(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Hn("operation",e),Hn("sessionId",n??be.activeSessionId),Hn("connection",be.connection),Hn("timestamp",cde(i??Date.now()))];return o?l.push(Hn("duration",cC(r)),Hn("request",`${t.method} ${t.path}`),Hn("endpoint",t.url),Hn("requestId",t.requestId),Hn("phase",t.phase),Hn("timeout",`${t.timeoutMs}ms`),Hn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Hn("contentType",t.contentType),Hn("responsePreview",t.bodyPreview),Hn("cause",t.cause)):s?l.push(Hn("duration",cC(r)),Hn("code",t.code),Hn("requestId",t.requestId),Hn("message",t.message),Hn("details",t.details)):l.push(Hn("errorName",rde(t)),Hn("message",lde(t)??v4(t)),Hn("stack",ade(t))),l.filter(a=>a!==void 0)}function dde(e,t,n={}){const o=v3(t),s=el(t),i=n.title??(o?Un.global.t("warnings.daemonNetworkTitle"):s?Un.global.t("warnings.daemonApiTitle"):Un.global.t("warnings.operationFailedTitle")),r=n.message??(o?Un.global.t("warnings.daemonNetworkMessage"):s?t.message:Un.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:ude(e,t,n.sessionId)}}function Oy(e){be.warnings=[...be.warnings,e]}function Wh(e,t,n){Oy(dde(e,t,n))}const fde={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function pde(e){if(!el(e))return;const t=fde[e.code];return t?Un.global.t(t):void 0}async function hde(e){if(r4(e),be.activeSessionId!==e)return;const t=be.sessions[0];t?await gt.selectSession(t.id,{urlMode:"replace"}):(Ny(void 0),be.sessionLoading=!1,gt.writeSessionUrl(void 0,"replace"))}const uC=new Set;async function mde(e){if(!uC.has(e)){uC.add(e);try{const t=await dt().getSessionWarnings(e),n=Un.global.t("warnings.noteLabel");for(const o of t)Oy(`${n}: ${o.message}`)}catch{}}}async function Py(e){try{const n=await dt().getSessionSnapshot(e);Qu.flush(),Dh(e,o=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:o.model})),Xue(e,n.messages),be.messagesHasMoreBySession={...be.messagesHasMoreBySession,[e]:n.hasMoreMessages},be.approvalsBySession={...be.approvalsBySession,[e]:n.pendingApprovals};for(const o of n.pendingApprovals){const s=o.display;s?.kind==="plan_review"&&typeof s.plan=="string"&&s.plan.length>0&&(be.planReviewByToolCallId={...be.planReviewByToolCallId,[o.toolCallId]:{plan:s.plan,path:typeof s.path=="string"?s.path:void 0}})}return be.questionsBySession={...be.questionsBySession,[e]:n.pendingQuestions},be.lastSeqBySession={...be.lastSeqBySession,[e]:n.asOfSeq},Hh[e]=n.epoch,Ly(),hi&&(hi.seedSnapshot(e,n),hi.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),y4(e)),zh.delete(e),mde(e),"ok"}catch(t){return ide(t)?(await hde(e),"not-found"):(Wh("getSessionSnapshot",t,{title:Un.global.t("warnings.sessionSnapshotTitle"),message:Un.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const gde=gce(Py);function vde(e){return Object.prototype.hasOwnProperty.call(be.messagesBySession,e)}const yde=4,ji=[],zh=new Set;function y4(e){const t=ji.indexOf(e);for(t!==-1&&ji.splice(t,1),ji.unshift(e);ji.length>yde;){let n=-1;for(let s=ji.length-1;s>=0;s--)if(ji[s]!==be.activeSessionId){n=s;break}if(n===-1)break;const[o]=ji.splice(n,1);if(o===void 0)break;hi?.unsubscribe(o),zh.add(o)}}function kde(e){const t=ji.indexOf(e);t!==-1&&ji.splice(t,1),zh.delete(e)}function bde(e){if(Ly(),hi){Qu.flush();const t=be.lastSeqBySession[e]??0,n=Hh[e];hi.subscribe(e,{seq:t,epoch:n}),y4(e)}}async function _de(e){return zh.has(e)?Py(e):(bde(e),"ok")}function Uh(e){const t=be.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Fo.sideChatTargetBySession.value[e]?.agentId,s=(be.tasksBySession[e]??[]).filter(i=>i.status==="running");return s.length===0?!(n&&be.sideChatSendingByAgent[n]):s.some(i=>i.id!==n)}function Ry(e,t){try{const n=new Date(e),s=Date.now()-n.getTime(),i=s/36e5;if(s<6e4)return Un.global.t("sessions.justNow");if(i<1)return`${Math.round(s/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=s/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}m`:`${Math.round(r/365)}y`}catch{return e}}const wde=3e4,Zu=Z(0);let vv=null;function Sde(){vv===null&&(vv=setInterval(()=>{Zu.value=(Zu.value+1)%Number.MAX_SAFE_INTEGER},wde),vv.unref?.())}function Cde(e,t){const n=e.split(`
|
|
278
|
-
`),o=t.split(`
|
|
279
|
-
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function xde(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:Cde(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Ade(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 Tde(e){const t=be.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function Mde(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=Un.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=Un.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??Tde(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const Ede=F(()=>{const e=be.sessions.find(n=>n.id===be.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:be.workspaceName,branch:t}}),Ide=F(()=>(Zu.value,be.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Ry(e.updatedAt,e.status),status:e.status,busy:Uh(e.id)})))),$de=F(()=>be.activeSessionId??""),Nde=F(()=>{const e=be.activeSessionId;return e?Wn.skillsBySession.value[e]??[]:[]}),Lde=F(()=>{const e=be.activeSessionId;return e?be.sendingBySession[e]??!1:!1}),Fo=pue(be,{pushOperationFailure:Wh,nextOptimisticMsgId:m4,connectEventsIfNeeded:Ly,getEventConn:()=>hi}),md=F(()=>{const e=be.activeSessionId;if(!e)return[];const t=Fo.sideChatTargetBySession.value[e]?.agentId;return(be.tasksBySession[e]??[]).filter(n=>n.id!==t)}),k4=Pce(be,md),Ode=F(()=>{const e=be.activeSessionId;if(!e)return[];const t=new Set(be.sideChatUserMessageIdsBySession[e]??[]),n=(be.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=be.approvalsBySession[e]??[];return j3(n,o,s=>dt().getFileUrl(s),qh.value!=="idle",md.value,be.planReviewByToolCallId)}),Pde=F(()=>(k4.taskClock.value,md.value.map(Mde))),b4=F(()=>Wce(md.value)),La=F(()=>{const e=be.activeSessionId;return e?be.goalBySession[e]??null:null}),Rde=F(()=>{const e=be.activeSessionId;return e?Pue(be.messagesBySession[e]??[]):[]}),Dde=F(()=>{const e=be.activeSessionId;return e?be.compactionBySession[e]??null:null}),Bde=F(()=>be.connection),Fde=F(()=>be.loading),Hde=F(()=>be.sessionLoading),Wde=F(()=>{const e=be.activeSessionId;return e?be.messagesLoadingMoreBySession[e]??!1:!1}),zde=F(()=>{const e=be.activeSessionId;return e?be.messagesHasMoreBySession[e]??!1:!1}),Ude=F(()=>{const e=be.activeSessionId;return e?be.messagesLoadMoreErrorBySession[e]??!1:!1}),qde=F(()=>be.serverVersion),jde=F(()=>be.dangerousBypassAuth);function Vde(){be.dangerousBypassAuth=!1}const Kde=F(()=>be.permission),Gde=F(()=>be.thinking),_4=F(()=>{const e=be.activeSessionId;return e?be.planModeBySession[e]??!1:Rh.planMode}),Yde=F(()=>{const e=be.activeSessionId;return e?be.swarmModeBySession[e]??!1:Rh.swarmMode}),Xde=F(()=>{const e=be.activeSessionId;return e?be.goalModeBySession[e]??!1:Rh.goalMode}),Qde=F(()=>{const e=zce(b4.value);return{plan:_4.value,goal:La.value&&La.value.status!=="complete"?{status:La.value.status,turnsUsed:La.value.turnsUsed,elapsedMs:La.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Zde=F(()=>{const e=be.activeSessionId;if(!e)return[];const t=dt();return(be.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId)}))}))}),Jde=F(()=>be.warnings),efe=F(()=>{const e=be.activeSessionId;return e?(be.questionsBySession[e]??[]).map(Ade):[]}),tfe=F(()=>{const e=be.activeSessionId;return e?(be.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:xde(t),agentName:t.agentName})):[]}),qh=F(()=>{const e=be.activeSessionId;return e?(be.approvalsBySession[e]??[]).length>0?"awaiting-approval":(be.questionsBySession[e]??[]).length>0?"awaiting-question":Uh(e)?"running":"idle":"idle"}),Wn=Bce(be,{pushOperationFailure:Wh,refreshSessionStatus:Bh,persistSessionProfile:d4,activity:qh,inFlightPromptSessions:Fh,saveThinkingToStorage:Hue,updateSession:Dh,updateSessionMessages:i4}),Up=F(()=>{const e=be.activeSessionId;if(!e)return null;const t=be.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),nfe=F(()=>{const e=be.activeSessionId;return e?be.gitStatusBySession[e]?.pullRequest??null:null}),ofe=F(()=>{const e=be.activeSessionId;if(!e)return[];const t=be.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),sfe=F(()=>{const e=be.activeSessionId;if(!e)return null;const t=be.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),w4=F(()=>{const e=be.sessions.find(r=>r.id===be.activeSessionId),t=Up.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Wn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??be.defaultModel)??"—",s=Wn.models.value.find(r=>r.id===o||r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:be.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Up.value!==null}}),ife=F(()=>a4.value),rfe=F(()=>be.sessions.find(t=>t.id===be.activeSessionId)?.usage.totalCostUsd??0),lfe=F(()=>be.authReady),afe=F(()=>be.defaultModel),cfe=F(()=>be.managedProviderStatus),ufe=F(()=>be.config),dfe=F(()=>{const e=be.activeSessionId;if(!e)return{};const t=be.gitStatusBySession[e];return t?{...t.entries}:{}});function pc(e){return be.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const Dy=F(()=>mce({workspaces:be.workspaces,sessions:be.sessions,hiddenWorkspaceRoots:be.hiddenWorkspaceRoots,activeRoot:be.sessions.find(e=>e.id===be.activeSessionId)?.cwd,activeBranch:Up.value?.branch??null,sessionsHasMoreByWorkspace:be.sessionsHasMoreByWorkspace})),qp=Z(b5()),hc=Z(_5()==="manual"?"manual":"recent");Ke(()=>[Dy.value.map(e=>e.id).join("\0"),be.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=L5(n,qp.value);o!==null&&(qp.value=o,kA(o))});const Yl=F(()=>{const e=Dy.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:jue(t.root,be.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(hc.value==="recent"){const t=new Map;for(const n of be.sessions){if(n.parentSessionId)continue;const o=pc(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return R5(e,t)}return O5(e,qp.value)}),S4=F(()=>{const e=be.activeWorkspaceId,t=Yl.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),ffe=F(()=>{const e=S4.value;return e?Yl.value.find(t=>t.id===e)??null:null}),pfe=F(()=>{Zu.value;const e=new Set(Yl.value.map(n=>n.id)),t=new Map(Yl.value.map(n=>[n.id,n.name]));return be.sessions.filter(n=>!n.parentSessionId&&e.has(pc(n))).map(n=>{const o=pc(n);return{id:n.id,title:n.title,time:Ry(n.updatedAt,n.status),status:n.status,busy:Uh(n.id),lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),hfe=F(()=>{Zu.value;const e=new Map;for(const t of be.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=pc(t),o={id:t.id,title:t.title,time:Ry(t.updatedAt,t.status),status:t.status,busy:Uh(t.id),updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Yl.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:be.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:be.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:be.sessionsInitialCountByWorkspace[t.id]??W1}))});function mfe(e){qp.value=e,kA(e),hc.value!=="manual"&&(hc.value="manual",bA("manual"))}function gfe(e){hc.value!==e&&(hc.value=e,bA(e))}const C4=F(()=>{const e={};for(const[t,n]of Object.entries(be.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(be.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),vfe=F(()=>{const e={};for(const[t,n]of Object.entries(be.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(be.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),yfe=F(()=>{const e={};for(const[t,n]of Object.entries(be.unreadBySession))n&&(e[t]=!0);return e}),kfe=F(()=>{const e={},t=C4.value;for(const n of be.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=pc(n);e[s]=(e[s]??0)+o}return e}),bfe=F(()=>be.recentRoots),_fe=F(()=>be.availableOpenInApps),gt=Sue(be,{taskPoller:k4,sideChat:Fo,modelProvider:Wn,pushOperationFailure:Wh,activity:qh,inFlightPromptSessions:Fh,sessionsKnownEmpty:g4,setSessions:o4,updateSession:Dh,upsertSessionFront:Vue,appendSession:Kue,forgetSession:r4,setActiveSessionId:Ny,updateSessionMessages:i4,nextOptimisticMsgId:m4,getEventConn:()=>hi,syncSessionFromSnapshot:Py,reopenSession:_de,hasLoadedMessages:vde,refreshSessionStatus:Bh,persistSessionProfile:d4,mergedWorkspaces:Dy,workspacesView:Yl,status:w4,workspaceIdForSession:pc,savePermissionToStorage:Bue,savePlanModeToStorage:J3,saveSwarmModeToStorage:e4,saveGoalModeToStorage:t4,draftModes:Rh,saveUnread:w0,saveActiveWorkspaceToStorage:que,saveHiddenWorkspacesToStorage:Uue,goalErrorMessage:pde,resetFastMoon:Ei.resetFastMoon,initialized:u4,selectedDiffPath:l4,fileDiffLines:a4,fileDiffLoading:c4});function wfe(e,t){if(Fh.delete(e),be.sendingBySession={...be.sendingBySession,[e]:!1},be.promptIdBySession[e]!==void 0){const i={...be.promptIdBySession};delete i[e],be.promptIdBySession=i}e===be.activeSessionId?(Ei.resetFastMoon(),gt.loadGitStatus(e),Bh(e)):t==="idle"&&(be.unreadBySession={...be.unreadBySession,[e]:!0},w0({[e]:!0})),Ol.maybeNotifyCompletion(e,{isActiveAndVisible:e===be.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:be.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{gt.selectSession(e)}}),t==="idle"&&zp.maybePlayCompletionSound();const n=be.queuedBySession[e]??[];if(n.length===0)return;const[o,...s]=n;be.queuedBySession={...be.queuedBySession,[e]:s},o!==void 0&>.submitPromptInternal(e,o.text,o.attachments).then(i=>{if(!i){const r=be.queuedBySession[e]??[];be.queuedBySession={...be.queuedBySession,[e]:[o,...r]}}})}function Sfe(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Ol.maybeNotifyQuestion(e,{isActiveAndVisible:e===be.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:be.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{gt.selectSession(e)}}),zp.maybePlayQuestionSound()}function Cfe(){return Sde(),{workspace:Ede,sessions:Ide,activeSessionId:$de,workspacesView:Yl,workspaceSortMode:hc,visibleWorkspace:ffe,activeWorkspaceId:S4,sessionsForView:pfe,workspaceGroups:hfe,attentionBySession:C4,pendingBySession:vfe,attentionByWorkspace:kfe,unreadBySession:yfe,recentRoots:bfe,turns:Ode,tasks:Pde,activeAppTasks:md,todos:Rde,goal:La,swarms:b4,activationBadges:Qde,compaction:Dde,status:w4,sessionCost:rfe,fileDiff:ife,selectedDiffPath:l4,fileDiffLoading:c4,changes:ofe,gitInfo:Up,gitDiffStats:sfe,activePullRequest:nfe,changesByPath:dfe,pendingApprovals:tfe,availableOpenInApps:_fe,connection:Bde,loading:Fde,sessionLoading:Hde,loadingMoreMessages:Wde,hasMoreMessages:zde,loadMoreMessagesError:Ude,serverVersion:qde,dangerousBypassAuth:jde,clearDangerousBypassAuth:Vde,initialized:u4,permission:Kde,thinking:Gde,planMode:_4,swarmMode:Yde,goalMode:Xde,queued:Zde,warnings:Jde,questions:efe,activity:qh,isSending:Lde,fastMoon:Ei.fastMoon,models:Wn.models,starredModelIds:Wn.starredModelIds,providers:Wn.providers,uiFontSize:Ei.uiFontSize,setUiFontSize:Ei.setUiFontSize,conversationToc:p4,setConversationToc:ede,colorScheme:Ei.colorScheme,setColorScheme:Ei.setColorScheme,accent:Ei.accent,setAccent:Ei.setAccent,notifyOnComplete:Ol.notifyOnComplete,notifyOnQuestion:Ol.notifyOnQuestion,notifyPermission:Ol.notifyPermission,setNotifyOnComplete:Ol.setNotifyOnComplete,setNotifyOnQuestion:Ol.setNotifyOnQuestion,soundOnComplete:zp.soundOnComplete,setSoundOnComplete:zp.setSoundOnComplete,onboarded:h4,setOnboarded:nde,load:gt.load,selectSession:gt.selectSession,clearActiveSession:gt.clearActiveSession,loadOlderMessages:gt.loadOlderMessages,loadWorkspaces:gt.loadWorkspaces,loadMoreSessions:gt.loadMoreSessions,loadAllSessions:gt.loadAllSessions,selectWorkspace:gt.selectWorkspace,openWorkspace:gt.openWorkspace,openWorkspaceDraft:gt.openWorkspaceDraft,startSessionAndSendPrompt:gt.startSessionAndSendPrompt,addWorkspaceByPath:gt.addWorkspaceByPath,browseFs:gt.browseFs,getFsHome:gt.getFsHome,sendPrompt:gt.sendPrompt,steerPrompt:gt.steerPrompt,sideChatVisible:Fo.sideChatVisible,sideChatSessionId:Fo.sideChatSessionId,sideChatTurns:Fo.sideChatTurns,sideChatRunning:Fo.sideChatRunning,sideChatSending:Fo.sideChatSending,openSideChat:Fo.openSideChat,closeSideChat:Fo.closeSideChat,sendSideChatPrompt:Fo.sendSideChatPrompt,uploadImage:gt.uploadImage,abortCurrentPrompt:gt.abortCurrentPrompt,respondApproval:gt.respondApproval,respondQuestion:gt.respondQuestion,dismissQuestion:gt.dismissQuestion,pendingQuestionActions:gt.pendingQuestionActions,pendingApprovalActions:gt.pendingApprovalActions,cancelTask:gt.cancelTask,setPermission:gt.setPermission,setThinking:Wn.setThinking,setPlanMode:gt.setPlanMode,togglePlanMode:gt.togglePlanMode,setSwarmMode:gt.setSwarmMode,toggleSwarmMode:gt.toggleSwarmMode,setGoalMode:gt.setGoalMode,toggleGoalMode:gt.toggleGoalMode,createGoal:gt.createGoal,controlGoal:gt.controlGoal,enqueue:gt.enqueue,dismissWarning:gt.dismissWarning,renameSession:gt.renameSession,renameWorkspace:gt.renameWorkspace,deleteWorkspace:gt.deleteWorkspace,reorderWorkspaces:mfe,setWorkspaceSortMode:gfe,archiveSession:gt.archiveSession,compact:gt.compact,forkSession:gt.forkSession,undo:gt.undo,unqueue:gt.unqueue,reorderQueue:gt.reorderQueue,searchFiles:gt.searchFiles,loadGitStatus:gt.loadGitStatus,loadFileDiff:gt.loadFileDiff,clearFileDiff:gt.clearFileDiff,listDir:gt.listDir,readFileContent:gt.readFileContent,getFileDownloadUrl:gt.getFileDownloadUrl,openWorkspaceFile:gt.openWorkspaceFile,openInApp:gt.openInApp,revealWorkspaceFile:gt.revealWorkspaceFile,resolveImageUrl:gt.resolveImageUrl,refreshOAuthProviderModels:Wn.refreshOAuthProviderModels,loadModels:Wn.loadModels,loadProviders:Wn.loadProviders,skills:Nde,activateSkill:Wn.activateSkill,setModel:Wn.setModel,toggleStarModel:Wn.toggleStarModel,addProvider:Wn.addProvider,deleteProvider:Wn.deleteProvider,refreshProvider:Wn.refreshProvider,refreshAllProviders:Wn.refreshAllProviders,authReady:lfe,defaultModel:afe,managedProviderStatus:cfe,config:ufe,updateConfig:gt.updateConfig,checkAuth:gt.checkAuth,startOAuthLogin:Wn.startOAuthLogin,pollOAuthLogin:Wn.pollOAuthLogin,cancelOAuthLogin:Wn.cancelOAuthLogin,logout:gt.logout}}function xfe({client:e,authLogoRef:t}){const n=F(()=>e.authReady.value),o=F(()=>e.initialized.value&&!n.value),s="/login",i=Z(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)}Ke(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return kn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function Afe({running:e,showAuthGate:t}){const{t:n}=It(),o=["◐","◓","◑","◒"],s=Z(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}Ke(e,c=>{c?r():l()},{immediate:!0});const a=F(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});mI(()=>{typeof document<"u"&&(document.title=a.value)}),kn(()=>{l()})}const x4=Z(typeof window>"u"?0:window.innerWidth);let _f=0,jp=!1;function z1(){x4.value=window.innerWidth}function Tfe(){jp||typeof window>"u"||(window.addEventListener("resize",z1),jp=!0,z1())}function Mfe(){!jp||typeof window>"u"||(window.removeEventListener("resize",z1),jp=!1)}function A4(e,t,n){return Math.max(t,e-n)}function U1(e,t,n){return Math.min(n,Math.max(t,e))}function T4(){return hn(()=>{_f+=1,Tfe()}),lo(()=>{_f=Math.max(0,_f-1),_f===0&&Mfe()}),{viewportWidth:x4}}const Efe="kimi-web.file-preview-width",Oa=320;function Ife({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=T4(),i=F(()=>Math.max(0,s.value-t.value)),r=F(()=>A4(i.value,Oa,Oa));function l(ne){return U1(Math.round(ne),Oa,r.value)}function a(){return l(i.value/2)}const c=F(()=>a()),u=Z(c.value),d=F(()=>U1(u.value,Oa,r.value)),p=Z(null),h=F(()=>{const ne=p.value;if(!ne)return null;const J=e.turns.value.find(ce=>ce.id===ne.turnId)?.blocks?.[ne.blockIndex];return J?.kind==="thinking"?J.thinking:null}),f=F(()=>h.value!==null);function m(ne){const H=p.value;if(H&&H.turnId===ne.turnId&&H.blockIndex===ne.blockIndex){p.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",p.value=ne}function b(){p.value=null,n.value==="thinking"&&(n.value=null)}const _=Z(null),g=F(()=>{const ne=_.value;if(!ne)return null;const H=e.turns.value.find(J=>J.id===ne.turnId);return H?.role==="compaction"&&H.text?H.text:null}),v=F(()=>g.value!==null);function y(ne){if(_.value?.turnId===ne.turnId){_.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",_.value=ne}function A(){_.value=null,n.value==="compaction"&&(n.value=null)}const O=Z(null);function $(ne){const H=e.activeAppTasks.value,J=H.find(te=>te.id===ne)??H.find(te=>te.parentToolCallId===ne);if(J)return J.id;const ce=H.filter(te=>te.kind==="subagent"&&!te.parentToolCallId);if(ce.length===1)return ce[0].id}const k=F(()=>{const ne=O.value;if(!ne)return null;const H=e.activeAppTasks.value.find(J=>J.id===ne.subagentId);return H?iue(H):null}),E=F(()=>k.value!==null);function M(ne){const H=$(ne);if(H){if(O.value?.subagentId===H){O.value=null,n.value==="agent"&&(n.value=null);return}O.value={subagentId:H},n.value="agent"}}function L(){O.value=null,n.value==="agent"&&(n.value=null)}const S=Z(null),I=F(()=>{const ne=S.value;if(!ne)return null;const H=cP(e.turns.value,ne);return H?{id:ne,title:rd(H.name),path:aP(H.arg),lines:H.status==="error"?null:$A(H),output:H.output}:null}),P=F(()=>I.value!==null);function D(ne){if(n.value==="toolDiff"&&S.value===ne){W();return}n.value="toolDiff",S.value=ne}function W(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const z=Z("list"),q=Z(null);function Q(){if(n.value==="diff"){X();return}n.value="diff",z.value="list",q.value=null,e.loadGitStatus(e.activeSessionId.value)}function X(){n.value==="diff"&&(n.value=null),z.value="list",q.value=null,e.clearFileDiff()}async function fe(ne){z.value="detail",q.value=ne,await e.loadFileDiff(ne)}async function ye(ne){await e.openSideChat(ne),n.value="btw"}function Me(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function we(){n.value==="btw"&&(n.value=null)}const ze=F(()=>e.sideChatVisible.value),Ue=F(()=>n.value!==null&&(n.value!=="thinking"||f.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||P.value)&&(n.value!=="btw"||ze.value)),Fe=Z(!1),rt=Z({});function le(){switch(n.value){case"thinking":return p.value?{kind:"thinking",...p.value}:null;case"compaction":return _.value?{kind:"compaction",..._.value}:null;case"agent":return O.value?{kind:"agent",...O.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function U(ne){if(ne)switch(ne.kind){case"thinking":p.value={turnId:ne.turnId,blockIndex:ne.blockIndex},n.value="thinking";break;case"compaction":_.value={turnId:ne.turnId},n.value="compaction";break;case"agent":O.value={subagentId:ne.subagentId},n.value="agent";break;case"toolDiff":S.value=ne.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function G(){return n.value==="thinking"&&f.value?(b(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&E.value?(L(),!0):n.value==="toolDiff"&&P.value?(W(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(X(),!0):n.value==="btw"?(Me(),!0):!1}return Ke(e.activeSessionId,(ne,H)=>{if(H){const J=le();J?rt.value[H]=J:delete rt.value[H]}o(),b(),A(),L(),W(),X(),we(),ne&&U(rt.value[ne])}),{PREVIEW_WIDTH_KEY:Efe,PREVIEW_MIN:Oa,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:f,openThinkingPanel:m,closeThinkingPanel:b,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:A,agentPanelMember:k,agentPanelVisible:E,openAgentPanel:M,closeAgentPanel:L,toolDiffTarget:I,toolDiffVisible:P,openToolDiff:D,closeToolDiff:W,detailDiffMode:z,detailDiffPath:q,openDiffDetail:Q,closeDiffDetail:X,selectDiffFile:fe,btwVisible:ze,openSideChatTab:ye,closeSideChat:Me,hideSideChatPanel:we,sidePanelVisible:Ue,panelDragging:Fe,closeOpenSidePanel:G}}const $fe=Et.sidebarWidth,dC=Et.sidebarCollapsed,fC=270,yv=170,Nfe=36,Lfe=320;function Ofe(e={}){const{viewportWidth:t}=T4(),n=Z(fC),o=Z(!1),s=F(()=>{const c=Lfe+(RC(e.previewOpen)?Oa:0);return A4(t.value,yv,c)}),i=F(()=>o.value?Nfe:U1(n.value,yv,s.value));function r(){try{o.value=Qn(dC)==="true"}catch{o.value=!1}}function l(){try{to(dC,String(o.value))}catch{}}function a(){o.value=!o.value,l()}return{SIDEBAR_WIDTH_KEY:$fe,SIDEBAR_DEFAULT:fC,SIDEBAR_MIN:yv,sidebarMax:s,sessionColWidth:n,sidebarCollapsed:o,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function Pfe({client:e,detailTarget:t}){const{t:n}=It(),o=Z(null),s=Z(null),i=Z(!1),r=Z(null),l=Z(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=F(()=>{const $=l.value;return $?e.getFileDownloadUrl($):null}),p=F(()=>o.value!==null);function h($){return $.length>1?$.replace(/\/+$/,""):$}function f($){const k=[];for(const E of $.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){k.pop();continue}k.push(E)}return k.join("/")}function m($){const k=$.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 E=h(e.status.value.cwd);if(k.startsWith("/")){if(!E||k!==E&&!k.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const L=k===E?"":k.slice(E.length+1);if(L.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=f(L);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const M=f(k);return M?{path:M}:{error:n("filePreview.errors.emptyPath")}}async function b($){const k=o.value;if(t.value==="file"&&k&&k.path===$.path&&k.line===$.line){y();return}const E=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=$,l.value=null;const M=m($.path);if("error"in M){i.value=!1,r.value=M.error;return}l.value=M.path;try{const L=await e.readFileContent(M.path);if(E!==a)return;L?s.value={...L,path:L.path||M.path}:s.value={path:M.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(L){if(E!==a)return;r.value=L instanceof Error?L.message:n("filePreview.errors.loadFailed")}finally{E===a&&(i.value=!1)}}function _($){return/^data:([^;,]+)/i.exec($)?.[1]}function g($){if($.kind!=="image")return;const k=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const E={path:$.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:$.mimeType??_($.url)??"image/*",isBinary:!0,size:$.bytes??0};$.fileId?(i.value=!0,s.value=E,dt().getFileBlob($.fileId).then(M=>{if(k===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(M),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{k===a&&(s.value&&(s.value={...s.value,sourceUrl:$.url}),i.value=!1)})):(i.value=!1,s.value={...E,sourceUrl:$.url})}function v(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Ke(t,($,k)=>{k==="file"&&$!=="file"&&v()});function A(){const $=s.value?.path??o.value?.path;$&&e.openWorkspaceFile($,o.value?.line)}function O(){const $=s.value?.path??o.value?.path;$&&e.revealWorkspaceFile($)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:p,openFilePreview:b,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:A,revealPreviewFile:O}}const Rfe=640,Dfe=`(max-width: ${Rfe}px)`;function Bfe(){const e=Z(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Dfe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),kn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),kn(()=>t.removeListener(n))),e}const Ffe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Hfe={class:"server-auth-card"},Wfe={class:"server-auth-body"},zfe={class:"server-auth-foot"},Ufe=je({__name:"ServerAuthDialog",setup(e){const t=Z(""),n=Z(null),o=Z(!1);hn(()=>{ht(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,b3(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(w(),N("div",Ffe,[T("div",Hfe,[l[1]||(l[1]=T("div",{class:"server-auth-head"},[T("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),T("p",{class:"server-auth-hint"},[qe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),T("code",null,"KIMI_CODE_PASSWORD"),qe("). ")])],-1)),T("div",Wfe,[se(oc,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),T("div",zfe,[se(Rt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:_e(()=>[qe(R(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),qfe=ut(Ufe,[["__scopeId","data-v-82150ea4"]]),jfe={class:"app-shell"},Vfe={key:1,class:"auth-page"},Kfe={class:"auth-page-inner"},Gfe={class:"auth-page-copy"},Yfe={key:0,class:"sidebar-rail"},Xfe=["aria-label","aria-hidden"],Qfe=je({__name:"App",setup(e){const t=yG(),n=Z(!t);let o=null;const s=Cfe(),i=F(()=>!s.dangerousBypassAuth.value&&n.value);En("resolveImage",s.resolveImageUrl);const{t:r}=It(),l=vi(),a=Bfe(),c=Z(!1),u=Z(!1),d=F(()=>{const ft=s.activeSessionId.value;return s.sessions.value.find(me=>me.id===ft)?.title??""}),p=F(()=>s.visibleWorkspace.value?.sessionCount??0),h=F(()=>s.activity.value!=="idle"),f=Z(null),{showAuthGate:m,blinkAuthLogo:b}=xfe({client:s,authLogoRef:f});Afe({running:h,showAuthGate:m});function _(ft){const me=s.status.value.modelId??s.status.value.model??"",Ne=s.models.value.find(xe=>xe.id===me||xe.model===me||xe.displayName===s.status.value.model),xn=by(Ne),So=fc(Ne,ft),oe=xn.indexOf(So),Ce=xn[(oe+1)%xn.length]??xn[0]??"off";return _y(Ne,Ce)}const g=Z(!s.onboarded.value);function v(){s.setOnboarded(!0),g.value=!1}function y(){g.value=!0}hn(()=>{s.load(),Fe(),document.addEventListener("keydown",A,!0),o=bG(()=>{n.value=!0,s.clearDangerousBypassAuth()})}),kn(()=>{document.removeEventListener("keydown",A,!0),o!==null&&(o(),o=null)});function A(ft){ft.key==="Escape"&&(Nn.value||ot()&&(ft.stopPropagation(),ft.preventDefault()))}const O=Z(null),$=Z(!1);Ke(s.activeSessionId,()=>{$.value=!0,ht(()=>{$.value=!1})});const{previewTarget:k,previewFile:E,previewLoading:M,previewError:L,previewDownloadUrl:S,previewExternalActions:I,openFilePreview:P,openMediaPreview:D,closeFilePreview:W,openPreviewInEditor:z,revealPreviewFile:q}=Pfe({client:s,detailTarget:O}),Q=F(()=>O.value!==null),{SIDEBAR_WIDTH_KEY:X,SIDEBAR_DEFAULT:fe,SIDEBAR_MIN:ye,sidebarMax:Me,sessionColWidth:we,sidebarCollapsed:ze,sideWidth:Ue,loadSidebarCollapsed:Fe,toggleSidebarCollapse:rt}=Ofe({previewOpen:Q}),{PREVIEW_WIDTH_KEY:le,PREVIEW_MIN:U,previewDefaultWidth:G,previewMax:ne,previewWidth:H,previewPanelWidth:J,thinkingPanelText:ce,thinkingVisible:te,openThinkingPanel:ue,closeThinkingPanel:j,compactionPanelText:Y,compactionPanelVisible:re,openCompactionPanel:ge,closeCompactionPanel:Ae,agentPanelMember:Ie,openAgentPanel:ae,closeAgentPanel:Te,toolDiffTarget:Ve,openToolDiff:tt,closeToolDiff:bt,detailDiffMode:kt,detailDiffPath:Tt,openDiffDetail:Pt,closeDiffDetail:mt,selectDiffFile:Yt,btwVisible:Rn,openSideChatTab:Dn,closeSideChat:Ft,sidePanelVisible:bn,panelDragging:Vn,closeOpenSidePanel:ot}=Ife({client:s,sideWidth:Ue,detailTarget:O,closeFilePreview:W}),In=Z(null),_n=Z(!1),Kn=Z(!1),$n=Z(!1),Ge=Z(!1),Ye=Z(!1),Ct=Z(!1),$t=Z(null),mn=Z(null),Nn=F(()=>Ea.value>0||_n.value||Kn.value||$n.value||Ge.value||Ye.value||Ct.value||g.value||c.value||u.value),tn=Z(!1),Ln=Z(!1),Zn=Z(!1),Mt=Z(!1),uo=Z(!1);async function Xt(){tn.value=!0,Ln.value=!1,_n.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{Ln.value=!0}finally{tn.value=!1}}async function si(){Zn.value=!0,Mt.value=!1,Kn.value=!0;try{await s.loadProviders()}catch{Mt.value=!0}finally{Zn.value=!1}}function _o(){$n.value=!0}async function Ds(ft){_n.value=!1,await s.setModel(ft)}async function ss(ft){await s.addProvider(ft)}async function jo(ft){await s.deleteProvider(ft)}async function is(ft){await s.refreshProvider(ft)}async function Nt(ft){uo.value=!0;try{await s.updateConfig(ft)&&await s.checkAuth()}finally{uo.value=!1}}async function Xe(){return s.startOAuthLogin()}async function st(){return s.pollOAuthLogin()}async function de(){return s.cancelOAuthLogin()}async function pe(){$n.value=!1,await s.checkAuth(),await s.load()}async function Oe(ft){await s.undo(1),await ht(),In.value?.loadComposerForEdit(ft)}function Qt(ft){if(ft==="/compact"||ft.startsWith("/compact ")){s.compact(ft.slice(8).trim()||void 0);return}if(ft==="/swarm"||ft.startsWith("/swarm ")){const me=ft.slice(6).trim();me==="on"?s.setSwarmMode(!0):me==="off"?s.setSwarmMode(!1):me?(s.setSwarmMode(!0),s.sendPrompt(me)):s.toggleSwarmMode();return}if(ft==="/goal"||ft.startsWith("/goal ")){const me=ft.slice(5).trim();me==="pause"||me==="resume"||me==="cancel"?s.controlGoal(me):me?s.createGoal(me):s.toggleGoalMode();return}if(ft==="/btw"||ft.startsWith("/btw ")){const me=ft.slice(4).trim();!me&&s.sideChatVisible.value?Ft():Dn(me||void 0);return}switch(ft){case"/new":case"/clear":ll();break;case"/fork":s.forkSession();break;case"/undo":s.undo();break;case"/permission":{const me=s.permission.value,Ne=me==="manual"?"auto":me==="auto"?"yolo":"manual";s.setPermission(Ne);break}case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(_(s.thinking.value));break;case"/help":s.dismissWarning(-1);break;case"/status":Ye.value=!0;break;case"/model":Xt();break;case"/provider":break;case"/login":_o();break;default:{const me=ft.indexOf(" "),Ne=(me===-1?ft:ft.slice(0,me)).slice(1),xn=me===-1?void 0:ft.slice(me+1).trim()||void 0;Ne&&s.activateSkill(Ne,xn);break}}}function Wt(ft){s.unqueue(ft)}function fo(ft){s.unqueue(ft)}function Bn(ft){s.reorderQueue(ft.from,ft.to)}async function bs(ft){const me=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&me){await s.startSessionAndSendPrompt(me,ft.text,ft.attachments);return}if(!s.activeSessionId.value&&!me){$t.value=ft,Ge.value=!0;return}s.sendPrompt(ft.text,ft.attachments)}async function ii(ft){if(mn.value=null,!await s.addWorkspaceByPath(ft)){mn.value=r("workspace.addFailed");return}Ge.value=!1;const Ne=$t.value;$t.value=null;const xn=s.activeWorkspaceId.value;Ne&&xn&&await s.startSessionAndSendPrompt(xn,Ne.text,Ne.attachments)}function wo(){$t.value=null,mn.value=null,Ge.value=!1}function ta(){ht(()=>{In.value?.focusComposer()})}function ll(){const ft=s.activeWorkspaceId.value;ft?s.openWorkspaceDraft(ft):s.clearActiveSession(),ta()}function al(ft){s.openWorkspaceDraft(ft),ta()}function Po(ft){ft&&window.open(ft,"_blank","noopener")}return(ft,me)=>(w(),N("div",jfe,[i.value?(w(),ve(qfe,{key:0})):ie("",!0),x(m)?(w(),N("section",Vfe,[T("div",Kfe,[(w(),N("svg",{ref_key:"authLogoRef",ref:f,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:me[0]||(me[0]=vt(()=>{},["prevent"])),onClick:me[1]||(me[1]=(...Ne)=>x(b)&&x(b)(...Ne))},[...me[94]||(me[94]=[c0('<defs data-v-14dd9f04><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-14dd9f04><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-14dd9f04></rect><g class="ch-eyes" fill="#000" data-v-14dd9f04><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-14dd9f04></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-14dd9f04></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-14dd9f04></rect>',2)])],544)),T("div",Gfe,[T("h1",null,R(x(r)("app.authPageTitle")),1),T("p",null,R(x(r)("app.authPageMessage")),1)]),se(Rt,{class:"auth-page-btn",variant:"primary",onClick:_o},{default:_e(()=>[se(Je,{name:"log-in",size:"md"}),T("span",null,R(x(r)("app.authPageLogin")),1)]),_:1})])])):(w(),N("div",{key:2,class:Re(["app",{mobile:x(a),"sidebar-collapsed":x(ze)&&!x(a)}]),style:Gt({"--side-w":x(Ue)+"px","--preview-w":x(J)+"px"})},[x(a)?(w(),ve(Dre,{key:1,workspace:x(s).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:x(s).status.value.branch,"session-count":p.value,onOpenSwitcher:me[17]||(me[17]=Ne=>c.value=!0),onOpenSettings:me[18]||(me[18]=Ne=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),N(Le,{key:0},[Mn(se(SL,{"col-width":x(Ue),"active-workspace":x(s).visibleWorkspace.value,"active-workspace-id":x(s).activeWorkspaceId.value,sessions:x(s).sessionsForView.value,groups:x(s).workspaceGroups.value,"active-id":x(s).activeSessionId.value,"attention-by-session":x(s).attentionBySession.value,"pending-by-session":x(s).pendingBySession.value,"unread-by-session":x(s).unreadBySession.value,"workspace-sort-mode":x(s).workspaceSortMode.value,onSelect:me[2]||(me[2]=Ne=>x(s).selectSession(Ne)),onCreate:ll,onCreateInWorkspace:me[3]||(me[3]=Ne=>al(Ne)),onSelectWorkspace:me[4]||(me[4]=Ne=>x(s).openWorkspace(Ne)),onAddWorkspace:me[5]||(me[5]=Ne=>Ge.value=!0),onRename:me[6]||(me[6]=(Ne,xn)=>x(s).renameSession(Ne,xn)),onArchive:me[7]||(me[7]=Ne=>x(s).archiveSession(Ne)),onFork:me[8]||(me[8]=Ne=>x(s).forkSession(Ne)),onRenameWorkspace:me[9]||(me[9]=(Ne,xn)=>x(s).renameWorkspace(Ne,xn)),onDeleteWorkspace:me[10]||(me[10]=Ne=>x(s).deleteWorkspace(Ne)),onReorderWorkspaces:me[11]||(me[11]=Ne=>x(s).reorderWorkspaces(Ne)),onSetWorkspaceSortMode:me[12]||(me[12]=Ne=>x(s).setWorkspaceSortMode(Ne)),onLoadMoreSessions:me[13]||(me[13]=Ne=>void x(s).loadMoreSessions(Ne)),onLoadAllSessions:me[14]||(me[14]=Ne=>void x(s).loadAllSessions()),onOpenSettings:me[15]||(me[15]=Ne=>Ct.value=!0),onCollapse:x(rt)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),[[Qs,!x(ze)]]),Mn(se(L_,{"storage-key":x(X),"default-width":x(fe),min:x(ye),max:x(Me),"onUpdate:width":me[16]||(me[16]=Ne=>we.value=Ne)},null,8,["storage-key","default-width","min","max"]),[[Qs,!x(ze)]]),x(ze)?(w(),N("div",Yfe,[se(gn,{size:"sm",label:x(r)("sidebar.expandSidebar"),onClick:x(rt)},{default:_e(()=>[se(Je,{name:"panel-expand",size:"sm"})]),_:1},8,["label","onClick"])])):ie("",!0)],64)),se(vee,{ref_key:"conversationPaneRef",ref:In,mobile:x(a),turns:x(s).turns.value,"session-id":x(s).activeSessionId.value,approvals:x(s).pendingApprovals.value,changes:x(s).changes.value,"git-info":x(s).gitInfo.value,tasks:x(s).tasks.value,todos:x(s).todos.value,goal:x(s).goal.value,swarms:x(s).swarms.value,"activation-badges":x(s).activationBadges.value,status:x(s).status.value,thinking:x(s).thinking.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,"goal-mode":x(s).goalMode.value,models:x(s).models.value,"starred-ids":x(s).starredModelIds.value,skills:x(s).skills.value,questions:x(s).questions.value,"pending-question-actions":x(s).pendingQuestionActions,"pending-approval-actions":x(s).pendingApprovalActions,running:h.value,queued:x(s).queued.value,"search-files":x(s).searchFiles,"upload-image":x(s).uploadImage,sending:x(s).isSending.value,"fast-moon":x(s).fastMoon.value,"file-reload-key":x(s).activeSessionId.value,"session-loading":x(s).sessionLoading.value,compaction:x(s).compaction.value,"has-more-messages":x(s).hasMoreMessages.value,"loading-more":x(s).loadingMoreMessages.value,"loading-more-error":x(s).loadMoreMessagesError.value,"load-older-messages":x(s).loadOlderMessages,"workspace-name":x(s).visibleWorkspace.value?.name,"workspace-root":x(s).visibleWorkspace.value?.root??x(s).status.value.cwd,"git-diff-stats":x(s).gitDiffStats.value,workspaces:x(s).workspacesView.value,"active-workspace-id":x(s).activeWorkspaceId.value,"session-title":d.value,pr:x(s).activePullRequest.value,"conversation-toc":x(s).conversationToc.value,onOpenChanges:me[19]||(me[19]=Ne=>x(Pt)()),onSelectWorkspace:me[20]||(me[20]=Ne=>al(Ne)),onAddWorkspace:me[21]||(me[21]=Ne=>Ge.value=!0),onOpenPr:Po,onSubmit:me[22]||(me[22]=Ne=>bs(Ne)),onSteer:me[23]||(me[23]=Ne=>x(s).steerPrompt(Ne.text,Ne.attachments)),onApproval:me[24]||(me[24]=(Ne,xn)=>x(s).respondApproval(Ne,xn)),onCancelTask:me[25]||(me[25]=Ne=>x(s).cancelTask(Ne)),onAnswer:me[26]||(me[26]=(Ne,xn)=>x(s).respondQuestion(Ne,xn)),onDismiss:me[27]||(me[27]=Ne=>x(s).dismissQuestion(Ne)),onCommand:Qt,onInterrupt:me[28]||(me[28]=Ne=>x(s).abortCurrentPrompt()),onUnqueue:Wt,onEditQueued:fo,onReorderQueue:Bn,onSetPermission:me[29]||(me[29]=Ne=>x(s).setPermission(Ne)),onSetThinking:me[30]||(me[30]=Ne=>x(s).setThinking(Ne)),onTogglePlan:me[31]||(me[31]=Ne=>x(s).togglePlanMode()),onToggleSwarm:me[32]||(me[32]=Ne=>x(s).toggleSwarmMode()),onToggleGoal:me[33]||(me[33]=Ne=>x(s).toggleGoalMode()),onCreateGoal:me[34]||(me[34]=Ne=>x(s).createGoal(Ne)),onControlGoal:me[35]||(me[35]=Ne=>x(s).controlGoal(Ne)),onRefreshGitStatus:me[36]||(me[36]=Ne=>x(s).activeSessionId.value&&x(s).loadGitStatus(x(s).activeSessionId.value)),onRenameSession:me[37]||(me[37]=(Ne,xn)=>x(s).renameSession(Ne,xn)),onForkSession:me[38]||(me[38]=Ne=>x(s).forkSession(Ne)),onArchiveSession:me[39]||(me[39]=Ne=>x(s).archiveSession(Ne)),onCompact:me[40]||(me[40]=Ne=>x(s).compact()),onPickModel:me[41]||(me[41]=Ne=>Xt()),onSelectModel:me[42]||(me[42]=Ne=>x(s).setModel(Ne)),onOpenFile:me[43]||(me[43]=Ne=>x(P)(Ne)),onOpenMedia:me[44]||(me[44]=Ne=>x(D)(Ne)),onOpenThinking:me[45]||(me[45]=Ne=>x(ue)(Ne)),onOpenCompaction:me[46]||(me[46]=Ne=>x(ge)(Ne)),onOpenAgent:me[47]||(me[47]=Ne=>x(ae)(Ne)),onOpenToolDiff:me[48]||(me[48]=Ne=>x(tt)(Ne)),onEditMessage:Oe},null,8,["mobile","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","pending-question-actions","pending-approval-actions","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","conversation-toc"]),x(bn)&&!x(a)?(w(),ve(L_,{key:2,"storage-key":x(le),"default-width":x(G),min:x(U),max:x(ne),reverse:"","aria-label":x(r)("layout.resizePreviewAria"),"onUpdate:width":me[49]||(me[49]=Ne=>H.value=Ne),"onUpdate:dragging":me[50]||(me[50]=Ne=>Vn.value=Ne)},null,8,["storage-key","default-width","min","max","aria-label"])):ie("",!0),!x(a)||x(bn)?(w(),N("aside",{key:3,class:Re(["global-preview",{open:x(bn),mobile:x(a),"no-anim":x(Vn)||$.value}]),role:"complementary","aria-label":x(r)("layout.detailPanelAria"),"aria-hidden":!x(bn)},[O.value==="thinking"&&x(te)?(w(),ve(XS,{key:0,text:x(ce)??"",onClose:x(j)},null,8,["text","onClose"])):O.value==="compaction"&&x(re)?(w(),ve(XS,{key:1,text:x(Y)??"",subtitle:x(r)("conversation.summaryTitle"),onClose:x(Ae)},null,8,["text","subtitle","onClose"])):O.value==="agent"&&x(Ie)?(w(),ve(Bte,{key:2,member:x(Ie),onClose:x(Te)},null,8,["member","onClose"])):O.value==="btw"&&x(Rn)?(w(),ve(ine,{key:3,turns:x(s).sideChatTurns.value,running:x(s).sideChatRunning.value,sending:x(s).sideChatSending.value,onSend:me[51]||(me[51]=Ne=>x(s).sendSideChatPrompt(Ne)),onClose:x(Ft)},null,8,["turns","running","sending","onClose"])):O.value==="diff"?(w(),ve(Lne,{key:4,mode:x(kt),changes:x(s).changes.value,"git-info":x(s).gitInfo.value,"file-diff":x(s).fileDiff.value,"selected-diff-path":x(s).selectedDiffPath.value,"file-diff-loading":x(s).fileDiffLoading.value,closable:"",onOpen:x(Yt),onBack:me[52]||(me[52]=Ne=>{kt.value="list",Tt.value=null,x(s).clearFileDiff()}),onClose:x(mt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):O.value==="toolDiff"&&x(Ve)?(w(),ve(Qte,{key:5,target:x(Ve),onClose:x(bt)},null,8,["target","onClose"])):O.value==="file"?(w(),ve(kte,{key:6,file:x(E),loading:x(M),error:x(L),line:x(k)?.line,"download-url":x(S),closable:"","external-actions":x(I),"open-file":x(P),onClose:x(W),onOpenExternal:x(z),onReveal:x(q)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ie("",!0)],10,Xfe)):ie("",!0),_n.value?(w(),ve(Zne,{key:4,models:x(s).models.value,current:x(s).status.value.modelId,"starred-ids":x(s).starredModelIds.value,loading:tn.value,unavailable:Ln.value,onSelect:me[53]||(me[53]=Ne=>Ds(Ne)),onToggleStar:me[54]||(me[54]=Ne=>x(s).toggleStarModel(Ne)),onClose:me[55]||(me[55]=Ne=>_n.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ie("",!0),Ct.value?(w(),ve(Tie,{key:5,"color-scheme":x(s).colorScheme.value,accent:x(s).accent.value,"ui-font-size":x(s).uiFontSize.value,"auth-ready":x(s).authReady.value,"account-model":x(s).defaultModel.value,notify:x(s).notifyOnComplete.value,"notify-question":x(s).notifyOnQuestion.value,"notify-permission":x(s).notifyPermission.value,sound:x(s).soundOnComplete.value,"conversation-toc":x(s).conversationToc.value,config:x(s).config.value,models:x(s).models.value,"config-saving":uo.value,"server-version":x(s).serverVersion.value,onSetColorScheme:me[56]||(me[56]=Ne=>x(s).setColorScheme(Ne)),onSetAccent:me[57]||(me[57]=Ne=>x(s).setAccent(Ne)),onSetUiFontSize:me[58]||(me[58]=Ne=>x(s).setUiFontSize(Ne)),onSetNotify:me[59]||(me[59]=Ne=>x(s).setNotifyOnComplete(Ne)),onSetNotifyQuestion:me[60]||(me[60]=Ne=>x(s).setNotifyOnQuestion(Ne)),onSetSound:me[61]||(me[61]=Ne=>x(s).setSoundOnComplete(Ne)),onSetConversationToc:me[62]||(me[62]=Ne=>x(s).setConversationToc(Ne)),onUpdateConfig:me[63]||(me[63]=Ne=>Nt(Ne)),onLogin:me[64]||(me[64]=()=>{Ct.value=!1,_o()}),onLogout:x(s).logout,onOpenOnboarding:me[65]||(me[65]=()=>{Ct.value=!1,y()}),onOpenProviders:me[66]||(me[66]=()=>{Ct.value=!1,si()}),onClose:me[67]||(me[67]=Ne=>Ct.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):ie("",!0),Kn.value?(w(),ve(Soe,{key:6,providers:x(s).providers.value,loading:Zn.value,unavailable:Mt.value,onAdd:me[68]||(me[68]=Ne=>ss(Ne)),onRefresh:me[69]||(me[69]=Ne=>is(Ne)),onDelete:me[70]||(me[70]=Ne=>jo(Ne)),onOpenLogin:me[71]||(me[71]=()=>{Kn.value=!1,_o()}),onClose:me[72]||(me[72]=Ne=>Kn.value=!1)},null,8,["providers","loading","unavailable"])):ie("",!0),Ye.value?(w(),ve(gre,{key:7,status:x(s).status.value,thinking:x(s).thinking.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,"cost-usd":x(s).sessionCost.value,onClose:me[73]||(me[73]=Ne=>Ye.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ie("",!0),Ge.value?(w(),ve(ere,{key:8,"browse-fs":x(s).browseFs,"get-fs-home":x(s).getFsHome,"default-path":x(s).visibleWorkspace.value?.root??x(s).status.value.cwd,error:mn.value,onAdd:me[74]||(me[74]=Ne=>ii(Ne)),onClose:wo},null,8,["browse-fs","get-fs-home","default-path","error"])):ie("",!0),se(Gr,{name:"gload-fade"},{default:_e(()=>[x(s).initialized.value?ie("",!0):(w(),ve(Rae,{key:0}))]),_:1}),g.value&&!x(m)?(w(),ve($ae,{key:9,onComplete:v,onSkip:v})):ie("",!0),se(Mre,{warnings:x(s).warnings.value,onDismiss:x(s).dismissWarning},null,8,["warnings","onDismiss"]),x(l)?(w(),ve(fce,{key:10})):ie("",!0),se(sre),x(a)?(w(),ve(rle,{key:11,modelValue:c.value,"onUpdate:modelValue":me[75]||(me[75]=Ne=>c.value=Ne),groups:x(s).workspaceGroups.value,"active-workspace-id":x(s).activeWorkspaceId.value,"active-id":x(s).activeSessionId.value,"attention-by-session":x(s).attentionBySession.value,"attention-by-workspace":x(s).attentionByWorkspace.value,onSelect:me[76]||(me[76]=Ne=>x(s).selectSession(Ne)),onCreate:ll,onCreateInWorkspace:me[77]||(me[77]=Ne=>al(Ne)),onAddWorkspace:me[78]||(me[78]=Ne=>Ge.value=!0),onRename:me[79]||(me[79]=(Ne,xn)=>x(s).renameSession(Ne,xn)),onArchive:me[80]||(me[80]=Ne=>x(s).archiveSession(Ne)),onDeleteWorkspace:me[81]||(me[81]=Ne=>x(s).deleteWorkspace(Ne)),onLoadMore:me[82]||(me[82]=Ne=>void x(s).loadMoreSessions(Ne))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ie("",!0),x(a)?(w(),ve(tae,{key:12,modelValue:u.value,"onUpdate:modelValue":me[83]||(me[83]=Ne=>u.value=Ne),status:x(s).status.value,thinking:x(s).thinking.value,models:x(s).models.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,"color-scheme":x(s).colorScheme.value,"ui-font-size":x(s).uiFontSize.value,"auth-ready":x(s).authReady.value,"conversation-toc":x(s).conversationToc.value,"server-version":x(s).serverVersion.value,onPickModel:me[84]||(me[84]=Ne=>Xt()),onSetThinking:me[85]||(me[85]=Ne=>x(s).setThinking(Ne)),onTogglePlan:me[86]||(me[86]=Ne=>x(s).togglePlanMode()),onToggleSwarm:me[87]||(me[87]=Ne=>x(s).toggleSwarmMode()),onSetPermission:me[88]||(me[88]=Ne=>x(s).setPermission(Ne)),onSetColorScheme:me[89]||(me[89]=Ne=>x(s).setColorScheme(Ne)),onSetUiFontSize:me[90]||(me[90]=Ne=>x(s).setUiFontSize(Ne)),onSetConversationToc:me[91]||(me[91]=Ne=>x(s).setConversationToc(Ne)),onLogin:me[92]||(me[92]=()=>{u.value=!1,_o()}),onLogout:x(s).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ie("",!0)],6)),$n.value?(w(),ve(Joe,{key:3,"on-start-o-auth-login":Xe,"on-poll-o-auth-login":st,"on-cancel-o-auth-login":de,onSuccess:pe,onClose:me[93]||(me[93]=Ne=>$n.value=!1)})):ie("",!0)]))}}),Zfe=ut(Qfe,[["__scopeId","data-v-14dd9f04"]]);fG();ap(Zfe).use(Un).mount("#app");export{NE as $,o0 as A,wI as B,so as C,Qpe as D,kC as E,Le as F,c0 as G,qe as H,se as I,tI as J,wpe as K,ui as L,je as M,G$ as N,Ape as O,Tpe as P,Ipe as Q,qf as R,Ga as S,lh as T,Mpe as U,d0 as V,xpe as W,Jpe as X,Epe as Y,Vpe as Z,epe as _,GC as a,Wo as a$,Oo as a0,V1 as a1,ape as a2,Z1 as a3,y$ as a4,cn as a5,gc as a6,hpe as a7,nhe as a8,ype as a9,JC as aA,LI as aB,FI as aC,hn as aD,BI as aE,DI as aF,K1 as aG,RI as aH,kn as aI,e0 as aJ,rI as aK,w as aL,j$ as aM,fpe as aN,En as aO,DC as aP,dpe as aQ,Yf as aR,No as aS,Vf as aT,Z as aU,Hpe as aV,u6 as aW,nt as aX,Cn as aY,WI as aZ,Spe as a_,_pe as aa,bpe as ab,kpe as ac,zpe as ad,ohe as ae,Ut as af,C$ as ag,ih as ah,Wr as ai,sr as aj,eo as ak,Wpe as al,Ms as am,Kr as an,Dr as ao,Lpe as ap,Ope as aq,dn as ar,ht as as,E$ as at,Re as au,Jfe as av,Gt as aw,NI as ax,PI as ay,lo as az,upe as b,$q as b$,Ype as b0,Eu as b1,tp as b2,Kpe as b3,Vr as b4,QE as b5,npe as b6,Ql as b7,pI as b8,Gpe as b9,ks as bA,Qs as bB,x$ as bC,qpe as bD,Ke as bE,mI as bF,mpe as bG,gI as bH,Rpe as bI,_e as bJ,$pe as bK,Mn as bL,di as bM,Upe as bN,vt as bO,ppe as bP,un as bQ,Qo as bR,phe as bS,bj as bT,zM as bU,mhe as bV,YU as bW,sy as bX,hhe as bY,u1 as bZ,_he as b_,tpe as ba,R as bb,wf as bc,Cpe as bd,Kt as be,ipe as bf,spe as bg,RC as bh,Fpe as bi,ope as bj,x as bk,od as bl,the as bm,Zpe as bn,X$ as bo,gpe as bp,Dpe as bq,hI as br,ehe as bs,Npe as bt,vpe as bu,KC as bv,lp as bw,i6 as bx,Fx as by,Rv as bz,jpe as c,Iq as c0,ty as c1,Eq as c2,uhe as c3,zU as c4,che as c5,Np as c6,rhe as c7,Mq as c8,RM as c9,bhe as ca,lhe as cb,She as cc,g1 as cd,Ha as ce,h1 as cf,Che as cg,whe as ch,fhe as ci,xs as cj,ahe as ck,dhe as cl,QU as cm,khe as cn,m1 as co,p1 as cp,yhe as cq,ihe as cr,vhe as cs,ghe as ct,ut as cu,she as cv,_A as cw,Q5 as cx,Bpe as d,zr as e,rpe as f,Gr as g,J$ as h,lpe as i,cpe as j,ti as k,ed as l,vo as m,Qp as n,ir as o,Xpe as p,F as q,ap as r,ve as s,ie as t,N as u,T as v,c$ as w,Ppe as x,a$ as y,d6 as z};
|