@moonshot-ai/kimi-code 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.mjs +61341 -60031
- package/dist-web/assets/{CodeBlockNode-CHRi13cp.js → CodeBlockNode-CaJnX8WY.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-Bw3zdw7l.js → CodeBlockShell.vue_vue_type_style_index_0_lang-BRgPQSVb.js} +1 -1
- package/dist-web/assets/DesignSystemView-2XTmljim.js +12 -0
- package/dist-web/assets/DesignSystemView-BskvdBnn.css +1 -0
- package/dist-web/assets/{Tooltip-Co8nMusV.js → Tooltip-DZguFKhz.js} +1 -1
- package/dist-web/assets/arc-DtSq864Y.js +1 -0
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-CVGQC8aY.js → architectureDiagram-3BPJPVTR-DMQz4tYy.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-B2akGU98.js → blockDiagram-GPEHLZMM-uiDJjfXs.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-d0Tnj3h7.js → c4Diagram-AAUBKEIU-Dupe9n1b.js} +1 -1
- package/dist-web/assets/channel-DzCUXF8u.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-aLmQ7kE7.js → chunk-2J33WTMH-CAvfdKCa.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-jj7AfMtu.js → chunk-4BX2VUAB-Bqf9QeRR.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DOuxcNQK.js → chunk-55IACEB6-DMDy7rWA.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-ByX_U4aJ.js → chunk-727SXJPM-RW5JVWWF.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-Dwe8AVWQ.js → chunk-AQP2D5EJ-C3cDBsoU.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-D4Su5t72.js → chunk-FMBD7UC4-P4JPvwBw.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-BNRuB-eG.js → chunk-ND2GUHAM-CrF954Ah.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-CfTAMtms.js → chunk-QZHKN3VN-Vs9ezeZH.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-Dk9AsUOO.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Dk9AsUOO.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-Db4x33Cx.js → cose-bilkent-S5V4N54A-COoPAHpC.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-CSVzL3o5.js → dagre-BM42HDAG-BBOPrdG4.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-ChQghRCe.js → diagram-2AECGRRQ-LRx2sTw8.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-CzjFtwV4.js → diagram-5GNKFQAL-DsCaLaVB.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-DzzhiPZ_.js → diagram-KO2AKTUF-C5eIL5L7.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-D_U1BnUF.js → diagram-LMA3HP47-DFMNWSuI.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-BfFICgG3.js → diagram-OG6HWLK6-YtRDbT5E.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-DrJpAckD.js → erDiagram-TEJ5UH35-DcGLpZq8.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-DXu73Cwn.js → flowDiagram-I6XJVG4X-iTJJ8EFf.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-C6uzlaWx.js → ganttDiagram-6RSMTGT7-DQgm6pxo.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-BJs5S8Wt.js → gitGraphDiagram-PVQCEYII-DhCBgkG8.js} +1 -1
- package/dist-web/assets/{index-CZrAeDIj.js → index-CFiJLIKp.js} +2 -2
- package/dist-web/assets/index-CY9IR2gG.js +279 -0
- package/dist-web/assets/index-Cioxfv4p.css +1 -0
- package/dist-web/assets/{index-0aK13Vx6.js → index-DpLAujyX.js} +1 -1
- package/dist-web/assets/{index10-B0hKHFI0.js → index10-Cq9SfqzI.js} +1 -1
- package/dist-web/assets/{index11-97AxRDhM.js → index11-BsI2TwS2.js} +1 -1
- package/dist-web/assets/{index5-Dhi5S4AY.js → index5-D0QCZ2WX.js} +1 -1
- package/dist-web/assets/{index6-Bt9yqgGH.js → index6-BCwMTbX-.js} +1 -1
- package/dist-web/assets/{index7-CnqGakDF.js → index7-ngQ9Fglu.js} +1 -1
- package/dist-web/assets/{index8-Dca1sG3X.js → index8-B8E09VXR.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-Cfn6nswp.js → infoDiagram-5YYISTIA-VG0FT9QF.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BJ-8LuY8.js → ishikawaDiagram-YF4QCWOH-57-3fzN_.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-D1yaSavm.js → journeyDiagram-JHISSGLW-_qj0ZBQM.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-BBFB4HDO.js → kanban-definition-UN3LZRKU-cpqKXF62.js} +1 -1
- package/dist-web/assets/{linear-hHmXIR2Z.js → linear-lEP30Zqf.js} +1 -1
- package/dist-web/assets/{mermaid.core-VDZ71vKz.js → mermaid.core-COCaMagj.js} +66 -66
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-RMoWi0xV.js → mindmap-definition-RKZ34NQL-BTy9wxvg.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-CQ4ZrI1-.js → pieDiagram-4H26LBE5-B9qPVNTt.js} +2 -2
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-Znu_X2s5.js → quadrantDiagram-W4KKPZXB-CIkg17kt.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-VSTs_T7S.js → requirementDiagram-4Y6WPE33-Cp6p0EDe.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DMQVbj0y.js → sankeyDiagram-5OEKKPKP-D4mtZQUj.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-B8CkNeLt.js → sequenceDiagram-3UESZ5HK-CYHpIUE5.js} +1 -1
- package/dist-web/assets/stateDiagram-AJRCARHV-B1Vf-wla.js +1 -0
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BdYtlYmX.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-BhvuXeeE.js → timeline-definition-PNZ67QCA-Dau6vvwN.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-CSNE2nud.js → vennDiagram-CIIHVFJN-DTu2pySe.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-B84GkS0f.js → vue.runtime.esm-bundler-Bd0MpuGP.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-uLQHoAEc.js → wardley-L42UT6IY-CRpR3kk0.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-ChcE1LUX.js → wardleyDiagram-YWT4CUSO-XbULEr5H.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-o26J5Mzy.js → xychartDiagram-2RQKCTM6-C34wLyKM.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +7 -7
- package/dist-web/assets/arc-dY0kCO7r.js +0 -1
- package/dist-web/assets/channel-Bw3RVCmn.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DSr63Xlm.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DSr63Xlm.js +0 -1
- package/dist-web/assets/index-Bfuo9grI.css +0 -1
- package/dist-web/assets/index-_zaDlMUv.js +0 -279
- package/dist-web/assets/stateDiagram-AJRCARHV-Lhe74gFS.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-C4weiutZ.js +0 -1
- package/dist-web/design-system.html +0 -2251
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-CHRi13cp.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-Bw3zdw7l.js","assets/index8-Dca1sG3X.js","assets/index11-97AxRDhM.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function Hp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const qt={},Da=[],Yo=()=>{},tx=()=>!1,Gu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),zp=e=>e.startsWith("onUpdate:"),gn=Object.assign,N1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},oI=Object.prototype.hasOwnProperty,sn=(e,t)=>oI.call(e,t),bt=Array.isArray,Ba=e=>cc(e)==="[object Map]",Gl=e=>cc(e)==="[object Set]",zk=e=>cc(e)==="[object Date]",iI=e=>cc(e)==="[object RegExp]",Et=e=>typeof e=="function",bn=e=>typeof e=="string",$o=e=>typeof e=="symbol",on=e=>e!==null&&typeof e=="object",L1=e=>(on(e)||Et(e))&&Et(e.then)&&Et(e.catch),nx=Object.prototype.toString,cc=e=>nx.call(e),rI=e=>cc(e).slice(8,-1),Up=e=>cc(e)==="[object Object]",qp=e=>bn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Rl=Hp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),jp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},lI=/-\w/g,ps=jp(e=>e.replace(lI,t=>t.slice(1).toUpperCase())),aI=/\B([A-Z])/g,lo=jp(e=>e.replace(aI,"-$1").toLowerCase()),Vp=jp(e=>e.charAt(0).toUpperCase()+e.slice(1)),vf=jp(e=>e?`on${Vp(e)}`:""),As=(e,t)=>!Object.is(e,t),Fa=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},sx=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Kp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Df=e=>{const t=bn(e)?Number(e):NaN;return isNaN(t)?e:t};let Uk;const Gp=()=>Uk||(Uk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),cI="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",uI=Hp(cI);function Qt(e){if(bt(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bn(s)?hI(s):Qt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(bn(e)||on(e))return e}const dI=/;(?![^(]*\))/g,fI=/:([^]+)/,pI=/\/\*[^]*?\*\//g;function hI(e){const t={};return e.replace(pI,"").split(dI).forEach(n=>{if(n){const s=n.split(fI);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function De(e){let t="";if(bn(e))t=e;else if(bt(e))for(let n=0;n<e.length;n++){const s=De(e[n]);s&&(t+=s+" ")}else if(on(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function yfe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!bn(t)&&(e.class=De(t)),n&&(e.style=Qt(n)),e}const mI="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",gI=Hp(mI);function ox(e){return!!e||e===""}function vI(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Ji(e[s],t[s]);return n}function Ji(e,t){if(e===t)return!0;let n=zk(e),s=zk(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=$o(e),s=$o(t),n||s)return e===t;if(n=bt(e),s=bt(t),n||s)return n&&s?vI(e,t):!1;if(n=on(e),s=on(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Ji(e[r],t[r]))return!1}}return String(e)===String(t)}function Yp(e,t){return e.findIndex(n=>Ji(n,t))}const ix=e=>!!(e&&e.__v_isRef===!0),O=e=>bn(e)?e:e==null?"":bt(e)||on(e)&&(e.toString===nx||!Et(e.toString))?ix(e)?O(e.value):JSON.stringify(e,rx,2):String(e),rx=(e,t)=>ix(t)?rx(e,t.value):Ba(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[Rm(s,i)+" =>"]=o,n),{})}:Gl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Rm(n))}:$o(t)?Rm(t):on(t)&&!bt(t)&&!Up(t)?String(t):t,Rm=(e,t="")=>{var n;return $o(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function yI(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 fs;class lx{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&&fs&&(fs.active?(this.parent=fs,this.index=(fs.scopes||(fs.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=fs;try{return fs=this,t()}finally{fs=n}}}on(){++this._on===1&&(this.prevScope=fs,fs=this)}off(){if(this._on>0&&--this._on===0){if(fs===this)fs=this.prevScope;else{let t=fs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function kI(e){return new lx(e)}function P1(){return fs}function O1(e,t=!1){fs&&fs.cleanups.push(e)}let En;const Dm=new WeakSet;class Bf{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,fs&&(fs.active?fs.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Dm.has(this)&&(Dm.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||cx(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,qk(this),ux(this);const t=En,n=ui;En=this,ui=!0;try{return this.fn()}finally{dx(this),En=t,ui=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)B1(t);this.deps=this.depsTail=void 0,qk(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Dm.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){cv(this)&&this.run()}get dirty(){return cv(this)}}let ax=0,tu,nu;function cx(e,t=!1){if(e.flags|=8,t){e.next=nu,nu=e;return}e.next=tu,tu=e}function R1(){ax++}function D1(){if(--ax>0)return;if(nu){let t=nu;for(nu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;tu;){let t=tu;for(tu=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function ux(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function dx(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),B1(s),bI(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function cv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(fx(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function fx(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===bu)||(e.globalVersion=bu,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!cv(e))))return;e.flags|=2;const t=e.dep,n=En,s=ui;En=e,ui=!0;try{ux(e);const o=e.fn(e._value);(t.version===0||As(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{En=n,ui=s,dx(e),e.flags&=-3}}function B1(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)B1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function bI(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function kfe(e,t){e.effect instanceof Bf&&(e=e.effect.fn);const n=new Bf(e);t&&gn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function bfe(e){e.effect.stop()}let ui=!0;const px=[];function er(){px.push(ui),ui=!1}function tr(){const e=px.pop();ui=e===void 0?!0:e}function qk(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=En;En=void 0;try{t()}finally{En=n}}}let bu=0;class _I{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 Xp{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(!En||!ui||En===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==En)n=this.activeLink=new _I(En,this),En.deps?(n.prevDep=En.depsTail,En.depsTail.nextDep=n,En.depsTail=n):En.deps=En.depsTail=n,hx(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=En.depsTail,n.nextDep=void 0,En.depsTail.nextDep=n,En.depsTail=n,En.deps===n&&(En.deps=s)}return n}trigger(t){this.version++,bu++,this.notify(t)}notify(t){R1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{D1()}}}function hx(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)hx(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ff=new WeakMap,Dl=Symbol(""),uv=Symbol(""),_u=Symbol("");function Ds(e,t,n){if(ui&&En){let s=Ff.get(e);s||Ff.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Xp),o.map=s,o.key=n),o.track()}}function ji(e,t,n,s,o,i){const r=Ff.get(e);if(!r){bu++;return}const l=a=>{a&&a.trigger()};if(R1(),t==="clear")r.forEach(l);else{const a=bt(e),c=a&&qp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===_u||!$o(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(_u)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Dl)),Ba(e)&&l(r.get(uv)));break;case"delete":a||(l(r.get(Dl)),Ba(e)&&l(r.get(uv)));break;case"set":Ba(e)&&l(r.get(Dl));break}}D1()}function wI(e,t){const n=Ff.get(e);return n&&n.get(t)}function ma(e){const t=Xt(e);return t===e?t:(Ds(t,"iterate",_u),xo(e)?t:t.map(di))}function Qp(e){return Ds(e=Xt(e),"iterate",_u),e}function Ti(e,t){return nr(e)?Ja(Fr(e)?di(t):t):di(t)}const SI={__proto__:null,[Symbol.iterator](){return Bm(this,Symbol.iterator,e=>Ti(this,e))},concat(...e){return ma(this).concat(...e.map(t=>bt(t)?ma(t):t))},entries(){return Bm(this,"entries",e=>(e[1]=Ti(this,e[1]),e))},every(e,t){return Fi(this,"every",e,t,void 0,arguments)},filter(e,t){return Fi(this,"filter",e,t,n=>n.map(s=>Ti(this,s)),arguments)},find(e,t){return Fi(this,"find",e,t,n=>Ti(this,n),arguments)},findIndex(e,t){return Fi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Fi(this,"findLast",e,t,n=>Ti(this,n),arguments)},findLastIndex(e,t){return Fi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Fi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Fm(this,"includes",e)},indexOf(...e){return Fm(this,"indexOf",e)},join(e){return ma(this).join(e)},lastIndexOf(...e){return Fm(this,"lastIndexOf",e)},map(e,t){return Fi(this,"map",e,t,void 0,arguments)},pop(){return Rc(this,"pop")},push(...e){return Rc(this,"push",e)},reduce(e,...t){return jk(this,"reduce",e,t)},reduceRight(e,...t){return jk(this,"reduceRight",e,t)},shift(){return Rc(this,"shift")},some(e,t){return Fi(this,"some",e,t,void 0,arguments)},splice(...e){return Rc(this,"splice",e)},toReversed(){return ma(this).toReversed()},toSorted(e){return ma(this).toSorted(e)},toSpliced(...e){return ma(this).toSpliced(...e)},unshift(...e){return Rc(this,"unshift",e)},values(){return Bm(this,"values",e=>Ti(this,e))}};function Bm(e,t,n){const s=Qp(e),o=s[t]();return s!==e&&!xo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const CI=Array.prototype;function Fi(e,t,n,s,o,i){const r=Qp(e),l=r!==e&&!xo(e),a=r[t];if(a!==CI[t]){const d=a.apply(e,i);return l?di(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Ti(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function jk(e,t,n,s){const o=Qp(e),i=o!==e&&!xo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Ti(e,c)),n.call(this,c,Ti(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Ti(e,a):a}function Fm(e,t,n){const s=Xt(e);Ds(s,"iterate",_u);const o=s[t](...n);return(o===-1||o===!1)&&eh(n[0])?(n[0]=Xt(n[0]),s[t](...n)):o}function Rc(e,t,n=[]){er(),R1();const s=Xt(e)[t].apply(e,n);return D1(),tr(),s}const xI=Hp("__proto__,__v_isRef,__isVue"),mx=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter($o));function AI(e){$o(e)||(e=String(e));const t=Xt(this);return Ds(t,"has",e),t.hasOwnProperty(e)}class gx{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?wx:_x:i?bx:kx).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=bt(t);if(!o){let a;if(r&&(a=SI[n]))return a;if(n==="hasOwnProperty")return AI}const l=Reflect.get(t,n,Jn(t)?t:s);if(($o(n)?mx.has(n):xI(n))||(o||Ds(t,"get",n),i))return l;if(Jn(l)){const a=r&&qp(n)?l:l.value;return o&&on(a)?Wf(a):a}return on(l)?o?Wf(l):Es(l):l}}class vx extends gx{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=bt(t)&&qp(n);if(!this._isShallow){const c=nr(i);if(!xo(s)&&!nr(s)&&(i=Xt(i),s=Xt(s)),!r&&Jn(i)&&!Jn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:sn(t,n),a=Reflect.set(t,n,s,Jn(t)?t:o);return t===Xt(o)&&(l?As(s,i)&&ji(t,"set",n,s):ji(t,"add",n,s)),a}deleteProperty(t,n){const s=sn(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&ji(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!$o(n)||!mx.has(n))&&Ds(t,"has",n),s}ownKeys(t){return Ds(t,"iterate",bt(t)?"length":Dl),Reflect.ownKeys(t)}}class yx extends gx{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const TI=new vx,MI=new yx,EI=new vx(!0),II=new yx(!0),dv=e=>e,Od=e=>Reflect.getPrototypeOf(e);function $I(e,t,n){return function(...s){const o=this.__v_raw,i=Xt(o),r=Ba(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?dv:t?Ja:di;return!t&&Ds(i,"iterate",a?uv:Dl),gn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Rd(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function NI(e,t){const n={get(o){const i=this.__v_raw,r=Xt(i),l=Xt(o);e||(As(o,l)&&Ds(r,"get",o),Ds(r,"get",l));const{has:a}=Od(r),c=t?dv:e?Ja:di;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&Ds(Xt(o),"iterate",Dl),o.size},has(o){const i=this.__v_raw,r=Xt(i),l=Xt(o);return e||(As(o,l)&&Ds(r,"has",o),Ds(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Xt(l),c=t?dv:e?Ja:di;return!e&&Ds(a,"iterate",Dl),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return gn(n,e?{add:Rd("add"),set:Rd("set"),delete:Rd("delete"),clear:Rd("clear")}:{add(o){const i=Xt(this),r=Od(i),l=Xt(o),a=!t&&!xo(o)&&!nr(o)?l:o;return r.has.call(i,a)||As(o,a)&&r.has.call(i,o)||As(l,a)&&r.has.call(i,l)||(i.add(a),ji(i,"add",a,a)),this},set(o,i){!t&&!xo(i)&&!nr(i)&&(i=Xt(i));const r=Xt(this),{has:l,get:a}=Od(r);let c=l.call(r,o);c||(o=Xt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?As(i,u)&&ji(r,"set",o,i):ji(r,"add",o,i),this},delete(o){const i=Xt(this),{has:r,get:l}=Od(i);let a=r.call(i,o);a||(o=Xt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&ji(i,"delete",o,void 0),c},clear(){const o=Xt(this),i=o.size!==0,r=o.clear();return i&&ji(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=$I(o,e,t)}),n}function Zp(e,t){const n=NI(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(sn(n,o)&&o in s?n:s,o,i)}const LI={get:Zp(!1,!1)},PI={get:Zp(!1,!0)},OI={get:Zp(!0,!1)},RI={get:Zp(!0,!0)},kx=new WeakMap,bx=new WeakMap,_x=new WeakMap,wx=new WeakMap;function DI(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Es(e){return nr(e)?e:Jp(e,!1,TI,LI,kx)}function BI(e){return Jp(e,!1,EI,PI,bx)}function Wf(e){return Jp(e,!0,MI,OI,_x)}function _fe(e){return Jp(e,!0,II,RI,wx)}function Jp(e,t,n,s,o){if(!on(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=DI(rI(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function Fr(e){return nr(e)?Fr(e.__v_raw):!!(e&&e.__v_isReactive)}function nr(e){return!!(e&&e.__v_isReadonly)}function xo(e){return!!(e&&e.__v_isShallow)}function eh(e){return e?!!e.__v_raw:!1}function Xt(e){const t=e&&e.__v_raw;return t?Xt(t):e}function Or(e){return!sn(e,"__v_skip")&&Object.isExtensible(e)&&sx(e,"__v_skip",!0),e}const di=e=>on(e)?Es(e):e,Ja=e=>on(e)?Wf(e):e;function Jn(e){return e?e.__v_isRef===!0:!1}function ee(e){return Sx(e,!1)}function Yl(e){return Sx(e,!0)}function Sx(e,t){return Jn(e)?e:new FI(e,t)}class FI{constructor(t,n){this.dep=new Xp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Xt(t),this._value=n?t:di(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||xo(t)||nr(t);t=s?t:Xt(t),As(t,n)&&(this._rawValue=t,this._value=s?t:di(t),this.dep.trigger())}}function wfe(e){e.dep&&e.dep.trigger()}function S(e){return Jn(e)?e.value:e}function Cx(e){return Et(e)?e():S(e)}const WI={get:(e,t,n)=>t==="__v_raw"?e:S(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Jn(o)&&!Jn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function xx(e){return Fr(e)?e:new Proxy(e,WI)}class HI{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Xp,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function zI(e){return new HI(e)}function Sfe(e){const t=bt(e)?new Array(e.length):{};for(const n in e)t[n]=Ax(e,n);return t}class UI{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=$o(n)?n:String(n),this._raw=Xt(t);let o=!0,i=t;if(!bt(t)||$o(this._key)||!qp(this._key))do o=!eh(i)||xo(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=S(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Jn(this._raw[this._key])){const n=this._object[this._key];if(Jn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return wI(this._raw,this._key)}}class qI{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 Cfe(e,t,n){return Jn(e)?e:Et(e)?new qI(e):on(e)&&arguments.length>1?Ax(e,t,n):ee(e)}function Ax(e,t,n){return new UI(e,t,n)}class jI{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Xp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=bu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&En!==this)return cx(this,!0),!0}get value(){const t=this.dep.track();return fx(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function VI(e,t,n=!1){let s,o;return Et(e)?s=e:(s=e.get,o=e.set),new jI(s,o,n)}const xfe={GET:"get",HAS:"has",ITERATE:"iterate"},Afe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Dd={},Hf=new WeakMap;let Tr;function Tfe(){return Tr}function KI(e,t=!1,n=Tr){if(n){let s=Hf.get(n);s||Hf.set(n,s=[]),s.push(e)}}function GI(e,t,n=qt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:xo(y)||o===!1||o===0?Vi(y,1):Vi(y);let u,d,f,h,p=!1,m=!1;if(Jn(e)?(d=()=>e.value,p=xo(e)):Fr(e)?(d=()=>c(e),p=!0):bt(e)?(m=!0,p=e.some(y=>Fr(y)||xo(y)),d=()=>e.map(y=>{if(Jn(y))return y.value;if(Fr(y))return c(y);if(Et(y))return a?a(y,2):y()})):Et(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){er();try{f()}finally{tr()}}const y=Tr;Tr=u;try{return a?a(e,3,[h]):e(h)}finally{Tr=y}}:d=Yo,t&&o){const y=d,C=o===!0?1/0:o;d=()=>Vi(y(),C)}const _=P1(),b=()=>{u.stop(),_&&_.active&&N1(_.effects,u)};if(i&&t){const y=t;t=(...C)=>{y(...C),b()}}let g=m?new Array(e.length).fill(Dd):Dd;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const C=u.run();if(o||p||(m?C.some((L,I)=>As(L,g[I])):As(C,g))){f&&f();const L=Tr;Tr=u;try{const I=[C,g===Dd?void 0:m&&g[0]===Dd?[]:g,h];g=C,a?a(t,3,I):t(...I)}finally{Tr=L}}}else u.run()};return l&&l(v),u=new Bf(d),u.scheduler=r?()=>r(v,!1):v,h=y=>KI(y,!1,u),f=u.onStop=()=>{const y=Hf.get(u);if(y){if(a)a(y,4);else for(const C of y)C();Hf.delete(u)}},t?s?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function Vi(e,t=1/0,n){if(t<=0||!on(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Jn(e))Vi(e.value,t,n);else if(bt(e))for(let s=0;s<e.length;s++)Vi(e[s],t,n);else if(Gl(e)||Ba(e))e.forEach(s=>{Vi(s,t,n)});else if(Up(e)){for(const s in e)Vi(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Vi(e[s],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const Tx=[];function YI(e){Tx.push(e)}function XI(){Tx.pop()}function Mfe(e,t){}const Efe={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"},QI={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 Yu(e,t,n,s){try{return s?e(...s):e()}catch(o){uc(o,t,n)}}function Zo(e,t,n,s){if(Et(e)){const o=Yu(e,t,n,s);return o&&L1(o)&&o.catch(i=>{uc(i,t,n)}),o}if(bt(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Zo(e[i],t,n,s));return o}}function uc(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||qt;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){er(),Yu(i,null,10,[e,a,c]),tr();return}}ZI(e,n,o,s,r)}function ZI(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Gs=[];let Si=-1;const Wa=[];let Mr=null,Sa=0;const Mx=Promise.resolve();let zf=null;function vt(e){const t=zf||Mx;return e?t.then(this?e.bind(this):e):t}function JI(e){let t=Si+1,n=Gs.length;for(;t<n;){const s=t+n>>>1,o=Gs[s],i=wu(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function F1(e){if(!(e.flags&1)){const t=wu(e),n=Gs[Gs.length-1];!n||!(e.flags&2)&&t>=wu(n)?Gs.push(e):Gs.splice(JI(t),0,e),e.flags|=1,Ex()}}function Ex(){zf||(zf=Mx.then(Ix))}function Uf(e){bt(e)?Wa.push(...e):Mr&&e.id===-1?Mr.splice(Sa+1,0,e):e.flags&1||(Wa.push(e),e.flags|=1),Ex()}function Vk(e,t,n=Si+1){for(;n<Gs.length;n++){const s=Gs[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Gs.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function qf(e){if(Wa.length){const t=[...new Set(Wa)].sort((n,s)=>wu(n)-wu(s));if(Wa.length=0,Mr){Mr.push(...t);return}for(Mr=t,Sa=0;Sa<Mr.length;Sa++){const n=Mr[Sa];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Mr=null,Sa=0}}const wu=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ix(e){try{for(Si=0;Si<Gs.length;Si++){const t=Gs[Si];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Yu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Si<Gs.length;Si++){const t=Gs[Si];t&&(t.flags&=-2)}Si=-1,Gs.length=0,qf(),zf=null,(Gs.length||Wa.length)&&Ix()}}let Ca,Bd=[];function $x(e,t){var n,s;Ca=e,Ca?(Ca.enabled=!0,Bd.forEach(({event:o,args:i})=>Ca.emit(o,...i)),Bd=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{$x(i,t)}),setTimeout(()=>{Ca||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Bd=[])},3e3)):Bd=[]}let Is=null,th=null;function Su(e){const t=Is;return Is=e,th=e&&e.type.__scopeId||null,t}function Ife(e){th=e}function $fe(){th=null}const Nfe=e=>de;function de(e,t=Is,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Yf(-1);const i=Su(t);let r;try{r=e(...o)}finally{Su(i),s._d&&Yf(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function In(e,t){if(Is===null)return e;const n=Ju(Is),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=qt]=t[o];i&&(Et(i)&&(i={mounted:i,updated:i}),i.deep&&Vi(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function xi(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(er(),Zo(a,n,8,[e.el,l,e,t]),tr())}}function Pn(e,t){if(Ts){let n=Ts.provides;const s=Ts.parent&&Ts.parent.provides;s===n&&(n=Ts.provides=Object.create(s)),n[e]=t}}function jt(e,t,n=!1){const s=$s();if(s||Bl){let o=Bl?Bl._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Et(t)?t.call(s&&s.proxy):t}}function Lfe(){return!!($s()||Bl)}const e$=Symbol.for("v-scx"),t$=()=>jt(e$);function n$(e,t){return Xu(e,null,t)}function Pfe(e,t){return Xu(e,null,{flush:"post"})}function s$(e,t){return Xu(e,null,{flush:"sync"})}function Ge(e,t,n){return Xu(e,t,n)}function Xu(e,t,n=qt){const{immediate:s,deep:o,flush:i,once:r}=n,l=gn({},n),a=t&&s||!t&&i!=="post";let c;if(ql){if(i==="sync"){const h=t$();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=Yo,h.resume=Yo,h.pause=Yo,h}}const u=Ts;l.call=(h,p,m)=>Zo(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{ts(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():F1(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=GI(e,t,l);return ql&&(c?c.push(f):a&&f()),f}function o$(e,t,n){const s=this.proxy,o=bn(e)?e.includes(".")?Nx(s,e):()=>s[e]:e.bind(s,s);let i;Et(t)?i=t:(i=t.handler,n=t);const r=dc(this),l=Xu(o,i.bind(s),n);return r(),l}function Nx(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const xr=new WeakMap,Lx=Symbol("_vte"),Px=e=>e.__isTeleport,Ml=e=>e&&(e.disabled||e.disabled===""),i$=e=>e&&(e.defer||e.defer===""),Kk=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Gk=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,fv=(e,t)=>{const n=e&&e.to;return bn(n)?t?t(n):null:n},r$={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:m,createComment:_,parentNode:b}}=c,g=Ml(t.props);let{dynamicChildren:v}=t;const y=(I,k,M)=>{I.shapeFlag&16&&u(I.children,k,M,o,i,r,l,a)},C=(I=t)=>{const k=Ml(I.props),M=I.target=fv(I.props,p),E=pv(M,I,m,h);M&&(r!=="svg"&&Kk(M)?r="svg":r!=="mathml"&&Gk(M)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(M),k||(y(I,M,E),jc(I,!1)))},L=I=>{const k=()=>{if(xr.get(I)===k){if(xr.delete(I),Ml(I.props)){const M=b(I.el)||n;y(I,M,I.anchor),jc(I,!0)}C(I)}};xr.set(I,k),ts(k,i)};if(e==null){const I=t.el=m(""),k=t.anchor=m("");if(h(I,n,s),h(k,n,s),i$(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,k),jc(t,!0)),C()}else{t.el=e.el;const I=t.anchor=e.anchor,k=xr.get(e);if(k){k.flags|=8,xr.delete(e),L(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,E=t.targetAnchor=e.targetAnchor,P=Ml(e.props),A=P?n:M,$=P?I:E;if(r==="svg"||Kk(M)?r="svg":(r==="mathml"||Gk(M))&&(r="mathml"),v?(f(e.dynamicChildren,v,A,o,i,r,l),X1(e,t,!0)):a||d(e,t,A,$,o,i,r,l,!1),g)P?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Fd(t,n,I,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=fv(t.props,p);D&&Fd(t,D,null,c,0)}else P&&Fd(t,M,E,c,1);jc(t,g)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!Ml(f),p=xr.get(e);if(p&&(p.flags|=8,xr.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let m=0;m<l.length;m++){const _=l[m];s(_,t,n,h,!!_.dynamicChildren)}},move:Fd,hydrate:l$};function Fd(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!xr.has(e)&&(!d||Ml(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function l$(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,b){let g=b;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,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(_,b){b.anchor=d(r(_),b,l(_),n,s,o,i)}const p=t.target=fv(t.props,a),m=Ml(t.props);if(p){const _=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,_),t.targetAnchor||pv(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,_),t.targetAnchor||pv(p,t,u,c),d(_&&r(_),t,p,n,s,o,i))),jc(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const nh=r$;function jc(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function pv(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[Lx]=r,e&&(s(i,e,o),s(r,e,o)),r}const Uo=Symbol("_leaveCb"),Dc=Symbol("_enterCb");function Ox(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return _n(()=>{e.isMounted=!0}),hs(()=>{e.isUnmounting=!0}),e}const Bo=[Function,Array],Rx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Bo,onEnter:Bo,onAfterEnter:Bo,onEnterCancelled:Bo,onBeforeLeave:Bo,onLeave:Bo,onAfterLeave:Bo,onLeaveCancelled:Bo,onBeforeAppear:Bo,onAppear:Bo,onAfterAppear:Bo,onAppearCancelled:Bo},Dx=e=>{const t=e.subTree;return t.component?Dx(t.component):t},a$={name:"BaseTransition",props:Rx,setup(e,{slots:t}){const n=$s(),s=Ox();return()=>{const o=t.default&&W1(t.default(),!0),i=o&&o.length?Bx(o):n.subTree?ie():void 0;if(!i)return;const r=Xt(e),{mode:l}=r;if(s.isLeaving)return Wm(i);const a=Yk(i);if(!a)return Wm(i);let c=Cu(a,r,s,n,d=>c=d);a.type!==ss&&qr(a,c);let u=n.subTree&&Yk(n.subTree);if(u&&u.type!==ss&&!li(u,a)&&Dx(n).type!==ss){let d=Cu(u,r,s,n);if(qr(u,d),l==="out-in"&&a.type!==ss)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Wm(i);l==="in-out"&&a.type!==ss?d.delayLeave=(f,h,p)=>{const m=Fx(s,u);m[String(u.key)]=u,f[Uo]=()=>{h(),f[Uo]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function Bx(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ss){t=n;break}}return t}const c$=a$;function Fx(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Cu(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:_,onAppear:b,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),C=Fx(n,e),L=(M,E)=>{M&&Zo(M,s,9,E)},I=(M,E)=>{const P=E[1];L(M,E),bt(M)?M.every(A=>A.length<=1)&&P():M.length<=1&&P()},k={mode:r,persisted:l,beforeEnter(M){let E=a;if(!n.isMounted)if(i)E=_||a;else return;M[Uo]&&M[Uo](!0);const P=C[y];P&&li(e,P)&&P.el[Uo]&&P.el[Uo](),L(E,[M])},enter(M){if(C[y]===e)return;let E=c,P=u,A=d;if(!n.isMounted)if(i)E=b||c,P=g||u,A=v||d;else return;let $=!1;M[Dc]=R=>{$||($=!0,R?L(A,[M]):L(P,[M]),k.delayedLeave&&k.delayedLeave(),M[Dc]=void 0)};const D=M[Dc].bind(null,!1);E?I(E,[M,D]):D()},leave(M,E){const P=String(e.key);if(M[Dc]&&M[Dc](!0),n.isUnmounting)return E();L(f,[M]);let A=!1;M[Uo]=D=>{A||(A=!0,E(),D?L(m,[M]):L(p,[M]),M[Uo]=void 0,C[P]===e&&delete C[P])};const $=M[Uo].bind(null,!1);C[P]=e,h?I(h,[M,$]):$()},clone(M){const E=Cu(M,t,n,s,o);return o&&o(E),E}};return k}function Wm(e){if(Qu(e))return e=sr(e),e.children=null,e}function Yk(e){if(!Qu(e))return Px(e.type)&&e.children?Bx(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&&Et(n.default))return n.default()}}function qr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,qr(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 W1(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Pe?(r.patchFlag&128&&o++,s=s.concat(W1(r.children,t,l))):(t||r.type!==ss)&&s.push(l!=null?sr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Ve(e,t){return Et(e)?gn({name:e.name},t,{setup:e}):e}function Ofe(){const e=$s();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function H1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Rfe(e){const t=$s(),n=Yl(null);if(t){const o=t.refs===qt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Xk(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const jf=new WeakMap;function Ha(e,t,n,s,o=!1){if(bt(e)){e.forEach((m,_)=>Ha(m,t&&(bt(t)?t[_]:t),n,s,o));return}if(Qi(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ha(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Ju(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===qt?l.refs={}:l.refs,d=l.setupState,f=Xt(d),h=d===qt?tx:m=>Xk(u,m)?!1:sn(f,m),p=(m,_)=>!(_&&Xk(u,_));if(c!=null&&c!==a){if(Qk(t),bn(c))u[c]=null,h(c)&&(d[c]=null);else if(Jn(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Et(a))Yu(a,l,12,[r,u]);else{const m=bn(a),_=Jn(a);if(m||_){const b=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)bt(g)&&N1(g,i);else if(bt(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];p(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):_&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{b(),jf.delete(e)};g.id=-1,jf.set(e,g),ts(g,n)}else Qk(e),b()}}}function Qk(e){const t=jf.get(e);t&&(t.flags|=8,jf.delete(e))}let Zk=!1;const ga=()=>{Zk||(console.error("Hydration completed but contains mismatches."),Zk=!0)},u$=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",d$=e=>e.namespaceURI.includes("MathML"),Wd=e=>{if(e.nodeType===1){if(u$(e))return"svg";if(d$(e))return"mathml"}},Ia=e=>e.nodeType===8;function f$(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),qf(),y._vnode=v;return}d(y.firstChild,v,null,null,null),qf(),y._vnode=v},d=(v,y,C,L,I,k=!1)=>{k=k||!!y.dynamicChildren;const M=Ia(v)&&v.data==="[",E=()=>m(v,y,C,L,I,M),{type:P,ref:A,shapeFlag:$,patchFlag:D}=y;let R=v.nodeType;y.el=v,D===-2&&(k=!1,y.dynamicChildren=null);let H=null;switch(P){case Wr:R!==3?y.children===""?(a(y.el=o(""),r(v),v),H=v):H=E():(v.data!==y.children&&(ga(),v.data=y.children),H=i(v));break;case ss:g(v)?(H=i(v),b(y.el=v.content.firstChild,v,C)):R!==8||M?H=E():H=i(v);break;case Ua:if(M&&(v=i(v),R=v.nodeType),R===1||R===3){H=v;const z=!y.children.length;for(let q=0;q<y.staticCount;q++)z&&(y.children+=H.nodeType===1?H.outerHTML:H.data),q===y.staticCount-1&&(y.anchor=H),H=i(H);return M?i(H):H}else E();break;case Pe:M?H=p(v,y,C,L,I,k):H=E();break;default:if($&1)(R!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?H=E():H=f(v,y,C,L,I,k);else if($&6){y.slotScopeIds=I;const z=r(v);if(M?H=_(v):Ia(v)&&v.data==="teleport start"?H=_(v,v.data,"teleport end"):H=i(v),t(y,z,null,C,L,Wd(z),k),Qi(y)&&!y.type.__asyncResolved){let q;M?(q=Z(Pe),q.anchor=H?H.previousSibling:z.lastChild):q=v.nodeType===3?je(""):Z("div"),q.el=v,y.component.subTree=q}}else $&64?R!==8?H=E():H=y.type.hydrate(v,y,C,L,I,k,e,h):$&128&&(H=y.type.hydrate(v,y,C,L,Wd(r(v)),I,k,e,d))}return A!=null&&Ha(A,null,L,y),H},f=(v,y,C,L,I,k)=>{k=k||!!y.dynamicChildren;const{type:M,props:E,patchFlag:P,shapeFlag:A,dirs:$,transition:D}=y,R=M==="input"||M==="option";if(R||P!==-1){$&&xi(y,null,C,"created");let H=!1;if(g(v)){H=o2(null,D)&&C&&C.vnode.props&&C.vnode.props.appear;const q=v.content.firstChild;if(H){const Q=q.getAttribute("class");Q&&(q.$cls=Q),D.beforeEnter(q)}b(q,v,C),y.el=v=q}if(A&16&&!(E&&(E.innerHTML||E.textContent))){let q=h(v.firstChild,y,v,C,L,I,k);for(q&&!Hd(v,1)&&ga();q;){const Q=q;q=q.nextSibling,l(Q)}}else if(A&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
|
-
`)&&(Hd(v,0)||ga(),v.textContent=y.children)}if(E){if(R||!k||P&48){const q=v.tagName.includes("-");for(const Q in E)(R&&(Q.endsWith("value")||Q==="indeterminate")||Gu(Q)&&!Rl(Q)||Q[0]==="."||q&&!Rl(Q))&&s(v,Q,null,E[Q],void 0,C)}else if(E.onClick)s(v,"onClick",null,E.onClick,void 0,C);else if(P&4&&Fr(E.style))for(const q in E.style)E.style[q]}let z;(z=E&&E.onVnodeBeforeMount)&&so(z,C,y),$&&xi(y,null,C,"beforeMount"),((z=E&&E.onVnodeMounted)||$||H)&&a2(()=>{z&&so(z,C,y),H&&D.enter(v),$&&xi(y,null,C,"mounted")},L)}return v.nextSibling},h=(v,y,C,L,I,k,M)=>{M=M||!!y.dynamicChildren;const E=y.children,P=E.length;let A=!1;for(let $=0;$<P;$++){const D=M?E[$]:E[$]=ro(E[$]),R=D.type===Wr;v?(R&&!M&&$+1<P&&ro(E[$+1]).type===Wr&&(a(o(v.data.slice(D.children.length)),C,i(v)),v.data=D.children),v=d(v,D,L,I,k,M)):R&&!D.children?a(D.el=o(""),C):(A||(A=!0,Hd(C,1)||ga()),n(null,D,C,null,L,I,Wd(C),k))}return v},p=(v,y,C,L,I,k)=>{const{slotScopeIds:M}=y;M&&(I=I?I.concat(M):M);const E=r(v),P=h(i(v),y,E,C,L,I,k);return P&&Ia(P)&&P.data==="]"?i(y.anchor=P):(ga(),a(y.anchor=c("]"),E,P),P)},m=(v,y,C,L,I,k)=>{if(Hd(v.parentElement,1)||ga(),y.el=null,k){const P=_(v);for(;;){const A=i(v);if(A&&A!==P)l(A);else break}}const M=i(v),E=r(v);return l(v),n(null,y,E,M,C,L,Wd(E),I),C&&(C.vnode.el=y.el,ih(C,y.el)),M},_=(v,y="[",C="]")=>{let L=0;for(;v;)if(v=i(v),v&&Ia(v)&&(v.data===y&&L++,v.data===C)){if(L===0)return i(v);L--}return v},b=(v,y,C)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let I=C;for(;I;)I.vnode.el===y&&(I.vnode.el=I.subTree.el=v),I=I.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const Jk="data-allow-mismatch",p$={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Hd(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Jk);)e=e.parentElement;const n=e&&e.getAttribute(Jk);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(p$[t])}}const h$=Gp().requestIdleCallback||(e=>setTimeout(e,1)),m$=Gp().cancelIdleCallback||(e=>clearTimeout(e)),Dfe=(e=1e4)=>t=>{const n=h$(t,{timeout:e});return()=>m$(n)};function g$(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const Bfe=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(g$(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Ffe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Wfe=(e=[])=>(t,n)=>{bn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function v$(e,t){if(Ia(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Ia(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Qi=e=>!!e.type.__asyncLoader;function Mi(e){Et(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((_,b)=>{a(m,()=>_(f()),()=>b(m),d+1)});throw m}).then(m=>p!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Ve({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,_){let b=!1;(m.bu||(m.bu=[])).push(()=>b=!0);const g=()=>{b||_()},v=i?()=>{const y=i(g,C=>v$(p,C));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Ts;if(H1(p),u)return()=>zd(u,p);const m=v=>{c=null,uc(v,p,13,!s)};if(l&&p.suspense||ql)return h().then(v=>()=>zd(v,p)).catch(v=>(m(v),()=>s?Z(s,{error:v}):null));const _=ee(!1),b=ee(),g=ee(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!_.value&&!b.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),b.value=v}},r),h().then(()=>{_.value=!0,p.parent&&Qu(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),b.value=v}),()=>{if(_.value&&u)return zd(u,p);if(b.value&&s)return Z(s,{error:b.value});if(n&&!g.value)return zd(n,p)}}})}function zd(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=Z(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Qu=e=>e.type.__isKeepAlive,y$={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=$s(),s=n.ctx;if(!s.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,f=d("div");s.activate=(g,v,y,C,L)=>{const I=g.component;c(g,v,y,0,l),a(I.vnode,g,v,y,I,l,C,g.slotScopeIds,L),ts(()=>{I.isDeactivated=!1,I.a&&Fa(I.a);const k=g.props&&g.props.onVnodeMounted;k&&so(k,I.parent,g)},l)},s.deactivate=g=>{const v=g.component;Kf(v.m),Kf(v.a),c(g,f,null,1,l),ts(()=>{v.da&&Fa(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&so(y,v.parent,g),v.isDeactivated=!0},l)};function h(g){Hm(g),u(g,n,l,!0)}function p(g){o.forEach((v,y)=>{const C=wv(Qi(v)?v.type.__asyncResolved||{}:v.type);C&&!g(C)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!li(v,r))?h(v):r&&Hm(r),o.delete(g),i.delete(g)}Ge(()=>[e.include,e.exclude],([g,v])=>{g&&p(y=>Vc(g,y)),v&&p(y=>!Vc(v,y))},{flush:"post",deep:!0});let _=null;const b=()=>{_!=null&&(Gf(n.subTree.type)?ts(()=>{o.set(_,Ud(n.subTree))},n.subTree.suspense):o.set(_,Ud(n.subTree)))};return _n(b),z1(b),hs(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,C=Ud(v);if(g.type===C.type&&g.key===C.key){Hm(C);const L=C.component.da;L&&ts(L,y);return}h(g)})}),()=>{if(_=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!jr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=Ud(v);if(y.type===ss)return r=null,y;const C=y.type,L=wv(Qi(y)?y.type.__asyncResolved||{}:C),{include:I,exclude:k,max:M}=e;if(I&&(!L||!Vc(I,L))||k&&L&&Vc(k,L))return y.shapeFlag&=-257,r=y,v;const E=y.key==null?C:y.key,P=o.get(E);return y.el&&(y=sr(y),v.shapeFlag&128&&(v.ssContent=y)),_=E,P?(y.el=P.el,y.component=P.component,y.transition&&qr(y,y.transition),y.shapeFlag|=512,i.delete(E),i.add(E)):(i.add(E),M&&i.size>parseInt(M,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,Gf(v.type)?v:y}}},Hfe=y$;function Vc(e,t){return bt(e)?e.some(n=>Vc(n,t)):bn(e)?e.split(",").includes(t):iI(e)?(e.lastIndex=0,e.test(t)):!1}function k$(e,t){Wx(e,"a",t)}function b$(e,t){Wx(e,"da",t)}function Wx(e,t,n=Ts){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(sh(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Qu(o.parent.vnode)&&_$(s,t,n,o),o=o.parent}}function _$(e,t,n,s){const o=sh(t,e,s,!0);wn(()=>{N1(s[t],o)},n)}function Hm(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ud(e){return e.shapeFlag&128?e.ssContent:e}function sh(e,t,n=Ts,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{er();const l=dc(n),a=Zo(t,n,e,r);return l(),tr(),a});return s?o.unshift(i):o.push(i),i}}const ir=e=>(t,n=Ts)=>{(!ql||e==="sp")&&sh(e,(...s)=>t(...s),n)},w$=ir("bm"),_n=ir("m"),Hx=ir("bu"),z1=ir("u"),hs=ir("bum"),wn=ir("um"),S$=ir("sp"),C$=ir("rtg"),x$=ir("rtc");function A$(e,t=Ts){sh("ec",e,t)}const U1="components",T$="directives";function M$(e,t){return q1(U1,e,!0,t)||e}const zx=Symbol.for("v-ndc");function Bs(e){return bn(e)?q1(U1,e,!1)||e:e||zx}function zfe(e){return q1(T$,e)}function q1(e,t,n=!0,s=!1){const o=Is||Ts;if(o){const i=o.type;if(e===U1){const l=wv(i,!1);if(l&&(l===t||l===ps(t)||l===Vp(ps(t))))return i}const r=eb(o[e]||i[e],t)||eb(o.appContext[e],t);return!r&&s?i:r}}function eb(e,t){return e&&(e[t]||e[ps(t)]||e[Vp(ps(t))])}function ot(e,t,n,s){let o;const i=n&&n[s],r=bt(e);if(r||bn(e)){const l=r&&Fr(e);let a=!1,c=!1;l&&(a=!xo(e),c=nr(e),e=Qp(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?Ja(di(e[u])):di(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(on(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function j1(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(bt(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Tn(e,t,n={},s,o){if(Is.ce||Is.parent&&Qi(Is.parent)&&Is.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ve(Pe,null,[Z("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&V1(i(n)),l=n.key||r&&r.key,a=ve(Pe,{key:(l&&!$o(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function V1(e){return e.some(t=>jr(t)?!(t.type===ss||t.type===Pe&&!V1(t.children)):!0)?e:null}function Ufe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:vf(s)]=e[s];return n}const hv=e=>e?p2(e)?Ju(e):hv(e.parent):null,su=gn(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=>hv(e.parent),$root:e=>hv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>K1(e),$forceUpdate:e=>e.f||(e.f=()=>{F1(e.update)}),$nextTick:e=>e.n||(e.n=vt.bind(e.proxy)),$watch:e=>o$.bind(e)}),zm=(e,t)=>e!==qt&&!e.__isScriptSetup&&sn(e,t),mv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(zm(s,t))return r[t]=1,s[t];if(o!==qt&&sn(o,t))return r[t]=2,o[t];if(sn(i,t))return r[t]=3,i[t];if(n!==qt&&sn(n,t))return r[t]=4,n[t];gv&&(r[t]=0)}}const c=su[t];let u,d;if(c)return t==="$attrs"&&Ds(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==qt&&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:s,setupState:o,ctx:i}=e;return zm(o,t)?(o[t]=n,!0):s!==qt&&sn(s,t)?(s[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:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==qt&&l[0]!=="$"&&sn(e,l)||zm(t,l)||sn(i,l)||sn(s,l)||sn(su,l)||sn(o.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)}},E$=gn({},mv,{get(e,t){if(t!==Symbol.unscopables)return mv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!uI(t)}});function qfe(){return null}function jfe(){return null}function Vfe(e){}function Kfe(e){}function Gfe(){return null}function Yfe(){}function Xfe(e,t){return null}function Qfe(){return Ux().slots}function Zu(){return Ux().attrs}function Ux(e){const t=$s();return t.setupContext||(t.setupContext=g2(t))}function xu(e){return bt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Zfe(e,t){const n=xu(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?bt(o)||Et(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function Jfe(e,t){return!e||!t?e||t:bt(e)&&bt(t)?e.concat(t):gn({},xu(e),xu(t))}function epe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function tpe(e){const t=$s(),n=ql;let s=e();Tu(),n&&qa(!1);const o=()=>{dc(t),n&&qa(!0)},i=()=>{$s()!==t&&t.scope.off(),Tu(),n&&qa(!1)};return L1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let gv=!0;function I$(e){const t=K1(e),n=e.proxy,s=e.ctx;gv=!1,t.beforeCreate&&tb(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:m,deactivated:_,beforeDestroy:b,beforeUnmount:g,destroyed:v,unmounted:y,render:C,renderTracked:L,renderTriggered:I,errorCaptured:k,serverPrefetch:M,expose:E,inheritAttrs:P,components:A,directives:$,filters:D}=t;if(c&&$$(c,s,null),r)for(const z in r){const q=r[z];Et(q)&&(s[z]=q.bind(n))}if(o){const z=o.call(n,n);on(z)&&(e.data=Es(z))}if(gv=!0,i)for(const z in i){const q=i[z],Q=Et(q)?q.bind(n,n):Et(q.get)?q.get.bind(n,n):Yo,X=!Et(q)&&Et(q.set)?q.set.bind(n):Yo,ue=W({get:Q,set:X});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>ue.value,set:ge=>ue.value=ge})}if(l)for(const z in l)qx(l[z],s,n,z);if(a){const z=Et(a)?a.call(n):a;Reflect.ownKeys(z).forEach(q=>{Pn(q,z[q])})}u&&tb(u,e,"c");function H(z,q){bt(q)?q.forEach(Q=>z(Q.bind(n))):q&&z(q.bind(n))}if(H(w$,d),H(_n,f),H(Hx,h),H(z1,p),H(k$,m),H(b$,_),H(A$,k),H(x$,L),H(C$,I),H(hs,g),H(wn,y),H(S$,M),bt(E))if(E.length){const z=e.exposed||(e.exposed={});E.forEach(q=>{Object.defineProperty(z,q,{get:()=>n[q],set:Q=>n[q]=Q,enumerable:!0})})}else e.exposed||(e.exposed={});C&&e.render===Yo&&(e.render=C),P!=null&&(e.inheritAttrs=P),A&&(e.components=A),$&&(e.directives=$),M&&H1(e)}function $$(e,t,n=Yo){bt(e)&&(e=vv(e));for(const s in e){const o=e[s];let i;on(o)?"default"in o?i=jt(o.from||s,o.default,!0):i=jt(o.from||s):i=jt(o),Jn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function tb(e,t,n){Zo(bt(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function qx(e,t,n,s){let o=s.includes(".")?Nx(n,s):()=>n[s];if(bn(e)){const i=t[e];Et(i)&&Ge(o,i)}else if(Et(e))Ge(o,e.bind(n));else if(on(e))if(bt(e))e.forEach(i=>qx(i,t,n,s));else{const i=Et(e.handler)?e.handler.bind(n):t[e.handler];Et(i)&&Ge(o,i,e)}}function K1(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>Vf(a,c,r,!0)),Vf(a,t,r)),on(t)&&i.set(t,a),a}function Vf(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Vf(e,i,n,!0),o&&o.forEach(r=>Vf(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=N$[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const N$={data:nb,props:sb,emits:sb,methods:Kc,computed:Kc,beforeCreate:js,created:js,beforeMount:js,mounted:js,beforeUpdate:js,updated:js,beforeDestroy:js,beforeUnmount:js,destroyed:js,unmounted:js,activated:js,deactivated:js,errorCaptured:js,serverPrefetch:js,components:Kc,directives:Kc,watch:P$,provide:nb,inject:L$};function nb(e,t){return t?e?function(){return gn(Et(e)?e.call(this,this):e,Et(t)?t.call(this,this):t)}:t:e}function L$(e,t){return Kc(vv(e),vv(t))}function vv(e){if(bt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function js(e,t){return e?[...new Set([].concat(e,t))]:t}function Kc(e,t){return e?gn(Object.create(null),e,t):t}function sb(e,t){return e?bt(e)&&bt(t)?[...new Set([...e,...t])]:gn(Object.create(null),xu(e),xu(t??{})):t}function P$(e,t){if(!e)return t;if(!t)return e;const n=gn(Object.create(null),e);for(const s in t)n[s]=js(e[s],t[s]);return n}function jx(){return{app:null,config:{isNativeTag:tx,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 O$=0;function R$(e,t){return function(s,o=null){Et(s)||(s=gn({},s)),o!=null&&!on(o)&&(o=null);const i=jx(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:O$++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:f4,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Et(u.install)?(r.add(u),u.install(c,...d)):Et(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||Z(s,o);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,Ju(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Zo(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=Bl;Bl=c;try{return u()}finally{Bl=d}}};return c}}let Bl=null;function npe(e,t,n=qt){const s=$s(),o=ps(t),i=lo(t),r=Vx(e,o),l=zI((a,c)=>{let u,d=qt,f;return s$(()=>{const h=e[o];As(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!As(p,u)&&!(d!==qt&&As(h,d)))return;const m=s.vnode.props;m&&(t in m||o in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${o}`in m||`onUpdate:${i}`in m)||(u=h,c()),s.emit(`update:${t}`,p),As(h,p)&&As(h,d)&&!As(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||qt:l,done:!1}:{done:!0}}}},l}const Vx=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ps(t)}Modifiers`]||e[`${lo(t)}Modifiers`];function D$(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||qt;let o=n;const i=t.startsWith("update:"),r=i&&Vx(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>bn(u)?u.trim():u)),r.number&&(o=n.map(Kp)));let l,a=s[l=vf(t)]||s[l=vf(ps(t))];!a&&i&&(a=s[l=vf(lo(t))]),a&&Zo(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Zo(c,e,6,o)}}const B$=new WeakMap;function Kx(e,t,n=!1){const s=n?B$:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!Et(e)){const a=c=>{const u=Kx(c,t,!0);u&&(l=!0,gn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(on(e)&&s.set(e,null),null):(bt(i)?i.forEach(a=>r[a]=null):gn(r,i),on(e)&&s.set(e,r),r)}function oh(e,t){return!e||!Gu(t)?!1:(t=t.slice(2).replace(/Once$/,""),sn(e,t[0].toLowerCase()+t.slice(1))||sn(e,lo(t))||sn(e,t))}function yf(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:m}=e,_=Su(e);let b,g;try{if(n.shapeFlag&4){const y=o||s,C=y;b=ro(c.call(C,y,u,d,h,f,p)),g=l}else{const y=t;b=ro(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:W$(l)}}catch(y){ou.length=0,uc(y,e,1),b=Z(ss)}let v=b;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:C}=v;y.length&&C&7&&(i&&y.some(zp)&&(g=H$(g,i)),v=sr(v,g,!1,!0))}return n.dirs&&(v=sr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&qr(v,n.transition),b=v,Su(_),b}function F$(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(jr(o)){if(o.type!==ss||o.children==="v-if"){if(n)return;n=o}}else return}return n}const W$=e=>{let t;for(const n in e)(n==="class"||n==="style"||Gu(n))&&((t||(t={}))[n]=e[n]);return t},H$=(e,t)=>{const n={};for(const s in e)(!zp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function z$(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?ob(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(Gx(r,s,f)&&!oh(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?ob(s,r,c):!0:!!r;return!1}function ob(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(Gx(t,e,i)&&!oh(n,i))return!0}return!1}function Gx(e,t,n){const s=e[n],o=t[n];return n==="style"&&on(s)&&on(o)?!Ji(s,o):s!==o}function ih({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Yx={},Xx=()=>Object.create(Yx),Qx=e=>Object.getPrototypeOf(e)===Yx;function U$(e,t,n,s=!1){const o={},i=Xx();e.propsDefaults=Object.create(null),Zx(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:BI(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function q$(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Xt(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(oh(e.emitsOptions,f))continue;const h=t[f];if(a)if(sn(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=ps(f);o[p]=yv(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{Zx(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!sn(t,d)&&((u=lo(d))===d||!sn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=yv(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!sn(t,d))&&(delete i[d],c=!0)}c&&ji(e.attrs,"set","")}function Zx(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Rl(a))continue;const c=t[a];let u;o&&sn(o,u=ps(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:oh(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Xt(n),c=l||qt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=yv(o,a,d,c[d],e,!sn(c,d))}}return r}function yv(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=sn(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Et(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=dc(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===lo(n))&&(s=!0))}return s}const j$=new WeakMap;function Jx(e,t,n=!1){const s=n?j$:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!Et(e)){const u=d=>{a=!0;const[f,h]=Jx(d,t,!0);gn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return on(e)&&s.set(e,Da),Da;if(bt(i))for(let u=0;u<i.length;u++){const d=ps(i[u]);ib(d)&&(r[d]=qt)}else if(i)for(const u in i){const d=ps(u);if(ib(d)){const f=i[u],h=r[d]=bt(f)||Et(f)?{type:f}:gn({},f),p=h.type;let m=!1,_=!0;if(bt(p))for(let b=0;b<p.length;++b){const g=p[b],v=Et(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(_=!1)}else m=Et(p)&&p.name==="Boolean";h[0]=m,h[1]=_,(m||sn(h,"default"))&&l.push(d)}}const c=[r,l];return on(e)&&s.set(e,c),c}function ib(e){return e[0]!=="$"&&!Rl(e)}const G1=e=>e==="_"||e==="_ctx"||e==="$stable",Y1=e=>bt(e)?e.map(ro):[ro(e)],V$=(e,t,n)=>{if(t._n)return t;const s=de((...o)=>Y1(t(...o)),n);return s._c=!1,s},e2=(e,t,n)=>{const s=e._ctx;for(const o in e){if(G1(o))continue;const i=e[o];if(Et(i))t[o]=V$(o,i,s);else if(i!=null){const r=Y1(i);t[o]=()=>r}}},t2=(e,t)=>{const n=Y1(t);e.slots.default=()=>n},n2=(e,t,n)=>{for(const s in t)(n||!G1(s))&&(e[s]=t[s])},K$=(e,t,n)=>{const s=e.slots=Xx();if(e.vnode.shapeFlag&32){const o=t._;o?(n2(s,t,n),n&&sx(s,"_",o,!0)):e2(t,s)}else t&&t2(e,t)},G$=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=qt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:n2(o,t,n):(i=!t.$stable,e2(t,o)),r=t}else t&&(t2(e,t),r={default:1});if(i)for(const l in o)!G1(l)&&r[l]==null&&delete o[l]},ts=a2;function Y$(e){return s2(e)}function X$(e){return s2(e,f$)}function s2(e,t){const n=Gp();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Yo,insertStaticContent:p}=e,m=(U,Y,fe,se=null,ce=null,j=null,G=void 0,re=null,me=!!Y.dynamicChildren)=>{if(U===Y)return;U&&!li(U,Y)&&(se=Ue(U),ge(U,ce,j,!0),U=null),Y.patchFlag===-2&&(me=!1,Y.dynamicChildren=null);const{type:Ae,ref:Ee,shapeFlag:ae}=Y;switch(Ae){case Wr:_(U,Y,fe,se);break;case ss:b(U,Y,fe,se);break;case Ua:U==null&&g(Y,fe,se,G);break;case Pe:A(U,Y,fe,se,ce,j,G,re,me);break;default:ae&1?C(U,Y,fe,se,ce,j,G,re,me):ae&6?$(U,Y,fe,se,ce,j,G,re,me):(ae&64||ae&128)&&Ae.process(U,Y,fe,se,ce,j,G,re,me,F)}Ee!=null&&ce?Ha(Ee,U&&U.ref,j,Y||U,!Y):Ee==null&&U&&U.ref!=null&&Ha(U.ref,null,j,U,!0)},_=(U,Y,fe,se)=>{if(U==null)s(Y.el=l(Y.children),fe,se);else{const ce=Y.el=U.el;Y.children!==U.children&&c(ce,Y.children)}},b=(U,Y,fe,se)=>{U==null?s(Y.el=a(Y.children||""),fe,se):Y.el=U.el},g=(U,Y,fe,se)=>{[U.el,U.anchor]=p(U.children,Y,fe,se,U.el,U.anchor)},v=({el:U,anchor:Y},fe,se)=>{let ce;for(;U&&U!==Y;)ce=f(U),s(U,fe,se),U=ce;s(Y,fe,se)},y=({el:U,anchor:Y})=>{let fe;for(;U&&U!==Y;)fe=f(U),o(U),U=fe;o(Y)},C=(U,Y,fe,se,ce,j,G,re,me)=>{if(Y.type==="svg"?G="svg":Y.type==="math"&&(G="mathml"),U==null)L(Y,fe,se,ce,j,G,re,me);else{const Ae=U.el&&U.el._isVueCE?U.el:null;try{Ae&&Ae._beginPatch(),M(U,Y,ce,j,G,re,me)}finally{Ae&&Ae._endPatch()}}},L=(U,Y,fe,se,ce,j,G,re)=>{let me,Ae;const{props:Ee,shapeFlag:ae,transition:Ce,dirs:Xe}=U;if(me=U.el=r(U.type,j,Ee&&Ee.is,Ee),ae&8?u(me,U.children):ae&16&&k(U.children,me,null,se,ce,Um(U,j),G,re),Xe&&xi(U,null,se,"created"),I(me,U,U.scopeId,G,se),Ee){for(const xt in Ee)xt!=="value"&&!Rl(xt)&&i(me,xt,null,Ee[xt],j,se);"value"in Ee&&i(me,"value",null,Ee.value,j),(Ae=Ee.onVnodeBeforeMount)&&so(Ae,se,U)}Xe&&xi(U,null,se,"beforeMount");const tt=o2(ce,Ce);tt&&Ce.beforeEnter(me),s(me,Y,fe),((Ae=Ee&&Ee.onVnodeMounted)||tt||Xe)&&ts(()=>{try{Ae&&so(Ae,se,U),tt&&Ce.enter(me),Xe&&xi(U,null,se,"mounted")}finally{}},ce)},I=(U,Y,fe,se,ce)=>{if(fe&&h(U,fe),se)for(let j=0;j<se.length;j++)h(U,se[j]);if(ce){let j=ce.subTree;if(Y===j||Gf(j.type)&&(j.ssContent===Y||j.ssFallback===Y)){const G=ce.vnode;I(U,G,G.scopeId,G.slotScopeIds,ce.parent)}}},k=(U,Y,fe,se,ce,j,G,re,me=0)=>{for(let Ae=me;Ae<U.length;Ae++){const Ee=U[Ae]=re?qi(U[Ae]):ro(U[Ae]);m(null,Ee,Y,fe,se,ce,j,G,re)}},M=(U,Y,fe,se,ce,j,G)=>{const re=Y.el=U.el;let{patchFlag:me,dynamicChildren:Ae,dirs:Ee}=Y;me|=U.patchFlag&16;const ae=U.props||qt,Ce=Y.props||qt;let Xe;if(fe&&kl(fe,!1),(Xe=Ce.onVnodeBeforeUpdate)&&so(Xe,fe,Y,U),Ee&&xi(Y,U,fe,"beforeUpdate"),fe&&kl(fe,!0),(ae.innerHTML&&Ce.innerHTML==null||ae.textContent&&Ce.textContent==null)&&u(re,""),Ae?E(U.dynamicChildren,Ae,re,fe,se,Um(Y,ce),j):G||q(U,Y,re,null,fe,se,Um(Y,ce),j,!1),me>0){if(me&16)P(re,ae,Ce,fe,ce);else if(me&2&&ae.class!==Ce.class&&i(re,"class",null,Ce.class,ce),me&4&&i(re,"style",ae.style,Ce.style,ce),me&8){const tt=Y.dynamicProps;for(let xt=0;xt<tt.length;xt++){const wt=tt[xt],It=ae[wt],Wt=Ce[wt];(Wt!==It||wt==="value")&&i(re,wt,It,Wt,ce,fe)}}me&1&&U.children!==Y.children&&u(re,Y.children)}else!G&&Ae==null&&P(re,ae,Ce,fe,ce);((Xe=Ce.onVnodeUpdated)||Ee)&&ts(()=>{Xe&&so(Xe,fe,Y,U),Ee&&xi(Y,U,fe,"updated")},se)},E=(U,Y,fe,se,ce,j,G)=>{for(let re=0;re<Y.length;re++){const me=U[re],Ae=Y[re],Ee=me.el&&(me.type===Pe||!li(me,Ae)||me.shapeFlag&198)?d(me.el):fe;m(me,Ae,Ee,null,se,ce,j,G,!0)}},P=(U,Y,fe,se,ce)=>{if(Y!==fe){if(Y!==qt)for(const j in Y)!Rl(j)&&!(j in fe)&&i(U,j,Y[j],null,ce,se);for(const j in fe){if(Rl(j))continue;const G=fe[j],re=Y[j];G!==re&&j!=="value"&&i(U,j,re,G,ce,se)}"value"in fe&&i(U,"value",Y.value,fe.value,ce)}},A=(U,Y,fe,se,ce,j,G,re,me)=>{const Ae=Y.el=U?U.el:l(""),Ee=Y.anchor=U?U.anchor:l("");let{patchFlag:ae,dynamicChildren:Ce,slotScopeIds:Xe}=Y;Xe&&(re=re?re.concat(Xe):Xe),U==null?(s(Ae,fe,se),s(Ee,fe,se),k(Y.children||[],fe,Ee,ce,j,G,re,me)):ae>0&&ae&64&&Ce&&U.dynamicChildren&&U.dynamicChildren.length===Ce.length?(E(U.dynamicChildren,Ce,fe,ce,j,G,re),(Y.key!=null||ce&&Y===ce.subTree)&&X1(U,Y,!0)):q(U,Y,fe,Ee,ce,j,G,re,me)},$=(U,Y,fe,se,ce,j,G,re,me)=>{Y.slotScopeIds=re,U==null?Y.shapeFlag&512?ce.ctx.activate(Y,fe,se,G,me):D(Y,fe,se,ce,j,G,me):R(U,Y,me)},D=(U,Y,fe,se,ce,j,G)=>{const re=U.component=f2(U,se,ce);if(Qu(U)&&(re.ctx.renderer=F),h2(re,!1,G),re.asyncDep){if(ce&&ce.registerDep(re,H,G),!U.el){const me=re.subTree=Z(ss);b(null,me,Y,fe),U.placeholder=me.el}}else H(re,U,Y,fe,ce,j,G)},R=(U,Y,fe)=>{const se=Y.component=U.component;if(z$(U,Y,fe))if(se.asyncDep&&!se.asyncResolved){z(se,Y,fe);return}else se.next=Y,se.update();else Y.el=U.el,se.vnode=Y},H=(U,Y,fe,se,ce,j,G)=>{const re=()=>{if(U.isMounted){let{next:ae,bu:Ce,u:Xe,parent:tt,vnode:xt}=U;{const Ht=i2(U);if(Ht){ae&&(ae.el=xt.el,z(U,ae,G)),Ht.asyncDep.then(()=>{ts(()=>{U.isUnmounted||Ae()},ce)});return}}let wt=ae,It;kl(U,!1),ae?(ae.el=xt.el,z(U,ae,G)):ae=xt,Ce&&Fa(Ce),(It=ae.props&&ae.props.onVnodeBeforeUpdate)&&so(It,tt,ae,xt),kl(U,!0);const Wt=yf(U),_t=U.subTree;U.subTree=Wt,m(_t,Wt,d(_t.el),Ue(_t),U,ce,j),ae.el=Wt.el,wt===null&&ih(U,Wt.el),Xe&&ts(Xe,ce),(It=ae.props&&ae.props.onVnodeUpdated)&&ts(()=>so(It,tt,ae,xt),ce)}else{let ae;const{el:Ce,props:Xe}=Y,{bm:tt,m:xt,parent:wt,root:It,type:Wt}=U,_t=Qi(Y);if(kl(U,!1),tt&&Fa(tt),!_t&&(ae=Xe&&Xe.onVnodeBeforeMount)&&so(ae,wt,Y),kl(U,!0),Ce&&te){const Ht=()=>{U.subTree=yf(U),te(Ce,U.subTree,U,ce,null)};_t&&Wt.__asyncHydrate?Wt.__asyncHydrate(Ce,U,Ht):Ht()}else{It.ce&&It.ce._hasShadowRoot()&&It.ce._injectChildStyle(Wt,U.parent?U.parent.type:void 0);const Ht=U.subTree=yf(U);m(null,Ht,fe,se,U,ce,j),Y.el=Ht.el}if(xt&&ts(xt,ce),!_t&&(ae=Xe&&Xe.onVnodeMounted)){const Ht=Y;ts(()=>so(ae,wt,Ht),ce)}(Y.shapeFlag&256||wt&&Qi(wt.vnode)&&wt.vnode.shapeFlag&256)&&U.a&&ts(U.a,ce),U.isMounted=!0,Y=fe=se=null}};U.scope.on();const me=U.effect=new Bf(re);U.scope.off();const Ae=U.update=me.run.bind(me),Ee=U.job=me.runIfDirty.bind(me);Ee.i=U,Ee.id=U.uid,me.scheduler=()=>F1(Ee),kl(U,!0),Ae()},z=(U,Y,fe)=>{Y.component=U;const se=U.vnode.props;U.vnode=Y,U.next=null,q$(U,Y.props,se,fe),G$(U,Y.children,fe),er(),Vk(U),tr()},q=(U,Y,fe,se,ce,j,G,re,me=!1)=>{const Ae=U&&U.children,Ee=U?U.shapeFlag:0,ae=Y.children,{patchFlag:Ce,shapeFlag:Xe}=Y;if(Ce>0){if(Ce&128){X(Ae,ae,fe,se,ce,j,G,re,me);return}else if(Ce&256){Q(Ae,ae,fe,se,ce,j,G,re,me);return}}Xe&8?(Ee&16&&qe(Ae,ce,j),ae!==Ae&&u(fe,ae)):Ee&16?Xe&16?X(Ae,ae,fe,se,ce,j,G,re,me):qe(Ae,ce,j,!0):(Ee&8&&u(fe,""),Xe&16&&k(ae,fe,se,ce,j,G,re,me))},Q=(U,Y,fe,se,ce,j,G,re,me)=>{U=U||Da,Y=Y||Da;const Ae=U.length,Ee=Y.length,ae=Math.min(Ae,Ee);let Ce;for(Ce=0;Ce<ae;Ce++){const Xe=Y[Ce]=me?qi(Y[Ce]):ro(Y[Ce]);m(U[Ce],Xe,fe,null,ce,j,G,re,me)}Ae>Ee?qe(U,ce,j,!0,!1,ae):k(Y,fe,se,ce,j,G,re,me,ae)},X=(U,Y,fe,se,ce,j,G,re,me)=>{let Ae=0;const Ee=Y.length;let ae=U.length-1,Ce=Ee-1;for(;Ae<=ae&&Ae<=Ce;){const Xe=U[Ae],tt=Y[Ae]=me?qi(Y[Ae]):ro(Y[Ae]);if(li(Xe,tt))m(Xe,tt,fe,null,ce,j,G,re,me);else break;Ae++}for(;Ae<=ae&&Ae<=Ce;){const Xe=U[ae],tt=Y[Ce]=me?qi(Y[Ce]):ro(Y[Ce]);if(li(Xe,tt))m(Xe,tt,fe,null,ce,j,G,re,me);else break;ae--,Ce--}if(Ae>ae){if(Ae<=Ce){const Xe=Ce+1,tt=Xe<Ee?Y[Xe].el:se;for(;Ae<=Ce;)m(null,Y[Ae]=me?qi(Y[Ae]):ro(Y[Ae]),fe,tt,ce,j,G,re,me),Ae++}}else if(Ae>Ce)for(;Ae<=ae;)ge(U[Ae],ce,j,!0),Ae++;else{const Xe=Ae,tt=Ae,xt=new Map;for(Ae=tt;Ae<=Ce;Ae++){const Vt=Y[Ae]=me?qi(Y[Ae]):ro(Y[Ae]);Vt.key!=null&&xt.set(Vt.key,Ae)}let wt,It=0;const Wt=Ce-tt+1;let _t=!1,Ht=0;const $n=new Array(Wt);for(Ae=0;Ae<Wt;Ae++)$n[Ae]=0;for(Ae=Xe;Ae<=ae;Ae++){const Vt=U[Ae];if(It>=Wt){ge(Vt,ce,j,!0);continue}let Kt;if(Vt.key!=null)Kt=xt.get(Vt.key);else for(wt=tt;wt<=Ce;wt++)if($n[wt-tt]===0&&li(Vt,Y[wt])){Kt=wt;break}Kt===void 0?ge(Vt,ce,j,!0):($n[Kt-tt]=Ae+1,Kt>=Ht?Ht=Kt:_t=!0,m(Vt,Y[Kt],fe,null,ce,j,G,re,me),It++)}const Sn=_t?Q$($n):Da;for(wt=Sn.length-1,Ae=Wt-1;Ae>=0;Ae--){const Vt=tt+Ae,Kt=Y[Vt],Qn=Y[Vt+1],st=Vt+1<Ee?Qn.el||r2(Qn):se;$n[Ae]===0?m(null,Kt,fe,st,ce,j,G,re,me):_t&&(wt<0||Ae!==Sn[wt]?ue(Kt,fe,st,2):wt--)}}},ue=(U,Y,fe,se,ce=null)=>{const{el:j,type:G,transition:re,children:me,shapeFlag:Ae}=U;if(Ae&6){ue(U.component.subTree,Y,fe,se);return}if(Ae&128){U.suspense.move(Y,fe,se);return}if(Ae&64){G.move(U,Y,fe,F);return}if(G===Pe){s(j,Y,fe);for(let ae=0;ae<me.length;ae++)ue(me[ae],Y,fe,se);s(U.anchor,Y,fe);return}if(G===Ua){v(U,Y,fe);return}if(se!==2&&Ae&1&&re)if(se===0)re.persisted&&!j[Uo]?s(j,Y,fe):(re.beforeEnter(j),s(j,Y,fe),ts(()=>re.enter(j),ce));else{const{leave:ae,delayLeave:Ce,afterLeave:Xe}=re,tt=()=>{U.ctx.isUnmounted?o(j):s(j,Y,fe)},xt=()=>{const wt=j._isLeaving||!!j[Uo];j._isLeaving&&j[Uo](!0),re.persisted&&!wt?tt():ae(j,()=>{tt(),Xe&&Xe()})};Ce?Ce(j,tt,xt):xt()}else s(j,Y,fe)},ge=(U,Y,fe,se=!1,ce=!1)=>{const{type:j,props:G,ref:re,children:me,dynamicChildren:Ae,shapeFlag:Ee,patchFlag:ae,dirs:Ce,cacheIndex:Xe,memo:tt}=U;if(ae===-2&&(ce=!1),re!=null&&(er(),Ha(re,null,fe,U,!0),tr()),Xe!=null&&(Y.renderCache[Xe]=void 0),Ee&256){Y.ctx.deactivate(U);return}const xt=Ee&1&&Ce,wt=!Qi(U);let It;if(wt&&(It=G&&G.onVnodeBeforeUnmount)&&so(It,Y,U),Ee&6)ze(U.component,fe,se);else{if(Ee&128){U.suspense.unmount(fe,se);return}xt&&xi(U,null,Y,"beforeUnmount"),Ee&64?U.type.remove(U,Y,fe,F,se):Ae&&!Ae.hasOnce&&(j!==Pe||ae>0&&ae&64)?qe(Ae,Y,fe,!1,!0):(j===Pe&&ae&384||!ce&&Ee&16)&&qe(me,Y,fe),se&&xe(U)}const Wt=tt!=null&&Xe==null;(wt&&(It=G&&G.onVnodeUnmounted)||xt||Wt)&&ts(()=>{It&&so(It,Y,U),xt&&xi(U,null,Y,"unmounted"),Wt&&(U.el=null)},fe)},xe=U=>{const{type:Y,el:fe,anchor:se,transition:ce}=U;if(Y===Pe){ke(fe,se);return}if(Y===Ua){y(U);return}const j=()=>{o(fe),ce&&!ce.persisted&&ce.afterLeave&&ce.afterLeave()};if(U.shapeFlag&1&&ce&&!ce.persisted){const{leave:G,delayLeave:re}=ce,me=()=>G(fe,j);re?re(U.el,j,me):me()}else j()},ke=(U,Y)=>{let fe;for(;U!==Y;)fe=f(U),o(U),U=fe;o(Y)},ze=(U,Y,fe)=>{const{bum:se,scope:ce,job:j,subTree:G,um:re,m:me,a:Ae}=U;Kf(me),Kf(Ae),se&&Fa(se),ce.stop(),j&&(j.flags|=8,ge(G,U,Y,fe)),re&&ts(re,Y),ts(()=>{U.isUnmounted=!0},Y)},qe=(U,Y,fe,se=!1,ce=!1,j=0)=>{for(let G=j;G<U.length;G++)ge(U[G],Y,fe,se,ce)},Ue=U=>{if(U.shapeFlag&6)return Ue(U.component.subTree);if(U.shapeFlag&128)return U.suspense.next();const Y=f(U.anchor||U.el),fe=Y&&Y[Lx];return fe?f(fe):Y};let Le=!1;const le=(U,Y,fe)=>{let se;U==null?Y._vnode&&(ge(Y._vnode,null,null,!0),se=Y._vnode.component):m(Y._vnode||null,U,Y,null,null,null,fe),Y._vnode=U,Le||(Le=!0,Vk(se),qf(),Le=!1)},F={p:m,um:ge,m:ue,r:xe,mt:D,mc:k,pc:q,pbc:E,n:Ue,o:e};let ne,te;return t&&([ne,te]=t(F)),{render:le,hydrate:ne,createApp:R$(le,ne)}}function Um({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 kl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function o2(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function X1(e,t,n=!1){const s=e.children,o=t.children;if(bt(s)&&bt(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=qi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&X1(r,l)),l.type===Wr&&(l.patchFlag===-1&&(l=o[i]=qi(l)),l.el=r.el),l.type===ss&&!l.el&&(l.el=r.el)}}function Q$(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function i2(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:i2(t)}function Kf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function r2(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?r2(t.subTree):null}const Gf=e=>e.__isSuspense;let kv=0;const Z$={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)J$(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}e4(e,t,n,s,o,r,l,a,c)}},hydrate:t4,normalize:n4},spe=Z$;function Au(e,t){const n=e.props&&e.props[t];Et(n)&&n()}function J$(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=l2(e,o,s,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,s,f,i,r),f.deps>0?(Au(e,"onPending"),Au(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),za(f,e.ssFallback)):f.resolve(!1,!0)}function e4(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:_,isHydrating:b}=d;if(m)d.pendingBranch=f,li(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():_&&(b||(a(p,h,n,s,o,null,i,r,l),za(d,h)))):(d.pendingId=kv++,b?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,s,o,null,i,r,l),za(d,h))):p&&li(p,f)?(a(p,f,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&li(p,f))a(p,f,n,s,o,d,i,r,l),za(d,f);else if(Au(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=kv++,a(null,f,d.hiddenContainer,null,o,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 l2(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:m,remove:_}}=c;let b;const g=s4(e);g&&t&&t.pendingBranch&&(b=t.pendingId,t.deps++);const v=e.props?Df(e.props.timeout):void 0,y=i,C={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:kv++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,I=!1){const{vnode:k,activeBranch:M,pendingBranch:E,pendingId:P,effects:A,parentComponent:$,container:D,isInFallback:R}=C;let H=!1;if(C.isHydrating)C.isHydrating=!1;else if(!L){H=M&&E.transition&&E.transition.mode==="out-in";let Q=!1;H&&(M.transition.afterLeave=()=>{P===C.pendingId&&(f(E,D,i===y&&!Q?p(M):i,0),Uf(A),R&&k.ssFallback&&(k.ssFallback.el=null))}),M&&!C.isFallbackMountPending&&(m(M.el)===D&&(i=p(M),Q=!0),h(M,$,C,!0),!H&&R&&k.ssFallback&&ts(()=>k.ssFallback.el=null,C)),H||f(E,D,i,0)}C.isFallbackMountPending=!1,za(C,E),C.pendingBranch=null,C.isInFallback=!1;let z=C.parent,q=!1;for(;z;){if(z.pendingBranch){z.effects.push(...A),q=!0;break}z=z.parent}!q&&!H&&Uf(A),C.effects=[],g&&t&&t.pendingBranch&&b===t.pendingId&&(t.deps--,t.deps===0&&!I&&t.resolve()),Au(k,"onResolve")},fallback(L){if(!C.pendingBranch)return;const{vnode:I,activeBranch:k,parentComponent:M,container:E,namespace:P}=C;Au(I,"onFallback");const A=p(k),$=()=>{C.isFallbackMountPending=!1,C.isInFallback&&(d(null,L,E,A,M,null,P,l,a),za(C,L))},D=L.transition&&L.transition.mode==="out-in";D&&(C.isFallbackMountPending=!0,k.transition.afterLeave=$),C.isInFallback=!0,h(k,M,null,!0),D||$()},move(L,I,k){C.activeBranch&&f(C.activeBranch,L,I,k),C.container=L},next(){return C.activeBranch&&p(C.activeBranch)},registerDep(L,I,k){const M=!!C.pendingBranch;M&&C.deps++;const E=L.vnode.el;L.asyncDep.catch(P=>{uc(P,L,0)}).then(P=>{if(L.isUnmounted||C.isUnmounted||C.pendingId!==L.suspenseId)return;Tu(),L.asyncResolved=!0;const{vnode:A}=L;bv(L,P,!1),E&&(A.el=E);const $=!E&&L.subTree.el;I(L,A,m(E||L.subTree.el),E?null:p(L.subTree),C,r,k),$&&(A.placeholder=null,_($)),ih(L,A.el),M&&--C.deps===0&&C.resolve()})},unmount(L,I){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,L,I),C.pendingBranch&&h(C.pendingBranch,n,L,I)}};return C}function t4(e,t,n,s,o,i,r,l,a){const c=t.suspense=l2(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function n4(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=rb(s?n.default:n),e.ssFallback=s?rb(n.fallback):Z(ss)}function rb(e){let t;if(Et(e)){const n=Ul&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=Fs,c2())}return bt(e)&&(e=F$(e)),e=ro(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function a2(e,t){t&&t.pendingBranch?bt(e)?t.effects.push(...e):t.effects.push(e):Uf(e)}function za(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,ih(s,o))}function s4(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),Wr=Symbol.for("v-txt"),ss=Symbol.for("v-cmt"),Ua=Symbol.for("v-stc"),ou=[];let Fs=null;function w(e=!1){ou.push(Fs=e?null:[])}function c2(){ou.pop(),Fs=ou[ou.length-1]||null}let Ul=1;function Yf(e,t=!1){Ul+=e,e<0&&Fs&&t&&(Fs.hasOnce=!0)}function u2(e){return e.dynamicChildren=Ul>0?Fs||Da:null,c2(),Ul>0&&Fs&&Fs.push(e),e}function N(e,t,n,s,o,i){return u2(T(e,t,n,s,o,i,!0))}function ve(e,t,n,s,o){return u2(Z(e,t,n,s,o,!0))}function jr(e){return e?e.__v_isVNode===!0:!1}function li(e,t){return e.type===t.type&&e.key===t.key}function ope(e){}const d2=({key:e})=>e??null,kf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bn(e)||Jn(e)||Et(e)?{i:Is,r:e,k:t,f:!!n}:e:null);function T(e,t=null,n=null,s=0,o=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&d2(t),ref:t&&kf(t),scopeId:th,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Is};return l?(Z1(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=bn(n)?8:16),Ul>0&&!r&&Fs&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Fs.push(a),a}const Z=o4;function o4(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===zx)&&(e=ss),jr(e)){const l=sr(e,t,!0);return n&&Z1(l,n),Ul>0&&!i&&Fs&&(l.shapeFlag&6?Fs[Fs.indexOf(e)]=l:Fs.push(l)),l.patchFlag=-2,l}if(u4(e)&&(e=e.__vccOpts),t){t=i4(t);let{class:l,style:a}=t;l&&!bn(l)&&(t.class=De(l)),on(a)&&(eh(a)&&!bt(a)&&(a=gn({},a)),t.style=Qt(a))}const r=bn(e)?1:Gf(e)?128:Px(e)?64:on(e)?4:Et(e)?2:0;return T(e,t,n,s,o,r,i,!0)}function i4(e){return e?eh(e)||Qx(e)?gn({},e):e:null}function sr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?hn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&d2(c),ref:t&&t.ref?n&&i?bt(i)?i.concat(kf(t)):[i,kf(t)]:kf(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Pe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&sr(e.ssContent),ssFallback:e.ssFallback&&sr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&qr(u,a.clone(u)),u}function je(e=" ",t=0){return Z(Wr,null,e,t)}function Q1(e,t){const n=Z(Ua,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(w(),ve(ss,null,e)):Z(ss,null,e)}function ro(e){return e==null||typeof e=="boolean"?Z(ss):bt(e)?Z(Pe,null,e.slice()):jr(e)?qi(e):Z(Wr,null,String(e))}function qi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:sr(e)}function Z1(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(bt(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Z1(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Qx(t)?t._ctx=Is:o===3&&Is&&(Is.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Et(t)?(t={default:t,_ctx:Is},n=32):(t=String(t),s&64?(n=16,t=[je(t)]):n=8);e.children=t,e.shapeFlag|=n}function hn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=De([t.class,s.class]));else if(o==="style")t.style=Qt([t.style,s.style]);else if(Gu(o)){const i=t[o],r=s[o];r&&i!==r&&!(bt(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!zp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function so(e,t,n,s=null){Zo(e,t,7,[n,s])}const r4=jx();let l4=0;function f2(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||r4,i={uid:l4++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new lx(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Jx(s,o),emitsOptions:Kx(s,o),emit:null,emitted:null,propsDefaults:qt,inheritAttrs:s.inheritAttrs,ctx:qt,data:qt,props:qt,attrs:qt,slots:qt,refs:qt,setupState:qt,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=D$.bind(null,i),e.ce&&e.ce(i),i}let Ts=null;const $s=()=>Ts||Is;let Xf,qa;{const e=Gp(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};Xf=t("__VUE_INSTANCE_SETTERS__",n=>Ts=n),qa=t("__VUE_SSR_SETTERS__",n=>ql=n)}const dc=e=>{const t=Ts;return Xf(e),e.scope.on(),()=>{e.scope.off(),Xf(t)}},Tu=()=>{Ts&&Ts.scope.off(),Xf(null)};function p2(e){return e.vnode.shapeFlag&4}let ql=!1;function h2(e,t=!1,n=!1){t&&qa(t);const{props:s,children:o}=e.vnode,i=p2(e);U$(e,s,i,t),K$(e,o,n||t);const r=i?a4(e,t):void 0;return t&&qa(!1),r}function a4(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,mv);const{setup:s}=n;if(s){er();const o=e.setupContext=s.length>1?g2(e):null,i=dc(e),r=Yu(s,e,0,[e.props,o]),l=L1(r);if(tr(),i(),(l||e.sp)&&!Qi(e)&&H1(e),l){if(r.then(Tu,Tu),t)return r.then(a=>{bv(e,a,t)}).catch(a=>{uc(a,e,0)});e.asyncDep=r}else bv(e,r,t)}else m2(e,t)}function bv(e,t,n){Et(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:on(t)&&(e.setupState=xx(t)),m2(e,n)}let Qf,_v;function ipe(e){Qf=e,_v=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,E$))}}const rpe=()=>!Qf;function m2(e,t,n){const s=e.type;if(!e.render){if(!t&&Qf&&!s.render){const o=s.template||K1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=gn(gn({isCustomElement:i,delimiters:l},r),a);s.render=Qf(o,c)}}e.render=s.render||Yo,_v&&_v(e)}{const o=dc(e);er();try{I$(e)}finally{tr(),o()}}}const c4={get(e,t){return Ds(e,"get",""),e[t]}};function g2(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,c4),slots:e.slots,emit:e.emit,expose:t}}function Ju(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(xx(Or(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in su)return su[n](e)},has(t,n){return n in t||n in su}})):e.proxy}function wv(e,t=!0){return Et(e)?e.displayName||e.name:e.name||t&&e.__name}function u4(e){return Et(e)&&"__vccOpts"in e}const W=(e,t)=>VI(e,t,ql);function un(e,t,n){try{Yf(-1);const s=arguments.length;return s===2?on(t)&&!bt(t)?jr(t)?Z(e,null,[t]):Z(e,t):Z(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&jr(n)&&(n=[n]),Z(e,t,n))}finally{Yf(1)}}function lpe(){}function ape(e,t,n,s){const o=n[s];if(o&&d4(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function d4(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(As(n[s],t[s]))return!1;return Ul>0&&Fs&&Fs.push(e),!0}const f4="3.5.35",cpe=Yo,upe=QI,dpe=Ca,fpe=$x,p4={createComponentInstance:f2,setupComponent:h2,renderComponentRoot:yf,setCurrentRenderingInstance:Su,isVNode:jr,normalizeVNode:ro,getComponentPublicInstance:Ju,ensureValidVNode:V1,pushWarningContext:YI,popWarningContext:XI},ppe=p4,hpe=null,mpe=null,gpe=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let Sv;const lb=typeof window<"u"&&window.trustedTypes;if(lb)try{Sv=lb.createPolicy("vue",{createHTML:e=>e})}catch{}const v2=Sv?e=>Sv.createHTML(e):e=>e,h4="http://www.w3.org/2000/svg",m4="http://www.w3.org/1998/Math/MathML",zi=typeof document<"u"?document:null,ab=zi&&zi.createElement("template"),g4={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?zi.createElementNS(h4,e):t==="mathml"?zi.createElementNS(m4,e):n?zi.createElement(e,{is:n}):zi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>zi.createTextNode(e),createComment:e=>zi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>zi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{ab.innerHTML=v2(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=ab.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},gr="transition",Bc="animation",ec=Symbol("_vtc"),y2={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},k2=gn({},Rx,y2),v4=e=>(e.displayName="Transition",e.props=k2,e),Vr=v4((e,{slots:t})=>un(c$,b2(e),t)),bl=(e,t=[])=>{bt(e)?e.forEach(n=>n(...t)):e&&e(...t)},cb=e=>e?bt(e)?e.some(t=>t.length>1):e.length>1:!1;function b2(e){const t={};for(const A in e)A in y2||(t[A]=e[A]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=y4(o),m=p&&p[0],_=p&&p[1],{onBeforeEnter:b,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:C,onBeforeAppear:L=b,onAppear:I=g,onAppearCancelled:k=v}=t,M=(A,$,D,R)=>{A._enterCancelled=R,Ar(A,$?u:l),Ar(A,$?c:r),D&&D()},E=(A,$)=>{A._isLeaving=!1,Ar(A,d),Ar(A,h),Ar(A,f),$&&$()},P=A=>($,D)=>{const R=A?I:g,H=()=>M($,A,D);bl(R,[$,H]),ub(()=>{Ar($,A?a:i),wi($,A?u:l),cb(R)||db($,s,m,H)})};return gn(t,{onBeforeEnter(A){bl(b,[A]),wi(A,i),wi(A,r)},onBeforeAppear(A){bl(L,[A]),wi(A,a),wi(A,c)},onEnter:P(!1),onAppear:P(!0),onLeave(A,$){A._isLeaving=!0;const D=()=>E(A,$);wi(A,d),A._enterCancelled?(wi(A,f),Cv(A)):(Cv(A),wi(A,f)),ub(()=>{A._isLeaving&&(Ar(A,d),wi(A,h),cb(y)||db(A,s,_,D))}),bl(y,[A,D])},onEnterCancelled(A){M(A,!1,void 0,!0),bl(v,[A])},onAppearCancelled(A){M(A,!0,void 0,!0),bl(k,[A])},onLeaveCancelled(A){E(A),bl(C,[A])}})}function y4(e){if(e==null)return null;if(on(e))return[qm(e.enter),qm(e.leave)];{const t=qm(e);return[t,t]}}function qm(e){return Df(e)}function wi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ec]||(e[ec]=new Set)).add(t)}function Ar(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[ec];n&&(n.delete(t),n.size||(e[ec]=void 0))}function ub(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let k4=0;function db(e,t,n,s){const o=e._endId=++k4,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=_2(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function _2(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${gr}Delay`),i=s(`${gr}Duration`),r=fb(o,i),l=s(`${Bc}Delay`),a=s(`${Bc}Duration`),c=fb(l,a);let u=null,d=0,f=0;t===gr?r>0&&(u=gr,d=r,f=i.length):t===Bc?c>0&&(u=Bc,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?gr:Bc:null,f=u?u===gr?i.length:a.length:0);const h=u===gr&&/\b(?:transform|all)(?:,|$)/.test(s(`${gr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function fb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>pb(n)+pb(e[s])))}function pb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Cv(e){return(e?e.ownerDocument:document).body.offsetHeight}function b4(e,t,n){const s=e[ec];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Zf=Symbol("_vod"),w2=Symbol("_vsh"),Ko={name:"show",beforeMount(e,{value:t},{transition:n}){e[Zf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Fc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Fc(e,!0),s.enter(e)):s.leave(e,()=>{Fc(e,!1)}):Fc(e,t))},beforeUnmount(e,{value:t}){Fc(e,t)}};function Fc(e,t){e.style.display=t?e[Zf]:"none",e[w2]=!t}function _4(){Ko.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const S2=Symbol("");function vpe(e){const t=$s();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Jf(i,o))},s=()=>{const o=e(t.proxy);t.ce?Jf(t.ce,o):xv(t.subTree,o),n(o)};Hx(()=>{Uf(s)}),_n(()=>{Ge(s,Yo,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),wn(()=>o.disconnect())})}function xv(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{xv(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Jf(e.el,t);else if(e.type===Pe)e.children.forEach(n=>xv(n,t));else if(e.type===Ua){let{el:n,anchor:s}=e;for(;n&&(Jf(n,t),n!==s);)n=n.nextSibling}}function Jf(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=yI(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[S2]=s}}const w4=/(?:^|;)\s*display\s*:/;function S4(e,t,n){const s=e.style,o=bn(n);let i=!1;if(n&&!o){if(t)if(bn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Gc(s,l,"")}else for(const r in t)n[r]==null&&Gc(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?x4(e,r,!bn(t)&&t?t[r]:void 0,l)||Gc(s,r,l):Gc(s,r,"")}}else if(o){if(t!==n){const r=s[S2];r&&(n+=";"+r),s.cssText=n,i=w4.test(n)}}else t&&e.removeAttribute("style");Zf in e&&(e[Zf]=i?s.display:"",e[w2]&&(s.display="none"))}const hb=/\s*!important$/;function Gc(e,t,n){if(bt(n))n.forEach(s=>Gc(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=C4(e,t);hb.test(n)?e.setProperty(lo(s),n.replace(hb,""),"important"):e[s]=n}}const mb=["Webkit","Moz","ms"],jm={};function C4(e,t){const n=jm[t];if(n)return n;let s=ps(t);if(s!=="filter"&&s in e)return jm[t]=s;s=Vp(s);for(let o=0;o<mb.length;o++){const i=mb[o]+s;if(i in e)return jm[t]=i}return t}function x4(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bn(s)&&n===s}const gb="http://www.w3.org/1999/xlink";function vb(e,t,n,s,o,i=gI(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(gb,t.slice(6,t.length)):e.setAttributeNS(gb,t,n):n==null||i&&!ox(n)?e.removeAttribute(t):e.setAttribute(t,i?"":$o(n)?String(n):n)}function yb(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?v2(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=ox(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function Ki(e,t,n,s){e.addEventListener(t,n,s)}function A4(e,t,n,s){e.removeEventListener(t,n,s)}const kb=Symbol("_vei");function T4(e,t,n,s,o=null){const i=e[kb]||(e[kb]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=M4(t);if(s){const c=i[t]=$4(s,o);Ki(e,l,c,a)}else r&&(A4(e,l,r,a),i[t]=void 0)}}const bb=/(?:Once|Passive|Capture)$/;function M4(e){let t;if(bb.test(e)){t={};let s;for(;s=e.match(bb);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):lo(e.slice(2)),t]}let Vm=0;const E4=Promise.resolve(),I4=()=>Vm||(E4.then(()=>Vm=0),Vm=Date.now());function $4(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(bt(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&Zo(c,t,5,l)}}else Zo(o,t,5,[s])};return n.value=e,n.attached=I4(),n}const _b=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,N4=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?b4(e,s,r):t==="style"?S4(e,n,s):Gu(t)?zp(t)||T4(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):L4(e,t,s,r))?(yb(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&vb(e,t,s,r,i,t!=="value")):e._isVueCE&&(P4(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bn(s)))?yb(e,ps(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),vb(e,t,s,r))};function L4(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&_b(t)&&Et(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return _b(t)&&bn(n)?!1:t in e}function P4(e,t){const n=e._def.props;if(!n)return!1;const s=ps(t);return Array.isArray(n)?n.some(o=>ps(o)===s):Object.keys(n).some(o=>ps(o)===s)}const wb={};function O4(e,t,n){let s=Ve(e,t);Up(s)&&(s=gn({},s,t));class o extends J1{constructor(r){super(s,r,n)}}return o.def=s,o}const ype=((e,t)=>O4(e,t,Z4)),R4=typeof HTMLElement<"u"?HTMLElement:class{};class J1 extends R4{constructor(t,n={},s=np){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==np?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(gn({},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 J1){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,vt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!bt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Df(this._props[a])),(l||(l=Object.create(null)))[ps(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)sn(this,s)||Object.defineProperty(this,s,{get:()=>S(n[s])})}_resolveProps(t){const{props:n}=t,s=bt(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(ps))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):wb;const o=ps(t);n&&this._numberProps&&this._numberProps[o]&&(s=Df(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===wb?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(lo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(lo(t),n+""):n||this.removeAttribute(lo(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),Q4(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=Z(this._def,gn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Up(r[0])?gn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),lo(i)!==i&&o(lo(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function D4(e){const t=$s(),n=t&&t.ce;return n||null}function kpe(){const e=D4();return e&&e.shadowRoot}function bpe(e="$style"){{const t=$s();if(!t)return qt;const n=t.type.__cssModules;if(!n)return qt;const s=n[e];return s||qt}}const C2=new WeakMap,x2=new WeakMap,ep=Symbol("_moveCb"),Sb=Symbol("_enterCb"),B4=e=>(delete e.props.mode,e),F4=B4({name:"TransitionGroup",props:gn({},k2,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=$s(),s=Ox();let o,i;return z1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!q4(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(H4),o.forEach(z4);const l=o.filter(U4);Cv(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;wi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[ep]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[ep]=null,Ar(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Xt(e),l=b2(r);let a=r.tag||Pe;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),qr(u,Cu(u,l,s,n)),C2.set(u,A2(u.el)))}i=t.default?W1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&qr(u,Cu(u,l,s,n))}return Z(a,null,i)}}}),W4=F4;function H4(e){const t=e.el;t[ep]&&t[ep](),t[Sb]&&t[Sb]()}function z4(e){x2.set(e,A2(e.el))}function U4(e){const t=C2.get(e),n=x2.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function A2(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function q4(e,t,n){const s=e.cloneNode(),o=e[ec];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=_2(s);return i.removeChild(s),r}const Kr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return bt(t)?n=>Fa(t,n):t};function j4(e){e.target.composing=!0}function Cb(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Xo=Symbol("_assign");function xb(e,t,n){return t&&(e=e.trim()),n&&(e=Kp(e)),e}const go={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[Xo]=Kr(o);const i=s||o.props&&o.props.type==="number";Ki(e,t?"change":"input",r=>{r.target.composing||e[Xo](xb(e.value,n,i))}),(n||i)&&Ki(e,"change",()=>{e.value=xb(e.value,n,i)}),t||(Ki(e,"compositionstart",j4),Ki(e,"compositionend",Cb),Ki(e,"change",Cb))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[Xo]=Kr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Kp(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},tp={deep:!0,created(e,t,n){e[Xo]=Kr(n),Ki(e,"change",()=>{const s=e._modelValue,o=tc(e),i=e.checked,r=e[Xo];if(bt(s)){const l=Yp(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(Gl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(M2(e,i))})},mounted:Ab,beforeUpdate(e,t,n){e[Xo]=Kr(n),Ab(e,t,n)}};function Ab(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(bt(t))o=Yp(t,s.props.value)>-1;else if(Gl(t))o=t.has(s.props.value);else{if(t===n)return;o=Ji(t,M2(e,!0))}e.checked!==o&&(e.checked=o)}const T2={created(e,{value:t},n){e.checked=Ji(t,n.props.value),e[Xo]=Kr(n),Ki(e,"change",()=>{e[Xo](tc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Xo]=Kr(s),t!==n&&(e.checked=Ji(t,s.props.value))}},Av={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=Gl(t);Ki(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Kp(tc(r)):tc(r));e[Xo](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,vt(()=>{e._assigning=!1})}),e[Xo]=Kr(s)},mounted(e,{value:t}){Tb(e,t)},beforeUpdate(e,t,n){e[Xo]=Kr(n)},updated(e,{value:t}){e._assigning||Tb(e,t)}};function Tb(e,t){const n=e.multiple,s=bt(t);if(!(n&&!s&&!Gl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=tc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Yp(t,l)>-1}else r.selected=t.has(l);else if(Ji(tc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function tc(e){return"_value"in e?e._value:e.value}function M2(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const V4={created(e,t,n){qd(e,t,n,null,"created")},mounted(e,t,n){qd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){qd(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){qd(e,t,n,s,"updated")}};function E2(e,t){switch(e){case"SELECT":return Av;case"TEXTAREA":return go;default:switch(t){case"checkbox":return tp;case"radio":return T2;default:return go}}}function qd(e,t,n,s,o){const r=E2(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function K4(){go.getSSRProps=({value:e})=>({value:e}),T2.getSSRProps=({value:e},t)=>{if(t.props&&Ji(t.props.value,e))return{checked:!0}},tp.getSSRProps=({value:e},t)=>{if(bt(e)){if(t.props&&Yp(e,t.props.value)>-1)return{checked:!0}}else if(Gl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},V4.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=E2(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const G4=["ctrl","shift","alt","meta"],Y4={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)=>G4.some(n=>e[`${n}Key`]&&!t.includes(n))},kt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=Y4[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},X4={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ai=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=lo(o.key);if(t.some(r=>r===i||X4[r]===i))return e(o)}))},I2=gn({patchProp:N4},g4);let iu,Mb=!1;function $2(){return iu||(iu=Y$(I2))}function N2(){return iu=Mb?iu:X$(I2),Mb=!0,iu}const Q4=((...e)=>{$2().render(...e)}),_pe=((...e)=>{N2().hydrate(...e)}),np=((...e)=>{const t=$2().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=P2(s);if(!o)return;const i=t._component;!Et(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,L2(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),Z4=((...e)=>{const t=N2().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=P2(s);if(o)return n(o,!0,L2(o))},t});function L2(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function P2(e){return bn(e)?document.querySelector(e):e}let Eb=!1;const wpe=()=>{Eb||(Eb=!0,K4(),_4())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function J4(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const sp=typeof window<"u",Jr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),eN=(e,t,n)=>tN({l:e,k:t,s:n}),tN=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),is=e=>typeof e=="number"&&isFinite(e),O2=e=>t0(e)==="[object Date]",nc=e=>t0(e)==="[object RegExp]",rh=e=>Gt(e)&&Object.keys(e).length===0,rs=Object.assign,nN=Object.create,kn=(e=null)=>nN(e);let Ib;const Ll=()=>Ib||(Ib=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:kn());function $b(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function sN(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const oN=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,iN=/^(?:href|src|action|formaction)$/i;function e0(e){return oN.test(e)}function rN(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(s,i),n+=e0(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function Nb(e,t){if(iN.test(e)&&e0(t))return"about:blank";const n=e.toLowerCase()==="style"?rN(t):t;return sN(n)}function lN(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${Nb(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${Nb(s,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,s,o)=>e0(o)?`${s}about:blank`:n),e}const aN=Object.prototype.hasOwnProperty;function Go(e,t){return aN.call(e,t)}const Gn=Array.isArray,Dn=e=>typeof e=="function",mt=e=>typeof e=="string",Jt=e=>typeof e=="boolean",en=e=>e!==null&&typeof e=="object",cN=e=>en(e)&&Dn(e.then)&&Dn(e.catch),R2=Object.prototype.toString,t0=e=>R2.call(e),Gt=e=>t0(e)==="[object Object]",uN=e=>e==null?"":Gn(e)||Gt(e)&&e.toString===R2?JSON.stringify(e,null,2):String(e);function n0(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const jd=e=>!en(e)||Gn(e);function bf(e,t){if(jd(e)||jd(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(en(s[i])&&!en(o[i])&&(o[i]=Array.isArray(s[i])?[]:kn()),jd(o[i])||jd(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function dN(e,t,n){return{line:e,column:t,offset:n}}function Tv(e,t,n){return{start:e,end:t}}const cn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},fN=17;function lh(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function pN(e){throw e}const bi=" ",hN="\r",Os=`
|
|
29
|
-
`,mN="\u2028",gN="\u2029";function vN(e){const t=e;let n=0,s=1,o=1,i=0;const r=I=>t[I]===hN&&t[I+1]===Os,l=I=>t[I]===Os,a=I=>t[I]===gN,c=I=>t[I]===mN,u=I=>r(I)||l(I)||a(I)||c(I),d=()=>n,f=()=>s,h=()=>o,p=()=>i,m=I=>r(I)||a(I)||c(I)?Os:t[I],_=()=>m(n),b=()=>m(n+i);function g(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,s=1,o=1,i=0}function C(I=0){i=I}function L(){const I=n+i;for(;I!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:_,currentPeek:b,next:g,peek:v,reset:y,resetPeek:C,skipToPeek:L}}const Wi=void 0,yN=".",Lb="'",kN="tokenizer";function bN(e,t={}){const n=t.location!==!1,s=vN(e),o=()=>s.index(),i=()=>dN(s.line(),s.column(),s.index()),r=i(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(j,G,re,...me){const Ae=c();if(G.column+=re,G.offset+=re,u){const Ee=n?Tv(Ae.startLoc,G):null,ae=lh(j,Ee,{domain:kN,args:me});u(ae)}}function f(j,G,re){j.endLoc=i(),j.currentType=G;const me={type:G};return n&&(me.loc=Tv(j.startLoc,j.endLoc)),re!=null&&(me.value=re),me}const h=j=>f(j,13);function p(j,G){return j.currentChar()===G?(j.next(),G):(d(cn.EXPECTED_TOKEN,i(),0,G),"")}function m(j){let G="";for(;j.currentPeek()===bi||j.currentPeek()===Os;)G+=j.currentPeek(),j.peek();return G}function _(j){const G=m(j);return j.skipToPeek(),G}function b(j){if(j===Wi)return!1;const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G===95}function g(j){if(j===Wi)return!1;const G=j.charCodeAt(0);return G>=48&&G<=57}function v(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const me=b(j.currentPeek());return j.resetPeek(),me}function y(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const me=j.currentPeek()==="-"?j.peek():j.currentPeek(),Ae=g(me);return j.resetPeek(),Ae}function C(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const me=j.currentPeek()===Lb;return j.resetPeek(),me}function L(j,G){const{currentType:re}=G;if(re!==7)return!1;m(j);const me=j.currentPeek()===".";return j.resetPeek(),me}function I(j,G){const{currentType:re}=G;if(re!==8)return!1;m(j);const me=b(j.currentPeek());return j.resetPeek(),me}function k(j,G){const{currentType:re}=G;if(!(re===7||re===11))return!1;m(j);const me=j.currentPeek()===":";return j.resetPeek(),me}function M(j,G){const{currentType:re}=G;if(re!==9)return!1;const me=()=>{const Ee=j.currentPeek();return Ee==="{"?b(j.peek()):Ee==="@"||Ee==="|"||Ee===":"||Ee==="."||Ee===bi||!Ee?!1:Ee===Os?(j.peek(),me()):P(j,!1)},Ae=me();return j.resetPeek(),Ae}function E(j){m(j);const G=j.currentPeek()==="|";return j.resetPeek(),G}function P(j,G=!0){const re=(Ae=!1,Ee="")=>{const ae=j.currentPeek();return ae==="{"||ae==="@"||!ae?Ae:ae==="|"?!(Ee===bi||Ee===Os):ae===bi?(j.peek(),re(!0,bi)):ae===Os?(j.peek(),re(!0,Os)):!0},me=re();return G&&j.resetPeek(),me}function A(j,G){const re=j.currentChar();return re===Wi?Wi:G(re)?(j.next(),re):null}function $(j){const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G>=48&&G<=57||G===95||G===36}function D(j){return A(j,$)}function R(j){const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G>=48&&G<=57||G===95||G===36||G===45}function H(j){return A(j,R)}function z(j){const G=j.charCodeAt(0);return G>=48&&G<=57}function q(j){return A(j,z)}function Q(j){const G=j.charCodeAt(0);return G>=48&&G<=57||G>=65&&G<=70||G>=97&&G<=102}function X(j){return A(j,Q)}function ue(j){let G="",re="";for(;G=q(j);)re+=G;return re}function ge(j){let G="";for(;;){const re=j.currentChar();if(re==="\\"){const me=j.peek();me==="{"||me==="}"||me==="@"||me==="|"||me==="\\"?(G+=re+me,j.next(),j.next()):(j.resetPeek(),G+=re,j.next())}else{if(re==="{"||re==="}"||re==="@"||re==="|"||!re)break;if(re===bi||re===Os)if(P(j))G+=re,j.next();else{if(E(j))break;G+=re,j.next()}else G+=re,j.next()}}return G}function xe(j){_(j);let G="",re="";for(;G=H(j);)re+=G;const me=j.currentChar();if(me&&me!=="}"&&me!==Wi&&me!==bi&&me!==Os&&me!==" "){const Ae=F(j);return d(cn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re+Ae),re+Ae}return j.currentChar()===Wi&&d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),re}function ke(j){_(j);let G="";return j.currentChar()==="-"?(j.next(),G+=`-${ue(j)}`):G+=ue(j),j.currentChar()===Wi&&d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),G}function ze(j){return j!==Lb&&j!==Os}function qe(j){_(j),p(j,"'");let G="",re="";for(;G=A(j,ze);)G==="\\"?re+=Ue(j):re+=G;const me=j.currentChar();return me===Os||me===Wi?(d(cn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),me===Os&&(j.next(),p(j,"'")),re):(p(j,"'"),re)}function Ue(j){const G=j.currentChar();switch(G){case"\\":case"'":return j.next(),`\\${G}`;case"u":return Le(j,G,4);case"U":return Le(j,G,6);default:return d(cn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,G),""}}function Le(j,G,re){p(j,G);let me="";for(let Ae=0;Ae<re;Ae++){const Ee=X(j);if(!Ee){d(cn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${G}${me}${j.currentChar()}`);break}me+=Ee}return`\\${G}${me}`}function le(j){return j!=="{"&&j!=="}"&&j!==bi&&j!==Os}function F(j){_(j);let G="",re="";for(;G=A(j,le);)re+=G;return re}function ne(j){let G="",re="";for(;G=D(j);)re+=G;return re}function te(j){const G=re=>{const me=j.currentChar();return me==="{"||me==="@"||me==="|"||me==="("||me===")"||!me||me===bi?re:(re+=me,j.next(),G(re))};return G("")}function U(j){_(j);const G=p(j,"|");return _(j),G}function Y(j,G){let re=null;switch(j.currentChar()){case"{":return G.braceNest>=1&&d(cn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),re=f(G,2,"{"),_(j),G.braceNest++,re;case"}":return G.braceNest>0&&G.currentType===2&&d(cn.EMPTY_PLACEHOLDER,i(),0),j.next(),re=f(G,3,"}"),G.braceNest--,G.braceNest>0&&_(j),G.inLinked&&G.braceNest===0&&(G.inLinked=!1),re;case"@":return G.braceNest>0&&d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),re=fe(j,G)||h(G),G.braceNest=0,re;default:{let Ae=!0,Ee=!0,ae=!0;if(E(j))return G.braceNest>0&&d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),re=f(G,1,U(j)),G.braceNest=0,G.inLinked=!1,re;if(G.braceNest>0&&(G.currentType===4||G.currentType===5||G.currentType===6))return d(cn.UNTERMINATED_CLOSING_BRACE,i(),0),G.braceNest=0,se(j,G);if(Ae=v(j,G))return re=f(G,4,xe(j)),_(j),re;if(Ee=y(j,G))return re=f(G,5,ke(j)),_(j),re;if(ae=C(j,G))return re=f(G,6,qe(j)),_(j),re;if(!Ae&&!Ee&&!ae)return re=f(G,12,F(j)),d(cn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re.value),_(j),re;break}}return re}function fe(j,G){const{currentType:re}=G;let me=null;const Ae=j.currentChar();switch((re===7||re===8||re===11||re===9)&&(Ae===Os||Ae===bi)&&d(cn.INVALID_LINKED_FORMAT,i(),0),Ae){case"@":return j.next(),me=f(G,7,"@"),G.inLinked=!0,me;case".":return _(j),j.next(),f(G,8,".");case":":return _(j),j.next(),f(G,9,":");default:return E(j)?(me=f(G,1,U(j)),G.braceNest=0,G.inLinked=!1,me):L(j,G)||k(j,G)?(_(j),fe(j,G)):I(j,G)?(_(j),f(G,11,ne(j))):M(j,G)?(_(j),Ae==="{"?Y(j,G)||me:f(G,10,te(j))):(re===7&&d(cn.INVALID_LINKED_FORMAT,i(),0),G.braceNest=0,G.inLinked=!1,se(j,G))}}function se(j,G){let re={type:13};if(G.braceNest>0)return Y(j,G)||h(G);if(G.inLinked)return fe(j,G)||h(G);switch(j.currentChar()){case"{":return Y(j,G)||h(G);case"}":return d(cn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(G,3,"}");case"@":return fe(j,G)||h(G);default:{if(E(j))return re=f(G,1,U(j)),G.braceNest=0,G.inLinked=!1,re;if(P(j))return f(G,0,ge(j));break}}return re}function ce(){const{currentType:j,offset:G,startLoc:re,endLoc:me}=a;return a.lastType=j,a.lastOffset=G,a.lastStartLoc=re,a.lastEndLoc=me,a.offset=o(),a.startLoc=i(),s.currentChar()===Wi?f(a,13):se(s,a)}return{nextToken:ce,currentOffset:o,currentPosition:i,context:c}}const _N="parser",wN=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,SN=/\\([\\@{}|])/g;function CN(e,t){return t}function xN(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function AN(e={}){const t=e.location!==!1,{onError:n}=e;function s(b,g,v,y,...C){const L=b.currentPosition();if(L.offset+=y,L.column+=y,n){const I=t?Tv(v,L):null,k=lh(g,I,{domain:_N,args:C});n(k)}}function o(b,g,v){const y={type:b};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(b,g,v,y){t&&(b.end=g,b.loc&&(b.loc.end=v))}function r(b,g){const v=b.context(),y=o(3,v.offset,v.startLoc);return y.value=g.replace(SN,CN),i(y,b.currentOffset(),b.currentPosition()),y}function l(b,g){const v=b.context(),{lastOffset:y,lastStartLoc:C}=v,L=o(5,y,C);return L.index=parseInt(g,10),b.nextToken(),i(L,b.currentOffset(),b.currentPosition()),L}function a(b,g){const v=b.context(),{lastOffset:y,lastStartLoc:C}=v,L=o(4,y,C);return L.key=g,b.nextToken(),i(L,b.currentOffset(),b.currentPosition()),L}function c(b,g){const v=b.context(),{lastOffset:y,lastStartLoc:C}=v,L=o(9,y,C);return L.value=g.replace(wN,xN),b.nextToken(),i(L,b.currentOffset(),b.currentPosition()),L}function u(b){const g=b.nextToken(),v=b.context(),{lastOffset:y,lastStartLoc:C}=v,L=o(8,y,C);return g.type!==11?(s(b,cn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),L.value="",i(L,y,C),{nextConsumeToken:g,node:L}):(g.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,_i(g)),L.value=g.value||"",i(L,b.currentOffset(),b.currentPosition()),{node:L})}function d(b,g){const v=b.context(),y=o(7,v.offset,v.startLoc);return y.value=g,i(y,b.currentOffset(),b.currentPosition()),y}function f(b){const g=b.context(),v=o(6,g.offset,g.startLoc);let y=b.nextToken();if(y.type===8){const C=u(b);v.modifier=C.node,y=C.nextConsumeToken||b.nextToken()}switch(y.type!==9&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),y=b.nextToken(),y.type===2&&(y=b.nextToken()),y.type){case 10:y.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),v.key=d(b,y.value||"");break;case 4:y.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),v.key=a(b,y.value||"");break;case 5:y.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),v.key=l(b,y.value||"");break;case 6:y.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(y)),v.key=c(b,y.value||"");break;default:{s(b,cn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const C=b.context(),L=o(7,C.offset,C.startLoc);return L.value="",i(L,C.offset,C.startLoc),v.key=L,i(v,C.offset,C.startLoc),{nextConsumeToken:y,node:v}}}return i(v,b.currentOffset(),b.currentPosition()),{node:v}}function h(b){const g=b.context(),v=g.currentType===1?b.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,C=o(2,v,y);C.items=[];let L=null;do{const M=L||b.nextToken();switch(L=null,M.type){case 0:M.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(M)),C.items.push(r(b,M.value||""));break;case 5:M.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(M)),C.items.push(l(b,M.value||""));break;case 4:M.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(M)),C.items.push(a(b,M.value||""));break;case 6:M.value==null&&s(b,cn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_i(M)),C.items.push(c(b,M.value||""));break;case 7:{const E=f(b);C.items.push(E.node),L=E.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const I=g.currentType===1?g.lastOffset:b.currentOffset(),k=g.currentType===1?g.lastEndLoc:b.currentPosition();return i(C,I,k),C}function p(b,g,v,y){const C=b.context();let L=y.items.length===0;const I=o(1,g,v);I.cases=[],I.cases.push(y);do{const k=h(b);L||(L=k.items.length===0),I.cases.push(k)}while(C.currentType!==13);return L&&s(b,cn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(I,b.currentOffset(),b.currentPosition()),I}function m(b){const g=b.context(),{offset:v,startLoc:y}=g,C=h(b);return g.currentType===13?C:p(b,v,y,C)}function _(b){const g=bN(b,rs({},e)),v=g.context(),y=o(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=b),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(b)),v.currentType!==13&&s(g,cn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,b[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:_}}function _i(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 TN(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Pb(e,t){for(let n=0;n<e.length;n++)s0(e[n],t)}function s0(e,t){switch(e.type){case 1:Pb(e.cases,t),t.helper("plural");break;case 2:Pb(e.items,t);break;case 6:{s0(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 MN(e,t={}){const n=TN(e);n.helper("normalize"),e.body&&s0(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function EN(e){const t=e.body;return t.type===2?Ob(t):t.cases.forEach(n=>Ob(n)),e}function Ob(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=n0(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function xa(e){switch(e.t=e.type,e.type){case 0:{const t=e;xa(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)xa(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)xa(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;xa(t.key),t.k=t.key,delete t.key,t.modifier&&(xa(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 IN(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,_){r.code+=m}function c(m,_=!0){const b=_?s:"";a(o?b+" ".repeat(m):b)}function u(m=!0){const _=++r.indentLevel;m&&c(_)}function d(m=!0){const _=--r.indentLevel;m&&c(_)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function $N(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),sc(e,t.key),t.modifier?(e.push(", "),sc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function NN(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(sc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function LN(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(sc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function PN(e,t){t.body?sc(e,t.body):e.push("null")}function sc(e,t){const{helper:n}=e;switch(t.type){case 0:PN(e,t);break;case 1:LN(e,t);break;case 2:NN(e,t);break;case 6:$N(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 ON=(e,t={})=>{const n=mt(t.mode)?t.mode:"normal",s=mt(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=IN(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${n0(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),sc(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 RN(e,t={}){const n=rs({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=AN(n).parse(e);return s?(i&&EN(l),o&&xa(l),{ast:l,code:""}):(MN(l,n),ON(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function DN(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ll().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ll().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ei(e){return en(e)&&o0(e)===0&&(Go(e,"b")||Go(e,"body"))}const D2=["b","body"];function BN(e){return el(e,D2)}const B2=["c","cases"];function FN(e){return el(e,B2,[])}const F2=["s","static"];function WN(e){return el(e,F2)}const W2=["i","items"];function HN(e){return el(e,W2,[])}const H2=["t","type"];function o0(e){return el(e,H2)}const z2=["v","value"];function Vd(e,t){const n=el(e,z2);if(n!=null)return n;throw Mu(t)}const U2=["m","modifier"];function zN(e){return el(e,U2)}const q2=["k","key"];function UN(e){const t=el(e,q2);if(t)return t;throw Mu(6)}function el(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(Go(e,o)&&e[o]!=null)return e[o]}return n}const j2=[...D2,...B2,...F2,...W2,...q2,...U2,...z2,...H2];function Mu(e){return new Error(`unhandled node type: ${e}`)}function Km(e){return n=>qN(n,e)}function qN(e,t){const n=BN(t);if(n==null)throw Mu(0);if(o0(n)===1){const i=FN(n);return e.plural(i.reduce((r,l)=>[...r,Rb(e,l)],[]))}else return Rb(e,n)}function Rb(e,t){const n=WN(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=HN(t).reduce((o,i)=>[...o,Mv(e,i)],[]);return e.normalize(s)}}function Mv(e,t){const n=o0(t);switch(n){case 3:return Vd(t,n);case 9:return Vd(t,n);case 4:{const s=t;if(Go(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(Go(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Mu(n)}case 5:{const s=t;if(Go(s,"i")&&is(s.i))return e.interpolate(e.list(s.i));if(Go(s,"index")&&is(s.index))return e.interpolate(e.list(s.index));throw Mu(n)}case 6:{const s=t,o=zN(s),i=UN(s);return e.linked(Mv(e,i),o?Mv(e,o):void 0,e.type)}case 7:return Vd(t,n);case 8:return Vd(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const jN=e=>e;let Kd=kn();function VN(e,t={}){let n=!1;const s=t.onError||pN;return t.onError=o=>{n=!0,s(o)},{...RN(e,t),detectError:n}}function KN(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&mt(e)){Jt(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||jN)(e),o=Kd[s];if(o)return o;const{ast:i,detectError:r}=VN(e,{...t,location:!1,jit:!0}),l=Km(i);return r?l:Kd[s]=l}else{const n=e.cacheKey;if(n){const s=Kd[n];return s||(Kd[n]=Km(e))}else return Km(e)}}let Eu=null;function GN(e){Eu=e}function YN(e,t,n){Eu&&Eu.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const XN=QN("function:translate");function QN(e){return t=>Eu&&Eu.emit(e,t)}const Gi={INVALID_ARGUMENT:fN,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},ZN=24;function Yi(e){return lh(e,null,void 0)}function i0(e,t){return t.locale!=null?Db(t.locale):Db(e.locale)}let Gm;function Db(e){if(mt(e))return e;if(Dn(e)){if(e.resolvedOnce&&Gm!=null)return Gm;if(e.constructor.name==="Function"){const t=e();if(cN(t))throw Yi(Gi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Gm=t}else throw Yi(Gi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Yi(Gi.NOT_SUPPORT_LOCALE_TYPE)}function JN(e,t,n){return[...new Set([n,...Gn(t)?t:en(t)?Object.keys(t):mt(t)?[t]:[n]])]}function Ev(e,t,n){const s=mt(n)?n:Iu,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;Gn(r);)r=Bb(i,r,t);const l=Gn(t)||!Gt(t)?t:t.default?t.default:null;r=mt(l)?[l]:l,Gn(r)&&Bb(i,r,!1),o.__localeChainCache.set(s,i)}return i}function Bb(e,t,n){let s=!0;for(let o=0;o<t.length&&Jt(s);o++){const i=t[o];mt(i)&&(s=e6(e,t[o],n))}return s}function e6(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=t6(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function t6(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(Gn(n)||Gt(n))&&n[o]&&(s=n[o])}return s}const tl=[];tl[0]={w:[0],i:[3,0],"[":[4],o:[7]};tl[1]={w:[1],".":[2],"[":[4],o:[7]};tl[2]={w:[2],i:[3,0],0:[3,0]};tl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};tl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};tl[5]={"'":[4,0],o:8,l:[5,0]};tl[6]={'"':[4,0],o:8,l:[6,0]};const n6=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function s6(e){return n6.test(e)}function o6(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 i6(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 r6(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:s6(t)?o6(t):"*"+t}function l6(e){const t=[];let n=-1,s=0,o=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),o++},f[3]=()=>{if(o>0)o--,s=4,f[0]();else{if(o=0,r===void 0||(r=r6(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(s===5&&p==="'"||s===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=i6(i),d=tl[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const Fb=new Map;function a6(e,t){return en(e)?e[t]:null}function c6(e,t){if(!en(e))return null;let n=Fb.get(t);if(n||(n=l6(t),n&&Fb.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(j2.includes(r)&&Ei(o)||!en(o)||!Go(o,r))return null;const l=o[r];if(l===void 0||Dn(o))return null;o=l,i++}return o}const u6="11.4.5",ah=-1,Iu="en-US",op="",Wb=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function d6(){return{upper:(e,t)=>t==="text"&&mt(e)?e.toUpperCase():t==="vnode"&&en(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&mt(e)?e.toLowerCase():t==="vnode"&&en(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&mt(e)?Wb(e):t==="vnode"&&en(e)&&"__v_isVNode"in e?Wb(e.children):e}}let V2;function f6(e){V2=e}let K2;function p6(e){K2=e}let G2;function h6(e){G2=e}let Y2=null;const m6=e=>{Y2=e},g6=()=>Y2;let X2=null;const Hb=e=>{X2=e},v6=()=>X2;let zb=0;function y6(e={}){const t=Dn(e.onWarn)?e.onWarn:J4,n=mt(e.version)?e.version:u6,s=mt(e.locale)||Dn(e.locale)?e.locale:Iu,o=Dn(s)?Iu:s,i=Gn(e.fallbackLocale)||Gt(e.fallbackLocale)||mt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Gt(e.messages)?e.messages:Ym(o),l=Gt(e.datetimeFormats)?e.datetimeFormats:Ym(o),a=Gt(e.numberFormats)?e.numberFormats:Ym(o),c=rs(kn(),e.modifiers,d6()),u=e.pluralRules||kn(),d=Dn(e.missing)?e.missing:null,f=Jt(e.missingWarn)||nc(e.missingWarn)?e.missingWarn:!0,h=Jt(e.fallbackWarn)||nc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,_=Dn(e.postTranslation)?e.postTranslation:null,b=Gt(e.processor)?e.processor:null,g=Jt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Dn(e.messageCompiler)?e.messageCompiler:V2,C=Dn(e.messageResolver)?e.messageResolver:K2||a6,L=Dn(e.localeFallbacker)?e.localeFallbacker:G2||JN,I=en(e.fallbackContext)?e.fallbackContext:void 0,k=e,M=en(k.__datetimeFormatters)?k.__datetimeFormatters:new Map,E=en(k.__numberFormatters)?k.__numberFormatters:new Map,P=en(k.__meta)?k.__meta:{};zb++;const A={version:n,cid:zb,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:_,processor:b,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:C,localeFallbacker:L,fallbackContext:I,onWarn:t,__meta:P};return A.datetimeFormats=l,A.numberFormats=a,A.__datetimeFormatters=M,A.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&YN(A,n,P),A}const Ym=e=>({[e]:kn()});function r0(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return mt(l)?l:t}else return t}function Wc(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function k6(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function b6(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(k6(e,t[s]))return!0;return!1}function Ub(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!mt(t[0])&&!O2(t[0])&&!is(t[0]))return op;const[a,c,u,d]=Iv(...t),f=Jt(u.missingWarn)?u.missingWarn:e.missingWarn;Jt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=i0(e,u),m=r(e,o,p);if(!mt(a)||a===""){const L=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let _={},b,g=null;const v="datetime format";for(let L=0;L<m.length&&(b=m[L],_=n[b]||{},g=_[a],!Gt(g));L++)r0(e,a,b,f,v);if(!Gt(g)||!mt(b))return s?ah:a;let y=`${b}__${a}`;rh(d)||(y=`${y}__${JSON.stringify(d)}`);let C=l.get(y);return C||(C=new Intl.DateTimeFormat(b,rs({},g,d)),l.set(y,C)),h?C.formatToParts(c):C.format(c)}const Q2=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Iv(...e){const[t,n,s,o]=e,i=kn();let r=kn(),l;if(mt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Yi(Gi.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 Yi(Gi.INVALID_ISO_DATE_ARGUMENT)}}else if(O2(t)){if(isNaN(t.getTime()))throw Yi(Gi.INVALID_DATE_ARGUMENT);l=t}else if(is(t))l=t;else throw Yi(Gi.INVALID_ARGUMENT);return mt(n)?i.key=n:Gt(n)&&Object.keys(n).forEach(a=>{Q2.includes(a)?r[a]=n[a]:i[a]=n[a]}),mt(s)?i.locale=s:Gt(s)&&(r=s),Gt(o)&&(r=o),[i.key||"",l,i,r]}function qb(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function jb(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!is(t[0]))return op;const[a,c,u,d]=$v(...t),f=Jt(u.missingWarn)?u.missingWarn:e.missingWarn;Jt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=i0(e,u),m=r(e,o,p);if(!mt(a)||a===""){const L=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let _={},b,g=null;const v="number format";for(let L=0;L<m.length&&(b=m[L],_=n[b]||{},g=_[a],!Gt(g));L++)r0(e,a,b,f,v);if(!Gt(g)||!mt(b))return s?ah:a;let y=`${b}__${a}`;rh(d)||(y=`${y}__${JSON.stringify(d)}`);let C=l.get(y);return C||(C=new Intl.NumberFormat(b,rs({},g,d)),l.set(y,C)),h?C.formatToParts(c):C.format(c)}const Z2=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function $v(...e){const[t,n,s,o]=e,i=kn();let r=kn();if(!is(t))throw Yi(Gi.INVALID_ARGUMENT);const l=t;return mt(n)?i.key=n:Gt(n)&&Object.keys(n).forEach(a=>{Z2.includes(a)?r[a]=n[a]:i[a]=n[a]}),mt(s)?i.locale=s:Gt(s)&&(r=s),Gt(o)&&(r=o),[i.key||"",l,i,r]}function Vb(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const _6=e=>e,w6=e=>"",S6="text",C6=e=>e.length===0?"":n0(e),x6=uN;function Xm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function A6(e){const t=is(e.pluralIndex)?e.pluralIndex:-1;return is(e.named?.count)?e.named.count:is(e.named?.n)?e.named.n:t}function T6(e={}){const t=e.locale,n=A6(e),s=mt(t)&&Dn(e.pluralRules?.[t])?e.pluralRules[t]:Xm,o=s===Xm?void 0:Xm,i=b=>b[s(n,b.length,o)],r=e.list||[],l=b=>r[b],a=e.named||kn();is(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=b=>a[b];function u(b,g){const v=Dn(e.messages)?e.messages(b,!!g):en(e.messages)?e.messages[b]:!1;return v||(e.parent?e.parent.message(b):w6)}const d=b=>e.modifiers?e.modifiers[b]:_6,f=Dn(e.processor?.normalize)?e.processor.normalize:C6,h=Dn(e.processor?.interpolate)?e.processor.interpolate:x6,p=mt(e.processor?.type)?e.processor.type:S6,_={list:l,named:c,plural:i,linked:(b,...g)=>{const[v,y]=g;let C="text",L="";g.length===1?en(v)?(L=v.modifier||L,C=v.type||C):mt(v)&&(L=v||L):g.length===2&&(mt(v)&&(L=v||L),mt(y)&&(C=y||C));const I=u(b,!0)(_),k=I===""||I===void 0?b:I,M=C==="vnode"&&Gn(k)&&L?k[0]:k;return L?d(L)(M,C):M},message:u,type:p,interpolate:h,normalize:f,values:rs(kn(),r,a)};return _}const Kb=()=>"",qo=e=>Dn(e);function Gb(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Nv(...t),u=Jt(c.missingWarn)?c.missingWarn:e.missingWarn,d=Jt(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=Jt(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=mt(c.default)||Jt(c.default)?Jt(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(mt(p)||Dn(p)),_=i0(e,c);f&&M6(c);let[b,g,v]=h?[a,_,l[_]||kn()]:J2(e,a,_,r,d,u),y=b,C=a;if(!h&&!(mt(y)||Ei(y)||qo(y))&&m&&(y=p,C=y),!h&&(!(mt(y)||Ei(y)||qo(y))||!mt(g)))return o?ah:a;let L=!1;const I=()=>{L=!0},k=qo(y)?y:eA(e,a,g,y,C,I);if(L)return y;const M=$6(e,g,v,c),E=T6(M),P=E6(e,k,E);let A=s?s(P,a):P;if(f&&mt(A)&&(A=lN(A)),__INTLIFY_PROD_DEVTOOLS__){const $={timestamp:Date.now(),key:mt(a)?a:qo(y)?y.key:"",locale:g||(qo(y)?y.locale:""),format:mt(y)?y:qo(y)?y.source:"",message:A};$.meta=rs({},e.__meta,g6()||{}),XN($)}return A}function M6(e){Gn(e.list)?e.list=e.list.map(t=>mt(t)?$b(t):t):en(e.named)&&Object.keys(e.named).forEach(t=>{mt(e.named[t])&&(e.named[t]=$b(e.named[t]))})}function J2(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=kn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||kn(),(h=a(d,t))===null&&(h=d[t]),!(mt(h)||Ei(h)||qo(h)));m++)if(!b6(f,u)){const _=r0(e,t,f,i,p);_!==t&&(h=_)}return[h,f,d]}function eA(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(qo(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,I6(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function E6(e,t,n){return t(n)}function Nv(...e){const[t,n,s]=e,o=kn();if(!mt(t)&&!is(t)&&!qo(t)&&!Ei(t))throw Yi(Gi.INVALID_ARGUMENT);const i=is(t)?String(t):(qo(t),t);return is(n)?o.plural=n:mt(n)?o.default=n:Gt(n)&&!rh(n)?o.named=n:Gn(n)&&(o.list=n),is(s)?o.plural=s:mt(s)?o.default=s:Gt(s)&&rs(o,s),[i,o]}function I6(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>eN(t,n,r)}}function $6(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:o,pluralRules:i,messages:(h,p)=>{let m=r(n,h);if(m==null&&(u||p)){const[_,,b]=J2(u||e,h,t,l,a,c);m=_??r(b,h)}if(mt(m)||Ei(m)){let _=!1;const g=eA(e,h,t,m,h,()=>{_=!0});return _?Kb:g}else return qo(m)?m:Kb}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),is(s.plural)&&(f.pluralIndex=s.plural),f}DN();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const N6="11.4.5";function L6(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ll().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ll().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ll().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ll().__INTLIFY_PROD_DEVTOOLS__=!1)}const Ys={UNEXPECTED_RETURN_TYPE:ZN,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 co(e,...t){return lh(e,null,void 0)}const Lv=Jr("__translateVNode"),Pv=Jr("__datetimeParts"),Ov=Jr("__numberParts"),tA=Jr("__setPluralRules"),nA=Jr("__injectWithOption"),$a=Jr("__dispose");function $u(e){if(!en(e)||Ei(e))return e;for(const t in e)if(Go(e,t))if(!t.includes("."))en(e[t])&&$u(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=kn()),!en(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Ei(o)?j2.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Ei(o)){const r=o[n[s]];en(r)&&$u(r)}}return e}function l0(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Gt(n)?n:Gn(s)?kn():{[e]:kn()};if(Gn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||kn(),bf(c,r[a])):bf(c,r)}else mt(l)&&bf(JSON.parse(l),r)}),o==null&&i)for(const l in r)Go(r,l)&&$u(r[l]);return r}function sA(e){return e.type}function oA(e,t,n){let s=en(t.messages)?t.messages:kn();"__i18nGlobal"in n&&(s=l0(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[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 Yb(e){return Z(Wr,null,e,0)}function Nu(){return $s()}const Xb="__INTLIFY_META__",Qb=()=>[],P6=()=>!1;let Zb=0;function Jb(e){return((t,n,s,o)=>e(n,s,Nu()||void 0,o))}const O6=()=>{const e=Nu();let t=null;return e&&(t=sA(e)[Xb])?{[Xb]:t}:null};function ip(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=sp?ee:Yl;let r=Jt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:mt(e.locale)?e.locale:Iu),a=i(t&&r?t.fallbackLocale.value:mt(e.fallbackLocale)||Gn(e.fallbackLocale)||Gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(l0(l.value,e)),u=i(Gt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Gt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:Jt(e.missingWarn)||nc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:Jt(e.fallbackWarn)||nc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:Jt(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,_=Dn(e.missing)?e.missing:null,b=Dn(e.missing)?Jb(e.missing):null,g=Dn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:Jt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const C=t?t.modifiers:Gt(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,I;I=(()=>{s&&Hb(null);const ae={version:N6,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:C,pluralRules:L,missing:b===null?void 0:b,missingWarn:f,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=Gt(I)?I.__datetimeFormatters:void 0,ae.__numberFormatters=Gt(I)?I.__numberFormatters:void 0;const Ce=y6(ae);return s&&Hb(Ce),Ce})(),Wc(I,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const E=W({get:()=>l.value,set:ae=>{I.locale=ae,l.value=ae}}),P=W({get:()=>a.value,set:ae=>{I.fallbackLocale=ae,a.value=ae,Wc(I,l.value,ae)}}),A=W(()=>c.value),$=W(()=>u.value),D=W(()=>d.value);function R(){return Dn(g)?g:null}function H(ae){g=ae,I.postTranslation=ae}function z(){return _}function q(ae){ae!==null&&(b=Jb(ae)),_=ae,I.missing=b}const Q=(ae,Ce,Xe,tt,xt,wt)=>{M();let It;try{__INTLIFY_PROD_DEVTOOLS__,s||(I.fallbackContext=t?v6():void 0),It=ae(I)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(I.fallbackContext=void 0)}if(Xe!=="translate exists"&&is(It)&&It===ah||Xe==="translate exists"&&!It){const[Wt,_t]=Ce();return t&&p?tt(t):xt(Wt)}else{if(wt(It))return It;throw co(Ys.UNEXPECTED_RETURN_TYPE)}};function X(...ae){return Q(Ce=>Reflect.apply(Gb,null,[Ce,...ae]),()=>Nv(...ae),"translate",Ce=>Reflect.apply(Ce.t,Ce,[...ae]),Ce=>Ce,Ce=>mt(Ce))}function ue(...ae){const[Ce,Xe,tt]=ae;if(tt&&!en(tt))throw co(Ys.INVALID_ARGUMENT);return X(Ce,Xe,rs({resolvedMessage:!0},tt||{}))}function ge(...ae){return Q(Ce=>Reflect.apply(Ub,null,[Ce,...ae]),()=>Iv(...ae),"datetime format",Ce=>Reflect.apply(Ce.d,Ce,[...ae]),()=>op,Ce=>mt(Ce)||Gn(Ce))}function xe(...ae){return Q(Ce=>Reflect.apply(jb,null,[Ce,...ae]),()=>$v(...ae),"number format",Ce=>Reflect.apply(Ce.n,Ce,[...ae]),()=>op,Ce=>mt(Ce)||Gn(Ce))}function ke(ae){return ae.map(Ce=>mt(Ce)||is(Ce)||Jt(Ce)?Yb(String(Ce)):Ce)}const qe={normalize:ke,interpolate:ae=>ae,type:"vnode"};function Ue(...ae){return Q(Ce=>{let Xe;const tt=Ce;try{tt.processor=qe,Xe=Reflect.apply(Gb,null,[tt,...ae])}finally{tt.processor=null}return Xe},()=>Nv(...ae),"translate",Ce=>Ce[Lv](...ae),Ce=>[Yb(Ce)],Ce=>Gn(Ce))}function Le(...ae){return Q(Ce=>Reflect.apply(jb,null,[Ce,...ae]),()=>$v(...ae),"number format",Ce=>Ce[Ov](...ae),Qb,Ce=>mt(Ce)||Gn(Ce))}function le(...ae){return Q(Ce=>Reflect.apply(Ub,null,[Ce,...ae]),()=>Iv(...ae),"datetime format",Ce=>Ce[Pv](...ae),Qb,Ce=>mt(Ce)||Gn(Ce))}function F(ae){L=ae,I.pluralRules=L}function ne(ae,Ce){return Q(()=>{if(!ae)return!1;const Xe=mt(Ce)?Ce:l.value,tt=mt(Ce)?[Xe]:Ev(I,a.value,Xe);for(let xt=0;xt<tt.length;xt++){const wt=Y(tt[xt]);let It=I.messageResolver(wt,ae);if(It===null&&(It=wt[ae]),Ei(It)||qo(It)||mt(It))return!0}return!1},()=>[ae],"translate exists",Xe=>Reflect.apply(Xe.te,Xe,[ae,Ce]),P6,Xe=>Jt(Xe))}function te(ae){let Ce=null;const Xe=Ev(I,a.value,l.value);for(let tt=0;tt<Xe.length;tt++){const xt=c.value[Xe[tt]]||{},wt=I.messageResolver(xt,ae);if(wt!=null){Ce=wt;break}}return Ce}function U(ae){const Ce=te(ae);return Ce??(t?t.tm(ae)||{}:{})}function Y(ae){return c.value[ae]||{}}function fe(ae,Ce){if(o){const Xe={[ae]:Ce};for(const tt in Xe)Go(Xe,tt)&&$u(Xe[tt]);Ce=Xe[ae]}c.value[ae]=Ce,I.messages=c.value}function se(ae,Ce){c.value[ae]=c.value[ae]||{};const Xe={[ae]:Ce};if(o)for(const tt in Xe)Go(Xe,tt)&&$u(Xe[tt]);Ce=Xe[ae],bf(Ce,c.value[ae]),I.messages=c.value}function ce(ae){return u.value[ae]||{}}function j(ae,Ce){u.value[ae]=Ce,I.datetimeFormats=u.value,qb(I,ae,Ce)}function G(ae,Ce){u.value[ae]=rs(u.value[ae]||{},Ce),I.datetimeFormats=u.value,qb(I,ae,Ce)}function re(ae){return d.value[ae]||{}}function me(ae,Ce){d.value[ae]=Ce,I.numberFormats=d.value,Vb(I,ae,Ce)}function Ae(ae,Ce){d.value[ae]=rs(d.value[ae]||{},Ce),I.numberFormats=d.value,Vb(I,ae,Ce)}Zb++,t&&sp&&(Ge(t.locale,ae=>{r&&(l.value=ae,I.locale=ae,Wc(I,l.value,a.value))}),Ge(t.fallbackLocale,ae=>{r&&(a.value=ae,I.fallbackLocale=ae,Wc(I,l.value,a.value))}));const Ee={id:Zb,locale:E,fallbackLocale:P,get inheritLocale(){return r},set inheritLocale(ae){r=ae,ae&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Wc(I,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:A,get modifiers(){return C},get pluralRules(){return L||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(ae){f=ae,I.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ae){h=ae,I.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(ae){p=ae},get fallbackFormat(){return m},set fallbackFormat(ae){m=ae,I.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(ae){v=ae,I.warnHtmlMessage=ae},get escapeParameter(){return y},set escapeParameter(ae){y=ae,I.escapeParameter=ae},t:X,getLocaleMessage:Y,setLocaleMessage:fe,mergeLocaleMessage:se,getPostTranslationHandler:R,setPostTranslationHandler:H,getMissingHandler:z,setMissingHandler:q,[tA]:F};return Ee.datetimeFormats=$,Ee.numberFormats=D,Ee.rt=ue,Ee.te=ne,Ee.tm=U,Ee.d=ge,Ee.n=xe,Ee.getDateTimeFormat=ce,Ee.setDateTimeFormat=j,Ee.mergeDateTimeFormat=G,Ee.getNumberFormat=re,Ee.setNumberFormat=me,Ee.mergeNumberFormat=Ae,Ee[nA]=n,Ee[Lv]=Ue,Ee[Pv]=le,Ee[Ov]=Le,Ee}function R6(e){const t=mt(e.locale)?e.locale:Iu,n=mt(e.fallbackLocale)||Gn(e.fallbackLocale)||Gt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Dn(e.missing)?e.missing:void 0,o=Jt(e.silentTranslationWarn)||nc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Jt(e.silentFallbackWarn)||nc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Jt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Gt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Dn(e.postTranslation)?e.postTranslation:void 0,d=mt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=Jt(e.sync)?e.sync:!0;let p=e.messages;if(Gt(e.sharedMessages)){const C=e.sharedMessages;p=Object.keys(C).reduce((I,k)=>{const M=I[k]||(I[k]={});return rs(M,C[k]),I},p||{})}const{__i18n:m,__root:_,__injectWithOption:b}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:y,datetimeFormats:g,numberFormats:v,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:_,__injectWithOption:b}}function Rv(e={}){const t=ip(R6(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Jt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Jt(o)?!o:o},get silentFallbackWarn(){return Jt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Jt(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function D6(e,t,n){return{beforeCreate(){const s=Nu();if(!s)throw co(Ys.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=e_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Rv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=e_(e,o);else{this.$i18n=Rv({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&oA(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=Nu();if(!s)throw co(Ys.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function e_(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[tA](t.pluralizationRules||e.pluralizationRules);const n=l0(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const a0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function B6({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Pe?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},kn())}function iA(){return Pe}const F6=Ve({name:"i18n-t",props:rs({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>is(e)||!isNaN(e)}},a0),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=kn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=mt(e.plural)?+e.plural:e.plural);const u=B6(t,a);return o[Lv](e.keypath,u,c)},r=rs(kn(),s),l=mt(e.tag)||en(e.tag)?e.tag:iA();return en(l)?un(l,r,{default:i}):un(l,r,i())}}}),t_=F6;function W6(e){return Gn(e)&&!mt(e[0])}function rA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=kn();e.locale&&(c.locale=e.locale),mt(e.format)?c.key=e.format:en(e.format)&&(mt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?rs(kn(),h,{[p]:e.format[p]}):h,kn()));const d=s(e.value,c,u);let f=[c.key];return Gn(d)?f=d.map((h,p)=>{const m=o[h.type],_=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return W6(_)&&(_[0].key=`${h.type}-${p}`),_}):mt(d)&&(f=[d]),f},l=rs(kn(),i),a=mt(e.tag)||en(e.tag)?e.tag:iA();return en(a)?un(a,l,{default:r}):un(a,l,r())}}const H6=Ve({name:"i18n-n",props:rs({value:{type:Number,required:!0},format:{type:[String,Object]}},a0),setup(e,t){const n=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return rA(e,t,Z2,(...s)=>n[Ov](...s))}}),n_=H6;function z6(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function U6(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw co(Ys.UNEXPECTED_ERROR);const c=z6(e,l.$),u=s_(a);return[Reflect.apply(c.t,c,[...o_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);sp&&(r.__i18nWatcher=Ge(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{sp&&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=s_(l);r.textContent=Reflect.apply(a.t,a,[...o_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function s_(e){if(mt(e))return{path:e};if(Gt(e)){if(!("path"in e))throw co(Ys.REQUIRED_VALUE,"path");return e}else throw co(Ys.INVALID_VALUE)}function o_(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return mt(n)&&(r.locale=n),is(o)&&(r.plural=o),is(i)&&(r.plural=i),[t,l,r]}function q6(e,t,...n){const s=Gt(n[0])?n[0]:{};(Jt(s.globalInstall)?s.globalInstall:!0)&&([t_.name,"I18nT"].forEach(i=>e.component(i,t_)),[n_.name,"I18nN"].forEach(i=>e.component(i,n_)),[l_.name,"I18nD"].forEach(i=>e.component(i,l_))),e.directive("t",U6(t))}const j6=Jr("global-vue-i18n");function V6(e={}){const t=__VUE_I18N_LEGACY_API__&&Jt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Jt(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=K6(e,t),r=Jr("");function l(d){return s.get(d)||null}function a(d,f){s.set(d,f)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Gt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=eL(d,u.global)),__VUE_I18N_FULL_INSTALL__&&q6(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(D6(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Nt(e={}){const t=Nu();if(t==null)throw co(Ys.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw co(Ys.NOT_INSTALLED);const n=G6(t),s=X6(n),o=sA(t),i=Y6(e,o);if(i==="global")return oA(s,e,o),s;if(i==="parent"){let a=i_(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw co(Ys.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=rs({},e),u=i_(n,t);c.__root=u||s;const d=ip(c);return a.__composerExtend&&(d[$a]=a.__composerExtend(d)),P1()&&O1(()=>{const h=d[$a];h&&(h(),delete d[$a])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=rs({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=ip(a),r.__composerExtend&&(l[$a]=r.__composerExtend(l)),Z6(r,t,l),r.__setInstance(t,l)}return l}function K6(e,t){const n=kI(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Rv(e)):n.run(()=>ip(e));if(s==null)throw co(Ys.UNEXPECTED_ERROR);return[n,s]}function G6(e){const t=jt(e.isCE?j6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw co(e.isCE?Ys.NOT_INSTALLED_WITH_PROVIDE:Ys.UNEXPECTED_ERROR);return t}function Y6(e,t){return rh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function X6(e){return e.mode==="composition"?e.global:e.global.__composer}function i_(e,t,n=!1){let s=null;const o=t.root;let i=Q6(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[nA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function Q6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Z6(e,t,n){_n(()=>{},t),wn(()=>{const s=n;e.__deleteInstance(t);const o=s[$a];o&&(o(),delete s[$a])},t)}const J6=["locale","fallbackLocale","availableLocales"],r_=["t","rt","d","n","tm","te"];function eL(e,t){const n=Object.create(null);return J6.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw co(Ys.UNEXPECTED_ERROR);const r=Jn(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,r_.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw co(Ys.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,r_.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const tL=Ve({name:"i18n-d",props:rs({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},a0),setup(e,t){const n=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return rA(e,t,Q2,(...s)=>n[Pv](...s))}}),l_=tL;L6();f6(KN);p6(c6);h6(Ev);if(__INTLIFY_PROD_DEVTOOLS__){const e=Ll();e.__INTLIFY__=!0,GN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const $t={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 a_(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function Xn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function es(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function oc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function ed(e){const t=Xn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function fc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function c0(){const e=Xn($t.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function u0(e){const n={...c0()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];es($t.unread,JSON.stringify(n))}function nL(){const e=ed($t.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function Qm(e){fc($t.collapsedWorkspaces,Array.from(e))}function sL(){return ed($t.showWorkspacePaths)===!0}function oL(e){fc($t.showWorkspacePaths,e)}function iL(){const e=ed($t.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function lA(e){fc($t.workspaceOrder,Array.from(e))}function Gd(){const e=ed($t.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,s]of Object.entries(e))typeof s=="string"&&(t[n]=s);return t}function c_(e){fc($t.workspaceNameOverrides,e)}function rL(){return Xn($t.workspaceSort)}function aA(e){es($t.workspaceSort,e)}const u_=$t.clientId,lL="kimi-code-web",aL="web";function cL(){return{serverHttpUrl:dL(),clientId:mL(),clientName:lL,clientVersion:gL(),clientUiMode:aL}}function uL(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function dL(e){const t=uL(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function fL(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function pL(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return fL(e)}function rp(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function hL(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 mL(){const e=Xn(u_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return es(u_,t),t}function gL(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function Ws(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 vL(e)}function vL(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 yL(e,t){if(e.length===0)return null;const n=new Set(e),s=t.filter(i=>n.has(i)),o=e.filter(i=>!t.includes(i));return o.length===0&&s.length===t.length?null:[...o,...s]}function kL(e,t){const n=new Map(t.map((s,o)=>[s,o]));return e.toSorted((s,o)=>(n.get(s.id)??-1)-(n.get(o.id)??-1))}function bL(e,t,n,s="before"){const o=e.indexOf(t),i=e.indexOf(n);if(o===-1||i===-1||o===i)return e;const r=[...e];r.splice(o,1);const l=o<i?i-1:i,a=s==="before"?l:l+1;return r.splice(a,0,t),r}function _L(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const wL={"&":"&","<":"<",">":">",'"':""","'":"'"};function d_(e){return e.replace(/[&<>"']/g,t=>wL[t]??t)}function SL(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function CL(e,t,n=40){const s=e.replace(/\s+/g," ").trim();if(s.length===0)return"";const o=t.trim();if(o.length===0)return f_(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return f_(s,n*2);const r=Math.max(0,i-n),l=Math.min(s.length,i+o.length+n),a=r>0,c=l<s.length;return`${a?"…":""}${s.slice(r,l)}${c?"…":""}`}function f_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function Zm(e,t){const n=d_(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(SL(d_(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const Aa=ee(0),xL=["type","disabled","aria-label"],AL=Ve({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=ee();return t({el:n}),(s,o)=>(w(),N("button",{ref_key:"el",ref:n,class:De(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Tn(s.$slots,"default",{},void 0,!0)],10,xL))}}),ft=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},dn=ft(AL,[["__scopeId","data-v-321e56e3"]]),cA={sm:14,md:16,lg:20},TL={plus:{body:'<path d="M8 3v10M3 8h10"/>'},close:{body:'<path d="M4 4l8 8M12 4l-8 8"/>'},check:{body:'<path d="M3 8.5l3.5 3.5L13 4.5"/>'},search:{body:'<circle cx="7" cy="7" r="4.5"/><path d="m10.5 10.5 3 3"/>'},folder:{body:'<path d="M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"/><path d="M1 5.5h12"/>'},image:{body:'<rect x="2" y="3" width="12" height="10" rx="1.5"/><circle cx="5" cy="6" r="1.2"/><path d="M2 10.5l3-2.5L8 11l2.5-2L14 11"/>'},"chevron-down":{body:'<path d="M4 6l4 4 4-4"/>'},send:{body:'<path d="M8 3l6 5.5M8 3L2 8.5M8 3v10"/>'},sort:{body:'<path d="M3 4h10M3 8h7M3 12h4"/>'},grip:{body:'<circle cx="6" cy="4" r="1.2"/><circle cx="10" cy="4" r="1.2"/><circle cx="6" cy="8" r="1.2"/><circle cx="10" cy="8" r="1.2"/><circle cx="6" cy="12" r="1.2"/><circle cx="10" cy="12" r="1.2"/>',fill:!0},"file-text":{body:'<rect x="2.5" y="1.5" width="9" height="13" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7.5" x2="11" y2="7.5"/><line x1="5" y1="10" x2="10" y2="10"/>'},terminal:{body:'<rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><polyline points="4,6 6.5,8 4,10"/><line x1="8" y1="10" x2="12" y2="10"/>'},pencil:{body:'<path d="M10.5 2.5l3 3-8 8H2.5v-3l8-8z"/><line x1="8.5" y1="4.5" x2="11.5" y2="7.5"/>'},"file-plus":{body:'<path d="M3 12V4.5L8 2l5 2.5V12H3z"/><line x1="6" y1="7" x2="10" y2="7"/><line x1="8" y1="5" x2="8" y2="9"/>'},glob:{body:'<path d="M5 2.5C3.5 2.5 3.5 5 3.5 6.5S2.5 8 2.5 8s1 0 1 1.5S3.5 13.5 5 13.5"/><path d="M11 2.5c1.5 0 1.5 2.5 1.5 4S13.5 8 13.5 8s-1 0-1 1.5.5 4-1.5 4"/><line x1="8" y1="6" x2="8" y2="10"/><line x1="6.3" y1="6.8" x2="9.7" y2="9.2"/><line x1="9.7" y1="6.8" x2="6.3" y2="9.2"/>'},globe:{body:'<circle cx="8" cy="8" r="6"/><path d="M8 2c-2 2-3 3.6-3 6s1 4 3 6"/><path d="M8 2c2 2 3 3.6 3 6s-1 4-3 6"/><line x1="2" y1="8" x2="14" y2="8"/>'},"check-list":{body:'<polyline points="2,4.5 3.5,6 5.5,3"/><polyline points="2,11 3.5,12.5 5.5,9.5"/><line x1="8" y1="4.5" x2="14" y2="4.5"/><line x1="8" y1="11" x2="14" y2="11"/>'},bolt:{body:'<path d="M8.5 1L3 9h4l-1.5 6 5.5-8h-4l1.5-6z"/>'},"panel-collapse":{viewBox:"0 0 24 24",body:'<path d="M11 6h9"/><path d="M11 12h9"/><path d="M11 18h9"/><path d="M7 9l-3 3 3 3"/>'},settings:{viewBox:"0 0 24 24",body:'<circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 15 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z"/>'},expand:{viewBox:"0 0 24 24",body:'<path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="M21 3l-7 7"/><path d="M3 21l7-7"/>'},collapse:{viewBox:"0 0 24 24",body:'<path d="M4 14h6v6"/><path d="M20 10h-6V4"/><path d="M14 10l7-7"/><path d="M3 21l7-7"/>'},info:{viewBox:"0 0 12 12",body:'<circle cx="6" cy="6" r="5"/><line x1="6" y1="3.5" x2="6" y2="6.5"/><circle cx="6" cy="8.5" r="0.5" fill="currentColor"/>'},play:{body:'<path d="M5 3.5v9l7-4.5z"/>',fill:!0},stop:{body:'<rect x="3" y="3" width="10" height="10" rx="1.5"/>',fill:!0},star:{viewBox:"0 0 24 24",body:'<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>',fill:!0},"log-in":{body:'<path d="M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"/><path d="M9 8H2"/><path d="M5 5l3 3-3 3"/>'},message:{body:'<path d="M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"/>'},mail:{body:'<path d="M2 4l6 4 6-4"/><rect x="2" y="4" width="12" height="8" rx="1.5"/>'},code:{body:'<polyline points="5.5,5 2.5,8 5.5,11"/><polyline points="10.5,5 13.5,8 10.5,11"/>'},file:{body:'<path d="M4 1.5h5l3 3v10H4z"/><polyline points="9,1.5 9,4.5 12,4.5"/>'},copy:{body:'<rect x="3" y="3" width="9" height="9" rx="1.5"/><path d="M6 1h7a1 1 0 0 1 1 1v7"/>'},link:{body:'<path d="M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.2l-1 1"/><path d="M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.2l1-1"/>'},"external-link":{body:'<path d="M9.5 2.5h4v4"/><path d="M13.5 2.5 7.5 8.5"/><path d="M12 8.7V12a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12V5.5A1.5 1.5 0 0 1 4 4h3.3"/>'},download:{body:'<path d="M8 2v8"/><path d="M4.5 6.5 8 10l3.5-3.5"/><path d="M2.5 13.5h11"/>'},undo:{body:'<path d="M6.5 2.5 3 6l3.5 3.5"/><path d="M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"/>'},clock:{body:'<circle cx="8" cy="8" r="5.5"/><path d="M8 4.5V8l2.5 1.5"/>'},sparkles:{body:'<path d="M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"/>'},list:{body:'<path d="M2 4h12M2 8h12M2 12h8"/>'},user:{body:'<circle cx="8" cy="5" r="3"/><path d="M3 14c0-3 2.2-5 5-5s5 2 5 5"/>'},"folder-plus":{body:'<path d="M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"/><path d="M1 5.5h12"/><path d="M8 7.25v4.5M5.75 9.5h4.5"/>'},"folder-closed":{body:'<path d="M1.5 6V3.5a1 1 0 0 1 1-1h3.6l1.3 1.5h5.1a1 1 0 0 1 1 1v1"/><rect x="1.5" y="6" width="13" height="7" rx="1"/>'},"chevron-right":{body:'<path d="M6 4l4 4-4 4"/>'},"arrow-up":{body:'<path d="M8 12V4M4 7l4-3 4 3"/>'},"arrow-down":{body:'<path d="M8 4v8m0 0 3.5-3.5M8 12l-3.5-3.5"/>'},"arrow-right":{body:'<path d="M2 8h10"/><path d="M8 4l4 4-4 4"/>'},minus:{body:'<path d="M3 8h10"/>'},"panel-expand":{viewBox:"0 0 24 24",body:'<path d="M4 6h9"/><path d="M4 12h9"/><path d="M4 18h9"/><path d="M17 9l3 3-3 3"/>'},"git-pull-request":{viewBox:"0 0 24 24",body:'<circle cx="5" cy="6" r="3"/><path d="M5 9v12"/><circle cx="19" cy="18" r="3"/><path d="m15 9-3-3 3-3"/><path d="M12 6h5a2 2 0 0 1 2 2v7"/>'},sliders:{viewBox:"0 0 24 24",body:'<line x1="4" y1="8" x2="20" y2="8"/><circle cx="10" cy="8" r="2.5" fill="currentColor"/><line x1="4" y1="16" x2="20" y2="16"/><circle cx="15" cy="16" r="2.5" fill="currentColor"/>'},"star-outline":{viewBox:"0 0 24 24",body:'<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>'},"alert-triangle":{body:'<path d="M8 2 14 13H2L8 2Z"/><path d="M8 6v3"/><circle cx="8" cy="11" r=".6" fill="currentColor"/>'},"help-circle":{body:'<circle cx="8" cy="8" r="6.5"/><path d="M6.2 6a1.8 1.8 0 0 1 3.5.6c0 1.2-1.7 1.4-1.7 2.6"/><circle cx="8" cy="11.5" r=".7" fill="currentColor"/>'},"dots-vertical":{body:'<circle cx="8" cy="3" r="1.3"/><circle cx="8" cy="8" r="1.3"/><circle cx="8" cy="13" r="1.3"/>',fill:!0},"dots-horizontal":{body:'<circle cx="3" cy="8" r="1.3"/><circle cx="8" cy="8" r="1.3"/><circle cx="13" cy="8" r="1.3"/>',fill:!0},"folder-solid":{body:'<path d="M1.5 3.5h3l1.5 2h7a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z"/>',fill:!0},"image-off":{viewBox:"0 0 20 20",body:'<rect x="2" y="2" width="16" height="16" rx="2"/><path d="M7 10h6M10 7v6"/>'},"file-off":{viewBox:"0 0 20 20",body:'<path d="M5 3h7l4 4v10H5V3z"/><path d="M12 3v4h4"/>'}},ML="0 0 16 16";function uA(e){return TL[e]}function Ta(e,t="md"){const n=uA(e),s=cA[t],o=n.viewBox??ML;return n.fill?`<svg class="kw-icon" width="${s}" height="${s}" viewBox="${o}" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">${n.body}</svg>`:`<svg class="kw-icon" width="${s}" height="${s}" viewBox="${o}" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">${n.body}</svg>`}const EL=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],IL=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],Ye=Ve({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=W(()=>uA(t.name)),s=W(()=>cA[t.size]),o=W(()=>n.value.viewBox??"0 0 16 16");return(i,r)=>n.value.fill?(w(),N("svg",{key:0,class:"kw-icon",width:s.value,height:s.value,viewBox:o.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,EL)):(w(),N("svg",{key:1,class:"kw-icon",width:s.value,height:s.value,viewBox:o.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,IL))}}),$L={key:0,class:"ui-dialog__head"},NL={class:"ui-dialog__titles"},LL={key:0,class:"ui-dialog__title"},PL={key:1,class:"ui-dialog__desc"},OL={class:"ui-dialog__body"},RL={key:1,class:"ui-dialog__foot"},DL='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',BL=Ve({__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,s=t,o=ee(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(DL)):[]}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(),f=d[0],h=d[d.length-1];if(!f||!h){u.preventDefault(),o.value?.focus();return}const p=document.activeElement;u.shiftKey&&p===f?(u.preventDefault(),h.focus()):!u.shiftKey&&p===h&&(u.preventDefault(),f.focus())}function c(u){n.closeOnOverlay&&u.target===u.currentTarget&&r()}return Ge(()=>n.open,async u=>{u?(Aa.value+=1,i=document.activeElement,await vt(),(l()[0]??o.value)?.focus()):(Aa.value=Math.max(0,Aa.value-1),i instanceof HTMLElement&&(i.focus(),i=null))},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",a),hs(()=>{typeof window<"u"&&window.removeEventListener("keydown",a),n.open&&(Aa.value=Math.max(0,Aa.value-1))}),(u,d)=>(w(),ve(nh,{to:"body"},[e.open?(w(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:c},[T("div",{ref_key:"panel",ref:o,class:De(["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",$L,[Tn(u.$slots,"head",{},()=>[T("div",NL,[e.title?(w(),N("div",LL,O(e.title),1)):ie("",!0),e.description?(w(),N("div",PL,O(e.description),1)):ie("",!0)])],!0),Z(dn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:de(()=>[Z(Ye,{name:"close",size:"md"})]),_:1})])):ie("",!0),T("div",OL,[Tn(u.$slots,"default",{},void 0,!0)]),u.$slots.foot?(w(),N("div",RL,[Tn(u.$slots,"foot",{},void 0,!0)])):ie("",!0)],2)],32)):ie("",!0)]))}}),rr=ft(BL,[["__scopeId","data-v-7904ff48"]]),FL={class:"sd-head"},WL=["placeholder","aria-label"],HL=["aria-selected","onClick","onMousemove"],zL={class:"sd-meta"},UL=["innerHTML"],qL={class:"sd-time"},jL=["innerHTML"],VL=["innerHTML"],KL={key:1,class:"sd-empty"},GL={class:"sd-hint"},YL=200,XL=Ve({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=ee(!0),r=ee(""),l=ee(null),a=ee(null),c=W(()=>{const b=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",C=v.lastPrompt??"",L=v.workspaceName??"",I=b.length>0&&y.toLowerCase().includes(b),k=b.length>0&&C.toLowerCase().includes(b),M=b.length>0&&L.toLowerCase().includes(b);if(!(b.length>0&&!I&&!k&&!M)&&(g.push({session:v,inTitle:I,inWorkspace:M,snippetText:C?CL(C,r.value):""}),g.length>=YL))break}return g}),u=ee(0);Ge(r,()=>{u.value=0});function d(b){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,b))}async function f(){await vt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(b){u.value=d(u.value+b),f()}function p(b){o("select",b),o("close")}function m(){const b=c.value[u.value];b&&p(b.session.id)}function _(b){b.key==="ArrowDown"?(b.preventDefault(),h(1)):b.key==="ArrowUp"?(b.preventDefault(),h(-1)):b.key==="Enter"&&(b.preventDefault(),m())}return _n(()=>{l.value?.focus()}),(b,g)=>(w(),ve(rr,{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=>o("close"))},{head:de(()=>[T("div",FL,[Z(Ye,{class:"sd-search-icon",name:"search",size:"md"}),In(T("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:S(n)("sidebar.searchPlaceholder"),"aria-label":S(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:_},null,40,WL),[[go,r.value]])])]),foot:de(()=>[T("span",GL,O(S(n)("sidebar.searchHint")),1)]),default:de(()=>[T("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),N(Pe,{key:0},ot(c.value,(v,y)=>(w(),N("button",{key:v.session.id,class:De(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:C=>p(v.session.id),onMousemove:C=>u.value=y},[T("span",zL,[Z(Ye,{class:"sd-folder",name:"folder-closed",size:"sm"}),T("span",{class:"sd-ws",innerHTML:S(Zm)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,UL),T("span",qL,O(v.session.time),1)]),T("span",{class:"sd-title",innerHTML:S(Zm)(v.session.title,v.inTitle?r.value:"")},null,8,jL),v.snippetText?(w(),N("span",{key:0,class:"sd-snippet",innerHTML:S(Zm)(v.snippetText,r.value)},null,8,VL)):ie("",!0)],42,HL))),128)):(w(),N("div",KL,O(S(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),QL=ft(XL,[["__scopeId","data-v-8e37376e"]]),ZL=["aria-label"],JL=Ve({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),N("span",{class:De(["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,ZL))}}),Jo=ft(JL,[["__scopeId","data-v-e5c5b17d"]]),e8={key:0,class:"ui-badge__dot","aria-hidden":"true"},t8=Ve({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),N("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),N("span",e8)):ie("",!0),Tn(t.$slots,"default",{},void 0,!0)],2))}}),Ms=ft(t8,[["__scopeId","data-v-5bc5cd6d"]]),Lu=ee(null);function dA(e){const t=Lu.value;t&&(Lu.value=null,t.resolve(e))}function n8(e){return Lu.value&&dA(!1),new Promise(t=>{Lu.value={...e,resolve:t}})}function nl(){return{current:Lu,confirm:n8,settle:dA}}const s8=Ve({__name:"Menu",setup(e,{expose:t}){const n=ee();return t({el:n}),(s,o)=>(w(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Tn(s.$slots,"default",{},void 0,!0)],512))}}),Fl=ft(s8,[["__scopeId","data-v-60e6cd8d"]]),o8={key:0,class:"ui-menu-sep",role:"separator"},i8=["disabled"],r8=Ve({__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",o8)):(w(),N("button",{key:1,class:De(["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]=s=>t.$emit("click",s))},[Tn(t.$slots,"default",{},void 0,!0)],10,i8))}}),mn=ft(r8,[["__scopeId","data-v-eab8e277"]]),vr=6,yr=8,l8=150,a8=Ve({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=ee(),s=ee(),o=ee(!1),i=ee(!1),r=ee({maxWidth:`${t.maxWidth}px`});let l,a=null;function c(){const h=s.value;if(!a||!h)return;const p=a.getBoundingClientRect(),m=h.offsetWidth,_=h.offsetHeight,b=window.innerWidth,g=window.innerHeight;let v=t.placement;v==="top"&&p.top-vr-_<yr?v="bottom":v==="bottom"&&p.bottom+vr+_>g-yr?v="top":v==="left"&&p.left-vr-m<yr?v="right":v==="right"&&p.right+vr+m>b-yr&&(v="left");let y=0,C=0;v==="top"?(y=p.top-vr-_,C=p.left+p.width/2-m/2):v==="bottom"?(y=p.bottom+vr,C=p.left+p.width/2-m/2):v==="left"?(y=p.top+p.height/2-_/2,C=p.left-vr-m):(y=p.top+p.height/2-_/2,C=p.right+vr),C=Math.min(Math.max(C,yr),b-yr-m),y=Math.min(Math.max(y,yr),g-yr-_),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(y)}px`,left:`${Math.round(C)}px`}}function u(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,vt(()=>{c(),i.value=!0})},l8))}function d(){window.clearTimeout(l),o.value=!1,i.value=!1}function f(){o.value&&d()}return _n(()=>{a=n.value?.firstElementChild??n.value??null,a&&(a.addEventListener("mouseenter",u),a.addEventListener("mouseleave",d),a.addEventListener("focusin",u),a.addEventListener("focusout",d),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f))}),hs(()=>{window.clearTimeout(l),a&&(a.removeEventListener("mouseenter",u),a.removeEventListener("mouseleave",d),a.removeEventListener("focusin",u),a.removeEventListener("focusout",d)),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}),(h,p)=>(w(),N(Pe,null,[T("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Tn(h.$slots,"default",{},void 0,!0)],512),(w(),ve(nh,{to:"body"},[In(T("div",{ref_key:"bubble",ref:s,class:De(["ui-tip__bubble",{positioned:i.value}]),style:Qt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[Ko,o.value]])]))],64))}}),ht=ft(a8,[["__scopeId","data-v-813592e5"]]),c8={class:"row"},u8={class:"lead","aria-hidden":"true"},d8={key:1,class:"unread-dot"},f8={class:"left"},p8=["onKeydown"],h8={class:"ts"},m8={class:"menu-time"},g8=Ve({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=Nt(),{confirm:o}=nl(),i=e,r=n;function l(A){const $=new Date(A);if(Number.isNaN($.getTime()))return A;const D=R=>String(R).padStart(2,"0");return`${$.getFullYear()}-${D($.getMonth()+1)}-${D($.getDate())} ${D($.getHours())}:${D($.getMinutes())}`}const a=W(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=ee(!1),u=ee(null),d=ee(null),f=ee({});function h(A){const $=A.target;d.value?.el?.contains($)||u.value?.el?.contains($)||_()}function p(){const A=u.value?.el;if(!A)return;const $=d.value?.el,D=A.getBoundingClientRect(),R=4,H=8,z=$?.offsetHeight??0,q=$?.offsetWidth??0;let Q=D.bottom+R;Q+z>window.innerHeight-H&&(Q=Math.max(H,D.top-z-R));let X=D.right-q;X<H&&(X=H),f.value={top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`}}async function m(A){if(A.stopPropagation(),c.value){_();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",_),await vt(),p()}function _(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",_)}wn(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",_)});const b=ee(!1),g=ee(""),v=ee(null);async function y(){_(),b.value=!0,g.value=i.session.title,await vt();try{v.value?.focus(),v.value?.select()}catch{}}function C(){const A=g.value.trim();A&&r("rename",i.session.id,A),b.value=!1}function L(){b.value=!1}const I=ee(!1),k=ee(!1);async function M(){const A=await Ws(i.session.id);I.value=A,k.value=!A,setTimeout(()=>{I.value=!1,k.value=!1,_()},1500)}function E(){_(),r("fork",i.session.id)}async function P(){_(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:_}),(A,$)=>(w(),N("div",{class:De(["se",{on:e.active}]),onClick:$[4]||($[4]=D=>r("select",e.session.id))},[T("div",c8,[T("span",u8,[e.session.busy?(w(),ve(Jo,{key:0,size:"sm"})):e.unread?(w(),N("span",d8)):ie("",!0)]),T("div",f8,[b.value?In((w(),N("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":$[0]||($[0]=D=>g.value=D),class:"rename-input",onClick:$[1]||($[1]=kt(()=>{},["stop"])),onKeydown:[ai(kt(C,["stop"]),["enter"]),ai(kt(L,["stop"]),["esc"])],onBlur:C},null,40,p8)),[[go,g.value]]):(w(),N("span",{key:1,class:"t",onDblclick:kt(y,["stop"])},O(e.session.title),33))]),T("span",h8,O(e.session.time),1),Z(ht,{text:S(s)("workspace.awaitingAnswerTitle")},{default:de(()=>[!b.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(w(),ve(Ms,{key:0,variant:"info",size:"sm"},{default:de(()=>[je(O(S(s)("workspace.awaitingAnswer")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:S(s)("workspace.awaitingPermissionTitle")},{default:de(()=>[!b.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(w(),ve(Ms,{key:0,variant:"warning",size:"sm"},{default:de(()=>[je(O(S(s)("workspace.awaitingPermission")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:S(s)("workspace.abortedTitle")},{default:de(()=>[!b.value&&e.session.status==="aborted"?(w(),ve(Ms,{key:0,variant:"danger",size:"sm"},{default:de(()=>[je(O(S(s)("workspace.aborted")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),b.value?ie("",!0):(w(),ve(dn,{key:0,ref_key:"kebabRef",ref:u,class:De(["kebab",{open:c.value}]),size:"sm",label:S(s)("sidebar.options"),onClick:$[2]||($[2]=kt(D=>m(D),["stop"]))},{default:de(()=>[Z(Ye,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))]),(w(),ve(nh,{to:"body"},[c.value?(w(),ve(Fl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Qt(f.value),onClick:$[3]||($[3]=kt(()=>{},["stop"]))},{default:de(()=>[Z(mn,{danger:k.value,onClick:M},{default:de(()=>[je(O(k.value?S(s)("sidebar.copyFailed"):I.value?S(s)("sidebar.copied"):S(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),Z(mn,{separator:""}),Z(mn,{onClick:y},{default:de(()=>[je(O(S(s)("sidebar.rename")),1)]),_:1}),Z(mn,{onClick:E},{default:de(()=>[je(O(S(s)("sidebar.fork")),1)]),_:1}),Z(mn,{danger:"",onClick:P},{default:de(()=>[je(O(S(s)("sidebar.archive")),1)]),_:1}),Z(mn,{separator:""}),T("div",m8,O(a.value),1)]),_:1},8,["style"])):ie("",!0)]))],2))}}),v8=ft(g8,[["__scopeId","data-v-eb434627"]]),y8={class:"gh-top"},k8={key:2,class:"gh-name"},b8={class:"gh-path"},_8=["inert"],w8=["disabled"],S8={key:1,class:"group-empty"},C8=Ve({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},showPath:{type:Boolean},isCollapsed:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=W({get:()=>s.renameValue,set:a=>o("updateRenameValue",a)});function r(a){s.renameInputRef.value=a instanceof HTMLInputElement?a:null}function l(a){a.dataTransfer&&(a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(a,c)=>(w(),N("div",{class:De(["group",{dragging:e.dragging}])},[T("div",{class:De(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id),"show-path":e.showPath}]),draggable:"true",onClick:c[7]||(c[7]=kt(u=>o("groupClick",e.group.workspace.id,u),["stop"])),onContextmenu:c[8]||(c[8]=u=>o("groupContextmenu",e.group.workspace,u)),onDragstart:l,onDragend:c[9]||(c[9]=u=>o("wsDragend"))},[T("div",y8,[e.isCollapsed(e.group.workspace.id)?(w(),ve(Ye,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(w(),ve(Ye,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(w(),N("span",k8,O(e.group.workspace.name),1)):In((w(),N("input",{key:3,ref:r,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),class:"gh-rename",type:"text",onKeydown:[c[1]||(c[1]=ai(u=>o("confirmRename"),["enter"])),c[2]||(c[2]=ai(u=>o("cancelRename"),["esc"]))],onBlur:c[3]||(c[3]=u=>o("cancelRename")),onClick:c[4]||(c[4]=kt(()=>{},["stop"]))},null,544)),[[go,i.value]]),Z(ht,{text:S(n)("sidebar.options")},{default:de(()=>[Z(dn,{class:De(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:S(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:c[5]||(c[5]=kt(u=>o("toggleWsMenu",e.group.workspace,u),["stop"]))},{default:de(()=>[Z(Ye,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"])]),_:1},8,["text"]),Z(ht,{text:S(n)("workspace.newInGroup")},{default:de(()=>[Z(dn,{class:"gh-add",size:"sm",label:S(n)("workspace.newInGroup"),onClick:c[6]||(c[6]=kt(u=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:de(()=>[Z(Ye,{name:"plus"})]),_:1},8,["label"])]),_:1},8,["text"])]),Z(ht,{text:e.group.workspace.root},{default:de(()=>[T("div",b8,O(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),T("div",{class:De(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),N(Pe,null,ot(e.group.sessions,u=>(w(),ve(v8,{key:u.id,session:u,active:u.id===e.activeId,"approval-count":e.pendingBySession[u.id]?.approvals??0,"question-count":e.pendingBySession[u.id]?.questions??0,unread:e.unreadBySession[u.id]??!1,onSelect:c[10]||(c[10]=d=>o("selectSession",d)),onRename:c[11]||(c[11]=(d,f)=>o("renameSession",d,f)),onArchive:c[12]||(c[12]=d=>o("archiveSession",d)),onFork:c[13]||(c[13]=d=>o("forkSession",d))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:c[14]||(c[14]=kt(u=>o("loadMore",e.group.workspace.id),["stop"]))},O(e.group.loadingMore?S(n)("sidebar.loadingMore"):S(n)("sidebar.showMore",{count:Math.max(0,e.group.workspace.sessionCount-e.group.sessions.length)})),9,w8)):ie("",!0),e.group.sessions.length===0?(w(),N("div",S8,O(S(n)("sidebar.noSessions")),1)):ie("",!0)],10,_8)],2))}}),x8=ft(C8,[["__scopeId","data-v-7143fe84"]]),A8="kimi_desktop",T8="platform",p_="kimi-desktop",h_="kimi-desktop-platform";function M8(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(A8)?(sessionStorage.setItem(p_,"1"),e=!0):e=e||sessionStorage.getItem(p_)==="1";const s=n.get(T8);s?(sessionStorage.setItem(h_,s),t=s):t=sessionStorage.getItem(h_)}catch{}return{isDesktop:e,platform:t}}const Dv=M8(),E8=Dv.isDesktop,fA=Dv.isDesktop&&Dv.platform==="darwin",I8=["aria-label"],$8=Ve({__name:"InternalBuildBanner",setup(e){const{t}=Nt(),n=E8;return(s,o)=>S(n)?(w(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":S(t)("app.internalBuildBanner")},[o[0]||(o[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,O(S(t)("app.internalBuildBanner")),1)],8,I8)):ie("",!0)}}),N8=ft($8,[["__scopeId","data-v-b5e70a09"]]),L8={class:"ch"},P8={class:"ch-brand"},O8={class:"ch-name"},R8={key:0,class:"ch-endpoint"},D8={class:"search-input"},B8={key:0,class:"empty"},F8={class:"side-section-label"},W8={class:"side-section-title"},H8={class:"side-section-actions"},z8=["onDragover","onDrop"],U8={class:"section-menu-check"},q8={class:"section-menu-check"},j8={class:"section-menu-check"},V8={class:"ds-egg-frame"},K8={class:"ds-egg-head"},G8=!1,Y8=1e3,X8=Ve({__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}=Nt(),{confirm:s}=nl(),o=!1,i="",r=e,l=t,a=ee(!1);function c(){l("loadAllSessions"),a.value=!0}function u(et){(et.metaKey||et.ctrlKey)&&et.key.toLowerCase()==="k"&&(et.preventDefault(),c())}_n(()=>window.addEventListener("keydown",u)),hs(()=>window.removeEventListener("keydown",u));const d=ee(!1);function f(et){d.value=et.target.scrollTop>0}const h=ee(new Set(nL()));function p(et){return h.value.has(et)}function m(et){const Ke=new Set(h.value);Ke.has(et)?Ke.delete(et):Ke.add(et),h.value=Ke,Qm(Ke)}function _(){const et=new Set(r.groups.map(Ke=>Ke.workspace.id));h.value=et,Qm(et)}function b(){const et=new Set;h.value=et,Qm(et)}const g=W(()=>r.groups.length>0&&r.groups.every(et=>h.value.has(et.workspace.id))),v=ee(sL());function y(){v.value=!v.value,oL(v.value)}const C=ee(null),L=ee(null);function I(et){C.value=et}function k(){C.value=null,L.value=null}function M(et){const Ke=et.currentTarget.getBoundingClientRect();return et.clientY<Ke.top+Ke.height/2?"before":"after"}function E(et,Ke){C.value===null||C.value===Ke||(et.preventDefault(),et.dataTransfer&&(et.dataTransfer.dropEffect="move"),L.value={id:Ke,position:M(et)})}function P(et){const Ke=C.value,Mt=L.value?.id===et?L.value.position:"before";if(L.value=null,C.value=null,!Ke||Ke===et)return;const Ft=bL(r.groups.map(vn=>vn.workspace.id),Ke,et,Mt);l("reorderWorkspaces",Ft)}function A(et,Ke){Ke.target.closest(".gh-more, .gh-add")||m(et)}function $(et){l("select",et)}const D=ee(null),R=ee(""),H=ee(null);function z(){return H}function q(et,Ke){D.value=et,R.value=Ke,vt().then(()=>H.value?.focus())}function Q(){const et=D.value,Ke=R.value.trim();et&&Ke&&l("renameWorkspace",et,Ke),D.value=null}function X(){D.value=null}function ue(et){R.value=et}const ge=ee(!1),xe=ee(null),ke=ee({}),ze=ee(null);function qe(et){ze.value?.el&&!ze.value.el.contains(et.target)&&Le()}function Ue(et,Ke){Ke.preventDefault(),Ke.stopPropagation(),xe.value=et,ke.value={top:`${Ke.clientY}px`,left:`${Ke.clientX}px`},ge.value=!0,document.addEventListener("mousedown",qe,!0)}function Le(){ge.value=!1,document.removeEventListener("mousedown",qe,!0),xe.value=null}function le(){xe.value&&Ws(xe.value.root),Le()}function F(){xe.value&&q(xe.value.id,xe.value.name),Le()}async function ne(){const et=xe.value;et&&(Le(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:et.name}),variant:"danger"})&&l("deleteWorkspace",et.id))}const te=ee(null),U=ee(null),Y=ee({}),fe=ee(null);function se(et){const Ke=et.target;Ke.closest(".gh-more")||Ke.closest(".ws-menu")||j()}async function ce(et,Ke){if(te.value===et.id){j();return}const Mt=Ke.currentTarget;U.value=et,te.value=et.id,document.addEventListener("mousedown",se),window.addEventListener("resize",j),await vt();const Ft=fe.value?.el,vn=Mt.getBoundingClientRect(),rn=4,zt=8,ms=Ft?.offsetHeight??0,Ln=Ft?.offsetWidth??0;let yn=vn.bottom+rn;yn+ms>window.innerHeight-zt&&(yn=Math.max(zt,vn.top-ms-rn));let jn=vn.right-Ln;jn<zt&&(jn=zt),Y.value={top:`${Math.round(yn)}px`,left:`${Math.round(jn)}px`}}function j(){te.value=null,U.value=null,document.removeEventListener("mousedown",se),window.removeEventListener("resize",j)}function G(et){Ws(et.root),j()}function re(et){q(et.id,et.name),j()}async function me(et){j(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:et.name}),variant:"danger"})&&l("deleteWorkspace",et.id)}const Ae=ee(!1),Ee=ee({}),ae=ee(null);function Ce(et){const Ke=et.target;Ke.closest(".side-section-kebab")||Ke.closest(".section-menu")||tt()}async function Xe(et){if(Ae.value){tt();return}const Ke=et.currentTarget;Ae.value=!0,document.addEventListener("mousedown",Ce),window.addEventListener("resize",tt),await vt();const Mt=ae.value?.el,Ft=Ke.getBoundingClientRect(),vn=4,rn=8,zt=Mt?.offsetHeight??0,ms=Mt?.offsetWidth??0;let Ln=Ft.bottom+vn;Ln+zt>window.innerHeight-rn&&(Ln=Math.max(rn,Ft.top-zt-vn));let yn=Ft.right-ms;yn<rn&&(yn=rn),Ee.value={top:`${Math.round(Ln)}px`,left:`${Math.round(yn)}px`}}function tt(){Ae.value=!1,document.removeEventListener("mousedown",Ce),window.removeEventListener("resize",tt)}function xt(et){l("setWorkspaceSortMode",et),tt()}function wt(){y(),tt()}hs(()=>{document.removeEventListener("mousedown",qe,!0),document.removeEventListener("mousedown",se),document.removeEventListener("mousedown",Ce),window.removeEventListener("resize",j),window.removeEventListener("resize",tt)});const It=ee(null);let Wt;function _t(){const et=It.value;et&&(et.classList.remove("blink-now"),et.getBoundingClientRect(),et.classList.add("blink-now"),clearTimeout(Wt),Wt=setTimeout(()=>et.classList.remove("blink-now"),300))}const Ht=ee(!1);let $n,Sn=!1;function Vt(et){Sn=!1,clearTimeout($n),et.currentTarget.setPointerCapture?.(et.pointerId),$n=setTimeout(()=>{Sn=!0,Ht.value=!0},Y8)}function Kt(et){clearTimeout($n);const Ke=et.currentTarget;Ke.hasPointerCapture?.(et.pointerId)&&Ke.releasePointerCapture(et.pointerId)}function Qn(){if(Sn){Sn=!1;return}_t()}function st(){Ht.value=!1}function Nn(et){et.key==="Escape"&&Ht.value&&st()}return typeof window<"u"&&window.addEventListener("keydown",Nn),hs(()=>{clearTimeout($n),typeof window<"u"&&window.removeEventListener("keydown",Nn)}),(et,Ke)=>(w(),N("aside",{class:De(["side",{"macos-desktop":S(fA)}])},[T("div",{class:"col",style:Qt({width:e.colWidth+"px"})},[T("div",L8,[T("div",P8,[(w(),N("svg",{ref_key:"logoRef",ref:It,class:De(["ch-logo",{"is-dev":S(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Qn,onPointerdown:Vt,onPointerup:Kt,onPointercancel:Kt},[...Ke[21]||(Ke[21]=[Q1('<defs data-v-2924688d><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-2924688d><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-2924688d></rect><g class="ch-eyes" fill="#000" data-v-2924688d><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-2924688d></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-2924688d></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-2924688d></rect>',2)])],34)),T("span",O8,[Ke[22]||(Ke[22]=je("Kimi Code",-1)),S(o)?(w(),N("span",R8," · "+O(S(i)),1)):ie("",!0)]),Z(N8)]),Z(ht,{text:S(n)("sidebar.collapseSidebar")},{default:de(()=>[Z(dn,{size:"sm",label:S(n)("sidebar.collapseSidebar"),onClick:Ke[0]||(Ke[0]=kt(Mt=>l("collapse"),["stop"]))},{default:de(()=>[Z(Ye,{name:"panel-collapse"})]),_:1},8,["label"])]),_:1},8,["text"]),Z(ht,{text:S(n)("settings.title")},{default:de(()=>[Z(dn,{size:"sm",label:S(n)("settings.title"),onClick:Ke[1]||(Ke[1]=kt(Mt=>l("openSettings"),["stop"]))},{default:de(()=>[Z(Ye,{name:"settings"})]),_:1},8,["label"])]),_:1},8,["text"])]),T("button",{class:"search",type:"button",onClick:c},[Z(Ye,{class:"search-icon",name:"search"}),T("span",D8,O(S(n)("sidebar.searchShortcut")),1)]),T("div",{class:De(["btn-wrap",{"btn-wrap--scrolled":d.value}])},[T("button",{class:"btn-new-chat",type:"button",onClick:Ke[2]||(Ke[2]=kt(Mt=>l("create"),["stop"]))},[Z(Ye,{name:"plus"}),T("span",null,O(S(n)("sidebar.newChat")),1)]),Z(ht,{text:S(n)("sidebar.newWorkspace")},{default:de(()=>[G8?(w(),ve(dn,{key:0,size:"sm",label:S(n)("sidebar.newWorkspace"),onClick:Ke[3]||(Ke[3]=kt(Mt=>l("addWorkspace"),["stop"]))},{default:de(()=>[Z(Ye,{name:"folder"})]),_:1},8,["label"])):ie("",!0)]),_:1},8,["text"])],2),T("div",{class:"sessions",onScroll:f},[e.groups.length===0?(w(),N("div",B8,O(S(n)("workspace.noWorkspace")),1)):(w(),N(Pe,{key:1},[T("div",F8,[T("span",W8,O(S(n)("sidebar.workspaces")),1),T("div",H8,[Z(ht,{text:g.value?S(n)("sidebar.expandAll"):S(n)("sidebar.collapseAll")},{default:de(()=>[Z(dn,{class:"side-section-toggle",size:"sm",label:g.value?S(n)("sidebar.expandAll"):S(n)("sidebar.collapseAll"),onClick:Ke[4]||(Ke[4]=kt(Mt=>g.value?b():_(),["stop"]))},{default:de(()=>[g.value?(w(),ve(Ye,{key:0,name:"expand"})):(w(),ve(Ye,{key:1,name:"collapse"}))]),_:1},8,["label"])]),_:1},8,["text"]),Z(ht,{text:S(n)("sidebar.options")},{default:de(()=>[Z(dn,{class:"side-section-toggle side-section-kebab",size:"sm",label:S(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Ae.value,onClick:Ke[5]||(Ke[5]=kt(Mt=>Xe(Mt),["stop"]))},{default:de(()=>[Z(Ye,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])]),_:1},8,["text"])])]),(w(!0),N(Pe,null,ot(e.groups,Mt=>(w(),N("div",{key:Mt.workspace.id,class:De(["ws-drop-target",{"drop-before":L.value?.id===Mt.workspace.id&&L.value.position==="before","drop-after":L.value?.id===Mt.workspace.id&&L.value.position==="after"}]),onDragover:Ft=>E(Ft,Mt.workspace.id),onDrop:Ft=>P(Mt.workspace.id)},[Z(x8,{group:Mt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":D.value,"rename-value":R.value,"rename-input-ref":z(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":te.value,dragging:C.value===Mt.workspace.id,"is-collapsed":p,"show-path":v.value,onGroupClick:A,onGroupContextmenu:Ue,onToggleWsMenu:ce,onCreateInWorkspace:Ke[6]||(Ke[6]=Ft=>l("createInWorkspace",Ft)),onSelectSession:$,onRenameSession:Ke[7]||(Ke[7]=(Ft,vn)=>l("rename",Ft,vn)),onArchiveSession:Ke[8]||(Ke[8]=Ft=>l("archive",Ft)),onForkSession:Ke[9]||(Ke[9]=Ft=>l("fork",Ft)),onLoadMore:Ke[10]||(Ke[10]=Ft=>l("loadMoreSessions",Ft)),onConfirmRename:Q,onCancelRename:X,onUpdateRenameValue:ue,onWsDragstart:I,onWsDragend:k},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,z8))),128))],64))],32)],4),ge.value?(w(),ve(Fl,{key:0,ref_key:"ghMenuRef",ref:ze,class:"gh-menu",style:Qt(ke.value),onClick:Ke[11]||(Ke[11]=kt(()=>{},["stop"]))},{default:de(()=>[Z(mn,{onClick:le},{default:de(()=>[je(O(S(n)("sidebar.copyPath")),1)]),_:1}),Z(mn,{onClick:F},{default:de(()=>[je(O(S(n)("sidebar.rename")),1)]),_:1}),Z(mn,{danger:"",onClick:ne},{default:de(()=>[je(O(S(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),te.value!==null&&U.value?(w(),ve(Fl,{key:1,ref_key:"wsMenuRef",ref:fe,class:"ws-menu",style:Qt(Y.value),onClick:Ke[15]||(Ke[15]=kt(()=>{},["stop"]))},{default:de(()=>[Z(mn,{onClick:Ke[12]||(Ke[12]=Mt=>G(U.value))},{default:de(()=>[je(O(S(n)("sidebar.copyPath")),1)]),_:1}),Z(mn,{separator:""}),Z(mn,{onClick:Ke[13]||(Ke[13]=Mt=>re(U.value))},{default:de(()=>[je(O(S(n)("sidebar.rename")),1)]),_:1}),Z(mn,{separator:""}),Z(mn,{danger:"",onClick:Ke[14]||(Ke[14]=Mt=>me(U.value))},{default:de(()=>[je(O(S(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),Ae.value?(w(),ve(Fl,{key:2,ref_key:"sectionMenuRef",ref:ae,class:"section-menu",style:Qt(Ee.value),onClick:Ke[19]||(Ke[19]=kt(()=>{},["stop"]))},{default:de(()=>[Z(mn,{onClick:Ke[16]||(Ke[16]=Mt=>xt("manual"))},{default:de(()=>[T("span",U8,[e.workspaceSortMode==="manual"?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+O(S(n)("sidebar.sortManual")),1)]),_:1}),Z(mn,{onClick:Ke[17]||(Ke[17]=Mt=>xt("recent"))},{default:de(()=>[T("span",q8,[e.workspaceSortMode==="recent"?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+O(S(n)("sidebar.sortRecent")),1)]),_:1}),Z(mn,{separator:""}),Z(mn,{onClick:Ke[18]||(Ke[18]=Mt=>wt())},{default:de(()=>[T("span",j8,[v.value?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+O(S(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),a.value?(w(),ve(QL,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:$,onClose:Ke[20]||(Ke[20]=Mt=>a.value=!1)},null,8,["sessions","active-id"])):ie("",!0),(w(),ve(nh,{to:"body"},[Ht.value?(w(),N("div",{key:0,class:"ds-egg",onMousedown:kt(st,["self"])},[T("div",V8,[T("div",K8,[Ke[23]||(Ke[23]=T("span",{class:"ds-egg-title"},"Design system",-1)),Z(dn,{size:"sm",label:S(n)("diff.close"),onClick:st},{default:de(()=>[Z(Ye,{name:"close",size:"md"})]),_:1},8,["label"])]),Ke[24]||(Ke[24]=T("iframe",{class:"ds-egg-iframe",src:"/design-system.html",title:"Design system"},null,-1))])],32)):ie("",!0)]))],2))}}),Q8=ft(X8,[["__scopeId","data-v-2924688d"]]);function Z8(e){try{const t=Xn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function J8(e,t){try{es(e,String(t))}catch{}}function e5(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(b){return Number.isFinite(b)?Math.min(Cx(o),Math.max(s,Math.round(b))):n}const l=ee(r(Z8(t)??n)),a=ee(!1);function c(b){const g=r(b);l.value=g,J8(t,g)}let u=0,d=0,f=null,h=-1;function p(b){if(!a.value)return;const g=b.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function _(b){b.preventDefault(),a.value=!0,u=b.clientX,d=r(l.value),f=b.currentTarget,h=b.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return hs(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const t5=["aria-label"],n5=Ve({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),{width:i,dragging:r,onPointerDown:l}=e5({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ge(i,a=>s("update:width",a)),Ge(r,a=>s("update:dragging",a)),(a,c)=>(w(),N("div",{class:De(["rh",{dragging:S(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??S(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>S(l)&&S(l)(...u))},[...c[1]||(c[1]=[T("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,t5))}}),m_=ft(n5,[["__scopeId","data-v-ad762f1c"]]),s5={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},o5={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"},i5={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:"Show more ({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"},r5={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"},l5={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…"},a5={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",modelTooltip:"Click to switch model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionTooltip:"Click to cycle permission mode",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",modesTooltip:"Mode: Plan / Goal / Swarm",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},c5={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"},u5={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"},d5={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"},f5={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"},p5={justNow:"just now"},h5={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"},m5={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},g5={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"},v5={panelTitle:"Thinking",close:"Close"},y5={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"},k5={},b5={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},_5={searching:"Searching…",noMatch:"No matches"},w5={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."}},S5={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"}},C5={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"}},x5={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},A5={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"},T5={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},M5={preview:"预览",confirm:"确认",cancel:"取消"},E5={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},I5={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})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchShortcut:"搜索会话 (⌘K)",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},$5={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:"此会话在完成前被中断"},N5={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:"正在加载更早的消息…"},L5={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",modelTooltip:"点击切换模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionTooltip:"点击循环切换审批模式",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",modesTooltip:"模式:计划 / 目标 / Swarm",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},P5={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"},O5={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 后重试"},R5={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 关闭"},D5={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},B5={justNow:"刚刚"},F5={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:"拒绝并退出"},W5={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},H5={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:"展开"},z5={panelTitle:"思考过程",close:"关闭"},U5={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},q5={},j5={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},V5={searching:"搜索中…",noMatch:"无匹配"},K5={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:"目标描述太长了,请精简后重试。"}},G5={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:"撤销上一条消息"}},Y5={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:"已完成"}},X5={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},Q5={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式"},Z5={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},J5={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"},eP={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},tP={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"},nP={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:"在右侧显示可点击跳转的对话目录"},sP={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"},oP={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},iP={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"},rP={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},lP={en:{common:s5,app:o5,sidebar:i5,workspace:r5,conversation:l5,status:a5,composer:c5,login:u5,providers:d5,model:f5,sessions:p5,approval:h5,question:m5,tasks:g5,thinking:v5,diff:y5,fileTree:k5,filePreview:b5,mention:_5,warnings:w5,commands:S5,tools:C5,layout:x5,mobile:A5,theme:T5,onboarding:J5,settings:tP,header:sP,sideChat:iP},zh:{common:M5,app:E5,sidebar:I5,workspace:$5,conversation:N5,status:L5,composer:P5,login:O5,providers:R5,model:D5,sessions:B5,approval:F5,question:W5,tasks:H5,thinking:z5,diff:U5,fileTree:q5,filePreview:j5,mention:V5,warnings:K5,commands:G5,tools:Y5,layout:X5,mobile:Q5,theme:Z5,onboarding:eP,settings:nP,header:oP,sideChat:rP}},pA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function aP(){const e=Xn($t.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const zn=V6({legacy:!1,locale:aP(),fallbackLocale:"en",messages:lP});function hA(e){zn.global.locale.value=e,es($t.locale,e)}const ja=zn.global.t,cP={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"},uP={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 Xl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return uP[t]??t}function td(e){const t=cP[Xl(e)];return t?ja(t):e}const dP={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 d0(e){const t=Xl(e);let n=dP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n?Ta(n,"sm"):""}const mA=80;function fP(e,t=mA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function pP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function hP(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 nn(e){return typeof e=="string"&&e.length>0?e:void 0}function _l(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function mP(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 Jm(e){return nn(e.path)??nn(e.file_path)??nn(e.filePath)??nn(e.filename)}const gP=64;function Pu(e,t,n=!1){const s=(o,i=mA)=>n?o.trim():fP(o,i);try{const o=hP(t);if(!n&&pP(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(Xl(e)){case"read":{const r=Jm(o);if(!r)return i();const l=_l(o.offset)??_l(o.line_start)??_l(o.start_line),a=_l(o.limit)??_l(o.length),c=_l(o.line_end)??_l(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=Jm(o);return r?s(`${r} ${ja("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=Jm(o);return r?s(r):i()}case"bash":{const r=nn(o.command)??nn(o.cmd)??nn(o.script);return r?s(r,gP):i()}case"grep":case"search":{const r=nn(o.pattern)??nn(o.query)??nn(o.regex),l=nn(o.path)??nn(o.glob)??nn(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=nn(o.pattern)??nn(o.glob)??nn(o.query),l=nn(o.path)??nn(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):nn(o.path)?s(nn(o.path)):i()}case"ls":{const r=nn(o.path)??nn(o.dir)??nn(o.directory)??nn(o.cwd);return r?s(r):i()}case"web_fetch":{const r=nn(o.url)??nn(o.uri);return r?s(mP(r)):i()}case"todo":case"task":{const r=nn(o.description)??nn(o.title)??nn(o.prompt)??nn(o.name)??nn(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(ja("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function vP(e){try{switch(Xl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ja("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return ja("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ja("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const yP=Ve({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){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 s=W(()=>n(t.status));return(o,i)=>(w(),N("span",{class:De(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),Ou=ft(yP,[["__scopeId","data-v-e36198e5"]]),kP=["innerHTML"],bP={class:"a"},_P={key:0,class:"p"},wP={class:"rt"},SP=["aria-label"],CP={key:0,class:"tm"},xP=["inert"],AP={class:"bb-pad"},TP=Ve({__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:De(["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]=s=>t.$emit("toggle"))},[e.icon?(w(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,kP)):ie("",!0),T("span",bP,O(e.name),1),Z(ht,{text:e.arg},{default:de(()=>[e.arg?(w(),N("span",_P,O(e.arg),1)):ie("",!0)]),_:1},8,["text"]),T("span",wP,[T("span",{class:De(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),ve(Ye,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),ve(Ou,{key:2,status:"suspended"})):(w(),ve(Ou,{key:3,status:"running"}))],10,SP),Tn(t.$slots,"trailing"),e.time?(w(),N("span",CP,O(e.time),1)):ie("",!0)]),e.expandable?(w(),ve(Ye,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ie("",!0)]),T("div",{class:De(["bb",{open:e.open}]),inert:!e.open},[T("div",AP,[Tn(t.$slots,"default")])],10,xP)],2))}}),f0=ft(TP,[["__scopeId","data-v-92e82f68"]]),MP={key:0,class:"at-type"},EP={key:1,class:"at-task"},IP={key:2,class:"bb-code"},$P=Ve({__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}=Nt(),s=e,o=t;function i(b){if(!b)return{};try{const g=JSON.parse(b);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=W(()=>i(s.tool.arg)),l=W(()=>!!s.tool.output&&s.tool.output.length>0),a=W(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=ee(s.tool.defaultExpanded===!0&&a.value),u=W(()=>s.tool.status),d=W(()=>td(s.tool.name)),f=W(()=>d0(s.tool.name)),h=W(()=>r.value.description||r.value.subagentType||""),p=jt("resolveAgentTaskId"),m=W(()=>p?p(s.tool.id)!==void 0:!0);function _(){a.value&&(c.value=!c.value)}return Ge(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(b,g)=>(w(),ve(f0,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:_},{trailing:de(()=>[m.value?(w(),N("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=kt(v=>o("openAgent",e.tool.id),["stop"]))},O(S(n)("tasks.openDetail")),1)):ie("",!0)]),default:de(()=>[r.value.subagentType?(w(),N("div",MP,O(r.value.subagentType),1)):ie("",!0),r.value.prompt?(w(),N("div",EP,O(r.value.prompt),1)):ie("",!0),l.value?(w(),N("div",IP,[(w(!0),N(Pe,null,ot(e.tool.output??[],(v,y)=>(w(),N("div",{key:y},O(v),1))),128))])):ie("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),NP=ft($P,[["__scopeId","data-v-14ef8750"]]),LP=1e6,g_=5e3;function v_(e){if(e==="")return[];const t=e.split(`
|
|
39
|
-
`);return t.at(-1)===""&&t.pop(),t}function PP(e,t){const n=v_(e),s=v_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>g_||i>g_||(o+1)*(i+1)>LP)return null;const r=Array.from({length:o+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=o;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===s[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=o,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===s[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:s[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function OP(e){let t=0,n=0;for(const s of e)s.type==="add"?t++:s.type==="del"&&n++;return{added:t,removed:n}}function gA(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 vA(e){const t=Xl(e.name);if(t!=="edit"&&t!=="write")return null;const n=gA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const s=typeof n.old_string=="string"?n.old_string:void 0,o=typeof n.new_string=="string"?n.new_string:void 0;return s===void 0||o===void 0?null:PP(s,o)}return null}function RP(e){const t=gA(e);return t&&typeof t.path=="string"?t.path:void 0}function DP(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const BP={key:0,class:"chip"},FP={key:0,class:"bb-summary"},WP={class:"bb-code"},HP={key:0,class:"bb-empty"},zP=Ve({__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,s=t,o=W(()=>n.tool.status),i=W(()=>td(n.tool.name)),r=W(()=>d0(n.tool.name)),l=W(()=>Pu(n.tool.name,n.tool.arg)),a=W(()=>Pu(n.tool.name,n.tool.arg,!0)),c=W(()=>vA(n.tool)),u=W(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:_,removed:b}=OP(m);if(_||b)return`+${_} −${b}`}return""}),d=W(()=>!!n.tool.output&&n.tool.output.length>0),f=ee(!1),h=W(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,_)=>(w(),ve(f0,{status:o.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:de(()=>[u.value?(w(),N("span",BP,O(u.value),1)):ie("",!0)]),default:de(()=>[a.value?(w(),N("div",FP,O(a.value),1)):ie("",!0),T("div",WP,[d.value?ie("",!0):(w(),N("div",HP,"Waiting for output…")),(w(!0),N(Pe,null,ot(e.tool.output??[],(b,g)=>(w(),N("div",{key:g},O(b),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),UP=ft(zP,[["__scopeId","data-v-69861679"]]),qP={key:0,class:"chip"},jP={key:0,class:"bb-summary"},VP={class:"bb-code"},KP={key:0,class:"bb-empty"},GP=Ve({__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=W(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=W(()=>!!t.tool.output&&t.tool.output.length>0),o=W(()=>s.value||n.value),i=ee(t.tool.defaultExpanded===!0&&o.value),r=W(()=>t.tool.status),l=W(()=>td(t.tool.name)),a=W(()=>d0(t.tool.name)),c=W(()=>Pu(t.tool.name,t.tool.arg)),u=W(()=>Pu(t.tool.name,t.tool.arg,!0)),d=W(()=>vP({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){o.value&&(i.value=!i.value)}return Ge(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(h,p)=>(w(),ve(f0,{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:o.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:de(()=>[d.value?(w(),N("span",qP,O(d.value),1)):ie("",!0)]),default:de(()=>[u.value?(w(),N("div",jP,O(u.value),1)):ie("",!0),T("div",VP,[s.value?ie("",!0):(w(),N("div",KP,"Waiting for output…")),(w(!0),N(Pe,null,ot(e.tool.output??[],(m,_)=>(w(),N("div",{key:_},O(m),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),YP=ft(GP,[["__scopeId","data-v-f3c4ee38"]]),XP={class:"media-title"},QP=["src","alt"],ZP=["src"],JP=["src"],eO=Ve({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=W(()=>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=W(()=>{const c=o.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=o.value;c?.kind==="image"&&s("openMedia",c)}return(c,u)=>o.value?(w(),N("div",{key:0,class:De(["media-tool",{mob:e.mobile}])},[Z(ht,{text:o.value.path||l.value},{default:de(()=>[T("div",XP,O(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(w(),ve(ht,{key:0,text:o.value.path||l.value},{default:de(()=>[T("button",{type:"button",class:"media-image-button",onClick:a},[T("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,QP)])]),_:1},8,["text"])):o.value.kind==="video"?(w(),N("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,ZP)):(w(),N("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,JP))],2)):ie("",!0)}}),tO=ft(eO,[["__scopeId","data-v-bec13b73"]]);function nO(e){if(e.media&&e.status==="ok")return tO;const t=Xl(e.name);return t==="edit"||t==="write"||t==="multi_edit"?UP:t==="task"?NP:YP}const yA=Ve({__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,s=t,o=W(()=>nO(n.tool));return(i,r)=>(w(),ve(Bs(o.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:r[0]||(r[0]=l=>s("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>s("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>s("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>s("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel"]))}});function y_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function sO(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 ch(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 oO(e){return!(e.tool.status==="ok"&&e.tool.media)}function iO(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function rO(e){const t=ch(e),n=[];let s=[];const o=()=>{if(s.length===1){const[i]=s;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else s.length>1&&n.push({kind:"tool-stack",tools:s});s=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(oO(i)){s.push({tool:i.tool,sourceIndex:r});return}o(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}o(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),o(),n}function lO(e){return ch(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
40
|
-
|
|
41
|
-
`)}function aO(e){const t=[];for(const n of ch(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 s=n.tool.output.join(`
|
|
45
|
-
`);t.push(`\`\`\`
|
|
46
|
-
[${n.tool.name}]
|
|
47
|
-
${s}
|
|
48
|
-
\`\`\``)}return t.join(`
|
|
49
|
-
|
|
50
|
-
`)}function kA(e){return e.tool.id||`tool-${e.sourceIndex}`}function cO(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?kA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const uO=["aria-expanded"],dO={class:"tg-title"},fO={class:"tg-meta"},pO={class:"tool-group-body"},hO=Ve({__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,s=t,o=ee(!0),i=W(()=>n.tools.length),r=W(()=>n.tools.some(u=>u.tool.status==="running")?"running":n.tools.some(u=>u.tool.status==="error")?"error":"done"),{t:l}=Nt(),a=W(()=>{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(){o.value=!o.value}return(u,d)=>(w(),N("div",{class:De(["tool-group",{open:o.value}])},[T("button",{class:"tool-group-head",type:"button","aria-expanded":o.value,onClick:c},[Z(Ou,{status:r.value},null,8,["status"]),Z(Ye,{class:"tg-ic",name:"list",size:"sm"}),T("span",dO,O(S(l)("tools.group.title",i.value)),1),T("span",fO,"· "+O(a.value),1),Z(Ye,{class:"tg-car",name:"chevron-right",size:"sm"})],8,uO),In(T("div",pO,[(w(!0),N(Pe,null,ot(e.tools,(f,h)=>(w(),ve(yA,{key:S(kA)(f),tool:f.tool,mobile:e.mobile,"stack-position":S(iO)(h,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:d[0]||(d[0]=p=>s("openMedia",p)),onOpenFile:d[1]||(d[1]=p=>s("openFile",p)),onOpenToolDiff:d[2]||(d[2]=p=>s("openToolDiff",p)),onOpenAgent:d[3]||(d[3]=p=>s("openAgent",p))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))],512),[[Ko,o.value]])],2))}}),mO=ft(hO,[["__scopeId","data-v-79e21bc7"]]);var gO=Object.create,p0=Object.defineProperty,vO=Object.getOwnPropertyDescriptor,bA=Object.getOwnPropertyNames,yO=Object.getPrototypeOf,kO=Object.prototype.hasOwnProperty,_A=(e,t)=>function(){return t||(0,e[bA(e)[0]])((t={exports:{}}).exports,t),t.exports},wA=e=>{let t={};for(var n in e)p0(t,n,{get:e[n],enumerable:!0});return t},bO=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=bA(t),i=0,r=o.length,l;i<r;i++)l=o[i],!kO.call(e,l)&&l!==n&&p0(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=vO(t,l))||s.enumerable});return e},SA=(e,t,n)=>(n=e!=null?gO(yO(e)):{},bO(p0(n,"default",{value:e,enumerable:!0}),e));function _O(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function wO(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function SO(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function CO(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 xO(){return`</ol>
|
|
55
|
-
</section>
|
|
56
|
-
`}function AO(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function TO(){return`</li>
|
|
57
|
-
`}function MO(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function EO(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=SO,e.renderer.rules.footnote_block_open=CO,e.renderer.rules.footnote_block_close=xO,e.renderer.rules.footnote_open=AO,e.renderer.rules.footnote_close=TO,e.renderer.rules.footnote_anchor=MO,e.renderer.rules.footnote_caption=wO,e.renderer.rules.footnote_anchor_name=_O;function s(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:p},m.level=l.level++,l.tokens.push(m);const _=l.bMarks[a],b=l.tShift[a],g=l.sCount[a],v=l.parentType,y=h,C=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=C;for(;h<f;){const k=l.src.charCodeAt(h);if(n(k))k===9?L+=4-L%4:L++;else break;h++}l.tShift[a]=h-y,l.sCount[a]=L-C,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]=b,l.sCount[a]=g,l.bMarks[a]=_;const I=new l.Token("footnote_reference_close","",-1);return I.level=--l.level,l.tokens.push(I),!0}function o(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,m=h.length;p<m;p++){const _=new l.Token("footnote_open","",1);if(_.meta={id:p,label:h[p].label},l.tokens.push(_),h[p].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[p].tokens,y.content=h[p].content,a.push(y);const C=new l.Token("paragraph_close","p",-1);C.block=!0,a.push(C)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let b;l.tokens[l.tokens.length-1].type==="paragraph_close"?b=l.tokens.pop():b=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:p,subId:v,label:h[p].label},l.tokens.push(y)}b&&l.tokens.push(b),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function IO(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function $O(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const NO=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function LO(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(NO,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function PO(e){e.inline.ruler.after("emphasis","sub",LO)}const OO=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function RO(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(OO,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function DO(e){e.inline.ruler.after("emphasis","sup",RO)}var BO=_A({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,_){_=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},_),m.core.ruler.after("inline","github-task-lists",function(b){for(var g=b.tokens,v=0,y=2;y<g.length;y++)o(g,y)&&(i(g[y],v,_,b.Token),v+=1,n(g[y-2],"class",_.liClass),n(g[s(g,y-2)],"class",_.ulClass))})};function n(m,_,b){var g=m.attrIndex(_),v=[_,b];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,_){for(var b=m[_].level-1,g=_-1;g>=0;g--)if(m[g].level===b)return g;return-1}function o(m,_){return d(m[_])&&f(m[_-1])&&h(m[_-2])&&p(m[_])}function i(m,_,b,g){var v=b.idPrefix+_;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,b,g)),b.divWrap&&(m.children.unshift(c(b,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",_]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),b.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,_){var b=new _("label_open","label",1);return b.attrs=[["for",m]],b}function a(m){return new m("label_close","label",-1)}function c(m,_){var b=new _("checkbox_open","div",0);return b.attrs=[["class",m.divClass]],b}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),FO=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))),WO=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),eg;const HO=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]]),zO=(eg=String.fromCodePoint)!==null&&eg!==void 0?eg: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 UO(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=HO.get(e))!==null&&t!==void 0?t:e}var ks;(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"})(ks||(ks={}));const qO=32;var Rr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Rr||(Rr={}));function Bv(e){return e>=ks.ZERO&&e<=ks.NINE}function jO(e){return e>=ks.UPPER_A&&e<=ks.UPPER_F||e>=ks.LOWER_A&&e<=ks.LOWER_F}function VO(e){return e>=ks.UPPER_A&&e<=ks.UPPER_Z||e>=ks.LOWER_A&&e<=ks.LOWER_Z||Bv(e)}function KO(e){return e===ks.EQUALS||VO(e)}var ys;(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"})(ys||(ys={}));var Lr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Lr||(Lr={}));var GO=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ys.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Lr.Strict}startEntity(e){this.decodeMode=e,this.state=ys.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ys.EntityStart:return e.charCodeAt(t)===ks.NUM?(this.state=ys.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ys.NamedEntity,this.stateNamedEntity(e,t));case ys.NumericStart:return this.stateNumericStart(e,t);case ys.NumericDecimal:return this.stateNumericDecimal(e,t);case ys.NumericHex:return this.stateNumericHex(e,t);case ys.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|qO)===ks.LOWER_X?(this.state=ys.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ys.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Bv(s)||jO(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Bv(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ks.SEMI)this.consumed+=1;else if(this.decodeMode===Lr.Strict)return 0;return this.emitCodePoint(UO(this.result),this.consumed),this.errors&&(e!==ks.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&Rr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=YO(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Lr.Attribute&&(o===0||KO(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&Rr.VALUE_LENGTH)>>14,o!==0){if(i===ks.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Lr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&Rr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~Rr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case ys.NamedEntity:return this.result!==0&&(this.decodeMode!==Lr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ys.NumericDecimal:return this.emitNumericEntity(0,2);case ys.NumericHex:return this.emitNumericEntity(0,3);case ys.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ys.EntityStart:return 0}}};function CA(e){let t="";const n=new GO(e,s=>t+=zO(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function YO(e,t,n,s){const o=(t&Rr.BRANCH_LENGTH)>>7,i=t&Rr.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const XO=CA(FO);CA(WO);function h0(e,t=Lr.Legacy){return XO(e,t)}var QO=SA(BO());const k_={};function ZO(e){let t=k_[e];if(t)return t;t=k_[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function uh(e,t){typeof t!="string"&&(t=uh.defaultChars);const n=ZO(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}uh.defaultChars=";/?:@&=+$,#";uh.componentChars="";var Fv=uh;const b_={};function JO(e){let t=b_[e];if(t)return t;t=b_[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function dh(e,t,n){typeof t!="string"&&(n=t,t=dh.defaultChars),typeof n>"u"&&(n=!0);const s=JO(t);let o="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}dh.defaultChars=";/?:@&=+$,-_.!~*'()#";dh.componentChars="-_.!~*'()";var xA=dh;function m0(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 lp(){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 eR=/^([a-z0-9.+-]+:)/i,tR=/:[0-9]*$/,nR=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,sR=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
58
|
-
`," "]),oR=["'"].concat(sR),__=["%","/","?",";","#"].concat(oR),w_=["/","?","#"],iR=255,S_=/^[+a-z0-9A-Z_-]{0,63}$/,rR=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,C_={javascript:!0,"javascript:":!0},x_={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 lp)return e;const n=new lp;return n.parse(e,t),n}lp.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=nR.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=eR.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&C_[r])&&(i=i.substr(2),this.slashes=!0)),!C_[r]&&(o||r&&!x_[r])){let c=-1;for(let p=0;p<w_.length;p++)s=i.indexOf(w_[p]),s!==-1&&(c===-1||s<c)&&(c=s);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let p=0;p<__.length;p++)s=i.indexOf(__[p]),s!==-1&&(c===-1||s<c)&&(c=s);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let m=0,_=p.length;m<_;m++){const b=p[m];if(b&&!b.match(S_)){let g="";for(let v=0,y=b.length;v<y;v++)b.charCodeAt(v)>127?g+="x":g+=b[v];if(!g.match(S_)){const v=p.slice(0,m),y=p.slice(m+1),C=b.match(rR);C&&(v.push(C[1]),y.unshift(C[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>iR&&(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),x_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};lp.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 g0=lR,AA=wA({decode:()=>Fv,encode:()=>xA,format:()=>m0,parse:()=>g0}),TA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,MA=/[\0-\x1F\x7F-\x9F]/,aR=/[\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]/,EA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,cR=/[\$\+<->\^`\|~\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]/,IA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,uR=wA({Any:()=>TA,Cc:()=>MA,Cf:()=>aR,P:()=>EA,S:()=>cR,Z:()=>IA}),dR=Object.defineProperty,$A=e=>{let t={};for(var n in e)dR(t,n,{get:e[n],enumerable:!0});return t},os=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},fR=$A({arrayReplaceAt:()=>kR,assign:()=>vR,countLines:()=>Kn,escapeHtml:()=>MR,escapeRE:()=>IR,fromCodePoint:()=>Du,has:()=>gR,isMdAsciiPunct:()=>up,isPunctChar:()=>cp,isPunctCode:()=>Wv,isSpace:()=>yR,isString:()=>hR,isValidEntityCode:()=>ph,isWhiteSpace:()=>Ru,lib:()=>$R,mdurl:()=>AA,normalizeReference:()=>fh,ucmicro:()=>ap,unescapeAll:()=>Bu,unescapeMd:()=>SR});const ap=uR;function pR(e){return Object.prototype.toString.call(e)}function hR(e){return pR(e)==="[object String]"}const mR=Object.prototype.hasOwnProperty;function gR(e,t){return mR.call(e,t)}function vR(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function yR(e){return e===9||e===32}function Ru(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 cp(e){return ap.P.test(e)||ap.S.test(e)}const A_=new Map;function Wv(e){if(up(e))return!0;const t=A_.get(e);if(t!==void 0)return t;const n=cp(String.fromCharCode(e));return A_.set(e,n),n}function up(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 fh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function kR(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function ph(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 Du(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 NA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,bR=new RegExp(`${NA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),_R=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function wR(e,t){if(t.charCodeAt(0)===35&&_R.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return ph(s)?Du(s):e}const n=h0(e);return n!==e?n:e}function SR(e){return e.includes("\\")?e.replace(NA,"$1"):e}function Bu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(bR,(t,n,s)=>n||wR(t,s))}const CR=/[&<>"]/,xR=/[&<>"]/g,AR={"&":"&","<":"<",">":">",'"':"""};function TR(e){return AR[e]}function MR(e){return CR.test(e)?e.replace(xR,TR):e}const ER=/[.?*+^$[\]\\(){}|-]/g;function IR(e){return e.replace(ER,"\\$&")}const $R={mdurl:AA,ucmicro:ap};function Kn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
59
|
-
`,n+1))!==-1;)t++;return t}const NR=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,LR=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,PR=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,v0=["references","footnotes","abbreviations","abbr","abbrs"],y0=Symbol.for("markdown-it-ts.global-state"),k0=Object.prototype.hasOwnProperty;function T_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function ci(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Hr(e){if(Array.isArray(e))return e.map(t=>Hr(t));if(ci(e)){const t={};for(const n of Object.keys(e))t[n]=Hr(e[n]);return t}return e}function dp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):ci(e)?Object.keys(e):[]}function Hv(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(!Hv(e[n],t[n]))return!1;return!0}if(ci(e)||ci(t)){if(!ci(e)||!ci(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!k0.call(t,o)||!Hv(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function LA(e,t){if(Array.isArray(e))return e[Number(t)];if(ci(e))return e[t]}function OR(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Hr(t[n]);return e}if(ci(e)&&ci(t)){for(const n of Object.keys(e))k0.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Hr(t[n]);return e}return Hr(t)}function RR(e,t,n){const s=n.ownedKeys??[],o=e[t];if(ci(o)||Array.isArray(o)){const i=new Set(dp(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=Hr(LA(n.value,r)):delete o[r];!n.existed&&dp(o).length===0&&delete e[t];return}n.existed?e[t]=Hr(n.value):delete e[t]}function b0(e){const t=e[y0];return T_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&T_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function DR(e,t){Object.defineProperty(e,y0,{value:t,enumerable:!1,configurable:!0,writable:!0})}function oo(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:NR.test(e)?"footnote-definition":LR.test(e)?"abbreviation-definition":PR.test(e)?"reference-definition":null}function nd(e){return b0(e)?.reason??null}function Va(e,t,n){if(nd(e)&&or(e),!t)return n();_0(e,t);try{const s=n();return w0(e),s}catch(s){throw or(e),s}}function _0(e,t){try{or(e);const n={};for(const s of v0)n[s]=k0.call(e,s)?{existed:!0,value:Hr(e[s])}:{existed:!1};DR(e,{reason:t,snapshot:n})}catch{}}function w0(e){const t=b0(e);if(t)for(const n of v0){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!ci(o)&&!Array.isArray(o))continue;const i=new Set(dp(s.existed?s.value:void 0));s.ownedKeys=dp(o).filter(r=>i.has(r)?!Hv(o[r],LA(s.value,r)):!0)}}function or(e){const t=b0(e);if(t){for(const n of v0){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){RR(e,n,s);continue}s.existed?e[n]=OR(e[n],s.value):delete e[n]}delete e[y0]}}const zv=Symbol.for("markdown-it-ts.diagnostics");function hh(e,t){if(e)try{const n=e[zv];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[zv]=s,s}catch{return}}function Ui(e){return hh(e,!1)}function BR(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 Vs(e){BR(e)}function ns(e,t){const n=hh(e,!0);n&&(n.strategy=t)}function tg(e,t){const n=hh(e,!0);n&&(n.chunk=t)}function PA(e,t){const n=hh(e,!0);n&&(n.unbounded=t)}function FR(e){const t={};e=e||{},t.src_Any=TA.source,t.src_Cc=MA.source,t.src_Z=IA.source,t.src_P=EA.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 Uv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function mh(e){return Object.prototype.toString.call(e)}function WR(e){return mh(e)==="[object String]"}function HR(e){return mh(e)==="[object Object]"}function zR(e){return mh(e)==="[object RegExp]"}function M_(e){return mh(e)==="[object Function]"}function UR(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const OA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function qR(e){return Object.keys(e||{}).reduce(function(t,n){return t||OA.hasOwnProperty(n)},!1)}const jR={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},VR="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]",KR="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function GR(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function E_(){return function(e,t){t.normalize(e)}}function fp(e){const t=e.re=FR(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(VR),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(s(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(s(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(s(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,HR(a)){zR(a.validate)?c.validate=GR(a.validate):M_(a.validate)?c.validate=a.validate:i(l,a),M_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=E_();return}if(WR(a)){o.push(l);return}i(l,a)}),o.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:E_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(UR).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 RA(e,t,n,s){const o=e.slice(n,s);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=s,this.raw=o,this.text=o,this.url=o}function No(e,t){if(!(this instanceof No))return new No(e,t);t||qR(e)&&(t=e,e={}),this.__opts__=Uv({},OA,t),this.__schemas__=Uv({},jR,e),this.__compiled__={},this.__tlds__=KR,this.__tlds_replaced__=!1,this.re={},fp(this)}No.prototype.add=function(t,n){return this.__schemas__[t]=n,fp(this),this};No.prototype.set=function(t){return this.__opts__=Uv(this.__opts__,t),this};No.prototype.test=function(t){if(!t.length)return!1;let n,s;if(this.re.schema_test.test(t)){for(s=this.re.schema_search,s.lastIndex=0;(n=s.exec(t))!==null;)if(this.testSchemaAt(t,n[2],s.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)};No.prototype.pretest=function(t){return this.re.pretest.test(t)};No.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};No.prototype.match=function(t){const n=[],s=[],o=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&s.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;)o.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[s[u[0]],i[u[1]],o[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new RA(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};No.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);if(!s)return null;const o=new RA(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};No.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),fp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,fp(this),this)};No.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};No.prototype.onCompile=function(){};var DA=No,YR=_A({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,_=Math.floor,b=String.fromCharCode;function g(R){throw new RangeError(p[R])}function v(R,H){const z=[];let q=R.length;for(;q--;)z[q]=H(R[q]);return z}function y(R,H){const z=R.split("@");let q="";z.length>1&&(q=z[0]+"@",R=z[1]),R=R.replace(h,".");const Q=v(R.split("."),H).join(".");return q+Q}function C(R){const H=[];let z=0;const q=R.length;for(;z<q;){const Q=R.charCodeAt(z++);if(Q>=55296&&Q<=56319&&z<q){const X=R.charCodeAt(z++);(X&64512)==56320?H.push(((Q&1023)<<10)+(X&1023)+65536):(H.push(Q),z--)}else H.push(Q)}return H}const L=R=>String.fromCodePoint(...R),I=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},k=function(R,H){return R+22+75*(R<26)-((H!=0)<<5)},M=function(R,H,z){let q=0;for(R=z?_(R/700):R>>1,R+=_(R/H);R>m*26>>1;q+=36)R=_(R/m);return _(q+(m+1)*R/(R+38))},E=function(R){const H=[],z=R.length;let q=0,Q=128,X=72,ue=R.lastIndexOf("-");ue<0&&(ue=0);for(let ge=0;ge<ue;++ge)R.charCodeAt(ge)>=128&&g("not-basic"),H.push(R.charCodeAt(ge));for(let ge=ue>0?ue+1:0;ge<z;){const xe=q;for(let ze=1,qe=36;;qe+=36){ge>=z&&g("invalid-input");const Ue=I(R.charCodeAt(ge++));Ue>=36&&g("invalid-input"),Ue>_((2147483647-q)/ze)&&g("overflow"),q+=Ue*ze;const Le=qe<=X?1:qe>=X+26?26:qe-X;if(Ue<Le)break;const le=36-Le;ze>_(2147483647/le)&&g("overflow"),ze*=le}const ke=H.length+1;X=M(q-xe,ke,xe==0),_(q/ke)>2147483647-Q&&g("overflow"),Q+=_(q/ke),q%=ke,H.splice(q++,0,Q)}return String.fromCodePoint(...H)},P=function(R){const H=[];R=C(R);const z=R.length;let q=128,Q=0,X=72;for(const xe of R)xe<128&&H.push(b(xe));const ue=H.length;let ge=ue;for(ue&&H.push("-");ge<z;){let xe=2147483647;for(const ze of R)ze>=q&&ze<xe&&(xe=ze);const ke=ge+1;xe-q>_((2147483647-Q)/ke)&&g("overflow"),Q+=(xe-q)*ke,q=xe;for(const ze of R)if(ze<q&&++Q>2147483647&&g("overflow"),ze===q){let qe=Q;for(let Ue=36;;Ue+=36){const Le=Ue<=X?1:Ue>=X+26?26:Ue-X;if(qe<Le)break;const le=qe-Le,F=36-Le;H.push(b(k(Le+le%F,0))),qe=_(le/F)}H.push(b(k(qe,0))),X=M(Q,ke,ge===ue),Q=0,++ge}++Q,++q}return H.join("")},D={version:"2.3.1",ucs2:{decode:C,encode:L},decode:E,encode:P,toASCII:function(R){return y(R,function(H){return f.test(H)?"xn--"+P(H):H})},toUnicode:function(R){return y(R,function(H){return d.test(H)?E(H.slice(4).toLowerCase()):H})}};t.exports=D})}),BA=SA(YR());function S0(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=Bu(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=Bu(e.slice(t,o)),i.pos=o,i.ok=!0),i}var FA=S0;const _f=-2;function XR(e,t,n,s){let o=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(o--,o===0)return i;if(s){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return _f}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return _f;if(r===91){o++,i++;continue}i++}return-1}function C0(e,t,n){let s=1,o=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=XR(l,t,a,n);if(f!==_f)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let h=-1;return o&&(h=e.pos),e.pos=c,h}var pp=C0;function x0(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=Bu(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Bu(e.slice(t,i)),r}var WA=x0;function gh(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 A0(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function QR(e,t,n){const s=gh(e,t),o=[t,n];s<0?A0(e,o):e.attrs[s]=o}function ZR(e,t){const n=gh(e,t);return n>=0?e.attrs[n][1]:null}function JR(e,t,n){const s=gh(e,t);s<0?A0(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var eD=$A({attrGet:()=>ZR,attrIndex:()=>gh,attrJoin:()=>JR,attrPush:()=>A0,attrSet:()=>QR,parseLinkDestination:()=>S0,parseLinkLabel:()=>C0,parseLinkTitle:()=>x0});function tD(e){return e.includes("\r")||e.includes("\0")}function HA(e){return typeof e=="string"?e:e.toString()}function nD(e){if(e.inlineMode){const t=new os("inline","",0);t.content=HA(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 sD=/^([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])?)*)$/,oD=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function iD(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(oD.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(sD.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 rD=iD;function lD(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(s,c);f.includes(`
|
|
60
|
-
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var aD=lD;function I_(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=s-i[s]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function cD(e){const t=e.tokens_meta,n=e.tokens_meta.length;I_(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&I_(t[s].delimiters)}var uD=cD;function dD(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function $_(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function fD(e){const t=e.tokens_meta,n=e.tokens_meta.length;$_(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&$_(e,t[s].delimiters)}const N_={tokenize:dD,postProcess:fD};function zA(e){return h0(e)}function T0(e){return e>=48&&e<=57}function pD(e){const t=e|32;return T0(e)||t>=97&&t<=102}function UA(e){const t=e|32;return t>=97&&t<=122}function hD(e){return UA(e)||T0(e)}function mD(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?pD(l):T0(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function gD(e,t,n){let s=t+1;if(s>=n||!UA(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&hD(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return zA(o)!==o?o:null}function vD(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=mD(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=ph(i)?Du(i):Du(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=gD(e.src,n,s);if(o){const i=zA(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var yD=vD;const qA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),qv=new Array(128),jA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);qv[e]=`\\${t}`,jA[e]=qA[e]?t:qv[e]}function L_(e,t,n){e.pending&&e.pushPending();const s=new os("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function kD(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(L_(e,jA[i],qv[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return L_(e,i<256&&qA[i]?r:l,l),e.pos=n+1,!0}var bD=kD;function _D(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var wD=_D;const VA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,KA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",SD=new RegExp(`^(?:${VA}|${KA}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),CD=new RegExp(`^(?:${VA}|${KA})`);function GA(e){return e===32||e===9||e===10||e===12||e===13}function xD(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||GA(t)}function AD(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(!GA(n))return!1}return!1}function TD(e){const t=e|32;return t>=97&&t<=122}function MD(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!TD(i))return!1;const r=o.slice(s).match(SD);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,xD(l)&&e.linkLevel++,AD(l)&&e.linkLevel--}return e.pos+=l.length,!0}var ED=MD;function ID(e,t){let n,s,o,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=pp(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=FA(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=WA(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=pp(e,i),i>=0?o=e.src.slice(c,i++):i=p+1):i=p+1,o||(o=e.src.slice(h,p)),r=e.env.references[fh(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(h,p);const m=[];e.md.inline.parse(s,e.md,e.env,m);const _=e.push("image","img",0);_.attrs=[["src",u],["alt",""]],_.children=m,_.content=s,a&&_.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var $D=ID;function ND(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=pp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(o=FA(e.src,p,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?p=o.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(o=WA(e.src,p,e.posMax),p<d&&a!==p&&o.ok)for(l=o.str,p=o.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=pp(e,p),p>=0?s=e.src.slice(a,p++):p=h+1):p=h+1,s||(s=e.src.slice(f,h)),i=e.env.references[fh(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const m=e.push("link_open","a",1),_=[["href",r]];m.attrs=_,l&&_.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var LD=ND;function YA(e){const t=e|32;return t>=97&&t<=122}function PD(e){return e>=48&&e<=57}function OD(e){return YA(e)||PD(e)||e===43||e===45||e===46}function RD(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&OD(e.charCodeAt(t));)t--;return t++,t>=e.length||!YA(e.charCodeAt(t))?null:e.slice(t)}function DD(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function BD(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=RD(e.pending);if(!o)return!1;const i=DD(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function FD(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var WD=FD;function HD(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function P_(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function zD(e){const t=e.delimiters;P_(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&P_(e,n[s].delimiters)}const O_={tokenize:HD,postProcess:zD};function R_(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 UD(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||R_(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!R_(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var qD=UD;function M0(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function jD(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function VD(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 XA(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:M0(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function Ka(e,t,n,s,o,i){const r=XA(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=VD(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=M0()}function KD(e){const t=XA(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=jD(o.samples)}return t.completedAt=M0(),t}var D_=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},QA=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,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new os("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 os(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const s=new os(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=Ru(l),u=Ru(a),d=Wv(l),f=Wv(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};QA.prototype.Token=os;const GD=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function ZA(e){return!GD.test(e)}var YD=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new D_,this.ruler2=new D_,this.ruler.push("text",qD),this.ruler.push("linkify",BD),this.ruler.push("newline",WD),this.ruler.push("escape",bD),this.ruler.push("backticks",aD),this.ruler.push("strikethrough",O_.tokenize),this.ruler.push("emphasis",N_.tokenize),this.ruler.push("link",LD),this.ruler.push("image",$D),this.ruler.push("autolink",rD),this.ruler.push("html_inline",ED),this.ruler.push("entity",yD),this.ruler2.push("balance_pairs",uD),this.ruler2.push("strikethrough",O_.postProcess),this.ruler2.push("emphasis",N_.postProcess),this.ruler2.push("fragments_join",wD),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<s;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Ka(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<s;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Ka(e.env,"inline",o[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&ZA(e)){const a=new os("text","",0);a.content=e,s.push(a);return}const o=new QA(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ka(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function XD(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&ZA(i.content)){const r=new os("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const QD=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,ZD=/[0-9a-z]/i;function JD(e){return/^<a[>\s]/i.test(e)}function eB(e){return/^<\/a\s*>/i.test(e)}function tB(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!QD.test(s)||!ZD.test(o))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function nB(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(JD(l.content)&&i>0&&i--,eB(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=>tB(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],m=e.md.normalizeLink(p.url);if(!e.md.validateLink(m))continue;let _=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText(`mailto:${_}`).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText(`http://${_}`).replace(/^http:\/\//,"");const b=p.index;if(b>f){const C=new os("text","",0);C.content=a.slice(f,b),C.level=d,u.push(C)}const g=new os("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new os("text","",0);v.content=_,v.level=d,u.push(v);const y=new os("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new os("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const sB=/\r\n?|\n/g,oB=/\0/g;function iB(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(sB,`
|
|
61
|
-
`)),s&&(o=o.replace(oB,"�")),e.src=o}const JA=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,rB=/\((?:c|tm|r)\)/i,lB=/\((c|tm|r)\)/gi,aB={c:"©",r:"®",tm:"™"};function cB(e,t){return aB[t.toLowerCase()]}function uB(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(lB,cB)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function dB(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&JA.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function fB(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");rB.test(s)&&uB(n.children||[]),JA.test(s)&&dB(n.children||[])}}var pB=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(s=>s.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(s=>s.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const hB=/['"]/,B_=/['"]/g,F_="’";function Yd(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function mB(e,t){let n;const s=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){B_.lastIndex=c;const d=B_.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let m=32;if(d.index-1>=0)m=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let _=32;if(c<u)_=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){_=e[n].content.charCodeAt(0);break}const b=up(m)||cp(String.fromCharCode(m)),g=up(_)||cp(String.fromCharCode(_)),v=Ru(m),y=Ru(_);if(y?f=!1:g&&(v||b||(f=!1)),v?h=!1:b&&(y||g||(h=!1)),_===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=b,h=g),!f&&!h){p&&(r.content=Yd(r.content,d.index,F_));continue}if(h)for(n=s.length-1;n>=0;n--){let C=s[n];if(s[n].level<l)break;if(C.single===p&&s[n].level===l){C=s[n];let L,I;p?(L=o[2]||"‘",I=o[3]||"’"):(L=o[0]||"“",I=o[1]||"”"),r.content=Yd(r.content,d.index,I),e[C.token].content=Yd(e[C.token].content,C.pos,L),c+=I.length-1,C.token===i&&(c+=L.length-1),a=r.content,u=a.length,s.length=n;continue e}}f?s.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=Yd(r.content,d.index,F_))}}}function gB(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!hB.test(s)||!n.children||mB(n.children,e)}}function vB(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const yB=/^(?:vbscript|javascript|file|data):/,kB=/^data:image\/(?:gif|png|jpeg|webp);/,eT=["http:","https:","mailto:"];function tT(e){const t=e.trim().toLowerCase();return yB.test(t)?kB.test(t):!0}function nT(e){const t=g0(e,!0);if(t.hostname&&(!t.protocol||eT.includes(t.protocol)))try{t.hostname=BA.default.toASCII(t.hostname)}catch{}return xA(m0(t))}function sT(e){const t=g0(e,!0);if(t.hostname&&(!t.protocol||eT.includes(t.protocol)))try{t.hostname=BA.default.toUnicode(t.hostname)}catch{}return Fv(m0(t),`${Fv.defaultChars}%`)}function bB(e){switch(e){case 9:case 32:return!0}return!1}function _B(e,t,n,s){const o=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||o.charCodeAt(u)!==62)return!1;if(s)return!0;const h=[],p=[],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 M=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!M){let P=a[y]+1,A,$;o.charCodeAt(u)===32?(u++,P++,$=!1,A=!0):o.charCodeAt(u)===9?(A=!0,(c[y]+P)%4===3?(u++,P++,$=!1):$=!0):A=!1;let D=P;for(h.push(i[y]),i[y]=u;u<d;){const R=o.charCodeAt(u);if(bB(R))R===9?D+=4-(D+c[y]+($?1:0))%4:D++;else break;u++}v=u>=d,p.push(c[y]),c[y]=a[y]+1+(A?1:0),m.push(a[y]),a[y]=D-P,_.push(l[y]),l[y]=u-i[y];continue}if(v)break;let E=!1;for(let P=0,A=b.length;P<A;P++)if(b[P](e,y,n,!0)){E=!0;break}if(E){e.lineMax=y,e.blkIndent!==0&&(h.push(i[y]),p.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}h.push(i[y]),p.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]=-1}const C=e.blkIndent;e.blkIndent=0;const L=e.push("blockquote_open","blockquote",1);L.markup=">";const I=[t,0];L.map=I,e.md.block.tokenize(e,t,y);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=f,e.parentType=g,I[1]=e.line;for(let M=0;M<_.length;M++)i[M+t]=h[M],l[M+t]=_[M],a[M+t]=m[M],c[M+t]=p[M];return e.blkIndent=C,!0}function wB(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
|
|
62
|
-
`,i.map=[t,e.line],!0}function SB(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const W_=["","h1","h2","h3","h4","h5","h6"],H_=["","#","##","###","####","#####","######"];function z_(e){switch(e){case 9:case 32:return!0}return!1}function CB(e,t,n,s){const o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!z_(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&z_(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",W_[d],1);h.markup=H_[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=o.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const m=e.push("heading_close",W_[d],-1);return m.markup=H_[d],!0}function xB(e){switch(e){case 9:case 32:return!0}return!1}function AB(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!xB(c))return!1;c===r&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const va=[[/^<(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(`${CD.source}\\s*$`),/^$/,!1]];function TB(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<va.length&&!va[l][0].test(r);l++);if(l===va.length)return!1;if(s)return va[l][2];let a=t+1;if(!va[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),va[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 U_(e){switch(e){case 9:case 32:return!0}return!1}const ru={Pipe:1,ParagraphTerminator:2};function MB(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 oT=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,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=o.length;u<d;u++){const f=o.charCodeAt(u);if(f===124&&(c|=ru.Pipe|ru.ParagraphTerminator),!a)if(U_(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,MB(f)&&(c|=ru.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(o.length),this.eMarks.push(o.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 o=new os(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new os(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=s?this.eMarks[u]+1:this.eMarks[u];let p=0;const m=this.src,_=this.bsCount,b=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+_[u])%4:p++;else if(f-d<b[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const o=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const h=r[d];let p=h,m;for(d+1<t||s?m=l[d]+1:m=l[d];p<m&&f<n;){const _=i.charCodeAt(p);if(U_(_))_===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?o[u]=new Array(f-n+1).join(" ")+i.slice(p,m):o[u]=i.slice(p,m)}return o.join("")}};oT.prototype.Token=os;function EB(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function iT(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function rT(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&ru.ParagraphTerminator)===0||s>=o)return!1;const i=n.charCodeAt(s);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:EB(n,s,o)}const q_=["","h1","h2"];function IB(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=iT(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const y=i[p]+r[p],C=l[p];if(y>=C)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(y),h===45||h===61)){let I=y+1,k=I;for(;I<C&&o.charCodeAt(I)===h;)I++;for(k=I;I<C;){const M=o.charCodeAt(I);if(M!==9&&M!==32)break;I++}if(I>=C){f=h===61?1:2;break}if(k-y>1)continue}if(a[p]<0||u&&!rT(e,p,o,y,C))continue;let L=!1;for(let I=0,k=s.length;I<k;I++)if(s[I](e,p,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(p===t+1){const y=i[t]+r[t];let C=l[t];for(;C>y;){const L=o.charCodeAt(C-1);if(L!==9&&L!==32)break;C--}m=o.slice(y,C)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const _=h===61?"=":"-",b=e.push("heading_open",q_[f],1);b.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",q_[f],-1);return v.markup=_,e.parentType=d,!0}function lT(e){switch(e){case 9:case 32:return!0}return!1}function j_(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!lT(i.charCodeAt(l))?-1:l}function V_(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!lT(c))?-1:a}function $B(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const NB=["0","1","2","3","4","5","6","7","8","9"];function LB(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function PB(e,t,n,s){let o,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,m=e.tShift,_=e.eMarks,b=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=_[l])return!1;const y=h.charCodeAt(v);if(y>=48&&y<=57){if(f=V_(e,l),f<0||(u=!0,r=v,d=$B(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=j_(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=_[l])return!1;if(s)return!0;const C=h.charCodeAt(f-1),L=String.fromCharCode(C);if(u){const A=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(A.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const I=[l,0];e.tokens[e.tokens.length-1].map=I,e.tokens[e.tokens.length-1].markup=L;let k=!1;const M=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,"list"),P=e.parentType;for(e.parentType="list";l<n;){i=f,o=_[l];const A=b[l]+f-(p[l]+m[l]);let $=A;for(;i<o;){const ke=h.charCodeAt(i);if(ke===9)$+=4-($+g[l])%4;else if(ke===32)$++;else break;i++}const D=i;let R;D>=o?R=1:R=$-A,R>4&&(R=1);const H=A+R,z=e.push("list_item_open","li",1);z.markup=L;const q=[l,0];z.map=q,u&&(z.info=f-r-1===1?NB[h.charCodeAt(r)-48]:h.slice(r,f-1));const Q=e.tight,X=e.tShift[l],ue=e.sCount[l],ge=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=H,e.tight=!0,e.tShift[l]=D-p[l],e.sCount[l]=$,D>=o&&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=ge,e.tShift[l]=X,e.sCount[l]=ue,e.tight=Q,e.push("list_item_close","li",-1).markup=L,l=e.line,q[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let xe=!1;for(let ke=0,ze=E.length;ke<ze;ke++)if(E[ke](e,l,n,!0)){xe=!0;break}if(xe)break;if(u){if(f=V_(e,l),f<0)break;r=p[l]+m[l]}else if(f=j_(e,l),f<0)break;if(C!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=L:e.push("bullet_list_close","ul",-1).markup=L,I[1]=l,e.line=l,e.parentType=P,a&&LB(e,M),!0}function K_(e){return e===9||e===32}function OB(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=iT(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(o==="list"&&c[f]>=u){const v=r[f]+l[f],y=a[f];if(v<y){const C=i.charCodeAt(v);if(C===42||C===45||C===43){if(v+1>=y||K_(i.charCodeAt(v+1)))break}else if(C>=48&&C<=57&&v+1<y){let L=v+1;for(;;){if(L>=y){L=-1;break}const I=i.charCodeAt(L++);if(I>=48&&I<=57){if(L-v>=10){L=-1;break}continue}if((I===41||I===46)&&(L>=y||K_(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const _=r[f]+l[f],b=a[f];if(d&&!rT(e,f,i,_,b))continue;let g=!1;for(let v=0,y=s.length;v<y;v++)if(s[v](e,f,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function Xd(e){switch(e){case 9:case 32:return!0}return!1}function RB(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(v){const y=e.lineMax;if(v>=y||e.isEmpty(v))return null;let C=!1;if(e.sCount[v]-e.blkIndent>3&&(C=!0),e.sCount[v]<0&&(C=!0),!C){const k=e.parentType;e.parentType="reference";let M=!1;for(let E=0,P=l.length;E<P;E++)if(l[E](e,v,y,!0)){M=!0;break}if(e.parentType=k,M)return null}const L=e.bMarks[v]+e.tShift[v],I=e.eMarks[v];return e.src.slice(L,I+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const v=c.charCodeAt(o);if(v===91)return!1;if(v===93){u=o;break}else if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(v===92&&(o++,o<i&&c.charCodeAt(o)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!Xd(v))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;o=d.pos;const h=o,p=r,m=o;for(;o<i;o++){const v=c.charCodeAt(o);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!Xd(v))break}let _=e.md.helpers.parseLinkTitle(c,o,i);for(;_.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,_=e.md.helpers.parseLinkTitle(c,o,i,_)}let b;for(o<i&&m!==o&&_.ok?(b=_.str,o=_.pos):(b="",o=h,r=p);o<i&&Xd(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&b)for(b="",o=h,r=p;o<i&&Xd(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=fh(c.slice(1,u));return g?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:b,href:f}),e.line=r),!0):!1}function ng(e){switch(e){case 9:case 32:return!0}return!1}const DB=65536;function sg(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function BB(e,t){if(e.lineFlags)return(e.lineFlags[t]&ru.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function G_(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function FB(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!ng(l)||r===45&&ng(l)||!BB(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!ng(y))return!1;i++}let a=sg(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const C=c[y].trim();if(!C){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?u.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=sg(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=G_(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(s)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const _=e.push("thead_open","thead",1);_.map=[t,t+1];const b=e.push("tr_open","tr",1);b.map=[t,t+1];for(let y=0;y<c.length;y++){const C=e.push("th_open","th",1);u[y]&&(C.attrs=[["style",`text-align:${u[y]}`]]);const L=e.push("inline","",0);L.content=c[y].trim(),L.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let y=!1;for(let L=0,I=h.length;L<I;L++)if(h[L](e,o,n,!0)){y=!0;break}if(y||(a=sg(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=G_(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>DB))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=g=[t+2,0]}const C=e.push("tr_open","tr",1);C.map=[o,o+1];for(let L=0;L<d;L++){const I=e.push("td_open","td",1);u[L]&&(I.attrs=[["style",`text-align:${u[L]}`]]);const k=e.push("inline","",0);k.content=c[L]?c[L].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]=o),e.push("table_close","table",-1),m[1]=o,e.parentType=f,e.line=o,!0}var WB=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Ka(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};const Qd=[["table",FB,["paragraph","reference"]],["code",wB],["fence",SB,["paragraph","reference","blockquote","list"]],["blockquote",_B,["paragraph","reference","blockquote","list"]],["hr",AB,["paragraph","reference","blockquote","list"]],["list",PB,["paragraph","reference","blockquote"]],["reference",RB],["html_block",TB,["paragraph","reference","blockquote"]],["heading",CB,["paragraph","reference","blockquote"]],["lheading",IB],["paragraph",OB]];var HB=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new WB;for(let e=0;e<Qd.length;e++)this.ruler.push(Qd[e][0],Qd[e][1],{alt:(Qd[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let m=0;m<o;m++)if(p=s[m](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let m=0;m<o;m++){const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Ka(e.env,"block",f[m].name,b-_,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,s){if(!e||e.length===0)return;const o=new oT(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},aT=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}};aT.prototype.Token=os;const Y_=[["normalize",iB],["block",nD],["inline",XD],["linkify",nB],["replacements",fB],["smartquotes",gB],["text_join",vB]],zB={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},UB={parseLinkLabel:C0,parseLinkDestination:S0,parseLinkTitle:x0};function qB(){return{...zB}}function jB(){return{...UB}}var VB=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new HB,this.inline=new YD,this.ruler=new pB;for(let e=0;e<Y_.length;e++){const[t,n]=Y_[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:qB(),helpers:jB(),normalizeLink:nT,normalizeLinkText:sT,validateLink:tT,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new DA),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 aT(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ka(e.env,"core",t[n].name,o-s,!0,!1)}KD(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&tD(e))return this.parse(HA(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const KB=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function hp(e){return!KB.test(e)}function Yc(e,t){const n=e.indexOf(`
|
|
63
|
-
`,t);return n===-1?e.length:n}function wf(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9)return!1}return!0}function X_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function og(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function GB(e){if(e.length>3)return hp(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 YB=["","h1","h2","h3","h4","h5","h6"],XB=["","#","##","###","####","#####","######"],Q_=0,ig=1,rg=2;function Co(e,t,n,s){const o=new os(e,t,n);return o.level=s,o.block=!0,o}function cT(e,t,n){const s=Co("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new os("text","",0);return o.content=e,s.children=[o],s}function QB(e,t,n,s,o){let i=0,r=n;for(;r<s&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=s||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<s&&t.charCodeAt(l)===32;)l++;let a=s;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(!hp(u))return!1;const d=YB[i],f=XB[i],h=Co("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(cT(u,o,1));const p=Co("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function ZB(e,t,n){const s=Co("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(cT(t,n,1)),e.push(Co("paragraph_close","p",-1,0))}function JB(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function lg(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function eF(e,t){const n=Co("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function tF(e,t,n){const s=Co("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=Co("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=Co("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new os("text","",0);r.content=t,i.children=[r],e.push(i);const l=Co("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Co("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function nF(e){const t=Co("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function sF(e,t,n,s){if(!X_(e,t,n))return null;const o=e.slice(t+3,n);if(o.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=s+1;for(;l<e.length;){const c=Yc(e,l);if(X_(e,l,c)&&wf(e,l+3,c)){const u=Co("fence","code",0,0);return u.map=[s,a+1],u.markup="```",u.info=o,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 oF(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?Q_:rg,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Yc(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(!wf(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!QB(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=lg(e,h),l+=1+r-h;continue}if(c===45){if(!og(e,r,a))return null;const h=l;let p=r,m=l,_=null,b=null;for(;p<e.length;){const y=Yc(e,p);if(!og(e,p,y))break;const C=p+2,L=y===C+1?e[C]:e.slice(C,y);if(!GB(L))return null;_===null&&(_=eF(t,h)),b=tF(t,L,m),p=y<e.length?y+1:y,m++}if(_===null||b===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=Yc(e,g);if(!wf(e,g,y)){if(og(e,g,y))return null;break}g=y<e.length?y+1:y,v++}_.map[1]=v,b.map[1]=v,nF(t),r=g,l=v;continue}if(c===96){const h=sF(e,r,a,l);if(!h)return null;t.push(h.token),r=lg(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=JB(e,r,a);let d;if(n===rg?d=hp(u):n===ig&&u===s?d=o:(d=hp(u),n===Q_?(i&&(n=u===s?ig:rg),s=u,o=d,i=!0):n===ig&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!wf(e,f,Yc(e,f)))return null;ZB(t,u,l),r=lg(e,f),l+=1+r-f}return t}const iF=/[&<>"]/,Z_=/[&<>"]/g,rF=/&/g,lF=/[<>"]/g,aF={"&":"&","<":"<",">":">",'"':"""};function ag(e){return aF[e]||e}function An(e){if(e.length===0)return"";if(e.length<32)return iF.test(e)?e.replace(Z_,ag):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(rF,"&"):t?e.replace(Z_,ag):e.replace(lF,ag)}const cF=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),uF=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function uT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(cF,(t,n,s)=>{if(n)return n;if(uF.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return ph(i)?Du(i):"�"}const o=h0(t);return o!==t?o:t})}const dF=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,fF=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,pF=/"/g;function Na(e,t){const n=e.indexOf(`
|
|
64
|
-
`,t);return n===-1?e.length:n}function mp(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9)return!1}return!0}function Zd(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function hF(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!mp(e,t,Na(e,t))}function J_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function mF(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function E0(e){return fF.test(e)?dF.test(e)?null:e.replace(pF,"""):e}function gF(e,t,n){let s=0,o=t;for(;o<n&&e.charCodeAt(o)===35&&s<6;)o++,s++;if(s===0||o>=n||e.charCodeAt(o)!==32)return null;let i=o+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=E0(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
|
|
65
|
-
`}function ew(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function vF(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 yF(e,t,n){const s=t+2;if(n===s+1)return vF(e,s);const o=E0(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
|
|
68
|
-
`}function kF(e,t,n){for(;t<n;){const o=e.charCodeAt(t);if(o!==32&&o!==9)break;t++}for(;n>t;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let s=n;for(let o=t;o<n;o++){const i=e.charCodeAt(o);if(i===96)return null;if(i===32||i===9){s=o;break}}return e.slice(t,s)}function bF(e,t,n,s){if(!J_(e,t,n))return null;const o=kF(e,t+3,n);if(o===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=Na(e,l);if(J_(e,l,a)&&mp(e,l+3,a)){const c=e.slice(i,r);let u;return o===s.lang?u=s.open:(u=o?`<pre><code class="language-${An(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${An(c)}</code></pre>
|
|
69
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function tw(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const s=e.length>=25e4,o=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=Na(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!mp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=gF(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=Zd(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=Na(e,m);if(!ew(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const _=e.slice(t,m);let b;if(_===r)b=l;else{let v=t;for(b=`<ul>
|
|
70
|
-
`;v<m;){const y=Na(e,v),C=yF(e,v,y);if(C===null)return null;b+=C,v=y<e.length?y+1:y}b+=`</ul>
|
|
71
|
-
`,r=_,l=b}let g=Zd(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=Na(e,g);if(!mp(e,g,v)){if(ew(e,g,v))return null;break}g=v<e.length?v+1:v}s?o.push(b):n+=b,t=g;continue}if(d===96){const m=bF(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=Zd(e,m.nextPos);continue}const f=mF(e,t,u);let h;if(f===a)h=c;else{const m=E0(f);if(m===null)return null;h=`<p>${m}</p>
|
|
72
|
-
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&hF(e,p))return null;s?o.push(h):n+=h,t=Zd(e,p)}return s?o.join(""):n}const _F={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function gp(e,t,n={},s){Vs(n);const o={..._F,...s||{}},i=oo(t);if(o.fallbackOnGlobalState!==!1&&i)return tg(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Va(n,i,()=>e.core.parse(t,n,e).tokens);let r=Sf(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=xF(r,o.maxChunks)),Cf(t,r))return tg(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Va(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return tg(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),Va(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&SF(f,l),CF(a,f),l+=u.lineCount}return a})}function Sf(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(s.push({start:r,end:f,lineCount:l}),r=f,o=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
73
|
-
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=AF(e,f,h);if(t.fenceAware){let g=f;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 C=y-g;C>=3&&(u?u.marker===v&&C>=u.length&&(u=null):u={marker:v,length:C})}}const _=p-f;o+=_,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=_);const b=m;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(b)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(p)}f=p}return n&&d(e.length),s}function Cf(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!wF(e,t[o].end))return!0;return!1}function wF(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function SF(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function CF(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function xF(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),s+=l}return n}function AF(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const dT=4e6,fT=8e4,TF=1e4,MF=200,EF=1e4,IF=200;function pT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function $F(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function kr(e){return e.length===0?0:Kn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function NF(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function LF(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
74
|
-
`,s);o===-1&&(o=e.length);let i=s;for(;i<o;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function PF(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 NF(e,n+1,e.length-1)?!LF(e,t):!1}function OF(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??EF:e.options.fullChunkSizeChars??TF),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??IF:e.options.fullChunkSizeLines??MF);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var sd=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=kr(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=Sf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(Cf(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,kr(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!PF(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,kr(this.pending)),null;const n=Sf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,kr(this.pending)),null;const s=Cf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:kr(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=Sf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=Cf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:kr(this.pending)}]:n;this.commitRanges(s,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:kr(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+kr(this.pending);return OF(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(nd(e)&&or(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=oo(t);n&&(_0(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&$F(r,a),this.options.retainTokens!==!1&&pT(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&w0(t),n}catch(s){throw this.markedGlobalStateReason&&(or(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){PA(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 RF(e,t,n={},s={}){Vs(n);const o=new sd(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function DF(e,t,n={},s={}){Vs(n);const o=new sd(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function BF(e,t,n,s={},o={}){Vs(s);const i=new sd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function FF(e,t,n,s={},o={}){Vs(s);const i=new sd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function hT(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??dT,o=e.options.autoUnboundedThresholdLines??fT;return t>=s||n>=o}function mT(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??dT))return"yes";const s=e.options.autoUnboundedThresholdLines??fT;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function lu(e,t,n={},s={}){Vs(n);const o=oo(t);if(nd(n)&&or(n),s.fallbackOnGlobalState!==!1&&o)return PA(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:Kn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),Va(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new sd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){pT(i,l)}});if(o&&_0(n,o),r.feed(t),r.flushForce(n),o&&(w0(n),s.fallbackOnGlobalState===!1)){const l=Ui(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const Ga=(e,t,n)=>e<t?t:e>n?n:e;function gT(e){return e.experimental?{...e,...e.experimental}:e}const nw=[{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"}],sw=[{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 vT(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function WF(e,t=Math.max(0,e/40|0),n={}){const s=gT(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<nw.length;l++){const a=nw[l];if(e<=a.max){if(a.strategy!=="adaptive")return vT(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ga(Math.ceil(t/i),150,700),maxChunks:Ga(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function ow(e,t=Math.max(0,e/40|0),n={}){const s=gT(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<sw.length;l++){const a=sw[l];if(e<=a.max){if(a.strategy!=="adaptive")return vT(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ga(Math.ceil(t/i),150,700),maxChunks:Ga(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var HF={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"]}}},zF={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},UF={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 vh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function xf(e,t){if(vh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const iw=e=>vh(e)?e:Promise.resolve(e);function au(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 An(e)}}function Gr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${au(t[0])}="${An(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${au(o[0])}="${An(o[1])}"`}return n}function yT(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function cu(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
75
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${An(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
76
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Gr(r)}>${t}</code></pre>
|
|
77
|
-
`}return`<pre><code${Gr(e.attrs)}>${t}</code></pre>
|
|
78
|
-
`}function vp(e){return!e.attrs||e.attrs.length===0?`<code>${An(e.content)}</code>`:`<code${Gr(e.attrs)}>${An(e.content)}</code>`}function jv(e){const t=An(e.content);return e.attrs?`<pre${Gr(e.attrs)}><code>${t}</code></pre>
|
|
79
|
-
`:`<pre><code>${t}</code></pre>
|
|
80
|
-
`}function qF(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="${An(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${An(n[0][1])}">`}return null}function rw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${au(t[0][0])}="${An(t[0][1])}">`:t.length===2?`<a ${au(t[0][0])}="${An(t[0][1])}" ${au(t[1][0])}="${An(t[1][1])}">`:`<a${Gr(t)}>`}function jF(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 lw(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 yp(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+Gr(n);return s===0&&t&&(i+=" /"),`${i}>`}const VF={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Jd=Object.prototype.hasOwnProperty,xn={code_inline(e,t){return vp(e[t])},code_block(e,t){return jv(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?uT(i.info).trim():"",{langName:l,langAttrs:a}=yT(r),c=n.highlight,u=An(i.content);if(!c)return cu(i,u,r,l,n);const d=c(i.content,l,a);return vh(d)?d.then(f=>cu(i,f||u,r,l,n)):cu(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],yp(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 An(e[t].content)},text_special(e,t){return An(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 s=e.info?uT(e.info).trim():"",{langName:o,langAttrs:i}=yT(s),r=t.highlight,l=An(e.content);if(!r)return cu(e,l,s,o,t);const a=r(e.content,o,i);if(vh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return cu(e,a||l,s,o,t)}function ef(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===xn.text)return l.content.length===0?"":An(l.content);break;case"text_special":if(o.text_special===xn.text_special)return l.content.length===0?"":An(l.content);break;case"softbreak":if(o.softbreak===xn.softbreak)return r;break;case"hardbreak":if(o.hardbreak===xn.hardbreak)return i;break;case"html_inline":if(o.html_inline===xn.html_inline)return l.content;break;case"code_inline":if(o.code_inline===xn.code_inline)return vp(l);break}const a=o[l.type];if(!a)return yp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:xf(c,l.type)}var KF=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...xn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,_="";for(let b=0;b<e.length;b++){const g=e[b],v=g.type,y=b>0&&e[b-1].hidden?`
|
|
86
|
-
`:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&b+3<e.length){const I=e[b+1],k=e[b+2],M=e[b+3];if(I.type==="paragraph_open"&&I.hidden&&k.type==="inline"&&M.type==="paragraph_close"&&M.hidden){_+=`${y}<li>${this.renderInlineTokens(k.children||[],s,o)}`,b+=3;continue}}if(b+2<e.length){const I=e[b+1],k=e[b+2];if(I.type==="inline"&&k.nesting===-1&&k.tag===g.tag&&!k.hidden){const M=qF(g,y);if(M!==null){_+=`${M+this.renderInlineTokens(I.children||[],s,o)}</${g.tag}>
|
|
87
|
-
`,b+=2;continue}}}if(v==="inline"){const I=g.children||[];if(I.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=s.xhtmlOut?`<br />
|
|
88
|
-
`:`<br>
|
|
89
|
-
`,p=s.breaks?h:`
|
|
90
|
-
`,m=!0);const k=I[0];switch(k.type){case"text":if(l===xn.text){_+=An(k.content);continue}break;case"text_special":if(a===xn.text_special){_+=An(k.content);continue}break;case"softbreak":if(c===xn.softbreak){_+=p;continue}break;case"hardbreak":if(u===xn.hardbreak){_+=h;continue}break;case"html_inline":if(d===xn.html_inline){_+=k.content;continue}break;case"code_inline":if(f===xn.code_inline){_+=vp(k);continue}break}}_+=this.renderInlineTokens(I,s,o);continue}const C=i[v];if(!C){const I=g.attrs;if(!g.hidden){if(!I||I.length===0)switch(v){case"hr":_+=r?`<hr />
|
|
91
|
-
`:`<hr>
|
|
92
|
-
`;continue;case"heading_open":_+=`<${g.tag}>`;continue;case"heading_close":_+=`</${g.tag}>
|
|
93
|
-
`;continue;case"paragraph_open":_+=`${y}<p>`;continue;case"paragraph_close":_+=`</p>
|
|
94
|
-
`;continue;case"list_item_open":{const k=e[b+1];_+=y+(k&&(k.type==="inline"||k.hidden||k.nesting===-1&&k.tag==="li")?"<li>":`<li>
|
|
95
|
-
`);continue}case"list_item_close":_+=`</li>
|
|
96
|
-
`;continue;case"bullet_list_open":_+=`${y}<ul>
|
|
97
|
-
`;continue;case"bullet_list_close":_+=`</ul>
|
|
98
|
-
`;continue;case"blockquote_open":_+=y+(e[b+1]&&e[b+1].nesting===-1&&e[b+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
99
|
-
`);continue;case"blockquote_close":_+=`</blockquote>
|
|
100
|
-
`;continue;case"ordered_list_open":_+=`${y}<ol>
|
|
101
|
-
`;continue;case"ordered_list_close":_+=`</ol>
|
|
102
|
-
`;continue;case"table_open":_+=`${y}<table>
|
|
103
|
-
`;continue;case"table_close":_+=`</table>
|
|
104
|
-
`;continue;case"thead_open":_+=`${y}<thead>
|
|
105
|
-
`;continue;case"thead_close":_+=`</thead>
|
|
106
|
-
`;continue;case"tbody_open":_+=`${y}<tbody>
|
|
107
|
-
`;continue;case"tbody_close":_+=`</tbody>
|
|
108
|
-
`;continue;case"tr_open":_+=`${y}<tr>
|
|
109
|
-
`;continue;case"tr_close":_+=`</tr>
|
|
110
|
-
`;continue;case"td_open":_+=`${y}<td>`;continue;case"td_close":_+=`</td>
|
|
111
|
-
`;continue;case"th_open":_+=`${y}<th>`;continue;case"th_close":_+=`</th>
|
|
112
|
-
`;continue}else if(I.length===1){const k=I[0];if(v==="ordered_list_open"&&k[0]==="start"){_+=`${y}<ol start="${An(k[1])}">
|
|
113
|
-
`;continue}if(v==="td_open"&&k[0]==="style"){_+=`${y}<td style="${An(k[1])}">`;continue}if(v==="th_open"&&k[0]==="style"){_+=`${y}<th style="${An(k[1])}">`;continue}}}_+=this.renderToken(e,b,s);continue}if(v==="code_block"&&C===xn.code_block){_+=jv(g);continue}if(v==="fence"&&C===xn.fence){_+=aw(g,s);continue}if(v==="html_block"&&C===xn.html_block){_+=g.content;continue}const L=C(e,b,s,o,this);typeof L=="string"?_+=L:_+=xf(L,g.type)}return _}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await iw(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return Gr(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=o&&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+Gr(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const s=()=>(n||(n={...t}),n);if(Jd.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),Jd.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(Jd.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(Jd.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...VF,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===xn.code_block)return jv(t);if(i==="html_block"&&o.html_block===xn.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):yp(t,r.xhtmlOut===!0);if(i==="fence"&&a===xn.fence)return aw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:xf(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,f=s.em_open,h=s.em_close,p=s.strong_open,m=s.strong_close,_=t.xhtmlOut===!0,b=_?`<br />
|
|
116
|
-
`:`<br>
|
|
117
|
-
`,g=t.breaks?b:`
|
|
118
|
-
`;if(e.length===1)return ef(e,t,n,this,s,b,g);let v="";for(let y=0;y<e.length;y++){const C=e[y];if(C.type==="link_open"&&!u&&!d&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="link_close"&&jF(k)){const M=`${rw(C)+ef([k],t,n,this,s,b,g)}</a>`;if(r===xn.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=M+g,y+=3;continue}v+=M,y+=2;continue}}if(C.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${rw(C)}</a>`,y+=1;continue}if(C.type==="em_open"&&!f&&!h&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="em_close"&&lw(k)){v+=`<em>${ef([k],t,n,this,s,b,g)}</em>`,y+=2;continue}}if(C.type==="strong_open"&&!p&&!m&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="strong_close"&&lw(k)){v+=`<strong>${ef([k],t,n,this,s,b,g)}</strong>`,y+=2;continue}}switch(C.type){case"text":if(o===xn.text){const k=C.content.length===0?"":An(C.content);if(a===xn.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===xn.text_special){C.content.length!==0&&(v+=An(C.content));continue}break;case"softbreak":if(r===xn.softbreak){v+=g;continue}break;case"hardbreak":if(l===xn.hardbreak){v+=b;continue}break;case"html_inline":if(a===xn.html_inline){for(v+=C.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===xn.code_inline){v+=vp(C);continue}break}const L=s[C.type];if(!L){v+=C.block?this.renderToken(e,y,t):yp(C,_);continue}const I=L(e,y,t,n,this);typeof I=="string"?v+=I:v+=xf(I,C.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await iw(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
|
|
119
|
-
`;break}}return s}},GF=KF;const YF=[],cg=4096;function XF(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
|
|
120
|
-
`,n);s===-1&&(s=t);const o=s<t;let i=n,r=0;for(;i<s;){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<s){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<s&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<s){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===s&&o)return!0}break}case 62:{const a=i+1;if(a<s){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===s&&o)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<s){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===s&&o)return!0;break}case 96:case 126:{let a=i;for(;a<s&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<s;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<s&&e.charCodeAt(a)===46){const c=a+1;if(c<s){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===s&&o)return!0}}break}}if(s===t)break;n=s+1}return!1}function QF(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 ZF(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(!kT(e[n],t[n]))return!1;return!0}function kT(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,s=t.map;return!!n!=!!s||n&&s&&(n[0]!==s[0]||n[1]!==s[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||!QF(e.attrs,t.attrs)||!ZF(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function cw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var JF=class{core;cache=null;stats=cw();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=cw(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Vs(s??o?.env),!o||s&&s!==o.env){const $=s??{},D=!!n.__explicitStreamChunkFallbackSetting,R=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,H=!!n.options?.streamChunkedFallback,z=!D&&R,q=H||z,Q=n.options?.streamChunkAdaptive!==!1,X=n.options?.streamChunkTargetChunks??8,ue=n.options?.streamChunkSizeChars,ge=n.options?.streamChunkSizeLines,xe=n.options?.streamChunkMaxChunks,ke=!!n.__explicitStreamChunkConfig,ze=n.options?.autoTuneChunks!==!1,qe=n.options?.streamChunkFenceAware??!0,Ue=n.options?.streamLargeCachePolicy??"retain",Le=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,le=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let F,ne=!1;if(Ue==="skip"&&(ne=e.length>=Le,!ne&&le!==void 0&&(F=Kn(e),ne=F>=le)),ne){const U=this.parseFullDocument(e,$,n,F,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns($,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Ui($)?.unbounded}),U.tokens}else if(q){const U=(re,me,Ae)=>re<me?me:re>Ae?Ae:re;F===void 0&&(F=Kn(e));const Y=ze&&!ke?ow(e.length,F,n.options):null,fe=Y?.maxChunkChars??(Q?U(Math.ceil(e.length/X),8e3,64e3):ue??1e4),se=Y?.maxChunkLines??(Q?U(Math.ceil(F/X),150,700):ge??200),ce=Y?.maxChunks??(Q?U(Math.ceil(e.length/64e3),X,32):xe),j=e.length>0&&e.charCodeAt(e.length-1)===10,G=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Y?.strategy!=="plain";if((H||G)&&(e.length>=fe*2||F>=se*2)&&j){const re=gp(n,e,$,{maxChunkChars:fe,maxChunkLines:se,fenceAware:Y?.fenceAware??qe,maxChunks:ce});return this.cache={src:e,tokens:re,env:$,lineCount:F,lastSegment:void 0,globalStateReason:oo(e)},this.updateCacheLineCount(this.cache,F),this.recordChunkedParseResult($,H?"explicit-initial-large-doc":"default-initial-large-doc"),re}}const te=this.parseFullDocument(e,$,n,F);return F=te.lineCount,this.cache={src:e,tokens:te.tokens,env:$,lineCount:F,lastSegment:void 0,globalStateReason:oo(e)},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns($,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Ui($)?.unbounded}),te.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ns(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const i=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=oo(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):oo(e),a=r||l;if(a){const $=s??o.env;or($);const D=oo(e),R=this.parseFullDocument(e,$,n),H=R.tokens,z=R.lineCount;return this.cache={src:e,tokens:H,env:$,lineCount:z,lastSegment:void 0,globalStateReason:D},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns($,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Ui($)?.unbounded}),H}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<c&&e.length<c*1.5&&!e.startsWith(o.src)){const $=s??o.env,D=this.parseFullDocument(e,$,n),R=D.tokens,H=D.lineCount;return this.cache={src:e,tokens:R,env:$,lineCount:H,lastSegment:void 0,globalStateReason:oo(e)},this.updateCacheLineCount(this.cache,H),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns($,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!Ui($)?.unbounded}),R}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const $=o.lineCount??Kn(o.src);let D=3;u.length>5e3?D=8:u.length>1e3?D=6:u.length>200&&(D=4),D=Math.min(D,$);let R=null;const H=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,q=n.options?.streamContextParseMinLines??2;let Q;const X=()=>(Q===void 0&&(Q=Kn(u)),Q),ue=this.canDirectlyParseAppend(o),ge=ue&&this.shouldUseUnboundedAppend(e,o,u);let xe=!1;if(!ue)switch(H){case"lines":xe=X()>=q;break;case"constructs":if(u.length>=z){xe=!0;break}if(XF(u)){xe=!0;break}xe=X()>=q;break;case"chars":default:xe=u.length>=z}if(D>0&&xe){const qe=this.getTailLines(o.src,D)+u;try{const Ue=this.core.parse(qe,o.env,n).tokens,Le=Ue.findIndex(le=>le.map&&typeof le.map[1]=="number"&&le.map[1]>D);if(Le!==-1){const le=Ue.slice(Le),F=$-D;F!==0&&this.shiftTokenLines(le,F),R={tokens:le}}}catch{R=null}}else R=null;if(!R){const qe=$;if(ge)R={tokens:lu(n,u,o.env,{mode:"stream"})},qe>0&&this.shiftTokenLines(R.tokens,qe);else{const Ue=this.core.parse(u,o.env,n);qe>0&&this.shiftTokenLines(Ue.tokens,qe),R=Ue}}let ke=0;if(o.tokens.length>0&&R.tokens.length>0){const qe=o.tokens[o.tokens.length-1],Ue=R.tokens[0];try{qe.type==="inline"&&Ue.type==="inline"&&(Ue.children&&Ue.children.length>0&&(qe.children||(qe.children=[]),this.appendTokens(qe.children,Ue.children)),qe.content=(qe.content||"")+(Ue.content||""),ke=1)}catch{ke=0}}const ze=o.tokens.length;if(R.tokens.length>ke){const qe=o.tokens,Ue=R.tokens,Le=Math.min(qe.length,Ue.length-ke);let le=0;for(let F=Le;F>0;F--){let ne=!0;for(let te=0;te<F;te++){const U=qe[qe.length-F+te],Y=Ue[ke+te];if(!kT(U,Y)){ne=!1;break}}if(ne){le=F;break}}le>0&&(ke+=le),Ue.length>ke&&this.appendTokens(o.tokens,Ue,ke)}if(o.src=e,o.globalStateReason=null,o.lineCount=$+(Q??X()),o.tokens.length>ze){const qe=this.getLastSegment(o.tokens,e,ze,o.tokens.length,e.length-u.length,$);qe?o.lastSegment=qe:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ge&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ns(o.env,{area:"stream",path:ge?"stream-unbounded-append":"stream-append",reason:ge?"large-delta":"safe-append",unbounded:ge}),o.tokens}const d=s??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ns(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,_=!h&&!u&&p,b=m||_,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,C=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,k=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let E=u&&o.lineCount!==void 0?o.lineCount+Kn(u):void 0;if(b){E===void 0&&(E=Kn(e));const $=(X,ue,ge)=>X<ue?ue:X>ge?ge:X,D=k&&!I?ow(e.length,E,n.options):null,R=D?.maxChunkChars??(g?$(Math.ceil(e.length/v),8e3,64e3):y??1e4),H=D?.maxChunkLines??(g?$(Math.ceil(E/v),150,700):C??200),z=D?.maxChunks??(g?$(Math.ceil(e.length/64e3),v,32):L),q=e.length>0&&e.charCodeAt(e.length-1)===10,Q=_&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&D?.strategy!=="plain";if((m||Q)&&(e.length>=R*2||E>=H*2)&&q){const X=gp(n,e,d,{maxChunkChars:R,maxChunkLines:H,fenceAware:D?.fenceAware??M,maxChunks:z});return this.cache={src:e,tokens:X,env:d,lineCount:E,lastSegment:void 0,globalStateReason:oo(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),X}}const P=this.parseFullDocument(e,d,n,E),A=P.tokens;return E=P.lineCount,this.cache={src:e,tokens:A,env:d,lineCount:E,lastSegment:void 0,globalStateReason:oo(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ns(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Ui(d)?.unbounded}),A}recordChunkedParseResult(e,t){const n=Ui(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",ns(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!Ui(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ns(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=oo(e);nd(t)&&or(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?mT(n,e.length,s):"no";if(r==="yes"){const a=lu(n,e,t);return ns(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?Kn(e):0)}}let l=s;if(r==="need-lines"&&(l=Kn(e),hT(n,e.length,l))){const a=lu(n,e,t);return ns(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Kn(e):0),{tokens:Va(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:Kn(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 s=n??t.slice(e.length);if(!s)return null;const o=s.length;if(s.charCodeAt(o-1)!==10)return null;let i=0,r=-1;for(let a=0;a<o&&!(s.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?s:s.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(s)?null:s}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=o.lineStart+Kn(l),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
|
|
123
|
-
`,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??YF}getStats(){return{...this.stats}}appendTokens(e,t,n=0,s=t.length){for(let o=n;o<s;o++)e.push(t[o])}updateCacheLineCount(e,t){e.lineCount=t??Kn(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(-cg))+t,s=oo(n);return e.globalStateCarry=n.length>cg?n.slice(n.length-cg):n,s&&(e.globalStateReason=s),s}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,s=e.length,o,i){if(s<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=s-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:s,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,i)}}}return null}getLineStartOffset(e,t,n,s){if(n!==void 0&&s!==void 0&&t>=s)return this.getLineStartOffsetFrom(e,n,t-s);if(t<=0)return 0;let o=t,i=-1;for(;o>0;){if(i=e.indexOf(`
|
|
124
|
-
`,i+1),i===-1)return e.length;o--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let s=n,o=t-1;for(;s>0;){if(o=e.indexOf(`
|
|
125
|
-
`,o+1),o===-1)return e.length;s--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??Kn(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+Kn(i);t.lineCount=m;const _=this.getDocLineCount(e,m);return r.map&&(r.map[1]=_),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const m=o.lineEnd-2;m!==0&&this.shiftTokenLines(p,m);const _=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,b=t.lineCount??Kn(t.src);t.tokens.splice(_,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=b+Kn(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:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.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,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e,t=Kn(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 s=0;s<e.length;s++){const o=e[s];if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children){n??=[];for(let i=o.children.length-1;i>=0;i--)n.push(o.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 uw={default:zF,zero:UF,commonmark:HF};function e7(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function t7(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 dw(e){return e.experimental?{...e,...e.experimental}:e}function Ho(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 fw(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(Ho(t,o)||Ho(e,o))return!0}return!1}function pw(e,t,n){return Ho(t,n)||Ho(e,n)}function hw(e,t){const n=Ui(e)?.chunk;if(n?.fallback){ns(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}ns(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function n7(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},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=uw[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=dw(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=fw(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=fw(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=pw(i?.options,o,"fullChunkedFallback"),c=pw(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new VB;let p=null;const m=()=>(p||(p=new GF(n)),p);let _=null;const b=()=>(_||(_=new JF(h)),_);let g=null;const v=()=>(g||(g=new DA),g),y=k=>!u&&!!d&&!t7(k,d),C=(k,M)=>s==="default"&&!u&&p===null&&f!==null&&k.parse===f&&y(k)&&!k.stream.enabled&&M<(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,L=(k,M)=>s==="default"&&!u&&y(k)&&!k.stream.enabled&&!k.options.fullChunkedFallback&&M<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.linkify===!1&&k.options.typographer===!1,I={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 M=dw(k);return this.options={...this.options,...M},(Ho(k,"fullChunkSizeChars")||Ho(k,"fullChunkSizeLines")||Ho(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Ho(k,"streamChunkSizeChars")||Ho(k,"streamChunkSizeLines")||Ho(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Ho(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Ho(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,_&&(_.reset(),_.resetStats())),this},configure(k){const M=typeof k=="string"?uw[k]:k;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const E=M.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(k,M){const E=Array.isArray(k)?k:[k],P=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],A=new Set;for(const $ of P){if(!$)continue;const D=$.enable(E,!0);for(let R=0;R<D.length;R++)A.add(D[R])}if(!M){const $=E.filter(D=>!A.has(D));if($.length)throw new Error(`Rules manager: invalid rule name ${$.join(", ")}`)}return this},disable(k,M){const E=Array.isArray(k)?k:[k],P=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],A=new Set;for(const $ of P){if(!$)continue;const D=$.disable(E,!0);for(let R=0;R<D.length;R++)A.add(D[R])}if(!M){const $=E.filter(D=>!A.has(D));if($.length)throw new Error(`Rules manager: invalid rule name ${$.join(", ")}`)}return this},use(k,...M){const E=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const P=[this,...M],A=k;return u=!0,E.apply(A,P),this},render(k,M){if(C(this,k.length)){M!==void 0&&Vs(M);const A=tw(k);if(A!==null)return M!==void 0&&ns(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),A}const E=M??{},P=this.parse(k,E);return m().render(P,this.options,E)},async renderAsync(k,M){if(C(this,k.length)){M!==void 0&&Vs(M);const A=tw(k);if(A!==null)return M!==void 0&&ns(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),A}const E=M??{},P=this.parse(k,E);return m().renderAsync(P,this.options,E)},renderIterable(k,M={}){const E=this.parseIterable(k,M);return m().render(E,this.options,M)},async renderAsyncIterable(k,M={}){const E=await this.parseAsyncIterable(k,M);return m().renderAsync(E,this.options,M)},renderInline(k,M={}){const E=this.parseInline(k,M);return m().render(E,this.options,M)},validateLink:tT,normalizeLink:nT,normalizeLinkText:sT,utils:fR,helpers:{...eD},parse(k,M){if(typeof k!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&Vs(M),L(this,k.length)){const $=oF(k);if($!==null)return M!==void 0&&ns(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),$}const E=M??{};let P;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const $=mT(this,k.length);if($==="yes"){const D=lu(this,k,E);return ns(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),D}$==="need-lines"&&(P=Kn(k))}if(!this.stream.enabled){const $=k.length,D=this.options.autoTuneChunks!==!1,R=r,H=!a&&y(this),z=!!this.options.fullChunkedFallback,q=H&&$>=2e5;let Q;(z||q||P!==void 0)&&(Q=P??Kn(k));const X=(z||q)&&D&&!R?WF($,Q,this.options):null;if(z||q){const ue=Q??0;if(z?$>=(this.options.fullChunkThresholdChars??2e4)||ue>=(this.options.fullChunkThresholdLines??400):q){if(X&&X.strategy!=="plain"){const ge=gp(this,k,E,{maxChunkChars:X.maxChunkChars,maxChunkLines:X.maxChunkLines,fenceAware:X.fenceAware,maxChunks:X.maxChunks});return M&&hw(M,z?"explicit-full-chunk":"default-large-string"),ge}if(z){const ge=(ne,te,U)=>ne<te?te:ne>U?U:ne,xe=this.options.fullChunkAdaptive!==!1,ke=this.options.fullChunkTargetChunks??8,ze=ge(Math.ceil($/ke),8e3,64e3),qe=ge(Math.ceil(ue/ke),150,700),Ue=xe?ze:this.options.fullChunkSizeChars??1e4,Le=xe?qe:this.options.fullChunkSizeLines??200,le=xe?ge(Math.ceil($/64e3),ke,32):this.options.fullChunkMaxChunks,F=gp(this,k,E,{maxChunkChars:Ue,maxChunkLines:Le,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:le});return M&&hw(M,"explicit-full-chunk"),F}}}if(P!==void 0&&y(this)&&hT(this,$,Q??P)){const ue=lu(this,k,E);return ns(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),ue}}const A=oo(k);return ns(M,{area:"parse",path:"plain",reason:"default-plain"}),Va(E,A,()=>h.parse(k,E,this).tokens)},parseIterable(k,M={}){return Vs(M),RF(this,k,M)},parseAsyncIterable(k,M={}){return Vs(M),DF(this,k,M)},parseIterableToSink(k,M,E={}){return Vs(E),BF(this,k,M,E)},parseAsyncIterableToSink(k,M,E={}){return Vs(E),FF(this,k,M,E)},parseInline(k,M={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Vs(M),nd(M)&&or(M);const E=h.createState(k,M,this);return E.inlineMode=!0,h.process(E),E.tokens}};if(I.stream={enabled:!!n.stream,parse(k,M){return I.stream.enabled?b().parse(k,M,I):I.parse(k,M??{})},reset(){b().reset()},peek(){return _?_.peek():[]},stats(){return _?_.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){_&&_.resetStats()}},i?.components){const k=i.components;k.core?.rules&&I.core.ruler.enableOnly(k.core.rules),k.block?.rules&&I.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&I.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&I.inline.ruler2.enableOnly(k.inline2.rules)}return d=e7(I),f=I.parse,I}var s7=n7;const bT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],o7=["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"],_T=["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"],i7=["svg","g","path"],r7=["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"],l7=["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"],a7=["action","data","href","src","srcset","poster","xlink:href","formaction"],c7=["script"],u7=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Ql=new Set(bT),d7=new Set(_T),Fu=new Set([...bT,...o7,..._T,...i7]),wT=new Set([...Fu,...r7]),f7=new Set(l7),p7=new Set(a7),od=new Set(c7),ST=new Set(u7);function CT(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const h7={amp:"&",bsol:"\\",colon:":",newline:`
|
|
128
|
-
`,sol:"/",tab:" "};function xT(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return h7[String(o??"").toLowerCase()]??t})}const tf=new Set(["http","https","mailto","tel"]),m7=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),wl=new Set(["http","https"]);function AT(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function g7(e,t,n){if(!uu(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function uu(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function v7(e,t){return t==="href"||t==="xlink:href"?uu(e,t)?tf:wl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?wl:(uu(e,t),tf)}function Wl(e,t={}){const n=CT(xT(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=AT(n);return i?i==="file"?!g7(n,s,o):uu(s,o)?m7.has(i):!v7(s,o).has(i):!1}function y7(e){const t=xT(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=AT(CT(t).toLowerCase());return n==="http"||n==="https"}function k7(e,t={}){const n=String(e??"").trim();return n?Wl(n,t)?"":n:""}function mw(e){return k7(e,{tagName:"img",attrName:"src"})}function b7(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,m,_){return f[h].nesting===1&&f[h].attrJoin("class",t),_.renderToken(f,h,p,m,_)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(f,h,p,m){let _,b=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);const y=Math.floor((_-g)/a);if(y<i)return!1;_-=(_-g)%a;const C=f.src.slice(g,_),L=f.src.slice(_,v);if(!c(L,C))return!1;if(m)return!0;let I=h;for(;I++,!(I>=p||(g=f.bMarks[I]+f.tShift[I],v=f.eMarks[I],g<v&&f.sCount[I]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[I]-f.blkIndent>=4)){for(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);if(!(Math.floor((_-g)/a)<y)&&(_-=(_-g)%a,_=f.skipSpaces(_),!(_<v))){b=!0;break}}const k=f.parentType,M=f.lineMax;f.parentType="container",f.lineMax=I;const E=f.push("container_"+t+"_open","div",1);E.markup=C,E.block=!0,E.info=L,E.map=[h,I],f.md.block.tokenize(f,h+1,I);const P=f.push("container_"+t+"_close","div",-1);return P.markup=f.src.slice(g,_),P.block=!0,f.parentType=k,f.lineMax=M,f.line=I+(b?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 _7(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let _=0;_<a.length;_++){const b=a[_];if(b==="\\"){_++;continue}if(!u&&b==="'"){c=!c;continue}if(!c&&b==='"'){u=!u;continue}if(!c&&!u&&b===":"){d=_;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;l[p]=m}return l}function w7(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(b7,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
129
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),m=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,m?.startsWith("{")){let C=0,L=-1;for(let I=0;I<m.length;I++)if(m[I]==="{"?C++:m[I]==="}"&&C--,C===0){L=I+1;break}L>0&&(h=m.slice(0,L))}h||(f=d||void 0)}if(o)return!0;const _=!!i.env.__markstreamFinal;let b=n+1,g=!1;for(;b<=s;){const C=i.bMarks[b]+i.tShift[b],L=i.eMarks[b];if(i.src.slice(C,L).trim()===":::"){g=!0;break}b++}g||(b=s);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!g&&!_},f&&v.attrSet("data-args",f),h)try{const C=JSON.parse(h);for(const[L,I]of Object.entries(C)){const k=I!=null&&typeof I=="object";v.attrSet(`data-${L}`,k?JSON.stringify(I):String(I))}}catch{const C=_7(h);if(C)for(const[L,I]of Object.entries(C)){const k=I!=null&&typeof I=="object";v.attrSet(`data-${L}`,k?JSON.stringify(I):String(I))}else v.attrSet("data-attrs",h)}const y=[];for(let C=n+1;C<b;C++){const L=i.bMarks[C]+i.tShift[C],I=i.eMarks[C];y.push(i.src.slice(L,I))}if(y.some(C=>C.trim().length>0)){let C=y.join(`
|
|
130
|
-
`);C.endsWith(`
|
|
131
|
-
`)||(C+=`
|
|
132
|
-
`),C.endsWith(`
|
|
133
|
-
|
|
134
|
-
`)||(C+=`
|
|
135
|
-
`);const L=i.tokens[i.tokens.length-1];L&&(L.raw=C);const I=[];i.md.block.parse(C,i.md,i.env,I),i.tokens.push(...I)}return g&&i.push("vmr_container_close","div",-1),i.line=g?b+1:b,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ao(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Un(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function yh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const S7=/^[a-z][a-z0-9_-]*$/;function gw(e){return S7.test(String(e??"").trim().toLowerCase())}function ei(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return gw(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":gw(o)?o:""}function pc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=ei(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function C7(...e){const t=new Set,n=[];for(const s of e)for(const o of pc(s))t.has(o)||(t.add(o),n.push(o));return n}function x7(e){const t=pc(e);return{key:t.join(","),tags:t}}function TT(e){return ei(e)}function A7(e,t){const n=String(e??""),s=ei(t);if(!s)return!1;const o=Ao(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function MT(e,t){const n=ei(t);return!!n&&!Fu.has(n)&&!A7(e,n)}function T7(e,t){const n=String(e??""),s=ei(t);if(!s)return n;const o=Ao(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const ET=Ql,M7=Fu,IT=new Set(d7);IT.delete("details");const E7=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,I7=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Vv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,$7=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function kp(e){return(e.match(Vv)?.[1]??"").toLowerCase()}function I0(e){return/^\s*<\s*\//.test(e)}function $0(e,t){return ET.has(t)||/\/\s*>\s*$/.test(e)}function N7(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=kp(i);if(r===t){if(I0(i)){if(n===0)return s;n--;continue}$0(i,r)||n++}}return-1}function L7(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=kp(o);if(i===t){if(I0(o)){n>0&&n--;continue}$0(o,i)||n++}}return n}function vw(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Ao(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function P7(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ao(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function bp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function O7(e){const t=e;return t.meta||(t.meta={}),t.meta}function ug(e,t,n){const s=O7(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function R7(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ao(h)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!s.length))for(const p of s)p.raw+=h,p.inner+=h},l=()=>{!s.length||!o||(r(`
|
|
136
|
-
`),o=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<s.length;m++)s[m].raw+=h,m<s.length-1&&(s[m].inner+=h);const p=s.pop();ug(p.token,p.raw,p.inner)},u=h=>{const p=s[s.length-1]?.tag;if(!p)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Ao(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const _=m??(h.type==="html_inline"?kp(p):"");if(!(_&&t.has(_))){r(p);return}const b=I0(p),g=!b&&$0(p,_);if(b){if(!s.length||s[s.length-1].tag!==_){r(p);return}c(p);return}if(r(p),g){ug(h,p,"");return}s.push({tag:_,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?o=!1:l(),!s.length&&!i(p)){o=!1;continue}let m=0,_=!0;for(const b of h.children){const g=bp(b),v=b.type==="html_inline"?kp(g):"",y=v&&t.has(v);let C=g;if(_&&p&&g&&(s.length||y)){const L=p.indexOf(g,m);if(L!==-1)a(p.slice(m,L)),C=p.slice(L,L+g.length),m=L+g.length;else{if(s.length&&!y)continue;_=!1}}f(b,C,v)}_&&p&&m<p.length&&s.length&&a(p.slice(m)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=bp(h),m=h.type==="html_block"?u(p):null;if(m){c(`${o?`
|
|
137
|
-
`:""}${m}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)ug(h.token,h.raw,h.inner)}function D7(e){return/^\s*<\s*[!?]/.test(e)}function B7(e){const t=new Set(M7);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function yw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function F7(e,t){let n=null;for(const i of e.matchAll(E7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();yw(l,t)&&Un(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(I7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();yw(l,t)&&Un(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function W7(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function H7(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(W7(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),h=f.match(Vv);if(!h){i("<",c),u=d+1;continue}const p=Un(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),_=(h[1]??"").toLowerCase();t.has(_)?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=F7(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=bp(a),o=s.buffer;const c=Un(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=bp(a),u=(c.match(Vv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Un(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:o??void 0}}const z7=["a","span","strong","em","b","i","u"];function U7(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=ei(f);h&&n.add(h)}const s=f=>{const h=f,p=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const v of m){const y=ei(String(v??""));y&&p.add(y)}const _=B7(Array.from(p)),b=new Set(z7);for(const v of p)b.add(v);return{autoCloseInlineTagSet:b,commonHtmlTags:_,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!_.has(v)||IT.has(v)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const m=p.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const _={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},_,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[_]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:m}=s(f);for(const _ of h){const b=_;if(b.type!=="inline"||!Array.isArray(b.children))continue;const g=String(b.content??""),v=b.children.length?b.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=H7(v,p);if(b.children=y.children,y.pendingBuffer){const C=g.lastIndexOf(y.pendingBuffer);if(C!==-1){const L=g.slice(0,C);b.content=L,typeof b.raw=="string"&&(b.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}R7(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:_}=s(f),b=[];for(let g=0;g<h.length;g++){const v=h[g];if(b.length>0){const[C,L]=b[b.length-1];if(g!==L){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const I=String(v.content??v.raw??"");if(I){const k=h[L],M=`${String(k.content||"")}
|
|
138
|
-
${I}`,E=Un(M),P=E===-1?null:vw(M,C,E+1);if(P){const A=M.slice(0,P.end),$=M.slice(P.end);k.content=A,k.loading=!1,h.splice(g,1),b.pop();const D=d(k,$)?[]:c($,u(h,g,"paragraph"));D.length&&h.splice(g,0,...D),g--;continue}k.content=M,k.loading!==!1&&(k.loading=!0)}h.splice(g,1),g--;continue}}const y=o(v);if(y){if(D7(y))continue;const C=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!C||!_(C))continue;if(i(v,y),!L)C&&!new RegExp(`^\\s*<\\s*${C}\\b[^>]*\\/\\s*>`,"i").test(y)&&P7(y,C)>0&&b.push([C,g]);else if(b.length>0&&C&&b[b.length-1][0]===C){const[,I]=b[b.length-1],k=h[I];k.content=`${String(k.content||"")}
|
|
139
|
-
${y}`,k.loading=!1,b.pop(),h.splice(g,1),g--}continue}else if(b.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const C=v.content||"",L=new RegExp(`<\\s*\\/\\s*${b[b.length-1][0]}\\s*>`,"i").test(C);if(C){const[,I]=b[b.length-1],k=h[I];k.content=`${k.content||""}
|
|
140
|
-
${C}`,k.loading!==!1&&(k.loading=!L)}L&&b.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=I=>{let k=g.get(I);return k||(k=new RegExp(`<\\s*${I}\\b`,"i"),g.set(I,k)),k},C=I=>{let k=v.get(I);return k||(k=new RegExp(`<\\s*\\/\\s*${I}\\s*>`,"i"),v.set(I,k)),k},L=[];for(let I=0;I<h.length;I++){const k=h[I],M=String(k.content??"");if(L.length>0){const P=L[L.length-1],A=h[P.index],$=k.type==="html_block"?C(P.tag).exec(M):null;if($){const H=$.index+$[0].length,z=M.slice(0,H),q=M.slice(H);A.content=`${String(A.content??"")}
|
|
141
|
-
${z}`,Array.isArray(A.children)&&A.children.push({type:"html_inline",content:`</${P.tag}>`,raw:`</${P.tag}>`}),L.pop();const Q=d(A,q)?[]:c(q,u(h,I,"paragraph"));Q.length?h.splice(I,1,...Q):(h.splice(I,1),I--);continue}if(k.type!=="inline")continue;const D=Array.isArray(k.children)?k.children:[],R=N7(D,P.tag);if(R!==-1){const H=D.slice(0,R+1),z=D.slice(R+1),q=H.map(Q=>String(Q?.content??Q?.raw??"")).join("");if(A.content=`${String(A.content??"")}
|
|
142
|
-
${q}`,Array.isArray(A.children)&&A.children.push(...H),z.length){const Q=z.map(X=>String(X.content??X.raw??"")).join("");if(Q.trim()){const X=Q.replace(/^\s+/,"");if(d(A,Q))h.splice(I,1),I--;else if(X.startsWith("<"))h.splice(I,1,{type:"html_block",content:X});else{const ue=c(Q,u(h,I,"paragraph"));h.splice(I,1,...ue)}}else h.splice(I,1),I--}else h.splice(I,1),I--;L.pop();continue}A.content=`${String(A.content??"")}
|
|
143
|
-
${M}`,Array.isArray(A.children)&&A.children.push(...D),h.splice(I,1),I--;continue}if(k.type!=="inline")continue;const E=Array.isArray(k.children)?k.children:[];for(const P of m)if((E.length?L7(E,P):y(P).test(M)&&!C(P).test(M)?1:0)>0){L.push({tag:P,index:I});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 R=String(v.content??""),H=Un(R),z=H===-1?null:vw(R,k,H+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=R.slice(0,q+Q);let ue="";H!==-1&&H<q&&(ue=R.slice(H+1,q)),v.children=[{type:k,content:ue,raw:X,attrs:[],tag:k,loading:!1}],v.content=X,v.raw=X;const ge=c(R.slice(q+Q)||"","text");ge.length&&h.splice(g+1,0,...ge)}else v.children=[{type:k,content:"",raw:R,attrs:[],tag:k,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(k))continue;v.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let E;for(;(E=M.exec(v.content||""))!==null;)E[1],E[2]||E[3]||E[4];const P=String(v.content??""),A=new RegExp(`<\\/\\s*${k}\\s*>`,"i").exec(P),$=A?A.index:-1,D=A?A[0].length:0;if($!==-1){const R=P.slice(0,$+D),H=(P.slice($+D)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:R,tag:k,loading:!1}],v.content=R,v.raw=R,H&&h.splice(g+1,0,H.startsWith("<")?{type:"html_block",content:H}:{type:"text",content:H,raw:H})}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(),M=v.children[1],E=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&E===k)continue;p.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(p.has(k))continue;v.children=[{type:"html_block",loading:!1,tag:k,content:v.children.map(M=>M.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),C=v,L=C.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(C.children.length=0);continue}const I=String(L.content??y).match($7)?.[1]?.toLowerCase()??"";if(I){if(/\/\s*>\s*$/.test(y)||ET.has(I)){C.children=[{type:"html_inline",content:y}];continue}C.children.length=0}}})}function q7(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 j7(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!q7(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),o+=2}}})}const $T=/\.([a-z0-9]{1,15})$/i,V7=/[_()[\]{}<>]/u,K7=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,G7=/[?#@]/u,Y7=/[\\/]/u,X7=/^[\p{L}\p{N}./\\-]+$/u,Q7=/^[A-Za-z0-9-]{1,63}$/u,Z7=/^xn--[a-z0-9-]{2,59}$/i,J7=/^(?:[A-Z]{1,6}|\d{1,8})$/u,e9=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,t9=/文件名\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,n9=/文件名\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,s9=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,o9=new Set(["ai","md","py","rs","sh","zip"]),NT=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),i9=new Set([...NT,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),r9=new Set(["com","dev","io","page","site"]),l9=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),a9=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 Wu(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function dg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Wu(n)?n:void 0}function kw(e,t){if(!Wu(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=id(e);return Wu(t)?t:void 0}function c9(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function _w(e,t){if(!Wu(t))return;const n=String(e??"").trim().split(/\s+/u).map(c9).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>_p(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>_p(o,{marketTicker:!0}))&&(s.marketTicker=!0),Wu(s)?s:void 0}function sl(e,t=!1){let n;return{options(s){return t||s==null?kw(e,n):kw(e,dg(bw(s),_w(s,n)))},remember(s){const o=bw(s);n=t?dg(n,o):dg(o,_w(s,n))},reset(){n=void 0}}}function ww(e){return Q7.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function u9(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return ww(n)||Z7.test(n)?t.every(ww):!1}function LT(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function d9(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function f9(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function PT(e,t,n){const s=d9(t);return LT(e)&&f9(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function id(e){const t=String(e??"");return{explicitFilename:t9.test(t),filename:n9.test(t),marketTicker:s9.test(t)}}function p9(e){return u9(e.split(/[\\/]/)[0]??"")}function h9(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function m9(e){if(V7.test(e)||!X7.test(e))return!0;if(Y7.test(e))return!p9(e);const t=e.replace($T,"");return LT(t)?!0:t.split(".").filter(Boolean).some(h9)}function g9(e,t,n){if(!(n?i9:NT).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?e9:J7).test(s)}function _p(e,t={}){if(!e||K7.test(e)||G7.test(e))return!1;const n=e.match($T);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return g9(e,s,t.marketTicker===!0)?!0:a9.has(s)?!o9.has(s)||t.filename?!0:m9(e):!!(t.explicitFilename&&r9.has(s)||t.filename&&l9.has(s))}const Sw=["!"];function no(e){return{type:"text",content:e,raw:e}}function Sl(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 Cl(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 br(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function v9(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(no(t))}}function Cw(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function y9(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function k9(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function b9(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function _9(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=w9(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function w9(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=id(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=b9(e,s,i),l=y9(o);if(o.markup==="linkify"&&r&&!PT(r,l,t)&&_p(r,n)){e.splice(s,i-s+1,no(r));continue}const a=Cw(l,Sw);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Cw(u.content,Sw);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let b=c+1;b<i;b++){const g=e[b];g?.type==="text"&&typeof g.content=="string"&&(p+=g.content)}u.content=h,u.raw=h;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let _=l;if(a!==-1)_=l.slice(0,a);else if(p){const b=encodeURI(p);if(b&&l.endsWith(b))_=l.slice(0,l.length-b.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(_=l.slice(0,v))}}_!==l&&k9(o,_),p&&e.splice(i+1,0,no(p));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(no(r));const c=i[1],u=l[1].length;Sl(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(br(c,d,!e[s+4]?.content?.startsWith(")"))),Cl(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(no(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(no(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(h+=e[s+4]?.content||"",e[s+4].content=""),Sl(a,f),a.push(br(c,h,!e[s+4]?.content?.startsWith(")"))),Cl(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(no(p)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(br(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(no(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(br(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(no(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;Sl(f,p)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let p=s+1;p<e.length;p++){const m=d?d[1].length:e[s-3].markup.length,_=e[p];if(m===1&&_.type==="em_close")break;if(m===2&&_.type==="strong_close")break;if(m===3&&(_.type==="em_close"||_.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;Cl(f,p)}e.splice(s-u,c,...f),s-=f.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(no(l)),Sl(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(br(a,c,u)),Cl(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(no(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(no(r)),Sl(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(br(l,a,c)),Cl(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(no(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(no(r)),Sl(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const f=e[s+2].attrs?.find(h=>h[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(f||c)+e[s+5].content,e[s+5].content=""):c=f||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const f=(e[s+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[s+2]?.content?.slice(0,f)||"",e[s+2].content="")}i.push(br(a,c,d)),Cl(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];Sl(a,2),a.push(br(r,l,!1)),Cl(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;v9(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function S9(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=C9(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function C9(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 x9(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=A9(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function A9(e){let t=0;const n=new Set,s=new Set;let o=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const b=e[_];h==="__"&&(m?.content?.endsWith("_")||b?.content?.startsWith("_")||b?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){o++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const b=e[_];h==="_"&&(m?.content?.endsWith("_")||b?.content?.startsWith("_")||b?.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,s.add(o))}else f==="em_close"&&(s.has(o)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),o--,o<0&&(o=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=T9(l),l}function T9(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),h=u.slice(d+2);t.push(s),t.push(o),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=M9(e,n+6);if(u){t.push(s),t.push(o),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(s)}return t}function M9(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function E9(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=O9(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function xw(){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 Aw(){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 Tw(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 OT(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(s=>s.trim().length>0)?n:null}function fg(e){return OT(e)!==null}function RT(e){return/^:?-+:?$/.test(e.trim())}function I9(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(RT)}function $9(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function N9(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(RT)&&$9(n)}function L9(e){return e==="|"||e==="|:"}function P9(e){const t=OT(e);return t!==null&&t.every(n=>!n.includes(":"))}function O9(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
145
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
146
|
-
`),d=!t&&!r.includes(`
|
|
147
|
-
`)&&/\r?\n$/.test(n)&&fg(r);if(!t&&(r.includes(`
|
|
148
|
-
`)&&u.length===0&&fg(a)&&N9(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>Tw(p)),h=[...xw(),...f,...Aw()];s.splice(o-1,3,...h)}else if(r.includes(`
|
|
149
|
-
`)&&u.length===0&&fg(a)&&I9(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>Tw(p)),h=[...xw(),...f,...Aw()];s.splice(o-1,3,...h)}else r.includes(`
|
|
150
|
-
`)&&u.length===0&&P9(a)&&L9(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function R9(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=s;let l=0,a=t;for(;a<o;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var D9=R9;const B9=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],wp=B9.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),F9=/\\[a-z]+/i,DT="(?:\\\\|\\u0008)",W9=new RegExp(String.raw`${DT}(?:${wp})\s*\{[^}]+\}`,"i"),H9=new RegExp(String.raw`(?:${DT})?(?:${wp})\s*\{`,"i"),z9=/\\(?:text|frac|left|right|times)/,U9=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,q9=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,j9=/[A-Z]+\s*\([^)]+\)/i,V9=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,K9=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,G9=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,Y9={"\b":"\\b","\v":"\\v","\f":"\\f"};function X9(e){let t="";for(const n of e)t+=Y9[n]??n;return t}function La(e){if(!e)return!1;const t=X9(e),n=t.trim();if(G9.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=F9.test(t),o=W9.test(t),i=H9.test(t),r=z9.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=U9.test(t)&&!q9.test(t),c=j9.test(t),u=V9.test(n),d=K9.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||f||h}const BT="__markstreamMathPluginApplied",Kv=80,FT=2e4,Mw=FT+4096;function WT(e){return!!e[BT]}function Q9(e){e[BT]=!0}const HT=["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"],Z9=["cdot","mathbf{","partial","mu_{"],zT=HT.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),UT="[ \r\b\f\v]",J9=new RegExp(`([^\\\\])(${Z9.map(e=>e).join("|")})+`,"g"),eW=/span\{([^}]+)\}/,tW=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,nW=/(^|[^\\])\\\r?\n/g,sW=/(^|[^\\])\\$/g,oW=new RegExp(`(${UT})|(${zT})\\b`,"g"),Ew=new Map,Iw=new Map;function iW(e){if(!e)return oW;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=Ew.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${UT})|(${o})\\b`,"g");return Ew.set(n,i),i}function rW(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=Iw.get(s);if(o)return o;const i=e?[wp,zT].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),wp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Iw.set(s,r),r}const $w={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Nw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Lw(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function _r(e,t){const n=t?.commands??HT,s=t?.escapeExclamation??!0,o=t?.commands==null,i=iW(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&$w[u]!==void 0)return`\\${$w[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=rW(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(eW,"span\\{$1\\}").replace(tW,"\\operatorname{span}\\{$1\\}"),l=l.replace(nW,`$1\\\\
|
|
151
|
-
`),l=l.replace(sW,"$1\\\\"),l=l.replace(J9,"$1\\$2"),l}function Pw(e){const t=e.trim();return!(!La(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 qT(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function Sp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function lW(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function rd(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Gv(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(rd(e,s)){n=s+1;continue}return s}return-1}function pg(e,t){let n=t;for(;n<e.length;){const s=Gv(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function Xc(e,t,n=0){let s=Math.max(0,n);for(;s<e.length;){const o=e.indexOf(t,s);if(o===-1)return-1;if(!rd(e,o))return o;s=o+Math.max(1,t.length)}return-1}function Ow(e,t,n=0,s=e.length,o=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,s));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Sp(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}rd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function N0(e,t,n){const s=zu(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!zu(s.slice(0,o)).trim()||rd(s,o))return-1;const i=qT(s);if(Sp(i,o))return-1;const r=Ow(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Ow(s,n,0,o,i))return-1;return o}function Hu(e){return e===" "||e===" "}function zu(e){let t=e.length;for(;t>0&&Hu(e[t-1]);)t--;return e.slice(0,t)}function Rw(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
152
|
-
`&&t++;return t}function Dw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function aW(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(o===t){n++;continue}if(!Hu(o))return!1}return n>=3}function cW(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let s=0;for(;t[n]==="-";)s++,n++;return s<3?!1:(t[n]===":"&&n++,n===t.length)}function uW(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(cW)}function dW(e){let t=0;if(!Dw(e[t]))return!1;for(;Dw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Hu(e[t+1])}function jT(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&&Hu(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Hu(t[1])||dW(t)||aW(t)||uW(t))}function Bw(e,t){return e?t?`${e}
|
|
153
|
-
${t}`:e:t}function Yv(e){const t=String(e??"").trim();return t?La(t):!1}function Fw(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function VT(e){if(e.length<=Mw)return{source:e,lineOffset:0};let t=e.length-Mw;const n=e.indexOf(`
|
|
154
|
-
`,t);return n===-1?{source:"",lineOffset:Rw(e)}:(t=n+1,{source:e.slice(t),lineOffset:Rw(e.slice(0,t))})}function KT(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=VT(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-Kv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=zu(s[r]);if(l&&!jT(l)){for(const[a,c]of i)if(N0(l,a,c)!==-1)return!0}}return!1}function fW(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=VT(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-Kv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=zu(o[l]);for(const[c,u]of r){const d=N0(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>Kv){h=!0;break}const m=o[p],_=Xc(m,u);if(_!==-1){const b=Bw(f,m.slice(0,_));if(!Yv(b)){h=!0;break}const g=m.slice(_+u.length),v=g.trim()?`suffix:${Fw(g)}`:"nosuffix";return["closed",c,s+l,d,s+p,_,Fw(b),v].join(":")}if(jT(m)){h=!0;break}if(f=Bw(f,m),f.length>FT){h=!0;break}}if(!h&&Yv(f))return["pending",c,s+l,d].join(":")}}return null}function hg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function pW(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function mg(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function hW(e,t){Q9(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},s=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(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 C=g.slice(v,y),L=a.push("text","",0);return L.content=C,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 C=a.push("text","",0);return C.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let m=p,_=p;const b=p;for(const[g,v]of f){const y=a.src,C=qT(y),L=lW(y,u);let I=!1;g==="$$"&&m!==b&&(m=b);let k=-1,M=-1,E=0;const P=A=>{if((A==="undefined"||A==null)&&(A=""),A==="\\"){a.pos=a.pos+A.length,m=a.pos;return}if(A==="\\)"||A==="\\("){const R=a.push("text_special","",0);R.content=A==="\\)"?")":"(",R.markup=A,a.pos=a.pos+A.length,m=a.pos;return}if(!A)return;if(g==="$$"&&A.includes("$")){let R=0;for(;R<A.length;){const H=Gv(A,R);if(H===-1){const qe=A.slice(R);if(qe){const Ue=a.push("text","",0);Ue.content=qe,a.pos=a.pos+qe.length,m=a.pos}break}if(H>0&&A[H-1]==="$"||H+1<A.length&&A[H+1]==="$"){const qe=A.slice(R,H+1);if(qe){const Ue=a.push("text","",0);Ue.content=qe,a.pos=a.pos+qe.length,m=a.pos}R=H+1;continue}const z=A.slice(R,H);if(z){const qe=a.push("text","",0);qe.content=z,a.pos=a.pos+z.length,m=a.pos}const q=pg(A,H+1);if(q===-1){const qe=A.slice(H),Ue=a.push("text","",0);Ue.content=qe,a.pos=a.pos+qe.length,m=a.pos;break}const Q=A.slice(H+1,q),X=Q.includes("`"),ue=!Q||!Q.trim(),ge=A[q+1],xe=hg(Q,ge),ke=mg(Q);if(!X&&!ue&&!xe&&!ke){const qe=a.push("math_inline","math",0);qe.content=_r(Q,t),qe.markup="$",qe.raw=`$${Q}$`,qe.loading=!1,a.pos=a.pos+(q-H+1),m=a.pos,R=q+1;continue}const ze=a.push("text","",0);ze.content="$",a.pos=a.pos+1,m=a.pos,R=H+1}return}const $=A.indexOf("![");if($!==-1){if($>0){const z=A.slice(0,$),q=a.push("text","",0);q.content=z,a.pos=a.pos+z.length,m=a.pos}const R=A.slice($).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(R){const[,z,q]=R,Q=q.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),X=Q?Q[1]:q,ue=Q&&Q[2]?Q[2]:null,ge=a.push("image","img",0);ge.attrs=[["src",X],["alt",z]],ue&&ge.attrs.push(["title",ue]),ge.content=z,ge.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+R[0].length,m=a.pos;const xe=A.slice($+R[0].length);xe&&P(xe);return}const H=a.push("text","",0);H.content=A,a.pos=a.pos+A.length,m=a.pos;return}const D=a.push("text","",0);D.content=A,a.pos=a.pos+A.length,m=a.pos};for(;!(m>=y.length);){const A=y.indexOf(g,m);if(A===-1)break;if(rd(y,A)){m=A+Math.max(1,g.length);continue}const $=Sp(C,A);if($){m=$[1];continue}const D=Sp(L,A);if(D){m=D[1];continue}if(A===k&&m===M){if(E++,E>2){m=A+Math.max(1,g.length);continue}}else E=0,k=A,M=m;if(g==="("&&A>0){let xe=A-1;for(;xe>=0&&y[xe]===" ";)xe--;if(xe>=0&&y[xe]==="]"){m=A+g.length;continue}}if(g==="$"&&A>0&&y[A-1]==="$"){m=A+1;continue}if(g==="$"&&A<y.length-1&&y[A+1]==="$"){m=A+2;continue}const R=g==="$"?pg(y,A+g.length):D9(y,A+g.length,g,v);if(R===-1){const xe=y.slice(A+g.length);if(xe.includes(g)){m=y.indexOf(g,A+g.length);continue}if(R===-1){const ke=g==="$"&&pW(xe);if(u&&!c&&!ke&&La(xe)&&!xe.includes("`")){if(m=A+g.length,I=!0,!l){a.pending="";const ze=_?y.slice(_,m):y.slice(0,m),qe=Nw(ze)%2===1;if(_)P(y.slice(_,m));else{let Ue=y.slice(0,m);Ue.endsWith(g)&&(Ue=Ue.slice(0,Ue.length-g.length)),P(Ue)}if(qe){const Ue=Lw(ze)?.marker??"**",Le=a.push("strong_open","",0);Le.markup=Ue;const le=a.push("math_inline","math",0);le.content=_r(xe,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${xe}${v}`,le.loading=!0,Le.content=xe,a.push("strong_close","",0)}else{const Ue=a.push("math_inline","math",0);Ue.content=_r(xe,t),Ue.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ue.raw=`${g}${xe}${v}`,Ue.loading=!0}a.pos=y.length}m=y.length,_=m}break}}const H=y.slice(A+g.length,R),z=H.includes("`"),q=!H||!H.trim(),Q=g==="$",X=y[R+v.length],ue=Q&&hg(H,X),ge=Q&&mg(H);if(c?z||q||ue||ge:z||q||ue||ge||!Q&&!La(H)){m=R+v.length;const xe=y.slice(a.pos,m);a.pending||(P(xe),_=m);continue}if(I=!0,!l){const xe=y.slice(a.pos-(a.pending??"").length,A);let ke=y.slice(0,m)?y.slice(_,A):xe;const ze=Nw(ke)%2===1;A!==a.pos&&ze&&(ke=a.pending+y.slice(a.pos,A));const qe=ze?Lw(ke):null,Ue=qe?.marker??"**";if(a.pending!==ke)if(a.pending="",ze)if(qe){const Le=ke.slice(qe.index+Ue.length);P(ke.slice(0,qe.index));const le=a.push("strong_open","",0);le.markup=Ue;const F=a.push("text","",0);F.content=Le,a.push("strong_close","",0)}else P(ke);else P(ke);if(ze){const Le=a.push("strong_open","",0);Le.markup=Ue;const le=a.push("math_inline","math",0);le.content=_r(H,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${H}${v}`,le.loading=!1;const F=y.slice(R+v.length).startsWith(Ue);return F&&a.push("strong_close","",0),a.pos=d(y,R+v.length),m=a.pos,_=m,F||a.push("strong_close","",0),!0}else{const Le=a.push("math_inline","math",0);Le.content=_r(H,t),Le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Le.raw=`${g}${H}${v}`,Le.loading=!1}}return m=d(y,R+v.length),_=m,a.pos=m,!0}if(I){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let A=m;for(;!(A>=y.length);){const $=Gv(y,A);if($===-1)break;if($+1<y.length&&y[$+1]==="$"){A=$+2;continue}if($>0&&y[$-1]==="$"){A=$+1;continue}const D=pg(y,$+1);if(D===-1)break;const R=y.slice($+1,D),H=R.includes("`"),z=!R||!R.trim(),q=y[D+1],Q=hg(R,q),X=mg(R);if(!H&&!z&&!Q&&!X){const ue=y.slice(m,$);ue&&P(ue);const ge=a.push("math_inline","math",0);ge.content=_r(R,t),ge.markup="$",ge.raw=`$${R}$`,ge.loading=!1,m=D+1,A=D+1}else P("$"),A=$+1}A<y.length&&P(y.slice(A))}else m<y.length&&P(y.slice(m));a.pos=y.length}return!0}}return!1},o=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let m=u.src.slice(p,u.eMarks[l]).trim(),_=!1,b="",g="",v=!1,y="",C=!1;for(const[ue,ge]of h)if(m.startsWith(ue))if(ue.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){_=!0,b=ue,g=ge;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){_=!0,b=ue,g=ge;break}continue}else{const xe=u.tokens[u.tokens.length-1];if(xe&&xe.type==="list_item_open"&&xe.mark==="-"&&m.slice(ue.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const ke=m.indexOf("]");if(m.slice(ke).trim()!=="]")continue;const ze=m.slice(ue.length,ke);if(ue==="["?Pw(ze):La(ze)){_=!0,b=ue,g=ge;break}continue}}else{_=!0,b=ue,g=ge;break}else if((ue==="$$"||ue==="\\[")&&m.endsWith(ue)&&l+1<a){const xe=N0(m,ue,ge);if(xe===-1)continue;y=zu(m.slice(0,xe)),C=!0;const ke=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(ke,u.eMarks[l+1]).trim(),v=!0,_=!0,b=ue,g=ge;break}if(!_)return!1;if(c&&!C)return!0;const L=m.indexOf(b),I=L+b.length,k=!f&&b==="["?m.indexOf("\\]",I):-1,M=k>=0?"\\]":g,E=k>=0?k:Xc(m,g,I);if(!v&&E>b.length){const ue=m.slice(L+b.length,E),ge=u.push("math_block","math",0);ge.content=_r(ue),ge.markup=b==="$$"?"$$":b==="["?"[]":"\\[\\]",ge.map=[l,l+1],ge.raw=`${b}${ue}${M}`,ge.block=!0,ge.loading=!1,u.line=l+1;const xe=m.slice(E+M.length);return xe.trim()&&n(u,xe,l),!0}let P=l,A="",$=!1,D="",R=l;const H=v?m:m===b?"":m.slice(b.length),z=!f&&b==="\\["?"]":"",q=Xc(H,g);if(q!==-1){const ue=q;A=H.slice(0,ue),D=H.slice(ue+g.length),R=v?l+1:l,$=!0,P=R}else for(H&&!v&&(A=H),P=l+1;P<a;P++){const ue=u.bMarks[P]+u.tShift[P],ge=u.eMarks[P],xe=u.src.slice(ue,ge),ke=xe.trim();if(!f&&b==="["&&ke==="\\]"){g="\\]",$=!0;break}if(z&&xe.trim()===z){g=z,$=!0;break}if(ke===g){$=!0;break}else if(!f&&b==="["&&xe.includes("\\]")){$=!0;const ze=xe.indexOf("\\]");g="\\]";const qe=xe.slice(0,ze);qe&&(A+=(A?`
|
|
157
|
-
`:"")+qe),D=xe.slice(ze+g.length),R=P;break}else if(Xc(xe,g)!==-1){$=!0;const ze=Xc(xe,g),qe=xe.slice(0,ze);qe&&(A+=(A?`
|
|
158
|
-
`:"")+qe),D=xe.slice(ze+g.length),R=P;break}A+=(A?`
|
|
159
|
-
`:"")+xe}if((!d||f)&&!$)return!1;const Q=/^\s*!\[/.test(A);if(!(C?!Q&&Yv(A):b==="$$"?!Q:b==="["?Pw(A):La(A)))return!1;if(c)return!0;y&&n(u,y,l);const X=u.push("math_block","math",0);return X.content=_r(A),X.markup=b==="$$"?"$$":b==="["?"[]":"\\[\\]",X.raw=`${b}${A}${A.startsWith(`
|
|
160
|
-
`)?`
|
|
161
|
-
`:""}${g}`,X.map=[l,P+1],X.block=!0,X.loading=!$,u.line=P+1,D.trim()&&n(u,D,R),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,c)};e.inline.ruler.before("escape","math",s),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function mW(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function gW(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new s7({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!Wl(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&hW(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&w7(i),e.enableFixIndentedCodeBlock!==!1&&j7(i),_9(i),x9(i),S9(i),E9(i),mW(i),U7(i,{customHtmlTags:e.customHtmlTags}),i}function Hl(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=>Hl(n))),t}function vW(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function yW(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function kW(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function nf(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...qn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const Ww=/\r?\n[ \t]*`+\s*$/,GT=["diff ","index ","--- ","+++ ","@@ "],bW=/\r?\n/;function _W(e){const t=String(e??"");return t?GT.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function Hw(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function wW(e,t){const n=[],s=[],o=[],i=[],r=e.split(bW),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!GT.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);o.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(p.startsWith("+")){const m=p.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{Hw(n,s,o,i);const m=a&&p.startsWith(" ")?p.slice(1):p;n.push(m),s.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&_W(p)||c(p)}(t||o.length>0||i.length>0)&&Hw(n,s,o,i);const d=n.join(`
|
|
162
|
-
`),f=s.join(`
|
|
163
|
-
`);return{original:t&&l&&d?`${d}
|
|
164
|
-
`:d,updated:t&&l&&f?`${f}
|
|
165
|
-
`:f}}function L0(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(Ww.test(a)&&(a=a.replace(Ww,"")),r){const{original:c,updated:u}=wW(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function SW(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function CW(){return{type:"hardbreak",raw:`\\
|
|
166
|
-
`}}function xW(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...qn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let gg=null;const vg=new WeakMap;function zw(){return gg||(gg={customTagSet:null,allowedTagSet:_h()}),gg}function YT(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function XT(e){return/^<\s*\//.test(e)}function QT(e,t){return/\/\s*>\s*$/.test(t)||Ql.has(e)}function AW(e){if(!e||e.length===0)return zw();const t=vg.get(e);if(t)return t;const n=e.map(ei).filter(Boolean);if(!n.length){const o=zw();return vg.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:_h({customHtmlTags:e})};return vg.set(e,s),s}function ZT(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function TW(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function Cp(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function MW(e,t,n){const s=e.slice();return Cp(s,"href")||s.push(["href",t]),n!=null&&!Cp(s,"title")&&s.push(["title",n]),s}function Xv(e){return e.map(ZT).join("")}function Af(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:Af(s.children)});continue}t.push(s)}return t}function EW(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=YT(r),a=XT(r),c=QT(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function yg(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?EW(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:Xv(s),innerTokens:o,nextIndex:i}}function IW(e,t,n,s,o,i,r){const l=String(e.content??""),a=YT(l),{customTagSet:c,allowedTagSet:u}=AW(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!yg(t,n,a).closed){const C=ZT(e);return[{type:"text",content:C,raw:C},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=XT(l),f=QT(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const C=yg(t,n,a),L=yh(l),I=C.innerTokens,k=String(Cp(L,"href")??""),M=Cp(L,"title"),E=M==null?null:String(M),P=MW(L,k,E),A=Af(I.length?s(I,o,i,r):[]),$=I.length?Xv(I):k||"";return!A.length&&$&&A.push({type:"text",content:$,raw:$}),[{type:"link",href:k,title:E,text:$,attrs:P,children:A,loading:!C.closed,raw:C.html||l},C.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=yg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Af(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=Af(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let m=h.html||l,_=!h.closed,b=!1;if(!h.closed){const C=`</${a}>`;m.toLowerCase().includes(C.toLowerCase())||(m+=C),b=!0,_=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const C=y[1],L=y[2]||y[3]||y[4]||"";g.push([C,L])}if(c?.has(a)){const C=TW(e);return[{type:a,tag:a,attrs:g,content:C?C.inner:h.innerTokens.length?Xv(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:C?.raw??m,loading:e.loading||_,autoClosed:b},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:_,autoClosed:b},h.nextIndex]}function JT(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=>JT(t)).join(""):String(e.content??"")}function $W(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>JT(t)).join("")}function Uw(e,t=!1){let n=e.attrs??[],s=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=$W(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:o,alt:l,title:c,raw:u,loading:t}}function NW(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function LW(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...qn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function PW(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function xp(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function OW(e,t,n){const s=e.slice();return xp(s,"href")||s.push(["href",t]),n!=null&&!xp(s,"title")&&s.push(["title",n]),s}function sf(e,t,n){const s=e[t],o=PW(s.attrs),i=String(xp(o,"href")??""),r=xp(o,"title"),l=r==null?null:String(r),a=OW(o,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(_=>_.type==="strong_open")){const _=String(h.content??""),b=String(h.raw??_),g=Hl(h);g.content=_.slice(0,-2),g.raw=b.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=qn(f,void 0,void 0,n),m=p.map(_=>{const b=_;return"content"in _?String(b.content??""):String(b.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:p,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function qw(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 RW(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function jw(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...qn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const DW=/\\([\\()[\]`$|*_\-!])/g;function BW(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(DW,"$1")===t))return n}function Hc(e,t,n,s){const o=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...s,__insideStrong:!0};return o.push(...qn(l,BW(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function FW(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...qn(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function WW(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...qn(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function HW(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const zW=/[^~]*~{2,}[^~]+/,UW=/\*\*/,qW=/[[_*^~]/,jW=/\\([\\()[\]`$|*_\-!])/g,P0=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),VW=/\s/u,KW=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,GW=/\p{P}/u,YW=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,XW=/:\/\//;function QW(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 eM(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&P0.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Yr(e){return!!e&&VW.test(e)}function Xr(e){return!!e&&(KW.test(e)||GW.test(e))}function ZW(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||Yr(s)?!1:!(Xr(s)&&n&&!Yr(n)&&!Xr(n))}function JW(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||Yr(n)?!1:!(Xr(n)&&s&&!Yr(s)&&!Xr(s))}function eH(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?eM(e,s):t.indexOf("*",s);if(i===-1)break;if(JW(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function tH(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||Yr(s)?!1:!(Xr(s)&&n&&!Yr(n)&&!Xr(n))}function nH(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||Yr(n)?!1:!(Xr(n)&&s&&!Yr(s)&&!Xr(s))}function sH(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(nH(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function oH(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&P0.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function iH(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&P0.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function rH(e,t,n){const s=iH(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const lH=/[\p{L}\p{N}]/u,aH=/^[\p{L}\p{N}]+$/u;function Qv(e){return e?lH.test(e):!1}function tM(e){return e?aH.test(e):!1}function du(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:Qv(s)&&Qv(o)}}function cH(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=du(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!tM(e.slice(s.end,o.start)))return o.end}return-1}function uH(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function dH(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=du(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function fH(e){return e?YW.test(e)||XW.test(e):!1}function pH(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function qn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=id(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function m(F,ne){const te=e.length===1?t:String(ne.content??""),U=[],Y=cH(F);if(Y!==-1){C(F.slice(0,Y),F.slice(0,Y));const se=F.slice(Y);return se&&(E({type:"text",content:se,raw:se}),u--),u++,!0}if(zW.test(F)){const se=F.indexOf("~~");se!==-1&&U.push({type:"strikethrough",index:se})}if(UW.test(F)){const se=F.indexOf("**");se!==-1&&U.push({type:"strong",index:se})}if(/[^*]*\*[^*]+/.test(F)){const se=te?eM(te,0):F.indexOf("*");if(te&&se===-1)return!1;se!==-1&&U.push({type:"emphasis",index:se})}U.sort((se,ce)=>se.index!==ce.index?se.index-ce.index:se.type===ce.type?0:se.type==="strong"?-1:ce.type==="strong"?1:0);const fe=U[0];if(!fe)return!1;if(fe.type==="strikethrough"){const se=fe.index,ce=se>-1?F.slice(0,se):"";if(ce&&C(ce,ce),se===-1)return u++,!0;const j=F.indexOf("~~",se+2),G=j===-1?F.slice(se+2):F.slice(se+2,j),re=j===-1?"":F.slice(j+2),{node:me}=jw([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:G,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),y(me),re&&(E({type:"text",content:re,raw:re}),u--),u++,!0}if(fe.type==="strong"){const se=fe.index,ce=se>-1?F.slice(0,se):"";if(ce&&C(ce,ce),se===-1)return u++,!0;if(t&&se===0){let Ee=!1,ae=0;for(;ae<F.length&&F[ae]==="*";)ae++;if(t.startsWith("\\*")&&(Ee=!0),Ee){let Ce=0,Xe=0;for(;Xe<t.length&&Ce<ae;)if(t[Xe]==="\\"&&Xe+1<t.length&&t[Xe+1]==="*")Ce+=1,Xe+=2;else{if(t[Xe]==="*")break;Xe++}if(Ce>=2)return C(F,F),u++,!0}}if(t&&(F.match(/\*/g)||[]).length>QW(t))return C(F.slice(ce.length),F.slice(ce.length)),u++,!0;const j=du(F,se);if(j.len>=3){const Ee=dH(F,se+j.len);if(Ee!==-1){const ae=F.slice(se+j.len,Ee);if(uH(ae)){const{node:Ce}=Hc([{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,s);p(),y(Ce);const Xe=F.slice(Ee+3);return Xe&&(E({type:"text",content:Xe,raw:Xe}),u--),u++,!0}}}if(!tH(F,se)){const Ee=F.slice(se,se+j.len);C(Ee,Ee);const ae=F.slice(se+j.len);return ae&&(E({type:"text",content:ae,raw:ae}),u--),u++,!0}const G=sH(F,se+2);let re="",me="";if(G.index!==-1){re=F.slice(se+2,G.index),me=F.slice(G.index+2);const Ee=G.index,ae=du(F,Ee);if(j.intraword&&ae.intraword&&!tM(re)||!re&&j.len>=4&&j.intraword)return C(F.slice(ce.length),F.slice(ce.length)),u++,!0}else{if(d||G.sawInvalidClose||j.intraword)return C(F.slice(ce.length),F.slice(ce.length)),u++,!0;re=F.slice(se+2),me=""}if(!re&&/^\*+$/.test(me))return C(F,F),u++,!0;const{node:Ae}=Hc([{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,s);return p(),y(Ae),me&&(E({type:"text",content:me,raw:me}),u--),u++,!0}if(fe.type==="emphasis"){let se=fe.index;se===-1&&(se=0);const ce=F.slice(0,se);if(ce&&C(ce,ce),!ZW(F,se)){C(F[se],F[se]);const Ee=F.slice(se+1);return Ee&&(E({type:"text",content:Ee,raw:Ee}),u--),u++,!0}const j=du(F,se),G=eH(te,F,se+1),re=G.index,me=e[u+1];if(s?.final&&me?.type==="em_open"&&re!==-1&&F.slice(se+1,re).trim()!==F.slice(se+1,re)||re===-1&&(G.sawInvalidClose||s?.final||j.intraword||!Qv(F[se+1])))return C(F.slice(se),F.slice(se)),u++,!0;const{node:Ae}=nf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re>-1?F.slice(se+1,re):F.slice(se+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),y(Ae),re!==-1&&re<F.length-1){const Ee=F.slice(re+1);Ee&&(E({type:"text",content:Ee,raw:Ee}),u--)}return u++,!0}return!1}function _(F,ne){if(!F.includes("`"))return!1;const U=(me=>{for(let Ae=0;Ae<me.length;Ae++){if(me[Ae]!=="`")continue;let Ee=0;for(let ae=Ae-1;ae>=0&&me[ae]==="\\";ae--)Ee++;if(Ee%2===0)return Ae}return-1})(F);if(U===-1)return!1;let Y=1;for(let me=U+1;me<F.length&&F[me]==="`";me++)Y++;const fe="`".repeat(Y),se=U+Y,ce=F.indexOf(fe,se);if(ce===-1){if(Y===1){const Ae=F.slice(0,U),Ee=F.slice(U+1);return Ae&&(m(Ae,ne)?u--:C(Ae,Ae)),g({type:"inline_code",code:Ee,raw:String(Ee)}),u++,!0}let me=F;for(let Ae=u+1;Ae<e.length;Ae++)me+=String((e[Ae].content??"")+(e[Ae].markup??""));return u=e.length-1,C(me,me),u++,!0}p();const j=F.slice(0,U),G=F.slice(U+Y,ce),re=F.slice(ce+Y);return j&&(m(j,ne)?u--:C(j,j)),g({type:"inline_code",code:G,raw:String(G??"")}),re&&(E({type:"text",content:re,raw:re}),u--),u++,!0}function b(F){const ne=l?.__markdownIt;if(!ne||e.length<=1||!e.some(fe=>fe?.type==="math_inline")||!qW.test(F))return null;const te=ne.parseInline(F,{__markstreamFinal:!!s?.final});if(!Array.isArray(te)||te.length===0)return null;const U=(te.find(fe=>fe?.type==="inline")?.children??[]).filter(fe=>!(fe?.type==="text"&&String(fe.content??"")===""));if(!U.length||!U.some(fe=>fe?.type!=="text")||U.length===1&&U[0]?.type==="text"&&String(U[0].content??"")===F)return null;const Y=qn(U,F,n,s);return Y.length?Y:null}function g(F){p(),a.push(F)}function v(F){p();const ne=Hl(F);a.push(ne)}function y(F){g(F)}function C(F,ne){c?(c.content+=F,c.raw+=ne??F):(c={type:"text",content:String(F??""),raw:String(ne??F??"")},a.push(c))}function L(F,ne){if(!F)return;const te=qn([{...ne,type:"text",content:F,raw:F}],F,n,s);if(te.length===1&&te[0]?.type==="text"){const U=te[0];C(String(U.content??""),String(U.raw??U.content??""));return}for(const U of te)y(U)}function I(F,ne){return String(F.markup??"").startsWith(ne)}function k(F){return F.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function M(F,ne){let te=F;const U=String(ne.content??"");return te.endsWith("\\")&&!I(ne,"\\\\")&&!U.endsWith("\\\\")&&(te=te.slice(0,-1)),te.endsWith("(")&&!I(ne,"\\(")&&!U.endsWith("\\(")&&(te=te.slice(0,-1)),/\*+$/.test(te)&&!I(ne,"\\*")&&!U.endsWith("\\*")&&(te=te.replace(/\*+$/,"")),te}for(;u<e.length;){const F=e[u];E(F)}function E(F){switch(F.type){case"text":A(F);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(NW(F)),u++;break;case"html_inline":{const[ne,te]=IW(F,e,u,qn,t,n,s);y(ne),u=te;break}case"link_open":$(F);break;case"image":xe(F)||(p(),y(Uw(F)),u++);break;case"strong_open":{p();const{node:ne,nextIndex:te}=Hc(e,u,F.content,s);y(ne),u=te;break}case"em_open":{p();const{node:ne,nextIndex:te}=nf(e,u,s);y(ne),u=te;break}case"s_open":{p();const{node:ne,nextIndex:te}=jw(e,u,s);y(ne),u=te;break}case"mark_open":{p();const{node:ne,nextIndex:te}=xW(e,u,s);y(ne),u=te;break}case"ins_open":{p();const{node:ne,nextIndex:te}=LW(e,u,s);y(ne),u=te;break}case"sub_open":{p();const{node:ne,nextIndex:te}=FW(e,u,s);y(ne),u=te;break}case"sup_open":{p();const{node:ne,nextIndex:te}=WW(e,u,s);y(ne),u=te;break}case"sub":p(),y({type:"subscript",children:[{type:"text",content:String(F.content??""),raw:String(F.content??"")}],raw:`~${String(F.content??"")}~`}),u++;break;case"sup":p(),y({type:"superscript",children:[{type:"text",content:String(F.content??""),raw:String(F.content??"")}],raw:`^${String(F.content??"")}^`}),u++;break;case"emoji":{p();const ne=e[u-1];ne?.type==="text"&&/\|:-+/.test(String(ne.content??""))?C("",""):y(kW(F)),u++;break}case"checkbox":p(),y(vW(F)),u++;break;case"checkbox_input":p(),y(yW(F)),u++;break;case"footnote_ref":p(),y(SW(F)),u++;break;case"footnote_anchor":{p();const ne=F.meta??{};g({type:"footnote_anchor",id:String(ne.label??F.content??""),raw:String(F.content??"")}),u++;break}case"hardbreak":p(),y(CW()),u++;break;case"fence":p(),y(L0(e[u])),u++;break;case"math_inline":p(),!F.content&&F.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(qw({...F,content:e[u+1].content})),u+=2):y(qw(F)),u++;break;case"reference":R(F);break;case"text_special":C(String(F.content??""),String(F.content??"")),u++;break;default:{const ne=F;if(F.type==="link"&&ne.href!=null&&s?.validateLink&&!s.validateLink(String(ne.href))){p();const te=String(ne.text??"");C(te,te),u++}else ke(F)||z(F)||Q(F)||H(F)||v(F),u++;break}}}function P(F,ne,te,U){const Y=HW({...ne,content:F});if(c){c.content+=M(Y.content,ne),c.raw+=Y.raw;return}const fe=te?.tag==="br"&&e[u-2]?.content==="[";U||(Y.content=M(Y.content,ne)),c=Y,c.center=fe,a.push(c)}function A(F){const ne=String(F.content??""),te=e.length===1&&ne.includes("\\")&&typeof t=="string"?String(t):"";let U=te?oH(te):ne.replace(jW,"$1");if(F.content==="<"||U==="1"&&e[u-1]?.tag==="br"){u++;return}const Y=U.indexOf("$");Y!==-1&&Y===U.lastIndexOf("$")&&U.endsWith("$")&&(U=U.slice(0,-1)),U.endsWith("undefined")&&!t?.endsWith("undefined")&&(U=U.slice(0,-9));let fe=a.length,se="";for(let re=a.length-1;re>=0;re--){const me=a[re];if(me.type!=="text")break;fe=re,se=String(me.content??"")+se}fe<a.length&&(U.startsWith(se)?(c=null,a.length=fe):c=a[a.length-1]);const ce=e[u+1];if((U==="`"||U==="|"||U==="$")&&!I(F,`\\${U}`)||/^\*+$/.test(U)&&!I(F,"\\*")){u++;return}if(!ce&&/[^\]]\s*\(\s*$/.test(U)&&(U=U.replace(/\(\s*$/,"")),!U){u++;return}if(ge(U)||ze(U))return;if(!(U.includes("*")||U.includes("_")||U.includes("~")||U.includes("`")||U.includes("[")||U.includes("!")||U.includes("$")||U.includes("|")||U.includes("("))){P(U,F,e[u-1],ce),u++;return}if(le(U))return;const j=e[u-1];if(U==="["&&!ce?.markup?.includes("*")&&!I(F,"\\[")||U==="]"&&!j?.markup?.includes("*")&&!I(F,"\\]")){u++;return}if(_(ne,F)||Le(U)||(e[u+1]?.type!=="link_open"||k(U))&&Ue(U,F))return;const G=b(ne);if(G){p();for(const re of G)y(re);u++;return}m(U,F)||(P(U,F,j,ce),u++)}function $(F){if(D(F))return;if(qe()){const{node:ce,nextIndex:j}=sf(e,u,s),G=String(ce.text||ce.href||"");C(G,G),u=j;return}p();const{node:ne,nextIndex:te}=sf(e,u,s);u=te;const U=ne.text||ne.href||"";if(F.markup==="linkify"&&!PT(U,ne.href,t)&&_p(U,l?.__linkifyDemotionContext)){C(U,U);return}const Y=ne.children.length===1&&ne.children[0]?.type==="text";if(ne.loading&&t&&ne.text===ne.href&&Y){const ce=pH(t,ne.href);ce&&(ne.text=ce,ne.children=[{type:"text",content:ce,raw:ce}],ne.raw=`[${ce}](${ne.href}${ne.title?` "${ne.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(ne.href)){C(ne.text,ne.text);return}const fe=F.attrs?.find(([ce])=>ce==="href")?.[1],se=String(fe??"");if(t&&se){const ce=t.indexOf("](");if(ce!==-1){const j=t.indexOf(")",ce+2);j===-1?ne.loading=!0:ne.loading&&t.slice(ce+2,j).includes(se)&&(ne.loading=!1)}}H(ne)||g(ne)}function D(F){if(F.markup!=="linkify")return!1;const{node:ne,nextIndex:te}=sf(e,u,s);return q(ne,te)?(u=te,!0):!1}function R(F){p(),y(RW(F)),u++}function H(F){if(F.type!=="link")return!1;const ne=a[a.length-1];if(!ne||ne.type!=="text")return!1;const te=String(ne.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!te)return!1;const U=F,Y=String(U.href??""),fe=String(U.text??""),se=String(te[2]??""),ce=Y.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Y||!(fe===Y||fe===ce||fH(fe)))return!1;const j=String(te[1]??"");return j?(ne.content=j,ne.raw=j):a.pop(),g({...F,text:se,children:[{type:"text",content:se,raw:se}],raw:`[${se}](${Y}${U.title?` "${U.title}"`:""})`}),!0}function z(F){if(F.type!=="link")return!1;const ne=F,te=String(ne.href??"");return te?q({href:te,title:ne.title==null||ne.title===""?null:String(ne.title),loading:!!ne.loading},u+1):!1}function q(F,ne){const te=a[a.length-1];if(te?.type!=="image"||te.src||!te.loading||!String(te.raw??"").endsWith("]("))return!1;const U=e[ne],Y=String(U?.content??"");if(U?.type!=="text"||!Y.startsWith(")"))return!1;a.pop(),c=null;const fe=String(te.alt??"");g({type:"image",src:F.href,alt:fe,title:F.title,raw:``,loading:!!F.loading});const se=Y.slice(1),ce=Hl(U);return ce.content=se,ce.raw=se,h()[ne]=ce,!0}function Q(F){if(F.type!=="link")return!1;const ne=a[a.length-1],te=e[u-1];if(!ne||ne.type!=="text"||te?.type!=="text")return!1;const U=String(ne.content??""),Y=String(te.content??"");if(!U.endsWith("!")||!Y.endsWith("!")||I(te,"\\!"))return!1;const fe=U.slice(0,-1);fe?(ne.content=fe,ne.raw=fe,c=ne):(a.pop(),c=null);const se=F,ce=String(se.text??se.children?.map(re=>String(re?.content??re?.raw??"")).join("")??""),j=String(se.href??""),G=se.title==null||se.title===""?null:String(se.title);return g({type:"image",src:j,alt:ce,title:G,raw:``,loading:!!se.loading}),!0}function X(F,ne="",te=null){const U=String(F.alt??F.raw??"");return{type:"link",href:ne,title:te,text:U,children:[F],raw:`[${U}](${ne}${te?` "${te}"`:""})`,loading:!0}}function ue(F){const ne=F.startsWith(";return{type:"image",src:"",alt:U===-1?te.replace(/\]$/,""):te.slice(0,U),title:null,raw:ne,loading:!0}}function ge(F){const ne=F.indexOf("[![");if(ne===-1||typeof t=="string"&&e.length===1&&rH(t,ne,"["))return!1;const te=F.slice(0,ne);return te&&C(te,te),g(X(ue(F.slice(ne+1)))),u++,!0}function xe(F){if(s?.final)return!1;const ne=e[u-1];if(ne?.type!=="text"||!String(ne.content??"").endsWith("[")||I(ne,"\\["))return!1;const te=a[a.length-1];if(te?.type==="text"&&te.content.endsWith("[")){const U=te.content.slice(0,-1);U?(te.content=U,te.raw=U,c=te):(a.pop(),c=null)}return g(X(Uw(F))),u++,!0}function ke(F){if(F.type!=="link")return!1;const ne=F,te=String(ne.raw??""),U=String(ne.text??"");if(!te.startsWith("[![")&&!U.startsWith("!["))return!1;const Y=ne.title==null||ne.title===""?null:String(ne.title);return g(X({type:"image",src:String(ne.href??""),alt:U.replace(/^!\[/,"").replace(/\]$/,""),title:Y,raw:te.startsWith("[)return!1;const ne=e[u-2];if(ne?.type==="text"&&String(ne.content??"").endsWith("[")&&I(ne,"\\["))return!1;const te=a[a.length-1];if(te?.type!=="image"&&te?.type!=="link")return!1;const U=te,Y=te?.type==="link"&&Array.isArray(U.children)&&U.children.length===1&&U.children[0]?.type==="image"?a.pop():null,fe=Y?Y.children[0]:a.pop();if(!fe||fe.type!=="image")return!1;const se=e[u+1];let ce=String(Y?.href??""),j=Y?.title==null?null:String(Y.title),G=!0;if(se?.type==="link_open"){const{node:me,nextIndex:Ae}=sf(e,u+1,s);ce=me.href,j=me.title,G=!0,u=Ae}else{if(ce=F.slice(2),ce.includes('"')){const me=ce.split('"');ce=String(me[0]??"").trim(),j=me[1]==null?null:String(me[1]).trim()}u++}const re=X(fe,ce,j);return re.loading=G,g(re),!0}function qe(){const F=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&F?.type==="text"&&String(F.content??"").endsWith("[")&&I(F,"\\[")}function Ue(F,ne){const te=F.indexOf("[");if(te===-1)return!1;let U=F.slice(0,te);const Y=F.indexOf("](",te);if(Y!==-1){const fe=e[u+2];let se=F.slice(te+1,Y);if(se.includes("[")){const Ee=se.indexOf("[");U+=F.slice(0,te+Ee+1);const ae=te+Ee+1;se=F.slice(ae+1,Y)}const ce=e[u+1];if(F.endsWith("](")&&ce?.type==="link_open"&&fe){const Ee=e[u+4];let ae=4,Ce=!0;if(Ee?.type==="text"){const tt=String(Ee.content??"");if(tt.startsWith(")")){Ce=!1;const xt=tt.slice(1);if(xt){const wt=Hl(Ee);wt.content=xt,wt.raw=xt,h()[u+4]=wt}else ae++}else tt==="."&&ae++}L(U,ne);const Xe=String(fe.content??"");return s?.validateLink&&!s.validateLink(Xe)?C(se,se):g({type:"link",href:Xe,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:Ce}),u+=ae,!0}const j=F.indexOf(")",Y),G=j!==-1?F.slice(Y+2,j):"",re=j===-1;let me=U.match(/\*+$/);if(me&&(U=U.replace(/\*+$/,"")),L(U,ne),me||(me=se.match(/^\*+/)),!d&&me){const Ee=me[0].length;se=se.replace(/^\*+/,"").replace(/\*+$/,"");const ae=[];if(Ee===1?ae.push({type:"em_open",tag:"em",nesting:1}):Ee===2?ae.push({type:"strong_open",tag:"strong",nesting:1}):Ee===3&&(ae.push({type:"strong_open",tag:"strong",nesting:1}),ae.push({type:"em_open",tag:"em",nesting:1})),ae.push({type:"link",href:G,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:re}),Ee===1){ae.push({type:"em_close",tag:"em",nesting:-1});const{node:Ce}=nf(ae,0,s);y(Ce)}else if(Ee===2){ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ce}=Hc(ae,0,void 0,s);y(Ce)}else if(Ee===3){ae.push({type:"em_close",tag:"em",nesting:-1}),ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ce}=Hc(ae,0,void 0,s);y(Ce)}else{const{node:Ce}=nf(ae,0,s);y(Ce)}}else s?.validateLink&&!s.validateLink(G)?C(se,se):g({type:"link",href:G,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:re});const Ae=j!==-1?F.slice(j+1):"";return Ae&&(E({type:"text",content:Ae,raw:Ae}),u--),u++,!0}return!1}function Le(F){const ne=F.indexOf("![");if(ne===-1)return!1;const te=F.slice(0,ne);return te&&!c?c={type:"text",content:te,raw:te}:te&&c&&(c.content+=te),c&&(a.push(c),c=null),g(ue(F.slice(ne))),u++,!0}function le(F){if(!(F?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ne=F.slice(1).match(/[^\s\]]/);if(ne===null)return u++,!0;if(ne&&/x/i.test(ne[0])){const te=ne[0]==="x"||ne[0]==="X";return g({type:"checkbox_input",checked:te,raw:te?"[x]":"[ ]"}),u++,!0}return!1}return a}function hH(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function mH(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function gH(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function hc(e,t,n){const s=e[t],o=[],i=sl(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=gH(c)?Hl(c):c,d=e[a-1];u!==c&&(mH(u),hH(u));const f=String(u.content??"");l.push({type:"paragraph",children:qn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=mc(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]=hc(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=R0(e,a,i.options(),O0);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
|
|
171
|
-
`)},r+1]}function vH(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=sl(s,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:qn(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]=hc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=mc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=kh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
|
|
172
|
-
${r.map(c=>c.raw).join(`
|
|
173
|
-
`)}
|
|
174
|
-
:::`},a+1]}const yH=new Set(["warning","info","note","tip","danger","caution"]);function kH(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return yH.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function bH(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const f=d.slice(o.length).trim();f&&(i=f)}}else{const d=kH(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=sl(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let m=f.length-1;m>=0;m--){const _=f[m];if(_.type==="text"&&/:+/.test(_.content)){h=m;break}}const p={type:"paragraph",children:qn((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=hc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=mc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=kh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
|
|
175
|
-
${l.map(d=>d.raw).join(`
|
|
176
|
-
`)}
|
|
177
|
-
:::`},c+1]}const _H=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function wH(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=_H.exec(String(s.info??""));return o?vH(e,t,o,n):null}const O0={parseContainer:(e,t,n)=>bH(e,t,n),matchAdmonition:wH};function mc(e,t,n){const s=[],o=sl(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:qn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=hc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=mc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=R0(e,i,o.options(),O0);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
|
|
178
|
-
`)},i+1]}function SH(e){if(e.info?.startsWith("diff"))return L0(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function CH(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=sl(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=qn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:qn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
179
|
-
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
180
|
-
`)},o+1]}function xH(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=sl(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:qn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
181
|
-
`)}`},l+1]}function AH(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(s.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:qn(a.children||[],c,void 0,n),raw:c}}function TH(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=Un(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=Un(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 nM(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const s=Un(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=Ql.has(n),l=yh(o),a=(s===-1?-1:TH(t,n,s+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 MH(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 EH(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function sM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function oM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return sM(n)?n:void 0}function IH(e,t,n){const s=oM(id(t),n);if(!sM(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function $H(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),m=EH(e[c].attrs),_=a.length,b=!f&&!r,g=b?o?.cells[_]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:qn(h.children||[],p,void 0,IH(n,g,b?u:void 0)),raw:p,align:m}),b&&(u=oM(u,id(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
|
|
183
|
-
`)},s+1]}function NH(){return{type:"thematic_break",raw:"---"}}let kg=null;const bg=new WeakMap;function Vw(){return kg||(kg={allowedTagSet:_h(),customTagSet:null}),kg}function LH(e){if(!e||e.length===0)return Vw();const t=bg.get(e);if(t)return t;const n=e.map(ei).filter(Boolean);if(!n.length){const o=Vw();return bg.set(e,o),o}const s={allowedTagSet:_h({customHtmlTags:e}),customTagSet:new Set(n)};return bg.set(e,s),s}function PH(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[h,p]of o)if(h==="class"){const m=p.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(p)}catch{r[m]=p}}}const l=[],a=sl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:qn(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=hc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=mc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=kh(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 f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
184
|
-
`,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
|
|
185
|
-
`),f+=`
|
|
186
|
-
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function OH(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function RH(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function DH(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Ao(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Ao(s)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=Un(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=Un(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 BH(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Un(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),end:p}}let u=1,d=c+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const _=m+1;return{raw:e.slice(r,_),end:_}}d=m+1;continue}if(f(p)){const m=Un(e.slice(p));if(m===-1)return null;u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function Zv(e){return Number.isFinite(e)&&e>0?e:0}function FH(e,t){const n=Zv(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
187
|
-
`&&(s++,s===n))return o+1;return e.length}function kh(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[AH(e,t,n),t+3];case"code_block":return[SH(s),t+1];case"fence":return[L0(s),t+1];case"math_block":return[MH(s),t+1];case"html_block":{const o=nM(s),i=o.tag?LH(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?FH(l,Number(s.map?.[0]??0)):0,u=BH(l,r,Math.max(Zv(a),Zv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=Un(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),m=f===-1?null:DH(d,r,f+1),_=m?.start??-1;let b="";f!==-1&&(_!==-1&&f<_?b=d.slice(f+1,_):b=d.slice(f+1)),_===-1&&(b=RH(b,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(h))!==null;){const L=y[1];if(!L||L.toLowerCase()===r)continue;const I=y[2]||y[3]||y[4]||"";g.push([L,I])}const C=!n?.final&&!p&&m==null;return[{type:r,tag:r,content:OH(b),raw:String(u?.raw??o.raw??d),loading:C,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=$H(e,t,n);return[o,i]}case"dl_open":{const[o,i]=CH(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=xH(e,t,n);return[o,i]}case"hr":return[NH(),t+1]}return null}function R0(e,t,n,s){const o=kh(e,t,n);if(o)return o;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return PH(e,t,n)}return null}function WH(){return{type:"hardbreak",raw:`\\
|
|
188
|
-
`}}function HH(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:qn(s.children||[],o,void 0,n),raw:o}}const Kw=new WeakMap,bh=new WeakMap,zH=["$$","\\["];function ic(){return typeof performance<"u"?performance.now():Date.now()}function D0(e,t,n){e&&(e[t]=(e[t]??0)+n)}function iM(e){return e.__timing}function _g(e,t,n){return t&&D0(t,"parseMarkdownToStructureTotalMs",ic()-n),e}function Gw(e,t,n){if(!n)return nS(e,t);const s=ic(),o=nS(e,t);return D0(n,"processTokensMs",ic()-s),o}function UH(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=pc(t);return n.length?new Set(n):null}function qH(e,t){const n=e;let s=Kw.get(n);s||(s=new Map,Kw.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function jH(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function of(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=El(o.value,n))}}function El(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(El(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(El(l,t),El(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(El(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),of(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),of(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),of(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!jH(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),of(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=El(i[r],t);return o}function rM(e,t=!0){if(!t)return Hl(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>rM(a,t)):t&&r&&typeof r=="object"&&(l=El(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function Yw(e,t=!0){return e.map(n=>rM(n,t))}function lM(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function VH(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function KH(e){bh.delete(e)}function GH(e,t,n){bh.set(e,{source:t,key:n,pendingCandidate:n===null&&KT(t)})}function YH(e){return e.endsWith("$")||e.endsWith("\\")}function XH(e){const t=Math.max(e.lastIndexOf(`
|
|
189
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return zH.some(s=>n.endsWith(s))}function QH(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||XH(e)&&/[\r\n]/.test(t)):!1}function ZH(e,t){if(!WT(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=bh.get(s);if(o?.source===t)return;if(o&&t.startsWith(o.source)){const l=t.slice(o.source.length);if(o.key===null&&o.pendingCandidate===!1&&!QH(o.source,l)&&!YH(t)){o.source=t;return}}const i=fW(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),GH(e,t,i)}function JH(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function ez(e,t){const n=e?.map,s=t?.map;return n===s?!0:!Array.isArray(n)||!Array.isArray(s)?!1:n.length===s.length&&n.every((o,i)=>o===s[i])}function wg(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&&ez(e,t)}function Xw(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(Xw(e,t)&&Xw(e,t+3)&&wg(e[t],e[t+3])&&wg(e[t+1],e[t+4])&&wg(e[t+2],e[t+5]))return!0;return!1}function nz(e,t,n){return WT(e)&&KT(t)&&tz(n)}function sz(e){const t=bh.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function Qw(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!lM(e,s)||(ZH(e,t),sz(e)))return e.parse(t,n);const o=e.stream.parse(t,qH(e,n));if(nz(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!JH(s))return o;const i=iM(s);if(!i)return Yw(o,!0);const r=ic(),l=Yw(o,!0);return D0(i,"tokenCloneMs",ic()-r),l}function _h(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Fu;const n=new Set(Fu);for(const s of pc(t))s&&n.add(s);return n}function oz(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 Zw(e){return{type:"paragraph",children:e,raw:e.map(oz).join("")}}function Jw(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=UH(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const f=s.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push(Zw(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(Zw(c)),a}function iz(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function fu(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function rz(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*${Ao(t)}\s*>\s*$`,"i").test(n)}function B0(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Ao(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Un(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Ql.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${Ao(s)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Ao(s)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const m=Un(e.slice(p));if(m===-1)return null;u--;const _=p+m+1;if(u===0)return{raw:e.slice(r,_),start:r,end:_,closed:!0};d=_;continue}if(f(p)){const m=Un(e.slice(p));if(m===-1)return null;const _=e.slice(p,p+m+1);/\/\s*>$/.test(_)||u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function lz(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
|
|
190
|
-
`){n++;continue}return-1}return s===t.length?n:-1}function az(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
191
|
-
</${t}>`}function eS(e){return e.replace(/\r\n/g,`
|
|
192
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function cz(e,t,n){return n?e.includes(n,t)?!0:eS(e.slice(Math.max(0,t))).includes(eS(n)):!1}function uz(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 tS(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 F0(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Ao(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function aM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const fz=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),pz=/(?:^|\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)||pz.test(e)}function mz(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>fz.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!hz(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function gz(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||ST.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=Un(l);if(a===-1)return o;const c=F0(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=pu(u,t,aM(n,s));return mz(u,d)?{...o,children:d}:o})}function pu(e,t,n){return e.trim()?uM(e,t,{...n,__disableStreamParse:!0}):[]}function vz(e,t,n){const s=pu(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function yz(e,t,n){const s=nM({content:e}),o=Un(e),i=F0(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=vz(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function kz(e,t,n){const s=Un(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=B0(o,"summary",0);if(!i)return pu(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...pu(r,t,n),yz(i.raw,t,n),...pu(l,t,n)]}function cM(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=fu(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!tS(c)){r.push(c);continue}const f=String(c.raw??fu(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,m=-1;for(let Q=a+1;Q<e.length;Q++){const X=e[Q];if(tS(X)){p++;continue}if(dz(X)&&(p--,p===0)){m=Q;break}}const _=B0(t,"details",h),b=m===-1&&_?.closed===!0,g=b?(()=>{const Q=F0(f,"details");return Q!==-1?f.slice(0,Q):f})():f,[v]=cM(b?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,h+f.length),y=kz(g,n,aM(s,o)),C=m===-1?"</details>":String(e[m].raw??fu(e[m])??"</details>"),L=b||m!==-1&&_?.closed===!0,I=C.replace(/[\t\r\n ]+$/,""),k=L?(()=>{const Q=(_?.raw??"").lastIndexOf(I);return Q===-1?t.length:h+Q})():t.length,M=Un(f),E=b&&M!==-1?h+M+1:h+f.length,P=t.slice(E,k===-1?t.length:k),A=n.parse(P,{__markstreamFinal:o}),$=n.renderer.render(A,n.options,{__markstreamFinal:o}),D=k+I.length,R=L?Math.max(k+C.length,uz(t,D)):t.length,H=L?t.slice(k,R):C,z=L?t.slice(h,R):t.slice(h),q=b&&M!==-1?f.slice(0,M+1):f;if(r.push({...c,tag:"details",attrs:yh(f.slice(0,M+1)),raw:z,content:`${q}${$}${H}`,children:[...y,...v],loading:!o&&!L}),l=L?R:t.length,m===-1&&!b)break;m!==-1&&(a=m)}return[r,l]}function bz(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=fu(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=B0(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),h=az(u.raw,c,u.closed),p=!t&&!u.closed,m=d!==h||f!==u.raw||!!r.loading!==p,_=Un(u.raw),b=_===-1?"":u.raw.slice(0,_+1),g=b?yh(b):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=g.length?g:void 0,!m)continue;let v=lz(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&rz(s[y],c)){s.splice(y,1);continue}const C=fu(s[y]);if(!C)break;const L=u.raw.indexOf(C,v);if(L===-1){if(cz(n,u.end,C))break;s.splice(y,1);continue}v=L+C.length,s.splice(y,1)}}return s}function _z(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 _=m.charCodeAt(0);return _>=65&&_<=90||_>=97&&_<=122},u=m=>{const _=m.charCodeAt(0);return _>=48&&_<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",h=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!h(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const _=l[a];if(t(_)||_==="<"||_===">"||_==='"'||_==="'"||_==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",h=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let C=v;for(;C<g.length&&g[C]===y;)C++;const L=C-v;return L<3?null:{markerChar:y,markerLen:L,rest:g.slice(C)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let y=!1;for(;v<g.length&&g[v]===">";)for(y=!0,v++;v<g.length&&f(g[v]);)v++;return y?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const y=p(g);return y==null?null:h(y)};let _=0;const b=l.split(/\r?\n/);for(const g of b){const v=_,y=_+g.length;if(a<v)break;const C=m(g);if(C){const L=C.markerChar,I=C.markerLen;c?L===u&&I>=d&&/^\s*$/.test(C.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=I)}if(a<=y)break;_=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
196
|
-
`||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
197
|
-
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function wz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=p=>p===" "||p===" ",o=p=>{const m=p.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let m=0;for(let _=0;_<p.length;_++){const b=p[_];if(b===" "){if(m++,m>=4)return!0;continue}if(b===" ")return!0;break}return!1},r=p=>{let m=!1,_=!1;for(let b=0;b<p.length;b++){const g=p[b];if(g==="\\"){b++;continue}if(!_&&g==="'"){m=!m;continue}if(!m&&g==='"'){_=!_;continue}if(!m&&!_&&g===">")return b}return-1},l=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const _=p[m];if(_!=="`"&&_!=="~")return null;let b=m;for(;b<p.length&&p[b]===_;)b++;const g=b-m;return g<3?null:{markerChar:_,markerLen:g,rest:p.slice(b)}},a=(p,m)=>{if(i(p))return-1;const _=p.replace(/^[ \t]+/,"");if(!_||_.startsWith(">")||_.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(_))return-1;let b=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){s(v)||(b=!0),g++;continue}const y=r(p.slice(g));if(y===-1){b=!0,g++;continue}const C=p.slice(g,g+y+1);let L=1;for(;L<C.length&&s(C[L]);)L++;if(L>=C.length){b=!0,g++;continue}const I=C[L];if(I==="!"||I==="?"){b=!0,g+=y+1;continue}if(I==="/"){b=!0,g+=y+1;continue}const k=L;for(;L<C.length&&o(C[L]);)L++;if(L===k){b=!0,g++;continue}const M=C.slice(k,L).toLowerCase(),E=C[L];if(E&&E!==" "&&E!==" "&&E!==">"&&E!=="/"){b=!0,g++;continue}const P=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),A=/\/\s*>$/.test(C),$=P.test(p.slice(g+y+1)),D=P.test(e.slice(m+g+y+1)),R=/[\r\n]/.test(e.slice(m+g+y+1));if(b&&n.has(M)&&!A&&!$&&(D||R))return g;b=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
198
|
-
`,h),m=p!==-1,_=m&&p>h&&e[p-1]==="\r",b=m?_?p-1:p:e.length,g=e.slice(h,b),v=m?_?`\r
|
|
199
|
-
`:`
|
|
200
|
-
`:"",y=l(g);let C=g;if(!c&&!y){const L=a(g,h);if(L!==-1){const I=v||`
|
|
201
|
-
`;C=`${g.slice(0,L).replace(/[ \t]+$/,"")}${I}${I}${g.slice(L).replace(/^[ \t]+/,"")}`}}f+=C,f+=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?p+1:e.length}return f}function Sz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&s(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const m=d[p];if(m==="\\"){p++;continue}if(!h&&m==="'"){f=!f;continue}if(!f&&m==='"'){h=!h;continue}if(!f&&!h&&m===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let _=m+1;for(;_<d.length&&s(d[_]);)_++;if(_>=d.length||d[_]!=="/"){m=d.indexOf("<",m+1);continue}for(_++;_<d.length&&s(d[_]);)_++;if(_+p.length>d.length){m=d.indexOf("<",m+1);continue}let b=!0;for(let v=0;v<p.length;v++){const y=d[_+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==p[v]){b=!1;break}}if(!b){m=d.indexOf("<",m+1);continue}let g=_+p.length;if(g<d.length&&o(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&s(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&s(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&s(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&o(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const m=r(d.slice(f));if(m===-1)return d;const _=f+m;if(l(d,_+1,p))return d;const b=i(d.slice(_+1));return b?`${d.slice(0,_+1)}
|
|
202
|
-
${b}`: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 f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
|
|
204
|
-
`:`
|
|
205
|
-
`,u=d+1}return c}function Cz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{let h=0,p=!1,m=0;for(;h<f.length;){for(;h<f.length&&s(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&s(f[h]);)h++;m=h}return p?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let h=0;for(;h<f.length&&s(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let m=h;for(;m<f.length&&f[m]===p;)m++;const _=m-h;return _<3?null:{markerChar:p,markerLen:_,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
|
|
206
|
-
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,_=e.slice(d,m),b=h?p?`\r
|
|
207
|
-
`:`
|
|
208
|
-
`:"",g=o(_),v=g?.prefix??"",y=g?.content??_,C=i(y);C&&(l?C.markerChar===a&&C.markerLen>=c&&/^\s*$/.test(C.rest)&&(l=!1,a="",c=0):(l=!0,a=C.markerChar,c=C.markerLen));let L=y;if(!l&&L.includes("</"))for(const I of r)L=L.replace(I,(k,M,E,P)=>{if(P.replace(/^[\t ]+/,"").startsWith("|"))return k;const A=P.slice(0,E).replace(/^[\t ]+/,"");if(A.length>0){const $=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",D=A.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!$||!D||$!==D)return k}return`${M}
|
|
209
|
-
|
|
210
|
-
`});if(v){const I=v+L.split(`
|
|
211
|
-
`).join(`
|
|
212
|
-
${v}`);u+=I}else u+=L;u+=b,d=h?f+1:e.length}return u}function xz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(A=>String(A??"").toLowerCase()));if(!n.size)return e;const s=A=>A===" "||A===" ",o=A=>{if(!A)return!1;if(A[0]===" ")return!0;let $=0;for(let D=0;D<A.length;D++){const R=A[D];if(R===" "){if($++,$>=4)return!0;continue}if(R===" ")return!0;break}return!1},i=A=>{const $=A.charCodeAt(0);return $>=65&&$<=90||$>=97&&$<=122||$>=48&&$<=57||A==="_"||A==="-"||A===":"},r=A=>{let $=0;for(;$<A.length&&s(A[$]);)$++;return A.slice($)},l=A=>{let $=0,D=!1,R=0;for(;$<A.length;){for(;$<A.length&&s(A[$]);)$++;if($>=A.length||A[$]!==">")break;for(D=!0,$++;$<A.length&&s(A[$]);)$++;R=$}if(!D)return null;const H=A.slice(0,R);return{prefix:H,key:H.replace(/[ \t]+$/,""),content:A.slice(R)}},a=A=>r(A).startsWith("<"),c=A=>{for(let $=0;$<A.length;$++){const D=A[$];if(D!==" "&&D!==" ")return!1}return!0},u=A=>{if(o(A))return"";const $=r(A);if(!$.startsWith("<"))return"";let D=1;for(;D<$.length&&s($[D]);)D++;if(D>=$.length||$[D]==="/"||$[D]==="!"||$[D]==="?")return"";const R=D;for(;D<$.length&&i($[D]);)D++;if(D===R)return"";const H=$.slice(R,D).toLowerCase();if(!n.has(H))return"";const z=$[D];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":H},d=A=>{if(o(A))return null;const $=r(A);if(!$.startsWith("<"))return null;let D=1;for(;D<$.length&&s($[D]);)D++;if(D>=$.length)return null;const R=$[D]==="/";if(R)for(D++;D<$.length&&s($[D]);)D++;const H=$[D];if(!H||H==="!"||H==="?")return null;const z=D;for(;D<$.length&&i($[D]);)D++;if(D===z)return null;const q=$.slice(z,D).toLowerCase();if(!n.has(q))return null;const Q=$[D];if(Q&&Q!==" "&&Q!==" "&&Q!==">"&&Q!=="/")return null;if(R)return{type:"close",name:q};if(/\/\s*>\s*$/.test($))return{type:"open",name:q,complete:!0};const X=$.indexOf(">",D);if(X!==-1){const ue=$.slice(X+1);if(new RegExp(`<\\s*\\/\\s*${q}\\s*>`,"i").test(ue))return{type:"open",name:q,complete:!0}}return{type:"open",name:q,complete:!1}},f=A=>{if(o(A))return null;const $=r(A).replace(/[ \t]+$/,"");if(!$.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test($))return null;const D=$.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(D?.[1])return D[1].toLowerCase();const R=$.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const H=R[1].toLowerCase();return H===R[2].toLowerCase()?H:null};let h=!1,p="",m=0;const _=A=>{let $=0;for(;$<A.length&&s(A[$]);)$++;const D=A[$];if(D!=="`"&&D!=="~")return null;let R=$;for(;R<A.length&&A[R]===D;)R++;const H=R-$;return H<3?null:{markerChar:D,markerLen:H,rest:A.slice(R)}},b=A=>_(A),g=A=>{const $=r(A);return $?o(A)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test($):!1},v=(A,$,D)=>{let R=A,H=0;for(;R<e.length;){const z=e.indexOf(`
|
|
213
|
-
`,R),q=z!==-1,Q=q&&z>R&&e[z-1]==="\r",X=q?Q?z-1:z:e.length,ue=e.slice(R,X),ge=l(ue),xe=ge?.key??"";if(H>0&&$&&xe!==$)break;const ke=ge?.content??ue,ze=d(ke);if(ze?.name===D){if(ze.type==="open")ze.complete||H++;else if(H>0&&(H--,H===0))return!1}else if(H>0&&(c(ke)||g(ke)))return!0;if(q)R=z+1;else break}return!1};let y="",C=0,L=!0,I=!1,k=!1,M=`
|
|
214
|
-
`;const E=[];let P="";for(;C<e.length;){const A=e.indexOf(`
|
|
215
|
-
`,C),$=A!==-1,D=$&&A>C&&e[A-1]==="\r",R=$?D?A-1:A:e.length,H=e.slice(C,R),z=$?D?`\r
|
|
216
|
-
`:`
|
|
217
|
-
`:"",q=l(H),Q=q?.key??"",X=q?.content??H,ue=b(X);ue&&(h?ue.markerChar===p&&ue.markerLen>=m&&/^\s*$/.test(ue.rest)&&(h=!1,p="",m=0):(h=!0,p=ue.markerChar,m=ue.markerLen));const ge=E.length>0;if(!h&&!ge){const ke=u(X),ze=!!ke&&!L&&I&&k&&v(C,Q,ke);ke&&!L&&(!I||ze)&&(Q&&P&&Q===P?y+=`${Q}${M}`:Q||(y+=M))}if(y+=H,y+=z,z&&(M=z),!h){const ke=d(X);if(ke){if(ke.type==="open")ke.complete||E.push(ke.name);else for(let ze=E.length-1;ze>=0;ze--)if(E[ze]===ke.name){E.length=ze;break}}}const xe=c(X);L=xe,I=!xe&&a(X),k=!xe&&!!f(X),P=Q,C=$?A+1:e.length}return y}function uM(e,t,n={}){const s=iM(n),o=s?ic():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(VH(t,n)&&(t.stream.reset(),KH(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,_=>_.startsWith(`
|
|
218
|
-
`)?`
|
|
219
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,_=>_.startsWith(`
|
|
220
|
-
`)?`
|
|
221
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,_=>_.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*$/,_=>_.startsWith(`
|
|
225
|
-
`)?`
|
|
226
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(_,b,g)=>`${b}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,_=>_.startsWith(`
|
|
227
|
-
`)?`
|
|
228
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
229
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const _=pc(n.customHtmlTags);if(_.length&&(r=wz(r,_),r=Sz(r,_),r=xz(r,_),r=Cz(r,_),r.includes("</")))for(const b of _){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${b}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=_z(r));const l=iz(r);if(l){const _=n.preTransformTokens,b=n.postTransformTokens;if(lM(t,n)||typeof _=="function"||typeof b=="function"){const g=Qw(t,r,{__markstreamFinal:i},n),v=typeof _=="function"&&_(g)||g;typeof b=="function"&&b(v)}return _g(l,s,o)}const a=Qw(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return _g([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=Gw(d,p,s);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const b=_[0],g=b?.type;b&&typeof g=="string"?m=Gw(_,void 0,s):m=_}}if(m=bz(m,i,r),m=cM(m,r,t,n,i)[0],m=gz(m,t,n,i),i){const _=new WeakSet,b=g=>{if(!g||typeof g!="object"||_.has(g))return;if(_.add(g),Array.isArray(g)){for(const y of g)b(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))b(y)};b(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),_g(m,s,o)}function nS(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=sl(t);let o=0;for(;o<e.length;){const i=R0(e,o,s.options(),O0);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=HH(e,o,s.options(l)),c=Jw(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=hc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=mc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(WH()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=qn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=Jw(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const Az=new Set([...od,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),Tz=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"]),sS=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function oS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Mz(e){return typeof e=="string"?e:e==null?"":String(e)}function dM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Pr(e){return Mz(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function fM(e){return Pr(e).replace(/`/g,"`")}function wh(e){return String(e??"").trim().toLowerCase()}function W0(e,t="safe"){const n=wh(e);return n?t==="escape"?!0:t==="trusted"?od.has(n):!Tz.has(n):!1}function pM(e,t="safe"){const n=wh(e);return n?t==="escape"?!0:t==="trusted"?od.has(n):Az.has(n):!1}function iS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${fM(s)}"`).join("")}function Ez(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||Wl(o,{tagName:t,attrName:"srcset"})})}function hM(e,t,n,s){return f7.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?Ez(t,s):!!(p7.has(e)&&t&&Wl(t,{tagName:s,attrName:e}))}function Il(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function mM(e,t,n,s=!1){if(t!=="safe"||wh(n)!=="a")return e;const o=Il(e,"href");if(s&&(!o||!e[o])){const a=Il(e,"target"),c=Il(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Il(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Il(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 rS(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!dM(r)||hM(l,i,t,n)||(s[r]=i)}return mM(s,t,n,!!Il(e,"href"))}function gM(e,t){const n=e.toLowerCase();return wT.has(n)?!1:oS(t,n)||oS(t,e)}function H0(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!dM(r)||hM(l,i,t,n)||(s[r]=i)}return mM(s,t,n,!!Il(e,"href"))}function Ap(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function Jv(e,t="safe",n){const s=H0(Ap(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function Iz(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function $z(e){const t={};for(const[n,s]of Object.entries(e))t[n]=Iz(s,n);return t}function lS(e){return e.trim().length>0}function Nz(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);lS(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);lS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||Ql.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function Lz(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const f=e.indexOf("]]>",s);if(f!==-1){t.push({type:"text",content:e.slice(s,f+3)}),n=f+3;continue}break}if(e.startsWith("!",s+1)){const f=e.indexOf(">",s);if(f!==-1){n=f+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||Ql.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function Pz(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Pr(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${Pr(s)}`:` ${Pr(s)}="${fM(o)}"`).join("");return e.type==="self_closing"?`<${Pr(t)}${n} />`:`<${Pr(t)}${n}>`}function Oz(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;sS.lastIndex=0;let n;for(;(n=sS.exec(e))!==null;)if(gM(n[1],t))return!0;return!1}function Ya(e,t="safe"){if(!e)return"";if(t==="escape")return Pr(e);const n=Lz(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(Pr(r.content??""));continue}const l=wh(r.tagName);if(!l)continue;if(pM(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"&&W0(l,t)){o.push(Pz(r));continue}if(r.type==="self_closing"){o.push(`<${l}${iS(rS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${iS(rS(r.attrs??{},t,l))}>`),Ql.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const Rz=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],aS="http://www.w3.org/2000/svg",Dz=new Set(["script","style","iframe","object","embed","link","meta"]),Bz=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"]),Fz=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Wz=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Hz=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function zz(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Uz(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function qz(e){const t=e.nodeName.toLowerCase();return t==="use"?zz(e):t==="image"?Uz(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Hz.has(t)}function jz(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 Vz(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?Wl(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?Wl(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":Wl(i,{tagName:s,attrName:o})?"":i:""}function Kz(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function vM(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function yM(e){const t=vM(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=Kz(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function cS(e){const t=vM(e);return Rz.some(n=>n.test(t))||yM(t)}function Gz(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 rf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function kM(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!Dz.has(s)){if(s==="br"){t.push(`
|
|
230
|
-
`);return}for(const o of Array.from(n.childNodes))kM(o,t)}}function Yz(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];kM(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=rf(t.getAttribute("width")),i=rf(t.getAttribute("height")),r=rf(t.getAttribute("x")),l=rf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(aS,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,f]of s.entries()){const h=e.ownerDocument.createElementNS(aS,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function Xz(e){Yz(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!Bz.has(s)){n.remove();continue}if(s==="style"&&cS(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&cS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(Fz.has(r)&&i.value){const l=Vz(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(Wz.has(r)&&i.value&&yM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=jz(i.value);l!==i.value&&n.setAttribute(i.name,l)}}Gz(n)}}function Spe(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 Xz(n),Qz(n)?null:n}catch{return null}}function Qz(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){qz(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const uS=[];function Sg(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Zz(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function Jz(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function dS(e=`editor-${Date.now()}`,t={}){const n=gW(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;o=h=>f[h]??s[h]??h}else o=f=>s[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...m]=h;typeof p=="function"&&n.use(p,...m)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(uS.length)for(const f of uS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(PO),n.use(DO),n.use($O);const i=QO,r=i.default??i;n.use(r),n.use(IO),n.use(EO),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,m=!!h.env?.__markstreamFinal,_=p.split(/\r?\n/);for(const b of h.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const g=b.map[0],v=b.map[1],y=b.markup,C=y[0],L=y.length,I=_[Math.max(0,v-1)]??"";let k=0;for(;k<I.length&&(I[k]===" "||I[k]===" ");)k++;let M=0;for(;k+M<I.length&&I[k+M]===C;)M++;let E=k+M;for(;E<I.length&&(I[E]===" "||I[E]===" ");)E++;const P=m?!0:v>g+1&&M>=L&&E===I.length,A=b;A.meta=A.meta??{},A.meta.unclosed=!P,A.meta.closed=!!P}});const l=(f,h)=>{const p=f,m=p.pos;if(p.src[m]!=="~")return!1;const _=p.src[m-1],b=p.src[m+1];if(/\d/.test(_)&&/\d/.test(b)){if(!h){const g=p.push("text","",0);g.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],m=String(p.info??"").trim(),_=String(p.content??""),b=btoa(unescape(encodeURIComponent(_))),g=Zz(m),v=Sg(g),y=Jz(`editor-${e}-${h}-${g}`),C=Sg(o("common.copy"));return`<div class="code-block" data-code="${b}" data-lang="${v}" id="${y}">
|
|
231
|
-
<div class="code-header">
|
|
232
|
-
<span class="code-lang">${Sg(g.toUpperCase())}</span>
|
|
233
|
-
<button class="copy-button" data-code="${b}">${C}</button>
|
|
234
|
-
</div>
|
|
235
|
-
<div class="code-editor"></div>
|
|
236
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const m=a.exec(p.src.slice(p.pos));if(!m)return!1;const _=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const b=p.src.slice(p.pos+m[0].length);if(b.startsWith("](")||b.startsWith("(")||u(b))return!1;if(!h){const g=m[1],v=p.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return p.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const m=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}const eU="modulepreload",tU=function(e){return"/"+e},fS={},ao=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=tU(c),c in fS)return;fS[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":eU,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function nU({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 bM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:nU({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const pS=new WeakMap;function sU(e){let t=pS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},pS.set(e,t)),t}function hS(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function z0(e){return!!(e.themes?.length||e.langs?.length)}function _M(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function oU(e,t){return!t?.length||e.registeredAllLangs?!0:_M(e.registeredLangs,t)}function Cg(e,t){return z0(t)&&_M(e.registeredThemes,t.themes)&&oU(e,t.langs)}function iU(e,t){if(!z0(t))return t;const n=hS(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:hS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const rU={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 lU(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function wM(e){const t=lU(e);return rU[t]??t}function SM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>wM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function CM(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function aU(e){return CM(e)?.join("\0")??""}function xM(e,t){const n=CM(e),s=SM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Tp(e,t){return`${aU(e)}\0\0${SM(t)?.join("\0")??""}`}function Cpe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=xM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Tp(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function xpe(e,t={},n){if(!e)return"ready";const s=xM(t.themes,t.langs),o=Tp(s.themes,s.langs),i=n&&n===o?n:o,r=sU(e);if(r.completed.has(i))return"ready";if(Cg(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||Cg(r,s))return r.completed.add(i),"ready";const c=iU(r,s),u=Tp(c.themes,c.langs);return r.completed.has(u)||Cg(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(z0(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 ya(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function mS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var cU=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=gS();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=gS();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,m=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=pU(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const b=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=fU(this.source.slice(this.visible.length),b,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:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=ya(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,ya(s,1e3,1)),this.normalizedTargetLatencyMs=ya(o,900,1),this.normalizedCatchUpLatencyMs=ya(i,350,1),this.normalizedCatchUpThreshold=mS(r,600),this.normalizedStartDelayMs=mS(a,80),this.maxCommitFps=Math.trunc(ya(l,30,1)),this.maxCharsPerCommit=Math.trunc(ya(c,80,1)),this.flushOnFinish=u,this.segmenter=dU(),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 uU(e={},t){const n=new cU(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 dU(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function fU(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function gS(){return typeof performance<"u"?performance.now():Date.now()}function pU(e,t,n){return Math.min(n,Math.max(t,e))}var hU=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const e1=Symbol.for("markstream-vue:node-lifecycle"),vS='<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>',yS='<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>',mU={id:"material",core:{"":yS,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:yS,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:vS,csharp:vS,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:()=>ao(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},t1=new Map;let kS="material";const Pa=new Map,bS=new Map;let n1=null;function gU(e){t1.set(e.id,e)}function vU(e){return hU(this,null,function*(){var t,n,s;if(Pa.has(e.id))return(t=Pa.get(e.id))!=null?t:null;let o=bS.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Pa.set(e.id,i),n1?.(),i)).catch(()=>(Pa.set(e.id,null),null)),bS.set(e.id,o)),o})}const yU=Yl(0);n1=()=>{yU.value++},gU(mU);const kU={"":"",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 U0(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=kU[n])!=null?t:n}function Ape(e){const t=U0(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Tpe(e){return(function(s){const o=t1.get(kS);if(!o)return;const i=o.core[s];if(i)return i;const r=Pa.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Pa.has(o.id)&&vU(o)})(U0(e))||((n=(t=t1.get(kS))==null?void 0:t.fallback)!=null?n:"");var t,n}const Mpe={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 AM=!1;function Epe(){return AM}function Ipe(){AM=!0}var Sh=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let So=null,Tf=!1,Ch=j0;function xh(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function q0(){try{const e=globalThis;return xh(e?.katex)}catch{return null}}function j0(){return Sh(null,null,function*(){const e=q0();if(e)return e;const t=yield ao(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ao(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return xh(t)})}function bU(e){Ch=e,So=null,Tf=!1}function _U(e){bU(j0)}function TM(){return typeof Ch=="function"}function $pe(){var e;const t=Ch;if(!t||t===j0)return null;if(So)return So;const n=q0();if(n)return So=n,So;try{const s=t();return s&&typeof s?.then!="function"?(So=(e=xh(s))!=null?e:s,So):null}catch{return null}}function V0(){return Sh(this,null,function*(){var e;const t=q0();if(t)return So=t,So;if(So)return So;if(Tf)return null;const n=Ch;if(!n)return Tf=!0,null;try{const s=yield n();if(s)return So=(e=xh(s))!=null?e:s,So}catch{}return Tf=!0,null})}function MM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Dr=null,Er=null;const jo=new Map,Xi=new Map;let Mp=5;const Pl=new Set;function Uu(){if(jo.size<Mp&&Pl.size){const e=Array.from(Pl);Pl.clear();for(const t of e)try{t()}catch{}}}function wU(e){Dr=e,Er=null,Dr.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=jo.get(n);if(i)if(jo.delete(n),clearTimeout(i.timeoutId),Uu(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Xi.set(a,s),Xi.size>200){const c=Xi.keys().next().value;Xi.delete(c)}}i.resolve(s)}},Dr.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of jo.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));jo.clear(),Uu()}}function SU(){var e;Dr&&((e=Dr.terminate)==null||e.call(Dr)),Dr=null,Er=null}function CU(e,t=!0,n=2e3,s){return Sh(this,null,function*(){performance.now();const o=MM(e);if(!TM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Er)return Promise.reject(Er);const i=`${t?"d":"i"}:${o}`,r=Xi.get(i);if(r)return Promise.resolve(r);const l=Dr||(Er=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Er.name="WorkerInitError",Er.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Er);if(jo.size>=Mp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=jo.size,a.max=Mp,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{jo.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Uu()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),jo.has(u)&&jo.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Uu()},{once:!0});const f=a,h=c;jo.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function Npe(e,t=!0,n){const s=`${t?"d":"i"}:${MM(e)}`;if(Xi.set(s,n),Xi.size>200){const o=Xi.keys().next().value;Xi.delete(o)}}const xU="WORKER_BUSY";function AU(e=2e3,t){return jo.size<Mp?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Pl.delete(r),n())};if(Pl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Pl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>Uu()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Pl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const zc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Lpe(e){return Sh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!TM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:zc.timeout,c=(i=s.waitTimeout)!=null?i:zc.waitTimeout,u=(r=s.backoffMs)!=null?r:zc.backoffMs,d=(l=s.maxRetries)!=null?l:zc.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):zc.maxRetries,h=s.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield CU(t,n,a,h)}catch(m){if(m?.code!==xU||p>=f)throw m;if(p++,yield AU(c,h).catch(()=>{}),h?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*p)))}}})}function Oa(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function TU(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function s1(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=TU(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function o1(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 EM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function i1(e,t=360,n=500){return EM(e,t,n)}function r1(e,t=360,n=500){return EM(e,t,n)}var MU=Object.defineProperty,EU=Object.defineProperties,IU=Object.getOwnPropertyDescriptors,_S=Object.getOwnPropertySymbols,$U=Object.prototype.hasOwnProperty,NU=Object.prototype.propertyIsEnumerable,wS=(e,t,n)=>t in e?MU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IM=(e,t)=>{for(var n in t||(t={}))$U.call(t,n)&&wS(e,n,t[n]);if(_S)for(var n of _S(t))NU.call(t,n)&&wS(e,n,t[n]);return e},K0=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const G0=()=>ao(()=>import("./mermaid.core-VDZ71vKz.js").then(e=>e.bn),[]);let Hi=null,Y0=G0;function LU(e){Y0=e,Hi=null}function PU(e){LU(G0)}function OU(){return typeof Y0=="function"}function SS(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 o=t.mermaidAPI;return n=IM({},t),s={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):o.initialize?o.initialize(i):void 0},EU(n,IU(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function CS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=IM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,s):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(s):void 0}}catch{}}function Ppe(){return K0(this,null,function*(){if(Hi)return Hi;const e=(function(){try{const s=globalThis;return SS(s?.mermaid)}catch{return null}})();if(e)return Hi=e,CS(Hi),Hi;const t=Y0;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===G0?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(Hi=SS(n),CS(Hi),Hi):null})}let Ks=null,Ir=null;const xs=new Map;let xS=5,AS=!1;const RU="WORKER_BUSY",DU="MERMAID_DISABLED";function BU(e){Ks=e,Ir=null;const t=e;Ks.onmessage=n=>{if(Ks!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=xs.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Ks.onerror=n=>{var s,o;if(Ks===t)if(xs.size!==0){try{AS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of xs.entries())r.reject(new Error(`Worker error: ${n.message}`));xs.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Ks.onmessageerror=n=>{var s,o;if(Ks===t)if(xs.size!==0){try{AS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of xs.entries())r.reject(new Error("Worker messageerror"));xs.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function FU(){var e;if(Ks)try{for(const[t,n]of xs.entries())n.reject(new Error("Worker cleared"));xs.clear(),(e=Ks.terminate)==null||e.call(Ks)}catch{}Ks=null,Ir=null}function $M(e,t,n=1400){if(!OU()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=DU,Promise.reject(o)}if(Ir)return Promise.reject(Ir);const s=Ks||(Ir=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Ir.name="WorkerInitError",Ir.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Ir);if(xs.size>=xS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=RU,o.inFlight=xs.size,o.max=xS,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),xs.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};xs.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return xs.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=xs.get(r);f&&f.reject(d)},n)})}function Ope(e,t,n=1400){return K0(this,null,function*(){try{return yield $M("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Rpe(e,t,n=1400){return K0(this,null,function*(){try{return yield $M("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Dpe(){if(Ks)try{for(const[e,t]of xs.entries())t.reject(new Error("Worker terminated"));xs.clear(),Ks.terminate()}finally{Ks=null}}var WU=Object.defineProperty,HU=Object.defineProperties,zU=Object.getOwnPropertyDescriptors,TS=Object.getOwnPropertySymbols,UU=Object.prototype.hasOwnProperty,qU=Object.prototype.propertyIsEnumerable,MS=(e,t,n)=>t in e?WU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))UU.call(t,n)&&MS(e,n,t[n]);if(TS)for(var n of TS(t))qU.call(t,n)&&MS(e,n,t[n]);return e},Lt=(e,t)=>HU(e,zU(t)),Hn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const jU="__global__",xg="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",l1=(()=>{const e=globalThis;if(e[xg])return e[xg];const t={scopedCustomComponents:{},revision:Yl(0)};return e[xg]=t,t})(),ES=l1.revision,VU=Symbol("markstreamCustomComponents"),KU=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 ld(e){return KU.has(String(e).trim().toLowerCase())}function GU(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Ag(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([ei(n),ei(GU(n))]))!o||ld(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function ls(e){const t=jt(VU,null);return W(()=>{var n;return ES.value,(function(s,o={}){return ES.value,rt(rt(rt({},Ag(l1.scopedCustomComponents[jU]||{})),Ag(o)),Ag((function(i){return i&&l1.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const YU=["aria-label"],XU={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"},QU={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"},fn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},To=fn(Ve({__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",QU,[...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",XU,[...n[0]||(n[0]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,YU))}),[["__scopeId","data-v-be21ab83"]]);To.install=e=>{e.component(To.__name,To)};const ZU={class:"emoji-node"},uo=fn(Ve({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",ZU,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);uo.install=e=>{e.component(uo.__name,uo)};const JU=["id"],eq=["title"],Mo=fn(Ve({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(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"},"["+O(e.node.id)+"]",9,eq)],8,JU))}}),[["__scopeId","data-v-c1463a29"]]);Mo.install=e=>{e.component(Mo.__name,Mo)};const NM=(()=>{try{return!1}catch{}return!1})();function Tg(e){NM&&console.warn(e)}function IS(e,t="safe",n){return H0(e,t,n)}function LM(e){return $z(e)}function Mg(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function X0(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Jv((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Mg(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Mg(r.value)]):Object.entries(o).map(([r,l])=>[r,Mg(l)]):null,t,n);var o;if(!s)return;const i=LM(Ap(s));return Object.keys(i).length>0?i:void 0}function $S(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Uc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Eg(e,t,n,s,o,i,r=!1){const l=(function(d,f){return gM(d,f)})(e,s);if(od.has(e.toLowerCase())||!l&&pM(e,i))return null;if(!l&&W0(e,i))return r?[$S(e,t,!0)]:[$S(e,t),...n,`</${e}>`];const a=H0(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=LM(a);return un(d,Lt(rt({},f),{key:u}),n.length>0?n:void 0)}return un(e,Lt(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function PM(e,t){return Oz(e,t)}function Ep(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=Eg(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Uc(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),m=Eg(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Uc(c[c.length-1].children,m):Uc(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&Tg(`Auto-closing unclosed tag: <${p.tagName}>`)}else Tg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Eg(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Uc(c[c.length-1].children,f):Uc(u,f),Tg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(Nz(e),t,n)}catch(o){return s=o,NM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const tq=["innerHTML"],Eo=fn(Ve({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),s=W(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=ls(()=>t.customId),i=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=W(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Ya(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Ep(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!PM(l,o.value))return{mode:"html",content:Ya(l,s.value)};const a=Ep(l,o.value,s.value);return a===null?{mode:"html",content:Ya(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),N("span",{key:0,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[Z(S(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),N("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(w(),N("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,tq))}}),[["__scopeId","data-v-d17f12b0"]]);Eo.install=e=>{e.component(Eo.__name,Eo)};const nq={class:"inline-code"},sq={key:0},Hs=fn(Ve({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Zu(),s=jt("markstreamFade",void 0),o=jt("markstreamTextStreamState",void 0),i=jt("markstreamStreamVersion",void 0),r=W(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=W(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=W(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=W(()=>!l.value),u=W(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=ee(t.node.code),f=ee("");let h=i?.value;const p=ee(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}Ge([()=>t.node.code,u,l,()=>i?.value],([g,v,y,C])=>{const L=String(g??""),I=u.value,k=C!==h;h=C;const M=bM({nextContent:L,persistedContent:I?o?.get(I):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=M.settledContent,f.value=M.streamedDelta,M.appended&&(p.value+=1),I&&o?.set(I,L)},{immediate:!0}),Ge(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const b=W(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(w(),N("code",nq,[c.value?(w(),N(Pe,{key:0},[je(O(a.value),1)],64)):(w(),N(Pe,{key:1},[d.value?(w(),N("span",sq,O(d.value),1)):ie("",!0),f.value?(w(),N("span",{key:1,class:De(["inline-code-stream-delta",[b.value]]),onAnimationend:_},O(f.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);Hs.install=e=>{e.component(Hs.__name,Hs)};const a1=ee(!1),NS=ee(""),LS=ee("top"),hu=ee(null),mu=ee(null),c1=ee(null),u1=ee(null),PS=ee(null);let Mf=null,Ef=null,d1=0;function OM(){Mf&&(clearTimeout(Mf),Mf=null),Ef&&(clearTimeout(Ef),Ef=null)}let lf=!1,af=null,OS=!1;function oq(e,t,n="top",s=!1,o,i){if(!e)return;const r=++d1;OM();const l=()=>Hn(null,null,function*(){var a,c;if(yield(function(){return Hn(this,null,function*(){if(!lf&&!OS&&typeof document<"u"){af!=null||(af=Hn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ao(()=>import("./vue.runtime.esm-bundler-B84GkS0f.js"),[]),ao(()=>import("./Tooltip-Co8nMusV.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:a1.value,"anchor-el":hu.value,content:NS.value,placement:LS.value,id:mu.value,originX:c1.value,originY:u1.value,isDark:(p=PS.value)!=null?p:void 0})}}).mount(h),lf=!0}));try{yield af}catch(u){lf=!1,af=null,OS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),lf&&r===d1){mu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,hu.value=e,NS.value=t,LS.value=n,c1.value=(a=o?.x)!=null?a:null,u1.value=(c=o?.y)!=null?c:null,PS.value=typeof i=="boolean"?i:null,a1.value=!0;try{e.setAttribute("aria-describedby",mu.value)}catch{}}});s?l():Mf=setTimeout(l,80)}function iq(e=!1){d1+=1,OM();const t=()=>{if(hu.value&&mu.value)try{hu.value.removeAttribute("aria-describedby")}catch{}a1.value=!1,hu.value=null,mu.value=null,c1.value=null,u1.value=null};e?t():Ef=setTimeout(t,120)}const f1={"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..."},p1=e=>{var t;return(t=f1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function RS(e){return{t(t){if(e.te&&f1[t]&&!e.te(t))return p1(t);const n=e.t(t);return n===t&&f1[t]?p1(t):n}}}function rq(){const e=(function(){var t,n;try{const s=$s(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return RS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return RS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:p1}}function lq(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const aq=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],cq={key:1,class:"image-placeholder"},uq={key:1,class:"image-node__raw-text"},dq={key:0,class:"image-shimmer-overlay"},fq={key:1,class:"image-node__raw-text"},pq={key:2,class:"image-error"},zr=fn(Ve({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=ee(!1),i=ee(!1),r=ee(""),l=ee("primary"),a=ee(null),c=Zu(),u=jt(e1,null);let d="",f=null;const h=W(()=>mw(n.node.src)),p=W(()=>mw(n.fallbackSrc)),m=W(()=>r.value),_=W(()=>!n.lazy),b=W(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=W(()=>l.value==="failed"),v=W(()=>!_.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=W(()=>lq(n,c));function C(D=y.value){D&&a.value&&u?.reportHeight(D,a.value.offsetHeight)}function L(D=y.value){D&&vt(()=>{C(D)})}function I(){f&&(clearTimeout(f),f=null)}function k(){const D=y.value;D&&d!==D&&(d&&u?.markSettled(d),I(),d=D,u?.markPending(D),typeof window<"u"&&(f=window.setTimeout(()=>{d===D&&(L(D),M())},8e3)))}function M(){return Hn(this,null,function*(){const D=d;D&&(I(),d="",yield vt(),C(D),u?.markSettled(D))})}function E(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,o.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,s("error",r.value),L()}function P(){o.value=!0,i.value=!1,s("load",m.value),L()}function A(D){D.preventDefault(),o.value&&!i.value&&s("click",[D,m.value])}const{t:$}=rq();return Ge([h,p,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ge([b,o,i,m,()=>n.lazy],([D,R,H,z,q])=>D&&z&&!H?R?(M(),void L()):q?(k(),void L()):void(R||H||k()):(M(),void L()),{flush:"post",immediate:!0}),hs(()=>{(function(){const D=d;D&&(I(),d="",u?.markSettled(D))})()}),(D,R)=>{var H,z,q,Q,X;return w(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[b.value?(w(),N("img",{key:0,src:m.value,alt:String((z=(H=n.node.alt)!=null?H:n.node.title)!=null?z:""),title:String((Q=(q=n.node.title)!=null?q:n.node.alt)!=null?Q:""),class:De(["image-node__img",{"is-loading":!_.value&&!o.value,"is-loaded":_.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(X=n.node.alt)!=null?X:S($)("image.preview"),onError:E,onLoad:P,onClick:A},null,42,aq)):ie("",!0),e.node.loading&&!i.value?(w(),N("span",cq,[n.usePlaceholder?Tn(D.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[0]||(R[0]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",uq,O(e.node.raw),1))])):ie("",!0),Z(Vr,{name:"shimmer-fade"},{default:de(()=>[v.value&&!e.node.loading?(w(),N("span",dq,[n.usePlaceholder?Tn(D.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[1]||(R[1]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",fq,O(e.node.raw),1))])):ie("",!0)]),_:3}),g.value?(w(),N("span",pq,[Tn(D.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[2]||(R[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,O(S($)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);zr.install=e=>{e.component(zr.__name,zr)};const hq={key:2},$i=Ve({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ls(()=>t.customId),s=jt("markstreamHtmlPolicy",void 0),o=jt("markstreamNestedRendererProps",void 0),i=W(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=W(()=>{var p,m;const _=(p=o?.value)!=null?p:{};return Lt(rt({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=Mi({loader:()=>Promise.resolve().then(()=>sy),suspensible:!1}),a=W(()=>t.components[String(t.node.type)]),c=W(()=>!!(a.value&&n.value[t.node.type]&&!ld(String(t.node.type)))),u=W(()=>c.value?X0(t.node,i.value):void 0),d=W(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=W(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=W(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(w(),ve(Bs(a.value),hn({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:de(()=>[d.value?(w(),ve(S(l),hn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(w(),ve(S(l),hn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),ve(Bs(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",hq,O(h.value),1)):ie("",!0)}}),mq=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],gq={key:0,translate:"no",class:"markstream-pre__diff-code"},vq={class:"markstream-pre__diff-number","aria-hidden":"true"},yq={class:"markstream-pre__diff-content"},kq={class:"markstream-pre__diff-content-inner"},bq={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},_q=["textContent"],wo=Ve({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=W(()=>{var A,$,D;const R=String(($=(A=t.node)==null?void 0:A.language)!=null?$:"");return String((D=String(R).split(/\s+/g)[0])!=null?D:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=W(()=>`language-${n.value}`),o=W(()=>{var A,$,D,R,H;return((A=t.node)==null?void 0:A.diff)===!0?String((D=($=t.node)==null?void 0:$.code)!=null?D:""):(function(z,q){const Q=String(z??"");return q?Q:Q.replace(/\r\n$|\n$|\r$/,"")})((R=t.node)==null?void 0:R.code,((H=t.node)==null?void 0:H.loading)===!0)}),i=W(()=>o.value.split(/\r\n|\n|\r/)),r=W(()=>Array.from({length:Math.max(1,i.value.length)},(A,$)=>$+1)),l=W(()=>{var A;return t.showLineNumbers===!0&&((A=t.node)==null?void 0:A.diff)===!0}),a=W(()=>l.value&&t.diffInline===!0),c=W(()=>{const A=Number(t.reservedHeightPx);if(!Number.isFinite(A)||A<=0)return;const $=`${Math.ceil(A)}px`;return{height:$,minHeight:$,maxHeight:$,overflow:"auto"}});function u(A){return String(A??"").trim().length===0}function d(A,$="context",D={}){const R=u(A);return{code:A,kind:R&&$!=="hunk"&&!D.preserveBlankKind?"context":$,empty:R}}function f(A){const $=String(A??"");return $?$.split(/\r\n|\n|\r/):[]}function h(A,$){return!u(A[$])||$<A.length-1}function p(A){return A.startsWith("-")&&!A.startsWith("---")}function m(A){return A.startsWith("+")&&!A.startsWith("+++")}function _(A,$){const D=f(A),R=f($),H=(function(ge,xe){const ke=ge.length,ze=xe.length;if((ke+1)*(ze+1)>15e5)return null;const qe=ze+1,Ue=new Uint32Array((ke+1)*(ze+1));for(let ne=1;ne<=ke;ne++)for(let te=1;te<=ze;te++){const U=ne*qe+te;if(ge[ne-1]===xe[te-1])Ue[U]=Ue[(ne-1)*qe+(te-1)]+1;else{const Y=Ue[(ne-1)*qe+te],fe=Ue[ne*qe+(te-1)];Ue[U]=Y>=fe?Y:fe}}const Le=[];let le=ke,F=ze;for(;le>0&&F>0;)ge[le-1]===xe[F-1]?(Le.push({originalIndex:le-1,modifiedIndex:F-1}),le--,F--):Ue[(le-1)*qe+F]>=Ue[le*qe+(F-1)]?le--:F--;return Le.reverse(),Le})(D,R);if(H){const ge=[];let xe=0,ke=0;for(const ze of H){for(;xe<ze.originalIndex;)ge.push(Lt(rt({},d(D[xe],"removed",{preserveBlankKind:h(D,xe)})),{key:`inline-removed-source-${xe}`,number:""})),xe++;for(;ke<ze.modifiedIndex;)ge.push(Lt(rt({},d(R[ke],"added",{preserveBlankKind:h(R,ke)})),{key:`inline-added-source-${ke}`,number:ke+1})),ke++;ge.push(Lt(rt({},d(R[ze.modifiedIndex])),{key:`inline-context-source-${ze.originalIndex}-${ze.modifiedIndex}`,number:ze.modifiedIndex+1})),xe=ze.originalIndex+1,ke=ze.modifiedIndex+1}for(;xe<D.length;)ge.push(Lt(rt({},d(D[xe],"removed",{preserveBlankKind:h(D,xe)})),{key:`inline-removed-source-${xe}`,number:""})),xe++;for(;ke<R.length;)ge.push(Lt(rt({},d(R[ke],"added",{preserveBlankKind:h(R,ke)})),{key:`inline-added-source-${ke}`,number:ke+1})),ke++;return ge}const z=[];let q=0,Q=D.length-1,X=R.length-1;for(;q<=Q&&q<=X&&D[q]===R[q];)z.push(Lt(rt({},d(R[q])),{key:`inline-prefix-${q}`,number:q+1})),q++;const ue=[];for(;Q>=q&&X>=q&&D[Q]===R[X];)ue.unshift(Lt(rt({},d(R[X])),{key:`inline-suffix-${X}`,number:X+1})),Q--,X--;for(let ge=q;ge<=Q;ge++)z.push(Lt(rt({},d(D[ge],"removed",{preserveBlankKind:h(D,ge)})),{key:`inline-removed-source-${ge}`,number:""}));for(let ge=q;ge<=X;ge++)z.push(Lt(rt({},d(R[ge],"added",{preserveBlankKind:h(R,ge)})),{key:`inline-added-source-${ge}`,number:ge+1}));return z.concat(ue)}const b=W(()=>{var A,$,D,R;const H=(function(X){const ue=X.some(xe=>p(xe)),ge=X.some(xe=>m(xe));return ue&&ge||(function(){var xe,ke,ze,qe;if(n.value==="diff")return!0;const Ue=(qe=(ze=String((ke=(xe=t.node)==null?void 0:xe.raw)!=null?ke:"").split(/\r?\n/,1)[0])==null?void 0:ze.trim())!=null?qe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ue)})()&&(ue||ge)})(i.value),z=(function(){var X,ue;return((X=t.node)==null?void 0:X.originalCode)!=null||((ue=t.node)==null?void 0:ue.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:H?(function(X){const ue=[];let ge=1;for(const[xe,ke]of X.entries())if(ke.startsWith("@@"))ue.push(Lt(rt({},d(ke,"hunk")),{key:`inline-hunk-${xe}`,number:""}));else if(p(ke))ue.push(Lt(rt({},d(ke.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${xe}`,number:""}));else if(m(ke))ue.push(Lt(rt({},d(ke.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${xe}`,number:ge++}));else{const ze=ke.startsWith(" ")?ke.slice(1):ke;ue.push(Lt(rt({},d(ze)),{key:`inline-context-${xe}`,number:ge})),ge++}return ue})(i.value):_((A=t.node)==null?void 0:A.originalCode,($=t.node)==null?void 0:$.updatedCode)}];if(!H&&z){const X=f((D=t.node)==null?void 0:D.originalCode),ue=f((R=t.node)==null?void 0:R.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:X.map((ge,xe)=>{const ke=ue[xe]===ge?"context":"removed";return Lt(rt({},d(ge,ke,{preserveBlankKind:h(X,xe)})),{key:`original-${xe}`,number:xe+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ue.map((ge,xe)=>{const ke=X[xe]===ge?"context":"added";return Lt(rt({},d(ge,ke,{preserveBlankKind:h(ue,xe)})),{key:`modified-${xe}`,number:xe+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 ue=X.startsWith(" ")?X.slice(1):X;q.push(d(ue)),Q.push(d(ue))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:q.map((X,ue)=>Lt(rt({},X),{key:`original-${ue}`,number:ue+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((X,ue)=>Lt(rt({},X),{key:`modified-${ue}`,number:ue+1}))}]}),g=W(()=>{const A=n.value;return A?`Code block: ${A}`:"Code block"}),v=ee(null),y=ee([]);let C=null,L=null;function I(A){const $=Number.parseFloat(String(A??""));return Number.isFinite($)&&$>0?$:0}function k(A,$){var D;if(!A)return $;const R=A.querySelector(".markstream-pre__diff-content"),H=R?.getBoundingClientRect(),z=(D=H?.height)!=null?D:0;return Math.max($,Math.ceil(z))}function M(){typeof window<"u"&&(C!=null&&window.cancelAnimationFrame(C),C=window.requestAnimationFrame(()=>{(function(){var A,$;C=null;const D=v.value;if(!D||!l.value)return void(y.value.length&&(y.value=[]));const R=(function(ge){const xe=window.getComputedStyle(ge),ke=I(xe.getPropertyValue("--markstream-pre-diff-line-height"));if(ke>0)return ke;const ze=I(xe.lineHeight);return ze>0?ze:18})(D),H=Array.from(D.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(D.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),q=Math.max(H.length,z.length),Q=[];for(let ge=0;ge<q;ge++){const xe=k((A=H[ge])!=null?A:null,R),ke=k(($=z[ge])!=null?$:null,R),ze=Math.max(R,xe,ke);Q.push({rowHeight:ze,originalHeight:xe,modifiedHeight:ke})}var X,ue;X=y.value,ue=Q,X.length===ue.length&&X.every((ge,xe)=>{const ke=ue[xe];return ke&&Math.abs(ge.rowHeight-ke.rowHeight)<=.5&&Math.abs(ge.originalHeight-ke.originalHeight)<=.5&&Math.abs(ge.modifiedHeight-ke.modifiedHeight)<=.5})||(y.value=Q)})()}))}function E(A){L?.disconnect(),L=null,A&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{M()}),L.observe(A))}function P(A,$){const D=y.value[A];if(!D)return;const R=$==="original"?D.originalHeight:D.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(D.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(R)}px`}}return Ge(v,A=>{E(A),vt(()=>M())},{flush:"post"}),Ge([l,b],()=>{E(v.value),vt(()=>M())},{flush:"post",immediate:!0}),hs(()=>{C!=null&&(window.cancelAnimationFrame(C),C=null),L?.disconnect(),L=null}),(A,$)=>(w(),N("pre",{ref_key:"preRef",ref:v,style:Qt(c.value),class:De([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":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",gq,[(w(!0),N(Pe,null,ot(b.value,D=>(w(),N("span",{key:D.key,class:De(["markstream-pre__diff-pane",D.className])},[(w(!0),N(Pe,null,ot(D.lines,(R,H)=>(w(),N("span",{key:R.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${R.kind}`,{"markstream-pre__diff-line--empty":R.empty}]]),style:Qt(P(H,D.key))},[$[0]||($[0]=T("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),T("span",vq,O(R.number),1),T("span",yq,[T("span",kq,O(R.code),1)])],6))),128))],2))),128))])):(w(),N(Pe,{key:1},[t.showLineNumbers?(w(),N("span",bq,[(w(!0),N(Pe,null,ot(r.value,D=>(w(),N("span",{key:D,class:"markstream-pre__line-number"},O(D),1))),128))])):ie("",!0),T("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,_q)],64))],14,mq))}});wo.install=e=>{e.component(wo.__name,wo)};const Ig=Yl(!1);let DS=null;const wq={key:0},Yn=fn(Ve({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(DS||(DS=V0().then(b=>{Ig.value=!!b}).catch(()=>{Ig.value=!1})),Wf(Ig)),s=Zu(),o=jt("markstreamFade",void 0),i=jt("markstreamTextStreamState",void 0),r=jt("markstreamStreamVersion",void 0),l=W(()=>{const b=s.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),a=W(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=W(()=>{var b;const g=(b=s["index-key"])!=null?b:s.indexKey;return g==null||g===""?"":String(g)}),u=ee(t.node.content),d=ee("");let f=r?.value;const h=ee(0);function p(){return u.value+d.value}function m(){d.value&&(u.value=p(),d.value="")}Ge([()=>t.node.content,c,a,()=>r?.value],([b,g,v,y])=>{const C=String(b??""),L=c.value,I=y!==f;f=y;const k=bM({nextContent:C,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:I});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(h.value+=1),L&&i?.set(L,C)},{immediate:!0}),Ge(a,b=>{var g;b||(g=p(),u.value=g,d.value="")});const _=W(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(b,g)=>(w(),N("span",{class:De([[S(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),N("span",wq,O(u.value),1)):ie("",!0),d.value?(w(),N("span",{key:1,class:De(["text-node-stream-delta",[_.value]]),onAnimationend:m},O(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Yn.install=e=>{e.component(Yn.__name,Yn)};const RM=Ve({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return un(wo,Lt(rt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),$g=Mi({loader:()=>Hn(null,null,function*(){try{return(yield ao(()=>import("./CodeBlockNode-CHRi13cp.js"),__vite__mapDeps([2,3,4]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),wo}}),loadingComponent:RM,delay:0,suspensible:!1}),fi=Mi(()=>Hn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return un(Yn,Lt(rt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield V0())return(yield ao(()=>import("./index6-Bt9yqgGH.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return un(Yn,Lt(rt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),DM=Mi(()=>Hn(null,null,function*(){try{if(yield V0())return(yield ao(()=>import("./index5-Dhi5S4AY.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return un(Yn,Lt(rt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),Xs=fn(Ve({__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]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const Sq={class:"superscript-node"},fo=fn(Ve({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ls(()=>t.customId),s=W(()=>rt({text:Yn,inline_code:Hs,link:Js,html_inline:Eo,strong:Qs,emphasis:eo,footnote_reference:Mo,strikethrough:Zs,highlight:Io,insert:ho,subscript:po,emoji:uo,math_inline:fi,reference:Xs},n.value));return(o,i)=>(w(),N("sup",Sq,[(w(!0),N(Pe,null,ot(e.node.children,(r,l)=>(w(),ve(S($i),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);fo.install=e=>{e.component(fo.__name,fo)};const Cq={class:"subscript-node"},po=fn(Ve({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ls(()=>t.customId),s=W(()=>rt({text:Yn,inline_code:Hs,link:Js,html_inline:Eo,strong:Qs,emphasis:eo,footnote_reference:Mo,strikethrough:Zs,highlight:Io,insert:ho,superscript:fo,emoji:uo,math_inline:fi,reference:Xs},n.value));return(o,i)=>(w(),N("sub",Cq,[(w(!0),N(Pe,null,ot(e.node.children,(r,l)=>(w(),ve(S($i),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);po.install=e=>{e.component(po.__name,po)};const xq={class:"strong-node"},Qs=fn(Ve({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ls(()=>t.customId),s=W(()=>rt({text:Yn,inline_code:Hs,link:Js,html_inline:Eo,emphasis:eo,strikethrough:Zs,highlight:Io,insert:ho,subscript:po,superscript:fo,emoji:uo,footnote_reference:Mo,math_inline:fi,reference:Xs},n.value));return(o,i)=>(w(),N("strong",xq,[(w(!0),N(Pe,null,ot(e.node.children,(r,l)=>(w(),ve(S($i),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const Aq={class:"strikethrough-node"},Zs=fn(Ve({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ls(()=>t.customId),s=W(()=>rt({text:Yn,inline_code:Hs,link:Js,html_inline:Eo,strong:Qs,emphasis:eo,highlight:Io,insert:ho,subscript:po,superscript:fo,emoji:uo,footnote_reference:Mo,math_inline:fi,reference:Xs},n.value));return(o,i)=>(w(),N("del",Aq,[(w(!0),N(Pe,null,ot(e.node.children,(r,l)=>(w(),ve(S($i),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const Tq=["href","title","aria-label","aria-hidden","target","rel"],Mq=["aria-hidden"],Eq={class:"link-text-wrapper relative inline-flex"},Iq={class:"leading-[normal] link-text"},Js=fn(Ve({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=jt("markstreamShowTooltips",void 0),s=W(()=>{const b=n?.value;return typeof b=="boolean"?b:t.showTooltip}),o=W(()=>{var b,g,v,y,C;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",I=(b=t.animationOpacity)!=null?b:.35,k=Math.max(.12,Math.min(.5*I,I)),M={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String(I),"--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):(C=t.animationIteration)!=null?C:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=ls(()=>t.customId),r=W(()=>rt({text:Yn,strong:Qs,strikethrough:Zs,emphasis:eo,image:zr,html_inline:Eo,inline_code:Hs},i.value)),l=Zu(),a=W(()=>{var b,g;const v=(b=t.node)==null?void 0:b.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const C of v)Array.isArray(C)&&C[0]&&(y[String(C[0])]=String((g=C[1])!=null?g:""));else for(const[C,L]of Object.entries(v))C&&L!=null&&L!==!1&&(y[C]=L===!0?"":String(L));return IS(y,"safe","a")}),c=W(()=>rt(rt({},l),a.value)),u=W(()=>{var b,g;return IS({href:String((g=(b=t.node)==null?void 0:b.href)!=null?g:"")},"safe","a").href}),d=W(()=>{if(!u.value)return;const b=c.value.target;return(typeof b=="string"?b.trim():String(b??"").trim())||(y7(u.value)?"_blank":void 0)}),f=W(()=>{var b;return String((b=d.value)!=null?b:"").trim().toLowerCase()==="_blank"}),h=W(()=>{if(!u.value)return;const b=c.value.rel,g=new Set((typeof b=="string"?b:String(b??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=W(()=>{const b=rt({},c.value);return delete b.title,delete b.href,delete b.target,delete b.rel,b});function m(){s.value&&iq()}const _=W(()=>{var b,g;const v=(b=t.node)==null?void 0:b.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(b,g)=>{var v,y;return e.node.loading?(w(),N("span",hn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},S(l),{style:o.value}),[T("span",Eq,[T("span",Iq,[Z(S(Yn),{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,Mq)):(w(),N("a",hn({key:0,class:"link-node",href:u.value,title:s.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:g[0]||(g[0]=C=>(function(L){var I,k,M,E;if(!s.value)return;const P=L,A=P?.clientX!=null&&P?.clientY!=null?{x:P.clientX,y:P.clientY}:void 0,$=((I=t.node)==null?void 0:I.title)||((k=u.value)!=null&&k.includes("xn--")&&((E=(M=t.node)==null?void 0:M.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";oq(L.currentTarget,$,"top",!1,A)})(C)),onMouseleave:m}),[(w(!0),N(Pe,null,ot(e.node.children,(C,L)=>(w(),ve(S($i),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:C,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Tq))}}}),[["__scopeId","data-v-367e6ca4"]]);Js.install=e=>{e.component(Js.__name,Js)};const $q={class:"insert-node"},ho=fn(Ve({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ls(()=>t.customId),s=W(()=>rt({text:Yn,inline_code:Hs,link:Js,html_inline:Eo,strong:Qs,emphasis:eo,strikethrough:Zs,highlight:Io,subscript:po,superscript:fo,emoji:uo,footnote_reference:Mo,math_inline:fi,reference:Xs},n.value));return(o,i)=>(w(),N("ins",$q,[(w(!0),N(Pe,null,ot(e.node.children,(r,l)=>(w(),ve(S($i),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);ho.install=e=>{e.component(ho.__name,ho)};const Nq={class:"highlight-node"},Io=fn(Ve({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ls(()=>t.customId),s=W(()=>rt({text:Yn,inline_code:Hs,link:Js,html_inline:Eo,strong:Qs,emphasis:eo,strikethrough:Zs,insert:ho,subscript:po,superscript:fo,emoji:uo,footnote_reference:Mo,math_inline:fi,reference:Xs},n.value));return(o,i)=>(w(),N("mark",Nq,[(w(!0),N(Pe,null,ot(e.node.children,(r,l)=>(w(),ve(S($i),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Io.install=e=>{e.component(Io.__name,Io)};const Lq={class:"emphasis-node"},eo=fn(Ve({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ls(()=>t.customId),s=W(()=>rt({text:Yn,inline_code:Hs,link:Js,html_inline:Eo,strong:Qs,strikethrough:Zs,highlight:Io,insert:ho,subscript:po,superscript:fo,emoji:uo,footnote_reference:Mo,math_inline:fi,reference:Xs},n.value));return(o,i)=>(w(),N("em",Lq,[(w(!0),N(Pe,null,ot(e.node.children,(r,l)=>(w(),ve(S($i),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);eo.install=e=>{e.component(eo.__name,eo)};const Pq={class:"hard-break"},Ur=fn(Ve({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("br",Pq))}),[["__scopeId","data-v-50c58f70"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const qu=Ve({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Or({checkbox:To,checkbox_input:To,emoji:uo,emphasis:eo,hardbreak:Ur,highlight:Io,inline_code:Hs,insert:ho,link:Js,reference:Xs,strikethrough:Zs,strong:Qs,subscript:po,superscript:fo,text:Yn}),s=ls(()=>t.customId),o=W(()=>{const i=s.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(w(!0),N(Pe,null,ot(e.nodes,(l,a)=>(w(),ve(S($i),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function h1(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(h1)}function Ip(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(h1))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(h1)?o:null}function rc(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const Oq=["cite"],Rq={key:0,dir:"auto",class:"paragraph-node"},Dq=["custom-id"],If=fn(Ve({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ls(()=>t.customId),s=W(()=>!!n.value.paragraph),o=W(()=>!!n.value.text),i=W(()=>Ip(t.node.children,!s.value)),r=W(()=>t.fade!==!1||o.value?null:rc(i.value));return Pn("markstreamShowTooltips",W(()=>t.showTooltips)),Pn("markstreamFade",W(()=>t.fade)),(l,a)=>(w(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),N("p",Rq,[r.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,Dq)):(w(),ve(S(qu),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),ve(S(mo),{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,Oq))}}),[["__scopeId","data-v-abfecebc"]]);If.install=e=>{e.component(If.__name,If)};const Bq={class:"definition-list"},Fq={class:"definition-term"},Wq={class:"definition-desc"},$f=fn(Ve({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),N("dl",Bq,[(w(!0),N(Pe,null,ot(t.node.items,(o,i)=>(w(),N(Pe,{key:i},[T("dt",Fq,[Z(S(mo),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),T("dd",Wq,[Z(S(mo),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);$f.install=e=>{e.component($f.__name,$f)};const Hq=["href","title"],gu=fn(Ve({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(w(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,Hq))}}),[["__scopeId","data-v-e1eb37b6"]]);gu.install=e=>{e.component(gu.__name,gu)};const zq=["id"],Uq={class:"flex-1"},Nf=Ve({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(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",Uq,[Z(S(mo),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,zq))}});Nf.install=e=>{e.component(Nf.__name,Nf)};const qq=["custom-id"],m1=fn(Ve({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ls(()=>t.customId),s=jt("markstreamFade",void 0),o=W(()=>s?.value!==!1||n.value.text?null:rc(t.node.children)),i=W(()=>rt({text:Yn,inline_code:Hs,link:Js,image:zr,strong:Qs,emphasis:eo,strikethrough:Zs,highlight:Io,insert:ho,subscript:po,superscript:fo,emoji:uo,checkbox:To,checkbox_input:To,footnote_reference:Mo,hardbreak:Ur,math_inline:fi,reference:Xs},n.value));return(r,l)=>(w(),ve(Bs(`h${e.node.level}`),hn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:de(()=>[o.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,qq)):(w(!0),N(Pe,{key:1},ot(e.node.children,(a,c)=>(w(),ve(S($i),{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"]]),$p=m1;$p.install=e=>{e.component(m1.__name,m1)};const jq={key:0,dir:"auto",class:"paragraph-node"},Vq=["custom-id"],Kq={dir:"auto",class:"paragraph-node"},Gq=["custom-id"],Xa=fn(Ve({__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=W(()=>{var h;return(h=t.node)!=null?h:t.item}),s=ls(()=>t.customId),o=W(()=>!!s.value.paragraph),i=W(()=>!!s.value.text),r=W(()=>{var h;return Ip((h=n.value)==null?void 0:h.children,!o.value)}),l=W(()=>{var h;if(o.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const m=p[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const _=p.slice(1);if(!_.every(g=>g?.type==="list"))return null;const b=Ip([m]);return b?{paragraphChildren:b,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=W(()=>a()?rc(r.value):null),u=W(()=>{var h;return a()?rc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=W(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Pn("markstreamShowTooltips",W(()=>t.showTooltips)),Pn("markstreamFade",W(()=>t.fade)),(h,p)=>{var m,_;return w(),N("li",hn({class:"list-item",dir:"auto"},f.value),[r.value?(w(),N("p",jq,[c.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,Vq)):(w(),ve(S(qu),{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(Pe,{key:1},[T("p",Kq,[u.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,Gq)):(w(),ve(S(qu),{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(Pe,null,ot(l.value.nestedLists,(b,g)=>(w(),ve(S(mo),{key:g,nodes:[b],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),ve(S(mo),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=b=>h.$emit("copy",b))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Xa.install=e=>{e.component(Xa.__name,Xa)};const Qa=fn(Ve({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ls(()=>e.customId),n=W(()=>t.value.list_item||Xa);return(s,o)=>(w(),ve(Bs(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:de(()=>[(w(!0),N(Pe,null,ot(e.node.items,(i,r)=>{var l;return w(),ve(Bs(n.value),hn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Qa.install=e=>{e.component(Qa.__name,Qa)};const BM=Symbol("ViewportPriority");function Yq(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?ee(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){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),p()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&_())},{timeout:1200}))}Ge(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const b=(g,v)=>{const y=ee(!1);let C,L=!1;const I=new Promise(E=>{C=()=>{L||(L=!0,E())}}),k=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()};if(!o||!i.value)return y.value=!0,C(),{isVisible:y,whenVisible:I,destroy:k};const M=(function(E,P){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const A=(function(R,H){var z,q,Q;return{root:(z=e?.(R??null))!=null?z:null,rootMargin:(q=H?.rootMargin)!=null?q:"300px",threshold:(Q=H?.threshold)!=null?Q:0}})(E,P);if(a&&(D=A,($=c)&&$.root===D.root&&$.rootMargin===D.rootMargin&&$.threshold===D.threshold))return a;var $,D;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(R=>{for(const H of R)(H.isIntersecting||H.intersectionRatio>0)&&m(H.target)},{root:A.root,rootMargin:A.rootMargin,threshold:A.threshold}),c=A;for(const R of u.keys())a.observe(R);return a})(g,v);return M?(u.set(g,{resolve:C,visible:y}),M.observe(g),d.add(g),_(),{isVisible:y,whenVisible:I,destroy:k}):(y.value=!0,C(),{isVisible:y,whenVisible:I,destroy:k})};return Pn(BM,b),b}function Xq(){var e,t;const n=jt(BM,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=s.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=ee(!1);let p,m=!1;const _=new Promise(v=>{p=()=>{m||(m=!0,v())}}),b=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(f,{resolve:p,visible:h}),g.observe(f),i.add(f),d(),{isVisible:h,whenVisible:_,destroy:b}):(h.value=!0,p(),{isVisible:h,whenVisible:_,destroy:b})}}const Qq={key:2,class:"html-block-node__raw"},Zq=["innerHTML"],Jq={key:1,class:"html-block-node__placeholder"},vu=fn(Ve({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),s=jt("markstreamNestedRendererProps",void 0),o=W(()=>{var L,I;return(I=(L=t.htmlPolicy)!=null?L:n?.value)!=null?I:"safe"}),i=W(()=>{var L,I;const k=(L=s?.value)!=null?L:{};return Lt(rt({},k),{customId:(I=t.customId)!=null?I:k.customId,htmlPolicy:o.value})}),r=Mi({loader:()=>Promise.resolve().then(()=>sy),suspensible:!1}),l=W(()=>{const L=Jv(t.node.attrs,o.value);if(!L)return;const I=Ap(L);return Object.keys(I).length>0?I:void 0}),a=W(()=>{const L=String(t.node.tag||"").trim(),I=Jv(t.node.attrs,o.value,L);if(!I)return;const k=Ap(I);return Object.keys(k).length>0?k:void 0}),c=ls(()=>t.customId),u=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=ee(null),f=ee(typeof window>"u"),h=ee(t.node.content),p=W(()=>Array.isArray(t.node.children)?t.node.children:[]),m=W(()=>String(t.node.tag||"div")),_=W(()=>{const L=m.value.trim().toLowerCase();return ST.has(L)||W0(L,o.value)}),b=W(()=>p.value.length>0&&!!t.node.tag&&!_.value),g=W(()=>{var L,I,k;if(b.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=h.value)!=null?L:""};const M=(I=h.value)!=null?I:t.node.content;if(!M)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Ya(M,o.value)};if(t.node.loading){const P=Ep(M,c.value,o.value);return P===null?{mode:"text",content:(k=t.node.raw)!=null?k:M}:{mode:"dynamic",nodes:P}}if(!PM(M,c.value))return{mode:"html",content:Ya(M,o.value)};const E=Ep(M,c.value,o.value);return E===null?{mode:"html",content:Ya(M,o.value)}:{mode:"dynamic",nodes:E}}),v=Xq(),y=ee(null),C=!!t.node.loading;return typeof window<"u"?(Ge(d,L=>{var I,k;if((k=(I=y.value)==null?void 0:I.destroy)==null||k.call(I),y.value=null,!C)return f.value=!0,void(h.value=t.node.content);if(!L)return void(f.value=!1);const M=v(L,{rootMargin:"400px"});y.value=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ge(()=>t.node.content,L=>{C&&!f.value||(h.value=L)})):f.value=!0,hs(()=>{var L,I;(I=(L=y.value)==null?void 0:L.destroy)==null||I.call(L),y.value=null}),(L,I)=>(w(),ve(Bs(b.value?m.value:"div"),hn({ref_key:"htmlRef",ref:d,class:"html-block-node"},b.value?a.value:void 0),{default:de(()=>[f.value?(w(),N(Pe,{key:0},[g.value.mode==="structured"?(w(),ve(S(r),hn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(w(),ve(S(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(w(),N("pre",Qq,O(g.value.content),1)):(w(),N("div",hn({key:3},l.value,{innerHTML:g.value.content}),null,16,Zq))],64)):(w(),N("div",Jq,[Tn(L.$slots,"placeholder",{node:e.node},()=>[I[0]||(I[0]=T("span",{class:"html-block-node__placeholder-bar"},null,-1)),I[1]||(I[1]=T("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),I[2]||(I[2]=T("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);vu.install=e=>{e.component(vu.__name,vu)};const ej={dir:"auto",class:"paragraph-node"},tj=["custom-id"],zl=fn(Ve({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ls(()=>t.customId),s=jt("markstreamHtmlPolicy",void 0),o=jt("markstreamFade",void 0),i=jt("markstreamParseOptions",void 0),r=jt("markstreamCustomMarkdownIt",void 0),l=jt("markstreamNestedRendererProps",void 0),a=W(()=>{var k;return(k=s?.value)!=null?k:"safe"}),c=W(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=W(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=W(()=>{var k,M;return(M=t.customHtmlTags)!=null?M:(k=l?.value)==null?void 0:k.customHtmlTags}),f=W(()=>{var k,M;const E=(k=l?.value)!=null?k:{};return Lt(rt({},E),{customId:(M=t.customId)!=null?M:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Mi({loader:()=>Promise.resolve().then(()=>sy),suspensible:!1});function p(k){var M;return k.type==="text"&&String((M=k.content)!=null?M:"").trim()===""}const m=W(()=>t.node.children.filter(k=>!p(k))),_=W(()=>m.value.length>0&&m.value.every(k=>k.type==="image"||(function(M){var E;const P=(function(A){return A.type==="link"&&Array.isArray(A.children)?A.children.filter($=>!p($)):[]})(M);return P.length===1&&((E=P[0])==null?void 0:E.type)==="image"})(k))),b=W(()=>new Set(pc(d.value))),g=W(()=>{if(!_.value||m.value.length<=1)return t.node.children;const k=[];for(let M=0;M<t.node.children.length;M++){const E=t.node.children[M];if(!p(E)){k.push(E);continue}const P=k.length>0,A=t.node.children.slice(M+1).some($=>!p($));P&&A&&k.push(Lt(rt({},E),{content:" ",raw:" "}))}return k}),v=W(()=>o?.value===!1&&!n.value.text),y=W(()=>v.value?rc(g.value):null);function C(k,M){return{node:k,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=W(()=>rt({inline_code:Hs,image:zr,link:Js,hardbreak:Ur,emphasis:eo,strong:Qs,strikethrough:Zs,highlight:Io,insert:ho,subscript:po,superscript:fo,html_inline:Eo,html_block:vu,emoji:uo,checkbox:To,math_inline:fi,checkbox_input:To,reference:Xs,footnote_anchor:gu,footnote_reference:Mo,text:Yn},n.value)),I=W(()=>g.value.map((k,M)=>{var E;const P=(function(A){var $,D,R,H;if(A.type==="html_block"||A.type==="html_inline"){const z=String(($=A.tag)!=null?$:"").trim().toLowerCase()||TT(A.content);if(z&&!b.value.has(z)&&MT((D=A.content)!=null?D:A.raw,z)){const q=String((H=(R=A.content)!=null?R:A.raw)!=null?H:"");return{child:{type:"text",content:q,raw:q},component:Yn,isCustomComponent:!1}}}return{child:A,component:L.value[A.type],isCustomComponent:!!(n.value[A.type]&&!ld(String(A.type)))}})(k);return Lt(rt({},P),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:P.isCustomComponent?X0(P.child,a.value):void 0,hasSlotChildren:Array.isArray(P.child.children)&&P.child.children.length>0,slotContent:String((E=P.child.content)!=null?E:""),originalChild:k})}));return(k,M)=>(w(),N("p",ej,[y.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(y.value),9,tj)):(w(!0),N(Pe,{key:1},ot(I.value,E=>{return w(),N(Pe,{key:E.key},[_.value&&p(E.originalChild)?(w(),N(Pe,{key:0},[je(O((P=E.originalChild,String((A=P.content)!=null?A:""))),1)],64)):E.isCustomComponent?(w(),ve(Bs(E.component),hn({key:1,ref_for:!0},E.customAttrs,{node:E.child,loading:E.child.loading,"index-key":E.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:de(()=>[E.hasSlotChildren?(w(),ve(S(h),hn({key:0,ref_for:!0},f.value,{nodes:E.child.children,"index-key":E.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):E.slotContent?(w(),ve(S(h),hn({key:1,ref_for:!0},f.value,{content:E.slotContent,final:!E.child.loading,"index-key":`${E.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(Bs(E.component),hn({key:2,ref_for:!0},C(E.child,E.index)),null,16))],64);var P,A}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);zl.install=e=>{e.component(zl.__name,zl)};const nj={class:"table-node-wrapper"},sj=["aria-busy"],oj={key:0},ij=["custom-id"],rj=["aria-label","onPointerdown"],lj=["custom-id"],aj={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},yu=fn(Ve({__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=W(()=>{var b;return(b=t.node.loading)!=null&&b}),s=W(()=>{var b;return(b=t.node.rows)!=null?b:[]}),o=ee(null),i=ee([]);let r=null;const l=W(()=>t.node.header.cells.length),a=W(()=>i.value.some(b=>Number.isFinite(b)&&b>0)),c=W(()=>a.value?i.value.map(b=>b>0?{width:`${b}px`}:void 0):[]);Pn("markstreamShowTooltips",W(()=>t.showTooltips)),Pn("markstreamFade",W(()=>t.fade));const u=ls(()=>t.customId),d=W(()=>!!u.value.text),f=W(()=>!!u.value.paragraph),h=new WeakMap;function p(b){const g=t.fade===!1&&!d.value,v=!f.value,y=h.get(b);if(y?.children===b.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const C=Ip(b.children,v,!0),L={simpleChildren:C,plainText:C&&g?rc(C):null};return h.set(b,{children:b.children,textFastPath:g,paragraphFastPath:v,info:L}),L}function m(b){if(!r)return;b.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+b.clientX-r.startX))),C=[...r.widths];C[r.index]=y,C[r.index+1]=g-y,i.value=C}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return Ge(l,()=>{_(),i.value=[]}),hs(_),(b,g)=>(w(),N("div",nj,[T("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),N("colgroup",oj,[(w(!0),N(Pe,null,ot(e.node.header.cells,(v,y)=>(w(),N("col",{key:y,style:Qt(c.value[y])},null,4))),128))])):ie("",!0),T("thead",null,[T("tr",null,[(w(!0),N(Pe,null,ot(e.node.header.cells,(v,y)=>(w(),N("th",{key:y,dir:"auto",class:De([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(p(v).plainText),9,ij)):p(v).simpleChildren?(w(),ve(S(qu),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(w(),ve(S(mo),{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]=C=>b.$emit("copy",C))},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:C=>(function(L,I){if(I.button!==0)return;const k=(function(){var P;const A=(P=o.value)==null?void 0:P.querySelectorAll("thead th");return Array.from(A??[],$=>Math.round($.getBoundingClientRect().width))})(),M=k[L],E=k[L+1];M&&E&&(I.preventDefault(),r={index:L,startX:I.clientX,startWidth:M,nextStartWidth:E,widths:k},i.value=k,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,C)},null,40,rj)):ie("",!0)],2))),128))])]),T("tbody",null,[(w(!0),N(Pe,null,ot(s.value,(v,y)=>(w(),N("tr",{key:y},[(w(!0),N(Pe,null,ot(v.cells,(C,L)=>(w(),N("td",{key:L,class:De([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(C).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(p(C).plainText),9,lj)):p(C).simpleChildren?(w(),ve(S(qu),{key:1,nodes:p(C).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(w(),ve(S(mo),{key:2,nodes:C.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]=I=>b.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,sj),Z(Vr,{name:"table-node-fade"},{default:de(()=>[n.value?(w(),N("div",aj,[Tn(b.$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"]]);yu.install=e=>{e.component(yu.__name,yu)};const cj={class:"hr-node"},Lf=fn({},[["render",function(e,t){return w(),N("hr",cj)}],["__scopeId","data-v-39b2349c"]]);Lf.install=e=>{e.component(Lf.__name,Lf)};const uj={class:"unknown-node"},g1=Ve({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),N("div",uj,O(e.node.raw),1))}),Pf=fn(Ve({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=W(()=>`vmr-container vmr-container-${t.node.name}`),s=ls(()=>t.customId),o=W(()=>rt({text:Yn,paragraph:zl,heading:$p,inline_code:Hs,link:Js,image:zr,strong:Qs,emphasis:eo,strikethrough:Zs,insert:ho,subscript:po,superscript:fo,checkbox:To,checkbox_input:To,hardbreak:Ur,math_inline:fi,reference:Xs,list:Qa,math_block:DM,table:yu},s.value));return(i,r)=>(w(),N("div",hn({class:n.value},e.node.attrs),[(w(!0),N(Pe,null,ot(e.node.children,(l,a)=>{return w(),ve(Bs((c=l.type,o.value[c]||g1)),{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"]]);Pf.install=e=>{e.component(Pf.__name,Pf)};const dj=["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"],BS=[[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 fj(e){if(e<=255)return dj[e];let t=0,n=BS.length-1;for(;t<=n;){const s=t+n>>1,o=BS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const pj=/[ \t\n\r\f]+/g,hj=/[\t\n\r\f]| {2,}|^ | $/;let Ng=null;const mj=new RegExp("\\p{Script=Arabic}","u"),Ah=new RegExp("\\p{M}","u"),FM=new RegExp("\\p{Nd}","u");function FS(e){return mj.test(e)}function WS(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 Zi(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(WS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(WS(n))return!0}}return!1}const gj=new Set([" "," ","","\uFEFF"]);function vj(e){return Zi(e)}function v1(e){return!(function(t){const n=Np(t);return n!==null&&(Q0.has(n)||jl.has(n))})(e)&&!(function(t){const n=Np(t);return n!==null&&gj.has(n)})(e)}const Q0=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Th=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Z0=new Set(["'","’"]),jl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),yj=new Set([":",".","،","؛"]),kj=new Set(["၏"]),bj=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function _j(e){if(J0(e))return!0;let t=!1;for(const n of e)if(jl.has(n))t=!0;else if(!t||!Ah.test(n))return!1;return t}function wj(e){for(const t of e)if(!Q0.has(t)&&!jl.has(t))return!1;return e.length>0}function Sj(e){if(J0(e))return!0;for(const t of e)if(!Th.has(t)&&!Z0.has(t)&&!Ah.test(t))return!1;return e.length>0}function J0(e){let t=!1;for(const n of e)if(n!=="\\"&&!Ah.test(n)){if(!(Th.has(n)||jl.has(n)||Z0.has(n)))return!1;t=!0}return t}function WM(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Np(e){if(e.length===0)return null;const t=WM(e,e.length);return e.slice(t)}function Cj(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Ah.test(s))n--;else{if(!Th.has(s)&&!Z0.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function xj(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function HS(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function zS(e,t){return e&&t!==null&&yj.has(t)}function Aj(e){const t=Np(e);return t!==null&&kj.has(t)}function Tj(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 y1(e){let t=e.length;for(;t>0;){const n=WM(e,t),s=e.slice(n,t);if(bj.has(s))return!0;if(!jl.has(s))return!1;t=n}return!1}function Mj(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 Ej=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function zo(e){return e.length===1?e[0]:e.join("")}function Ij(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),zo(n)}function $j(e,t,n,s){if(!Ej.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Mj(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:zo(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:zo(r),isWordLike:a,kind:i,start:l}),o}function Lg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Nj=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Lj(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Nj.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Pj(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const Oj=new Set([":","-","/","×",",",".","+","–","—"]),US=/^[A-Za-z0-9_]+[,:;]*$/,qS=/[,:;]+$/;function jS(e){for(const t of e)if(FM.test(t))return!0;return!1}function Of(e){if(e.length===0)return!1;for(const t of e)if(!FM.test(t)&&!Oj.has(t))return!1;return!0}function VS(e,t,n){var s,o,i;const r=(Ng===null&&(Ng=new Intl.Segmenter(void 0,{granularity:"word"})),Ng);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],_=[],b=[],g=[],v=[];for(const k of r.segment(e))for(const M of $j(k.segment,(s=k.isWordLike)!=null&&s,k.index,n)){let E=function(){h[q]!==null&&(c[q]=[HS(a,h,p,q)],h[q]=null),c[q].push(M.text),u[q]=u[q]||M.isWordLike,m[q]=m[q]||$,_[q]=_[q]||D,b[q]=H,g[q]=z,v[q]=zS(_[q],R)};const P=M.kind==="text",A=xj(M.text,M.isWordLike,M.kind),$=Zi(M.text),D=FS(M.text),R=Np(M.text),H=y1(M.text),z=Aj(M.text),q=l-1;t.carryCJKAfterClosingQuote&&P&&l>0&&d[q]==="text"&&$&&m[q]&&b[q]||P&&l>0&&d[q]==="text"&&wj(M.text)&&m[q]||P&&l>0&&d[q]==="text"&&g[q]?E():P&&l>0&&d[q]==="text"&&M.isWordLike&&D&&v[q]?(E(),u[q]=!0):A!==null&&l>0&&d[q]==="text"&&h[q]===A?p[q]=((o=p[q])!=null?o:1)+1:P&&!M.isWordLike&&l>0&&d[q]==="text"&&(_j(M.text)||M.text==="-"&&u[q])?E():(a[l]=M.text,c[l]=[M.text],u[l]=M.isWordLike,d[l]=M.kind,f[l]=M.start,h[l]=A,p[l]=A===null?0:1,m[l]=$,_[l]=D,b[l]=H,g[l]=z,v[l]=zS(D,R),l++)}for(let k=0;k<l;k++)h[k]===null?a[k]=zo(c[k]):a[k]=HS(a,h,p,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&J0(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 C=-1;for(let k=l-1;k>=0;k--){const M=a[k];if(M.length!==0){if(d[k]==="text"&&!u[k]&&Sj(M)&&C>=0&&d[C]==="text"){const E=(i=y[C])!=null?i:[];E.push(M),y[C]=E,f[C]=f[k],a[k]="";continue}C=k}}for(let k=0;k<l;k++){const M=y[k];M!=null&&(a[k]=Ij(M,a[k]))}let L=0;for(let k=0;k<l;k++){const M=a[k];M.length!==0&&(L!==k&&(a[L]=M,u[L]=u[k],d[L]=d[k],f[L]=f[k]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const I=(function(k){const M=k.texts.slice(),E=k.isWordLike.slice(),P=k.kinds.slice(),A=k.starts.slice();for(let $=0;$<M.length-1;$++){if(P[$]!=="text"||P[$+1]!=="text"||!Zi(M[$])||!Zi(M[$+1]))continue;const D=Cj(M[$]);D!==null&&(M[$]=D.head,M[$+1]=D.tail+M[$+1],A[$+1]=A[$]+D.head.length)}return{len:M.length,texts:M,isWordLike:E,kinds:P,starts:A}})((function(k){const M=[],E=[],P=[],A=[];for(let $=0;$<k.len;$++){const D=k.texts[$],R=k.kinds[$],H=k.isWordLike[$];if(R==="text"&&H&&US.test(D)){const z=[D];let q=qS.test(D),Q=$+1;for(;q&&Q<k.len&&k.kinds[Q]==="text"&&k.isWordLike[Q]&&US.test(k.texts[Q]);){const X=k.texts[Q];z.push(X),q=qS.test(X),Q++}M.push(zo(z)),E.push(!0),P.push("text"),A.push(k.starts[$]),$=Q-1;continue}M.push(D),E.push(H),P.push(R),A.push(k.starts[$])}return{len:M.length,texts:M,isWordLike:E,kinds:P,starts:A}})((function(k){const M=[],E=[],P=[],A=[];for(let $=0;$<k.len;$++){const D=k.texts[$];if(k.kinds[$]==="text"&&D.includes("-")){const R=D.split("-");let H=R.length>1;for(let z=0;z<R.length;z++){const q=R[z];if(!H)break;q.length!==0&&jS(q)&&Of(q)||(H=!1)}if(H){let z=0;for(let q=0;q<R.length;q++){const Q=R[q],X=q<R.length-1?`${Q}-`:Q;M.push(X),E.push(!0),P.push("text"),A.push(k.starts[$]+z),z+=X.length}continue}}M.push(D),E.push(k.isWordLike[$]),P.push(k.kinds[$]),A.push(k.starts[$])}return{len:M.length,texts:M,isWordLike:E,kinds:P,starts:A}})((function(k){const M=[],E=[],P=[],A=[];for(let $=0;$<k.len;$++){const D=k.texts[$],R=k.kinds[$];if(R==="text"&&Of(D)&&jS(D)){const H=[D];let z=$+1;for(;z<k.len&&k.kinds[z]==="text"&&Of(k.texts[z]);)H.push(k.texts[z]),z++;M.push(zo(H)),E.push(!0),P.push("text"),A.push(k.starts[$]),$=z-1;continue}M.push(D),E.push(k.isWordLike[$]),P.push(R),A.push(k.starts[$])}return{len:M.length,texts:M,isWordLike:E,kinds:P,starts:A}})((function(k){const M=[],E=[],P=[],A=[];for(let $=0;$<k.len;$++){const D=k.texts[$];if(M.push(D),E.push(k.isWordLike[$]),P.push(k.kinds[$]),A.push(k.starts[$]),!Pj(D))continue;const R=$+1;if(R>=k.len||Lg(k.kinds[R]))continue;const H=[],z=k.starts[R];let q=R;for(;q<k.len&&!Lg(k.kinds[q]);)H.push(k.texts[q]),q++;H.length>0&&(M.push(zo(H)),E.push(!0),P.push("text"),A.push(z),$=q-1)}return{len:M.length,texts:M,isWordLike:E,kinds:P,starts:A}})((function(k){const M=k.texts.slice(),E=k.isWordLike.slice(),P=k.kinds.slice(),A=k.starts.slice();for(let D=0;D<k.len;D++){if(P[D]!=="text"||!Lj(k,D))continue;const R=[M[D]];let H=D+1;for(;H<k.len&&!Lg(P[H]);){R.push(M[H]),E[D]=!0;const z=M[H].includes("?");if(P[H]="text",M[H]="",H++,z)break}M[D]=zo(R)}let $=0;for(let D=0;D<M.length;D++){const R=M[D];R.length!==0&&($!==D&&(M[$]=R,E[$]=E[D],P[$]=P[D],A[$]=A[D]),$++)}return M.length=$,E.length=$,P.length=$,A.length=$,{len:$,texts:M,isWordLike:E,kinds:P,starts:A}})((function(k){const M=[],E=[],P=[],A=[];let $=0;for(;$<k.len;){const D=[k.texts[$]];let R=k.isWordLike[$],H=k.kinds[$],z=k.starts[$];if(H==="glue"){const q=[D[0]],Q=z;for($++;$<k.len&&k.kinds[$]==="glue";)q.push(k.texts[$]),$++;const X=zo(q);if(!($<k.len&&k.kinds[$]==="text")){M.push(X),E.push(!1),P.push("glue"),A.push(Q);continue}D[0]=X,D.push(k.texts[$]),R=k.isWordLike[$],H="text",z=Q,$++}else $++;if(H==="text")for(;$<k.len&&k.kinds[$]==="glue";){const q=[];for(;$<k.len&&k.kinds[$]==="glue";)q.push(k.texts[$]),$++;const Q=zo(q);$<k.len&&k.kinds[$]==="text"?(D.push(Q,k.texts[$]),R=R||k.isWordLike[$],$++):D.push(Q)}M.push(zo(D)),E.push(R),P.push(H),A.push(z)}return{len:M.length,texts:M,isWordLike:E,kinds:P,starts:A}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let k=0;k<I.len-1;k++){const M=Tj(I.texts[k]);M!==null&&(I.kinds[k]!=="space"&&I.kinds[k]!=="preserved-space"||I.kinds[k+1]!=="text"||!FS(I.texts[k+1])||(I.texts[k]=M.space,I.isWordLike[k]=!1,I.kinds[k]=I.kinds[k]==="preserved-space"?"preserved-space":"space",I.texts[k+1]=M.marks+I.texts[k+1],I.starts[k+1]=I.starts[k]+M.space.length))}return I}function Rj(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let ka=null;const KS=new Map;let ba=null;const Dj=new RegExp("\\p{Emoji_Presentation}","u"),Bj=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Pg=null;const GS=new Map;function k1(){if(ka!==null)return ka;if(typeof OffscreenCanvas<"u")return ka=new OffscreenCanvas(1,1).getContext("2d"),ka;if(typeof document<"u")return ka=document.createElement("canvas").getContext("2d"),ka;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function wr(e,t){let n=t.get(e);return n===void 0&&(n={width:k1().measureText(e).width,containsCJK:Zi(e)},t.set(e,n)),n}function Mh(){if(ba!==null)return ba;if(typeof navigator>"u")return ba={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ba;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 ba={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ba}function HM(){return Pg===null&&(Pg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Pg}function Fj(e){return Dj.test(e)||e.includes("️")}function xl(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=HM();for(const a of l.segment(i))Fj(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function Wj(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 Hj(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function YS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Mh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(y=u,C=d,L=a){l++,a=0,c=!1,f=-1,h=0}function m(y,C){c=!0,u=y+1,d=0,a=C}function _(y,C,L){c=!0,u=y,d=C+1,a=L}function b(y,C){c?(a+=C,u=y+1,d=0):m(y,C)}function g(y,C){const L=i[y];for(let I=C;I<L.length;I++){const k=L[I];c?a+k>r?(p(),_(y,I,k)):(a+=k,u=y,d=I+1):_(y,I,k)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=Wj(e,v),!(v>=s.length)));){const y=s[v],C=o[v],L=C==="space"||C==="preserved-space"||C==="tab"||C==="zero-width-break"||C==="soft-hyphen";if(c)if(a+y>r){if(L){b(v,y),p(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(y>t&&i[v]!==null){p(),g(v,0),v++;continue}p()}else b(v,y),L&&(f=v+1,h=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),L&&(f=v+1,h=a-y),v++}return c&&p(),l}let Og=null;function zj(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,h){s=[d],o=f,i=h,r=y1(d),l=Th.has(d)}function u(d,f){s.push(d),i=i||f;const h=y1(d);r=d.length===1&&jl.has(d)&&r||h,l=!1}for(const d of(Og===null&&(Og=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Og).segment(e)){const f=d.segment,h=Zi(f);s.length!==0?l||Q0.has(f)||jl.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function Uj(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Zi(e[0].text),i=v1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=Zi(a.text),u=v1(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function qj(e,t,n,s){const o=Mh(),{cache:i,emojiCorrection:r}=(function(I,k){k1().font=I;const M=(function(A){let $=KS.get(A);return $||($=new Map,KS.set(A,$)),$})(I),E=(function(A){const $=A.match(/(\d+(?:\.\d+)?)\s*px/);return $?parseFloat($[1]):16})(I),P=k?(function(A,$){let D=GS.get(A);if(D!==void 0)return D;const R=k1();R.font=A;const H=R.measureText("😀").width;if(D=0,H>$+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=A,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),H-q>.5&&(D=H-q)}return GS.set(A,D),D})(I,E):0;return{cache:M,fontSize:E,emojiCorrection:P}})(t,(l=e.normalized,Bj.test(l)));var l;const a=xl("-",wr("-",i),r),c=8*xl(" ",wr(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const m=null,_=[],b=n?[]:null,g=Array.from({length:e.len});function v(I,k,M,E,P,A,$){P!=="text"&&P!=="space"&&P!=="zero-width-break"&&(p=!1),u.push(k),d.push(M),f.push(E),h.push(P),_.push($),b!==null&&b.push(I)}function y(I,k,M,E,P){const A=wr(I,i),$=xl(I,A,r),D=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:$,R=k==="space"||k==="zero-width-break"?0:$;if(P&&E&&I.length>1){let H="sum-graphemes";Of(I)?H="pair-context":o.preferPrefixWidthsForBreakableRuns&&(H="segment-prefixes");const z=(function(q,Q,X,ue,ge){if(Q.breakableFitAdvances!==void 0)return Q.breakableFitAdvances;const xe=HM(),ke=[];for(const Le of xe.segment(q))ke.push(Le.segment);if(ke.length<=1)return Q.breakableFitAdvances=null,Q.breakableFitAdvances;if(ge==="sum-graphemes"){const Le=[];for(const le of ke){const F=wr(le,X);Le.push(xl(le,F,ue))}return Q.breakableFitAdvances=Le,Q.breakableFitAdvances}if(ge==="pair-context"||ke.length>96){const Le=[];let le=null,F=0;for(const ne of ke){const te=xl(ne,wr(ne,X),ue);if(le===null)Le.push(te);else{const U=le+ne,Y=wr(U,X);Le.push(xl(U,Y,ue)-F)}le=ne,F=te}return Q.breakableFitAdvances=Le,Q.breakableFitAdvances}const ze=[];let qe="",Ue=0;for(const Le of ke){qe+=Le;const le=xl(qe,wr(qe,X),ue);ze.push(le-Ue),Ue=le}return Q.breakableFitAdvances=ze,Q.breakableFitAdvances})(I,A,i,r,H);return void v(I,$,D,R,k,M,z)}v(I,$,D,R,k,M,null)}for(let I=0;I<e.len;I++){g[I]=u.length;const k=e.texts[I],M=e.isWordLike[I],E=e.kinds[I],P=e.starts[I];if(E==="soft-hyphen"){v(k,0,a,a,E,P,null);continue}if(E==="hard-break"){v(k,0,0,0,E,P,null);continue}if(E==="tab"){v(k,0,0,0,E,P,null);continue}const A=wr(k,i);if(E==="text"&&A.containsCJK){const $=zj(k,o),D=s==="keep-all"?Uj($):$;for(let R=0;R<D.length;R++){const H=D[R];y(H.text,"text",P+H.start,M,s==="keep-all"||!Zi(H.text))}continue}y(k,E,P,M,!0)}const C=(function(I,k,M){const E=[];for(let P=0;P<I.length;P++){const A=I[P],$=A.startSegmentIndex<k.length?k[A.startSegmentIndex]:M,D=A.endSegmentIndex<k.length?k[A.endSegmentIndex]:M,R=A.consumedEndSegmentIndex<k.length?k[A.consumedEndSegmentIndex]:M;E.push({startSegmentIndex:$,endSegmentIndex:D,consumedEndSegmentIndex:R})}return E})(e.chunks,g,u.length),L=m===null?null:(function(I,k){const M=(function(P){const A=P.length;if(A===0)return null;const $=new Array(A);let D=!1;for(let X=0;X<A;){const ue=P.charCodeAt(X);let ge=ue,xe=1;if(ue>=55296&&ue<=56319&&X+1<A){const ze=P.charCodeAt(X+1);ze>=56320&&ze<=57343&&(ge=ze-56320+(ue-55296<<10)+65536,xe=2)}const ke=fj(ge);ke!=="R"&&ke!=="AL"&&ke!=="AN"||(D=!0);for(let ze=0;ze<xe;ze++)$[X+ze]=ke;X+=xe}if(!D)return null;let R=0;for(let X=0;X<A;X++){const ue=$[X];if(ue==="L"){R=0;break}if(ue==="R"||ue==="AL"){R=1;break}}const H=new Int8Array(A);for(let X=0;X<A;X++)H[X]=R;const z=1&R?"R":"L",q=z;let Q=q;for(let X=0;X<A;X++)$[X]==="NSM"?$[X]=Q:Q=$[X];Q=q;for(let X=0;X<A;X++){const ue=$[X];ue==="EN"?$[X]=Q==="AL"?"AN":"EN":ue!=="R"&&ue!=="L"&&ue!=="AL"||(Q=ue)}for(let X=0;X<A;X++)$[X]==="AL"&&($[X]="R");for(let X=1;X<A-1;X++)$[X]==="ES"&&$[X-1]==="EN"&&$[X+1]==="EN"&&($[X]="EN"),$[X]!=="CS"||$[X-1]!=="EN"&&$[X-1]!=="AN"||$[X+1]!==$[X-1]||($[X]=$[X-1]);for(let X=0;X<A;X++){if($[X]!=="EN")continue;let ue;for(ue=X-1;ue>=0&&$[ue]==="ET";ue--)$[ue]="EN";for(ue=X+1;ue<A&&$[ue]==="ET";ue++)$[ue]="EN"}for(let X=0;X<A;X++){const ue=$[X];ue!=="WS"&&ue!=="ES"&&ue!=="ET"&&ue!=="CS"||($[X]="ON")}Q=q;for(let X=0;X<A;X++){const ue=$[X];ue==="EN"?$[X]=Q==="L"?"L":"EN":ue!=="R"&&ue!=="L"||(Q=ue)}for(let X=0;X<A;X++){if($[X]!=="ON")continue;let ue=X+1;for(;ue<A&&$[ue]==="ON";)ue++;const ge=(X>0?$[X-1]:q)!=="L"?"R":"L";if(ge===((ue<A?$[ue]:q)!=="L"?"R":"L"))for(let xe=X;xe<ue;xe++)$[xe]=ge;X=ue-1}for(let X=0;X<A;X++)$[X]==="ON"&&($[X]=z);for(let X=0;X<A;X++){const ue=$[X];1&H[X]?ue!=="L"&&ue!=="AN"&&ue!=="EN"||H[X]++:ue==="R"?H[X]++:ue!=="AN"&&ue!=="EN"||(H[X]+=2)}return H})(I);if(M===null)return null;const E=new Int8Array(k.length);for(let P=0;P<k.length;P++)E[P]=M[k[P]];return E})(e.normalized,m);return b!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:C,segments:b}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:C}}function jj(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return qj((function(c,u,d="normal",f="normal"){const h=(function(_){const b=_??"normal";return b==="pre-wrap"?{mode:b,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:b,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(_){return/[\r\f]/.test(_)?_.replace(/\r\n/g,`
|
|
238
|
-
`).replace(/[\r\f]/g,`
|
|
239
|
-
`):_.replace(/\r\n/g,`
|
|
240
|
-
`)})(c):(function(_){if(!hj.test(_))return _;let b=_.replace(pj," ");return b.charCodeAt(0)===32&&(b=b.slice(1)),b.length>0&&b.charCodeAt(b.length-1)===32&&(b=b.slice(0,-1)),b})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(_){if(_.len<=1)return _;const b=[],g=[],v=[],y=[];let C=null,L=!1,I=0,k=!1,M=!1;function E(){C!==null&&(b.push(zo(C)),g.push(L),v.push("text"),y.push(I),C=null)}for(let P=0;P<_.len;P++){const A=_.texts[P],$=_.kinds[P],D=_.isWordLike[P],R=_.starts[P];if($==="text"){const H=vj(A),z=v1(A);if(C!==null&&k&&M){C.push(A),L=L||D,k=k||H,M=z;continue}E(),C=[A],L=D,I=R,k=H,M=z;continue}E(),b.push(A),g.push(D),v.push($),y.push(R)}return E(),{len:b.length,texts:b,isWordLike:g,kinds:v,starts:y}})(VS(p,u,h)):VS(p,u,h);return rt({normalized:p,chunks:Rj(m,h)},m)})(s,Mh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Rg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",ds=(()=>{const e=globalThis;if(e[Rg])return e[Rg];const t={configs:{},controllers:{},revision:Yl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Rg]=t,t})();let qc=null;const XS=ds.revision;function QS(e){var t;return e&&(t=ds.configs[e])!=null?t:null}function ZS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Vj(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Dg(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!Vj(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
241
|
-
`)}return o.length>0?o:null}function Bg(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(qc!=null)return qc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return qc=!!((i=r.getContext)!=null&&i.call(r,"2d")),qc}catch{return qc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=ds.blockEstimateCache.get(r);if(l)return ds.blockEstimateCache.delete(r),ds.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(h,p,m){const _=`${m}\0${p}\0${h}`,b=ds.preparedCache.get(_);if(b)return ds.preparedCache.delete(_),ds.preparedCache.set(_,b),b.prepared;const g=jj(h,p,{whiteSpace:m});for(ds.preparedCache.set(_,{prepared:g});ds.preparedCache.size>240;){const v=ds.preparedCache.keys().next().value;if(!v)break;ds.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const _=(function(b,g){return b.simpleLineWalkFastPath?YS(b,g):(function(v,y){if(v.simpleLineWalkFastPath)return YS(v,y);const{widths:C,lineEndFitAdvances:L,lineEndPaintAdvances:I,kinds:k,breakableFitAdvances:M,discretionaryHyphenWidth:E,tabStopAdvance:P,chunks:A}=v;if(C.length===0||A.length===0)return 0;const $=Mh(),D=$.lineFitEpsilon,R=y+D;let H=0,z=0,q=!1,Q=0,X=0,ue=-1,ge=0,xe=0,ke=null;function ze(){ue=-1,ge=0,xe=0,ke=null}function qe(Y=Q,fe=X,se=z){H++,z=0,q=!1,ze()}function Ue(Y,fe){q=!0,Q=Y+1,X=0,z=fe}function Le(Y,fe,se){q=!0,Q=Y,X=fe+1,z=se}function le(Y,fe){q?(z+=fe,Q=Y+1,X=0):Ue(Y,fe)}function F(Y,fe,se,ce){if(!fe)return;const j=Y==="tab"?0:L[se],G=Y==="tab"?ce:I[se];ue=se+1,ge=z-ce+j,xe=z-ce+G,ke=Y}function ne(Y,fe){const se=M[Y];for(let ce=fe;ce<se.length;ce++){const j=se[ce];q?z+j>R?(qe(),Le(Y,ce,j)):(z+=j,Q=Y,X=ce+1):Le(Y,ce,j)}q&&Q===Y&&X===se.length&&(Q=Y+1,X=0)}function te(Y){if(ke!=="soft-hyphen")return!1;const fe=M[Y];if(fe==null)return!1;const{fitCount:se,fittedWidth:ce}=(function(j,G,re,me,Ae){let Ee=0,ae=G;for(;Ee<j.length;){const Ce=ae+j[Ee];if((Ee+1<j.length?Ce+Ae:Ce)>re+me)break;ae=Ce,Ee++}return{fitCount:Ee,fittedWidth:ae}})(fe,z,y,D,E);return se!==0&&(z=ce,Q=Y,X=se,ze(),se===fe.length?(Q=Y+1,X=0,!0):(qe(Y,se,ce+E),ne(Y,se),!0))}function U(Y){H++,ze()}for(let Y=0;Y<A.length;Y++){const fe=A[Y];if(fe.startSegmentIndex===fe.endSegmentIndex){U();continue}q=!1,z=0,fe.startSegmentIndex,Q=fe.startSegmentIndex,X=0,ze();let se=fe.startSegmentIndex;for(;se<fe.endSegmentIndex;){const ce=k[se],j=ce==="space"||ce==="preserved-space"||ce==="tab"||ce==="zero-width-break"||ce==="soft-hyphen",G=ce==="tab"?Hj(z,P):C[se];if(ce!=="soft-hyphen")if(q){if(z+G>R){const re=z+(ce==="tab"?0:L[se]),me=z+(ce==="tab"?G:I[se]);if(ke==="soft-hyphen"&&$.preferEarlySoftHyphenBreak&&ge<=R){qe(ue,0,xe);continue}if(ke==="soft-hyphen"&&te(se)){se++;continue}if(j&&re<=R){le(se,G),qe(se+1,0,me),se++;continue}if(ue>=0&&ge<=R){if(Q>ue||Q===ue&&X>0){qe();continue}const Ae=ue;qe(Ae,0,xe),se=Ae;continue}if(G>y&&M[se]!==null){qe(),ne(se,0),se++;continue}qe();continue}le(se,G),F(ce,j,se,G),se++}else G>y&&M[se]!==null?ne(se,0):Ue(se,G),F(ce,j,se,G),se++;else q&&(Q=se+1,X=0,ue=se+1,ge=z+E,xe=z+E,ke=ce),se++}if(q){const ce=ue===fe.consumedEndSegmentIndex?xe:z;qe(fe.consumedEndSegmentIndex,0,ce)}}return H})(b,g)})(h,p);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(ds.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});ds.blockEstimateCache.size>4e3;){const h=ds.blockEstimateCache.keys().next().value;if(!h)break;ds.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function zM(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Dg(e.children);return i&&n.paragraph?Bg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Dg(e.children),l=n.headings[i];return r&&l?Bg(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=Dg((o=i[0])==null?void 0:o.children);return r?Bg(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=zM(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 cf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Kj(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(cf(String((d=u.originalCode)!=null?d:"")),cf(String((f=u.updatedCode)!=null?f:"")),cf(String((h=u.code)!=null?h:""))):cf((function(p,m){const _=String(p??"");return m?_:_.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const m=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*m)})(u,r),f=(function(h,p){var m,_;if(!p)return 0;const b=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((_=h?.padding)==null?void 0:_.bottom)=="number"?h.padding.bottom:22;return Math.max(0,b)+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+f:i*(d+1.5))}else s==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(o?40:0)),contentHeight:c,rendererKind:s}}function Gj(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Fg(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=ZS(s.lineHeight,1.5*ZS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Gj(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const Yj=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function JS(e,t={}){var n;const s={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return s;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))Yj.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const Xj=!1;function Bpe(){return Xj}function eC(e,t,n,s){var o;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=s.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const UM=Symbol("MarkstreamMathBlockMinHeightCache");function Fpe(){return jt(UM,null)}const Qj=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Zj=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],Jj=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),qM=["raw","content","code","originalCode","updatedCode"],tC=new WeakMap,nC=new WeakMap;let eV=1;function ri(){return typeof performance<"u"?performance.now():Date.now()}function sC(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Vo(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=tC.get(t);return n||(n=eV++,tC.set(t,n)),String(n)}function oC(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:Vo(t),customMarkdownIt:Vo(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:Vo(e.validateLink),preTransformTokens:Vo(e.preTransformTokens),postTransformTokens:Vo(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function iC(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 rC(e){const t=jM(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function jM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function VM(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 ey(e){const t=String(e??"");return`${t.length}:${VM(t)}`}function b1(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?ey(r):`${r.length}:${VM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Vo(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${Vo(s)}`;const i=Vo(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>b1(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}:${b1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Lp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function KM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Lp(s)?Qr(s,t,n+1):KM(s,t,n+1)).join(",")}`:Lp(e)?Qr(e,t,n):b1(e,t,n)}function tV(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!qM.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${ey(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${Vo(o)}`:Jj.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${KM(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${Vo(o)}`:""}).filter(Boolean).join(";")}function nV(e){return qM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${ey(n)}`:""}).filter(Boolean).join(";")}function Qr(e,t=new WeakMap,n=0){const s=nC.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Vo(o)}`;const r=Vo(o);t.set(o,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>Qr(p,c,u+1)).join("|"):"";return[a.type,nV(d),tV(d,c,u),f.length,h].join(":")})(e,t,n);return nC.set(o,l),l}function GM(e,t){return Qr(e)===Qr(t)}function ty(e,t,n){const s=ri(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ri()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function lC(e,t,n){return ty(t,n,()=>Qr(e))}function YM(e,t,n){return lC(e,n,"stabilizeSignatureMs")===lC(t,n,"stabilizeSignatureMs")}function Wg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function aC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function sV(e,t){return e.length===t.length&&e===t}function ny(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=s[d],h=o[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!sV(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Lp(d)||!Lp(f))return null;const h=ny(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function oV(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=ny(e,t);return n??GM(e,t)}function iV(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return ty(n,"stabilizeSignatureMs",()=>{s=ny(e,t)}),s??YM(e,t,n)}function rV(e,t){const n={};for(const s of Qj){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function lV(e,t){var n;const s=dS(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:W(()=>!1),r=ee(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=ri();function m(){l&&(clearTimeout(l),l=void 0)}function _(){m();const M=t.renderContent.value;r.value!==M&&(r.value=M),p=ri()}Ge([t.renderContent,t.effectiveFinal,i],([M,E,P])=>{r.value!==M&&(!P||E||(function(A,$){if(!A&&$||$.length<=80||$.length<A.length||!$.startsWith(A))return!0;const D=$.slice(A.length);return!!D&&(!!rC(iC($))||!(!D.includes(`
|
|
243
|
-
|
|
244
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(D))||D.endsWith(`
|
|
245
|
-
`)&&!(function(R){const H=iC(R);if(rC(H))return!1;const z=jM(H);return z.length>=2&&z.some(q=>q.trim())})($))})(r.value,M)?_():(function(){if(h+=1,l)return;const A=Math.max(0,(function($){const D=$.parseCoalesceMs;return typeof D=="number"&&Number.isFinite(D)&&D>=0?D:80})(e)-(ri()-p));A<=0?_():l=setTimeout(_,A)})())},{flush:"sync",immediate:!0}),O1(m);const b=W(()=>{var M,E,P,A;return C7(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(A=(P=(E=t.customComponentsMap)==null?void 0:E.value)!=null?P:{},Object.entries(A).map(([$,D])=>{const R=ei($);return D==null||!R||ld(R)||wT.has(R)||od.has(R)?"":R}).filter(Boolean)))}),g=W(()=>{const{key:M,tags:E}=x7(b.value);if(!M)return s;const P=o.get(M);if(P)return P;const A=dS(t.instanceMsgId,{customHtmlTags:E});return o.set(M,A),A}),v=W(()=>{const M=g.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),y=W(()=>{var M,E;const P=(M=e.parseOptions)!=null?M:{},A=t.effectiveFinal.value,$=b.value,D=A!=null,R=$.length>0;return D||R||P.streamParse==null?rt(rt(Lt(rt({},P),{streamParse:(E=P.streamParse)==null||E}),D?{final:A}:{}),R?{customHtmlTags:$}:{}):P}),C=W(()=>{var M;return new Set(((M=y.value.customHtmlTags)!=null?M:[]).map(E=>String(E).trim().toLowerCase()).filter(Boolean))}),L=W(()=>oC(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),I=W(()=>oC(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ge([L,I],([M,E],[P,A])=>{P&&(M===P&&E===A||(_(),E!==A&&(a=[],d="")))},{flush:"sync"});const k=W(()=>{var M,E,P,A,$,D,R,H;if((M=e.nodes)!=null&&M.length)return a=[],d="",Or(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const q=t.debugPerformanceEnabled.value,Q=q?ri():0,X=v.value,ue=L.value,ge=I.value;c&&ue!==c&&(function(fe){var se,ce;(ce=(se=fe.stream)==null?void 0:se.reset)==null||ce.call(se)})(X),u&&ge!==u&&(a=[],d="");const xe=a.length>0&&z.startsWith(d)&&ge===u,ke=q?sC(X):null,ze=q?{}:void 0,qe=ze?Lt(rt({},y.value),{__timing:ze}):y.value,Ue=uM(z,X,qe),Le=q?ri():0,le=q?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let F,ne=q?Wg(Ue.length):void 0,te=0,U=0;if(xe){const fe=q?ri():0;if(le){const se=(function(ce,j,G){if(!j.length)return{nodes:ce,metrics:Wg(ce.length)};const re=(function(Ee,ae,Ce){const Xe=Math.min(Ee.length,ae.length);for(let tt=0;tt<Xe;tt++)if(!iV(ae[tt],Ee[tt],Ce))return tt;return Ee.length===ae.length?-1:Xe})(ce,j,G);if(re<0)return{nodes:j,metrics:{reusedNodeCount:ce.length,dirtyStartIndex:re,stablePrefixNodeCount:ce.length,dirtyTailNodeCount:0}};const me=ce.slice();let Ae=re;for(let Ee=0;Ee<re;Ee++)me[Ee]=j[Ee];for(let Ee=re;Ee<ce.length;Ee++){const ae=j[Ee],Ce=ce[Ee];ae&&YM(ae,Ce,G)&&(me[Ee]=ae,Ae+=1)}return{nodes:me,metrics:{reusedNodeCount:Ae,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:aC(re,ce,j)}}})(Ue,a,le);F=se.nodes,ne=se.metrics}else{const se=(function(ce,j){if(!j.length)return{nodes:ce,metrics:Wg(ce.length)};const G=(function(Ae,Ee){const ae=Math.min(Ae.length,Ee.length);for(let Ce=0;Ce<ae;Ce++)if(!oV(Ee[Ce],Ae[Ce]))return Ce;return Ae.length===Ee.length?-1:ae})(ce,j);if(G<0)return{nodes:j,metrics:{reusedNodeCount:ce.length,dirtyStartIndex:G,stablePrefixNodeCount:ce.length,dirtyTailNodeCount:0}};const re=ce.slice();let me=G;for(let Ae=0;Ae<G;Ae++)re[Ae]=j[Ae];for(let Ae=G;Ae<ce.length;Ae++){const Ee=j[Ae],ae=ce[Ae];Ee&&GM(Ee,ae)&&(re[Ae]=Ee,me+=1)}return{nodes:re,metrics:{reusedNodeCount:me,dirtyStartIndex:G,stablePrefixNodeCount:G,dirtyTailNodeCount:aC(G,ce,j)}}})(Ue,a);F=se.nodes,ne=se.metrics}te=q?ri()-fe:0,U=ne?.dirtyStartIndex==null||ne.dirtyStartIndex<0?F.length:ne.dirtyStartIndex}else F=Ue;le?(function(fe,se,ce=0){for(let j=Math.max(0,ce);j<fe.length;j++)ty(se,"primeSignatureMs",()=>Qr(fe[j]))})(F,le,U):(function(fe,se=0){for(let ce=Math.max(0,se);ce<fe.length;ce++)Qr(fe[ce])})(F,U);const Y=q?ri()-Le:0;if(f+=1,d=z,c=ue,u=ge,a=F,q){const fe=sC(X),se=typeof fe?.total=="number"&&fe.total>((E=ke?.total)!=null?E:0);t.logPerf(se?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(ri()-Q),nodes:F.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:Y,signatureMs:(P=le?.signatureMs)!=null?P:0,stabilizeSignatureMs:(A=le?.stabilizeSignatureMs)!=null?A:0,primeSignatureMs:($=le?.primeSignatureMs)!=null?$:0,signatureCallCount:(D=le?.signatureCallCount)!=null?D:0,stabilizeSignatureCallCount:(R=le?.stabilizeSignatureCallCount)!=null?R:0,primeSignatureCallCount:(H=le?.primeSignatureCallCount)!=null?H:0,stabilizeMs:te},ne??{}),ze?Object.fromEntries(Zj.map(ce=>{var j;return[ce,(j=ze[ce])!=null?j:0]})):{}),fe?{streamMode:fe.lastMode,streamDelta:rV(fe,ke),streamStats:fe}:{}))}return Or(F)});return{effectiveCustomHtmlTags:b,effectiveCustomHtmlTagsSet:C,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:k}}function aV(e){const{isClient:t}=e,n=ee(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((m=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!m)return;var p,m;const _=n.value,b=_.has(f);if(h){if(b)return;const v=new Set(_);return v.add(f),void(n.value=v)}if(!b)return;const g=new Set(_);g.delete(f),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f<c||(h(),o.delete(f));for(const[f,h]of s.entries())f<c||(h.destroy(),s.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function cV(e={}){const t=ee(""),n=ee(""),s=ee(!1),o=uU(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=W(()=>Math.max(0,t.value.length-n.value.length)),a=W(()=>l.value===0),c=W(()=>s.value&&a.value);return P1()&&O1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const cC=/auto|scroll|overlay/i;function uV(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return cC.test(t)||cC.test(n)}function dV(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 fV=Ve({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=W(()=>{var n,s;return r1((s=Oa(e.estimatedPreviewHeightPx))!=null?s:o1(String((n=e.node.code)!=null?n:"")))});return()=>un("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?un("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)"}},[un("div",{class:"flex items-center gap-x-2 overflow-hidden"},[un("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),un("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),un("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},()=>un("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,un("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[un("div",{class:"absolute inset-0"},[un("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),pV=Ve({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=W(()=>{var n,s;return i1((s=Oa(e.estimatedPreviewHeightPx))!=null?s:s1(String((n=e.node.code)!=null?n:"")))});return()=>un("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?un("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)"}},[un("div",{class:"flex items-center gap-x-2 overflow-hidden"},[un("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),un("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},()=>un("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[un("span",{class:"action-icon block"})])))]):null,un("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)"}},[un("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"}})])])}}),hV=["data-custom-id"],mV={class:"m-0 p-0"},gV=["data-probe"],vV=["data-node-index","data-node-type"],XM=fn(Ve(Lt(rt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=$s(),r=jt("markstreamNestedRendererProps",void 0);function l(x){var B,V;const K=s[x];return(function(J){const pe=i?.vnode.props;return!!pe&&(Object.prototype.hasOwnProperty.call(pe,J)||Object.prototype.hasOwnProperty.call(pe,String(J).replace(/[A-Z]/g,ye=>`-${ye.toLowerCase()}`)))})(x)?K:(V=(B=r?.value)==null?void 0:B[x])!=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=W(()=>{return(x=l("mode"))==="chat"||x==="minimal"||x==="docs"?x:"docs";var x}),u=W(()=>{const x=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return x===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:x===!1||c.value==="docs"?"monaco":"pre"}),d=W(()=>a[c.value]),f=W(()=>{var x;return(x=l("showTooltips"))!=null?x:d.value.showTooltips}),h=W(()=>{var x;return(x=l("fade"))!=null?x:d.value.fade}),p=W(()=>{var x;return(x=l("batchRendering"))!=null?x:d.value.batchRendering}),m=W(()=>{var x;return(x=l("initialRenderBatchSize"))!=null?x:d.value.initialRenderBatchSize}),_=W(()=>{var x;return(x=l("renderBatchSize"))!=null?x:d.value.renderBatchSize}),b=W(()=>{var x;return(x=l("renderBatchDelay"))!=null?x:d.value.renderBatchDelay}),g=W(()=>{var x;return(x=l("renderBatchBudgetMs"))!=null?x:d.value.renderBatchBudgetMs}),v=W(()=>{var x;return(x=l("renderBatchIdleTimeoutMs"))!=null?x:d.value.renderBatchIdleTimeoutMs}),y=W(()=>{var x;return(x=l("deferNodesUntilVisible"))!=null?x:d.value.deferNodesUntilVisible}),C=W(()=>{var x;return(x=l("maxLiveNodes"))!=null?x:d.value.maxLiveNodes}),L=W(()=>{var x;return(x=l("liveNodeBuffer"))!=null?x:d.value.liveNodeBuffer}),I=W(()=>{var x;return(x=l("nodeVirtual"))!=null?x:d.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return b.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return C.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return I.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function M(x){o("height-change",x)}function E(x){o("virtual-state-change",x)}function P(x){o("anchor-change",x)}const A=ee(),$=ee(null),D=ee(null),R=ee(null),H=Es({1:null,2:null,3:null,4:null,5:null,6:null}),z=ee(!1),q=new Map,Q=ee(0),X=ee(0),ue=ee({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ge(){var x,B;if(((x=s.virtualScroll)==null?void 0:x.enabled)!==!0)return null;const V=(B=s.virtualScroll)==null?void 0:B.scrollRoot;return xe(typeof V=="function"?V():V)}function xe(x){return x?typeof HTMLElement<"u"&&x instanceof HTMLElement?x:typeof x=="object"&&"value"in x?xe(x.value):typeof x=="object"&&"$el"in x?xe(x.$el):null:null}const{isClient:ke,renderAsFragment:ze,debugPerformanceEnabled:qe,resolvedShowTooltips:Ue,resolvedHtmlPolicy:Le,inheritedSmoothStreaming:le,ownsTypewriterCursor:F}=(function(x){const B=typeof window<"u",V=Zu(),K=jt("markstreamHtmlPolicy",void 0),J=jt("markstreamTypewriterCursor",void 0),pe=jt("markstreamSmoothStreaming",void 0),ye=W(()=>x.renderAsFragment===!0),we=W(()=>!!(x.debugPerformance&&B&&typeof console<"u")),Oe=W(()=>{var Be;if(typeof x.showTooltips=="boolean")return x.showTooltips;const $e=(Be=V.showTooltips)!=null?Be:V["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Me=W(()=>{var Be,$e;return($e=(Be=x.htmlPolicy)!=null?Be:K?.value)!=null?$e:"safe"}),He=W(()=>J?.value!==!0);return{isClient:B,renderAsFragment:ye,debugPerformanceEnabled:we,resolvedShowTooltips:Oe,resolvedHtmlPolicy:Me,inheritedSmoothStreaming:pe,inheritedTypewriterCursor:J,ownsTypewriterCursor:He}})(k),{resolveViewportRoot:ne,resolveScrollContainer:te,isReverseFlexScrollRoot:U,getNormalizedScrollTop:Y,getOffsetTopWithinRoot:fe}=(function(x,B){function V(){var we,Oe;return(Oe=(we=B.scrollRoot)==null?void 0:we.call(B))!=null?Oe:null}function K(we){if(typeof window>"u")return null;const Oe=V();if(Oe)return Oe;const Me=we??x.value;if(!Me)return null;const He=Me.ownerDocument||document,Be=He.scrollingElement||He.documentElement;let $e=Me;for(;$e&&$e!==He.body&&$e!==Be;){if(uV(window.getComputedStyle($e))&&dV($e))return $e;$e=$e.parentElement}return null}function J(we){if(!B.isClient)return!1;try{const Oe=window.getComputedStyle(we);return!!(Oe.display||"").toLowerCase().includes("flex")&&(Oe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function pe(we,Oe,Me){var He,Be;if(Me)return ye(Oe);const $e=we.scrollTop;if(!J(we))return $e;const We=$e<0?-$e:$e;return Math.max(0,((He=we.scrollHeight)!=null?He:0)-((Be=we.clientHeight)!=null?Be:0))-We}function ye(we){var Oe,Me,He,Be,$e;const We=Number((Oe=we.scrollingElement)==null?void 0:Oe.scrollTop),Qe=Number((He=(Me=we.documentElement)==null?void 0:Me.scrollTop)!=null?He:0),Ze=Number(($e=(Be=we.body)==null?void 0:Be.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(We)?We:0,Number.isFinite(Qe)?Qe:0,Number.isFinite(Ze)?Ze:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(we){var Oe,Me,He,Be;const $e=V();if($e)return $e;const We=K((Oe=we??x.value)!=null?Oe:null);if(We)return We;const Qe=(Be=(He=we?.ownerDocument)!=null?He:(Me=x.value)==null?void 0:Me.ownerDocument)!=null?Be:typeof document<"u"?document:null;return Qe?.scrollingElement||Qe?.documentElement||null},isReverseFlexScrollRoot:J,getNormalizedScrollTop:pe,getOffsetTopWithinRoot:function(we,Oe){const Me=Oe.ownerDocument||we.ownerDocument||document;if((function(We,Qe){return We===Qe.documentElement||We===Qe.body||We===Qe.scrollingElement})(Oe,Me))return we.getBoundingClientRect().top+ye(Me);const He=Oe.getBoundingClientRect(),Be=we.getBoundingClientRect(),$e=pe(Oe,Me,!1);return Be.top-He.top+$e}}})(A,{isClient:ke,scrollRoot:ge});Pn("markstreamShowTooltips",Ue),Pn("markstreamHtmlPolicy",Le),Pn("markstreamTypewriter",W(()=>k.typewriter!==!1)),Pn("markstreamFade",W(()=>k.fade!==!1)),Pn("markstreamTypewriterCursor",W(()=>!0)),Pn("markstreamTextStreamState",q),Pn("markstreamStreamVersion",Q),Pn("markstreamParseOptions",W(()=>k.parseOptions)),Pn("markstreamCustomMarkdownIt",W(()=>k.customMarkdownIt));const{smoothStreamingEnabled:se,renderContent:ce,effectiveFinal:j}=(function(x,B){const V=cV(x.smoothStreamingOptions),K=W(()=>{var Me,He,Be;return x.smoothStreaming!==!1&&!((Me=x.nodes)!=null&&Me.length)&&(x.smoothStreaming===!0||!((He=B.inheritedSmoothStreaming)!=null&&He.value))&&(x.smoothStreaming===!0||x.typewriter===!0||((Be=x.maxLiveNodes)!=null?Be:0)<=0)}),J=ee(!B.isClient||x.smoothStreaming===!0);_n(()=>{J.value=!0});const pe=W(()=>J.value&&K.value),ye=W(()=>{var Me;return pe.value?V.visible.value:(Me=x.content)!=null?Me:""}),we=W(()=>{var Me,He;const Be=(Me=x.parseOptions)!=null?Me:{};return(He=x.final)!=null?He:Be.final}),Oe=W(()=>{const Me=we.value;return pe.value&&Me!=null?!!Me&&V.caughtUp.value:Me});return Ge([()=>x.content,()=>x.nodes,pe,we],([Me,He,Be,$e])=>{if(He?.length)return void V.reset("");const We=Me??"";if(!Be)return V.reset(We),void($e&&V.finish({flush:!0}));const Qe=V.source.value;We?We===Qe||(We.startsWith(Qe)?V.enqueue(We.slice(Qe.length)):V.reset(We)):V.reset(""),$e&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:pe,renderContent:ye,requestedFinal:we,effectiveFinal:Oe}})(k,{isClient:ke,inheritedSmoothStreaming:le});Pn("markstreamSmoothStreaming",se);const G=ee(!1);let re="",me=!1,Ae=null;function Ee(){ke&&Ae!=null&&(window.clearTimeout(Ae),Ae=null)}function ae(){G.value=!1,Ee()}function Ce(x,B){if(!qe.value)return;const V=(function(){if(!qe.value)return null;const K=It(Xe),J=It(tt),pe=Math.max(wt,J);if(K<=0&&pe<=0)return null;const ye={total:K,maxPerFrame:pe,byLabel:(we=Xe,Object.fromEntries(Array.from(we.entries()).sort((Oe,Me)=>Me[1]-Oe[1]||Oe[0].localeCompare(Me[0]))))};var we;return Xe.clear(),tt.clear(),wt=0,ye})();console.info(`[markstream-vue][perf] ${x}`,V?Lt(rt({},B),{layoutReads:V}):B)}Ge([ce,()=>s.nodes,j],([x,B,V])=>{const K=x??"";return B?.length||V===!0?(ae(),re=K,void(me=!0)):me?(re&&K.length>re.length&&K.startsWith(re)?(G.value=!0,ke&&(Ee(),Ae=window.setTimeout(()=>{var J;Ae=null,j.value===!0||(J=s.nodes)!=null&&J.length||(ca(),G.value=!1,Pi())},1200))):(K.length<re.length||!K.startsWith(re))&&ae(),void(re=K)):(re=K,void(me=!0))},{flush:"sync",immediate:!0});const Xe=new Map,tt=new Map;let xt=!1,wt=0;function It(x){let B=0;for(const V of x.values())B+=V;return B}function Wt(){wt=Math.max(wt,It(tt)),tt.clear(),xt=!1}function _t(x,B){return(function(V){var K,J;qe.value&&(Xe.set(V,((K=Xe.get(V))!=null?K:0)+1),tt.set(V,((J=tt.get(V))!=null?J:0)+1),xt||(xt=!0,ke&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Wt):typeof queueMicrotask!="function"?setTimeout(Wt,0):queueMicrotask(Wt)))})(x),B()}const Ht=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,$n=(function(x){const B=new Map;return{scope:x,cache:B,clear:()=>B.clear()}})(Ht),Sn=W(()=>`${Ht}:${Q.value}`);Pn(UM,$n);const Vt=ls(()=>k.customId),{effectiveCustomHtmlTagsSet:Kt,mergedParseOptions:Qn,parsedNodes:st}=lV(k,{instanceMsgId:Ht,renderContent:ce,effectiveFinal:j,smoothStreamingEnabled:se,debugPerformanceEnabled:qe,customComponentsMap:Vt,logPerf:Ce});Ge(st,()=>{$n.clear(),Q.value+=1},{immediate:!0});const Nn=W(()=>({customId:k.customId,customHtmlTags:Qn.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:Le.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:Ue.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));Pn("markstreamNestedRendererProps",Nn);const et=W(()=>st.value),Ke=W(()=>st.value.length),Mt=ee(null),Ft=ee(null),vn=ee(null),rn=ee(null),zt=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),ms=!zt&&k.customId?QS(k.customId):null,Ln=W(()=>ms?(XS.value,QS(k.customId)):null),yn=W(()=>{var x;return!!(ke&&!ze.value&&k.customId&&!zt&&((x=Ln.value)!=null&&x.enabled))}),jn=W(()=>{var x;return!!(!ze.value&&((x=s.virtualScroll)!=null&&x.enabled))}),zs=ee(!1);_n(()=>{zs.value=!0});const Pt=W(()=>!!(ke&&jn.value));Pn("markstreamHostScrollManaged",Pt);const bs=W(()=>!!(zs.value&&Pt.value)),pn=W(()=>yn.value||Pt.value),Ns=W(()=>yn.value||bs.value),Lo=W(()=>{var x;return pn.value&&((x=Ln.value)==null?void 0:x.textEstimation)!==!1}),ti=W(()=>{var x;return pn.value&&((x=Ln.value)==null?void 0:x.codeBlockEstimation)!==!1});function Je(){const x=X.value||_t("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=A.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(x)&&x>0?x:0}const it=W(()=>{const x=Je();return x>0?Math.max(1,Math.round(x)):640}),at=W(()=>{var x;return Math.max(1,(x=k.maxLiveNodes)!=null?x:320)}),pt=W(()=>{var x;return!ze.value&&k.nodeVirtual!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&(k.nodeVirtual===!0?st.value.length>0:st.value.length>at.value)}),ni=W(()=>pt.value||yn.value||Pt.value),hi=W(()=>k.viewportPriority!==!1&&!z.value),Ie=Yq(x=>{var B;return ne((B=x??A.value)!=null?B:null)},hi),{requestFrame:_e,cancelFrame:Re,hasIdleCallback:ln,isTestEnv:Ut}=(function(x){const B=x.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=x.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=x.isClient&&typeof window.requestIdleCallback=="function",J=(function(){var pe;if(typeof globalThis>"u"||!("process"in globalThis))return;const ye=(pe=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:pe.value;return ye?.env})();return{requestFrame:B,cancelFrame:V,hasIdleCallback:K,isTestEnv:J?.NODE_ENV==="test"}})({isClient:ke}),{resolvedBatchSize:as,resolvedInitialBatch:Bn,batchingEnabled:vo,incrementalRenderingActive:si,renderedCount:gs,previousRenderContext:il,adaptiveBatchSize:rl,previousBatchConfig:gc}=(function(x,B){var V;const K=W(()=>{var Be;const $e=Math.trunc((Be=x.renderBatchSize)!=null?Be:80);return Number.isFinite($e)?Math.max(0,$e):0}),J=W(()=>{var Be;const $e=Math.trunc((Be=x.initialRenderBatchSize)!=null?Be:K.value);return Number.isFinite($e)?Math.max(0,$e):K.value}),pe=W(()=>!B.renderAsFragment.value&&x.batchRendering!==!1&&K.value>0&&B.isClient&&!B.isTestEnv),ye=ee(0),we=ee({key:x.indexKey,total:0}),Oe=ee(Math.max(1,K.value||1)),Me=W(()=>{var Be;return pe.value&&((Be=x.maxLiveNodes)!=null?Be:0)<=0}),He=ee({batchSize:K.value,initial:J.value,delay:(V=x.renderBatchDelay)!=null?V:16,enabled:Me.value});return{resolvedBatchSize:K,resolvedInitialBatch:J,batchingEnabled:pe,incrementalRenderingActive:Me,renderedCount:ye,previousRenderContext:we,adaptiveBatchSize:Oe,previousBatchConfig:He}})(k,{isClient:ke,isTestEnv:Ut,renderAsFragment:ze}),dt=new Map,he=new Map,Ne=new WeakMap;let Cn=null;const ud=new WeakMap,Us=new Map,oe=ee(0),Se=W(()=>(oe.value,Array.from(dt.entries()).sort((x,B)=>x[0]-B[0]))),Te=ee(null),Fe=ee(null);let nt=null,lt=0,Bt=null;const{activeRestoreAnchor:On,getRelativeScrollTopWithinContainer:Yt,setRelativeScrollTopWithinContainer:Po,resolveAnchorOffset:Oo,clearRestoreReconcile:tn,scheduleRestoreReconcile:Zn,captureRestoreAnchor:Vn,restoreAnchor:_s,getAnchorDrift:Ls}=(function(x){const{isClient:B,containerRef:V,parsedNodeCount:K,requestFrame:J,cancelFrame:pe,resolveScrollContainer:ye,getNormalizedScrollTop:we,getOffsetTopWithinRoot:Oe,isReverseFlexScrollRoot:Me,estimateIndexForOffset:He,estimateHeightRange:Be,getFallbackNodeHeight:$e,clamp:We}=x,Qe=ee(null);let Ze=null,St=[];function ct(){const Tt=ye(),Dt=V.value;if(!Tt||!Dt)return null;const Rt=Tt.ownerDocument||Dt.ownerDocument||document;if(Tt===Rt.documentElement||Tt===Rt.body||Tt===Rt.scrollingElement){const an=Dt.getBoundingClientRect();return Math.max(0,-an.top)}return Math.max(0,we(Tt,Rt,!1)-Oe(Dt,Tt))}function ut(Tt){var Dt;const Rt=ye(),an=V.value;if(!Rt||!an)return;const _o=Math.max(0,Tt),qs=Rt.ownerDocument||an.ownerDocument||document,oi=qs.defaultView||(typeof window<"u"?window:null);if(Rt===qs.documentElement||Rt===qs.body||Rt===qs.scrollingElement){const fr=we(Rt,qs,!0)+an.getBoundingClientRect().top;return void((Dt=oi?.scrollTo)==null||Dt.call(oi,0,Math.max(0,fr+_o)))}eC(Rt,qs,Oe(an,Rt)+_o,{isReverseFlexScrollRoot:fr=>{var pr;return(pr=Me?.(fr))!=null&&pr},getNormalizedScrollTop:we})}function At(Tt){const Dt=K.value,Rt=We(Tt.nodeIndex,0,Math.max(0,Dt-1));return Be(0,Rt)+Math.max(0,Tt.offsetWithinNodePx)}function Ct(){if(Ze!=null&&(pe?.(Ze),Ze=null),B)for(const Tt of St)window.clearTimeout(Tt);St=[]}function Zt(Tt){const Dt=At(Tt),Rt=ct();Rt!=null&&Math.abs(Rt-Dt)<=.5||ut(Dt)}return{activeRestoreAnchor:Qe,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:ut,resolveAnchorOffset:At,clearRestoreReconcile:Ct,applyRestoreAnchor:Zt,scheduleRestoreReconcile:function(){Qe.value&&B&&Ze==null&&(Ze=J?J(()=>{Ze=null,Qe.value&&Zt(Qe.value)}):null,Ze==null&&Qe.value&&Zt(Qe.value))},captureRestoreAnchor:function(){const Tt=ct(),Dt=K.value;if(Tt==null||Dt<=0)return null;const Rt=We(He(Tt+1),0,Dt-1),an=Be(0,Rt),_o=$e(Rt);return{nodeIndex:Rt,offsetWithinNodePx:We(Tt-an,0,Math.max(0,_o-1))}},restoreAnchor:function(Tt){const Dt=K.value;if(Qe.value={nodeIndex:We(Tt.nodeIndex,0,Math.max(0,Dt-1)),offsetWithinNodePx:Math.max(0,Tt.offsetWithinNodePx)},Ct(),Zt(Qe.value),B)for(const Rt of[0,120,280,480])St.push(window.setTimeout(()=>{Qe.value&&Zt(Qe.value)},Rt))},getAnchorDrift:function(Tt){const Dt=ct();return Dt==null?null:Dt-At(Tt)}}})({isClient:ke,containerRef:A,parsedNodeCount:Ke,requestFrame:_e,cancelFrame:Re,resolveScrollContainer:()=>Te.value||te(),getNormalizedScrollTop:Y,getOffsetTopWithinRoot:fe,isReverseFlexScrollRoot:U,estimateIndexForOffset:Sm,estimateHeightRange:dr,getFallbackNodeHeight:bd,clamp:Cs}),{nodeHeights:cs,heightStats:ws,heightTreeSize:ll,heightSumTree:Fh,heightKnownTree:Wh,averageNodeHeight:mi,resetHeightMeasurements:m3,pruneHeightMeasurements:g3,rebuildHeightTrees:dd,recordNodeHeight:v3,removeNodeHeights:y3,exportHeightCache:k3,importHeightCache:b3,fenwickRangeSum:fd}=(function(x={}){const B=Es({}),V=Es({total:0,count:0}),K=ee(0),J=ee([]),pe=ee([]);function ye(){for(const $e of Object.keys(B))delete B[Number($e)];V.total=0,V.count=0,K.value=0,J.value=[],pe.value=[]}function we($e,We,Qe){for(let Ze=We+1;Ze<$e.length;Ze+=Ze&-Ze)$e[Ze]+=Qe}function Oe($e,We){let Qe=0;for(let Ze=We+1;Ze>0;Ze-=Ze&-Ze)Qe+=$e[Ze];return Qe}function Me($e){K.value=$e;const We=new Array($e+1).fill(0),Qe=new Array($e+1).fill(0);for(const[Ze,St]of Object.entries(B)){const ct=Number(Ze),ut=Number(St);!Number.isFinite(ct)||ct<0||ct>=$e||!Number.isFinite(ut)||ut<=0||(we(We,ct,ut),we(Qe,ct,1))}J.value=We,pe.value=Qe}function He($e){if(!Number.isInteger($e)||$e<0)return!1;const We=B[$e];if(!Number.isFinite(We)||We<=0)return!1;if(delete B[$e],V.total=Math.max(0,V.total-We),V.count=Math.max(0,V.count-1),K.value>$e){const Qe=J.value,Ze=pe.value;Qe.length&&Ze.length&&(we(Qe,$e,-We),we(Ze,$e,-1))}return!0}const Be=W(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:B,heightStats:V,heightTreeSize:K,heightSumTree:J,heightKnownTree:pe,averageNodeHeight:Be,resetHeightMeasurements:ye,pruneHeightMeasurements:function($e){if($e<=0)return void ye();let We=0,Qe=0;for(const[Ze,St]of Object.entries(B)){const ct=Number(Ze),ut=Number(St);!Number.isFinite(ct)||ct<0||ct>=$e||!Number.isFinite(ut)||ut<=0?delete B[ct]:(We+=ut,Qe++)}V.total=We,V.count=Qe},rebuildHeightTrees:Me,recordNodeHeight:function($e,We,Qe={}){(function(Ze,St,ct={}){var ut;if(!Number.isFinite(St)||St<=0)return!1;const At=B[Ze];if(At&&(ct.allowShrink===!1&&St<At||Math.abs(St-At)<=1))return!1;if(B[Ze]=St,At?V.total+=St-At:(V.total+=St,V.count++),K.value>Ze){const Ct=J.value,Zt=pe.value;if(Ct.length&&Zt.length)if(At){const Tt=St-At;Tt!==0&&we(Ct,Ze,Tt)}else we(Ct,Ze,St),we(Zt,Ze,1)}ct.notify!==!1&&((ut=x.onHeightRecorded)==null||ut.call(x))})($e,We,Lt(rt({},Qe),{notify:!0}))},removeNodeHeight:function($e,We={}){var Qe;const Ze=He($e);return Ze&&We.notify!==!1&&((Qe=x.onHeightRecorded)==null||Qe.call(x)),Ze},removeNodeHeights:function($e,We={}){var Qe;let Ze=0;for(const St of $e)He(Number(St))&&Ze++;return Ze>0&&We.notify!==!1&&((Qe=x.onHeightRecorded)==null||Qe.call(x)),Ze},exportHeightCache:function(){return Object.entries(B).map(([$e,We])=>({index:Number($e),height:Number(We)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,We)=>$e.index-We.index)},importHeightCache:function($e,We={}){var Qe;if(!Array.isArray($e))return;const Ze=K.value;let St=!1;if(We.mode!=="merge"){const ct=Object.keys(B);if(ct.length>0){for(const ut of ct)delete B[Number(ut)];St=!0}}for(const ct of $e){const ut=Number(ct.index),At=Number(ct.height);if(!Number.isInteger(ut)||ut<0||Ze>0&&ut>=Ze||!Number.isFinite(At)||At<=0)continue;const Ct=B[ut];Ct&&Math.abs(Ct-At)<=1||(B[ut]=At,St=!0)}St&&((function(){let ct=0,ut=0;const At=K.value;for(const[Ct,Zt]of Object.entries(B)){const Tt=Number(Ct),Dt=Number(Zt);!Number.isFinite(Tt)||Tt<0||At>0&&Tt>=At||!Number.isFinite(Dt)||Dt<=0?delete B[Tt]:(ct+=Dt,ut++)}V.total=ct,V.count=ut})(),Ze>0&&Me(Ze),(Qe=x.onHeightRecorded)==null||Qe.call(x))},fenwickRangeSum:function($e,We,Qe){if(Qe<=We)return 0;const Ze=Oe($e,Qe-1);return We<=0?Ze:Ze-Oe($e,We-1)}}})({onHeightRecorded:()=>{Do(),Pt.value&&Nc(),On.value&&Zn(),Fe.value&&ra(),Mn("node-resize")}});function pd(){m3(),Us.clear()}function wy(x){!Number.isInteger(x)||x<0||x>=st.value.length||Us.set(x,_c(x))}function Sy(x,B,V={}){const K=cs[x];v3(x,B,V);const J=cs[x];J&&J>0?wy(x):K&&Us.delete(x)}function Cy(x,B){const V=_t("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,J;return(J=(K=dt.get(x))==null?void 0:K.offsetHeight)!=null?J:0});return V>0?V:_t("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function xy(x,B={}){b3(x,B),hm()}const lr=W(()=>{var x;return!ze.value&&k.deferNodesUntilVisible!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&!pt.value&&!(st.value.length>900)&&hi.value}),Ay=W(()=>!!Ie&&(lr.value||pt.value)),Ty=W(()=>pt.value||Pt.value),{liveNodeBufferResolved:vc,focusIndex:Ro,liveRange:Ss,updateLiveRange:al}=(function(x,B){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:J,clamp:pe}=B,ye=W(()=>{var Me;return Math.max(0,(Me=x.liveNodeBuffer)!=null?Me:60)}),we=ee(0),Oe=Es({start:0,end:0});return{liveNodeBufferResolved:ye,focusIndex:we,liveRange:Oe,updateLiveRange:function(){const Me=V.value;if(!K.value||Me===0)return Oe.start=0,void(Oe.end=Me);const He=Math.min(J.value,Me),Be=ye.value,$e=pe(we.value-Be,0,Math.max(0,Me-He));Oe.start=$e,Oe.end=Math.min(Me,$e+He)}}})(k,{parsedNodeCount:Ke,virtualizationEnabled:pt,maxLiveNodesResolved:at,clamp:Cs}),gi=new Map,cl=new Map,ar=new Map,hd=[],Ni=new Map,cr=new Set,My=ee(0);let Hh=!1;const Ey=W(()=>(My.value,cr.size)),yo=new Map,vi=new Map,Iy=ee(0),zh=W(()=>{Iy.value;let x=0;for(const B of yo.values())x+=Math.max(0,B);return x});let ko=null,Uh=!0,$y=[0],Ny="";function Do(){Uh=!0}const md=W(()=>{if(!pt.value)return st.value.length;const x=vc.value,B=Math.max(Ss.end+x,Bn.value),V=Math.min(st.value.length,B);return Math.max(gs.value,V)});function gd(){Hh||(Hh=!0,queueMicrotask(()=>{Hh=!1,My.value+=1}))}function Ly(x,B,V="node-resize"){if(!ke||typeof window>"u")return null;const K=window.setTimeout(()=>{cr.delete(K)&&gd();try{B()}finally{Mn(V)}},Math.max(0,x));return cr.add(K),gd(),K}function vd(x){ke&&x!=null&&(cr.delete(x)&&gd(),window.clearTimeout(x))}function Py(){if(ke&&typeof window<"u")for(const x of cr)window.clearTimeout(x);cr.size&&(cr.clear(),gd()),hd.length=0,ar.clear()}function _3(x){var B,V;return(V=(B=rn.value)==null?void 0:B[x])!=null?V:null}const{cancelScheduledFocusSync:qh,scheduleFocusSync:yi}=(function(x){const{isClient:B,containerRef:V,virtualizationEnabled:K,requestFrame:J,cancelFrame:pe,syncFocusToScroll:ye}=x;let we=null;function Oe(){var He,Be,$e;return($e=(Be=(He=V.value)==null?void 0:He.ownerDocument)==null?void 0:Be.defaultView)!=null?$e:typeof window<"u"?window:null}function Me(){if(!we)return;const He=Oe();we.viaTimeout?He?He.clearTimeout(we.id):clearTimeout(we.id):pe?.(we.id),we=null}return{cancelScheduledFocusSync:Me,scheduleFocusSync:function(He={}){if(!K.value)return;if(!B)return void ye(!0);if(He.immediate)return Me(),void ye(!0);if(we)return;const Be=()=>{we=null,ye()};if(J)return void(we={id:J(Be),viaTimeout:!1});const $e=Oe();we={id:$e?$e.setTimeout(Be,16):setTimeout(Be,16),viaTimeout:!0}}}})({isClient:ke,containerRef:A,virtualizationEnabled:pt,requestFrame:_e,cancelFrame:Re,syncFocusToScroll:function(x=!1){var B;if(!pt.value)return;const V=Te.value||te();if(!V)return;const K=V.ownerDocument||((B=A.value)==null?void 0:B.ownerDocument)||document,J=K?.defaultView||(typeof window<"u"?window:null),pe=V===K?.documentElement||V===K?.body,ye=st.value.length;if(!pe&&ye>0&&U(V)){const Qe=_t("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),Ze=_t("syncFocusToScroll.scrollTop",()=>V.scrollTop),St=Ze<0?-Ze:Ze,ct=(function(At){var Ct,Zt;const Tt=st.value;if(!Tt.length)return 0;if(At<=0)return Math.max(0,Tt.length-1);if(pn.value){const Rt=(Ct=Yh()[Tt.length])!=null?Ct:0;return zy(Math.max(0,Rt-At))}if(ll.value===Tt.length){const Rt=dr(0,Tt.length);return Sm(Math.max(0,Rt-At))}let Dt=At;for(let Rt=Tt.length-1;Rt>=0;Rt--){const an=(Zt=cs[Rt])!=null?Zt:mi.value;if(Dt<=an)return Rt;Dt-=an}return 0})(Math.max(0,St)+.5*Math.max(0,Qe)),ut=Cs(ct,0,Math.max(0,ye-1));return void((x||Math.abs(ut-Ro.value)>1)&&(Ro.value=ut,al()))}const we=pe?null:_t("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Oe=pe?0:we.top,Me=pe?_t("syncFocusToScroll.viewport.clientHeight",()=>{var Qe,Ze;return(Ze=(Qe=J?.innerHeight)!=null?Qe:V.clientHeight)!=null?Ze:0}):we.bottom,He=Se.value;let Be=null,$e=null;for(const[Qe,Ze]of He){if(!Ze)continue;const St=_t("syncFocusToScroll.slot.getBoundingClientRect",()=>Ze.getBoundingClientRect());St.bottom<=Oe||St.top>=Me||(Be==null&&(Be=Qe),$e=Qe)}if(Be==null||$e==null){const Qe=A.value;if(!Qe)return;const Ze=pe?{top:0}:_t("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),St=_t("syncFocusToScroll.fallback.scrollTop",()=>Y(V,K,pe)),ct=pe?(()=>{const Ct=_t("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Qe.getBoundingClientRect()),Zt=(pe?0:Ze.top)-Ct.top;return Math.max(0,Zt)})():(()=>{const Ct=fe(Qe,V);return Math.max(0,St-Ct)})(),ut=pe?_t("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,Zt,Tt,Dt;return(Dt=(Tt=(Zt=J?.innerHeight)!=null?Zt:(Ct=K?.documentElement)==null?void 0:Ct.clientHeight)!=null?Tt:V.clientHeight)!=null?Dt:0}):_t("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),At=Sm(ct+.5*Math.max(0,ut));return Ro.value=Cs(At,0,Math.max(0,st.value.length-1)),void al()}const We=Math.round((Be+$e)/2);!x&&Math.abs(We-Ro.value)<=1||(Ro.value=Cs(We,0,Math.max(0,st.value.length-1)),al())}}),{visibleNodeIndices:jh,nodeVisibilityHandles:Jl,nodeVisibilityWatchStops:yd,nodeVisibilityFallbackTimers:Oy,clearVisibilityFallback:kd,markNodeVisible:ur,cleanupNodeVisibility:w3,destroyNodeVisibilityState:Vh}=aV({isClient:ke,shouldTrackVisibleNodeIndices:()=>lr.value,shouldCleanupNodeVisibility:()=>pt.value,onNodeMarkedVisible:x=>{pt.value?yi():Ro.value=Cs(x,0,Math.max(0,st.value.length-1))},onNodeVisibilityCleaned:x=>{dt.delete(x)&&uk()}}),{cleanupScrollListener:Ry,setupScrollListener:S3}=(function(x){const{isClient:B,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:J,resolveScrollContainer:pe,scheduleFocusSync:ye,onScroll:we}=x;let Oe=null,Me=null;function He(){Oe&&(Oe(),Oe=null),Me=null,J.value=null}function Be($e){const We=x.getScrollTop?x.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(We)?Math.abs(We):0)}return{cleanupScrollListener:He,setupScrollListener:function(){if(!B)return;if(!(($e=K?.value)!=null?$e:V.value))return void He();var $e;const We=pe();if(!We)return void He();if(J.value===We&&Oe)return;He(),Me=Be(We);const Qe=()=>{if(we?.(),V.value){const Ze=(function(St){const ct=Be(St),ut=Me;Me=ct;const At=Math.max(480,.75*(St.clientHeight||0));return ut==null?ct>At?{immediate:!0}:void 0:Math.abs(ct-ut)>At?{immediate:!0}:void 0})(We);Ze?ye(Ze):ye()}};We.addEventListener("scroll",Qe,{passive:!0}),J.value=We,Oe=()=>{We.removeEventListener("scroll",Qe)}}}})({isClient:ke,virtualizationEnabled:pt,listenerEnabled:Ty,scrollRootElement:Te,resolveScrollContainer:te,scheduleFocusSync:yi,onScroll:function(){const x=Fe.value;if(!x)return;const B=bc();if(!B||(function(K){if(Ac()>=lt)return Bt=null,!1;const J=Bt;if(J==null)return!0;const pe=Math.abs(K.scrollTop-J)<=2;return pe||(Bt=null),pe})(B))return;const V=Qy(B);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,x.distanceFromBottomPx))>32)&&ia("restore"):ia("restore")},getScrollTop:x=>{var B;const V=x.ownerDocument||((B=A.value)==null?void 0:B.ownerDocument)||document,K=x===V.documentElement||x===V.body||x===V.scrollingElement;return _t("scrollListener.getScrollTop",()=>Y(x,V,K))}});function Cs(x,B,V){return Math.min(Math.max(x,B),V)}function Kh(x){return x?.firstElementChild}function Dy(x,B){var V;return x?(V=x.matches)!=null&&V.call(x,B)?x:x.querySelector(B):null}function By(){if(!pn.value)return void(X.value=0);const x=_t("updateExperimentContainerWidth.clientWidth",()=>{var B,V;return(V=(B=A.value)==null?void 0:B.clientWidth)!=null?V:0});X.value=x>0?x:0}let yc=null;function Gh(){yc?.disconnect(),yc=null}const Fy=Mi({loader:()=>Hn(null,null,function*(){return(yield ao(()=>import("./index8-Dca1sG3X.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:RM,delay:0,suspensible:!1});function Wy(x){return x===Fy}const Hy=W(()=>u.value==="pre"?wo:u.value==="shiki"?Fy:$g),ul=W(()=>{const x=st.value;if(!x.length||!pn.value)return x.map(()=>null);const B=X.value||_t("estimatedNodeHeights.clientWidth",()=>{var V;return((V=A.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(B)||B<=0?x.map(()=>null):x.map((V,K)=>{const J=cs[K],pe=typeof J=="number"&&J>0;if(Lo.value&&!pe){const we=zM(V,B,ue.value);if(we)return we}if(ti.value&&V.type==="code_block"){const we=(function(Oe){if(Oe.type!=="code_block")return null;const Me=Sk(Oe,Td(Oe));return Wy(Me)?"markdown":Me===wo?"pre":Me===Hy.value||Me===$g?"monaco":null})(V);if(we==="monaco"||we==="markdown"||we==="pre")return Kj(V,{rendererKind:we,monacoOptions:k.codeBlockMonacoOptions,showHeader:((ye=k.codeBlockProps)==null?void 0:ye.showHeader)!==!1})}var ye;return null})});function bd(x){var B;const V=cs[x];if(Number.isFinite(V)&&V>0)return V;const K=(B=ul.value[x])==null?void 0:B.height;return Number.isFinite(K)&&K>0?K:Math.max(mi.value,(function(J){var pe,ye,we,Oe,Me,He,Be,$e,We,Qe,Ze,St,ct;const ut=st.value[J];if(!ut||typeof ut!="object")return 32;const At=String((pe=ut.type)!=null?pe:""),Ct=Je()||640;switch(At){case"heading":return 44;case"paragraph":return ea(String((we=(ye=ut.raw)!=null?ye:ut.content)!=null?we:""),Ct,34);case"list":{const Zt=Array.isArray(ut.items)?ut.items.length:1;return Math.max(48,30*Zt+12)}case"list_item":return ea(String((Me=(Oe=ut.raw)!=null?Oe:ut.content)!=null?Me:""),Ct,34);case"blockquote":return ea(String((Be=(He=ut.raw)!=null?He:ut.content)!=null?Be:""),Ct,56);case"table":{const Zt=Array.isArray(ut.rows)?ut.rows.length:Array.isArray(ut.children)?ut.children.length:3;return Math.max(120,38*Zt+48)}case"code_block":return ea(String((We=($e=ut.code)!=null?$e:ut.raw)!=null?We:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return ea(String((Ze=(Qe=ut.raw)!=null?Qe:ut.content)!=null?Ze:""),Ct,96);case"thematic_break":return 24;default:return ea(String((ct=(St=ut.raw)!=null?St:ut.content)!=null?ct:""),Ct,40)}})(x))}function ea(x,B,V,K=22){const J=String(x??"");if(!J)return V;const pe=Math.max(18,Math.floor(Math.max(320,B)/8)),ye=J.split(/\r?\n/).length,we=Math.ceil(J.length/pe),Oe=Math.max(1,ye,we);return Math.max(V,Math.ceil(Oe*K+12))}function kc(x){const B=Number(x);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function Yh(){var x,B;const V=st.value.length,K=kc(X.value||_t("getFallbackHeightPrefix.clientWidth",()=>{var we;return((we=A.value)==null?void 0:we.clientWidth)||0})),J=((x=s.virtualScroll)==null?void 0:x.measurementKey)==null?"":String(s.virtualScroll.measurementKey),pe=[V,ws.count,Math.round(ws.total),Math.round(100*mi.value),J,K,pn.value?1:0,XS.value,Q.value].join(":");if(!Uh&&Ny===pe)return $y;const ye=new Array(V+1);ye[0]=0;for(let we=0;we<V;we++)ye[we+1]=ye[we]+(pn.value?bd(we):(B=cs[we])!=null?B:mi.value);return $y=ye,Ny=pe,Uh=!1,ye}function zy(x){var B,V;const K=st.value.length;if(K<=0||x<=0)return 0;const J=Yh();if(x>=((B=J[K])!=null?B:0))return K-1;let pe=0,ye=K-1,we=K-1;for(;pe<=ye;){const Oe=pe+ye>>1;((V=J[Oe+1])!=null?V:0)>=x?(we=Oe,ye=Oe-1):pe=Oe+1}return we}function dr(x,B){var V,K;if(x>=B)return 0;if(pn.value)return(function(ye,we){var Oe,Me;const He=st.value.length,Be=Cs(Math.trunc(ye),0,He),$e=Cs(Math.trunc(we),Be,He);if(Be>=$e)return 0;const We=Yh();return((Oe=We[$e])!=null?Oe:0)-((Me=We[Be])!=null?Me:0)})(x,B);if(ll.value!==st.value.length){let ye=0;for(let we=x;we<B;we++)ye+=(V=cs[we])!=null?V:mi.value;return ye}const J=Fh.value,pe=Wh.value;if(!J.length||!pe.length){let ye=0;for(let we=x;we<B;we++)ye+=(K=cs[we])!=null?K:mi.value;return ye}return fd(J,x,B)+(B-x-fd(pe,x,B))*mi.value}Ge(()=>st.value.length,x=>{Do(),x<=0?pd():(x<ll.value&&g3(x),x!==ll.value&&dd(x))},{immediate:!0});const C3=W(()=>{if(!pt.value)return st.value.map((K,J)=>({node:K,index:J}));const x=st.value.length,B=Cs(Ss.start,0,x),V=Cs(Ss.end,B,x);return st.value.slice(B,V).map((K,J)=>({node:K,index:B+J}))}),Xh=W(()=>pt.value?dr(0,Math.min(Ss.start,st.value.length)):0),Qh=W(()=>{if(!pt.value)return 0;const x=st.value.length;return dr(Math.min(Ss.end,x),x)});function Uy(){if(!pn.value)return 0;let x=0;const B=ul.value;for(let V=0;V<B.length;V++){if(!B[V])continue;const K=cs[V];Number.isFinite(K)&&K>0||x++}return x}function qy(){const x=st.value.length;return{totalNodes:x,measuredCount:ws.count,estimatedCount:Uy(),averageNodeHeight:mi.value,topSpacerHeight:Xh.value,bottomSpacerHeight:Qh.value,estimatedTotalHeight:dr(0,x),width:dl()}}function x3(){const x=st.value,B=qy();return Lt(rt({},B),{probe:{paragraphReady:!!ue.value.paragraph,listItemReady:!!ue.value.listItem,listWrapperOverhead:ue.value.listWrapperOverhead,headingReadyLevels:Object.entries(ue.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:x.map((V,K)=>{var J,pe,ye,we,Oe,Me,He,Be,$e;return{index:K,type:V.type,estimateKind:(pe=(J=ul.value[K])==null?void 0:J.kind)!=null?pe:null,rendererKind:(we=(ye=ul.value[K])==null?void 0:ye.rendererKind)!=null?we:null,estimatedHeight:(Me=(Oe=ul.value[K])==null?void 0:Oe.height)!=null?Me:null,estimatedContentHeight:(Be=(He=ul.value[K])==null?void 0:He.contentHeight)!=null?Be:null,measuredHeight:($e=cs[K])!=null?$e:null}})})}function Zh(){return s.indexKey!=null?String(s.indexKey):jn.value?`virtual-${Rn()}`:"markdown-renderer"}function jy(x){const B=String(x),V=`${Zh()}-`;if(!B.startsWith(V))return null;const K=B.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const J=Number(K[1]);return!Number.isInteger(J)||J<0||J>=st.value.length?null:J}function Rn(){var x,B,V;const K=(x=s.virtualScroll)==null?void 0:x.sessionKey;return String(K!=null&&K!==""?K:(V=(B=s.indexKey)!=null?B:k.customId)!=null?V:Ht)}function us(){var x;const B=(x=s.virtualScroll)==null?void 0:x.threadKey;return B==null||B===""?void 0:String(B)}function Jh(x){var B;return(x??"")===((B=us())!=null?B:"")}function A3(){var x;const B=(x=s.virtualScroll)==null?void 0:x.measurementKey;return B==null?"":String(B)}function T3(){var x,B;const V=u.value,K=V==="monaco"?k.codeBlockMonacoOptions:void 0,J=k.codeBlockProps,pe=V==="shiki";return[k.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",vs(k.codeBlockMinWidth),vs(k.codeBlockMaxWidth),...pe?[Tp((x=J?.themes)!=null?x:k.themes,(B=J?.langs)!=null?B:k.langs)]:[],vs(K?.fontSize),vs(K?.lineHeight),vs(K?.fontFamily),vs(K?.tabSize),vs(K?.MAX_HEIGHT),vs(K?.wordWrap),vs(K?.wrappingIndent),vs(K?.padding),vs(J?.showHeader),vs(J?.showCopyButton),vs(J?.showExpandButton),vs(J?.showPreviewButton),vs(J?.showCollapseButton),vs(J?.showFontSizeButtons)].join("\0")}function Li(){return[A3(),T3()].join("\0")}function dl(){return Je()}const _d=W(()=>kc(dl())),bo=W(()=>[Li(),_d.value].join("\0")),M3=W(()=>{var x;return jn.value?["virtual",(x=us())!=null?x:"",Rn(),bo.value].join("\0"):s.indexKey});function ta(){Iy.value+=1}function em(x){return!(!x||!Number.isInteger(x.index)||x.index<0||x.index>=st.value.length||x.sessionKey!==Rn()||x.threadKey!==us()||x.layoutEpochKey!==bo.value)}function Vy(x){const B=String(x),V=vi.get(B);return V?em(V)?V.index:null:jy(B)}function Ky(x="async-node"){(yo.size||vi.size)&&(yo.clear(),vi.clear(),ta(),Mn(x))}const na=jt(e1,null),tm={reportHeight(x,B){if(!Pt.value)return;const V=Vy(x);if(V==null)return;const K=gi.get(V);if(!K)return;const J=Number(B),pe=Cy(V,K);Sy(V,Number.isFinite(J)&&J>0?Math.max(J,pe||0):pe)},markPending(x){if(!Pt.value)return;const B=jy(x);B!=null&&(function(V,K){var J;const pe=vi.get(V);if(pe&&em(pe))return yo.set(V,Math.max(0,(J=yo.get(V))!=null?J:0)+1),ta(),void Mn("async-node");yo.set(V,1),vi.set(V,(function(ye){return{index:ye,sessionKey:Rn(),threadKey:us(),layoutEpochKey:bo.value}})(K)),ta(),Mn("async-node")})(String(x),B)},markSettled(x){if(!Pt.value)return;const B=String(x),V=Vy(x);(V!=null||(function(K){return yo.has(String(K))})(B))&&(function(K){var J;const pe=(J=yo.get(K))!=null?J:0;return!(pe<=0||(pe<=1?(yo.delete(K),vi.delete(K)):yo.set(K,pe-1),ta(),pe===1&&Mn("async-node"),0))})(B)&&V!=null&&Pi()}};function E3(){let x=0;for(const B of gi.values())x+=_t("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=B?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,x))}Pn(e1,{reportHeight(x,B){tm.reportHeight(x,B),na?.reportHeight(x,B)},markPending(x){tm.markPending(x),na?.markPending(x)},markSettled(x){tm.markSettled(x),na?.markSettled(x)}});let nm,sm=null,sa=null;function wd(x){return x!==!1&&x!=null&&x!==""}function Gy(){return pt.value?(function(){if(!pt.value)return!0;const x=st.value.length,B=Cs(Ss.start,0,x),V=Cs(Ss.end,B,x);if(B>=V)return!0;for(let K=B;K<V;K++)if(!dt.has(K)||Cm(K)&&!gi.has(K))return!1;return!0})():gs.value>=md.value}function om(){return j.value===!0&&!G.value&&zh.value===0&&cr.size===0&&Ni.size===0&&ko==null&&Gy()}function Yy(){var x,B;if(((x=s.virtualScroll)==null?void 0:x.settleMode)!=="manual"||sm===Rn()&&nm===us())return!0;const V=(B=s.virtualScroll)==null?void 0:B.settledToken;return!!wd(V)&&sa===Lc(V)}function im(){return om()&&Yy()}function I3(x,B){return B.totalNodes<=0?x==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?x==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function fl(x="manual",B){const V=qy(),K=(function(J){return J||(j.value!==!0?st.value.length>0?"streaming":"estimating":!Gy()||Ni.size>0||ko!=null?"measuring":im()?"settled":"settling")})(B);return{sessionKey:Rn(),threadKey:us(),phase:K,nodeCount:V.totalNodes,liveRange:{start:Ss.start,end:Ss.end},renderedCount:gs.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:E3(),totalHeight:Xy(),width:V.width,final:j.value===!0,stable:im(),confidence:I3(K,V),reason:x}}function bc(){const x=Te.value||te(),B=A.value;if(!x||!B)return null;const V=x.ownerDocument||B.ownerDocument||document,K=x===V.documentElement||x===V.body||x===V.scrollingElement,J=_t("getScrollBox.scrollTop",()=>Y(x,V,K)),pe=_t("getScrollBox.scrollHeight",()=>{var we,Oe,Me,He,Be;return K?Math.max((Oe=(we=V.documentElement)==null?void 0:we.scrollHeight)!=null?Oe:0,(He=(Me=V.body)==null?void 0:Me.scrollHeight)!=null?He:0,(Be=x.scrollHeight)!=null?Be:0):x.scrollHeight}),ye=_t("getScrollBox.clientHeight",()=>{var we;return K?((we=V.documentElement)==null?void 0:we.clientHeight)||x.clientHeight||0:x.clientHeight});return{root:x,doc:V,isViewportRoot:K,scrollTop:J,scrollHeight:pe,clientHeight:ye}}function Xy(){const x=st.value.length,B=Math.max(0,dr(0,x)),V=_t("getRendererLogicalHeight.offsetHeight",()=>{var J,pe;return(pe=(J=A.value)==null?void 0:J.offsetHeight)!=null?pe:0}),K=Math.max(0,V>0?V:_t("getRendererLogicalHeight.scrollHeight",()=>{var J,pe;return(pe=(J=A.value)==null?void 0:J.scrollHeight)!=null?pe:0}));return x<=0?Math.ceil(V):pt.value?B>0?Math.max(1,Math.ceil(B),(function(){let J=Xh.value+Qh.value;for(const pe of dt.values())pe&&(J+=Math.max(0,_t("getVirtualizedDomLogicalHeight.offsetHeight",()=>pe.offsetHeight||0)));return Math.ceil(Math.max(0,J))})(),(function(J,pe){return J<=0||pe<=0?0:pe<=J+Math.max(512,.05*J)?Math.ceil(pe):0})(B,K)):Math.max(1,Math.ceil(K)):Pt.value?B>0||ws.count>0||Uy()>0?(si.value&&gs.value,Math.max(1,Math.ceil(K),Math.ceil(B))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(B))}function Qy(x){const B=A.value;if(!B)return null;const V=_t("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(J){return J.isViewportRoot?J.clientHeight:_t("getViewportBottomInRoot.getBoundingClientRect",()=>J.root.getBoundingClientRect().bottom)})(x)-V.bottom}function $3(x={}){const B=x.requireViewport!==!1,V=(function(pe=64){const ye=bc(),we=A.value;if(!ye||!we)return!1;const Oe=(function(He){if(He.isViewportRoot)return{top:0,bottom:He.clientHeight};const Be=_t("getVirtualViewportRect.getBoundingClientRect",()=>He.root.getBoundingClientRect());return{top:Be.top,bottom:Be.bottom}})(ye),Me=_t("isRendererNearVirtualViewport.getBoundingClientRect",()=>we.getBoundingClientRect());return Me.bottom>=Oe.top-pe&&Me.top<=Oe.bottom+pe})();if(B&&!V)return null;const K=(function(){const pe=bc(),ye=A.value;if(!pe||!ye||Math.max(0,pe.scrollHeight-pe.scrollTop-pe.clientHeight)>64)return null;const we=Qy(pe);return we==null?null:we>=-8&&we<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,we)}:null})();if(K)return{anchor:K,captured:!0};const J=Vn();if(J)return{anchor:{type:"node",nodeIndex:J.nodeIndex,offsetWithinNodePx:J.offsetWithinNodePx},captured:V};if(x.allowFallback===!0){const pe=(function(){const ye=st.value.length;return ye<=0?null:{type:"node",nodeIndex:Cs(Ro.value,0,Math.max(0,ye-1)),offsetWithinNodePx:0}})();return pe?{anchor:pe,captured:!1}:null}return null}function rm(x){let B=2166136261;for(let V=0;V<x.length;V++)B^=x.charCodeAt(V),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function N3(x,B){let V=x;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 L3=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Sd(x,B=new WeakSet,V=0){if(x==null||typeof x=="number"||typeof x=="boolean")return String(x);if(typeof x=="string")return`s:${(function(K){const J=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${rm(J)}`})(x)}`;if(typeof x=="function")return"fn";if(typeof x!="object")return typeof x;if(B.has(x))return"cycle";if(V>=6)return"max-depth";B.add(x);try{if(Array.isArray(x)){if(x.length<=160){const Me=[];for(let He=0;He<x.length;He++)Me.push(Sd(x[He],B,V+1));return`a:${x.length}:${Me.join(",")}`}const pe=[],ye=[],we=Math.max(0,x.length-32);let Oe=2166136261;for(let Me=0;Me<x.length;Me++){const He=Sd(x[Me],B,V+1);Oe=N3(Oe,He),Me<32&&pe.push(He),Me>=we&&ye.push(He)}return[`a:${x.length}`,`h=${pe.join(",")}`,`t=${ye.join(",")}`,`all=${(Oe>>>0).toString(36)}`].join(":")}const K=x,J=Object.keys(K).filter(pe=>{const ye=K[pe];return pe!=="parent"&&pe!=="el"&&pe!=="component"&&(ye==null||typeof ye=="string"||typeof ye=="number"||typeof ye=="boolean"||L3.has(pe))}).sort();return`o:${J.length}:${J.map(pe=>`${pe}=${Sd(K[pe],B,V+1)}`).join(";")}`}finally{B.delete(x)}}let Zy=-1,lm="";function _c(x){const B=st.value[x];return B?rm(Sd(B)):""}function am(){const x=Q.value;if(Zy===x)return lm;let B=2166136261;for(let V=0;V<st.value.length;V++){const K=_c(V);for(let J=0;J<K.length;J++)B^=K.charCodeAt(J),B=Math.imul(B,16777619)}return lm=(B>>>0).toString(36),Zy=x,lm}function oa(x,B={}){var V;const K=B.includeHeightCache===!0,J=(V=B.includeContentHash)!=null?V:K,pe=K?(function(we){const Oe=(function(){var Ze,St;const ct=Number((St=(Ze=s.virtualScroll)==null?void 0:Ze.heightCacheLimit)!=null?St:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(Oe)||we.length<=Oe)return we;const Me=new Map,He=Ze=>{!Ze||Me.size>=Oe||Me.set(Ze.index,Ze)},Be=st.value.length,$e=Cs(Ss.start-2*vc.value,0,Be),We=Cs(Ss.end+2*vc.value,$e,Be);for(const Ze of we)Ze.index>=$e&&Ze.index<We&&He(Ze);const Qe=Math.max(1,Math.ceil(we.length/Oe));for(let Ze=0;Ze<we.length&&Me.size<Oe;Ze+=Qe)He(we[Ze]);for(let Ze=we.length-1;Ze>=0&&Me.size<Oe;Ze-=Qe)He(we[Ze]);return Array.from(Me.values()).sort((Ze,St)=>Ze.index-St.index).slice(0,Oe)})(k3().map(we=>{var Oe;const Me=st.value[we.index];return Me?Lt(rt({},we),{nodeType:String((Oe=Me.type)!=null?Oe:""),signature:_c(we.index)}):null}).filter(we=>!!we)):[],ye=$3({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ye||pe.length||B.includeEmptyState===!0?Lt(rt({sessionKey:x.sessionKey,threadKey:x.threadKey},ye?{anchor:ye.anchor,anchorCaptured:ye.captured}:{anchorCaptured:!1}),{metrics:x,width:x.width,contentHash:J?am():void 0,measurementKey:Li()||void 0,heightCache:pe.length?pe:void 0}):null}function cm(x){var B,V;const K=bc();if(!K)return;const J=(function(we){const Oe=A.value;if(!Oe)return null;const Me=fe(Oe,we.root),He=st.value.length,Be=_t("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Oe.offsetHeight||0),$e=Math.max(0,Be>0?Be:He>0?_t("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Oe.scrollHeight||0):0),We=Xy();return Me+Math.max($e,We)})(K);if(J==null)return;const pe=Math.max(0,x.distanceFromBottomPx),ye=Math.max(0,J-K.clientHeight-pe);(function(we){lt=Ac()+120,Bt=we})(ye),K.isViewportRoot?(V=(B=K.doc.defaultView)==null?void 0:B.scrollTo)==null||V.call(B,0,ye):eC(K.root,K.doc,ye,{isReverseFlexScrollRoot:U,getNormalizedScrollTop:Y})}const um=[];function Jy(){if(ke)for(nt!=null&&(Re?.(nt),nt=null);um.length;){const x=um.pop();x!=null&&window.clearTimeout(x)}}function ia(x){const B=!!Fe.value;Fe.value=null,lt=0,Bt=null,Jy(),B&&x&&Mn(x)}function ra(){if(!Fe.value||!ke||nt!=null)return;const x=()=>{nt=null;const B=Fe.value;B&&cm(B)};nt=_e?_e(x):null,nt==null&&x()}function ek(x,B={}){const V=st.value.length;return V<=0?[]:x.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(J){var pe;const ye=st.value[J.index];return!(!ye||J.nodeType&&J.nodeType!==String((pe=ye.type)!=null?pe:"")||J.signature&&J.signature!==_c(J.index))})(K))}function tk(x){const B=kc(dl()),V=kc(x);return B!==-1&&V!==-1&&B===V}function dm(x){var B;const V=Number(x?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((B=x?.metrics)==null?void 0:B.width);return Number.isFinite(K)&&K>0?K:null}function nk(x){var B;return x.sessionKey===Rn()&&!!Jh(x.threadKey)&&((B=x.measurementKey)!=null?B:"")===Li()&&!!tk(dm(x))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(sk(V)?K.some(J=>!!(J.nodeType||J.signature)):K.some(J=>!!J.signature))})(x)}function sk(x){return!!(x.contentHash&&x.contentHash===am())}function P3(x){return!sk(x)}let pl=null,hl=null,Cd=null,wc=null,Sc=null;function fm(x){var B;const V=x.map(J=>{var pe,ye;return[J.index,Math.round(10*J.height),(pe=J.nodeType)!=null?pe:"",(ye=J.signature)!=null?ye:""].join("")}).join(""),K=kc(dl());return[(B=us())!=null?B:"",Rn(),Li(),st.value.length,K,x.length,rm(V)].join(":")}function ok(x=(B=>(B=s.virtualScroll)==null?void 0:B.heightCache)()){if(!Pt.value||!x?.length||st.value.length<=0||!tk((B=s.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const V=ek(x,{requireSignature:!0});if(!V.length)return!1;const K=fm(V);return K===pl?(hl="standalone",!0):(xy(V,{mode:"merge"}),Do(),pl=K,hl="standalone",Mc(),Mn("restore"),!0)}function pm(x,B={}){var V,K,J;if(!Pt.value||!x||x.sessionKey!==Rn()||!Jh(x.threadKey)||st.value.length<=0)return!1;const pe=!!((V=x.heightCache)!=null&&V.length)&&!xd(),ye=!x.anchor||x.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:x.anchor,we=B.restoreAnchor===!0&&!!ye&&!xd()&&Number(dm(x))>0;let Oe=!1;if((K=x.heightCache)!=null&&K.length&&nk(x)){const He=ek(x.heightCache,{requireCompatibilityMetadata:!x.contentHash,requireSignature:P3(x)});He.length&&(xy(He,{mode:"merge"}),Do(),pl=fm(He),hl="restore",Mc(),Oe=!0)}if(pe||we)return!1;if(!B.restoreAnchor||!ye)return Oe&&Mn("restore"),!0;const Me=(function(He,Be){var $e;const We=He.anchor,Qe=We?We.type==="bottom"?`bottom:${Math.round(We.distanceFromBottomPx)}`:`node:${We.nodeIndex}:${Math.round(We.offsetWithinNodePx)}`:"none";return[($e=us())!=null?$e:"",Rn(),Li(),_d.value,Be,Qe].join(":")})(x,(J=B.restoreToken)!=null?J:"imperative");return Cd===Me?(Oe&&Mn("restore"),!0):(Cd=Me,(function(He){const Be=()=>{if(He.type==="node")return ia(),void _s({nodeIndex:He.nodeIndex,offsetWithinNodePx:He.offsetWithinNodePx});if(tn(),On.value=null,Fe.value=He,Jy(),cm(He),ke)for(const $e of[0,120,280,480])um.push(window.setTimeout(()=>{const We=Fe.value;We&&cm(We)},$e))};(function($e){if(!pt.value)return!1;const We=st.value.length;return!(We<=0||(Ro.value=$e.type==="node"?Cs($e.nodeIndex,0,We-1):We-1,al(),0))})(He)?vt(Be):Be()})(ye),Mn("restore"),!0)}function xd(){const x=dl();return Number.isFinite(x)&&x>0}function ik(x){var B;return x.sessionKey===Rn()&&!!Jh(x.threadKey)&&(st.value.length<=0||!(!((B=x.heightCache)!=null&&B.length)||xd())||!(!(x.anchor&&Number(dm(x))>0)||xd()))}function hm(){Us.clear();for(const x of Object.keys(cs)){const B=Number(x);Number.isInteger(B)&&B>=0&&B<st.value.length&&wy(B)}}function Cc(){ko!=null&&(Re?.(ko),ko=null),xm()}function rk(){return!ke||Ut?Promise.resolve():new Promise(x=>{let B=!1,V=null;const K=()=>{B||(B=!0,V!=null&&window.clearTimeout(V),x())};if(_e)return _e(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function mm(x,B=us(),V=bo.value){return Rn()===x&&us()===B&&bo.value===V}function gm(){return Hn(this,arguments,function*(x={}){var B,V,K,J,pe;const ye=Rn(),we=us(),Oe=bo.value,Me=(B=x.frames)!=null?B:2,He=(V=x.timeoutMs)!=null?V:120,Be=(K=x.reason)!=null?K:"manual",$e=x.expectedSettledTokenKey,We=x.flushPendingTimers===!0,Qe=fl(Be),Ze=()=>Lt(rt({},Qe),{phase:Qe.final?"settling":Qe.phase,stable:!1,confidence:Qe.confidence==="final"?"mixed":Qe.confidence,reason:Be}),St=()=>mm(ye,we,Oe)&&($e==null||Tc()===$e);for(let Ct=0;Ct<Me;Ct++){if(yield vt(),!St()||(yield rk(),!St()))return Ze();Pi(),Cc()}if(yield(function(Ct){return!ke||Ct<=0?Promise.resolve():new Promise(Zt=>window.setTimeout(Zt,Ct))})(He),!St()||(We&&Py(),Pi(),Cc(),!St()))return Ze();const ct=om();ct&&(sm=ye,nm=we,((J=s.virtualScroll)==null?void 0:J.settleMode)==="manual"&&$e!=null&&wd((pe=s.virtualScroll)==null?void 0:pe.settledToken)&&Tc()===$e&&(sa=Lc(s.virtualScroll.settledToken)));const ut=St()&&ct&&Yy(),At=fl(Be,ut?"final":void 0);return _m(At,!0),At})}let vm="content",ml=null,gl=null,ym=0,xc=null,la=null,km=null,bm=null;function Ac(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function lk(x){var B,V;const K=xc;if(!K)return!0;const J=(V=(B=s.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?V:1;return Math.abs(x.totalHeight-K.totalHeight)>J||x.sessionKey!==K.sessionKey||x.phase!==K.phase||x.stable!==K.stable||x.final!==K.final||x.threadKey!==K.threadKey||x.nodeCount!==K.nodeCount||x.measuredCount!==K.measuredCount||x.width!==K.width}function vs(x){if(x==null)return"";if(typeof x=="string"||typeof x=="number"||typeof x=="boolean")return String(x);try{return JSON.stringify(x)}catch{return String(x)}}function Tc(x=(B=>(B=s.virtualScroll)==null?void 0:B.settledToken)()){return vs(x)}function ak(x,B){var V,K;return[x,B.sessionKey,(V=B.threadKey)!=null?V:"",Li(),am(),vs((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Mc(){km=null,bm=null,la=null}function O3(x){const B=x.heightCache;return B?.length?fm(B):""}function Ec(x){var B,V,K;const J=x.metrics,pe=x.anchor?(ye=x.anchor).type==="bottom"?`bottom:${Math.round(ye.distanceFromBottomPx)}`:`node:${ye.nodeIndex}:${Math.round(ye.offsetWithinNodePx)}`:"none";var ye;return[x.sessionKey,(B=x.threadKey)!=null?B:"",(V=x.measurementKey)!=null?V:Li(),(K=x.contentHash)!=null?K:"",O3(x),pe,x.anchorCaptured?1:0,J.liveRange.start,J.liveRange.end,J.renderedCount,J.nodeCount,Math.round(J.totalHeight),Math.round(J.width),J.phase,J.stable?1:0].join("\0")}function _m(x,B=!1){if(!Pt.value||(function(ye=!1){return!ye&&jn.value&&!bs.value})(B))return;const V=B||lk(x),K=(function(ye,we=!1){return we||ye.stable||ye.phase==="final"?{state:oa(ye,{includeHeightCache:!0})}:{state:oa(ye)}})(x,B),J=K.state,pe=!!(J&&(V||(function(ye,we=!1){return!!we||Ec(ye)!==la})(J,B)));if(V&&(M(x),xc=x,ym=Ac()),J&&pe&&(E(J),J.anchor&&P(J.anchor),la=Ec(J)),x.stable){const ye=ak("settled",x);if(ye!==km){km=ye;const we=oa(x,{includeHeightCache:!0});we&&(E(we),la=Ec(we)),(function(Oe){o("render-settled",Oe)})(x)}}if(x.phase==="final"){const ye=ak("final",x);if(ye!==bm){bm=ye;const we=oa(x,{includeHeightCache:!0});we&&(E(we),la=Ec(we)),(function(Oe){o("render-final",Oe)})(x)}}}function wm(){ml!=null&&(Re?.(ml),ml=null),gl!=null&&ke&&(window.clearTimeout(gl),gl=null)}function ck(){ml=null,gl=null,(function(x){if(Ni.size>0||ko!=null)return!0;switch(x){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(vm)&&(Pi(),Cc()),_m(fl(vm))}function Mn(x){var B,V;if(!Pt.value||(vm=x,ml!=null||gl!=null))return;const K=Math.max(0,(V=(B=s.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?V:32),J=Math.max(0,K-(Ac()-ym)),pe=()=>{gl=null,ml=_e?_e(ck):null,ml==null&&ck()};ke&&J>0?gl=window.setTimeout(pe,J):pe()}function Sm(x){var B;if(x<=0)return 0;const V=st.value;if(pn.value)return zy(x);if(ll.value===V.length&&Fh.value.length&&Wh.value.length){const J=mi.value,pe=Fh.value,ye=Wh.value,we=Be=>Be<=0?0:fd(pe,0,Be)+(Be-fd(ye,0,Be))*J;let Oe=0,Me=V.length-1,He=V.length-1;for(;Oe<=Me;){const Be=Oe+Me>>1;we(Be+1)>=x?(He=Be,Me=Be-1):Oe=Be+1}return He}let K=x;for(let J=0;J<V.length;J++){const pe=(B=cs[J])!=null?B:mi.value;if(K<=pe)return J;K-=pe}return Math.max(0,V.length-1)}function uk(){oe.value+=1}function Cm(x){return!(si.value&&x>=gs.value)&&(!lr.value||x<Bn.value||jh.value.has(x))}function aa(x){const B=yd.get(x);B&&(B(),yd.delete(x));const V=Jl.get(x);V&&(V.destroy(),Jl.delete(x)),kd(x)}function dk(x,B){let V=!1;if(B){const pe=dt.get(x);dt.set(x,B),pe!==B&&(V=!0)}else dt.delete(x)&&(V=!0);if(V&&uk(),B||kd(x),!Ay.value||!Ie||!pt.value&&lr.value&&!z.value&&Jl.size>=640&&(z.value||(z.value=!0,Vh()),!Ay.value||!Ie))return aa(x),void(B&&ur(x,!0));if(x<Bn.value&&!pt.value||jh.value.has(x))return aa(x),void ur(x,!0);if(!B)return void aa(x);aa(x);const K=Ie(B,{rootMargin:"400px"});if(!K)return;Jl.set(x,K),ur(x,K.isVisible.value),lr.value&&(function(pe){if(!ke||!lr.value)return;kd(pe);const ye=pe%17*23,we=window.setTimeout(()=>{if(Oy.delete(pe),!lr.value||jh.value.has(pe))return;const Oe=dt.get(pe);if(!Oe)return;const Me=te(Oe),He=Oe.ownerDocument||document,Be=He.defaultView||window,$e=!Me||Me===He.documentElement||Me===He.body,We=!$e&&Me?_t("nodeVisibilityFallback.root.getBoundingClientRect",()=>Me.getBoundingClientRect()):null,Qe=$e?0:We.top,Ze=$e?_t("nodeVisibilityFallback.clientHeight",()=>{var ct,ut;return(ut=(ct=Be.innerHeight)!=null?ct:Me?.clientHeight)!=null?ut:0}):We.bottom,St=_t("nodeVisibilityFallback.node.getBoundingClientRect",()=>Oe.getBoundingClientRect());St.bottom>=Qe-500&&St.top<=Ze+500&&ur(pe,!0)},1800+ye);Oy.set(pe,we)})(x);let J=null;J=Ge(()=>K.isVisible.value,pe=>{if(pe){kd(x),ur(x,!0),J?.(),yd.delete(x),Jl.get(x)===K&&Jl.delete(x);try{K.destroy()}catch{}}},{immediate:!0}),yd.set(x,J),pt.value&&yi()}function xm(){ko=null;for(const[x,B]of Ni)Ni.delete(x),gi.get(x)===B.el&&cl.get(x)===B.version&&Sy(x,B.height,{allowShrink:B.allowShrink})}function ca(){ko!=null&&(Re?.(ko),ko=null),Ni.clear()}function Ad(x,B){(function(V,K,J){var pe;if(!Number.isFinite(J)||J<=0||gi.get(V)!==K)return;const ye=cl.get(V);if(ye==null)return;const we=st.value[V],Oe=G.value&&j.value!==!0&&!((pe=s.nodes)!=null&&pe.length)&&V>=st.value.length-2,Me=!(we?.loading===!0||Oe),He=Ni.get(V),Be=He?He.allowShrink&&Me:Me,$e=He&&!Be?Math.max(He.height,J):J;Ni.set(V,{height:$e,allowShrink:Be,version:ye,el:K}),ko==null&&(ko=_e?_e(xm):null,ko==null&&xm())})(x,B,Cy(x,B))}function Pi(){for(const[x,B]of gi)B&&Ad(x,B)}function fk(){Cn?.disconnect(),Cn=null,he.clear()}function Am(){for(;hd.length;)vd(hd.pop())}Ge(bs,x=>{x&&Mn("content")},{flush:"post"}),t({getVirtualMetrics:fl,captureVirtualState:function(x={}){var B;return oa(fl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:x.allowFallbackAnchor===!0,requireViewport:x.requireViewport===!0,includeEmptyState:(B=x.includeEmptyState)==null||B})},restoreVirtualState:function(x,B={}){const V=B.restoreAnchor===!0,K=B.restoreToken==null?"imperative":String(B.restoreToken);wc=x,Sc={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!pm(x,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&ik(x)||(wc=null,Sc=null)},forceMeasure:function(x="manual"){return Hn(this,null,function*(){yield vt(),yield rk(),Pi(),Cc(),yield vt();const B=fl(x);return _m(B,!0),B})},settle:gm,scrollToNode:function(x,B="start"){ia(),tn();const V=st.value.length;if(V<=0)return;const K=Cs(x,0,V-1),J=()=>{var pe;const ye=Oo({nodeIndex:K,offsetWithinNodePx:0}),we=bd(K),Oe=bc(),Me=(pe=Oe?.clientHeight)!=null?pe:0,He=Yt();let Be=ye;if(B==="center")Be=ye-Me/2+we/2;else if(B==="end")Be=ye-Me+we;else if(B==="nearest"&&He!=null){if(ye>=He&&ye+we<=He+Me)return;Be=ye<He?ye:ye-Me+we}Po(Math.max(0,Be)),yi({immediate:!0}),pt.value&&(Ro.value=K,al())};if(pt.value)return Ro.value=K,al(),void vt(J);J()}}),Ge(()=>ni.value,x=>{if(!x){fk();for(const B of ar.values())for(const V of B)vd(V);ar.clear(),cl.clear(),Am(),ca()}},{immediate:!0}),Ge(j,x=>{x&&(function(){if(ke&&j.value&&gi.size){Am();for(const B of[80,240,640]){const V=Ly(B,()=>{for(const[K,J]of gi)J&&Ad(K,J)},"final");V!=null&&hd.push(V)}}})(),Mn(x?"final":"content")}),Ge([()=>st.value.length,()=>gs.value],()=>{Fe.value&&ra(),Mn("content")},{flush:"post",immediate:!0}),Ge([()=>Ss.start,()=>Ss.end],()=>{Mn("batch")},{flush:"post"});const{cleanupBatchScheduler:R3}=(function(x){const{props:B,isClient:V,isTestEnv:K,parsedNodesIdentity:J,parsedNodeCount:pe,desiredRenderedCount:ye,datasetKey:we,batchingEnabled:Oe,incrementalRenderingActive:Me,resolvedBatchSize:He,resolvedInitialBatch:Be,renderedCount:$e,adaptiveBatchSize:We,previousRenderContext:Qe,previousBatchConfig:Ze,requestFrame:St,cancelFrame:ct,hasIdleCallback:ut,cleanupNodeVisibility:At,onDatasetKeyChanged:Ct,onDatasetChanged:Zt}=x;let Tt=null,Dt=null,Rt=!1,an=null,_o=null,qs=0,oi=!1,fr=!1;const pr=new Set,yl=new Set;function Ik(){if(V){Tt!=null&&(ct?.(Tt),Tt=null),Dt!=null&&(window.clearTimeout(Dt),Dt=null),_o!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(_o),_o=null),qs+=1;for(const Ps of pr)ct?.(Ps);pr.clear();for(const Ps of yl)window.clearTimeout(Ps);yl.clear(),Rt=!1,an=null,oi=!1,fr=!1}}function Ld(){return typeof performance<"u"?performance.now():Date.now()}function $k(Ps){(function(Oi){var hr;if(!Me.value)return;const Ri=Math.max(2,(hr=B.renderBatchBudgetMs)!=null?hr:6),Di=Math.max(1,He.value||1),ii=Math.max(1,Math.floor(Di/4));Oi>1.2*Ri?We.value=Math.max(ii,Math.floor(.7*We.value)):Oi<.5*Ri&&We.value<Di&&(We.value=Math.min(Di,Math.ceil(1.2*We.value)))})(Ps),oi=!1;const to=fr||$e.value<ye.value;fr=!1,to&&Pk()}function Nk(Ps,to={}){var Oi,hr;if(!Me.value)return;const Ri=ye.value;if($e.value>=Ri)return;const Di=Math.max(1,Ps),ii=()=>{const fa=Ld();let pa=0;Tt=null,Dt=null,_o=null,Rt=!1;const ha=an??Di;an=null;const Pm=Ld();$e.value=Math.min(Ri,$e.value+ha),At($e.value),pa=Ld()-Pm,(function(Om,Ok){if(!V)return void $k(Ok);oi=!0;const Rk=++qs;vt().then(()=>{var Dk;if(Rk!==qs)return;const nI=Ld(),sI=Math.max(Ok,nI-Om),Bk=()=>{Rk===qs&&$k(sI)};if(St){let Wk=!1,Bi=null;const Hk=()=>{Wk||(Wk=!0,Bk())},Pd=St(()=>{pr.delete(Pd),Bi!=null&&(window.clearTimeout(Bi),yl.delete(Bi),Bi=null),Hk()});return pr.add(Pd),Bi=window.setTimeout(()=>{Bi!=null&&yl.delete(Bi),Bi=null,ct?.(Pd),pr.delete(Pd),Hk()},Math.max(32,(Dk=B.renderBatchIdleTimeoutMs)!=null?Dk:120)),void yl.add(Bi)}const Fk=window.setTimeout(()=>{yl.delete(Fk),Bk()},0);yl.add(Fk)})})(fa,pa)};if(!V||to.immediate)return void ii();const mr=Math.max(0,(Oi=B.renderBatchDelay)!=null?Oi:16);if(an=an!=null?Math.max(an,Di):Di,!Rt){if(Rt=!0,!K&&ut&&window.requestIdleCallback){const fa=Math.max(0,(hr=B.renderBatchIdleTimeoutMs)!=null?hr:120);return void(_o=window.requestIdleCallback(()=>ii(),{timeout:fa}))}St&&!K?Tt=St(()=>{mr!==0?Dt=window.setTimeout(()=>ii(),mr):ii()}):Dt=window.setTimeout(()=>ii(),mr)}}function Lk(Ps,to={}){oi?fr=!0:Ps==null?Pk():Nk(Ps,to)}function Pk(){Me.value&&Nk(Oe.value?Math.max(1,Math.round(We.value)):Math.max(1,He.value))}return Ge([J,pe,we,Me,He,Be,()=>B.renderBatchDelay],()=>{var Ps;const to=pe.value,Oi=Qe.value,hr=we.value,Ri=!Object.is(hr,Oi.key),Di=to!==Oi.total,ii=Ri||Di;Qe.value={key:hr,total:to};const mr=Ze.value,fa=(Ps=B.renderBatchDelay)!=null?Ps:16,pa=mr.batchSize!==He.value||mr.initial!==Be.value||mr.delay!==fa||mr.enabled!==Me.value;Ze.value={batchSize:He.value,initial:Be.value,delay:fa,enabled:Me.value},Ri&&Ct(to),(ii||pa||!Me.value)&&Ik(),(ii||pa)&&(We.value=Math.max(1,He.value||1)),ii&&Zt();const ha=ye.value;if(!to)return $e.value=0,void At(0);if(!Me.value)return $e.value=ha,void At($e.value);const Pm=Ri||Oi.total===0;$e.value=Pm||pa?Math.min(ha,Be.value):Math.min($e.value,ha);const Om=Math.max(1,Be.value||He.value||to);$e.value<ha?Lk(Om,{immediate:!V}):At($e.value)},{immediate:!0}),Ge(ye,(Ps,to)=>{Me.value&&(typeof to=="number"&&Ps<=to||Ps>$e.value&&Lk())}),{cleanupBatchScheduler:Ik}})({props:k,isClient:ke,isTestEnv:Ut,parsedNodesIdentity:et,parsedNodeCount:Ke,desiredRenderedCount:md,datasetKey:M3,batchingEnabled:vo,incrementalRenderingActive:si,resolvedBatchSize:as,resolvedInitialBatch:Bn,renderedCount:gs,adaptiveBatchSize:rl,previousRenderContext:il,previousBatchConfig:gc,requestFrame:_e,cancelFrame:Re,hasIdleCallback:ln,cleanupNodeVisibility:w3,onDatasetKeyChanged:x=>{ca(),pd(),Do(),Mc(),x>0&&dd(x)},onDatasetChanged:()=>{pt.value&&yi({immediate:!0})}});Ge([Ty,pt,()=>A.value,()=>ge()],([x,B])=>{if(!x)return Ry(),void qh();S3(),B?yi({immediate:!0}):qh()},{flush:"post",immediate:!0}),Ge([()=>st.value.length,()=>pt.value],x=>Hn(null,[x],function*([B,V]){V&&B&&ke&&(yield vt(),yi({immediate:!0}))}),{flush:"post"}),Ge(pn,x=>{x&&(function(){var B;if(Mt.value&&Ft.value&&vn.value&&((B=rn.value)!=null&&B[1]))return;const V=Or({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=Or({type:"list_item",children:[V],raw:"- Probe paragraph text"}),J=Or({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});Mt.value=V,Ft.value=K,vn.value=J;const pe={1:null,2:null,3:null,4:null,5:null,6:null};for(let ye=1;ye<=6;ye++)pe[ye]=Or({type:"heading",level:ye,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ye)} Probe heading`});rn.value=pe})()},{immediate:!0}),Ge([()=>A.value,pn],()=>{if(!pn.value)return Gh(),void(X.value=0);By(),Gh(),pn.value&&A.value&&typeof ResizeObserver<"u"&&(yc=new ResizeObserver(()=>{By(),On.value&&Zn(),Fe.value&&ra(),Mn("resize")}),yc.observe(A.value))},{immediate:!0}),Ge([pn,it,bo],()=>Hn(null,null,function*(){if(!pn.value)return ue.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Do();yield vt(),(function(){if(!pn.value||typeof window>"u")return ue.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Do();const x={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=Dy(Kh($.value),".paragraph-node");x.paragraph=Fg($.value,B,"pre-wrap");const V=Kh(D.value),K=V?.querySelector(".paragraph-node");x.listItem=Fg(D.value,K,"pre-wrap");const J=_t("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ye,we;return(we=(ye=R.value)==null?void 0:ye.offsetHeight)!=null?we:0}),pe=_t("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ye,we;return(we=(ye=D.value)==null?void 0:ye.offsetHeight)!=null?we:0});x.listWrapperOverhead=Math.max(0,J-pe);for(let ye=1;ye<=6;ye++){const we=Dy(Kh(H[ye]),`h${ye}`);x.headings[ye]=Fg(H[ye],we,"pre-wrap")}ue.value=x,Do()})()}),{flush:"post",immediate:!0}),Ge(()=>st.value.length,()=>{pt.value&&yi({immediate:!0})}),Ge([pn,X],()=>{Do(),pt.value&&yi({immediate:!0}),On.value&&Zn(),Fe.value&&ra(),Mn("resize")},{immediate:!1}),Ge(()=>lr.value,x=>{if(x)for(const[B,V]of dt)dk(B,V);else{Vh();for(const[B,V]of dt)V&&ur(B,!0)}},{immediate:!1}),Ge([()=>k.viewportPriority,()=>st.value.length],([x,B])=>{x!==!1?z.value&&B<=200&&(z.value=!1):z.value=!1}),Ge(()=>gs.value,()=>{pt.value&&yi({immediate:!0})}),Ge([Ro,at,vc,()=>st.value.length,pt],()=>{al()},{immediate:!0});let Ic=null,$c=!1,ua=null;function Nc(){Ic=null,sm=null,nm=void 0,sa=null,Mc()}function Tm(){ca(),pd(),Do(),Us.clear();const x=st.value.length;x>0&&dd(x),hm()}function Mm(){wm(),Py(),xc=null,pl=null,hl=null,Cd=null,wc=null,Sc=null,$c=!1,Nc(),Ky("restore"),tn(),ia()}function Lc(x){var B;return[(B=us())!=null?B:"",Rn(),Li(),_d.value,Tc(x),st.value.length,Math.round(dr(0,st.value.length)),Math.round(dl()),ws.count,Math.round(ws.total)].join(":")}function pk(){return Hn(this,null,function*(){var x,B,V,K;const J=(x=s.virtualScroll)==null?void 0:x.settledToken,pe=Tc(J),ye=Rn(),we=us(),Oe=bo.value;if(Pt.value&&((B=s.virtualScroll)==null?void 0:B.settleMode)==="manual"&&wd(J))if(om()){if(Lc(J)!==sa&&!$c){$c=!0;try{const Me=yield gm({reason:"manual",expectedSettledTokenKey:pe}),He=Tc()===pe;mm(ye,we,Oe)&&Me.sessionKey===ye&&Me.threadKey===we&&He&&Me.stable&&Me.phase==="final"&&(sa=Lc((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{$c=!1,yield vt();const Me=(K=s.virtualScroll)==null?void 0:K.settledToken,He=wd(Me)?Lc(Me):"";mm(ye,we,Oe)&&He&&sa!==He&&pk()}}}else Mn("manual")})}Ge(Pt,(x,B)=>{if(x!==B){if(!x)return Mm(),void wm();Mm(),Tm(),ua=bo.value,Mn("content")}},{flush:"post"}),Ge([Pt,bo],([x,B])=>{x?ua!=null?ua!==B&&(ua=B,(function(V="resize"){ca(),pd(),Do(),Us.clear();const K=st.value.length;K>0&&dd(K),hm(),pl=null,hl=null,Cd=null,xc=null,$c=!1,Nc(),ok(),vt(()=>{Pi(),On.value&&Zn(),Fe.value&&ra(),Mn(V)})})("resize")):ua=B:ua=null},{flush:"post",immediate:!0}),Ge([Pt,()=>Rn(),()=>us()],([x])=>{x&&(Mm(),Tm(),Ky("content"),Mn("content"))}),Ge([Pt,()=>Rn(),()=>us(),bo,()=>st.value.length],([x])=>{x&&(function(B="async-node"){let V=!1;for(const[K,J]of Array.from(vi.entries()))em(J)||(vi.delete(K),yo.delete(K),V=!0);V&&(ta(),Mn(B))})("async-node")},{flush:"post"}),Ge([Pt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.sessionKey},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>s.indexKey,()=>Q.value],([x])=>{x&&(Mc(),(function(B="content"){if(!Pt.value)return;const V=[],K=st.value.length;for(const J of Array.from(Us.keys())){if(J>=K){V.push(J);continue}const pe=_c(J),ye=Us.get(J);ye!=null&&ye!==pe&&V.push(J),Us.set(J,pe)}for(const J of Array.from(Us.keys()))J>=K&&Us.delete(J);V.length&&((function(J,pe={}){const ye=Array.from(J,Number);y3(ye,pe)>0&&(function(Oe){for(const Me of Oe)Us.delete(Me)})(ye)})(V,{notify:!1}),Do(),Nc(),On.value&&Zn(),Fe.value&&ra(),Mn(B))})("content"))},{flush:"post",immediate:!0}),Ge([Pt,()=>st.value.length,()=>Rn(),()=>us()],([x,B,V,K],[J,pe,ye,we])=>{x&&J&&V===ye&&K===we&&B!==pe&&Nc()},{flush:"post"}),Ge([Pt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCache},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCacheWidth},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>st.value.length,()=>Rn(),X],()=>{ok()},{flush:"post",immediate:!0}),Ge([Pt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreAnchor},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>st.value.length,()=>Rn(),X],x=>Hn(null,[x],function*([B,V]){if(!B||!V)return;yield vt();const K=(function(){var J;const pe=(J=s.virtualScroll)==null?void 0:J.restoreAnchor;return pe==null||pe===!1?null:pe===!0?"true":String(pe)})();pm(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ge([Pt,X,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey}],([x])=>{var B;if(!x)return;const V=(B=s.virtualScroll)==null?void 0:B.restoreState;V&&pl&&hl==="restore"&&(nk(V)||(Tm(),pl=null,hl=null,Mn("resize")))},{flush:"post"}),Ge([Pt,()=>st.value.length,()=>Rn(),X],x=>Hn(null,[x],function*([B]){var V;const K=wc,J=Sc;B&&K&&(yield vt(),!pm(K,{restoreAnchor:J?.restoreAnchor===!0,restoreToken:(V=J?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:J?.allowUncapturedAnchor===!0})&&ik(K)||(wc=null,Sc=null))}),{flush:"post",immediate:!0}),Ge([Pt,j,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>Rn(),()=>us(),bo,zh,Ey,()=>gs.value,md,()=>ws.count,()=>ws.total],([x,B,V])=>{if(!x||B!==!0||V==="manual"||!im())return;const K=(function(){var J;const pe=st.value.length;return[(J=us())!=null?J:"",Rn(),Li(),_d.value,pe,Math.round(dr(0,pe)),Math.round(dl()),ws.count,Math.round(ws.total)].join(":")})();Ic!==K&&(Ic=K,gm({reason:"final"}).then(J=>{J.stable||Ic!==K||(Ic=null)}))},{flush:"post",immediate:!0}),Ge([Pt,j,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settledToken},()=>Rn(),()=>us(),bo,zh,Ey,()=>gs.value,md,()=>st.value.length,()=>ws.count,()=>ws.total],()=>{pk()},{flush:"post",immediate:!0}),Ge([()=>st.value.length,pt,at,vc,()=>Ss.start,()=>Ss.end],([x,B,V,K,J,pe])=>{qe.value&&Ce("virtualization",{nodes:x,virtualization:B,maxLiveNodes:V,buffer:K,focusIndex:Ro.value,scroll:B?(()=>{const ye=Te.value||te();return ye?{reverse:U(ye),scrollTop:Math.round(ye.scrollTop),scrollTopAbs:Math.round(Math.abs(ye.scrollTop)),scrollHeight:Math.round(ye.scrollHeight),clientHeight:Math.round(ye.clientHeight)}:null})():null,liveRange:{start:J,end:pe},rendered:gs.value})}),Ge([()=>k.customId],([x],B,V)=>{if(!x||zt)return;const K=(function(J,pe){return J?(ds.controllers[J]=pe,()=>{ds.controllers[J]===pe&&delete ds.controllers[J]}):()=>{}})(x,{captureRestoreAnchor:Vn,restoreAnchor:_s,getAnchorDrift:Ls,getReport:x3});V(()=>{K()})},{immediate:!0}),hs(()=>{(function(){if(Pt.value)try{Pi(),Cc();const x=fl("manual");lk(x)&&(M(x),xc=x,ym=Ac());const B=oa(x,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(E(B),B.anchor&&P(B.anchor),la=Ec(B))}catch{}})(),R3(),Vh(),Ee(),fk();for(const x of ar.values())for(const B of x)vd(B);ar.clear(),cl.clear(),Us.clear(),Am(),ca(),Gh(),tn(),ia(),wm(),Ry(),qh()});const D3=Mi({loader:()=>Hn(null,null,function*(){try{return(yield ao(()=>import("./index11-97AxRDhM.js"),__vite__mapDeps([6,3]))).default}catch(x){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".',x),wo}}),loadingComponent:pV,delay:0}),B3=Mi({loader:()=>Hn(null,null,function*(){try{return(yield ao(()=>import("./index10-B0hKHFI0.js"),[])).default}catch(x){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.',x),wo}}),loadingComponent:fV,delay:0}),F3=Mi(()=>Hn(null,null,function*(){try{return(yield ao(()=>import("./index7-CnqGakDF.js"),[])).default}catch(x){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".',x),wo}})),hk={text:Yn,paragraph:zl,heading:$p,code_block:$g,list:Qa,list_item:Xa,blockquote:If,table:yu,definition_list:$f,footnote:Nf,footnote_reference:Mo,footnote_anchor:gu,admonition:Rf,vmr_container:Pf,hardbreak:Ur,link:Js,image:zr,thematic_break:Lf,math_inline:fi,math_block:DM,strong:Qs,emphasis:eo,strikethrough:Zs,highlight:Io,insert:ho,subscript:po,superscript:fo,emoji:uo,checkbox:To,checkbox_input:To,inline_code:Hs,html_inline:Eo,reference:Xs,html_block:vu},W3=W(()=>Zh()),mk=W(()=>JS(k.codeBlockProps)),H3=W(()=>JS(k.codeBlockProps,{omit:["langs"]})),gk=W(()=>rt(rt({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 Ue.value=="boolean"?{showTooltips:Ue.value}:{}),H3.value)),vk=W(()=>rt(Lt(rt({},gk.value),{langs:k.langs}),mk.value));function yk(x){return typeof x=="boolean"?x:void 0}const z3=W(()=>{const x=k.codeBlockProps||{},B={},V=yk(x.showLineNumbers);V!==void 0&&(B.showLineNumbers=V);const K=yk(x.diffInline);K!==void 0&&(B.diffInline=K);const J=(function(pe){const ye=Number(pe);return Number.isFinite(ye)&&ye>0?ye:void 0})(x.reservedHeightPx);return J!==void 0&&(B.reservedHeightPx=J),B}),U3=W(()=>rt(rt({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Ue.value=="boolean"?{showTooltips:Ue.value}:{}),mk.value)),q3=W(()=>rt({},k.mermaidProps||{})),kk=W(()=>rt({},k.d2Props||{})),j3=W(()=>rt({},k.infographicProps||{})),Pc=W(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:Qn.value.customHtmlTags})),V3=W(()=>rt(rt({},Pc.value),typeof Ue.value=="boolean"?{showTooltip:Ue.value}:{})),K3=W(()=>rt(rt({},Pc.value),typeof Ue.value=="boolean"?{showTooltips:Ue.value}:{})),G3=W(()=>rt(rt({},Pc.value),typeof Ue.value=="boolean"?{showTooltips:Ue.value}:{})),Y3=W(()=>rt(rt({},Pc.value),typeof Ue.value=="boolean"?{showTooltips:Ue.value}:{}));function X3(x){return Array.isArray(x.children)&&x.children.length>0}const Em=W(()=>C3.value.map(x=>{var B,V,K,J,pe,ye,we,Oe;let Me=(function(ct){var ut,At,Ct,Zt,Tt,Dt,Rt;if(ct.type!=="code_block")return ct;const an=ct,_o=[String((ut=an.language)!=null?ut:""),String((At=an.loading)!=null?At:""),String((Ct=an.diff)!=null?Ct:""),String((Zt=an.code)!=null?Zt:""),String((Tt=an.originalCode)!=null?Tt:""),String((Dt=an.updatedCode)!=null?Dt:""),String((Rt=an.raw)!=null?Rt:"")].join("\0"),qs=ud.get(an);if(qs&&qs.signature===_o)return qs.node;const oi=rt({},an);return ud.set(an,{signature:_o,node:oi}),oi})(x.node);const He=Td(Me);let Be=Sk(Me,He);if((Me.type==="html_block"||Me.type==="html_inline")&&Be===hk[Me.type]){const ct=Me,ut=String((B=ct.tag)!=null?B:"").trim().toLowerCase()||TT(ct.content);if(ut){const At=Vt.value[ut];if(Kt.value.has(ut)&&At)Be=At,Me=Lt(rt({},ct),{type:ut,tag:ut,content:T7(ct.content,ut)});else if(MT((V=ct.content)!=null?V:ct.raw,ut)){const Ct=String((J=(K=ct.content)!=null?K:ct.raw)!=null?J:"");Me.type==="html_inline"?(Be=Yn,Me={type:"text",content:Ct,raw:Ct}):(Be=zl,Me={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const $e=Me.type==="code_block"&&u.value==="pre"&&Be===wo&&!Im(Vt.value,He);let We=rt({},(function(ct,ut,At){const Ct=ut??Td(ct);if(ct.type==="code_block"){const Zt=Ct?Im(Vt.value,Ct):void 0;if(At&&u.value==="pre"&&!Zt&&At===wo)return z3.value;if(At&&Ct&&At===Zt)return Ct==="mermaid"?_k(ct):Ct==="infographic"?wk(ct):Ct==="d2"||Ct==="d2lang"?kk.value:vk.value;if(At&&At===Vt.value.code_block)return vk.value;if(Wy(At))return U3.value}return Ct==="mermaid"?_k(ct):Ct==="infographic"?wk(ct):Ct==="d2"||Ct==="d2lang"?kk.value:ct.type==="link"?V3.value:ct.type==="list"?K3.value:ct.type==="blockquote"?G3.value:ct.type==="table"?Y3.value:ct.type==="code_block"?gk.value:Pc.value})(Me,He,Be));const Qe=ul.value[x.index];Me.type==="code_block"&&Qe?.kind==="code-block"&&(We=Lt(rt({},We),$e?{reservedHeightPx:(pe=Qe.height)!=null?pe:Qe.contentHeight}:{estimatedHeightPx:Qe.height,estimatedContentHeightPx:Qe.contentHeight})),$e||Me.type!=="code_block"||He!=="mermaid"||Oa(We.estimatedPreviewHeightPx)!=null||(We=Lt(rt({},We),{estimatedPreviewHeightPx:i1(s1(String((ye=Me.code)!=null?ye:"")))})),$e||Me.type!=="code_block"||He!=="infographic"||Oa(We.estimatedPreviewHeightPx)!=null||(We=Lt(rt({},We),{estimatedPreviewHeightPx:r1(o1(String((we=Me.code)!=null?we:"")))})),Me.type==="math_block"&&(We=Lt(rt({},We),{cacheScope:Sn.value}));const Ze=(function(ct,ut){const At=String(ct.type);return!ld(At)&&Vt.value[At]===ut})(Me,Be),St=Ze?X0(Me,Le.value):void 0;return Lt(rt({},x),{node:Me,component:Be,bindings:We,customBindings:rt(rt({},St??{}),We),rendersCustomNode:Ze,hasSlotChildren:X3(Me),slotContent:String((Oe=Me.content)!=null?Oe:""),isCodeBlock:Me.type==="code_block",indexKey:`${W3.value}-${x.index}`})}));function Td(x){var B;return x?.type==="code_block"?String((B=x.language)!=null?B:"").trim().toLowerCase():""}function Im(x,B){const V=B.trim().toLowerCase();if(V)for(const K of[V,U0(V),wM(V)]){const J=K&&x[K];if(J)return J}}function bk(x,B,V,K){var J,pe;const ye=rt({},x.value);return Oa(ye.estimatedPreviewHeightPx)==null&&(ye.estimatedPreviewHeightPx=K(V(String((J=B?.code)!=null?J:"")),void 0,ye.maxHeight==="none"?null:(pe=Oa(ye.maxHeight))!=null?pe:void 0)),ye}function _k(x){return bk(q3,x,s1,i1)}function wk(x){return bk(j3,x,o1,r1)}function Sk(x,B){if(!x)return g1;const V=Vt.value,K=V[String(x.type)];if(x.type==="code_block"){const J=B??Td(x),pe=J?Im(V,J):void 0;return pe||(u.value==="pre"?V.code_block||wo:J==="mermaid"?V.mermaid||D3:J==="infographic"?V.infographic||B3:J==="d2"||J==="d2lang"?V.d2||F3:K||V.code_block||Hy.value)}return K||hk[String(x.type)]||g1}function $m(x){o("click",x)}function Q3(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&o("mouseover",x)}function Z3(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&o("mouseout",x)}function Ck(x){o("mouseover",x)}function xk(x){o("mouseout",x)}const vl=ee(null),ki=ee(!1);let Oc,da=null,Nm=0,Md=0,Ed=0;const Ak=["code_block","admonition","table","math_block","html_block","image","thematic_break"],J3=new Set(Ak),Tk=[".typewriter-cursor",".height-estimation-probes",...Ak.map(x=>`[data-node-type="${x}"]`),"script","style"].join(",");function Mk(x){if(!x||typeof x!="object")return!1;const B=x.type;return typeof B=="string"&&J3.has(B)}function Id(x){var B,V;if(!x||typeof x!="object")return 0;const K=x,J=(V=(B=K.raw)!=null?B:K.content)!=null?V:K.code;if(typeof J=="string")return J.length;const pe=K.children;if(Array.isArray(pe))return pe.reduce((we,Oe)=>we+Id(Oe),0);const ye=K.items;return Array.isArray(ye)?ye.reduce((we,Oe)=>we+Id(Oe),0):0}function $d(){Oc&&(clearTimeout(Oc),Oc=void 0)}function Ek(){Nm+=1,da!=null&&(Re?.(da),da=null)}function Nd(){Ek(),vl.value&&(vl.value.style.visibility="hidden")}function eI(x){var B;if(x.nodeType!==Node.TEXT_NODE||!((B=x.textContent)!=null?B:"").trim())return!1;const V=x.parentElement;return!!V&&!V.closest(Tk)}function tI(x){let B=x.lastChild;for(;B;){if(eI(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const V=B;if(!V.matches(Tk)&&V.lastChild){B=V.lastChild;continue}}for(;B&&B!==x&&!B.previousSibling;)B=B.parentNode;if(!B||B===x)break;B=B.previousSibling}return null}function Lm(){if(!ke||!ki.value||da!=null)return;const x=Nm,B=()=>{da=null,x===Nm&&(function(){var V,K;if(!(ke&&ki.value&&A.value&&vl.value))return;const J=A.value,pe=vl.value;pe.style.visibility="hidden";const ye=(function(){const Be=Em.value;for(let $e=Be.length-1;$e>=0;$e--){const We=Be[$e];if(!We||Mk(We.node)||!Cm(We.index))continue;const Qe=dt.get(We.index);if(!Qe)continue;const Ze=tI(Qe);if(Ze)return Ze}return null})();if(!ye)return;let we=0,Oe=0,Me=20,He=!1;if(ye?.textContent){const Be=ye.textContent.length,$e=document.createRange();$e.setStart(ye,Math.max(0,Be-1)),$e.setEnd(ye,Be);const We=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Qe=(K=We?.[We.length-1])!=null?K:(V=ye.parentElement)==null?void 0:V.getBoundingClientRect();if(Qe){const Ze=_t("typewriterCursor.root.getBoundingClientRect",()=>J.getBoundingClientRect());we=Qe.right-Ze.left+J.scrollLeft,Oe=Qe.top-Ze.top+J.scrollTop,Me=Qe.height||Me,He=!0}$e.detach()}He&&(pe.style.transform=`translate(${Math.max(0,we)}px, ${Math.max(0,Oe)}px)`,pe.style.height=`${Me}px`,pe.style.visibility="visible")})()};_e?da=_e(B):B()}return Ge([ce,()=>s.content,()=>s.nodes,()=>k.typewriter,j],()=>Hn(null,null,function*(){var x,B;if(!ke||ze.value||!F.value)return;if(j.value)return ki.value=!1,$d(),void Nd();if((x=s.nodes)!=null&&x.length)return ki.value=!1,$d(),Nd(),Md=((B=s.content)!=null?B:"").length,void(Ed=ce.value.length);const V=(function(){var we,Oe;return(we=s.nodes)!=null&&we.length?s.nodes.reduce((Me,He)=>Me+Id(He),0):((Oe=s.content)!=null?Oe:"").length})(),K=(function(){var we;return(we=s.nodes)!=null&&we.length?s.nodes.reduce((Oe,Me)=>Oe+Id(Me),0):ce.value.length})(),J=!Mk(st.value[st.value.length-1]),pe=V>Md,ye=K>Ed;if(k.typewriter===!1||!J||!pe&&!ye)return k.typewriter!==!1&&J||(ki.value=!1,Nd()),Md=V,void(Ed=K);Md=V,Ed=K,ki.value=!0,vl.value&&(vl.value.style.visibility="hidden"),$d(),yield vt(),Lm(),Oc=setTimeout(()=>{Oc=void 0,ki.value=!1},3e3)}),{flush:"post",immediate:!0}),Ge(ki,x=>Hn(null,null,function*(){x?(yield vt(),Lm()):Nd()}),{flush:"post"}),Ge([()=>gs.value,()=>Ss.start,()=>Ss.end],()=>Hn(null,null,function*(){ke&&!ze.value&&F.value&&ki.value&&(yield vt(),Lm())}),{flush:"post"}),hs(()=>{$d(),Ek(),$n.clear()}),(x,B)=>{const V=M$("NodeRenderer",!0);return S(ze)?(w(!0),N(Pe,{key:0},ot(Em.value,K=>(w(),N(Pe,{key:K.index},[K.rendersCustomNode?(w(),ve(Bs(K.component),hn({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:$m,onMouseover:Ck,onMouseout:xk,onCopy:B[0]||(B[0]=J=>o("copy",J)),onHandleArtifactClick:B[1]||(B[1]=J=>o("handleArtifactClick",J))}),{default:de(()=>[K.hasSlotChildren?(w(),ve(V,hn({key:0,ref_for:!0},Nn.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,hn({key:1,ref_for:!0},Nn.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(Bs(K.component),hn({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:$m,onMouseover:Ck,onMouseout:xk,onCopy:B[2]||(B[2]=J=>o("copy",J)),onHandleArtifactClick:B[3]||(B[3]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),N("div",{key:1,ref_key:"containerRef",ref:A,class:De(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:pt.value},{"virtual-scroll-coordinated":bs.value}]]),"data-custom-id":k.customId,onClick:$m,onMouseover:Q3,onMouseout:Z3},[Ns.value||pt.value?(w(),N(Pe,{key:0},[Ns.value?(w(),N("div",{key:0,class:"height-estimation-probes",style:Qt({width:`${it.value}px`}),"aria-hidden":"true"},[T("div",{ref_key:"paragraphProbeWrapperRef",ref:$,class:"node-content","data-probe":"paragraph"},[Z(S(zl),{node:Mt.value,"index-key":"probe-paragraph"},null,8,["node"])],512),T("div",{ref_key:"listItemProbeWrapperRef",ref:D,class:"node-content","data-probe":"list-item"},[T("ul",mV,[Z(S(Xa),{node:Ft.value,"index-key":"probe-list-item"},null,8,["node"])])],512),T("div",{ref_key:"listProbeWrapperRef",ref:R,class:"node-content","data-probe":"list"},[Z(S(Qa),{node:vn.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),N(Pe,null,ot(6,K=>T("div",{key:`probe-heading-${K}`,ref_for:!0,ref:J=>(function(pe,ye){pe<1||pe>6||(H[pe]=ye)})(K,J),class:"node-content","data-probe":`heading-${K}`},[Z(S($p),{node:_3(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,gV)),64))],4)):ie("",!0),pt.value?(w(),N("div",{key:1,class:"node-spacer",style:Qt({height:`${Xh.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(w(!0),N(Pe,null,ot(Em.value,K=>(w(),N("div",{key:K.index,ref_for:!0,ref:J=>dk(K.index,J),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[Cm(K.index)?(w(),N("div",{key:0,ref_for:!0,ref:J=>(function(pe,ye){var we;ye||(function(Be){const $e=`${Zh()}-${Be}`;let We=!1;for(const Qe of Array.from(yo.keys())){const Ze=vi.get(Qe);(Ze?.index===Be||Qe===$e||Qe.startsWith(`${$e}-`))&&(yo.delete(Qe),vi.delete(Qe),We=!0)}We&&(ta(),Mn("async-node"))})(pe),Ni.delete(pe),(function(Be){var $e;const We=(($e=cl.get(Be))!=null?$e:0)+1;cl.set(Be,We)})(pe);const Oe=ar.get(pe);if(Oe){for(const Be of Oe)vd(Be);ar.delete(pe)}if((function(Be){const $e=he.get(Be);$e&&(Cn?.unobserve($e),Ne.delete($e),he.delete(Be))})(pe),!ye||!ni.value)return gi.delete(pe),void cl.delete(pe);gi.set(pe,ye);const Me=()=>{Ad(pe,ye)};queueMicrotask(Me);const He=(Cn||typeof ResizeObserver>"u"||(Cn=new ResizeObserver(Be=>{if(Be.length)for(const $e of Be){const We=Ne.get($e.target),Qe=he.get(We??-1);We!=null&&Qe&&Ad(We,Qe)}else Pi()})),Cn);if(He&&(he.set(pe,ye),Ne.set(ye,pe),He.observe(ye)),typeof window<"u"){const Be=((we=st.value[pe])==null?void 0:we.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(Be.length){const $e=Be.map(We=>Ly(We,Me,"node-resize")).filter(We=>We!=null);$e.length&&ar.set(pe,$e)}}})(K.index,J),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(w(),ve(Bs(K.component),hn({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]=J=>o("copy",J)),onHandleArtifactClick:B[9]||(B[9]=J=>o("handleArtifactClick",J))}),{default:de(()=>[K.hasSlotChildren?(w(),ve(V,hn({key:0,ref_for:!0},Nn.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,hn({key:1,ref_for:!0},Nn.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(Bs(K.component),hn({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]=J=>o("copy",J)),onHandleArtifactClick:B[11]||(B[11]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Vr,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:de(()=>[K.rendersCustomNode?(w(),ve(Bs(K.component),hn({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]=J=>o("copy",J)),onHandleArtifactClick:B[5]||(B[5]=J=>o("handleArtifactClick",J))}),{default:de(()=>[K.hasSlotChildren?(w(),ve(V,hn({key:0,ref_for:!0},Nn.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,hn({key:1,ref_for:!0},Nn.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(Bs(K.component),hn({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]=J=>o("copy",J)),onHandleArtifactClick:B[7]||(B[7]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),N("div",{key:1,class:"node-placeholder",style:Qt({height:`${bd(K.index)}px`})},null,4))],8,vV))),128)),ki.value?(w(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:vl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),pt.value?(w(),N("div",{key:2,class:"node-spacer",style:Qt({height:`${Qh.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,hV))}}})),[["__scopeId","data-v-2e8e6e17"]]),mo=XM;mo.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",mo.__name,mo.name].filter(n=>!!n));for(const n of t)e.component(n,XM)};const sy=Object.freeze(Object.defineProperty({__proto__:null,default:mo},Symbol.toStringTag,{value:"Module"})),yV={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"},kV={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"},bV={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"},_V={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"},wV={class:"admonition-title"},SV=["aria-expanded","aria-controls"],CV=["id"],Rf=fn(Ve({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=W(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=ee(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(w(),N("div",{class:De(["admonition",[`admonition-${s.node.kind}`]])},[T("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(w(),N("svg",yV,[...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)])])):s.node.kind==="tip"?(w(),N("svg",kV,[...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)])])):s.node.kind==="warning"||s.node.kind==="caution"?(w(),N("svg",bV,[...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)])])):s.node.kind==="danger"||s.node.kind==="error"?(w(),N("svg",_V,[...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",wV,O(i.value),1),s.node.collapsible?(w(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),N("svg",{style:Qt({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,SV)):ie("",!0)]),In(T("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[Z(S(mo),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,CV),[[Ko,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Rf.install=e=>{e.component(Rf.__name,Rf)};const QM=()=>ao(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let uf=null,xV=QM;function Wpe(){return Hn(this,null,function*(){if(uf)return uf;const e=xV;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===QM?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(uf=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),uf):null})}function Hpe(){return!1}function zpe(){return Hn(this,null,function*(){return null})}const df=ee(!1);let uC=!1;function Hg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function AV(){return!uC&&typeof window<"u"&&typeof document<"u"&&(uC=!0,df.value=Hg(),new MutationObserver(()=>{df.value=Hg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{df.value=Hg()})),df}const ZM=["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"],TV=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=[...ZM].sort((e,t)=>t.length-e.length).join("|"),zg=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"),JM=/[),.;!?,。;!?)]+$/;function MV(e){const t=e.toLowerCase();return ZM.some(n=>t.endsWith(`.${n}`))}function EV(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${_1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function IV(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(JM,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=TV.has(i),a=MV(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function $V(e,t={}){const n=[];zg.lastIndex=0;let s;for(;(s=zg.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(JM,""),u=a.length-c.length;a=c;const d=IV(a,t);if(!d)continue;const f=s.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(zg.lastIndex-=u)}return n}const NV=12e4,LV=6e4,PV=32,OV=3e4,dC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function RV(e){let t=0,n=0,s=0;dC.lastIndex=0;let o;for(;(o=dC.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=NV||n>=LV||t>=PV||s>=OV?"pre":"shiki",codeFenceCount:t,codeChars:n}}function DV(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function BV(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const FV={key:1,class:"diff-wrap"},WV={class:"diff-bar"},HV=["onClick"],zV={class:"diff-pre"},UV="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",fC="github-light",pC="github-dark",qV=Ve({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){_U(),PU(),SU(),FU(),wU(new DV),BU(new BV);function t(D){return D.inline.ruler.disable("math"),D}const{t:n}=Nt(),s=jt("resolveImage"),o=ee(null),i=e,r=W(()=>!i.streaming),l=W(()=>EV(i.text??"")),a=W(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:RV(i.text??"")),c=AV(),u=W(()=>!i.streaming),d=Es(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(D){return!/^(https?:|data:|blob:)/i.test(D)}function _(D){if(!s)return;const R=[];for(const H of[h,p]){H.lastIndex=0;let z;for(;(z=H.exec(D))!==null;)R.push(z[2]??"")}for(const H of R)!H||!m(H)||d.has(H)||f.has(H)||(f.add(H),s(H).then(z=>{d.set(H,z!==H?z:"")}).catch(()=>{d.set(H,"")}).finally(()=>{f.delete(H)}))}function b(D){if(!s)return D;const R=H=>{if(!m(H))return null;const z=d.get(H);return z===void 0?UV:z===""?null:z};return D.replace(h,(H,z,q,Q)=>{const X=R(q);return X===null?H:`${z}${X}${Q}`}).replace(p,(H,z,q,Q)=>{const X=R(q);return X===null?H:`${z}${X}${Q}`})}Ge(()=>i.text,D=>_(D??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const D=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),R=[];let H=D.nextNode();for(;H;){const z=H,q=z.parentElement;q&&!q.closest("a, pre, .md-file-link, svg")&&z.data.trim().length>0&&R.push(z),H=D.nextNode()}for(const z of R){const q=$V(z.data,{aliases:l.value});if(q.length===0||!z.parentNode)continue;const Q=document.createDocumentFragment();let X=0;for(const ue of q){ue.start>X&&Q.append(document.createTextNode(z.data.slice(X,ue.start)));const ge=document.createElement("button");ge.type="button",ge.className="md-file-link",ge.textContent=ue.text,ge.title=ue.line?`${ue.path}:${ue.line}`:ue.path,ge.addEventListener("click",xe=>{xe.preventDefault(),xe.stopPropagation(),i.openFile?.({path:ue.path,line:ue.line})}),Q.append(ge),X=ue.end}X<z.data.length&&Q.append(document.createTextNode(z.data.slice(X))),z.parentNode.replaceChild(Q,z)}}function v(D){return!(!D||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(D))}function y(D){let R=D.length;for(const H of["#","?"]){const z=D.indexOf(H);z!==-1&&z<R&&(R=z)}return D.slice(0,R)}function C(){if(!o.value||!i.openFile||i.streaming)return;const D=o.value.querySelectorAll("a[href]");for(const R of D){if(R.dataset.mdLinkHandled==="true"||R.closest("svg"))continue;const H=R.getAttribute("href")??"";v(H)&&(R.dataset.mdLinkHandled="true",R.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(H)})}))}}function L(){vt().then(()=>{g(),C()})}Ge(()=>i.text,L),Ge(()=>i.streaming,L);let I=null;_n(()=>{L(),o.value&&(I=new MutationObserver(L),I.observe(o.value,{childList:!0,subtree:!0}))}),wn(()=>{I?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},M=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,E=W(()=>{const D=b(i.text??""),R=[];let H=0;M.lastIndex=0;let z;for(;(z=M.exec(D))!==null;){const Q=z[1]??"",X=D.slice(H,z.index)+(Q||"");X.trim()&&R.push({kind:"md",text:X}),R.push({kind:"diff",code:z[2]??""}),H=M.lastIndex}const q=D.slice(H);return(q.trim()||R.length===0)&&R.push({kind:"md",text:q}),R});function P(D){return D.split(`
|
|
246
|
-
`).map(R=>/^\+(?!\+\+)/.test(R)?{cls:"diff-add",text:R}:/^-(?!--)/.test(R)?{cls:"diff-del",text:R}:R.startsWith("@@")?{cls:"diff-hunk",text:R}:{cls:"diff-ctx",text:R})}const A=ee(null);function $(D,R){Ws(D).then(H=>{H&&(A.value=R,setTimeout(()=>{A.value=null},1400))})}return(D,R)=>(w(),N("div",{ref_key:"mdRef",ref:o,class:"md"},[(w(!0),N(Pe,null,ot(E.value,(H,z)=>(w(),N(Pe,{key:z},[H.kind==="md"?(w(),ve(S(mo),{key:0,content:H.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":S(c),"code-block-light-theme":fC,"code-block-dark-theme":pC,themes:[fC,pC],"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",FV,[T("div",WV,[R[0]||(R[0]=T("span",{class:"diff-lang"},"diff",-1)),Z(ht,{text:S(n)("filePreview.copyCode")},{default:de(()=>[T("button",{class:"diff-copy",onClick:q=>$(H.code,z)},O(A.value===z?"✓":"⧉"),9,HV)]),_:2},1032,["text"])]),T("pre",zV,[T("code",null,[(w(!0),N(Pe,null,ot(P(H.code),(q,Q)=>(w(),N("span",{key:Q,class:De(q.cls)},O(q.text),3))),128))])])]))],64))),128))],512))}}),Eh=ft(qV,[["__scopeId","data-v-8b684052"]]),jV={class:"tc-anim"},VV={class:"prev-anim"},KV={class:"prev"},GV=Ve({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=W(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=W(()=>n.foldable&&o.value.length>1),r=W(()=>n.streaming||!i.value),l=W(()=>o.value.pop()??""),a=ee(null);return _n(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ge(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||vt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),N("div",{class:De(["think",{mob:e.mobile}])},[i.value?(w(),N("div",{key:0,class:De(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[T("div",jV,[T("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),T("div",VV,[T("span",KV,O(l.value),1)])],2)):(w(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),YV=ft(GV,[["__scopeId","data-v-5f6e61ba"]]),XV={class:"activity-notice",role:"status"},QV={"aria-hidden":"true"},ZV={class:"an-label"},JV=Ve({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),N("div",XV,[T("span",QV,[Z(Jo,{size:"sm"})]),T("span",ZV,O(e.label),1)]))}}),eK=ft(JV,[["__scopeId","data-v-0d497074"]]),tK=["aria-label"],nK=120,sK=60,oK=Ve({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*nK}ms`,"--moon-frame-fast-delay":`${s*sK}ms`}}return(s,o)=>(w(),N("span",{class:De(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),N(Pe,null,ot(t,(i,r)=>T("span",{key:i,class:"ui-moon__frame",style:Qt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,tK))}}),eE=ft(oK,[["__scopeId","data-v-a6b7ec07"]]);function iK(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const rK={class:"chat"},lK={key:0,class:"chat-loading"},aK={class:"chat-loading-text"},cK={key:1,class:"chat-empty"},uK={key:1,class:"top-sentinel-text"},dK=["data-turn-id"],fK={key:0,class:"u-imgs"},pK=["src"],hK=["src","alt"],mK={key:1,class:"skill-act"},gK={class:"skill-act-head"},vK={key:0,class:"skill-act-args"},yK={key:2,class:"skill-act"},kK={class:"skill-act-head"},bK={key:0,class:"skill-act-args"},_K={key:3,class:"u-text"},wK={key:0,class:"u-meta"},SK=["onClick"],CK={class:"u-edit-text"},xK=["onClick"],AK=["onClick"],TK=["data-turn-id"],MK=["onClick"],EK={class:"cd-view"},IK={key:1,class:"cd-label"},$K=["data-turn-id"],NK={key:1,class:"msg"},LK={key:0,class:"a-msg-ft"},PK={key:0,class:"a-duration"},OK=["onClick"],RK={class:"a-cpbtn-text"},DK={key:4,class:"sending-placeholder"},BK={key:5,class:"q-stack"},FK={class:"q-head"},WK={class:"q-title"},HK={class:"q-hint"},zK=["onDragover","onDrop"],UK={class:"u-bub q-bub"},qK=["title","onDragstart"],jK=["title","disabled","onClick"],VK={key:0,class:"u-text q-text"},KK={key:1,class:"q-text q-text-placeholder"},GK={key:0,class:"q-imgs"},YK=["src"],XK=["src"],QK={key:1,class:"q-tag q-tag-next"},ZK={key:2,class:"q-tag q-tag-idx"},JK=["aria-label","onClick"],eG=2500,tG=Ve({__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:s}=Nt(),{confirm:o}=nl();wn(()=>{ke!==null&&(clearTimeout(ke),ke=null),z!==null&&(clearTimeout(z),z=null),M!==null&&(clearTimeout(M),M=null)});const i=e,r=ee(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))}_n(a),wn(()=>{l?.disconnect(),l=null}),Ge(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{vt().then(a)});const c=W(()=>{if(!i.running||i.turns.length===0)return null;const Le=i.turns.at(-1);return Le.role==="assistant"?Le.id:null}),u=W(()=>i.sending||i.running),d=n,f=ee(null),h=ee(null);function p(Le){return(Le.attachments?.length??0)>0}function m(Le,le){p(le)||d("editQueued",Le)}function _(Le,le){if(f.value=Le,!le.dataTransfer)return;le.dataTransfer.effectAllowed="move",le.dataTransfer.setData("text/plain",String(Le));const F=le.currentTarget?.closest(".q-turn");F&&le.dataTransfer.setDragImage(F,24,24)}function b(Le,le){if(f.value===null)return;le.preventDefault(),le.dataTransfer&&(le.dataTransfer.dropEffect="move");const F=le.currentTarget.getBoundingClientRect(),ne=le.clientY<F.top+F.height/2?"before":"after";h.value={index:Le,position:ne}}function g(Le,le){le.preventDefault();const F=f.value,ne=h.value?.position??"before";if(f.value=null,h.value=null,F===null)return;let te=ne==="before"?Le:Le+1;F<te&&(te-=1),F!==te&&d("reorderQueue",{from:F,to:te})}function v(){f.value=null,h.value=null}const y=W(()=>{for(let Le=i.turns.length-1;Le>=0;Le--)if(i.turns[Le].role==="user")return i.turns[Le].id;return null});function C(Le){return Le.role==="user"&&Le.id===y.value&&!i.running&&!i.sending&&!Le.skillActivation&&!Le.pluginCommand}function L(Le){const le=Le.compaction,F=le?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof le?.tokensBefore=="number"&&typeof le?.tokensAfter=="number"?F+s("conversation.compactedTokens",{before:y_(le.tokensBefore),after:y_(le.tokensAfter)}):F}const I=ee(null),k=ee(null);let M=null;const E=ee(new Set);function P(Le){return E.value.has(Le)}function A(Le){const le=new Set(E.value);le.has(Le)?le.delete(Le):le.add(Le),E.value=le}function $(Le,le){if(P(le)){const F=new Date(Le);if(Number.isNaN(F.getTime()))return Le;const ne=te=>String(te).padStart(2,"0");return`${F.getFullYear()}-${ne(F.getMonth()+1)}-${ne(F.getDate())} ${ne(F.getHours())}:${ne(F.getMinutes())}`}return iK(Le,s("conversation.yesterday"))}async function D(Le){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&R(Le)}function R(Le){k.value===null&&(k.value=Le.id,d("editMessage",Le.text),M=setTimeout(()=>{M=null,k.value=null},eG))}Ge(()=>i.turns,Le=>{k.value!==null&&(Le.some(le=>le.id===k.value)||(k.value=null,M!==null&&(clearTimeout(M),M=null)))},{flush:"post"});const H=ee(!1);let z=null;function q(){if(i.turns.length===0)return;const Le=[];for(const F of i.turns){if(F.role==="compaction")continue;const ne=F.role==="user"?"User":"Assistant",te=aO(F);te.trim()&&Le.push(`**${ne}**
|
|
247
|
-
|
|
248
|
-
${te}`)}const le=Le.join(`
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
`);Ws(le).then(F=>{F&&(H.value=!0,d("copyConversationCopied"),z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,H.value=!1},2e3))}).catch(()=>{})}function Q(Le){const le=[];for(let F=Le;F>=0;F--){const ne=i.turns[F];if(!ne||ne.role!=="assistant")break;le.unshift(ne)}return le}function X(Le){return Q(Le).map(le=>lO(le)).filter(Boolean).join(`
|
|
253
|
-
|
|
254
|
-
`)}function ue(){for(let Le=i.turns.length-1;Le>=0;Le-=1)if(i.turns[Le]?.role==="assistant")return X(Le);return""}function ge(){const Le=ue();Le.trim()&&Ws(Le).then(le=>{le&&(H.value=!0,d("copyConversationCopied"),z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,H.value=!1},2e3))}).catch(()=>{})}t({copyConversation:q,copyFinalSummary:ge});function xe(Le){const le=i.turns[Le];if(!le||le.role!=="assistant")return!1;const F=i.turns[Le+1];return!F||F.role!=="assistant"}let ke=null;function ze(Le){const le=i.turns[Le];if(!le)return;const F=X(Le);F.trim()&&Ws(F).then(ne=>{ne&&(I.value=le.id,ke!==null&&clearTimeout(ke),ke=setTimeout(()=>{ke=null,I.value=null},1400))}).catch(()=>{})}function qe(Le){const le=Le.text;le.trim()&&Ws(le).then(F=>{F&&(I.value=Le.id,ke!==null&&clearTimeout(ke),ke=setTimeout(()=>{ke=null,I.value=null},1400))}).catch(()=>{})}function Ue(Le,le){return Le.id!==c.value?!1:le.sourceIndex===ch(Le).length-1}return(Le,le)=>(w(),N("div",rK,[e.sessionLoading?(w(),N("div",lK,[Z(Jo,{size:"sm"}),T("span",aK,O(S(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),N("div",cK)):ie("",!0),e.hasMoreMessages||e.loadingMore?(w(),N("div",{key:2,ref_key:"topSentinelRef",ref:r,class:De(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),N("span",uK,[Z(Jo,{size:"sm"}),je(" "+O(S(s)("conversation.loadingOlder")),1)])):(w(),N("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:le[0]||(le[0]=F=>d("loadOlderMessages"))},O(S(s)("conversation.loadOlder")),1))],2)):ie("",!0),(w(!0),N(Pe,null,ot(e.turns,(F,ne)=>(w(),N(Pe,{key:F.id},[F.role==="user"?(w(),N("div",{key:0,class:De(["u-turn",{"is-latest-user":F.id===y.value}])},[T("div",{class:De(["u-bub turn-anchor",{undoing:k.value===F.id}]),"data-turn-id":F.id},[F.images&&F.images.length>0?(w(),N("div",fK,[(w(!0),N(Pe,null,ot(F.images,(te,U)=>(w(),N(Pe,{key:U},[te.kind==="video"?(w(),N("video",{key:0,class:"u-img",src:te.url,controls:"",playsinline:"",preload:"metadata"},null,8,pK)):(w(),N("img",{key:1,class:"u-img",src:te.url,alt:te.alt||"",loading:"lazy"},null,8,hK))],64))),128))])):ie("",!0),F.skillActivation?(w(),N("div",mK,[T("div",gK,[le[9]||(le[9]=T("span",{class:"skill-act-arrow"},"▶",-1)),T("span",null,O(S(s)("conversation.activatedSkill",{name:F.skillActivation.name})),1)]),F.skillActivation.args?(w(),N("div",vK,O(F.skillActivation.args),1)):ie("",!0)])):F.pluginCommand?(w(),N("div",yK,[T("div",kK,[le[10]||(le[10]=T("span",{class:"skill-act-arrow"},"▶",-1)),T("span",null,"/"+O(F.pluginCommand.pluginId)+":"+O(F.pluginCommand.commandName),1)]),F.pluginCommand.args?(w(),N("div",bK,O(F.pluginCommand.args),1)):ie("",!0)])):(w(),N("div",_K,O(F.text),1))],10,dK),F.createdAt||C(F)?(w(),N("div",wK,[C(F)?(w(),N("div",{key:0,class:De(["u-edit-wrap",{undoing:k.value===F.id}])},[Z(ht,{text:S(s)("conversation.undoTooltip")},{default:de(()=>[T("button",{type:"button",class:"u-edit",onClick:te=>D(F)},[T("span",CK,O(S(s)("conversation.undo")),1),Z(Ye,{name:"undo",size:"sm"})],8,SK)]),_:2},1032,["text"])],2)):ie("",!0),F.text.trim().length>0?(w(),ve(ht,{key:1,text:S(s)("filePreview.copy")},{default:de(()=>[T("button",{type:"button",class:"u-copy",onClick:kt(te=>qe(F),["stop"])},[I.value!==F.id?(w(),ve(Ye,{key:0,name:"copy",size:"sm"})):(w(),ve(Ye,{key:1,name:"check",size:"sm"}))],8,xK)]),_:2},1032,["text"])):ie("",!0),F.createdAt?(w(),N("button",{key:2,type:"button",class:"u-time",onClick:kt(te=>A(F.id),["stop"])},O($(F.createdAt,F.id)),9,AK)):ie("",!0)])):ie("",!0)],2)):F.role==="compaction"?(w(),N("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":F.id,role:"separator"},[le[11]||(le[11]=T("span",{class:"cd-line","aria-hidden":"true"},null,-1)),F.text?(w(),N("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:te=>d("openCompaction",{turnId:F.id})},[T("span",null,O(L(F)),1),T("span",EK,O(S(s)("conversation.viewSummary")),1)],8,MK)):(w(),N("span",IK,O(L(F)),1)),le[12]||(le[12]=T("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,TK)):(w(),N("div",{key:2,class:"a-msg turn-anchor","data-turn-id":F.id},[(w(!0),N(Pe,null,ot(S(rO)(F),(te,U)=>(w(),N(Pe,{key:S(cO)(te,U)},[te.kind==="thinking"?(w(),ve(YV,{key:0,text:te.thinking,mobile:"",streaming:Ue(F,te),onOpen:Y=>d("openThinking",{turnId:F.id,blockIndex:te.sourceIndex})},null,8,["text","streaming","onOpen"])):te.kind==="text"&&te.text?(w(),N("div",NK,[Z(Eh,{text:te.text,streaming:Ue(F,te),"open-file":Y=>d("openFile",Y)},null,8,["text","streaming","open-file"])])):te.kind==="tool-stack"?(w(),ve(mO,{key:2,tools:te.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[1]||(le[1]=Y=>d("openMedia",Y)),onOpenFile:le[2]||(le[2]=Y=>d("openFile",Y)),onOpenToolDiff:le[3]||(le[3]=Y=>d("openToolDiff",Y)),onOpenAgent:le[4]||(le[4]=Y=>d("openAgent",Y))},null,8,["tools","tool-diff-panel"])):te.kind==="tool"?(w(),ve(yA,{key:3,tool:te.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[5]||(le[5]=Y=>d("openMedia",Y)),onOpenFile:le[6]||(le[6]=Y=>d("openFile",Y)),onOpenToolDiff:le[7]||(le[7]=Y=>d("openToolDiff",Y)),onOpenAgent:le[8]||(le[8]=Y=>d("openAgent",Y))},null,8,["tool","tool-diff-panel"])):ie("",!0)],64))),128)),F.id!==c.value&&xe(ne)&&(X(ne).trim().length>0||F.durationMs!==void 0)?(w(),N("div",LK,[Z(ht,{text:`${F.durationMs} ms`},{default:de(()=>[F.durationMs!==void 0?(w(),N("span",PK,O(S(sO)(F.durationMs)),1)):ie("",!0)]),_:2},1032,["text"]),X(ne).trim().length>0?(w(),N("button",{key:0,class:"a-cpbtn",tabindex:"-1",onClick:te=>ze(ne)},[I.value!==F.id?(w(),ve(Ye,{key:0,name:"copy",size:"sm"})):(w(),ve(Ye,{key:1,name:"check",size:"sm"})),T("span",RK,O(S(s)("filePreview.copy")),1)],8,OK)):ie("",!0)])):ie("",!0)],8,$K))],64))),128)),e.compaction?(w(),ve(eK,{key:3,label:S(s)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(w(),N("div",DK,[Z(eE,{fast:e.fastMoon},null,8,["fast"])])):ie("",!0),e.queued.length>0?(w(),N("div",BK,[T("div",FK,[T("span",WK,[Z(Ye,{name:"mail",size:"sm"}),je(" "+O(S(s)("composer.queueLabel"))+" · ",1),T("b",null,O(e.queued.length),1)]),T("span",HK,O(S(s)("composer.queueAutoDrain")),1)]),(w(!0),N(Pe,null,ot(e.queued,(F,ne)=>(w(),N("div",{key:ne,class:De(["u-turn q-turn",{"q-dragging":f.value===ne,"drop-before":h.value?.index===ne&&h.value.position==="before","drop-after":h.value?.index===ne&&h.value.position==="after"}]),onDragover:te=>b(ne,te),onDrop:te=>g(ne,te)},[T("div",UK,[T("span",{class:"q-grip",title:S(s)("composer.queueDragTitle"),draggable:"true",onDragstart:te=>_(ne,te),onDragend:v},[Z(Ye,{name:"grip",size:"sm"})],40,qK),T("button",{type:"button",class:"q-body",title:p(F)?S(s)("composer.queuedHasImage",{n:F.attachments?.length??0}):S(s)("composer.editQueued"),disabled:p(F),onClick:te=>m(ne,F)},[F.text?(w(),N("span",VK,O(F.text),1)):(w(),N("span",KK,[Z(Ye,{name:"image",size:"sm"}),je(" "+O(S(s)("composer.queuedImageOnly",{n:F.attachments?.length??0})),1)]))],8,jK),p(F)?(w(),N("div",GK,[(w(!0),N(Pe,null,ot(F.attachments,(te,U)=>(w(),N(Pe,{key:U},[te.kind==="video"?(w(),N("video",{key:0,class:"q-img",src:te.url,muted:"",playsinline:"",preload:"metadata"},null,8,YK)):(w(),N("img",{key:1,class:"q-img",src:te.url,alt:"",loading:"lazy"},null,8,XK))],64))),128))])):ie("",!0),ne===0?(w(),N("span",QK,O(S(s)("composer.queueNext")),1)):(w(),N("span",ZK,"#"+O(ne+1),1)),Z(ht,{text:S(s)("composer.remove")},{default:de(()=>[T("button",{type:"button",class:"q-rm","aria-label":S(s)("composer.remove"),onClick:kt(te=>d("unqueue",ne),["stop"])},[Z(Ye,{name:"close",size:"sm"})],8,JK)]),_:2},1032,["text"])])],42,zK))),128))])):ie("",!0)]))}}),tE=ft(tG,[["__scopeId","data-v-cb4d1a09"]]),nG={class:"ch-id"},sG={key:0,class:"ch-ws"},oG={key:1,class:"ch-sep"},iG=["onKeydown"],rG={class:"ch-ses"},lG={key:0,class:"ch-pill ch-sync-pill"},aG={key:0,class:"ch-ahead"},cG={key:1,class:"ch-behind"},uG={key:1,class:"ch-pill ch-diff-pill"},dG={key:0,class:"ch-add"},fG={key:1,class:"ch-del"},pG=Ve({__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}=Nt(),{confirm:s}=nl(),o=e,i=t,r=W(()=>o.ahead??0),l=W(()=>o.behind??0),a=W(()=>o.gitDiffStats?.totalAdditions??0),c=W(()=>o.gitDiffStats?.totalDeletions??0),u=W(()=>a.value>0||c.value>0),d=ee(!1),f=ee(null),h=ee(null),p=ee({});function m(R){const H=R.target;h.value?.el?.contains(H)||f.value?.el?.contains(H)||g()}function _(){g()}async function b(R){if(R.stopPropagation(),d.value){g();return}d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",_),await vt();const H=f.value?.el,z=h.value?.el;if(!H||!z)return;const q=H.getBoundingClientRect(),Q=4,X=8,ue=z.offsetWidth,ge=z.offsetHeight;let xe=q.bottom+Q;xe+ge>window.innerHeight-X&&(xe=Math.max(X,q.top-ge-Q));let ke=q.left;ke+ue>window.innerWidth-X&&(ke=Math.max(X,q.right-ue)),p.value={top:`${Math.round(xe)}px`,left:`${Math.round(ke)}px`}}function g(){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",_)}wn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",_)});function v(){i("copyAll"),g()}function y(){i("copyFinalSummary"),g()}const C=ee(!1);function L(){o.sessionId&&Ws(o.sessionId).then(R=>{R&&(C.value=!0,setTimeout(()=>{C.value=!1},1200))})}const I=ee(!1),k=ee(""),M=ee(null);async function E(){if(g(),!!o.sessionId){I.value=!0,k.value=o.sessionTitle??"",await vt();try{M.value?.focus(),M.value?.select()}catch{}}}function P(){const R=k.value.trim();R&&o.sessionId&&R!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,R),I.value=!1}function A(){I.value=!1}function $(){o.sessionId&&(g(),i("forkSession",o.sessionId))}async function D(){o.sessionId&&(g(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(R,H)=>(w(),N("header",{class:De(["chat-header",{"macos-desktop":S(fA)}])},[T("div",nG,[e.workspaceName?(w(),N("span",sG,O(e.workspaceName),1)):ie("",!0),e.workspaceName&&e.sessionTitle?(w(),N("span",oG,"/")):ie("",!0),I.value?In((w(),N("input",{key:2,ref_key:"renameInputRef",ref:M,"onUpdate:modelValue":H[0]||(H[0]=z=>k.value=z),class:"ch-rename",type:"text",onKeydown:[ai(kt(P,["stop"]),["enter"]),ai(kt(A,["stop"]),["esc"])],onBlur:P,onClick:H[1]||(H[1]=kt(()=>{},["stop"]))},null,40,iG)),[[go,k.value]]):e.sessionTitle?(w(),ve(ht,{key:3,text:e.sessionTitle},{default:de(()=>[T("span",rG,O(e.sessionTitle),1)]),_:1},8,["text"])):ie("",!0)]),Z(ht,{text:S(n)("header.options")},{default:de(()=>[Z(dn,{ref_key:"kebabRef",ref:f,class:De(["ch-act-more",{open:d.value}]),label:S(n)("header.options"),"aria-expanded":d.value,"aria-haspopup":"menu",onClick:H[2]||(H[2]=kt(z=>b(z),["stop"]))},{default:de(()=>[Z(Ye,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"])]),_:1},8,["text"]),d.value?(w(),ve(Fl,{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Qt(p.value),onClick:H[3]||(H[3]=kt(()=>{},["stop"]))},{default:de(()=>[Z(mn,{onClick:v},{default:de(()=>[je(O(e.copied?S(n)("header.copied"):S(n)("header.copyAll")),1)]),_:1}),Z(mn,{onClick:y},{default:de(()=>[je(O(S(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),N(Pe,{key:0},[Z(mn,{separator:""}),Z(mn,{onClick:L},{default:de(()=>[je(O(C.value?S(n)("header.copied"):S(n)("header.copySessionId")),1)]),_:1}),Z(mn,{onClick:E},{default:de(()=>[je(O(S(n)("header.renameSession")),1)]),_:1}),Z(mn,{onClick:$},{default:de(()=>[je(O(S(n)("header.forkSession")),1)]),_:1}),Z(mn,{danger:"",onClick:D},{default:de(()=>[je(O(S(n)("header.archiveSession")),1)]),_:1})],64)):ie("",!0)]),_:1},8,["style"])):ie("",!0),H[6]||(H[6]=T("div",{class:"ch-spacer"},null,-1)),Z(ht,{text:S(n)("header.gitTooltip")},{default:de(()=>[e.isGitRepo?(w(),N("button",{key:0,type:"button",class:"ch-git",onClick:H[4]||(H[4]=z=>i("openChanges"))},[Z(ht,{text:e.branch||S(n)("header.detached")},{default:de(()=>[T("span",{class:De(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||S(n)("header.detached")),3)]),_:1},8,["text"]),r.value>0||l.value>0?(w(),N("span",lG,[r.value>0?(w(),N("span",aG,"↑"+O(r.value),1)):ie("",!0),l.value>0?(w(),N("span",cG,"↓"+O(l.value),1)):ie("",!0)])):ie("",!0),u.value?(w(),N("span",uG,[a.value>0?(w(),N("span",dG,"+"+O(a.value),1)):ie("",!0),c.value>0?(w(),N("span",fG,"-"+O(c.value),1)):ie("",!0)])):ie("",!0)])):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:S(n)("header.openPr")},{default:de(()=>[e.pr?(w(),N("button",{key:0,type:"button",class:De(["ch-pill ch-pr",`pr-${e.pr.state}`]),onClick:H[5]||(H[5]=z=>e.pr&&i("openPr",e.pr.url))},[Z(Ye,{name:"git-pull-request",size:"sm"}),T("span",null,"PR #"+O(e.pr.number)+" · "+O(e.pr.state),1)],2)):ie("",!0)]),_:1},8,["text"])],2))}}),hG=ft(pG,[["__scopeId","data-v-c1ee5cf2"]]),mG={key:0,class:"slash-menu",role:"listbox"},gG=["aria-selected","onMouseenter","onMousedown"],vG={class:"slash-name"},yG={class:"slash-desc"},kG=Ve({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=ee([]);return Ge(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),N("div",mG,[(w(!0),N(Pe,null,ot(e.items,(a,c)=>(w(),N("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:De(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:kt(u=>o("select",a),["prevent"])},[T("span",vG,O(a.name),1),T("span",yG,O(a.isSkill?a.desc:S(n)(a.desc)),1)],42,gG))),128))])):ie("",!0)}}),bG=ft(kG,[["__scopeId","data-v-f60b70d9"]]),_G={class:"mention-menu",role:"listbox"},wG={key:0,class:"mention-state dim"},SG={key:1,class:"mention-state dim"},CG=["aria-selected","onMouseenter","onMousedown"],xG=["innerHTML"],AG={class:"mention-name"},TG={class:"mention-path"},MG=Ve({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=Ta("folder","sm"),r=Ta("code","sm"),l=Ta("file-text","sm"),a=Ta("image","sm"),c=Ta("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const m=p.path;if(m.endsWith("/"))return i;const _=p.name||m.split("/").pop()||m,b=_.lastIndexOf("."),g=b>0?_.slice(b+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(w(),N("div",_G,[n.loading?(w(),N("div",wG,O(S(o)("mention.searching")),1)):n.items.length===0?(w(),N("div",SG,O(S(o)("mention.noMatch")),1)):(w(!0),N(Pe,{key:2},ot(n.items,(_,b)=>(w(),N("div",{key:_.path,class:De(["mention-item",{active:b===n.activeIndex}]),role:"option","aria-selected":b===n.activeIndex,onMouseenter:g=>s("hover",b),onMousedown:kt(g=>s("select",_),["prevent"])},[T("span",{class:"mention-icon",innerHTML:h(_),"aria-hidden":"true"},null,8,xG),T("span",AG,O(_.name),1),T("span",TG,O(_.path),1)],42,CG))),128))]))}}),EG=ft(MG,[["__scopeId","data-v-f4d6b958"]]),nE=[{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 IG(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 sE(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...nE,...t]}function $G(e,t=nE){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((s,o)=>{const i=s.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:s,index:o,score:r}}).filter(({score:s})=>s>0).sort((s,o)=>s.score!==o.score?o.score-s.score:s.index-o.index).map(({item:s})=>s)}function oE(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 hC(e,t){switch(oE(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Pp=100;function NG(e){const t=ed($t.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const s=n.length>Pp?n.slice(-Pp):n,o={[e]:s};return fc($t.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function LG(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=ee(NG(o())),r=W(()=>i.value[o()??""]??[]);let l=-1,a="";function c(b){const g=o();if(l=-1,!g)return;const v=b.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const C=[...y,v],L=C.length>Pp?C.slice(-Pp):C;i.value={...i.value,[g]:L},fc($t.inputHistory,i.value)}function u(){const b=n.value;return b?(b.selectionStart??0)===0:!1}function d(b){t.value=b,vt(()=>{const g=n.value;if(!g)return;s();const v=b.length;g.setSelectionRange(v,v)})}function f(){const b=r.value;if(b.length!==0){if(l===-1)a=t.value,l=b.length-1;else if(l>0)l-=1;else return;d(b[l])}}function h(){if(l===-1)return;const b=r.value;l<b.length-1?(l+=1,d(b[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function _(){return r.value.length>0}return Ge(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:_}}function PG(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=ee(!1),c=ee([]),u=ee(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=$G(h,sE(o())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,vt(()=>{const p=n.value;if(!p)return;const m=t.value.length;p.setSelectionRange(m,m),p.focus(),s()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function OG(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=ee(!1),r=ee([]),l=ee(0),a=ee(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let m=p-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const _=h.slice(m,p);return _.startsWith("@")?{token:_.slice(1),start:m,end:p}:null}function d(){const h=u(),p=o();if(!h||!p){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const m=t.value;t.value=m.slice(0,p.start)+h.path+m.slice(p.end),i.value=!1,vt(()=>{const _=n.value;if(!_)return;const b=p.start+h.path.length;_.setSelectionRange(b,b),_.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function RG(e){const{sessionId:t}=e;function n(c){return Xn(a_(c))??""}function s(c,u){const d=a_(c);u?es(d,u):oc(d)}const o=ee(n(t())),i=ee(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ge(o,c=>{vt(r),s(t(),c)}),Ge(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),vt(r))});function l(c){o.value=c,vt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){s(t(),"")}return{text:o,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function DG(e){const{uploadImage:t,sessionId:n}=e,s=ee({}),o=W(()=>s.value[n()??""]??[]),i=ee(null),r=ee(null),l=ee(!1);let a=0;function c(){return`att_${++a}`}function u(k,M){s.value={...s.value,[k]:M}}function d(k){try{URL.revokeObjectURL(k.previewUrl)}catch{}}function f(k){return k.startsWith("image/")?"image":k.startsWith("video/")?"video":null}async function h(k){const M=t();if(!M)return;const E=n()??"",P=k.map(A=>({file:A,kind:f(A.type)})).filter(A=>A.kind!==null);if(P.length!==0)for(const{file:A,kind:$}of P){const D=c(),R=URL.createObjectURL(A),H={localId:D,name:A.name,kind:$,previewUrl:R,uploading:!0};u(E,[...s.value[E]??[],H]),M(A,A.name).then(z=>{const q=s.value[E]??[];u(E,q.map(Q=>Q.localId===D?{...Q,uploading:!1,fileId:z?.fileId,error:z===null}:Q))}).catch(()=>{const z=s.value[E]??[];u(E,z.map(q=>q.localId===D?{...q,uploading:!1,error:!0}:q))})}}function p(k){const M=n()??"",E=s.value[M]??[],P=E.find(A=>A.localId===k);i.value?.localId===k&&(i.value=null),P&&d(P),u(M,E.filter(A=>A.localId!==k))}function m(k){i.value=k}function _(){i.value=null}function b(){r.value?.click()}function g(k){const M=k.target,E=Array.from(M.files??[]);h(E),M.value=""}function v(k){if(!t())return;const M=k.clipboardData;if(!M)return;const E=[],P=new Set,A=($,D)=>{const R=`${$.size}:${$.type}:${D}`;if(P.has(R))return;P.add(R);const H=$.type.split("/")[1]??"png",z=D.includes(".")?D:`paste-${Date.now()}.${H}`;E.push($ instanceof File?$:new File([$],z,{type:$.type}))};for(const $ of Array.from(M.items))if($.kind==="file"&&f($.type)){const D=$.getAsFile();D&&A(D,D.name||`paste-${Date.now()}.${$.type.split("/")[1]??"png"}`)}for(const $ of Array.from(M.files))f($.type)&&A($,$.name);E.length!==0&&(k.preventDefault(),h(E))}function y(k){!t()||!Array.from(k.dataTransfer?.items??[]).some(E=>E.kind==="file")||(k.preventDefault(),l.value=!0)}function C(){l.value=!1}function L(k){if(l.value=!1,!t())return;k.preventDefault();const M=Array.from(k.dataTransfer?.files??[]);h(M)}function I(){const k=n()??"";for(const M of s.value[k]??[])d(M);u(k,[])}return Ge(n,()=>{i.value=null}),_n(()=>{document.addEventListener("paste",v)}),wn(()=>{document.removeEventListener("paste",v);for(const k of Object.values(s.value))for(const M of k)d(M);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:_,openFilePicker:b,handleFileInputChange:g,handleDragOver:y,handleDragLeave:C,handleDrop:L,clearAfterSubmit:I}}const BG={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},FG=["stroke-dasharray","stroke-dashoffset"],Ug=7,WG=Ve({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*Ug;return(s,o)=>(w(),N("svg",BG,[T("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:Ug,fill:"none","stroke-width":"2.5"}),T("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:Ug,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,FG)]))}}),HG=ft(WG,[["__scopeId","data-v-a364f1f1"]]),zG={key:0,class:"att-strip"},UG=["onClick"],qG=["src"],jG=["src","alt"],VG={key:2,class:"att-video-badge","aria-hidden":"true"},KG={class:"att-name"},GG={class:"att-err-icon"},YG=["onClick"],XG={class:"att-lightbox-card"},QG=["src"],ZG=["src","alt"],JG={class:"att-lightbox-name"},eY={class:"composer-card"},tY={class:"cin-wrap"},nY={class:"input-row"},sY=["placeholder"],oY=["aria-label"],iY={class:"toolbar-left"},rY=["onKeydown"],lY=["onClick"],aY={class:"pd-check"},cY={class:"pd-info"},uY={class:"pd-desc"},dY={class:"mode-label"},fY={key:0,class:"mode-tag"},pY={key:1,class:"mode-tag"},hY={key:2,class:"mode-tag"},mY={class:"mode-row-name"},gY={class:"mode-row-name"},vY={class:"mode-row-name"},yY={key:0,class:"mode-row-actions"},kY={class:"toolbar-right"},bY={key:0,class:"ctx-group"},_Y={class:"ctx-num"},wY=["onKeydown"],SY={key:0,class:"think-suffix"},CY=["aria-label"],xY=["aria-label"],AY={key:0,class:"md-section"},TY=["onClick"],MY={class:"md-check"},EY={class:"md-name"},IY={class:"md-provider"},$Y={key:1,class:"md-divider"},NY={key:2,class:"md-section"},LY=["onClick"],PY={class:"md-check"},OY={class:"md-name"},RY={key:3,class:"md-divider"},DY=["disabled"],BY={class:"md-check"},FY={class:"md-name"},WY={key:0,class:"md-note"},HY={key:1,class:"md-note"},zY={class:"md-name"},mC=36,UY=Ve({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=W(()=>s.running?r("composer.placeholderRunning"):s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=Nt(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=RG({sessionId:()=>s.sessionId}),f=ee(!1);function h(){f.value=!f.value,vt(()=>{c(),b(),a.value?.focus()})}function p(){f.value&&(f.value=!1,vt(c))}function m(Je){if(typeof getComputedStyle>"u")return mC;const it=Number.parseFloat(getComputedStyle(Je).minHeight);return Number.isFinite(it)&&it>0?it:mC}const _=ee(!1);function b(){const Je=a.value;_.value=!!Je&&Je.scrollHeight>m(Je)}Ge(l,()=>{vt(b)}),Ge(()=>s.sessionId,()=>{f.value=!1});const g=LG({text:l,textareaRef:a,autosize:c,sessionId:()=>s.sessionId}),{open:v,items:y,active:C,update:L,select:I}=PG({text:l,textareaRef:a,autosize:c,skills:()=>s.skills,emitCommand:Je=>i("command",Je),historyPush:Je=>g.push(Je),clearDraft:d}),{open:k,items:M,active:E,loading:P,update:A,select:$}=OG({text:l,textareaRef:a,autosize:c,searchFiles:()=>s.searchFiles});function D(){g.resetBrowsing(),L(),A()}const{attachments:R,previewAttachment:H,fileInputRef:z,isDragOver:q,removeAttachment:Q,openAttachmentPreview:X,closeAttachmentPreview:ue,openFilePicker:ge,handleFileInputChange:xe,handleDragOver:ke,handleDragLeave:ze,handleDrop:qe,clearAfterSubmit:Ue}=DG({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});_n(()=>{l.value&&vt(()=>{c(),b()})}),wn(()=>{document.removeEventListener("mousedown",zt),U()});function Le(){a.value?.focus({preventScroll:!0})}t({loadForEdit:u,focus:Le});function le(){const Je=l.value.trim();if(R.value.some(pt=>pt.uploading))return;const it=R.value.filter(pt=>!pt.uploading&&!pt.error&&pt.fileId);if(!Je&&it.length===0)return;if(g.push(Je),Je){const pt=IG(Je),ni=pt?sE(s.skills).some(hi=>hi.name===pt.cmd):!1;if(pt&&ni){l.value="",d(),v.value=!1,p(),i("command",pt.arg?`${pt.cmd} ${pt.arg}`:pt.cmd);return}}const at={text:Je,attachments:it.map(pt=>({fileId:pt.fileId,kind:pt.kind}))};H.value=null,Ue(),l.value="",d(),v.value=!1,k.value=!1,p(),i("submit",at)}function F(){if(!s.running||R.value.some(pt=>pt.uploading))return;const Je=l.value.trim(),it=R.value.filter(pt=>!pt.uploading&&!pt.error&&pt.fileId);if(!Je&&it.length===0&&s.queued.length===0)return;const at={text:Je,attachments:it.map(pt=>({fileId:pt.fileId,kind:pt.kind}))};Ue(),g.push(Je),l.value="",d(),v.value=!1,k.value=!1,p(),i("steer",at)}let ne=!1,te=null;function U(){te!==null&&(clearTimeout(te),te=null)}function Y(){U(),ne=!0}function fe(){U(),te=setTimeout(()=>{te=null,ne=!1},0)}function se(Je){return ne||Je.isComposing||Je.keyCode===229}function ce(Je){if(!se(Je)){if(Je.key==="Escape"){if(re.value){Je.preventDefault(),ae();return}if(me.value){Je.preventDefault(),Xe();return}}if(v.value){if(Je.key==="ArrowDown"){Je.preventDefault(),C.value=(C.value+1)%y.value.length;return}if(Je.key==="ArrowUp"){Je.preventDefault(),C.value=(C.value-1+y.value.length)%y.value.length;return}if(Je.key==="Enter"||Je.key==="Tab"){Je.preventDefault();const it=y.value[C.value];it&&I(it);return}if(Je.key==="Escape"){Je.preventDefault(),v.value=!1;return}}if(k.value&&!P.value){if(Je.key==="ArrowDown"){Je.preventDefault(),E.value=(E.value+1)%Math.max(1,M.value.length);return}if(Je.key==="ArrowUp"){Je.preventDefault(),E.value=(E.value-1+Math.max(1,M.value.length))%Math.max(1,M.value.length);return}if(Je.key==="Enter"||Je.key==="Tab"){Je.preventDefault();const it=M.value[E.value];it&&$(it);return}if(Je.key==="Escape"){Je.preventDefault(),k.value=!1;return}}if(Je.key==="s"&&(Je.ctrlKey||Je.metaKey)&&!Je.shiftKey&&!Je.altKey){s.running&&(Je.preventDefault(),F());return}if(!f.value&&!v.value&&!k.value&&!Je.shiftKey&&!Je.altKey&&!Je.metaKey&&!Je.ctrlKey){const it=g.isBrowsing();if(Je.key==="ArrowUp"&&g.hasHistory()&&(it||g.caretAtTextStart())){Je.preventDefault(),g.recallOlder();return}if(Je.key==="ArrowDown"&&it){Je.preventDefault(),g.recallNewer();return}}if(Je.key==="Enter"&&!Je.shiftKey){if(f.value&&!(Je.metaKey||Je.ctrlKey))return;Je.preventDefault(),le()}}}const j=W(()=>r("composer.send")),G=W(()=>!!s.uploadImage),re=ee(!1),me=ee(!1),Ae=ee(null);function Ee(){re.value=!re.value,re.value?(me.value=!1,rn(),document.addEventListener("click",tt,!0)):document.removeEventListener("click",tt,!0)}function ae(){re.value=!1,me.value||document.removeEventListener("click",tt,!0)}function Ce(){me.value=!me.value,me.value?(re.value=!1,rn(),document.addEventListener("click",tt,!0)):document.removeEventListener("click",tt,!0)}function Xe(){me.value=!1,re.value||document.removeEventListener("click",tt,!0)}function tt(Je){Ae.value&&!Ae.value.contains(Je.target)&&(ae(),Xe())}wn(()=>{document.removeEventListener("click",tt,!0)});const xt=Je=>`${Math.round(Je/1e3)}k`,wt=W(()=>{const Je=s.status?.ctxMax??0;return Je<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Je*100)))}),It=W(()=>{const Je=(s.status?.ctxUsed??0).toLocaleString(),it=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Je,max:it,pct:wt.value})}),Wt=W(()=>wt.value>=80),_t=W(()=>{const Je=s.status?.modelId??s.status?.model??"";return s.models?.find(it=>it.id===Je||it.model===Je||it.displayName===s.status?.model)}),Ht=W(()=>oE(_t.value)),$n=W(()=>Ht.value==="toggle"),Sn=W(()=>Ht.value==="always-on"?!0:Ht.value==="unsupported"?!1:(s.thinking??"off")!=="off");function Vt(){$n.value&&i("setThinking",Sn.value?"off":"high")}const Kt=W(()=>s.planMode===!0),Qn=W(()=>s.swarmMode===!0),st=W(()=>s.activationBadges?.goal!==null),Nn=W(()=>st.value||s.goalMode===!0),et=ee(!1),Ke=ee(null),Mt=ee(null),Ft=ee({}),vn=W(()=>Kt.value||Qn.value||Nn.value);function rn(){et.value=!1,document.removeEventListener("mousedown",zt)}function zt(Je){const it=Je.target;Ke.value?.contains(it)||Mt.value?.contains(it)||rn()}function ms(){if(et.value){rn();return}ae(),Xe();const Je=Ke.value?.getBoundingClientRect();Je&&(Ft.value={left:`${Math.round(Je.left)}px`,bottom:`${Math.round(window.innerHeight-Je.top+8)}px`}),et.value=!0,setTimeout(()=>document.addEventListener("mousedown",zt),0)}const Ln=[{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 yn(Je){i("setPermission",Je),Xe()}const jn=W(()=>Ln.find(Je=>Je.mode===s.status?.permission)),zs=W(()=>jn.value?r(jn.value.labelKey):""),Pt=W(()=>_t.value?.provider??""),bs=W(()=>!Pt.value||!s.models?.length?[]:s.models.filter(Je=>Je.provider===Pt.value)),pn=W(()=>new Set(s.starredIds??[]));function Ns(Je){return pn.value.has(Je)}const Lo=W(()=>s.models?.length?s.models.filter(Je=>Ns(Je.id)&&Je.provider!==Pt.value):[]);function ti(Je){i("selectModel",Je),ae()}return(Je,it)=>(w(),N("div",{class:De(["composer",{"drag-over":S(q),expanded:f.value}]),onDragover:it[18]||(it[18]=(...at)=>S(ke)&&S(ke)(...at)),onDragleave:it[19]||(it[19]=(...at)=>S(ze)&&S(ze)(...at)),onDrop:it[20]||(it[20]=(...at)=>S(qe)&&S(qe)(...at))},[S(R).length>0?(w(),N("div",zG,[(w(!0),N(Pe,null,ot(S(R),at=>(w(),N("div",{key:at.localId,class:De(["att-chip",{"att-error":at.error}])},[Z(ht,{text:S(r)("composer.previewAttachment",{name:at.name})},{default:de(()=>[T("button",{type:"button",class:"att-preview",onClick:pt=>S(X)(at)},[at.kind==="video"?(w(),N("video",{key:0,class:"att-thumb",src:at.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,qG)):(w(),N("img",{key:1,class:"att-thumb",src:at.previewUrl,alt:at.name},null,8,jG)),at.kind==="video"?(w(),N("span",VG,[Z(Ye,{name:"play",size:"sm"})])):ie("",!0)],8,UG)]),_:2},1032,["text"]),T("span",KG,O(at.name),1),at.uploading?(w(),ve(Jo,{key:0,size:"sm",label:S(r)("composer.uploading")},null,8,["label"])):at.error?(w(),ve(ht,{key:1,text:S(r)("composer.uploadFailed")},{default:de(()=>[T("span",GG,[Z(Ye,{name:"info",size:"sm"})])]),_:1},8,["text"])):ie("",!0),Z(ht,{text:S(r)("composer.removeNamed",{name:at.name})},{default:de(()=>[T("button",{class:"att-rm",onClick:pt=>S(Q)(at.localId)},[Z(Ye,{name:"close",size:"sm"})],8,YG)]),_:2},1032,["text"])],2))),128))])):ie("",!0),S(H)?(w(),N("div",{key:1,class:"att-lightbox",onClick:it[1]||(it[1]=kt((...at)=>S(ue)&&S(ue)(...at),["self"]))},[T("div",XG,[Z(ht,{text:S(r)("model.close")},{default:de(()=>[T("button",{type:"button",class:"att-lightbox-close",onClick:it[0]||(it[0]=(...at)=>S(ue)&&S(ue)(...at))},"✕")]),_:1},8,["text"]),S(H).kind==="video"?(w(),N("video",{key:0,class:"att-lightbox-media",src:S(H).previewUrl,controls:"",playsinline:""},null,8,QG)):(w(),N("img",{key:1,class:"att-lightbox-media",src:S(H).previewUrl,alt:S(H).name},null,8,ZG)),T("div",JG,O(S(H).name),1)])])):ie("",!0),T("div",eY,[T("div",tY,[S(v)?(w(),ve(bG,{key:0,items:S(y),"active-index":S(C),onSelect:S(I),onHover:it[2]||(it[2]=at=>C.value=at)},null,8,["items","active-index","onSelect"])):ie("",!0),S(k)?(w(),ve(EG,{key:1,items:S(M),"active-index":S(E),loading:S(P),onSelect:S($),onHover:it[3]||(it[3]=at=>E.value=at)},null,8,["items","active-index","loading","onSelect"])):ie("",!0),T("div",nY,[In(T("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":it[4]||(it[4]=at=>Jn(l)?l.value=at:null),class:"ph",placeholder:o.value,rows:"1",onKeydown:ce,onCompositionstart:Y,onCompositionend:fe,onInput:D},null,40,sY),[[go,S(l)]]),Z(ht,{text:f.value?S(r)("composer.collapseTitle"):S(r)("composer.expandTitle")},{default:de(()=>[f.value||_.value?(w(),N("button",{key:0,class:"expand-btn",type:"button","aria-label":f.value?S(r)("composer.collapseTitle"):S(r)("composer.expandTitle"),onClick:h},[f.value?(w(),ve(Ye,{key:0,name:"collapse",size:"sm"})):(w(),ve(Ye,{key:1,name:"expand",size:"sm"}))],8,oY)):ie("",!0)]),_:1},8,["text"])])]),G.value?(w(),N("input",{key:0,ref_key:"fileInputRef",ref:z,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:it[5]||(it[5]=(...at)=>S(xe)&&S(xe)(...at))},null,544)):ie("",!0),T("div",{ref_key:"toolbarRef",ref:Ae,class:"toolbar"},[T("div",iY,[Z(ht,{text:S(r)("composer.attachImage")},{default:de(()=>[G.value?(w(),ve(dn,{key:0,size:"md",label:S(r)("composer.attachImage"),onClick:S(ge)},{default:de(()=>[Z(Ye,{name:"image"})]),_:1},8,["label","onClick"])):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:S(r)("status.permissionTooltip")},{default:de(()=>[e.status?(w(),N("span",{key:0,class:De(["perm-pill",["perm-"+e.status.permission,{open:me.value}]]),role:"button",tabindex:"0",onClick:kt(Ce,["stop"]),onKeydown:[ai(Ce,["enter"]),ai(kt(Ce,["prevent"]),["space"])]},O(zs.value),43,rY)):ie("",!0)]),_:1},8,["text"]),me.value&&e.status?(w(),N("div",{key:0,class:"perm-dropdown",role:"menu",onClick:it[6]||(it[6]=kt(()=>{},["stop"]))},[(w(),N(Pe,null,ot(Ln,at=>T("button",{key:at.mode,class:De(["pd-row",{"is-current":at.mode===e.status.permission}]),role:"menuitem",onClick:pt=>yn(at.mode)},[T("span",aY,[at.mode===e.status.permission?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",cY,[T("span",{class:"pd-name",style:Qt({color:at.color})},O(S(r)(at.labelKey)),5),T("span",uY,O(S(r)(at.descKey)),1)])],10,lY)),64))])):ie("",!0),e.status?(w(),N("div",{key:1,ref_key:"modesRef",ref:Ke,class:"modes"},[Z(ht,{text:S(r)("status.modesTooltip")},{default:de(()=>[T("button",{type:"button",class:De(["mode-pill",{on:vn.value,open:et.value}]),onClick:kt(ms,["stop"])},[T("span",dY,O(S(r)("status.modesLabel")),1),Kt.value?(w(),N("span",fY,O(S(r)("status.planLabel")),1)):ie("",!0),Qn.value?(w(),N("span",pY,O(S(r)("status.swarmLabel")),1)):ie("",!0),Nn.value?(w(),N("span",hY,O(S(r)("status.goalLabel")),1)):ie("",!0)],2)]),_:1},8,["text"]),et.value?(w(),N("div",{key:0,ref_key:"modesMenuRef",ref:Mt,class:"modes-menu",style:Qt(Ft.value)},[T("button",{type:"button",class:De(["mode-row",{on:Kt.value}]),onClick:it[7]||(it[7]=at=>i("togglePlan"))},[T("span",mY,O(S(r)("status.planLabel")),1),T("span",{class:De(["mode-switch",{on:Kt.value}])},[...it[21]||(it[21]=[T("span",{class:"mode-knob"},null,-1)])],2)],2),T("button",{type:"button",class:De(["mode-row",{on:Qn.value}]),onClick:it[8]||(it[8]=at=>i("toggleSwarm"))},[T("span",gY,O(S(r)("status.swarmLabel")),1),T("span",{class:De(["mode-switch",{on:Qn.value}])},[...it[22]||(it[22]=[T("span",{class:"mode-knob"},null,-1)])],2)],2),T("div",{class:De(["mode-row mode-row-goal",{on:st.value||s.goalMode}])},[T("button",{type:"button",class:"mode-row-main",onClick:it[9]||(it[9]=at=>st.value?i("controlGoal","cancel"):i("toggleGoal"))},[T("span",vY,O(S(r)("status.goalLabel")),1),st.value?ie("",!0):(w(),N("span",{key:0,class:De(["mode-switch",{on:s.goalMode}])},[...it[23]||(it[23]=[T("span",{class:"mode-knob"},null,-1)])],2))]),st.value?(w(),N("div",yY,[T("button",{type:"button",class:"mode-row-action",onClick:it[10]||(it[10]=at=>i("controlGoal","pause"))},O(S(r)("status.goalPause")),1),T("button",{type:"button",class:"mode-row-action",onClick:it[11]||(it[11]=at=>i("controlGoal","resume"))},O(S(r)("status.goalResume")),1)])):ie("",!0)],2)],4)):ie("",!0)],512)):ie("",!0)]),T("div",kY,[Wt.value?(w(),N("button",{key:0,class:"compact-chip",onClick:it[12]||(it[12]=kt(at=>i("compact"),["stop"]))},"/compact")):ie("",!0),Z(ht,{text:It.value},{default:de(()=>[e.status&&!e.hideContext?(w(),N("span",bY,[Z(HG,{pct:wt.value},null,8,["pct"]),T("span",_Y,O(xt(e.status.ctxUsed))+"/"+O(xt(e.status.ctxMax)),1)])):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:S(r)("status.modelTooltip")},{default:de(()=>[e.status?(w(),N("span",{key:0,class:De(["model-pill",{open:re.value}]),role:"button",tabindex:"0",onClick:kt(Ee,["stop"]),onKeydown:[ai(Ee,["enter"]),ai(kt(Ee,["prevent"]),["space"])]},[T("b",null,O(e.status.model),1),Sn.value?(w(),N("span",SY,O(S(r)("composer.thinkingSuffix")),1)):ie("",!0),Z(Ye,{class:"cv",name:"chevron-down",size:"sm"})],42,wY)):ie("",!0)]),_:1},8,["text"]),e.running?(w(),ve(ht,{key:1,text:S(r)("composer.interruptTitle")},{default:de(()=>[T("button",{class:"stop","aria-label":S(r)("composer.interrupt"),onClick:it[13]||(it[13]=at=>i("interrupt"))},[Z(Ye,{name:"stop",size:"sm"})],8,CY)]),_:1},8,["text"])):ie("",!0),Z(ht,{text:j.value},{default:de(()=>[T("button",{class:"send","aria-label":j.value,onClick:it[14]||(it[14]=at=>le())},[Z(Ye,{name:"send",size:"sm"})],8,xY)]),_:1},8,["text"])]),re.value&&e.status?(w(),N("div",{key:0,class:"model-dropdown",role:"menu",onClick:it[17]||(it[17]=kt(()=>{},["stop"]))},[Lo.value.length>0?(w(),N("div",AY,O(S(r)("status.starredModels")),1)):ie("",!0),(w(!0),N(Pe,null,ot(Lo.value,at=>(w(),N("button",{key:at.id,class:De(["md-row",{"is-current":at.id===e.status.modelId}]),role:"menuitem",onClick:pt=>ti(at.id)},[T("span",MY,[at.id===e.status.model||at.model===e.status.model||at.displayName===e.status.model?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",EY,O(at.displayName??at.model),1),T("span",IY,O(at.provider),1),Z(Ye,{class:"md-star",name:"star",size:"sm"})],10,TY))),128)),Lo.value.length>0?(w(),N("div",$Y)):ie("",!0),bs.value.length>0?(w(),N("div",NY,O(Pt.value),1)):ie("",!0),(w(!0),N(Pe,null,ot(bs.value,at=>(w(),N("button",{key:at.id,class:De(["md-row",{"is-current":at.id===e.status.modelId}]),role:"menuitem",onClick:pt=>ti(at.id)},[T("span",PY,[at.id===e.status.model||at.model===e.status.model||at.displayName===e.status.model?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",OY,O(at.displayName??at.model),1),Ns(at.id)?(w(),ve(Ye,{key:0,class:"md-star",name:"star",size:"sm"})):ie("",!0)],10,LY))),128)),bs.value.length>0?(w(),N("div",RY)):ie("",!0),T("button",{class:De(["md-row md-row-toggle",{"is-on":Sn.value,"is-disabled":!$n.value}]),role:"menuitem",disabled:!$n.value,onClick:it[15]||(it[15]=at=>Vt())},[T("span",BY,[Sn.value?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",FY,O(S(r)("status.thinkingLabel")),1),Ht.value==="always-on"?(w(),N("span",WY,O(S(r)("status.planOn")),1)):Ht.value==="unsupported"?(w(),N("span",HY,O(S(r)("status.modeNotSupported")),1)):ie("",!0)],10,DY),it[24]||(it[24]=T("div",{class:"md-divider"},null,-1)),T("button",{class:"md-row md-row-more",role:"menuitem",onClick:it[16]||(it[16]=at=>{ae(),i("pickModel")})},[T("span",zY,O(S(r)("status.moreModels")),1)])])):ie("",!0)],512)])],34))}}),iE=ft(UY,[["__scopeId","data-v-21024b3e"]]),qY=["id"],jY=["aria-expanded"],VY={class:"swarm-meta"},KY={class:"swarm-meta"},GY={class:"swarm-body"},YY={class:"row-name"},XY={key:0,class:"row-type"},QY={key:0,class:"row-activity"},ZY={class:"row-phase"},JY=Ve({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=ee(!0),s=W(()=>t.group.members.length),o=W(()=>t.group.counts.completed+t.group.counts.failed),i=W(()=>t.group.counts.working+t.group.counts.queued+t.group.counts.suspended),r=W(()=>i.value>0?"running":t.group.counts.failed>0?"error":"done"),l=W(()=>{switch(r.value){case"running":return`${i.value} running`;case"error":return"has failures";default:return"completed"}});function a(f){switch(f){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(f){return f.outputLines?.map(h=>h.trimEnd()).filter(Boolean).at(-1)}function u(f){return f.suspendedReason||c(f)||f.summary}function d(){n.value=!n.value}return(f,h)=>(w(),N("section",{class:De(["swarm-card",{open:n.value}]),id:`swarm-${e.group.id}`},[T("button",{class:"swarm-head",type:"button","aria-expanded":n.value,onClick:d},[Z(Ou,{status:r.value},null,8,["status"]),Z(Ye,{class:"swarm-ic",name:"git-pull-request",size:"sm"}),h[0]||(h[0]=T("span",{class:"swarm-title"},"Swarm",-1)),T("span",VY,"· "+O(o.value)+"/"+O(s.value),1),T("span",KY,"· "+O(l.value),1),Z(Ye,{class:"swarm-car",name:"chevron-right",size:"sm"})],8,jY),In(T("div",GY,[(w(!0),N(Pe,null,ot(e.group.members,p=>(w(),N("div",{key:p.id,class:De(["swarm-row",`phase-${p.phase}`])},[Z(Ou,{class:"row-dot",status:p.phase},null,8,["status"]),Z(ht,{text:p.name},{default:de(()=>[T("span",YY,O(p.name),1)]),_:2},1032,["text"]),p.subagentType?(w(),N("span",XY,O(p.subagentType),1)):ie("",!0),Z(ht,{text:u(p)},{default:de(()=>[u(p)?(w(),N("span",QY,O(u(p)),1)):ie("",!0)]),_:2},1032,["text"]),T("span",ZY,O(a(p.phase)),1)],2))),128))],512),[[Ko,n.value]])],10,qY))}}),eX=ft(JY,[["__scopeId","data-v-e56cfe7c"]]),tX={key:0,class:"ui-card__head"},nX={class:"ui-card__body"},sX={key:1,class:"ui-card__foot"},oX=Ve({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),N("div",tX,[Tn(t.$slots,"head",{},void 0,!0)])):ie("",!0),T("div",nX,[Tn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),N("div",sX,[Tn(t.$slots,"foot",{},void 0,!0)])):ie("",!0)],2))}}),oy=ft(oX,[["__scopeId","data-v-9c9f9a9a"]]),iX=["type","disabled"],rX={class:"ui-button__content"},lX=Ve({__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:De(["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(Jo,{key:0,size:"sm",class:"ui-button__spinner"})):ie("",!0),T("span",rX,[Tn(t.$slots,"default",{},void 0,!0)])],10,iX))}}),Ot=ft(lX,[["__scopeId","data-v-e58393a8"]]),aX={class:"goal-progress","aria-hidden":"true"},cX={class:"goal-full"},uX={key:0,class:"goal-criterion"},dX={class:"goal-stats"},fX={class:"goal-actions"},pX=Ve({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=ee(!1);Ge(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=W(()=>{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(oy,{class:De(["goal-strip",{expanded:i.value}])},j1({head:de(()=>[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:De(["goal-objective",{"expanded-hidden":i.value}])},O(e.goal.objective),3),Z(Ms,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:de(()=>[je(O(e.goal.status),1)]),_:1},8,["variant"]),T("span",aX,[T("span",{class:"goal-progress-fill",style:Qt({width:`${r.value}%`})},null,4)]),Z(Ye,{class:De(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:de(()=>[T("div",cX,O(e.goal.objective),1),e.goal.completionCriterion?(w(),N("div",uX,[c[5]||(c[5]=T("span",null,"Done when",-1)),T("p",null,O(e.goal.completionCriterion),1)])):ie("",!0),T("div",dX,[Z(Ms,{variant:"neutral",size:"sm"},{default:de(()=>[je(O(e.goal.turnsUsed)+" turns",1)]),_:1}),Z(Ms,{variant:"neutral",size:"sm"},{default:de(()=>[je(O(e.goal.tokensUsed.toLocaleString())+" tokens",1)]),_:1}),Z(Ms,{variant:"neutral",size:"sm"},{default:de(()=>[je(O(l(e.goal.wallClockMs)),1)]),_:1}),e.goal.budget.tokenBudget!==null?(w(),ve(Ms,{key:0,variant:"neutral",size:"sm"},{default:de(()=>[je(O(r.value)+"% token budget",1)]),_:1})):ie("",!0)])]),key:"0"}:void 0,i.value?{name:"foot",fn:de(()=>[T("div",fX,[e.goal.status!=="paused"?(w(),ve(Ot,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:c[1]||(c[1]=kt(u=>s("controlGoal","pause"),["stop"]))},{default:de(()=>[je(O(S(o)("status.goalPause")),1)]),_:1})):ie("",!0),e.goal.status==="paused"?(w(),ve(Ot,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:c[2]||(c[2]=kt(u=>s("controlGoal","resume"),["stop"]))},{default:de(()=>[je(O(S(o)("status.goalResume")),1)]),_:1})):ie("",!0),Z(Ot,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:c[3]||(c[3]=kt(u=>s("controlGoal","cancel"),["stop"]))},{default:de(()=>[je(O(S(o)("status.goalCancel")),1)]),_:1})])]),key:"1"}:void 0]),1032,["class"]))}}),hX=ft(pX,[["__scopeId","data-v-eaeefe1e"]]),mX={class:"qh"},gX={class:"qtitle"},vX={key:0,class:"qstep"},yX={key:1,class:"qmin-peek"},kX={class:"qbody"},bX=["aria-label"],_X=["aria-selected","aria-label","onClick"],wX={class:"qstep-num"},SX={key:1,class:"qheader-chip"},CX={class:"qtext"},xX={class:"qopts"},AX=["onClick"],TX={class:"qopt-key"},MX={class:"qopt-glyph"},EX={key:0,class:"chk"},IX={key:1,class:"rad"},$X={class:"qopt-text"},NX={class:"qopt-label"},LX={key:0,class:"qopt-desc"},PX={class:"qopt-glyph"},OX={key:0,class:"chk"},RX={key:1,class:"rad"},DX={class:"qopt-label"},BX=["placeholder"],FX={class:"qfoot"},WX=Ve({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Nt(),o=t,i=ee(0),r=ee(!1),l=W(()=>n.question.questions[i.value]),a=W(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(H){H>=0&&H<a.value&&(i.value=H)}function f(H){const z=p.value[H];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 f(l.value.id)}const p=ee({});function m(H){return H.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${H.label} ${H.description??""}`.toLowerCase())}function _(){const H={...p.value};let z=!1;for(const q of n.question.questions){if(H[q.id])continue;const Q=q.options.filter(m);Q.length!==0&&(H[q.id]=q.multiSelect?{kind:"multi",optionIds:Q.map(X=>X.id)}:{kind:"single",optionId:Q[0].id},z=!0)}z&&(p.value=H)}Ge(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),Ge(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),_()},{immediate:!0,deep:!0});function b(H,z){const q=p.value[H];if(q&&q.kind==="single"&&q.optionId===z){const Q={...p.value};delete Q[H],p.value=Q}else p.value={...p.value,[H]:{kind:"single",optionId:z}}}function g(H,z){const q=p.value[H],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 ue=p.value[H],ge=ue&&ue.kind==="multiWithOther"?ue.otherText:"";ge?p.value={...p.value,[H]:{kind:"multiWithOther",optionIds:Q,otherText:ge}}:p.value={...p.value,[H]:{kind:"multi",optionIds:Q}}}const v=ee({}),y=ee(null);function C(H){const z=n.question.questions.find(Q=>Q.id===H),q=v.value[H]??"";if(z.multiSelect){const Q=p.value[H],X=Q&&(Q.kind==="multi"||Q.kind==="multiWithOther")?Q.kind==="multi"?[...Q.optionIds]:[...Q.optionIds]:[];p.value={...p.value,[H]:{kind:"multiWithOther",optionIds:X,otherText:q}}}else p.value={...p.value,[H]:{kind:"other",text:q}}}function L(H){C(H),vt(()=>y.value?.focus())}function I(H,z){const q=p.value[H];return q?q.kind==="single"?q.optionId===z:q.kind==="multi"||q.kind==="multiWithOther"?q.optionIds.includes(z):!1:!1}function k(H){const z=p.value[H];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function M(){return n.question.questions.every(H=>f(H.id))}const E=W(()=>n.busyKind==="answer"),P=W(()=>n.busyKind==="dismiss"),A=W(()=>!!n.busyKind);function $(){if(A.value||!M())return;const H={answers:p.value,method:"click"};o("answer",n.question.questionId,H)}function D(){A.value||o("dismiss",n.question.questionId)}function R(H){const z=(document.activeElement?.tagName??"").toLowerCase(),q=z==="input"||z==="textarea";if(A.value)return;if(H.key==="Enter"){if(H.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():M()&&$();return}if(q)return;if(H.key==="Escape"){H.preventDefault(),D();return}if(r.value)return;const Q=parseInt(H.key,10);if(!isNaN(Q)&&Q>=1&&Q<=9){H.preventDefault();const X=l.value,ue=Q-1,ge=X.options[ue];ge&&(X.multiSelect?g(X.id,ge.id):b(X.id,ge.id))}}return _n(()=>document.addEventListener("keydown",R)),wn(()=>document.removeEventListener("keydown",R)),(H,z)=>(w(),ve(oy,{class:De(["qcard",{minimized:r.value}])},j1({head:de(()=>[T("div",mX,[z[5]||(z[5]=T("span",{class:"qh-ic"},"?",-1)),T("span",gX,O(S(s)("question.title")),1),a.value>1&&!r.value?(w(),N("span",vX,O(S(s)("question.step",{current:i.value+1,total:a.value})),1)):ie("",!0),r.value?(w(),N("span",yX,O(l.value.question),1)):ie("",!0),Z(ht,{text:r.value?S(s)("question.expand"):S(s)("question.minimize")},{default:de(()=>[Z(dn,{class:"qmin",size:"sm",label:r.value?S(s)("question.expand"):S(s)("question.minimize"),onClick:z[0]||(z[0]=q=>r.value=!r.value)},{default:de(()=>[r.value?(w(),ve(Ye,{key:0,name:"chevron-down",size:"md"})):(w(),ve(Ye,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])]),_:1},8,["text"])])]),_:2},[r.value?void 0:{name:"default",fn:de(()=>[T("div",kX,[a.value>1?(w(),N("div",{key:0,class:"qsteps",role:"tablist","aria-label":S(s)("question.step",{current:i.value+1,total:a.value})},[(w(!0),N(Pe,null,ot(n.question.questions,(q,Q)=>(w(),N("button",{key:q.id,type:"button",class:De(["qstep-dot",{active:Q===i.value,answered:f(q.id)}]),"aria-selected":Q===i.value,"aria-label":S(s)("question.step",{current:Q+1,total:a.value}),onClick:X=>d(Q)},[T("span",wX,O(Q+1),1)],10,_X))),128))],8,bX)):ie("",!0),l.value.header?(w(),N("div",SX,[Z(Ms,{variant:"neutral",size:"sm"},{default:de(()=>[je(O(l.value.header),1)]),_:1})])):ie("",!0),T("div",CX,O(l.value.question),1),l.value.body?(w(),ve(Eh,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ie("",!0),T("div",xX,[(w(!0),N(Pe,null,ot(l.value.options,(q,Q)=>(w(),N("label",{key:q.id,class:De(["qopt",{selected:I(l.value.id,q.id)}]),onClick:kt(X=>l.value.multiSelect?g(l.value.id,q.id):b(l.value.id,q.id),["prevent"])},[T("span",TX,O(Q+1),1),T("span",MX,[l.value.multiSelect?(w(),N("span",EX,O(I(l.value.id,q.id)?"■":"□"),1)):(w(),N("span",IX,O(I(l.value.id,q.id)?"●":"○"),1))]),T("span",$X,[T("span",NX,O(q.label),1),q.description?(w(),N("span",LX,O(q.description),1)):ie("",!0)])],10,AX))),128)),l.value.allowOther?(w(),N("label",{key:0,class:De(["qopt",{selected:k(l.value.id)}]),onClick:z[4]||(z[4]=kt(q=>L(l.value.id),["prevent"]))},[z[6]||(z[6]=T("span",{class:"qopt-key"},null,-1)),T("span",PX,[l.value.multiSelect?(w(),N("span",OX,O(k(l.value.id)?"■":"□"),1)):(w(),N("span",RX,O(k(l.value.id)?"●":"○"),1))]),T("span",DX,O(l.value.otherLabel??S(s)("question.otherDefault")),1),In(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??S(s)("question.otherDefault"),onInput:z[2]||(z[2]=q=>C(l.value.id)),onFocus:z[3]||(z[3]=q=>C(l.value.id))},null,40,BX),[[go,v.value[l.value.id]]])],2)):ie("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:de(()=>[T("div",FX,[i.value<a.value-1?(w(),ve(Ot,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:de(()=>[je(O(S(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),ve(Ot,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!M(),loading:E.value,onClick:$},{default:de(()=>[je(O(S(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),ve(Ot,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||A.value,onClick:c},{default:de(()=>[je(O(S(s)("question.back")),1)]),_:1},8,["disabled"])):ie("",!0),Z(Ot,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:P.value,disabled:A.value,onClick:D},{default:de(()=>[je(O(S(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),HX=ft(WX,[["__scopeId","data-v-8ac59f58"]]),zX={class:"ah"},UX={class:"akind"},qX={class:"apath"},jX={class:"ah-path"},VX={key:1,class:"diff"},KX={class:"dg"},GX={class:"dc"},YX={key:2,class:"body-shell"},XX={class:"shell-cmd"},QX={key:0,class:"shell-cwd"},ZX={key:1,class:"shell-danger"},JX={key:3,class:"body-file"},eQ={class:"file-bar"},tQ={class:"file-lang"},nQ={class:"file-content"},sQ={class:"file-ln"},oQ={class:"file-text"},iQ={key:4,class:"body-chip"},rQ={class:"chip-label"},lQ={class:"chip-value"},aQ={key:0,class:"chip-detail"},cQ={key:5,class:"body-chip"},uQ={key:0,class:"chip-label"},dQ={class:"chip-value"},fQ={key:6,class:"body-chip"},pQ={class:"chip-label"},hQ={class:"chip-value"},mQ={key:0,class:"chip-detail"},gQ={key:7,class:"body-chip"},vQ={class:"chip-label"},yQ={class:"chip-value"},kQ={key:0,class:"chip-detail"},bQ={key:8,class:"body-todo"},_Q={class:"todo-glyph"},wQ={key:9,class:"body-plan"},SQ={key:10,class:"body-generic"},CQ={class:"gen-text"},xQ={key:11,class:"feedback-wrap"},AQ=["placeholder"],TQ={class:"feedback-hint"},MQ={key:0,class:"plan-actions"},EQ={class:"k"},IQ={key:0,class:"k"},$Q={key:0,class:"k"},NQ={key:1,class:"abtn"},LQ=Ve({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=W(()=>{const E=n.block;return E.kind!=="plan_review"?null:{plan:E.plan,path:E.path,options:E.options??[]}}),r=ee(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const E=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${E}`)}const c=ee(!1),u=ee(""),d=ee(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const E=u.value.trim();i.value?b("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:E||void 0}):b("feedback",{decision:"rejected",feedback:E||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(E){E.key==="Enter"&&!E.shiftKey?(E.preventDefault(),h()):E.key==="Escape"&&(E.preventDefault(),p())}const _=ee(null);Ge(()=>n.busy,E=>{E||(_.value=null)});function b(E,P){n.busy||(_.value=E,s("decide",P))}function g(){b("approve",{decision:"approved"})}function v(){b("approveSession",{decision:"approved",scope:"session"})}function y(){b("reject",{decision:"rejected"})}function C(){b("approvePlan",{decision:"approved"})}function L(E){b(`option:${E}`,{decision:"approved",selectedLabel:E})}function I(){n.busy||f()}function k(){b("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function M(E){const P=(document.activeElement?.tagName??"").toLowerCase();if(P==="input"||P==="textarea"||n.busy||r.value)return;const A=i.value;if(A){if(A.options.length===0){E.key==="1"?(E.preventDefault(),C()):E.key==="2"?(E.preventDefault(),I()):E.key==="3"&&(E.preventDefault(),k());return}E.key==="1"&&A.options[0]?(E.preventDefault(),L(A.options[0].label)):E.key==="2"&&A.options[1]?(E.preventDefault(),L(A.options[1].label)):E.key==="3"&&A.options[2]&&(E.preventDefault(),L(A.options[2].label));return}E.key==="1"?(E.preventDefault(),g()):E.key==="2"?(E.preventDefault(),v()):E.key==="3"?(E.preventDefault(),y()):E.key==="4"&&(E.preventDefault(),f())}return _n(()=>document.addEventListener("keydown",M)),wn(()=>document.removeEventListener("keydown",M)),(E,P)=>(w(),ve(oy,{class:De(["appr",{minimized:r.value}])},j1({head:de(()=>[T("div",zX,[P[2]||(P[2]=T("span",{class:"ah-ic"},"!",-1)),T("span",UX,O(a()),1),T("span",qX,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),N(Pe,{key:0},[je(O(e.block.path),1)],64)):e.block.kind==="shell"?(w(),N(Pe,{key:1},[je(O(e.block.command),1)],64)):e.block.kind==="url"?(w(),N(Pe,{key:2},[je(O(e.block.url),1)],64)):e.block.kind==="search"?(w(),N(Pe,{key:3},[je(O(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),N(Pe,{key:4},[je(O(e.block.name),1)],64)):e.block.kind==="generic"?(w(),N(Pe,{key:5},[je(O(e.block.summary),1)],64)):ie("",!0)]),e.agentName&&!r.value?(w(),ve(Ms,{key:0,variant:"neutral",size:"sm"},{default:de(()=>[je(O(S(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ie("",!0),r.value?ie("",!0):(w(),ve(Ms,{key:1,variant:"warning",size:"sm",class:"aw"},{default:de(()=>[je(O(S(o)("approval.required")),1)]),_:1})),Z(ht,{text:r.value?S(o)("question.expand"):S(o)("question.minimize")},{default:de(()=>[Z(dn,{class:"amin",size:"sm",label:r.value?S(o)("question.expand"):S(o)("question.minimize"),onClick:P[0]||(P[0]=A=>r.value=!r.value)},{default:de(()=>[r.value?(w(),ve(Ye,{key:0,name:"chevron-down",size:"md"})):(w(),ve(Ye,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])]),_:1},8,["text"])])]),_:2},[r.value?void 0:{name:"default",fn:de(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),ve(ht,{key:0,text:e.block.path},{default:de(()=>[T("div",jX,O(e.block.path),1)]),_:1},8,["text"])):ie("",!0),e.block.kind==="diff"?(w(),N("div",VX,[(w(!0),N(Pe,null,ot(e.block.diff,(A,$)=>(w(),N("div",{key:$,class:De(["dl",A.kind==="add"?"add":A.kind==="rem"?"del":""])},[T("span",KX,O(A.gutter),1),T("span",GX,O(A.text),1)],2))),128))])):e.block.kind==="shell"?(w(),N("div",YX,[T("div",XX,[P[3]||(P[3]=T("span",{class:"shell-dollar"},"$",-1)),je(" "+O(e.block.command),1)]),e.block.cwd?(w(),N("div",QX,"cwd: "+O(e.block.cwd),1)):ie("",!0),e.block.danger?(w(),N("div",ZX,O(S(o)("approval.danger",{detail:e.block.danger})),1)):ie("",!0)])):e.block.kind==="file"?(w(),N("div",JX,[T("div",eQ,[T("span",tQ,O(e.block.language??""),1)]),T("div",nQ,[(w(!0),N(Pe,null,ot(e.block.content.split(`
|
|
255
|
-
`),(A,$)=>(w(),N("div",{key:$,class:"file-line"},[T("span",sQ,O($+1),1),T("span",oQ,O(A),1)]))),128))])])):e.block.kind==="fileop"?(w(),N("div",iQ,[T("span",rQ,O(e.block.op),1),T("span",lQ,O(e.block.path),1),e.block.detail?(w(),N("span",aQ,O(e.block.detail),1)):ie("",!0)])):e.block.kind==="url"?(w(),N("div",cQ,[e.block.method?(w(),N("span",uQ,O(e.block.method),1)):ie("",!0),T("span",dQ,O(e.block.url),1)])):e.block.kind==="search"?(w(),N("div",fQ,[T("span",pQ,O(S(o)("approval.searchQueryLabel")),1),T("span",hQ,O(e.block.query),1),e.block.scope?(w(),N("span",mQ,O(S(o)("approval.searchScope",{scope:e.block.scope})),1)):ie("",!0)])):e.block.kind==="invocation"?(w(),N("div",gQ,[T("span",vQ,O(e.block.kind2),1),T("span",yQ,O(e.block.name),1),e.block.description?(w(),N("span",kQ,O(e.block.description),1)):ie("",!0)])):e.block.kind==="todo"?(w(),N("div",bQ,[(w(!0),N(Pe,null,ot(e.block.items,(A,$)=>(w(),N("div",{key:$,class:"todo-item"},[T("span",_Q,O(A.status==="done"||A.status==="completed"?"✓":"○"),1),T("span",{class:De(["todo-title",{"todo-done":A.status==="done"||A.status==="completed"}])},O(A.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),N("div",wQ,[Z(Eh,{text:e.block.plan},null,8,["text"])])):(w(),N("div",SQ,[T("span",CQ,O(e.block.summary),1)])),c.value?(w(),N("div",xQ,[In(T("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":P[1]||(P[1]=A=>u.value=A),class:"feedback-ta",placeholder:S(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,AQ),[[go,u.value]]),T("div",TQ,O(S(o)("approval.feedbackHint")),1)])):ie("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:de(()=>[i.value?(w(),N("div",MQ,[i.value.options.length>0?(w(!0),N(Pe,{key:0},ot(i.value.options,(A,$)=>(w(),ve(ht,{key:$,text:A.description},{default:de(()=>[Z(Ot,{class:"kbtn",size:"sm",variant:"primary",loading:_.value===`option:${A.label}`,disabled:e.busy,onClick:D=>L(A.label)},{default:de(()=>[je(O(A.label),1),T("span",EQ,"["+O($+1)+"]",1)]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),ve(Ot,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approvePlan",disabled:e.busy,onClick:C},{default:de(()=>[je(O(S(o)("approval.approvePlan")),1),P[4]||(P[4]=T("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"])),Z(Ot,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:I},{default:de(()=>[je(O(S(o)("approval.revise")),1),i.value.options.length===0?(w(),N("span",IQ,"[2]")):ie("",!0)]),_:1},8,["disabled"]),Z(Ot,{class:"kbtn",size:"sm",variant:"danger-soft",loading:_.value==="rejectAndExit",disabled:e.busy,onClick:k},{default:de(()=>[je(O(S(o)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),N("span",$Q,"[3]")):ie("",!0)]),_:1},8,["loading","disabled"])])):(w(),N("div",NQ,[Z(Ot,{class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approve",disabled:e.busy,onClick:g},{default:de(()=>[je(O(S(o)("approval.approve")),1),P[5]||(P[5]=T("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"]),Z(Ot,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="approveSession",disabled:e.busy,onClick:v},{default:de(()=>[je(O(S(o)("approval.approveSession")),1),P[6]||(P[6]=T("span",{class:"k"},"[2]",-1))]),_:1},8,["loading","disabled"]),Z(Ot,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="reject",disabled:e.busy,onClick:y},{default:de(()=>[je(O(S(o)("approval.reject")),1),P[7]||(P[7]=T("span",{class:"k"},"[3]",-1))]),_:1},8,["loading","disabled"]),Z(Ot,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:de(()=>[je(O(S(o)("approval.feedback")),1),P[8]||(P[8]=T("span",{class:"k"},"[4]",-1))]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),PQ=ft(LQ,[["__scopeId","data-v-0a8b61ae"]]),OQ=Ve({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(w(),N("span",{class:De(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),rE=ft(OQ,[["__scopeId","data-v-f595d935"]]),RQ={class:"taskspane"},DQ={class:"tp-head"},BQ={class:"tp-title"},FQ={class:"tp-count"},WQ={class:"tp-list"},HQ={key:0,class:"tp-empty"},zQ=["role","onClick"],UQ={class:"tp-name"},qQ={class:"tp-time"},jQ=["onClick"],VQ={key:0,class:"tp-detail"},KQ={key:0,class:"tp-codebox"},GQ=["onClick"],YQ={class:"tp-pre"},XQ={class:"tp-cmd"},QQ={key:1,class:"tp-codebox"},ZQ=["onClick"],JQ={class:"tp-pre"},eZ=Ve({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Nt(),o=Es(new Set),i=Es(new Set),r=Es(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(o.has(p.id)?o.delete(p.id):o.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,m,_){await Ws(p)&&(_.add(m),setTimeout(()=>_.delete(m),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const m=p.output?.join(`
|
|
256
|
-
`)??"";m&&await d(m,p.id,r)}return(p,m)=>(w(),N("div",RQ,[T("div",DQ,[T("span",BQ,O(S(s)("tasks.tag")),1),T("span",FQ,O(e.tasks.length),1)]),T("div",WQ,[e.tasks.length===0?(w(),N("div",HQ,O(S(s)("tasks.emptyTasks")),1)):(w(!0),N(Pe,{key:1},ot(e.tasks,_=>(w(),N("div",{key:_.id,class:De(["tp-row",{done:_.state==="done",fail:_.state==="fail",expandable:c(_)}])},[T("div",{class:"tp-main",role:c(_)?"button":void 0,onClick:b=>a(_)},[Z(rE,{status:u(_.state)},null,8,["status"]),T("span",UQ,O(_.name),1),Z(Ms,{variant:"neutral",size:"sm"},{default:de(()=>[je(O(_.kind),1)]),_:2},1024),T("span",qQ,O(_.timing),1),_.state==="run"?(w(),N("button",{key:0,class:"tp-stop",onClick:kt(b=>n("cancel",_.id),["stop"])},O(S(s)("tasks.stop")),9,jQ)):ie("",!0),_.kind==="subagent"?(w(),ve(Ye,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(_)?(w(),ve(Ye,{key:2,class:De(["tp-chevron",{open:o.has(_.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ie("",!0)],8,zQ),o.has(_.id)&&l(_)?(w(),N("div",VQ,[_.meta?(w(),N("div",KQ,[T("button",{class:De(["tp-copy",{copied:i.has(_.id)}]),onClick:kt(b=>f(_),["stop"])},O(i.has(_.id)?"已复制":"复制"),11,GQ),T("pre",YQ,[T("code",null,[T("span",XQ,O(_.meta),1)])])])):ie("",!0),_.output&&_.output.length>0?(w(),N("div",QQ,[T("button",{class:De(["tp-copy",{copied:r.has(_.id)}]),onClick:kt(b=>h(_),["stop"])},O(r.has(_.id)?"已复制":"复制"),11,ZQ),T("pre",JQ,[T("code",null,[m[0]||(m[0]=je(`
|
|
257
|
-
`,-1)),(w(!0),N(Pe,null,ot(_.output,(b,g)=>(w(),N("span",{key:g,class:"tp-line"},O(b),1))),128)),m[1]||(m[1]=je(`
|
|
258
|
-
`,-1))])])])):ie("",!0)])):ie("",!0)],2))),128))])]))}}),gC=ft(eZ,[["__scopeId","data-v-28fd5fc0"]]),tZ={class:"todo-card"},nZ={key:0,class:"tc-empty"},sZ={class:"tc-name"},oZ=Ve({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Nt();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(w(),N("div",tZ,[t.todos.length===0?(w(),N("div",nZ,[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,O(S(n)("tasks.emptyTodo")),1)])):ie("",!0),(w(!0),N(Pe,null,ot(t.todos,(r,l)=>(w(),N("div",{key:l,class:De(["tc-row",`s-${r.status}`])},[Z(rE,{status:s(r.status)},null,8,["status"]),T("span",sZ,O(r.title),1)],2))),128))]))}}),iZ=ft(oZ,[["__scopeId","data-v-5ad486e3"]]),rZ=["disabled","aria-pressed"],lZ=Ve({__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:De(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Tn(t.$slots,"default",{},void 0,!0)],10,rZ)):(w(),N("span",{key:1,class:De(["ui-pill",{"is-active":e.active}])},[Tn(t.$slots,"default",{},void 0,!0)],2))}}),qg=ft(lZ,[["__scopeId","data-v-317ace1a"]]),aZ={class:"dock-work-head"},cZ={key:0,class:"dock-work-tab static"},uZ={key:1,class:"dock-work-tab static"},dZ={key:2,class:"dock-work-tab static"},fZ={class:"dock-work-body"},pZ={class:"dw-count"},hZ={class:"dw-count"},mZ={class:"dw-count"},gZ=Ve({__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 s=e,o=n,{t:i}=Nt(),r=ee(null),l=ee(null),a=ee(null);function c(f){r.value?.loadForEdit(f)}function u(){r.value?.focus()}function d(f){if(!s.dockPanel)return;const h=f.target;h&&(l.value?.contains(h)||a.value?.contains(h)||o("close-dock-panel"))}return Ge(()=>s.dockPanel,f=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),f&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),wn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c,focus:u}),(f,h)=>(w(),N("div",{class:De(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[28]||(h[28]=kt(()=>{},["stop"]))},[Z(Vr,{name:"dock-panel"},{default:de(()=>[e.dockPanel?(w(),N("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[3]||(h[3]=kt(()=>{},["stop"]))},[T("div",aZ,[e.dockPanel==="bash"?(w(),N("span",cZ,O(S(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(S(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),N("span",uZ,O(S(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(S(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),N("span",dZ,O(S(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):ie("",!0)]),T("div",fZ,[e.dockPanel==="bash"?(w(),ve(gC,{key:0,tasks:e.bashTasks,onCancel:h[0]||(h[0]=p=>o("cancelTask",p))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),ve(gC,{key:1,tasks:e.subagentTasks,onCancel:h[1]||(h[1]=p=>o("cancelTask",p)),onOpen:h[2]||(h[2]=p=>o("openAgent",p))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),ve(iZ,{key:2,todos:e.todos??[]},null,8,["todos"])):ie("",!0)])],512)):ie("",!0)]),_:1}),e.goal?(w(),ve(hX,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[4]||(h[4]=p=>o("controlGoal",p))},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(qg,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:h[5]||(h[5]=p=>o("toggle-dock-panel","bash"))},{default:de(()=>[Z(Ye,{name:"clock",size:"md"}),T("span",null,O(S(i)("tasks.dockBash")),1),T("span",pZ,[h[29]||(h[29]=je("(",-1)),T("b",null,O(e.bashTasks.length),1),h[30]||(h[30]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0),e.subagentTasks.length>0?(w(),ve(qg,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:h[6]||(h[6]=p=>o("toggle-dock-panel","subagent"))},{default:de(()=>[Z(Ye,{name:"sparkles",size:"md"}),T("span",null,O(S(i)("tasks.dockSubagent")),1),T("span",hZ,[h[31]||(h[31]=je("(",-1)),T("b",null,O(e.subagentTasks.length),1),h[32]||(h[32]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0),(e.todos?.length??0)>0?(w(),ve(qg,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:h[7]||(h[7]=p=>o("toggle-dock-panel","todos"))},{default:de(()=>[Z(Ye,{name:"check-list",size:"md"}),T("span",null,O(S(i)("tasks.dockTodos")),1),T("span",mZ,[h[33]||(h[33]=je("(",-1)),T("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),h[34]||(h[34]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0)],512)):ie("",!0),e.pendingQuestion?(w(),ve(HX,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:h[8]||(h[8]=(p,m)=>o("answer",p,m)),onDismiss:h[9]||(h[9]=p=>o("dismiss",p))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),ve(PQ,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:h[10]||(h[10]=p=>o("approval",e.pendingApproval.approvalId,p))},null,8,["block","agent-name","busy"])):(w(),ve(iE,{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]=p=>o("submit",p)),onSteer:h[12]||(h[12]=p=>o("steer",p)),onCommand:h[13]||(h[13]=p=>o("command",p)),onInterrupt:h[14]||(h[14]=p=>o("interrupt")),onSetPermission:h[15]||(h[15]=p=>o("setPermission",p)),onSetThinking:h[16]||(h[16]=p=>o("setThinking",p)),onTogglePlan:h[17]||(h[17]=p=>o("togglePlan")),onToggleSwarm:h[18]||(h[18]=p=>o("toggleSwarm")),onToggleGoal:h[19]||(h[19]=p=>o("toggleGoal")),onOpenBtw:h[20]||(h[20]=p=>o("openBtw")),onCreateGoal:h[21]||(h[21]=p=>o("createGoal",p)),onControlGoal:h[22]||(h[22]=p=>o("controlGoal",p)),onFocusGoal:h[23]||(h[23]=p=>o("focusGoal")),onFocusSwarm:h[24]||(h[24]=p=>o("focusSwarm")),onCompact:h[25]||(h[25]=p=>o("compact")),onPickModel:h[26]||(h[26]=p=>o("pickModel")),onSelectModel:h[27]||(h[27]=p=>o("selectModel",p))},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))}}),vZ=ft(gZ,[["__scopeId","data-v-c6b691c5"]]),yZ=["aria-label","aria-hidden"],kZ={class:"toc-scroll"},bZ=["onClick"],_Z={class:"toc-label"},wZ=240,SZ=Ve({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=ee(null),r=ee(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=wZ}const c=W(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ge(c,u=>{l?.disconnect(),l=null,u&&vt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),hs(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),N("nav",{key:0,ref_key:"navRef",ref:i,class:De(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":S(o)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[T("div",kZ,[(w(!0),N(Pe,null,ot(e.items,f=>(w(),N("button",{key:f.id,type:"button",class:De(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>s("select",f.id)},[d[0]||(d[0]=T("span",{class:"toc-bar"},null,-1)),T("span",_Z,O(f.title),1)],10,bZ))),128))])],10,yZ)):ie("",!0)}}),CZ=ft(SZ,[["__scopeId","data-v-0a2a2a96"]]),xZ=5;function AZ(e,t,n,s=xZ){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const TZ={class:"chat-layout"},MZ={class:"empty-hint"},EZ={class:"empty-hint-title"},IZ={class:"empty-hint-text"},$Z={key:0,class:"ws-pick"},NZ={class:"ws-pick-name"},LZ={key:1,class:"ws-pick-menu"},PZ=["onClick"],OZ={class:"ws-pick-item-name"},RZ={class:"ws-pick-item-path"},DZ={key:0,class:"swarm-stack"},BZ=["aria-label"],FZ={key:0,class:"abort-toast",role:"status","aria-live":"polite"},WZ={class:"abort-toast-text"},jg=80,vC=1e3,HZ=420,zZ=3e3,UZ=Ve({__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 s=e,o=n,i=ee(!1),r=ee(!1),l=W(()=>s.workspaces?.find(_e=>_e.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=W(()=>(s.workspaces?.length??0)>0),c=W(()=>AZ(s.workspaces??[],s.activeWorkspaceId,r.value)),u=W(()=>(s.workspaces?.length??0)-c.value.length);Ge(i,Ie=>{Ie||(r.value=!1)});const d=W(()=>s.swarms?.filter(Ie=>Ie.members.some(_e=>_e.phase!=="completed"&&_e.phase!=="failed"))??[]);function f(Ie){i.value=!1,Ie!==s.activeWorkspaceId&&o("selectWorkspace",Ie)}const{t:h}=Nt();oc($t.contentAlign);const p=ee(null),m=ee(null),_=ee(null),b=ee(!1),g=ee(0);let v=null;function y(Ie){(_.value??m.value)?.loadForEdit(Ie)}function C(){b.value=!0,v!==null&&clearTimeout(v),v=setTimeout(()=>{v=null,b.value=!1},2e3)}function L(){g.value++}function I(){vt(()=>{Ue.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const k=W(()=>s.tasks.filter(Ie=>Ie.kind!=="subagent")),M=W(()=>s.tasks.filter(Ie=>Ie.kind==="subagent"&&Ie.runInBackground)),E=W(()=>k.value.filter(Ie=>Ie.state==="run").length),P=W(()=>M.value.filter(Ie=>Ie.state==="run").length);function A(Ie){const _e=s.tasks,Re=_e.find(Ut=>Ut.id===Ie)??_e.find(Ut=>Ut.parentToolCallId===Ie);if(Re)return Re.id;const ln=_e.filter(Ut=>Ut.kind==="subagent"&&!Ut.parentToolCallId);if(ln.length===1)return ln[0].id}Pn("resolveAgentTaskId",A);const $=W(()=>(s.todos??[]).filter(Ie=>Ie.status==="done").length),D=W(()=>k.value.length>0||M.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),R=ee(null),H=W(()=>s.gitInfo?s.changes?.length??0:0);function z(Ie){R.value=R.value===Ie?null:Ie}function q(){R.value=null}Ge(D,Ie=>{Ie||q()});function Q(Ie){if(Ie.role==="compaction")return h("conversation.compactedPlain");if(Ie.role==="user"){if(Ie.skillActivation)return`/${Ie.skillActivation.name}`;if(Ie.pluginCommand)return`/${Ie.pluginCommand.pluginId}:${Ie.pluginCommand.commandName}`;const Re=Ie.text.trim().replaceAll(/\s+/g," ");return Re.length>0?Re:"user"}const _e=(Ie.text||Ie.thinking||"").trim().replaceAll(/\s+/g," ");return _e.length>0?_e:(Ie.tools?.length??0)>0?`${Ie.tools.length} tools`:"kimi"}const X=W(()=>s.turns.filter(Ie=>Ie.role==="user").map((Ie,_e)=>({id:Ie.id,role:Ie.role,no:_e+1,title:Q(Ie)}))),ue=ee(null);function ge(){const Ie=Ue.value;if(!Ie)return;const _e=Ie.querySelectorAll(".turn-anchor[data-turn-id]");if(_e.length===0)return;const Re=X.value;if(Re.length===0)return;const ln=new Set(Re.map(vo=>vo.id));if(j()<=jg){ue.value=Re[Re.length-1].id;return}const Ut=Ie.getBoundingClientRect(),as=Ut.height/2;let Bn=null;_e.forEach(vo=>{const si=vo.dataset.turnId;if(!si||!ln.has(si))return;vo.getBoundingClientRect().top-Ut.top<=as&&(Bn=si)}),ue.value=Bn??Re[0].id}const xe=W(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),ke=W(()=>{const Ie=xe.value;if(Ie)return s.pendingQuestionActions?.[Ie.questionId]}),ze=W(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),qe=W(()=>{const Ie=ze.value;return Ie?!!s.pendingApprovalActions?.[Ie.approvalId]:!1}),Ue=ee(null),Le=ee(null),le=ee(0),F=ee(0),ne=W(()=>({"--panes-scrollbar-width":`${le.value}px`}));function te(Ie){return Ie instanceof HTMLElement?Ie:Ie&&"$el"in Ie&&Ie.$el instanceof HTMLElement?Ie.$el:null}function U(){const Ie=Ue.value;le.value=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0,F.value=Le.value?.offsetHeight??0}function Y(Ie){const _e=te(Ie);Ue.value=_e,_e&&Ns()}function fe(Ie){const _e=te(Ie);Le.value=_e??null,Ie&&"loadForEdit"in Ie&&typeof Ie.loadForEdit=="function"&&"focus"in Ie&&typeof Ie.focus=="function"?_.value={loadForEdit:Ie.loadForEdit.bind(Ie),focus:Ie.focus.bind(Ie)}:_.value=null,pn()}const se=ee(!0),ce=ee(!1);function j(){const Ie=Ue.value;return Ie?Ie.scrollHeight-Ie.scrollTop-Ie.clientHeight:0}let G=0,re=0,me=0,Ae=0,Ee=0,ae=0;function Ce(){return Date.now()<re}function Xe(){const Ie=Ue.value;if(!Ie)return;const _e=Ie.scrollTop;if(performance.now()-me<100){G=_e;return}const Re=j();if(Ce()){se.value=!0,ce.value=!1,G=_e;return}_e<G-1&&Re>1?se.value=!1:Re<=jg&&_e>G+1&&(se.value=!0,ce.value=!1),G=_e,ge()}function tt(Ie=!1){const _e=Ue.value;se.value=!0,ce.value=!1,_e&&(!Ie&&performance.now()<Ae||(Ie&&typeof _e.scrollTo=="function"?(me=performance.now(),Ae=performance.now()+HZ,_e.scrollTo({top:_e.scrollHeight,behavior:"smooth"})):_e.scrollTop=_e.scrollHeight,G=_e.scrollTop))}function xt(Ie,_e){const Re=Ie.querySelectorAll(".turn-anchor");for(const ln of Re)if(ln.offsetTop>=_e){const Ut=ln.dataset.turnId;if(Ut)return{id:Ut,top:ln.offsetTop}}return null}async function wt(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Ie=s.sessionId,_e=Ue.value,Re=_e?.scrollTop??0,ln=_e?.scrollHeight??0,Ut=_e?xt(_e,Re):null;zs.value=!0;try{await s.loadOlderMessages(Ie),await vt()}finally{zs.value=!1}if(s.sessionId!==Ie)return;const as=Ue.value;if(!as)return;let Bn=0;if(Ut){const vo=as.querySelector(`.turn-anchor[data-turn-id="${It(Ut.id)}"]`);vo&&(Bn=vo.offsetTop-Ut.top)}Bn===0&&(Bn=as.scrollHeight-ln),as.scrollTop=Re+Bn}function It(Ie){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ie):Ie.replaceAll(/["\\]/g,"\\$&")}function Wt(Ie){const _e=Ue.value;if(!_e)return;const Re=_e.querySelector(`.turn-anchor[data-turn-id="${It(Ie)}"]`);Re&&(se.value=!1,ce.value=j()>jg,Re.scrollIntoView({behavior:"smooth",block:"center"}))}function _t(){const Ie=Ue.value;if(!Ie)return"none";const _e=Ie.firstElementChild,Re=_e instanceof HTMLElement?_e.offsetHeight:0,ln=Le.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${Re}:${ln}`}function Ht(Ie){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ie):setTimeout(Ie,16)}function $n(Ie){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ie):clearTimeout(Ie)}function Sn(Ie=36){if(!se.value&&!Ce())return;const _e=++ae;let Re="",ln=0,Ut=0;Ee&&($n(Ee),Ee=0);const as=()=>{if(Ee=0,_e!==ae||!se.value&&!Ce())return;tt(!1);const Bn=_t();ln=Bn===Re?ln+1:0,Re=Bn,Ut++,ln<3&&Ut<Ie&&(Ee=Ht(as))};Ee=Ht(as)}function Vt(Ie,_e){return Ie!==void 0&&Ie.length>0&&_e.length>=Ie.length&&Ie.firstId!==_e.firstId&&Ie.lastId===_e.lastId&&Ie.lastTextLen===_e.lastTextLen&&Ie.lastThinkingLen===_e.lastThinkingLen&&Ie.lastToolsLen===_e.lastToolsLen&&Ie.approvalIds===_e.approvalIds}const Kt=W(()=>{const Ie=(s.approvals??[]).map(as=>as.approvalId).join(","),_e=s.turns,Re=_e.at(-1),ln=Re?.thinking?.length??0,Ut=Re?.tools?.reduce((as,Bn)=>as+Bn.name.length+(Bn.arg?.length??0)+(Bn.output?.join("").length??0),0)??0;return{length:_e.length,firstId:_e[0]?.id??"",lastId:Re?.id??"",lastTextLen:Re?.text.length??0,lastThinkingLen:ln,lastToolsLen:Ut,approvalIds:Ie}});Ge(Kt,async(Ie,_e)=>{if(zs.value&&Vt(_e,Ie)){ge();return}await vt(),se.value||Ce()?tt(Ie.length<_e.length):ce.value=!0,ge()}),Ge(Le,()=>{pn()}),Ge(()=>s.mobile,async()=>{await vt(),U()});const Qn=new Map;Ge(()=>s.fileReloadKey,async(Ie,_e)=>{const Re=Ue.value;_e&&Re&&Qn.set(String(_e),{top:Re.scrollTop,following:se.value}),await vt();const ln=Ue.value,Ut=Ie?Qn.get(String(Ie)):void 0;Ut&&ln?(se.value=Ut.following,ln.scrollTop=Ut.top,G=Ut.top,Ut.following&&Sn()):(se.value=!0,G=0,tt(!1),Sn()),ge()}),Ge(()=>s.sessionLoading,async(Ie,_e)=>{Ie||!_e||(se.value=!0,await vt(),Sn(),ge())}),Ge(()=>s.running,async(Ie,_e)=>{Ie||!_e||!se.value&&!Ce()||(await vt(),Sn(48),ge())});function st(){se.value=!0,ce.value=!1,re=Date.now()+vC,vt(()=>{tt(!0),Sn(16)})}function Nn(Ie){st(),o("submit",Ie)}function et(Ie){se.value=!0,ce.value=!1,re=Date.now()+vC,o("editMessage",Ie)}function Ke(Ie){const _e=s.queued?.[Ie]?.text??"";_e&&y(_e),o("editQueued",Ie)}function Mt(Ie){o("reorderQueue",Ie)}function Ft(Ie,_e){st(),o("answer",Ie,_e)}function vn(Ie,_e){!Ie||!_e||o("approval",Ie,_e)}let rn=null,zt=null,ms=null,Ln=null,yn=0,jn=!1;const zs=ee(!1);function Pt(Ie){if(zs.value||(jn=jn||Ie,yn))return;yn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Re=>setTimeout(Re,16))(()=>{yn=0;const Re=jn;jn=!1,se.value||Ce()?tt(!1):Re&&(ce.value=!0)})}function bs(){if(!zt)return;const Ie=Ue.value?.firstElementChild??null;Ie!==ms&&(ms&&zt.unobserve(ms),ms=Ie,Ie&&zt.observe(Ie))}function pn(){if(!zt)return;const Ie=Le.value;Ie!==Ln&&(Ln&&zt.unobserve(Ln),Ln=Ie,Ie&&zt.observe(Ie))}function Ns(){const Ie=Ue.value;U(),rn&&(rn.disconnect(),Ie&&rn.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),zt&&(zt.disconnect(),ms=null,Ln=null,Ie&&zt.observe(Ie),bs(),pn())}function Lo(){bs(),Pt(!0)}function ti(){typeof document>"u"||document.visibilityState==="visible"&&se.value&&Sn()}const Je=ee(!1);let it=null;function at(){Je.value=!0,it!==null&&clearTimeout(it),it=setTimeout(()=>{Je.value=!1},zZ)}function pt(){at(),o("interrupt")}function ni(Ie){Ie.key==="Escape"&&(s.running||s.sending)&&(Ie.preventDefault(),pt())}_n(()=>{vt(()=>{typeof MutationObserver=="function"&&(rn=new MutationObserver(Lo)),typeof ResizeObserver=="function"&&(zt=new ResizeObserver(()=>{U(),Pt(!1)})),Ns(),Sn(48),ge(),typeof document<"u"&&(document.addEventListener("visibilitychange",ti),document.addEventListener("keydown",ni))})}),wn(()=>{rn&&rn.disconnect(),zt&&zt.disconnect(),yn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(yn),Ee&&$n(Ee),it!==null&&clearTimeout(it),v!==null&&(clearTimeout(v),v=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",ti),document.removeEventListener("keydown",ni))});function hi(){(_.value??m.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:hi}),(Ie,_e)=>(w(),N("section",{class:De(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),ve(hG,{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":H.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:_e[0]||(_e[0]=Re=>o("openChanges")),onCopyAll:_e[1]||(_e[1]=Re=>p.value?.copyConversation()),onCopyFinalSummary:_e[2]||(_e[2]=Re=>p.value?.copyFinalSummary()),onOpenPr:_e[3]||(_e[3]=Re=>e.pr&&o("openPr",e.pr.url)),onRenameSession:_e[4]||(_e[4]=(Re,ln)=>o("renameSession",Re,ln)),onForkSession:_e[5]||(_e[5]=Re=>o("forkSession",Re)),onArchiveSession:_e[6]||(_e[6]=Re=>o("archiveSession",Re))},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(CZ,{key:1,items:X.value,"active-turn-id":ue.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:Wt},null,8,["items","active-turn-id","mobile","session-loading"])):ie("",!0),T("div",TZ,[T("div",{ref:Y,class:"panes chat-scroll",onScrollPassive:Xe},[T("div",{class:De(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),N(Pe,{key:0},[_e[54]||(_e[54]=T("div",{class:"empty-spacer"},null,-1)),T("div",MZ,[T("span",EZ,O(S(h)("composer.emptyConversationTitle")),1),T("span",IZ,O(S(h)("composer.emptyConversation")),1),a.value?(w(),N("div",$Z,[Z(ht,{text:S(h)("conversation.switchWorkspace")},{default:de(()=>[T("button",{type:"button",class:"ws-pick-btn",onClick:_e[7]||(_e[7]=kt(Re=>i.value=!i.value,["stop"]))},[Z(Ye,{name:"folder",size:"sm"}),T("span",NZ,O(l.value),1),Z(Ye,{class:De(["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:_e[8]||(_e[8]=Re=>i.value=!1)})):ie("",!0),i.value?(w(),N("div",LZ,[(w(!0),N(Pe,null,ot(c.value,Re=>(w(),N("button",{key:Re.id,type:"button",class:De(["ws-pick-item",{on:Re.id===e.activeWorkspaceId}]),onClick:kt(ln=>f(Re.id),["stop"])},[T("span",OZ,O(Re.name),1),T("span",RZ,O(Re.shortPath),1)],10,PZ))),128)),u.value>0?(w(),N("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:_e[9]||(_e[9]=kt(Re=>r.value=!r.value,["stop"]))},[T("span",null,O(S(h)("conversation.moreWorkspaces",{count:u.value})),1)])):ie("",!0),_e[53]||(_e[53]=T("div",{class:"ws-pick-divider"},null,-1)),T("button",{type:"button",class:"ws-pick-action",onClick:_e[10]||(_e[10]=kt(Re=>{i.value=!1,o("addWorkspace")},["stop"]))},[Z(Ye,{name:"plus",size:"sm"}),T("span",null,O(S(h)("conversation.addWorkspace")),1)])])):ie("",!0)])):(w(),N("button",{key:1,type:"button",class:"empty-add-workspace",onClick:_e[11]||(_e[11]=Re=>o("addWorkspace"))},[Z(Ye,{name:"folder-plus",size:"sm"}),T("span",null,O(S(h)("conversation.addWorkspace")),1)]))]),Z(iE,{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:Nn,onSteer:_e[12]||(_e[12]=Re=>o("steer",Re)),onCommand:_e[13]||(_e[13]=Re=>o("command",Re)),onInterrupt:pt,onUnqueue:_e[14]||(_e[14]=Re=>o("unqueue",Re)),onEditQueued:_e[15]||(_e[15]=Re=>o("editQueued",Re)),onSetPermission:_e[16]||(_e[16]=Re=>o("setPermission",Re)),onSetThinking:_e[17]||(_e[17]=Re=>o("setThinking",Re)),onTogglePlan:_e[18]||(_e[18]=Re=>o("togglePlan")),onToggleSwarm:_e[19]||(_e[19]=Re=>o("toggleSwarm")),onToggleGoal:_e[20]||(_e[20]=Re=>o("toggleGoal")),onOpenBtw:_e[21]||(_e[21]=Re=>o("command","/btw")),onCreateGoal:_e[22]||(_e[22]=Re=>o("createGoal",Re)),onControlGoal:_e[23]||(_e[23]=Re=>o("controlGoal",Re)),onFocusGoal:L,onFocusSwarm:I,onCompact:_e[24]||(_e[24]=Re=>o("compact")),onPickModel:_e[25]||(_e[25]=Re=>o("pickModel")),onSelectModel:_e[26]||(_e[26]=Re=>o("selectModel",Re))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),_e[55]||(_e[55]=T("div",{class:"empty-spacer"},null,-1))],64)):(w(),N(Pe,{key:1},[(w(),ve(tE,{ref_key:"chatPaneRef",ref:p,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":se.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:_e[27]||(_e[27]=Re=>o("openFile",Re)),onOpenMedia:_e[28]||(_e[28]=Re=>o("openMedia",Re)),onCopyConversationCopied:C,onOpenThinking:_e[29]||(_e[29]=Re=>o("openThinking",Re)),onOpenCompaction:_e[30]||(_e[30]=Re=>o("openCompaction",Re)),onOpenAgent:_e[31]||(_e[31]=Re=>o("openAgent",Re)),onOpenToolDiff:_e[32]||(_e[32]=Re=>o("openToolDiff",Re)),onEditMessage:et,onLoadOlderMessages:wt,onUnqueue:_e[33]||(_e[33]=Re=>o("unqueue",Re)),onEditQueued:Ke,onReorderQueue:Mt},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",DZ,[(w(!0),N(Pe,null,ot(d.value,Re=>(w(),ve(eX,{key:Re.id,group:Re},null,8,["group"]))),128))])):ie("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ie("",!0):(w(),ve(vZ,{key:0,ref:fe,style:Qt(ne.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":R.value,"bash-tasks":k.value,"subagent-tasks":M.value,"bash-running":E.value,"subagent-running":P.value,"todo-done-count":$.value,"has-dock-work":D.value,todos:e.todos,"pending-question":xe.value,"question-busy-kind":ke.value,"pending-approval":ze.value,"approval-busy":qe.value,mobile:e.mobile,onToggleDockPanel:_e[34]||(_e[34]=Re=>z(Re)),onCloseDockPanel:_e[35]||(_e[35]=Re=>q()),onOpenAgent:_e[36]||(_e[36]=Re=>o("openAgent",Re)),onAnswer:Ft,onDismiss:_e[37]||(_e[37]=Re=>o("dismiss",Re)),onApproval:vn,onCancelTask:_e[38]||(_e[38]=Re=>o("cancelTask",Re)),onControlGoal:_e[39]||(_e[39]=Re=>o("controlGoal",Re)),onSubmit:Nn,onSteer:_e[40]||(_e[40]=Re=>o("steer",Re)),onCommand:_e[41]||(_e[41]=Re=>o("command",Re)),onInterrupt:pt,onSetPermission:_e[42]||(_e[42]=Re=>o("setPermission",Re)),onSetThinking:_e[43]||(_e[43]=Re=>o("setThinking",Re)),onTogglePlan:_e[44]||(_e[44]=Re=>o("togglePlan")),onToggleSwarm:_e[45]||(_e[45]=Re=>o("toggleSwarm")),onToggleGoal:_e[46]||(_e[46]=Re=>o("toggleGoal")),onOpenBtw:_e[47]||(_e[47]=Re=>o("command","/btw")),onCreateGoal:_e[48]||(_e[48]=Re=>o("createGoal",Re)),onFocusGoal:L,onFocusSwarm:I,onCompact:_e[49]||(_e[49]=Re=>o("compact")),onPickModel:_e[50]||(_e[50]=Re=>o("pickModel")),onSelectModel:_e[51]||(_e[51]=Re=>o("selectModel",Re))},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"]))]),Z(Vr,{name:"pill"},{default:de(()=>[ce.value?(w(),N("button",{key:0,class:"newmsg-pill",style:Qt({bottom:`${F.value+12}px`}),"aria-label":S(h)("conversation.jumpToLatestAria"),onClick:_e[52]||(_e[52]=Re=>tt(!0))},[Z(Ye,{class:"pill-chevron",name:"chevron-down",size:"md"}),je(" "+O(S(h)("conversation.newMessages")),1)],12,BZ)):ie("",!0)]),_:1}),Z(Vr,{name:"abort-toast"},{default:de(()=>[Je.value?(w(),N("div",FZ,[T("span",WZ,O(S(h)("conversation.manuallyAborted")),1)])):ie("",!0)]),_:1})],2))}}),qZ=ft(UZ,[["__scopeId","data-v-b7070e01"]]),jZ=["aria-selected","onClick"],VZ=Ve({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(w(),N("div",{class:De(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),N(Pe,null,ot(e.options,i=>(w(),N("button",{key:i.value,class:De(["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)},O(i.label),11,jZ))),128))],2))}}),Qo=ft(VZ,[["__scopeId","data-v-d1aaccd7"]]),KZ={class:"ui-panel-header__title"},GZ={key:0,class:"ui-panel-header__sub"},YZ=Ve({__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:De(["ui-panel-header",{wrap:e.wrap}])},[T("span",KZ,O(e.title),1),Z(ht,{text:e.subtitle},{default:de(()=>[e.subtitle?(w(),N("span",GZ,O(e.subtitle),1)):ie("",!0)]),_:1},8,["text"]),Tn(t.$slots,"default",{},void 0,!0),Z(ht,{text:e.closeLabel},{default:de(()=>[e.closable?(w(),ve(dn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:de(()=>[Z(Ye,{name:"close",size:"sm"})]),_:1},8,["label"])):ie("",!0)]),_:1},8,["text"])],2))}}),Vl=ft(YZ,[["__scopeId","data-v-7889ea70"]]),XZ={key:0,class:"fp-empty fp-error"},QZ={key:1,class:"fp-empty"},ZZ={key:2,class:"fp-loading"},JZ={class:"fp-path"},eJ={class:"fp-meta"},tJ={key:0,class:"fp-lines"},nJ={class:"fp-size"},sJ={key:3,class:"fp-search"},oJ=["placeholder"],iJ={key:0,class:"fp-search-count"},rJ=["href","aria-label"],lJ={key:1,class:"fp-code"},aJ={class:"fp-line-table"},cJ=["data-line"],uJ={class:"fp-gutter"},dJ=["innerHTML"],fJ={key:1,class:"fp-body fp-code"},pJ={class:"fp-line-table"},hJ=["data-line"],mJ={class:"fp-gutter"},gJ=["innerHTML"],vJ={key:2,class:"fp-body"},yJ=["srcdoc","title"],kJ={key:1,class:"fp-code"},bJ={class:"fp-line-table"},_J=["data-line"],wJ={class:"fp-gutter"},SJ=["innerHTML"],CJ={key:3,class:"fp-body fp-pdf-wrap"},xJ=["src","title"],AJ={key:1,class:"fp-binary-card"},TJ={class:"fp-binary-label"},MJ={key:4,class:"fp-body fp-table-wrap"},EJ={class:"fp-table"},IJ=["data-line"],$J={key:5,class:"fp-body fp-image-wrap"},NJ=["src","alt"],LJ={key:1,class:"fp-binary-card"},PJ={class:"fp-binary-icon"},OJ={class:"fp-binary-label"},RJ={key:6,class:"fp-body fp-code"},DJ={class:"fp-line-table"},BJ=["data-line"],FJ={class:"fp-gutter"},WJ=["innerHTML"],HJ={key:7,class:"fp-body fp-binary-wrap"},zJ={class:"fp-binary-card"},UJ={class:"fp-binary-icon"},qJ={class:"fp-binary-label"},jJ=Ve({__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}=Nt();function s(le,F){const ne=F?F.split("/").filter(Boolean):[];for(const te of le.split("/"))te===""||te==="."||(te===".."?ne.pop():ne.push(te));return ne.join("/")}const o=jt("resolveImage",async le=>le),i=W(()=>{const le=c.file?.path??"",F=le.lastIndexOf("/");return F>0?le.slice(0,F):""});function r(le){if(/^(https?:|data:|blob:)/i.test(le)||le.startsWith("/"))return le;const F=i.value;return F?s(le,F):le}async function l(le){const F=r(le);return o?o(F):F}Pn("resolveImage",l);function a(le){let F=le.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(F)||F.startsWith("/"))return le;for(const te of["#","?"]){const U=F.indexOf(te);U!==-1&&(F=F.slice(0,U))}const ne=i.value;return{...le,path:s(F,ne)}}const c=e,u=t;function d(le){c.openFile?.(a(le))}const f=ee(null),h=W(()=>{const le=c.file;if(!le)return"binary";const F=le.mime??"",ne=le.languageId??"",te=le.path.toLowerCase();return F==="text/markdown"||ne==="markdown"||ne==="md"||te.endsWith(".mdx")?"markdown":F==="application/json"||ne==="json"?"json":F==="text/html"||ne==="html"||te.endsWith(".html")||te.endsWith(".htm")?"html":F==="application/pdf"||te.endsWith(".pdf")?"pdf":F==="text/csv"||ne==="csv"||te.endsWith(".csv")?"csv":F.startsWith("image/")?"image":le.isBinary?"binary":F.startsWith("text/")||ne!==""?"text":"binary"});function p(le){const F=atob(le),ne=Uint8Array.from(F,te=>te.charCodeAt(0));return new TextDecoder().decode(ne)}const m=W(()=>{const le=c.file;if(!le)return"";if(le.encoding==="base64")try{return p(le.content)}catch{return le.content}return le.content}),_=W(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),b=W(()=>c.file?(h.value==="json"?_.value:m.value).split(`
|
|
259
|
-
`):[]),g=W(()=>c.file?h.value==="json"?_.value:m.value:""),v=ee(""),y=ee(0),C=W(()=>{const le=v.value.trim().toLowerCase();if(!le)return[];const F=[];return b.value.forEach((ne,te)=>{ne.toLowerCase().includes(le)&&F.push(te+1)}),F});Ge(v,()=>{y.value=0});function L(le,F=!1){le&&vt(()=>{const ne=f.value?.querySelector(".fp-body"),te=ne?.querySelector(`[data-line="${le}"]`);if(!ne||!te)return;F&&(ne.scrollTop=0);const U=ne.getBoundingClientRect(),Y=te.getBoundingClientRect(),fe=Y.top-U.top+ne.scrollTop;ne.scrollTop=fe-ne.clientHeight/2+Y.height/2})}Ge(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function I(le){const F=C.value;F.length!==0&&(y.value=(y.value+le+F.length)%F.length,L(F[y.value]))}function k(le){const F=C.value;return{target:c.line===le,hit:F.includes(le),active:F[y.value]===le}}function M(le){return le<1024?`${le} B`:le<1024*1024?`${(le/1024).toFixed(1)} KB`:`${(le/(1024*1024)).toFixed(1)} MB`}const E=ee(!1),P=ee(!1);function A(){c.file&&Ws(g.value).then(le=>{le&&(E.value=!0,setTimeout(()=>{E.value=!1},1400))})}function $(){c.file&&Ws(c.file.path).then(le=>{le&&(P.value=!0,setTimeout(()=>{P.value=!1},1400))})}const D=ee("preview"),R=ee("preview"),H=ee("fit");function z(le){D.value=le}function q(le){R.value=le}function Q(le){H.value=le}Ge(h,le=>{D.value=le==="html"?"preview":"source",R.value="preview",H.value="fit"});const X=W(()=>{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}),ue=W(()=>{const le=c.file;return!le||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:null}),ge=W(()=>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 xe(le){const F=[];let ne="",te=!1;for(let U=0;U<le.length;U++){const Y=le[U];Y==='"'&&le[U+1]==='"'?(ne+='"',U++):Y==='"'?te=!te:Y===","&&!te?(F.push(ne),ne=""):ne+=Y}return F.push(ne),F}const ke=W(()=>b.value.slice(0,200).map(xe));function ze(le){return le.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function qe(){const le=c.file;if(!le)return"";const F=le.languageId?.toLowerCase();return F||(le.path.split(".").pop()?.toLowerCase()??"")}function Ue(le){const F=qe();let ne=ze(le);return h.value==="json"||F==="json"||F==="jsonc"?(ne=ne.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),ne=ne.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),ne=ne.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ne=ne.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ne):h.value==="html"||F==="html"||F==="xml"||F==="svg"?(ne=ne.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ne=ne.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),ne=ne.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ne):(ne=ne.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>'),ne=ne.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),ne=ne.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ne)}function Le(le,F=55){return!le||le.length<=F?le:"…"+le.slice(le.length-F+1)}return(le,F)=>(w(),N("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),N("div",XZ,[T("span",null,O(e.error),1),e.closable?(w(),ve(Ot,{key:0,variant:"secondary",size:"sm",onClick:F[0]||(F[0]=ne=>u("close"))},{default:de(()=>[je(O(S(n)("filePreview.close")),1)]),_:1})):ie("",!0)])):!e.file&&!e.loading?(w(),N("div",QZ,O(S(n)("filePreview.empty")),1)):e.loading?(w(),N("div",ZZ,[F[7]||(F[7]=T("span",{class:"spinner"},null,-1)),T("span",null,O(S(n)("filePreview.loading")),1)])):e.file?(w(),N(Pe,{key:3},[Z(Vl,{wrap:"",title:S(n)("common.preview"),closable:e.closable,"close-label":S(n)("filePreview.close"),onClose:F[6]||(F[6]=ne=>u("close"))},{default:de(()=>[Z(ht,{text:e.file.path},{default:de(()=>[T("span",JZ,O(Le(e.file.path)),1)]),_:1},8,["text"]),T("span",eJ,[e.file.lineCount?(w(),N("span",tJ,O(S(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ie("",!0),T("span",nJ,O(M(e.file.size)),1)]),h.value==="html"?(w(),ve(Qo,{key:0,"model-value":D.value,size:"sm",options:[{value:"preview",label:S(n)("filePreview.preview")},{value:"source",label:S(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):ie("",!0),h.value==="markdown"?(w(),ve(Qo,{key:1,"model-value":R.value,size:"sm",options:[{value:"preview",label:S(n)("filePreview.preview")},{value:"source",label:S(n)("filePreview.source")}],"onUpdate:modelValue":q},null,8,["model-value","options"])):ie("",!0),h.value==="image"?(w(),ve(Qo,{key:2,"model-value":H.value,size:"sm",options:[{value:"fit",label:S(n)("filePreview.fit")},{value:"actual",label:S(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",sJ,[In(T("input",{"onUpdate:modelValue":F[1]||(F[1]=ne=>v.value=ne),class:"fp-search-input",type:"search",placeholder:S(n)("filePreview.search")},null,8,oJ),[[go,v.value]]),v.value.trim()?(w(),N("span",iJ,O(C.value.length),1)):ie("",!0),Z(ht,{text:S(n)("filePreview.prevMatch")},{default:de(()=>[Z(dn,{size:"sm",disabled:C.value.length===0,label:S(n)("filePreview.prevMatch"),onClick:F[2]||(F[2]=ne=>I(-1))},{default:de(()=>[Z(Ye,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"])]),_:1},8,["text"]),Z(ht,{text:S(n)("filePreview.nextMatch")},{default:de(()=>[Z(dn,{size:"sm",disabled:C.value.length===0,label:S(n)("filePreview.nextMatch"),onClick:F[3]||(F[3]=ne=>I(1))},{default:de(()=>[Z(Ye,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])]),_:1},8,["text"])])):ie("",!0),Z(ht,{text:P.value?S(n)("filePreview.copied"):S(n)("filePreview.copyPath")},{default:de(()=>[Z(dn,{size:"sm",class:De({copied:P.value}),label:P.value?S(n)("filePreview.copied"):S(n)("filePreview.copyPath"),onClick:$},{default:de(()=>[P.value?(w(),ve(Ye,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ve(Ye,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"])]),_:1},8,["text"]),Z(ht,{text:S(n)("filePreview.openInEditor")},{default:de(()=>[e.externalActions?(w(),ve(dn,{key:0,size:"sm",label:S(n)("filePreview.openInEditor"),onClick:F[4]||(F[4]=ne=>u("openExternal"))},{default:de(()=>[Z(Ye,{name:"external-link",size:"md"})]),_:1},8,["label"])):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:S(n)("filePreview.reveal")},{default:de(()=>[e.externalActions?(w(),ve(dn,{key:0,size:"sm",label:S(n)("filePreview.reveal"),onClick:F[5]||(F[5]=ne=>u("reveal"))},{default:de(()=>[Z(Ye,{name:"folder",size:"md"})]),_:1},8,["label"])):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:S(n)("filePreview.download")},{default:de(()=>[e.downloadUrl?(w(),N("a",{key:0,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":S(n)("filePreview.download")},[Z(Ye,{name:"download",size:"md"})],8,rJ)):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:E.value?S(n)("filePreview.copied"):S(n)("filePreview.copy")},{default:de(()=>[!e.file.isBinary&&h.value!=="image"?(w(),ve(dn,{key:0,size:"sm",class:De({copied:E.value}),label:E.value?S(n)("filePreview.copied"):S(n)("filePreview.copy"),onClick:A},{default:de(()=>[E.value?(w(),ve(Ye,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ve(Ye,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ie("",!0)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),N("div",{key:0,class:De(["fp-body",{"fp-markdown":R.value==="preview"}])},[R.value==="preview"?(w(),ve(Eh,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),N("div",lJ,[T("div",aJ,[(w(!0),N(Pe,null,ot(b.value,(ne,te)=>(w(),N("div",{key:te,class:De(["fp-line-row",k(te+1)]),"data-line":te+1},[T("span",uJ,O(te+1),1),T("span",{class:"fp-line-text",innerHTML:Ue(ne)},null,8,dJ)],10,cJ))),128))])]))],2)):h.value==="json"?(w(),N("div",fJ,[T("div",pJ,[(w(!0),N(Pe,null,ot(b.value,(ne,te)=>(w(),N("div",{key:te,class:De(["fp-line-row",k(te+1)]),"data-line":te+1},[T("span",mJ,O(te+1),1),T("span",{class:"fp-line-text",innerHTML:Ue(ne)},null,8,gJ)],10,hJ))),128))])])):h.value==="html"?(w(),N("div",vJ,[D.value==="preview"?(w(),N("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ge.value,title:e.file.path},null,8,yJ)):(w(),N("div",kJ,[T("div",bJ,[(w(!0),N(Pe,null,ot(b.value,(ne,te)=>(w(),N("div",{key:te,class:De(["fp-line-row",k(te+1)]),"data-line":te+1},[T("span",wJ,O(te+1),1),T("span",{class:"fp-line-text",innerHTML:Ue(ne)},null,8,SJ)],10,_J))),128))])]))])):h.value==="pdf"?(w(),N("div",CJ,[ue.value?(w(),N("iframe",{key:0,class:"fp-pdf-frame",src:ue.value,title:e.file.path},null,8,xJ)):(w(),N("div",AJ,[T("span",TJ,O(S(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),N("div",MJ,[T("table",EJ,[T("tbody",null,[(w(!0),N(Pe,null,ot(ke.value,(ne,te)=>(w(),N("tr",{key:te,class:De(k(te+1)),"data-line":te+1},[T("th",null,O(te+1),1),(w(!0),N(Pe,null,ot(ne,(U,Y)=>(w(),N("td",{key:Y},O(U),1))),128))],10,IJ))),128))])])])):h.value==="image"?(w(),N("div",$J,[X.value?(w(),N("img",{key:0,src:X.value,alt:e.file.path,class:De(["fp-image",{actual:H.value==="actual"}])},null,10,NJ)):(w(),N("div",LJ,[T("span",PJ,[Z(Ye,{name:"image-off",size:"lg"})]),T("span",OJ,O(S(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):h.value==="text"?(w(),N("div",RJ,[T("div",DJ,[(w(!0),N(Pe,null,ot(b.value,(ne,te)=>(w(),N("div",{key:te,class:De(["fp-line-row",k(te+1)]),"data-line":te+1},[T("span",FJ,O(te+1),1),T("span",{class:"fp-line-text",innerHTML:Ue(ne)},null,8,WJ)],10,BJ))),128))])])):(w(),N("div",HJ,[T("div",zJ,[T("span",UJ,[Z(Ye,{name:"file-off",size:"lg"})]),T("span",qJ,O(S(n)("filePreview.binaryNoPreview",{mime:e.file.mime||S(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):ie("",!0)],512))}}),VJ=ft(jJ,[["__scopeId","data-v-89d38c5b"]]),KJ={class:"tp"},GJ=Ve({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=ee(null);return Ge(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||vt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(w(),N("div",KJ,[Z(Vl,{title:S(o)("common.preview"),subtitle:e.subtitle??S(o)("thinking.panelTitle"),"close-label":S(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),T("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),yC=ft(GJ,[["__scopeId","data-v-6af94b37"]]),YJ={class:"ap"},XJ={key:0,class:"ap-type"},QJ={key:1,class:"ap-reason"},ZJ={key:2,class:"ap-field"},JJ={class:"ap-field-body"},eee={key:3,class:"ap-field"},tee={class:"ap-field-body ap-live"},nee={key:4,class:"ap-field"},see={class:"ap-field-body ap-progress"},oee={key:0,class:"ap-call"},iee={key:1,class:"ap-output"},ree=["onClick"],lee={key:5,class:"ap-field"},aee={class:"ap-field-body"},cee=8,kC=5,bC=2,uee=Ve({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=W(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=W(()=>(n.member.text??"").trimEnd());function l(m){const _=[];let b=null,g=0;for(const v of m)v.startsWith("Calling ")?(b={key:`g${g++}`,call:v,output:[]},_.push(b)):b?b.output.push(v):(b={key:`g${g++}`,call:"",output:[v]},_.push(b));return _}const a=W(()=>l(i.value)),c=ee(new Set);function u(m){return c.value.has(m)}function d(m){const _=new Set(c.value);_.has(m)?_.delete(m):_.add(m),c.value=_}function f(m){return m.output.length-kC-bC}function h(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=ee(null);return Ge(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||vt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,_)=>(w(),N("div",YJ,[Z(Vl,{title:S(o)("common.preview"),subtitle:e.member.name,"close-label":S(o)("thinking.close"),onClose:_[0]||(_[0]=b=>s("close"))},{default:de(()=>[Z(Ms,{variant:"neutral",size:"sm",class:"ap-phase"},{default:de(()=>[je(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),T("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),N("div",XJ,O(e.member.subagentType),1)):ie("",!0),e.member.suspendedReason?(w(),N("div",QJ,O(e.member.suspendedReason),1)):ie("",!0),e.member.prompt?(w(),N("div",ZJ,[_[1]||(_[1]=T("span",{class:"ap-field-label"},"Task",-1)),T("div",JJ,O(e.member.prompt),1)])):ie("",!0),r.value?(w(),N("div",eee,[_[2]||(_[2]=T("span",{class:"ap-field-label"},"Output",-1)),T("div",tee,O(r.value),1)])):ie("",!0),a.value.length>0?(w(),N("div",nee,[_[4]||(_[4]=T("span",{class:"ap-field-label"},"Progress",-1)),T("div",see,[(w(!0),N(Pe,null,ot(a.value,b=>(w(),N("div",{key:b.key,class:"ap-group"},[b.call?(w(),N("div",oee,[_[3]||(_[3]=T("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),je(" "+O(b.call),1)])):ie("",!0),b.output.length>0?(w(),N("div",iee,[b.output.length<=cee||u(b.key)?(w(!0),N(Pe,{key:0},ot(b.output,(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},O(g),1))),128)):(w(),N(Pe,{key:1},[(w(!0),N(Pe,null,ot(b.output.slice(0,kC),(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},O(g),1))),128)),T("button",{type:"button",class:"ap-fold",onClick:g=>d(b.key)}," … ("+O(f(b))+" more) ",9,ree),(w(!0),N(Pe,null,ot(b.output.slice(-bC),(g,v)=>(w(),N("div",{key:"t"+v,class:"ap-out-line"},O(g),1))),128))],64))])):ie("",!0)]))),128))])])):ie("",!0),e.member.summary?(w(),N("div",lee,[_[5]||(_[5]=T("span",{class:"ap-field-label"},"Result",-1)),T("div",aee,O(e.member.summary),1)])):ie("",!0)],512)]))}}),dee=ft(uee,[["__scopeId","data-v-715bd93e"]]),fee={class:"diff-lines"},pee={key:0,class:"hunk-text"},hee={class:"dl-gutter old"},mee={class:"dl-gutter new"},gee={class:"dl-sign"},vee={class:"dl-text"},yee=Ve({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(w(),N("div",fee,[(w(!0),N(Pe,null,ot(e.lines,(r,l)=>(w(),N("div",{key:l,class:De(["dl",s(r)])},[r.type==="hunk"?(w(),N("span",pee,O(r.text),1)):(w(),N(Pe,{key:1},[T("span",hee,O(t(r)),1),T("span",mee,O(n(r)),1),T("span",gee,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),T("span",vee,O(r.text),1)],64))],2))),128))]))}}),lE=ft(yee,[["__scopeId","data-v-2f6bc1cc"]]),kee={class:"tdp"},bee={class:"tdp-body"},_ee={key:1,class:"tdp-output"},wee={key:2,class:"tdp-empty"},See=Ve({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Nt();return(o,i)=>(w(),N("div",kee,[Z(Vl,{title:e.target.title,subtitle:e.target.path,"close-label":S(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),T("div",bee,[e.target.lines&&e.target.lines.length>0?(w(),ve(lE,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),N("div",_ee,[(w(!0),N(Pe,null,ot(e.target.output,(r,l)=>(w(),N("div",{key:l},O(r),1))),128))])):(w(),N("div",wee,O(S(s)("diff.noDiff")),1))])]))}}),Cee=ft(See,[["__scopeId","data-v-76f2fbca"]]),xee={class:"sc"},Aee={key:0,class:"sc-empty"},Tee={key:2,class:"sc-loading","aria-hidden":"true"},Mee={class:"sc-composer"},Eee=["placeholder"],Iee=["disabled"],$ee=Ve({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt(),i=W(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=W(()=>n.title?.trim()||o("sideChat.title")),l=W(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=ee(""),c=ee(null),u=ee(null);function d(){const b=a.value.trim();b&&(s("send",b),a.value="",vt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const b=u.value;b&&(b.scrollTop=b.scrollHeight)}const h=W(()=>{const b=n.turns;if(b.length===0)return"0";const g=b.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((C,L)=>C+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${b.length}:${g.text.length}:${v}:${y}`});Ge(h,async()=>{!n.running&&!n.sending||(await vt(),f())});const p=W(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(b){b.key==="Enter"&&!b.shiftKey&&!b.isComposing&&(b.preventDefault(),d())}function _(){const b=c.value;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,160)}px`)}return(b,g)=>(w(),N("div",xee,[Z(Vl,{title:r.value,subtitle:l.value,"close-label":S(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),T("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),N("div",Aee,O(S(o)("sideChat.empty")),1)):(w(),ve(tE,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),p.value?(w(),N("div",Tee,[Z(eE)])):ie("",!0)],512),T("div",Mee,[In(T("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:S(o)("sideChat.placeholder"),onInput:_,onKeydown:m},null,40,Eee),[[go,a.value]]),Z(ht,{text:S(o)("sideChat.send")},{default:de(()=>[T("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[Z(Ye,{name:"arrow-right",size:"sm"})],8,Iee)]),_:1},8,["text"])])]))}}),Nee=ft($ee,[["__scopeId","data-v-9ee5df02"]]),Lee={class:"changes-pane"},Pee={class:"dv-path"},Oee={class:"diff-head"},Ree={class:"back-label"},Dee={key:0,class:"empty-state"},Bee={key:1,class:"dv-lines-wrap"},Fee={key:2,class:"empty-state"},Wee={class:"dv-change-count"},Hee={class:"ch-head"},zee={class:"br-label"},Uee={class:"br-name"},qee={key:0,class:"sync-info"},jee={key:0,class:"ahead"},Vee={key:0,class:"behind"},Kee={key:1,class:"empty-head"},Gee={key:0,class:"ch-list"},Yee=["onClick"],Xee={class:"fpath"},Qee={key:1,class:"ch-list ch-tree"},Zee={class:"tree-list"},Jee=["onClick"],ete={class:"tree-name"},tte=["onClick"],nte={class:"tree-name"},ste={key:2,class:"empty-state"},ote={key:3,class:"empty-state"},ite=Ve({__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}=Nt(),s=e,o=t;function i(P){const A=P.toLowerCase();return A==="modified"?"modified":A==="added"?"added":A==="deleted"?"deleted":A==="renamed"?"renamed":A==="untracked"?"untracked":A==="conflicted"?"conflicted":A==="ignored"?"ignored":A==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(P){return r[i(P)]??"?"}function a(P,A=60){return P.length<=A?P:"…"+P.slice(P.length-A+1)}const c=W(()=>s.gitInfo!==null),u=W(()=>s.changes.length>0),d=W(()=>(s.selectedDiffPath??null)!==null),f=W(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=W(()=>s.fileDiff??[]),p=W(()=>s.fileDiffLoading===!0);function m(P){o("open",P)}function _(){o("back")}function b(){o("close")}const g=ee("list");function v(P){g.value=P}function y(P){const A={children:[]},$=[...P].sort((D,R)=>D.path.localeCompare(R.path));for(const D of $){const R=D.path.split("/");let H=A;for(let z=0;z<R.length;z++){const q=R[z],Q=z===R.length-1,X=R.slice(0,z+1).join("/");let ue=H.children.find(ge=>ge.name===q&&ge.kind===(Q?"file":"folder"));ue||(ue={name:q,path:X,kind:Q?"file":"folder",status:Q?D.status:void 0,children:[]},H.children.push(ue)),H=ue}}return A.children}const C=W(()=>y(s.changes)),L=ee(new Set);function I(P){return!L.value.has(P)}const k=W(()=>{const P=[];function A($,D){for(const R of $)P.push({node:R,depth:D}),R.kind==="folder"&&I(R.path)&&A(R.children,D+1)}return A(C.value,0),P});function M(P){const A=new Set(L.value);A.has(P.path)?A.delete(P.path):A.add(P.path),L.value=A}function E(P){return`${16+P*16}px`}return(P,A)=>(w(),N("div",Lee,[f.value?(w(),N(Pe,{key:0},[Z(Vl,{title:S(n)("diff.title"),closable:e.closable,"close-label":S(n)("diff.close"),onClose:b},{default:de(()=>[Z(ht,{text:e.selectedDiffPath??""},{default:de(()=>[T("span",Pee,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),T("div",Oee,[Z(ht,{text:S(n)("diff.back")},{default:de(()=>[e.hideBack?ie("",!0):(w(),ve(Ot,{key:0,variant:"ghost",size:"sm",onClick:_},{default:de(()=>[A[0]||(A[0]=T("span",{"aria-hidden":"true"},"←",-1)),T("span",Ree,O(S(n)("diff.back")),1)]),_:1}))]),_:1},8,["text"])]),p.value?(w(),N("div",Dee,O(S(n)("diff.loading")),1)):h.value.length>0?(w(),N("div",Bee,[Z(lE,{lines:h.value},null,8,["lines"])])):(w(),N("div",Fee,O(S(n)("diff.noDiff")),1))],64)):(w(),N(Pe,{key:1},[Z(Vl,{title:S(n)("diff.title"),closable:e.closable,"close-label":S(n)("diff.close"),onClose:b},{default:de(()=>[T("span",Wee,O(S(n)("diff.changeCount",{count:e.changes.length})),1),Z(Qo,{"model-value":g.value,size:"sm",options:[{value:"list",label:S(n)("diff.list")},{value:"tree",label:S(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),T("div",Hee,[c.value?(w(),N(Pe,{key:0},[T("span",zee,O(S(n)("diff.branch")),1),T("span",Uee,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),N("span",qee,[Z(ht,{text:S(n)("diff.aheadTitle")},{default:de(()=>[e.gitInfo.ahead>0?(w(),N("span",jee,"↑"+O(e.gitInfo.ahead),1)):ie("",!0)]),_:1},8,["text"]),Z(ht,{text:S(n)("diff.behindTitle")},{default:de(()=>[e.gitInfo.behind>0?(w(),N("span",Vee,"↓"+O(e.gitInfo.behind),1)):ie("",!0)]),_:1},8,["text"])])):ie("",!0)],64)):(w(),N("span",Kee,O(S(n)("diff.empty")),1))]),u.value&&g.value==="list"?(w(),N("div",Gee,[(w(!0),N(Pe,null,ot(e.changes,$=>(w(),ve(ht,{key:$.path,text:$.path},{default:de(()=>[T("button",{type:"button",class:"ch-row",onClick:D=>m($.path)},[T("span",{class:De(["badge",i($.status)])},O(l($.status)),3),T("span",Xee,O(a($.path)),1)],8,Yee)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(w(),N("div",Qee,[T("ul",Zee,[(w(!0),N(Pe,null,ot(k.value,({node:$,depth:D})=>(w(),N("li",{key:$.path,class:"tree-node"},[$.kind==="folder"?(w(),N("button",{key:0,type:"button",class:"tree-row tree-folder",style:Qt({paddingLeft:E(D)}),onClick:R=>M($)},[Z(Ye,{class:"tree-icon",name:"folder-solid",size:"sm"}),T("span",ete,O($.name),1)],12,Jee)):(w(),ve(ht,{key:1,text:$.path},{default:de(()=>[T("button",{type:"button",class:"tree-row tree-file",style:Qt({paddingLeft:E(D)}),onClick:R=>m($.path)},[T("span",{class:De(["badge",i($.status)])},O(l($.status)),3),T("span",nte,O($.name),1)],12,tte)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),N("div",ste,O(S(n)("diff.clean")),1)):(w(),N("div",ote,O(S(n)("diff.empty")),1))],64))]))}}),rte=ft(ite,[["__scopeId","data-v-24dfa030"]]);function iy(e,t){let n=null;_n(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,vt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),hs(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const lte=["type","value","placeholder","disabled","readonly"],ate=Ve({__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 s=n,o=ee();function i(a){s("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,c)=>(w(),N("input",{ref_key:"el",ref:o,class:De(["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,lte))}}),Za=ft(ate,[["__scopeId","data-v-340f0da2"]]),cte={class:"search-wrap"},ute={key:0,class:"tab-strip"},dte={key:1,class:"state-row"},fte={key:2,class:"state-row unavail"},pte={key:3,class:"model-list"},hte=["aria-selected","onClick","onMouseenter"],mte={class:"check"},gte={class:"model-main"},vte={class:"model-name"},yte={class:"model-id"},kte={key:0,class:"caps"},bte={class:"model-provider"},_te={class:"model-ctx"},wte={key:0,class:"empty"},Ste={class:"footer-hint"},Cte=Ve({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=W(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=ee(""),a=ee(null),c=ee(null),u=ee("all");iy(c,a);const d=W(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const C of s.models)v.has(C.provider)||(v.add(C.provider),y.push({id:C.provider,label:C.provider}));return y}),f=W(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(C=>{if(u.value!=="all"&&C.provider!==u.value)return!1;const L=(C.displayName??C.model).toLowerCase().includes(v),I=C.provider.toLowerCase().includes(v),k=C.id.toLowerCase().includes(v);return!v||L||I||k});return u.value!=="all"?y:y.sort((C,L)=>{const I=r(C.id)?1:0;return(r(L.id)?1:0)-I})}),h=W(()=>f.value),p=ee(0);Ge([l,u],()=>{p.value=0}),Ge(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ge(h,v=>{p.value=Math.min(p.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),p.value=Math.max(p.value-1,0);else if(v.key==="Enter"){const y=h.value[p.value];y&&o("select",y.id)}}_n(()=>{document.addEventListener("keydown",m)}),wn(()=>{document.removeEventListener("keydown",m)});function _(v){o("select",v)}function b(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(w(),ve(rr,{open:!0,"close-on-esc":!1,title:S(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=C=>o("close"))},{default:de(()=>[T("div",{ref_key:"dialogRef",ref:c,class:"mp"},[T("div",cte,[Z(Za,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=C=>l.value=C),placeholder:S(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),N("div",ute,[(w(!0),N(Pe,null,ot(d.value,C=>(w(),ve(Ot,{key:C.id,variant:C.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(C.id)},{default:de(()=>[je(O(C.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ie("",!0),e.loading?(w(),N("div",dte,[Z(Jo,{size:"sm"}),T("span",null,O(S(n)("model.loading")),1)])):e.unavailable?(w(),N("div",fte,[Z(Ye,{name:"alert-triangle",size:"lg"}),T("span",null,O(S(n)("model.unavailable")),1)])):(w(),N("div",pte,[(w(!0),N(Pe,null,ot(h.value,C=>(w(),N("div",{key:C.id,class:De(["model-row",{"is-current":C.id===e.current,"is-selected":b(C)===p.value}]),role:"option","aria-selected":C.id===e.current,onClick:L=>_(C.id),onMouseenter:L=>p.value=b(C)},[T("span",mte,[C.id===e.current?(w(),ve(Ye,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",gte,[T("span",vte,O(C.displayName??C.model),1),T("span",yte,O(C.id),1),C.capabilities&&C.capabilities.length>0?(w(),N("span",kte,[(w(!0),N(Pe,null,ot(C.capabilities,L=>(w(),ve(Ms,{key:L,variant:"info",size:"sm"},{default:de(()=>[je(O(L),1)]),_:2},1024))),128))])):ie("",!0)]),T("span",bte,O(C.provider),1),T("span",_te,O(S(n)("model.contextSuffix",{size:Math.round(C.maxContextSize/1e3)})),1),Z(dn,{size:"sm",label:r(C.id)?S(n)("model.unstarTitle"):S(n)("model.starTitle"),onClick:kt(L=>o("toggle-star",C.id),["stop"])},{default:de(()=>[r(C.id)?(w(),ve(Ye,{key:0,name:"star",size:"md"})):(w(),ve(Ye,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,hte))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),N("div",wte,O(s.models.length===0?S(n)("model.emptyNoModels"):S(n)("model.emptyNoMatch")),1)):ie("",!0)])),T("div",Ste,O(S(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),xte=ft(Cte,[["__scopeId","data-v-e93073d7"]]),Ate={key:0,class:"ui-field__label"},Tte={key:1,class:"ui-field__error"},Mte={key:2,class:"ui-field__hint"},Ete=Ve({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),N("label",Ate,O(e.label),1)):ie("",!0),Tn(t.$slots,"default",{},void 0,!0),e.error?(w(),N("span",Tte,O(e.error),1)):e.hint?(w(),N("span",Mte,O(e.hint),1)):ie("",!0)],2))}}),Qc=ft(Ete,[["__scopeId","data-v-49bce958"]]),Ite=["value","disabled"],$te=Ve({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(w(),N("select",{class:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[Tn(o.$slots,"default",{},void 0,!0)],42,Ite))}}),aE=ft($te,[["__scopeId","data-v-92a040fd"]]),Nte={class:"prov-list"},Lte={key:0,class:"state-row"},Pte={key:1,class:"state-row unavail"},Ote={key:2,class:"empty"},Rte={class:"prov-info"},Dte={class:"prov-type"},Bte={key:0,class:"prov-url"},Fte={class:"prov-meta"},Wte={key:0},Hte={class:"prov-actions"},zte={key:0,class:"add-section"},Ute={key:0,class:"add-btns"},qte={key:1,class:"add-form"},jte=["value"],Vte={key:0,class:"add-error"},Kte={class:"form-btns"},Gte={class:"footer-hint"},Yte=Ve({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Nt(),{confirm:s}=nl(),o=ee(null);iy(o);const i=t;async function r(b){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",b)}const l=ee(!1),a=Es({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=ee(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){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 p(b){if(b.key==="Escape"){if(l.value){f();return}i("close")}}_n(()=>document.addEventListener("keydown",p)),wn(()=>document.removeEventListener("keydown",p));function m(b){return b==="connected"?"var(--color-success)":b==="error"?"var(--color-danger)":"var(--color-text-faint)"}function _(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,g)=>(w(),ve(rr,{open:!0,"close-on-esc":!1,title:S(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:de(()=>[T("div",{ref_key:"dialogRef",ref:o,class:"pm"},[T("div",Nte,[e.loading?(w(),N("div",Lte,[Z(Jo,{size:"sm"}),T("span",null,O(S(n)("providers.loading")),1)])):e.unavailable?(w(),N("div",Pte,[Z(Ye,{name:"alert-triangle",size:"md"}),T("span",null,O(S(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),N("div",Ote,O(S(n)("providers.empty")),1)):(w(!0),N(Pe,{key:3},ot(e.providers,v=>(w(),N("div",{key:v.id,class:"prov-row"},[Z(ht,{text:_(v.status)},{default:de(()=>[T("span",{class:De(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Qt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),T("div",Rte,[T("span",Dte,O(v.type),1),v.baseUrl?(w(),N("span",Bte,O(v.baseUrl),1)):ie("",!0),T("span",Fte,[Z(Ms,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:de(()=>[je(O(v.hasApiKey?S(n)("providers.keySet"):S(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(w(),N("span",Wte," · "+O(S(n)("providers.modelCount",{count:v.models.length})),1)):ie("",!0)])]),T("div",Hte,[Z(ht,{text:S(n)("providers.refreshTitle",{type:v.type})},{default:de(()=>[Z(Ot,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:de(()=>[je(O(S(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),Z(ht,{text:S(n)("providers.deleteTitle",{type:v.type})},{default:de(()=>[Z(Ot,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:de(()=>[je(O(S(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ie("",!0):(w(),N("div",zte,[l.value?(w(),N("div",qte,[Z(Qc,{label:S(n)("providers.fieldType")},{default:de(()=>[Z(aE,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:de(()=>[(w(),N(Pe,null,ot(u,v=>T("option",{key:v,value:v},O(v),9,jte)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),Z(Qc,{label:S(n)("providers.fieldApiKey")},{default:de(()=>[Z(Za,{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"]),Z(Qc,{label:S(n)("providers.fieldBaseUrl")},{default:de(()=>[Z(Za,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:S(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),Z(Qc,{label:S(n)("providers.fieldDefaultModel")},{default:de(()=>[Z(Za,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:S(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(w(),N("div",Vte,O(c.value),1)):ie("",!0),T("div",Kte,[Z(Ot,{variant:"primary",size:"sm",onClick:h},{default:de(()=>[je(O(S(n)("providers.add")),1)]),_:1}),Z(Ot,{variant:"secondary",size:"sm",onClick:f},{default:de(()=>[je(O(S(n)("common.cancel")),1)]),_:1})])])):(w(),N("div",Ute,[Z(Ot,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:de(()=>[Z(Ye,{name:"user",size:"sm"}),je(" "+O(S(n)("providers.loginKimi")),1)]),_:1}),Z(Ot,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:de(()=>[Z(Ye,{name:"user",size:"sm"}),je(" "+O(S(n)("providers.loginAnthropic")),1)]),_:1}),Z(Ot,{variant:"primary",size:"sm",onClick:d},{default:de(()=>[Z(Ye,{name:"plus",size:"sm"}),je(" "+O(S(n)("providers.enterApiKey")),1)]),_:1})]))])),T("div",Gte,O(S(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Xte=ft(Yte,[["__scopeId","data-v-fb6f1365"]]),Qte={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Zte={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Jte={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},Vg=Ve({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),N("svg",Qte,[...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",Zte,[...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",Jte,[...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)])]))}}),ene={key:0,class:"center-body"},tne={class:"center-text"},nne={key:1,class:"nb"},sne={class:"nb-lead"},one=["href"],ine={class:"nb-or"},rne={class:"nb-fallback"},lne={class:"nb-fb-text"},ane=["href"],cne={class:"nb-code-row"},une={class:"nb-code"},dne={class:"nb-status"},fne={class:"nb-status-text"},pne={class:"nb-countdown"},hne={key:2,class:"center-body"},mne={class:"center-text success-text"},gne={class:"center-hint"},vne={class:"center-body"},yne={class:"center-text err-text"},kne={class:"center-hint"},bne={class:"actions"},_ne={class:"center-body"},wne={class:"center-text warn-text"},Sne={class:"center-hint"},Cne={class:"actions"},xne=Ve({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=ee(!0),o=t,i=e,r=ee("starting"),l=ee(null),a=ee(0),c=ee(!1);let u=null,d=null;_n(async()=>{await f()}),wn(()=>{m()});async function f(){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(),p(y.interval)}function h(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function p(y){u&&clearTimeout(u),u=setTimeout(async()=>{const C=await i.onPollOAuthLogin();C?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):C?.status==="expired"||C?.status==="cancelled"?(m(),r.value="expired"):p(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function b(){!l.value||!await Ws(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function v(y){const C=Math.floor(y/60),L=y%60;return`${C}:${String(L).padStart(2,"0")}`}return(y,C)=>(w(),ve(rr,{open:s.value,"onUpdate:open":C[0]||(C[0]=L=>s.value=L),title:S(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:de(()=>[r.value==="starting"?(w(),N("div",ene,[Z(Jo,{size:"md"}),T("span",tne,O(S(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(w(),N("div",nne,[T("div",sne,O(S(n)("login.lead")),1),T("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[je(O(S(n)("login.authorizeInBrowser"))+" ",1),Z(Ye,{name:"external-link",size:"sm"})],8,one),T("div",ine,O(S(n)("login.orDivider")),1),T("div",rne,[T("div",lne,[je(O(S(n)("login.fallbackPrefix")),1),T("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(l.value.verificationUri),9,ane),je(O(S(n)("login.fallbackSuffix")),1)]),T("div",cne,[T("span",une,O(l.value.userCode),1),Z(Ot,{class:De(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:b},{default:de(()=>[c.value?(w(),N(Pe,{key:0},[Z(Ye,{name:"check",size:"sm"}),je(" "+O(S(n)("login.copied")),1)],64)):(w(),N(Pe,{key:1},[Z(Ye,{name:"copy",size:"sm"}),je(" "+O(S(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),T("div",dne,[Z(Jo,{size:"sm",label:S(n)("login.waitingAuth")},null,8,["label"]),T("span",fne,O(S(n)("login.waitingAutoClose")),1),T("span",pne,O(v(a.value)),1)])])):r.value==="success"?(w(),N("div",hne,[Z(Vg,{kind:"success"}),T("span",mne,O(S(n)("login.success")),1),T("span",gne,O(S(n)("login.successHint")),1)])):r.value==="expired"?(w(),N(Pe,{key:3},[T("div",vne,[Z(Vg,{kind:"expired"}),T("span",yne,O(S(n)("login.expiredTitle")),1),T("span",kne,O(S(n)("login.expiredHint")),1)]),T("div",bne,[Z(Ot,{variant:"primary",onClick:_},{default:de(()=>[je(O(S(n)("login.retry")),1)]),_:1}),Z(Ot,{variant:"secondary",onClick:g},{default:de(()=>[je(O(S(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),N(Pe,{key:4},[T("div",_ne,[Z(Vg,{kind:"error"}),T("span",wne,O(S(n)("login.errorTitle")),1),T("span",Sne,O(S(n)("login.errorHint")),1)]),T("div",Cne,[Z(Ot,{variant:"primary",onClick:_},{default:de(()=>[je(O(S(n)("login.retry")),1)]),_:1}),Z(Ot,{variant:"secondary",onClick:g},{default:de(()=>[je(O(S(n)("login.closeBtn")),1)]),_:1})])],64)):ie("",!0)]),_:1},8,["open","title"]))}}),Ane=ft(xne,[["__scopeId","data-v-b228800e"]]),cE=Ve({__name:"LanguageSwitcher",setup(e){const{locale:t}=Nt(),n=pA.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&hA(o)}return(o,i)=>(w(),ve(Qo,{"model-value":S(t),options:S(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),_C=1e3,Kg=16384,Gg=500,Yg=50,Tne=6,Mne=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Ene=/^[A-Za-z0-9+/=_-]{200,}$/;let Xg=null;function pi(){if(Xg!==null)return Xg;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=Xn($t.debug)==="1"),Xg=e,e}const Br=[];let Ine=1;const ry=ee(0),Zc=Yl(!1);function $ne(){return Br}function Nne(){Br.length=0,ry.value++}function ol(e){Zc.value||(Br.push({id:Ine++,ts:Date.now(),...e}),Br.length>_C&&Br.splice(0,Br.length-_C),ry.value++)}function w1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return Ene.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>Gg?`${o.slice(0,Gg)}… [+${o.length-Gg} chars]`:o}if(n!=="object")return String(e);if(t>=Tne)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,Yg).map(i=>w1(i,t+1));return e.length>Yg&&o.push(`[+${e.length-Yg} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=Mne.test(o)?"[redacted]":w1(i,t+1);return s}function Zl(e){if(e===void 0)return;const t=w1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Kg)return{_truncated:`detail JSON was ${n.length} chars; first ${Kg} kept`,preview:n.slice(0,Kg)}}catch{return"[unserializable detail]"}return t}function wC(e){pi()&&ol({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Zl(e.body)}})}function SC(e){if(!pi())return;const t=e.code!==0;ol({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:Zl(e.data)}})}function ff(e){pi()&&ol({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 _a(e,t){pi()&&ol({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Zl(t)})}function Lne(e){if(!pi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;ol({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:Zl(e)})}function Pne(e){if(!pi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);ol({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Zl(t.payload)})}const One={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Qg(e,t,n){pi()&&ol({source:"client",kind:`client:${e}`,label:`${One[e]} ${t}`,detail:Zl(n)})}function $r(e,t){pi()&&ol({source:"client",kind:"client:event",label:`· ${e}`,detail:Zl(t)})}let CC=!1;function Rne(){if(!(CC||!pi())){CC=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Qg("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;Qg("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{Qg(e,n.map(Dne).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Dne(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 uE(e=Br){if(typeof document>"u")return;const t=new Blob([Bne(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function Bne(e=Br){return e.map(t=>JSON.stringify(t)).join(`
|
|
260
|
-
`)}const Fne=["aria-checked","aria-label","disabled"],Wne=Ve({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(w(),N("button",{class:De(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=i=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[T("span",{class:"ui-switch__thumb"},null,-1)])],10,Fne))}}),Sr=ft(Wne,[["__scopeId","data-v-dbe22dc4"]]),Hne=["aria-label"],zne=["aria-selected","onClick"],Une={class:"body"},qne={class:"panel"},jne={class:"sec"},Vne={class:"sec-title"},Kne={class:"row"},Gne={class:"rlabel"},Yne={class:"row"},Xne={class:"rlabel"},Qne={class:"row"},Zne={class:"rlabel"},Jne={class:"num-field"},ese=["value","aria-label"],tse={class:"row"},nse={class:"rlabel"},sse={class:"row"},ose={class:"rlabel"},ise={class:"hint"},rse={class:"sec"},lse={class:"sec-title"},ase={class:"row"},cse={class:"rlabel"},use={key:0,class:"hint"},dse={class:"row"},fse={class:"rlabel"},pse={key:0,class:"hint"},hse={class:"row"},mse={class:"rlabel"},gse={class:"panel"},vse={class:"sec"},yse={class:"sec-title"},kse={class:"row"},bse={class:"rlabel"},_se={key:0,class:"rvalue"},wse={class:"actions"},Sse={class:"panel"},Cse={class:"sec"},xse={class:"sec-head"},Ase={class:"sec-title"},Tse={key:0,class:"saving"},Mse={class:"row"},Ese={class:"rlabel"},Ise={class:"hint"},$se={key:0,class:"select-wrap"},Nse={key:0,value:"",disabled:""},Lse=["label"],Pse=["value"],Ose={key:1,class:"rvalue mono"},Rse={class:"row"},Dse={class:"rlabel"},Bse={class:"hint"},Fse={class:"row"},Wse={class:"rlabel"},Hse={class:"hint"},zse={class:"row"},Use={class:"rlabel"},qse={class:"hint"},jse={class:"row"},Vse={class:"rlabel"},Kse={class:"hint"},Gse={key:1,class:"empty-config"},Yse={class:"panel"},Xse={class:"sec"},Qse={class:"sec-title"},Zse={class:"row"},Jse={class:"rlabel"},eoe={class:"rvalue mono"},toe={class:"row"},noe={class:"rlabel"},soe={class:"rvalue mono"},ooe={key:0,class:"row"},ioe={class:"rlabel"},roe={class:"hint"},loe={class:"hint"},aoe={class:"row"},coe={class:"rlabel"},uoe={key:0,class:"hint"},doe=Ve({__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}=Nt(),s=e,o=t,i=ee("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=pL(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=ee(null);iy(u);function d(E){E.key==="Escape"&&o("close")}_n(()=>document.addEventListener("keydown",d)),wn(()=>document.removeEventListener("keydown",d));function f(){uE()}const h=W(()=>{const E=new Map;for(const P of s.models??[])E.set(P.id,{id:P.id,label:P.displayName??P.model??P.id,provider:P.provider});for(const[P,A]of Object.entries(s.config?.models??{})){if(E.has(P))continue;const $=_(A);E.set(P,{id:P,label:b(P,A,$),provider:$??P})}return Array.from(E.values())}),p=W(()=>{const E=new Map;for(const P of h.value){const A=E.get(P.provider)??[];A.push(P),E.set(P.provider,A)}for(const P of E.values())P.sort((A,$)=>A.label.localeCompare($.label));return Array.from(E.entries()).toSorted(([P],[A])=>P.localeCompare(A)).map(([P,A])=>({provider:P,options:A}))}),m=W(()=>{const E=s.config?.defaultPermissionMode;return E==="auto"||E==="yolo"||E==="manual"?E:"manual"});function _(E){if(!E||typeof E!="object")return;const P=E;return typeof P.provider=="string"?P.provider:void 0}function b(E,P,A){if(!P||typeof P!="object")return E;const $=P,D=typeof $.model=="string"?$.model:void 0,R=A??_(P);return D&&R?`${E} (${R}/${D})`:D?`${E} (${D})`:E}function g(E){return E===!0}function v(E){!E||E===s.config?.defaultModel||o("updateConfig",{defaultModel:E})}function y(E){E!==m.value&&o("updateConfig",{defaultPermissionMode:E})}function C(E){const P=s.config?.[E];o("updateConfig",{[E]:!g(P)})}function L(){const E=s.config?.thinking;return!E||typeof E!="object"?!0:E.enabled!==!1}function I(){o("updateConfig",{thinking:{enabled:!L()}})}function k(){const E=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!E})}function M(E){i.value=E}return(E,P)=>(w(),ve(rr,{open:!0,"close-on-esc":!1,title:S(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:P[15]||(P[15]=A=>o("close"))},{default:de(()=>[T("div",{ref_key:"dialogRef",ref:u,class:"sd"},[T("nav",{class:"settings-tabs",role:"tablist","aria-label":S(n)("settings.title")},[(w(),N(Pe,null,ot(r,A=>T("button",{key:A.id,type:"button",class:De(["tab",{on:i.value===A.id}]),role:"tab","aria-selected":i.value===A.id,onClick:$=>M(A.id)},O(S(n)(A.labelKey)),11,zne)),64))],8,Hne),T("div",Une,[In(T("section",qne,[T("section",jne,[T("h3",Vne,O(S(n)("settings.appearance")),1),T("div",Kne,[T("span",Gne,O(S(n)("theme.colorSchemeLabel")),1),Z(Qo,{"model-value":e.colorScheme,options:[{value:"light",label:S(n)("theme.light")},{value:"dark",label:S(n)("theme.dark")},{value:"system",label:S(n)("theme.system")}],"onUpdate:modelValue":P[0]||(P[0]=A=>o("setColorScheme",A))},null,8,["model-value","options"])]),T("div",Yne,[T("span",Xne,O(S(n)("theme.accentLabel")),1),Z(Qo,{"model-value":e.accent,options:[{value:"blue",label:S(n)("theme.accentBlue")},{value:"mono",label:S(n)("theme.accentBlack")}],"onUpdate:modelValue":P[1]||(P[1]=A=>o("setAccent",A))},null,8,["model-value","options"])]),T("div",Qne,[T("span",Zne,O(S(n)("settings.uiFontSize")),1),T("label",Jne,[T("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":S(n)("settings.uiFontSize"),onInput:P[2]||(P[2]=A=>o("setUiFontSize",Number(A.target.value)))},null,40,ese),P[16]||(P[16]=T("span",{class:"num-unit"},"px",-1))])]),T("div",tse,[T("span",nse,O(S(n)("sidebar.language")),1),Z(cE)]),T("div",sse,[T("span",ose,[je(O(S(n)("settings.conversationToc"))+" ",1),T("span",ise,O(S(n)("settings.conversationTocHint")),1)]),Z(Sr,{"model-value":e.conversationToc??!0,label:S(n)("settings.conversationToc"),"onUpdate:modelValue":P[3]||(P[3]=A=>o("setConversationToc",A))},null,8,["model-value","label"])])]),T("section",rse,[T("h3",lse,O(S(n)("settings.notifications")),1),T("div",ase,[T("span",cse,[je(O(S(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",use,O(S(n)("settings.notifyDenied")),1)):ie("",!0)]),Z(Sr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:S(n)("settings.notifyOnComplete"),"onUpdate:modelValue":P[4]||(P[4]=A=>o("setNotify",A))},null,8,["model-value","disabled","label"])]),T("div",dse,[T("span",fse,[je(O(S(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",pse,O(S(n)("settings.notifyDenied")),1)):ie("",!0)]),Z(Sr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:S(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":P[5]||(P[5]=A=>o("setNotifyQuestion",A))},null,8,["model-value","disabled","label"])]),T("div",hse,[T("span",mse,O(S(n)("settings.soundOnComplete")),1),Z(Sr,{"model-value":e.sound,label:S(n)("settings.soundOnComplete"),"onUpdate:modelValue":P[6]||(P[6]=A=>o("setSound",A))},null,8,["model-value","label"])])])],512),[[Ko,i.value==="general"]]),In(T("section",gse,[T("section",vse,[T("h3",yse,O(S(n)("settings.account")),1),T("div",kse,[T("span",bse,O(e.authReady?"managed:kimi-code":S(n)("sidebar.notSignedIn")),1),Z(ht,{text:e.accountModel},{default:de(()=>[e.authReady&&e.accountModel?(w(),N("span",_se,O(e.accountModel),1)):ie("",!0)]),_:1},8,["text"])]),T("div",wse,[Z(Ot,{variant:"secondary",size:"sm",onClick:P[7]||(P[7]=A=>{o("openOnboarding"),o("close")})},{default:de(()=>[je(O(S(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),ve(Ot,{key:0,variant:"danger-soft",size:"sm",onClick:P[8]||(P[8]=A=>o("logout"))},{default:de(()=>[je(O(S(n)("sidebar.signOut")),1)]),_:1})):(w(),ve(Ot,{key:1,variant:"primary",size:"sm",onClick:P[9]||(P[9]=A=>o("login"))},{default:de(()=>[je(O(S(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[Ko,i.value==="account"]]),In(T("section",Sse,[T("section",Cse,[T("div",xse,[T("h3",Ase,O(S(n)("settings.agentDefaults")),1),e.configSaving?(w(),N("span",Tse,O(S(n)("settings.saving")),1)):ie("",!0)]),e.config?(w(),N(Pe,{key:0},[T("div",Mse,[T("span",Ese,[je(O(S(n)("settings.defaultModel"))+" ",1),T("span",Ise,O(S(n)("settings.defaultModelHint")),1)]),p.value.length>0?(w(),N("div",$se,[Z(aE,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":S(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:de(()=>[e.config.defaultModel?ie("",!0):(w(),N("option",Nse,O(S(n)("settings.noDefaultModel")),1)),(w(!0),N(Pe,null,ot(p.value,A=>(w(),N("optgroup",{key:A.provider,label:A.provider},[(w(!0),N(Pe,null,ot(A.options,$=>(w(),N("option",{key:$.id,value:$.id},O($.label),9,Pse))),128))],8,Lse))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),N("span",Ose,O(e.config.defaultModel??S(n)("settings.noDefaultModel")),1))]),T("div",Rse,[T("span",Dse,[je(O(S(n)("settings.defaultPermission"))+" ",1),T("span",Bse,O(S(n)("settings.defaultPermissionHint")),1)]),Z(Qo,{"model-value":m.value,options:a.map(A=>({value:A,label:S(n)(c[A])})),"onUpdate:modelValue":P[10]||(P[10]=A=>y(A))},null,8,["model-value","options"])]),T("div",Fse,[T("span",Wse,[je(O(S(n)("settings.defaultThinking"))+" ",1),T("span",Hse,O(S(n)("settings.defaultThinkingHint")),1)]),Z(Sr,{"model-value":L(),disabled:e.configSaving,label:S(n)("settings.defaultThinking"),"onUpdate:modelValue":P[11]||(P[11]=A=>I())},null,8,["model-value","disabled","label"])]),T("div",zse,[T("span",Use,[je(O(S(n)("settings.defaultPlanMode"))+" ",1),T("span",qse,O(S(n)("settings.defaultPlanModeHint")),1)]),Z(Sr,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:S(n)("settings.defaultPlanMode"),"onUpdate:modelValue":P[12]||(P[12]=A=>C("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),T("div",jse,[T("span",Vse,[je(O(S(n)("settings.mergeSkills"))+" ",1),T("span",Kse,O(S(n)("settings.mergeSkillsHint")),1)]),Z(Sr,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:S(n)("settings.mergeSkills"),"onUpdate:modelValue":P[13]||(P[13]=A=>C("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),N("div",Gse,O(S(n)("settings.configUnavailable")),1))])],512),[[Ko,i.value==="agent"]]),In(T("section",Yse,[T("section",Xse,[T("h3",Qse,O(S(n)("settings.advanced")),1),T("div",Zse,[T("span",Jse,O(S(n)("sidebar.daemon")),1),T("span",eoe,O(S(l)),1)]),T("div",toe,[T("span",noe,O(S(n)("settings.serverVersion")),1),T("span",soe,O(e.serverVersion||"-"),1)]),e.config?(w(),N("div",ooe,[T("span",ioe,[je(O(S(n)("settings.telemetry"))+" ",1),T("span",roe,O(S(n)("settings.telemetryHint")),1),T("span",loe,O(S(n)("settings.telemetryRestartHint")),1)]),Z(Sr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:S(n)("settings.telemetry"),"onUpdate:modelValue":P[14]||(P[14]=A=>k())},null,8,["model-value","disabled","label"])])):ie("",!0),T("div",aoe,[T("span",coe,[je(O(S(n)("settings.exportLog"))+" ",1),S(pi)()?ie("",!0):(w(),N("span",uoe,O(S(n)("settings.logHint")),1))]),Z(Ot,{variant:"secondary",size:"sm",onClick:f},{default:de(()=>[je(O(S(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[Ko,i.value==="advanced"]])])],512)]),_:1},8,["title"]))}}),foe=ft(doe,[["__scopeId","data-v-b6913864"]]),poe={class:"aw"},hoe={class:"crumbbar"},moe={class:"crumbs"},goe={key:0,class:"crumb-sep"},voe=["onClick"],yoe={key:0,class:"filterbar"},koe=["placeholder"],boe={class:"folder-list"},_oe={key:0,class:"fl-loading"},woe=["onClick"],Soe={class:"folder-name search-rel"},Coe={key:0,class:"git-branch"},xoe={key:0,class:"fl-empty"},Aoe={key:1,class:"fl-loading"},Toe=["onClick"],Moe={class:"folder-name"},Eoe={key:0,class:"git-branch"},Ioe={key:0,class:"fl-empty"},$oe={class:"paste-row"},Noe={class:"paste-input-wrap"},Loe={key:1,class:"add-error",role:"alert"},Poe={class:"actions"},Ooe={class:"footer-hint"},Roe=600,Doe=6,xC=150,Boe=Ve({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=ee(!0),r=ee(!1),l=ee(!1),a=ee(""),c=ee(null),u=ee([]),d=ee(""),f=ee(!1),h=ee([]),p=W(()=>d.value.trim().length>0);let m=0,_=null;function b($,D){const R=$.toLowerCase(),H=D.toLowerCase();let z=0;for(let q=0;q<H.length&&z<R.length;q++)H[q]===R[z]&&z++;return z===R.length}async function g($){const D=a.value,R=$.trim();if(!D||R===""){h.value=[],f.value=!1;return}const H=++m;f.value=!0;const z=[],q=[{path:D,depth:0}];let Q=0;for(;q.length>0&&Q<Roe&&z.length<xC;){if(H!==m)return;const X=q.shift();Q++;let ue;try{ue=await s.browseFs(X.path)}catch{continue}if(H!==m)return;for(const ge of ue.entries){if(!ge.isDir)continue;const xe=ge.path.startsWith(D)?ge.path.slice(D.length).replace(/^\/+/,""):ge.path;if(b(R,xe||ge.name)&&(z.push({path:ge.path,name:ge.name,rel:xe||ge.name,isGitRepo:ge.isGitRepo,branch:ge.branch}),z.length>=xC))break;X.depth+1<Doe&&q.push({path:ge.path,depth:X.depth+1})}H===m&&(h.value=[...z])}H===m&&(f.value=!1)}Ge(d,$=>{if(_&&clearTimeout(_),$.trim()===""){m++,h.value=[],f.value=!1;return}_=setTimeout(()=>void g($),220)});const v=ee(!1),y=ee(""),C=W(()=>y.value.trim()),L=W(()=>{const $=a.value;if(!$)return[];const D=$.split("/").filter(Boolean),R=[{label:"/",path:"/"}];let H="";for(const z of D)H+=`/${z}`,R.push({label:z,path:H});return R}),I=W(()=>a.value.length>0);async function k($){r.value=!0;try{const D=await s.browseFs($);if(!D.path){l.value=!0;return}a.value=D.path,c.value=D.parent,u.value=D.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function M($){$.isDir&&k($.path)}function E(){c.value&&k(c.value)}function P(){I.value&&o("add",a.value)}function A(){C.value.length!==0&&o("add",C.value)}return _n(async()=>{r.value=!0;try{if(s.defaultPath&&(await k(s.defaultPath),!l.value))return;const $=await s.getFsHome();$.home?await k($.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),wn(()=>{_&&clearTimeout(_)}),($,D)=>(w(),ve(rr,{open:i.value,"onUpdate:open":D[5]||(D[5]=R=>i.value=R),title:S(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:D[6]||(D[6]=R=>o("close"))},{default:de(()=>[T("div",poe,[l.value?ie("",!0):(w(),N(Pe,{key:0},[T("div",hoe,[Z(dn,{size:"sm",disabled:!c.value,label:S(n)("workspace.up"),onClick:E},{default:de(()=>[Z(Ye,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),T("div",moe,[(w(!0),N(Pe,null,ot(L.value,(R,H)=>(w(),N(Pe,{key:R.path},[H>1?(w(),N("span",goe,"/")):ie("",!0),T("button",{class:De(["crumb",{last:H===L.value.length-1}]),onClick:z=>k(R.path)},O(R.label),11,voe)],64))),128))])]),r.value?ie("",!0):(w(),N("div",yoe,[Z(Ye,{class:"filter-icon",name:"search",size:"md"}),In(T("input",{"onUpdate:modelValue":D[0]||(D[0]=R=>d.value=R),class:"filter-input",type:"text",placeholder:S(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:D[1]||(D[1]=kt(()=>{},["stop"]))},null,40,koe),[[go,d.value]]),f.value?(w(),ve(Jo,{key:0,size:"sm"})):ie("",!0)])),T("div",boe,[r.value?(w(),N("div",_oe,O(S(n)("workspace.browsing")),1)):p.value?(w(),N(Pe,{key:1},[(w(!0),N(Pe,null,ot(h.value,R=>(w(),N("button",{key:R.path,class:"folder-row",onClick:H=>k(R.path)},[Z(Ye,{class:"dir-icon",name:"folder-closed",size:"sm"}),T("span",Soe,O(R.rel),1),R.isGitRepo?(w(),ve(Ms,{key:0,variant:"info",size:"sm"},{default:de(()=>[je(O(S(n)("workspace.gitTag")),1),R.branch?(w(),N("span",Coe,O(R.branch),1)):ie("",!0)]),_:2},1024)):ie("",!0)],8,woe))),128)),!f.value&&h.value.length===0?(w(),N("div",xoe,O(S(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),N("div",Aoe,O(S(n)("workspace.searching")),1)):ie("",!0)],64)):(w(),N(Pe,{key:2},[(w(!0),N(Pe,null,ot(u.value,R=>(w(),N("button",{key:R.path,class:"folder-row",onClick:H=>M(R)},[Z(Ye,{class:"dir-icon",name:"folder-closed",size:"sm"}),T("span",Moe,O(R.name),1),R.isGitRepo?(w(),ve(Ms,{key:0,variant:"info",size:"sm"},{default:de(()=>[je(O(S(n)("workspace.gitTag")),1),R.branch?(w(),N("span",Eoe,O(R.branch),1)):ie("",!0)]),_:2},1024)):ie("",!0)],8,Toe))),128)),u.value.length===0?(w(),N("div",Ioe,O(S(n)("workspace.noSubfolders")),1)):ie("",!0)],64))])],64)),T("div",{class:De(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(w(),ve(Ot,{key:0,variant:"ghost",size:"sm",onClick:D[2]||(D[2]=R=>v.value=!0)},{default:de(()=>[je(O(S(n)("workspace.pasteToggle")),1)]),_:1})):(w(),ve(Qc,{key:1,label:S(n)("workspace.pathLabel")},{default:de(()=>[T("div",$oe,[T("div",Noe,[Z(Za,{modelValue:y.value,"onUpdate:modelValue":D[3]||(D[3]=R=>y.value=R),placeholder:S(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:ai(kt(A,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),Z(dn,{disabled:C.value.length===0,label:S(n)("workspace.add"),onClick:A},{default:de(()=>[Z(Ye,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(w(),N("div",Loe,O(e.error),1)):ie("",!0),T("div",Poe,[Z(ht,{text:a.value},{default:de(()=>[l.value?ie("",!0):(w(),ve(Ot,{key:0,variant:"primary",disabled:!I.value,onClick:P},{default:de(()=>[je(O(S(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),Z(Ot,{variant:"secondary",onClick:D[4]||(D[4]=R=>o("close"))},{default:de(()=>[je(O(S(n)("workspace.cancel")),1)]),_:1})]),T("div",Ooe,O(S(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),Foe=ft(Boe,[["__scopeId","data-v-ad529757"]]),Woe={key:0,class:"confirm-dialog__message"},Hoe=Ve({__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:s}=Nt();function o(){n("update:open",!1),n("cancel")}return(i,r)=>(w(),ve(rr,{open:e.open,title:e.title,height:"auto","onUpdate:open":r[1]||(r[1]=l=>n("update:open",l)),onClose:o},{foot:de(()=>[Z(Ot,{variant:"secondary",disabled:e.loading,onClick:o},{default:de(()=>[je(O(e.cancelLabel??S(s)("common.cancel")),1)]),_:1},8,["disabled"]),Z(Ot,{variant:e.variant,loading:e.loading,onClick:r[0]||(r[0]=l=>n("confirm"))},{default:de(()=>[je(O(e.confirmLabel??S(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:de(()=>[e.message?(w(),N("p",Woe,O(e.message),1)):ie("",!0)]),_:1},8,["open","title"]))}}),zoe=ft(Hoe,[["__scopeId","data-v-a9df9b9a"]]),Uoe=Ve({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=nl();return(s,o)=>(w(),ve(zoe,{open:S(t)!==null,title:S(t)?.title??"",message:S(t)?.message,"confirm-label":S(t)?.confirmLabel,"cancel-label":S(t)?.cancelLabel,variant:S(t)?.variant,onConfirm:o[0]||(o[0]=i=>S(n)(!0)),onCancel:o[1]||(o[1]=i=>S(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),qoe={class:"rows"},joe={class:"row"},Voe={class:"row"},Koe={class:"row"},Goe={class:"row"},Yoe={class:"row"},Xoe={class:"row"},Qoe={class:"ctx-text"},Zoe={key:0,class:"bar"},Joe={class:"row"},eie=Ve({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t,i=ee(!0),r=W(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=W(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=W(()=>{const p=s.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=W(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=W(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=W(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=W(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(w(),ve(rr,{open:i.value,"onUpdate:open":m[0]||(m[0]=_=>i.value=_),title:S(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=_=>o("close"))},{default:de(()=>[T("dl",qoe,[T("div",joe,[T("dt",null,O(S(n)("status.statusModel")),1),T("dd",null,O(e.status.model),1)]),T("div",Voe,[T("dt",null,O(S(n)("status.statusThinking")),1),T("dd",null,O(e.thinking),1)]),T("div",Koe,[T("dt",null,O(S(n)("status.statusPermission")),1),T("dd",{style:Qt({color:c.value})},O(a(e.status.permission)),5)]),T("div",Goe,[T("dt",null,O(S(n)("status.statusPlanMode")),1),T("dd",{class:De({"plan-on":e.planMode})},O(u.value),3)]),T("div",Yoe,[T("dt",null,O(S(n)("status.statusSwarmMode")),1),T("dd",{class:De({"swarm-on":e.swarmMode})},O(d.value),3)]),T("div",Xoe,[T("dt",null,O(S(n)("status.statusContext")),1),T("dd",null,[T("span",Qoe,O(l.value),1),e.status.ctxMax>0?(w(),N("span",Zoe,[T("i",{style:Qt({width:r.value+"%"})},null,4)])):ie("",!0)])]),T("div",Joe,[T("dt",null,O(S(n)("status.statusCost")),1),T("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),tie=ft(eie,[["__scopeId","data-v-59dd31f3"]]),nie={class:"ui-toast__icon","aria-hidden":"true"},sie={class:"ui-toast__body"},oie={class:"ui-toast__title"},iie={key:0,class:"ui-toast__msg"},rie=Ve({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[T("span",nie,[Tn(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),ve(Ye,{key:0,name:"check"})):e.variant==="danger"?(w(),ve(Ye,{key:1,name:"close"})):e.variant==="warning"?(w(),ve(Ye,{key:2,name:"alert-triangle"})):(w(),ve(Ye,{key:3,name:"info"}))],!0)]),T("div",sie,[T("div",oie,O(e.title),1),e.message?(w(),N("div",iie,O(e.message),1)):ie("",!0),Tn(t.$slots,"default",{},void 0,!0)]),Z(dn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:de(()=>[Z(Ye,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),lie=ft(rie,[["__scopeId","data-v-adc6f346"]]),aie={key:0,class:"actions"},cie=["onClick"],uie=["onClick"],die={key:1,class:"details"},fie=Ve({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Nt();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(`${o("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 M=[k.title];k.message&&M.push(k.message);const E=k.details??[];if(E.length>0){M.push("",`${o("warnings.diagnostics")}:`);for(const P of E)M.push(`${P.label}: ${P.value}`)}return M.join(`
|
|
261
|
-
`)}let f=1;const h=ee([]),p=new Map,m=new Map;function _(k){const M=c(k)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function b(k,M){const E=p.get(k)??{handle:null,deadline:0,remaining:0};E.handle=setTimeout(()=>I(k),M),E.deadline=Date.now()+M,p.set(k,E)}function g(k){const M=p.get(k);M&&M.handle!==null&&clearTimeout(M.handle),p.delete(k)}function v(k){const M=p.get(k);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function y(k){if(h.value.find(P=>P.id===k)?.detailsOpen)return;const E=p.get(k);!E||E.handle!==null||b(k,E.remaining)}function C(k){k.detailsOpen=!k.detailsOpen,k.detailsOpen?v(k.id):y(k.id)}async function L(k){if(!await Ws(d(k.warning)))return;k.copied=!0;const E=m.get(k.id);E&&clearTimeout(E),m.set(k.id,setTimeout(()=>{k.copied=!1,m.delete(k.id)},1400))}function I(k){g(k);const M=m.get(k);M&&clearTimeout(M),m.delete(k);const E=h.value.findIndex(P=>P.id===k);E!==-1&&(h.value=h.value.filter(P=>P.id!==k),s("dismiss",E))}return Ge(()=>n.warnings,k=>{const M=[...h.value];h.value=k.map(E=>{const P=u(E),A=M.findIndex(R=>R.key===P),$=A===-1?void 0:M.splice(A,1)[0];if($)return $.warning=E,$;const D={id:f++,key:P,warning:E,detailsOpen:!1,copied:!1};return b(D.id,_(E)),D});for(const E of M){g(E.id);const P=m.get(E.id);P&&clearTimeout(P),m.delete(E.id)}},{immediate:!0,flush:"post"}),wn(()=>{p.forEach(k=>{k.handle!==null&&clearTimeout(k.handle)}),p.clear(),m.forEach(k=>clearTimeout(k)),m.clear()}),(k,M)=>(w(),ve(W4,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:de(()=>[(w(!0),N(Pe,null,ot(h.value,E=>(w(),ve(lie,{key:E.id,variant:c(E.warning)?"danger":"warning",title:r(E.warning),message:l(E.warning),"dismiss-label":S(o)("warnings.dismiss"),onDismiss:P=>I(E.id),onPointerenter:P=>v(E.id),onPointerleave:P=>y(E.id)},{default:de(()=>[a(E.warning)?.length?(w(),N("div",aie,[T("button",{class:"link",type:"button",onClick:P=>C(E)},O(E.detailsOpen?S(o)("warnings.hideDetails"):S(o)("warnings.showDetails")),9,cie),T("button",{class:"link",type:"button",onClick:P=>L(E)},O(E.copied?S(o)("warnings.copied"):S(o)("warnings.copyDetails")),9,uie)])):ie("",!0),E.detailsOpen&&a(E.warning)?.length?(w(),N("dl",die,[(w(!0),N(Pe,null,ot(a(E.warning),P=>(w(),N("div",{key:`${P.label}:${P.value}`,class:"detail-row"},[T("dt",null,O(P.label),1),T("dd",null,O(P.value),1)]))),128))])):ie("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),pie=ft(fie,[["__scopeId","data-v-92efeff8"]]),hie={class:"topbar"},mie={class:"wsq"},gie=["aria-label"],vie={class:"tb-path"},yie={class:"ws"},kie={class:"se"},bie={class:"tb-sub"},_ie=Ve({__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}=Nt(),s=e,o=t,i=W(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=W(()=>s.workspace?.name??n("workspace.noWorkspace")),l=W(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),N("div",hie,[T("span",mie,O(i.value),1),T("button",{type:"button",class:"tb-mid","aria-label":S(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[T("span",vie,[T("span",yie,O(r.value),1),e.sessionTitle?(w(),N(Pe,{key:0},[c[2]||(c[2]=T("span",{class:"sl"},"/",-1)),T("span",kie,O(e.sessionTitle),1)],64)):ie("",!0),c[3]||(c[3]=T("span",{class:"cv"},"⌄",-1))]),T("span",bie,[T("span",{class:De(["rd",{on:e.running}])},null,2),T("span",null,O(l.value),1),e.branch?(w(),N(Pe,{key:0},[je(" · "+O(e.branch),1)],64)):ie("",!0),e.sessionCount>0?(w(),N(Pe,{key:1},[je(" · "+O(S(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ie("",!0)])],8,gie),Z(dn,{size:"lg",label:S(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:de(()=>[Z(Ye,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),wie=ft(_ie,[["__scopeId","data-v-59a11935"]]),Sie={key:0,class:"sheet-root"},Cie=["aria-label"],xie=["aria-label"],Aie={key:0,class:"sheet-head"},Tie={class:"sheet-title"},Mie={class:"sheet-body"},Eie=Ve({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ge(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),wn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),ve(Vr,{name:"sheet"},{default:de(()=>[e.modelValue?(w(),N("div",Sie,[T("div",{class:"sheet-scrim",onClick:i}),T("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||S(n)("mobile.sheetLabel")},[T("button",{type:"button",class:"sheet-grab","aria-label":S(n)("mobile.closeSheet"),onClick:i},null,8,xie),e.title?(w(),N("div",Aie,[T("span",Tie,O(e.title),1)])):ie("",!0),T("div",Mie,[Tn(l.$slots,"default",{},void 0,!0)])],8,Cie)])):ie("",!0)]),_:3}))}}),dE=ft(Eie,[["__scopeId","data-v-4441dd70"]]),Iie={class:"mlist"},$ie={key:0,class:"mempty"},Nie=["onClick"],Lie={class:"mgh-main"},Pie={class:"mgh-name"},Oie={class:"mgh-path"},Rie={key:2,class:"att"},Die={key:0,class:"mempty small"},Bie=["onClick"],Fie={class:"m"},Wie={class:"s"},Hie={key:0,class:"att"},zie=["disabled","onClick"],Uie=Ve({__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}=Nt(),{confirm:s}=nl(),o=e,i=t;function r(){i("update:modelValue",!1)}function l(I){i("select",I),r()}function a(I){i("createInWorkspace",I),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=ee(new Set);function f(I){return d.value.has(I)}function h(I){const k=new Set(d.value);k.has(I)?k.delete(I):k.add(I),d.value=k,m.value=null,v.value=null}function p(I){return o.attentionByWorkspace[I]??0}const m=ee(null);function _(I){m.value=m.value===I?null:I,v.value=null}function b(I){m.value=null;const M=(typeof window<"u"?window.prompt(n("sidebar.rename"),I.title):null)?.trim();M&&i("rename",I.id,M)}async function g(I){m.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",I)}const v=ee(null);function y(I){v.value=v.value===I?null:I,m.value=null}function C(I){Ws(I.root),v.value=null}async function L(I){v.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:I.name}),variant:"danger"})&&i("deleteWorkspace",I.id)}return(I,k)=>(w(),ve(dE,{"model-value":e.modelValue,"onUpdate:modelValue":k[2]||(k[2]=M=>i("update:modelValue",M))},{default:de(()=>[T("button",{type:"button",class:"newrow",onClick:c},[Z(Ye,{name:"message",size:"sm"}),je(" "+O(S(n)("sidebar.newChat")),1)]),T("button",{type:"button",class:"newrow secondary",onClick:u},[Z(Ye,{name:"folder",size:"sm"}),je(" "+O(S(n)("sidebar.newWorkspace")),1)]),T("div",Iie,[e.groups.length===0?(w(),N("div",$ie,O(S(n)("workspace.noWorkspace")),1)):ie("",!0),(w(!0),N(Pe,null,ot(e.groups,M=>(w(),N("div",{key:M.workspace.id,class:"mgroup"},[T("div",{class:De(["mgh",{on:M.workspace.id===e.activeWorkspaceId}]),onClick:E=>h(M.workspace.id)},[f(M.workspace.id)?(w(),ve(Ye,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),ve(Ye,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),T("div",Lie,[T("span",Pie,O(M.workspace.name),1),Z(ht,{text:M.workspace.root},{default:de(()=>[T("span",Oie,O(M.workspace.branch||M.workspace.shortPath),1)]),_:2},1032,["text"])]),f(M.workspace.id)&&p(M.workspace.id)>0?(w(),N("span",Rie,O(p(M.workspace.id)),1)):ie("",!0),Z(ht,{text:S(n)("sidebar.options")},{default:de(()=>[Z(dn,{size:"lg",class:"mgh-more",label:S(n)("sidebar.options"),onClick:kt(E=>y(M.workspace.id),["stop"])},{default:de(()=>[Z(Ye,{name:"dots-vertical",size:"md"})]),_:1},8,["label","onClick"])]),_:2},1032,["text"]),Z(ht,{text:S(n)("workspace.newInGroup")},{default:de(()=>[Z(dn,{size:"lg",class:"mgh-add",label:S(n)("workspace.newInGroup"),onClick:kt(E=>a(M.workspace.id),["stop"])},{default:de(()=>[Z(Ye,{name:"plus",size:"md"})]),_:1},8,["label","onClick"])]),_:2},1032,["text"]),v.value===M.workspace.id?(w(),ve(Fl,{key:3,class:"kmenu wsmenu",onClick:k[0]||(k[0]=kt(()=>{},["stop"]))},{default:de(()=>[Z(mn,{size:"lg",onClick:E=>C(M.workspace)},{default:de(()=>[je(O(S(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),Z(mn,{size:"lg",danger:"",onClick:E=>L(M.workspace)},{default:de(()=>[je(O(S(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ie("",!0)],10,Nie),In(T("div",null,[M.sessions.length===0?(w(),N("div",Die,O(S(n)("sidebar.noSessions")),1)):ie("",!0),(w(!0),N(Pe,null,ot(M.sessions,E=>(w(),N("div",{key:E.id,class:De(["srow",{cur:E.id===e.activeId}]),onClick:P=>l(E.id)},[T("div",Fie,[T("div",{class:De(["t",{run:E.busy,aborted:E.status==="aborted"}])},O(E.title),3),T("div",Wie,O(E.time),1)]),(e.attentionBySession[E.id]??0)>0?(w(),N("span",Hie,O(e.attentionBySession[E.id]),1)):ie("",!0),Z(ht,{text:S(n)("sidebar.options")},{default:de(()=>[Z(dn,{size:"lg",class:"kb",label:S(n)("sidebar.options"),onClick:kt(P=>_(E.id),["stop"])},{default:de(()=>[Z(Ye,{name:"dots-vertical",size:"md"})]),_:1},8,["label","onClick"])]),_:2},1032,["text"]),m.value===E.id?(w(),ve(Fl,{key:1,class:"kmenu",onClick:k[1]||(k[1]=kt(()=>{},["stop"]))},{default:de(()=>[Z(mn,{size:"lg",onClick:P=>b(E)},{default:de(()=>[je(O(S(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),Z(mn,{size:"lg",danger:"",onClick:P=>g(E.id)},{default:de(()=>[je(O(S(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ie("",!0)],10,Bie))),128)),M.hasMore||M.loadingMore?(w(),N("button",{key:1,type:"button",class:"mshow-more",disabled:M.loadingMore,onClick:kt(E=>i("loadMore",M.workspace.id),["stop"])},O(M.loadingMore?S(n)("sidebar.loadingMore"):S(n)("sidebar.showMore",{count:Math.max(0,M.workspace.sessionCount-M.sessions.length)})),9,zie)):ie("",!0)],512),[[Ko,!f(M.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),qie=ft(Uie,[["__scopeId","data-v-cac27f6e"]]),jie={class:"group-title"},Vie={class:"srow-main"},Kie={class:"srow-label"},Gie={class:"srow-sub"},Yie={class:"srow-main"},Xie={class:"srow-label"},Qie={class:"srow-val"},Zie={class:"srow-main"},Jie={class:"srow-label"},ere={class:"srow-sub"},tre=["aria-checked"],nre={class:"srow-main"},sre={class:"srow-label"},ore={class:"srow-sub"},ire=["aria-checked"],rre={class:"srow-main"},lre={class:"srow-label"},are={class:"srow read-only"},cre={class:"srow-main"},ure={class:"srow-label"},dre={class:"srow-sub"},fre=["aria-label"],pre={class:"group-title"},hre={class:"srow read-only pref"},mre={class:"srow-main"},gre={class:"srow-label"},vre={class:"srow read-only pref"},yre={class:"srow-main"},kre={class:"srow-label"},bre={class:"srow read-only pref"},_re={class:"srow-main"},wre={class:"srow-label"},Sre={class:"num-field"},Cre=["value","aria-label"],xre={class:"srow-main"},Are={class:"srow-label"},Tre={class:"srow-sub"},Mre=["aria-checked"],Ere={class:"srow-main"},Ire={class:"srow-label"},$re={class:"srow-main"},Nre={class:"srow-label"},Lre={key:2,class:"srow read-only"},Pre={class:"srow-main"},Ore={class:"srow-label"},Rre={class:"srow-val dim"},Dre=Ve({__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:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Nt(),s=e,o=t;function i(y){o("setColorScheme",y)}const r=["manual","auto","yolo"],l=W(()=>s.thinking??"high"),a=W(()=>s.planMode===!0),c=W(()=>s.swarmMode===!0),u=W(()=>{const y=s.status.permission;return y==="yolo"?"var(--color-danger)":y==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),d=W(()=>{const y=s.status.permission,C=n(y==="yolo"?"mobile.permYoloSub":y==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${y} · ${C}`}),f=y=>`${Math.round(y/1e3)}k`,h=W(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),p=W(()=>s.status.ctxMax>0?`${f(s.status.ctxUsed)}/${f(s.status.ctxMax)}`:n("status.statusNone"));function m(){o("setThinking",l.value==="off"?"high":"off")}function _(){const y=r.indexOf(s.status.permission),C=r[(y+1)%r.length];o("setPermission",C)}function b(){o("pickModel"),o("update:modelValue",!1)}function g(){o("login"),o("update:modelValue",!1)}function v(){o("logout"),o("update:modelValue",!1)}return(y,C)=>(w(),ve(dE,{"model-value":e.modelValue,title:S(n)("mobile.settingsTitle"),"onUpdate:modelValue":C[4]||(C[4]=L=>o("update:modelValue",L))},{default:de(()=>[T("div",jie,O(S(n)("mobile.groupSession")),1),T("button",{type:"button",class:"srow",onClick:b},[T("span",Vie,[T("span",Kie,O(S(n)("status.statusModel")),1),T("span",Gie,O(e.status.model),1)]),C[5]||(C[5]=T("span",{class:"chev"},"›",-1))]),T("button",{type:"button",class:"srow",onClick:m},[T("span",Yie,[T("span",Xie,O(S(n)("status.statusThinking")),1)]),T("span",Qie,O(l.value==="off"?S(n)("status.planOff"):S(n)("status.planOn")),1),C[6]||(C[6]=T("span",{class:"chev"},"›",-1))]),T("button",{type:"button",class:"srow",onClick:C[0]||(C[0]=L=>o("togglePlan"))},[T("span",Zie,[T("span",Jie,O(S(n)("status.statusPlanMode")),1),T("span",ere,O(S(n)("mobile.planModeSub")),1)]),T("span",{class:De(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,tre)]),T("button",{type:"button",class:"srow",onClick:C[1]||(C[1]=L=>o("toggleSwarm"))},[T("span",nre,[T("span",sre,O(S(n)("status.statusSwarmMode")),1),T("span",ore,O(S(n)("mobile.swarmModeSub")),1)]),T("span",{class:De(["toggle",{on:c.value}]),role:"switch","aria-checked":c.value},null,10,ire)]),T("button",{type:"button",class:"srow",onClick:_},[T("span",rre,[T("span",lre,O(S(n)("status.statusPermission")),1),T("span",{class:"srow-sub",style:Qt({color:u.value})},O(d.value),5)]),C[7]||(C[7]=T("span",{class:"chev"},"›",-1))]),T("div",are,[T("span",cre,[T("span",ure,O(S(n)("status.statusContext")),1),T("span",dre,O(p.value),1)]),T("span",{class:"ctx-meter","aria-label":p.value},[T("i",{style:Qt({width:h.value+"%"})},null,4)],8,fre)]),T("div",pre,O(S(n)("mobile.groupApp")),1),T("div",hre,[T("span",mre,[T("span",gre,O(S(n)("theme.colorSchemeLabel")),1)]),Z(Qo,{"model-value":e.colorScheme??"system",options:[{value:"light",label:S(n)("theme.light")},{value:"dark",label:S(n)("theme.dark")},{value:"system",label:S(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),T("div",vre,[T("span",yre,[T("span",kre,O(S(n)("sidebar.language")),1)]),Z(cE)]),T("div",bre,[T("span",_re,[T("span",wre,O(S(n)("settings.uiFontSize")),1)]),T("label",Sre,[T("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":S(n)("settings.uiFontSize"),onInput:C[2]||(C[2]=L=>o("setUiFontSize",Number(L.target.value)))},null,40,Cre),C[8]||(C[8]=T("span",{class:"num-unit"},"px",-1))])]),T("button",{type:"button",class:"srow",onClick:C[3]||(C[3]=L=>o("setConversationToc",!e.conversationToc))},[T("span",xre,[T("span",Are,O(S(n)("settings.conversationToc")),1),T("span",Tre,O(S(n)("settings.conversationTocHint")),1)]),T("span",{class:De(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Mre)]),e.authReady?(w(),N("button",{key:0,type:"button",class:"srow acct out",onClick:v},[T("span",Ere,[T("span",Ire,O(S(n)("sidebar.signOut")),1)])])):(w(),N("button",{key:1,type:"button",class:"srow acct in",onClick:g},[T("span",$re,[T("span",Nre,O(S(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),N("div",Lre,[T("span",Pre,[T("span",Ore,O(S(n)("settings.serverVersion")),1)]),T("span",Rre,O(e.serverVersion),1)])):ie("",!0)]),_:1},8,["model-value","title"]))}}),Bre=ft(Dre,[["__scopeId","data-v-6c7aa567"]]),fE=["blue","mono"],pE=["light","dark","system"],hE=14,Fre=12,Wre=20;function Hre(){const e=Xn($t.accent);return e&&fE.includes(e)?e:"blue"}function zre(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Ure(){const e=Xn($t.colorScheme);return e&&pE.includes(e)?e:"system"}function qre(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function ly(e){return Number.isFinite(e)?Math.min(Wre,Math.max(Fre,Math.round(e))):hE}function jre(){const e=Xn($t.uiFontSize);return e===null?hE:ly(Number(e))}function Vre(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${ly(e)}px`)}const ay=ee(Ure()),cy=ee(Hre()),uy=ee(jre());Ge(ay,qre,{immediate:!0});Ge(cy,zre,{immediate:!0});Ge(uy,Vre,{immediate:!0});function Kre(e){pE.includes(e)&&(ay.value=e,es($t.colorScheme,e))}function Gre(e){fE.includes(e)&&(cy.value=e,es($t.accent,e))}function Yre(e){const t=ly(e);uy.value=t,es($t.uiFontSize,String(t))}const Xre=600,Qre=250,Ih=250,Zre=1e3,Jre=160,Op=ee(!1);let $l=[],Ol=null,Rp=-Ih;function ele(){$l=[],Rp=-Ih,Op.value=!1,Ol!==null&&(clearTimeout(Ol),Ol=null)}function tle(){Op.value=!0,Ol!==null&&clearTimeout(Ol),Ol=setTimeout(()=>{Ol=null,$l=[],Rp=-Ih,Op.value=!1},Zre)}function nle(e){if(e<=0)return;const t=Date.now();$l.push({time:t,chars:e});const n=t-Xre;if($l=$l.filter(l=>l.time>=n),t-Rp<Ih)return;Rp=t;const s=$l[0]?.time??t,o=Math.max(t-s,Qre);$l.reduce((l,a)=>l+a.chars,0)/o*1e3>=Jre&&tle()}function mE(){return{colorScheme:ay,accent:cy,uiFontSize:uy,fastMoon:Op,setColorScheme:Kre,setAccent:Gre,setUiFontSize:Yre,resetFastMoon:ele,recordMoonDelta:nle}}const sle={class:"ob-brand"},ole={class:"ob-brand-text"},ile={class:"ob-title"},rle={class:"ob-sub"},lle={class:"ob-sec"},ale={class:"ob-label"},cle={class:"ob-sec"},ule={class:"ob-label"},dle={class:"ob-sec"},fle={class:"ob-label"},ple=Ve({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Nt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=mE();function c(d){o.value!==d&&hA(d)}function u(){n("complete")}return(d,f)=>(w(),ve(rr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:de(()=>[T("div",sle,[f[4]||(f[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",ole,[T("div",ile,O(S(s)("onboarding.title")),1),T("div",rle,O(S(s)("onboarding.subtitle")),1)])])]),default:de(()=>[T("section",lle,[T("div",ale,O(S(s)("onboarding.languageLabel")),1),Z(Qo,{"model-value":S(o),options:S(pA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),T("section",cle,[T("div",ule,O(S(s)("theme.colorSchemeLabel")),1),Z(Qo,{"model-value":S(i),options:[{value:"light",label:S(s)("theme.light")},{value:"dark",label:S(s)("theme.dark")},{value:"system",label:S(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>S(l)(h))},null,8,["model-value","options"])]),T("section",dle,[T("div",fle,O(S(s)("theme.accentLabel")),1),Z(Qo,{"model-value":S(r),options:[{value:"blue",label:S(s)("theme.accentBlue")},{value:"mono",label:S(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>S(a)(h))},null,8,["model-value","options"])]),Z(Ot,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:de(()=>[je(O(S(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),hle=ft(ple,[["__scopeId","data-v-fbdd3eab"]]),mle=["aria-label"],gle={class:"gload-box"},vle={class:"gload-text"},yle=Ve({__name:"GlobalLoading",setup(e){const{t}=Nt();return(n,s)=>(w(),N("div",{class:"gload",role:"status","aria-label":S(t)("app.connecting")},[T("div",gle,[s[0]||(s[0]=Q1('<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)),Z(Jo,{size:"md",label:S(t)("app.connecting")},null,8,["label"]),T("div",vle,O(S(t)("app.connecting")),1)])],8,mle))}}),kle=ft(yle,[["__scopeId","data-v-8d6a5c44"]]),ble={class:"kap-root"},_le={class:"kap-head"},wle={class:"kap-count"},Sle={class:"kap-head-actions"},Cle={class:"kap-filters"},xle=["value"],Ale={class:"kap-check"},Tle={class:"kap-check"},Mle={class:"kap-view-toggle",role:"group"},Ele={key:0,class:"kap-empty"},Ile=["onClick"],$le={class:"kap-ts"},Nle={class:"kap-label"},Lle={key:0,class:"kap-detail"},Ple={class:"kap-detail-actions"},Ole=["onClick"],Rle={key:1,class:"kap-agg"},Dle={class:"mono"},Ble={class:"mono"},Fle={class:"num"},Wle={class:"num"},Hle={key:0},zle={class:"mono"},Ule={class:"num"},qle={class:"num"},jle={key:0},Vle=Ve({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=ee("all"),o=ee(""),i=ee(""),r=ee(!1),l=ee("timeline"),a=W(()=>(ry.value,[...$ne()])),c=W(()=>{const M=new Set;for(const E of a.value)E.sessionId&&M.add(E.sessionId);return[...M].sort()});function u(M){return M.kind==="rest:error"||M.code!==void 0&&M.code!==0||M.eventType==="error"||M.eventType==="parse-error"}const d=W(()=>{const M=o.value.trim().toLowerCase();return a.value.filter(E=>!(s.value!=="all"&&E.source!==s.value||i.value&&E.sessionId!==i.value||r.value&&!u(E)||M&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(M)))}),f=W(()=>{const M=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const P=E.kind==="ws:in"?"←":"→",A=`${P} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,$=M.get(A)??{key:A,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:P,count:0};$.count++,E.seq!==void 0&&($.lastSeq=E.seq),M.set(A,$)}return[...M.values()].sort((E,P)=>P.count-E.count)}),h=W(()=>{const M=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const P=`${E.method??"?"} ${E.path??"?"}`,A=M.get(P)??{count:0,errors:0,totalMs:0,timed:0};A.count++,u(E)&&A.errors++,E.durationMs!==void 0&&(A.totalMs+=E.durationMs,A.timed++),M.set(P,A)}return[...M.entries()].map(([E,P])=>({key:E,count:P.count,errors:P.errors,avgMs:P.timed>0?Math.round(P.totalMs/P.timed):0})).sort((E,P)=>P.count-E.count)}),p=ee(null),m=ee(!0),_=ee(null),b=ee(null);Ge(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await vt();const M=_.value;M&&(M.scrollTop=M.scrollHeight)});function g(M){p.value=p.value===M?null:M}function v(M){const E=new Date(M),P=(A,$=2)=>String(A).padStart($,"0");return`${P(E.getHours())}:${P(E.getMinutes())}:${P(E.getSeconds())}.${P(E.getMilliseconds(),3)}`}function y(M){return JSON.stringify(M,null,2)}async function C(M){await Ws(y(M))&&(b.value=M.id,setTimeout(()=>{b.value===M.id&&(b.value=null)},1500))}function L(){uE(d.value)}function I(M){return u(M)||M.source==="client"?"b-err":M.source==="rest"?"b-rest":M.kind==="ws:lifecycle"?"b-life":M.kind==="ws:out"?"b-out":"b-in"}function k(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,E)=>(w(),N("section",ble,[T("header",_le,[E[11]||(E[11]=T("strong",null,"KAP debug",-1)),T("span",wle,O(d.value.length)+"/"+O(a.value.length),1),T("div",Sle,[T("button",{type:"button",class:De({on:S(Zc)}),onClick:E[0]||(E[0]=P=>Zc.value=!S(Zc))},O(S(Zc)?"resume":"pause"),3),T("button",{type:"button",onClick:E[1]||(E[1]=P=>S(Nne)())},"clear"),T("button",{type:"button",onClick:E[2]||(E[2]=P=>L())},"export jsonl"),Z(ht,{text:"Close window"},{default:de(()=>[T("button",{type:"button",onClick:E[3]||(E[3]=P=>n("close"))},"✕")]),_:1})])]),T("div",Cle,[In(T("select",{"onUpdate:modelValue":E[4]||(E[4]=P=>s.value=P),"aria-label":"Source filter"},[...E[12]||(E[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),[[Av,s.value]]),In(T("select",{"onUpdate:modelValue":E[5]||(E[5]=P=>i.value=P),"aria-label":"Session filter"},[E[13]||(E[13]=T("option",{value:""},"all sessions",-1)),(w(!0),N(Pe,null,ot(c.value,P=>(w(),N("option",{key:P,value:P},O(P),9,xle))),128))],512),[[Av,i.value]]),In(T("input",{"onUpdate:modelValue":E[6]||(E[6]=P=>o.value=P),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[go,o.value]]),T("label",Ale,[In(T("input",{"onUpdate:modelValue":E[7]||(E[7]=P=>r.value=P),type:"checkbox"},null,512),[[tp,r.value]]),E[14]||(E[14]=je(" errors",-1))]),T("label",Tle,[In(T("input",{"onUpdate:modelValue":E[8]||(E[8]=P=>m.value=P),type:"checkbox"},null,512),[[tp,m.value]]),E[15]||(E[15]=je(" follow",-1))]),T("div",Mle,[T("button",{type:"button",class:De({on:l.value==="timeline"}),onClick:E[9]||(E[9]=P=>l.value="timeline")},"timeline",2),T("button",{type:"button",class:De({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=P=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),N("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(w(),N("div",Ele," No trace entries yet. REST calls and WS frames will appear here. ")):ie("",!0),(w(!0),N(Pe,null,ot(d.value,P=>(w(),N("div",{key:P.id,class:"kap-row-wrap"},[T("button",{type:"button",class:De(["kap-row",{expanded:p.value===P.id}]),onClick:A=>g(P.id)},[T("span",$le,O(v(P.ts)),1),T("span",{class:De(["kap-badge",I(P)])},O(k(P)),3),T("span",Nle,O(P.label),1)],10,Ile),p.value===P.id?(w(),N("div",Lle,[T("div",Ple,[T("button",{type:"button",onClick:A=>C(P)},O(b.value===P.id?"copied ✓":"copy json"),9,Ole)]),T("pre",null,O(y(P)),1)])):ie("",!0)]))),128))],512)):(w(),N("div",Rle,[E[20]||(E[20]=T("h4",null,"WS frames by session / type",-1)),T("table",null,[E[17]||(E[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(Pe,null,ot(f.value,P=>(w(),N("tr",{key:P.key},[T("td",null,O(P.dir),1),T("td",Dle,O(P.eventType),1),T("td",Ble,O(P.sessionId),1),T("td",Fle,O(P.count),1),T("td",Wle,O(P.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),N("tr",Hle,[...E[16]||(E[16]=[T("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ie("",!0)])]),E[21]||(E[21]=T("h4",null,"REST by endpoint",-1)),T("table",null,[E[19]||(E[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(Pe,null,ot(h.value,P=>(w(),N("tr",{key:P.key},[T("td",zle,O(P.key),1),T("td",Ule,O(P.count),1),T("td",{class:De(["num",{err:P.errors>0}])},O(P.errors),3),T("td",qle,O(P.avgMs),1)]))),128)),h.value.length===0?(w(),N("tr",jle,[...E[18]||(E[18]=[T("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ie("",!0)])])]))]))}}),Kle=ft(Vle,[["__scopeId","data-v-3cda6fe3"]]),Gle=Ve({__name:"DebugPanel",setup(e){const t=ee(!1);let n=null,s=null,o=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=np(Kle,{onClose:()=>u.close()});f.mount(d),s=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return _n(()=>{c()}),hs(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),ve(ht,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:de(()=>[T("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),Yle=ft(Gle,[["__scopeId","data-v-21346738"]]);function gE(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 S1(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 Xle(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 Ci(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:S1(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:gE(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 ku(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 AC(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 dy(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:AC(e.source)};case"video":return{type:"video",source:AC(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 C1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(dy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Qle(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 Zle(e){return{content:e.content.map(Qle),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 Jle(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function vE(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 eae(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function tae(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(eae),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function yE(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(tae),createdAt:e.created_at}}function nae(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 sae(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=nae(s);return{answers:t,method:e.method,note:e.note}}function x1(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 TC(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 Cr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function wa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Fo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function oae(e){if(!e||typeof e!="object")return null;const t=e,n=Cr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:Cr(t,"goalId")??Cr(t,"goal_id")??"goal",objective:Cr(t,"objective")??"",completionCriterion:Cr(t,"completionCriterion")??Cr(t,"completion_criterion"),status:n,turnsUsed:wa(t,"turnsUsed")??wa(t,"turns_used")??0,tokensUsed:wa(t,"tokensUsed")??wa(t,"tokens_used")??0,wallClockMs:wa(t,"wallClockMs")??wa(t,"wall_clock_ms")??0,terminalReason:Cr(t,"terminalReason")??Cr(t,"terminal_reason"),budget:{tokenBudget:Fo(o,"tokenBudget")??Fo(o,"token_budget"),remainingTokens:Fo(o,"remainingTokens")??Fo(o,"remaining_tokens"),turnBudget:Fo(o,"turnBudget")??Fo(o,"turn_budget"),remainingTurns:Fo(o,"remainingTurns")??Fo(o,"remaining_turns"),wallClockBudgetMs:Fo(o,"wallClockBudgetMs")??Fo(o,"wall_clock_budget_ms"),remainingWallClockMs:Fo(o,"remainingWallClockMs")??Fo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function iae(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ci(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ci(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:ku(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:ku(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:S1(t.payload.status),previousStatus:S1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:gE(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=oae(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:C1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(dy),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:vE(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:yE(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:x1(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:A1(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 rae(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function MC(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 A1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,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 lae(e){return e.session_id}function aae(e){return e.seq}const cae="main",uae=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 Nr(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 dae(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 EC(){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 io(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Tl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Wo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function fae(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=io(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=io(t,"goalId")??io(t,"goal_id")??"goal",r=io(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:io(t,"completionCriterion")??io(t,"completion_criterion"),status:o,turnsUsed:Tl(t,"turnsUsed")??Tl(t,"turns_used")??0,tokensUsed:Tl(t,"tokensUsed")??Tl(t,"tokens_used")??0,wallClockMs:Tl(t,"wallClockMs")??Tl(t,"wall_clock_ms")??0,terminalReason:io(t,"terminalReason")??io(t,"terminal_reason"),budget:{tokenBudget:Wo(s,"tokenBudget")??Wo(s,"token_budget"),remainingTokens:Wo(s,"remainingTokens")??Wo(s,"remaining_tokens"),turnBudget:Wo(s,"turnBudget")??Wo(s,"turn_budget"),remainingTurns:Wo(s,"remainingTurns")??Wo(s,"remaining_turns"),wallClockBudgetMs:Wo(s,"wallClockBudgetMs")??Wo(s,"wall_clock_budget_ms"),remainingWallClockMs:Wo(s,"remainingWallClockMs")??Wo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Ra(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function pae(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=io(t,"name")??io(t,"toolName")??"tool",s=td(hae(n)),o=mae(n,t.args??t.input);return o?`Calling ${s}: ${o}`:`Calling ${s}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=io(n,"text");if(o)return Zg(o);const i=io(n,"message");if(i)return Zg(i)}const s=io(t,"message");if(s)return Zg(s)}return null}function hae(e){return e.replace(/_\d+$/,"")}const IC=2e3;function Zg(e){return e.length>IC?`${e.slice(0,IC)}…`:e}function mae(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Pu(e,n)}function gae(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=io(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Ra(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=pae(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Ra(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 pf(e){return{...e,content:e.content.map(t=>({...t}))}}function $C(e,t,n){const s={id:Nr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function vae(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function yae(e){return Array.isArray(e)?e.map(t=>dy(t)):[]}function NC(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function kae(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function bae(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function LC(e,t){e.messages.find(n=>n.id===t)}function _ae(e,t,n,s,o,i){const r={id:Nr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Jg(e,t){return e.messages.find(n=>n.id===t)}function PC(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 wae(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=EC(),e.set(u,d)),d}function s(u){e.set(u,EC())}function o(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){s(u);const f=n(u),h=d.promptId??Nr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=$C(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const _=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:h},{type:"messageCreated",message:pf(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),m=d,_=[],b=m?.agentId;if(typeof b=="string"&&b!==cae){const g=t.has(b);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:b,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:b,reason:m?.reason}];if(uae.has(u))return gae(p,f,b,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)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=yae(m?.content);if(y.length===0)break;p.currentPromptId=g;const C=vae(p,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:pf(C)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??Nr("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,_.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=Nr("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=$C(p,f,v);p.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:pf(y)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const y=a(p.turnThinkLen,h?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const C=NC(p,g,"thinking",v);if(C<0)break;p.turnThinkLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:C,delta:{thinking:v}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const y=a(p.turnTextLen,h?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const C=NC(p,g,"text",v);if(C<0)break;p.turnTextLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:C,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,y=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!y)break;const C=m?.toolCallId,L=m?.name??m?.toolName??"",I=m?.args??m?.input??{};kae(p,g,C,L,I);const k=Jg(p,g);k&&k.content.length-1,p.toolStartTimes.set(C,Date.now()),k&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:k.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=bae(m??{});g&&v&&_.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=Nr("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=m?.toolCallId,C=m?.output,L=m?.isError??!1;p.toolStartTimes.get(y)??Date.now(),p.toolStartTimes.delete(y);const I=_ae(p,f,y,C,L,v);_.push({type:"messageCreated",message:pf(I)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=dae(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){LC(p,g);const y=Jg(p,g);y&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(C=>({...C})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(p.model=m.model),m?.contextTokens!==void 0&&(p.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(p.contextLimit=m.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:f,usage:PC(p),model:p.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,v=m?.reason??"completed",y=Tl(m??{},"durationMs");if(g){LC(p,g);const I=Jg(p,g);I&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:I.content.map(k=>({...k})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}p.turnCount++;const C=PC(p);_.push({type:"sessionUsageUpdated",sessionId:f,usage:C});const L=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";_.push({type:"sessionStatusChanged",sessionId:f,status:L,previousStatus:"running"}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{p.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Nr("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};p.subagentMeta.set(v.id,v),_.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Ra(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Ra(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Ra(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Ra(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.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):Nr("task_"),C=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:zn.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:C,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};_.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=fae(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const Sae=new Set(["server_hello","ack","ping","resync_required","error","pong"]),OC=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"]),Cae=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"]),xae=new Set(["assistant.delta","thinking.delta"]);function Aae(e,t){if(Sae.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return xae.has(s)?Tae(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Cae.has(s)?{route:"protocol"}:OC.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:OC.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Tae(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 T1 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 Jc 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 Zr(e){return e instanceof T1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function kE(e){return e instanceof Jc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const fy="kimi-web.server-credential",Mae="token";let ju;const M1=new Set;function Eae(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Mae);if(!n)return;const s=new URL(window.location.href);return s.hash="",window.history.replaceState(window.history.state,"",`${s.pathname}${s.search}`),n}function Iae(){try{return globalThis.sessionStorage?.getItem(fy)??void 0}catch{return}}function $ae(){const e=Eae();return e?(_E(e),!0):(ju=Iae(),ju!==void 0)}function bE(){return ju}function _E(e){ju=e;try{globalThis.sessionStorage?.setItem(fy,e)}catch{}}function Nae(){ju=void 0;try{globalThis.sessionStorage?.removeItem(fy)}catch{}}function Lae(e){return M1.add(e),()=>{M1.delete(e)}}function Pae(){Nae();for(const e of M1)try{e()}catch{}}const eu=3e4,wE="0123456789ABCDEFGHJKMNPQRSTVWXYZ",RC=500,Oae=40101;function DC(){try{return AbortSignal.timeout(eu)}catch{return}}function Rae(e,t){let n="",s=e;for(let o=0;o<t;o++)n=wE[s%32]+n,s=Math.floor(s/32);return n}function Dae(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=>wE[n%32]).join("")}function BC(){return`${Rae(Date.now(),10)}${Dae(16)}`}function Bae(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function FC(e){try{const t=await e.text();return t?t.length>RC?`${t.slice(0,RC)}...`:t:void 0}catch{return}}class Fae{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=rp(this.origin,t),o=BC(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();wC({method:"POST",path:t,url:s,requestId:o,body:Bae(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:DC()})}catch(u){throw ff({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new Jc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:eu,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw ff({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Jc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:eu,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await FC(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(SC({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new T1({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,s,o,i=[]){let r=rp(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,_]of Object.entries(o))_!==void 0&&h.set(m,String(_));const p=h.toString();p&&(r=`${r}?${p}`)}const l=BC(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();wC({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:DC()})}catch(h){throw ff({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new Jc({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:eu,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw ff({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new Jc({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:eu,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await FC(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(SC({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 T1({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=bE();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===Oae)&&Pae()}}const Wae="kimi-code.bearer.";class Hae{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;_a("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=bE(),n=t!==void 0?[`${Wae}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{_a("open")},s.onmessage=o=>{try{const i=JSON.parse(String(o.data));Pne(i),this.handleFrame(i)}catch(i){_a("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{_a("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{_a("close",o?{code:o.code,reason:o.reason,wasClean:o.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,_a("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=hf(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(hf(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(hf(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=hf(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=Aae(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Lne(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function hf(e,t){return`${e}\0${t}`}function ev(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 WC(e){return e==="auto_compact"||e==="manual_compact"}class zae{http;config;constructor(t){this.config=t,this.http=new Fae(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[]}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?Xle(t.status):void 0,include_archive:t?.includeArchive,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Ci),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return Ci(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ci(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return Ci(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 s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(C1),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:Ci(n.session),messages:n.messages.items.map(C1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(vE),pendingQuestions:n.pending_questions.map(yE)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Zle(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return Ci(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return Ci(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ci)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Jle(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,sae(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(x1)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return x1(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(ev)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return ev(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return ev(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(TC)])):void 0;return{items:o.items.map(TC),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return rp(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(ku)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return ku(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const s=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return ku(s)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(rae)}async listProviders(){return(await this.http.get("/providers")).items.map(MC)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return MC(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return tv(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return tv(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return tv(t)}async getConfig(){const t=await this.http.get("/config");return A1(t)}async setConfig(t){const n={},s={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=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return A1(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return rp(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=hL(this.config.serverHttpUrl,this.config.clientId),s=wae(),o=new Hae(n,this.config.clientId,{onWireEvent:i=>{const r=lae(i),l=aae(i),a=iae(i);a.type==="historyCompacted"&&!WC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!WC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}function tv(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 HC;function gt(){return HC??=new zae(cL()),HC}function Uae(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function qae(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function jae(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,activeRoot:o,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(s),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 p=h.cwd;p&&(l.has(p)||a.has(p)||a.set(p,{id:h.workspaceId??p,root:p,name:Uae(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=qae(t,h);c.set(p,(c.get(p)??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,p)=>h.localeCompare(p));const f=[];for(const h of[...u,...d]){const p=a.get(h),m=c.get(p.id)??c.get(p.root)??0,_=r[p.id]===!1?m:Math.max(p.sessionCount,m);let b=p.branch;!b&&i&&o===p.root&&(b=i),f.push({...p,sessionCount:_,branch:b})}return f}function Vae(e){const t=new Map,n=new Set;function s(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&s(i)});return t.set(i,l),l}function o(i){if(t.has(i)){n.add(i);return}s(i)}return{run:s,request:o}}const Kae=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Gae(e){return Kae.has(e.type)}function Yae(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Xae(e,t,n=Yae){let s=[],o=null;const i=()=>{if(o=null,s.length===0)return;const l=s;s=[];for(const a of l)e(a)},r=(l=>{if(t(l)){s.push(l),o===null&&(o=n(i));return}i(),e(l)});return r.flush=i,r}function SE(e,t){const n=Xn(e);return n===null?t:n==="1"}const py=ee(SE($t.notifyOnComplete,!0)),hy=ee(SE($t.notifyOnQuestion,!1)),my=ee(typeof Notification<"u"?Notification.permission:"denied");async function CE(e,t,n){if(!n){e.value=!1,es(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}my.value=s,s==="granted"&&(e.value=!0,es(t,"1"))}function Qae(e){return CE(py,$t.notifyOnComplete,e)}function Zae(e){return CE(hy,$t.notifyOnQuestion,e)}function xE(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{my.value=i,i==="granted"&&zC(t,n,s)});return}zC(t,n,s)}}function zC(e,t,n){if(e.isActiveAndVisible)return;const s=e.sessionTitle.trim()||"Kimi Code";try{const o=new Notification(s,{body:t,tag:n});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Jae(e,t){xE(py.value,t,zn.global.t("settings.notifyBody"),`kimi-complete-${e}`)}function ece(e,t){const n=t.questionPreview||zn.global.t("settings.notifyQuestionBody");xE(hy.value,t,n,`kimi-question-${e}`)}function tce(){return{notifyOnComplete:py,notifyOnQuestion:hy,notifyPermission:my,setNotifyOnComplete:Qae,setNotifyOnQuestion:Zae,maybeNotifyCompletion:Jae,maybeNotifyQuestion:ece}}function nce(){return Xn($t.soundOnComplete)==="1"}const ad=ee(nce());function sce(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let nv=null;function AE(){const e=sce();if(!e)return null;if(nv===null)try{nv=new e}catch{return null}return nv}function TE(){if(!ad.value)return;const e=AE();e!==null&&e.state==="suspended"&&e.resume().then(()=>{$r("sound: audio context resumed",{state:e.state})},t=>{$r("sound: audio context resume rejected",{error:String(t)})})}let UC=!1;function oce(){if(UC||typeof window>"u")return;UC=!0;const e=()=>{TE()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}oce();function ice(e){ad.value=e,es($t.soundOnComplete,e?"1":"0"),e&&TE()}function qC(e,t,n,s,o){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(o,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+s),i.start(l),i.stop(l+s+.02)}function ME(){const e=AE();if(e===null){$r("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){$r("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{$r("sound: context resumed for next time",{state:e.state})},t=>{$r("sound: resume rejected",{error:String(t)})});return}try{qC(e,880,0,.16,.18),qC(e,1320,.1,.22,.16),$r("sound: chime scheduled",{state:e.state})}catch(t){$r("sound: failed to play",{error:String(t)})}}function rce(){ad.value&&ME()}function lce(){ad.value&&ME()}function ace(){return{soundOnComplete:ad,setSoundOnComplete:ice,maybePlayCompletionSound:rce,maybePlayQuestionSound:lce}}function jC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const cce=1e3,uce=4096,VC=32*1024;function dce(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await gt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:jC(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],m=gt(),_=new Map;if(await Promise.all(p.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!o.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:VC});y.outputPreview!==void 0&&_.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),_.size===0)return;const b=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:b.map(g=>{const v=_.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=gt();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const y=v.status==="running",C=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!C)&&!(C&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await h.getTask(f,v.id,{withOutput:!0,outputBytes:y?uce:VC});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{C&&o.add(v.id)}}));const _=e.tasksBySession[f]??[],b=new Map(_.map(v=>[v.id,v])),g=p.map(v=>{const y=b.get(v.id),C=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:C?.preview??y?.outputPreview,outputBytes:C?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:jC(g,_)}}function a(f){n!==null&&s===f||(c(),s=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},cce))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=ee(0);let d=null;return Ge(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ge(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,m)=>{let _;h&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:W(()=>u.value),loadTasksForSession:i}}const EE=$t.starredModels;function fce(){try{const e=Xn(EE);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function pce(e){try{es(EE,JSON.stringify(e))}catch{}}function hce(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=ee([]),d=ee(fce()),f=ee({}),h=ee([]),p=ee(null);function m(z){if(!(z==null||z.length===0))return u.value.find(q=>q.id===z||q.model===z)}function _(){const z=e.activeSessionId?e.sessions.find(q=>q.id===e.activeSessionId):void 0;return m(z?.model??p.value??e.defaultModel)}function b(z){const q=hC(_(),z);return e.thinking=q,l(q),q}async function g(z){try{const Q=await gt().listSkills(z);f.value={...f.value,[z]:Q}}catch{}}async function v(){try{const z=gt();u.value=await z.listModels(),b(e.thinking)}catch(z){n("loadModels",z)}}async function y(){try{const z=await gt().refreshOAuthProviderModels();for(const q of z.failed)n("refreshOAuthProviderModels",new Error(q.reason),{message:q.provider})}catch{}}async function C(){try{const z=gt();h.value=await z.listProviders()}catch(z){n("loadProviders",z)}}async function L(z){const q=e.activeSessionId,Q=hC(m(z),e.thinking),X=e.thinking;if(!q){p.value=z,b(Q);return}const ue=e.sessions.find(ge=>ge.id===q)?.model;a(q,ge=>({...ge,model:z})),Q!==X&&(e.thinking=Q,l(Q));try{await gt().updateSession(q,{model:z,thinking:Q!==X?Q:void 0})}catch(ge){a(q,xe=>({...xe,model:ue??xe.model})),Q!==X&&(e.thinking=X,l(X)),n("setModel",ge,{sessionId:q});return}await s(q)}function I(z){const q=new Set(d.value);q.has(z)?q.delete(z):q.add(z),d.value=Array.from(q),pce(d.value)}async function k(z,q){const Q=e.activeSessionId;if(!Q)return;const X=i.value==="idle"&&!r.has(Q),ue=`msg_skill_opt_${Date.now().toString(36)}`;if(X){r.add(Q),e.sendingBySession={...e.sendingBySession,[Q]:!0};const ge={id:ue,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,xe=>[...xe,ge])}try{await gt().activateSkill(Q,z,q)}catch(ge){X&&(r.delete(Q),e.sendingBySession={...e.sendingBySession,[Q]:!1},c(Q,xe=>xe.filter(ke=>ke.id!==ue))),n("activateSkill",ge,{sessionId:Q})}}async function M(z){try{await gt().addProvider(z),await Promise.all([C(),v()])}catch(q){n("addProvider",q)}}async function E(z){try{await gt().deleteProvider(z),await Promise.all([C(),v()])}catch(q){n("deleteProvider",q)}}async function P(z){try{const q=await gt().refreshProvider(z);for(const Q of q.failed)n("refreshProvider",new Error(Q.reason),{message:Q.provider});await Promise.all([C(),v()])}catch(q){n("refreshProvider",q)}}async function A(){try{const z=await gt().refreshAllProviders();for(const q of z.failed)n("refreshAllProviders",new Error(q.reason),{message:q.provider});await Promise.all([C(),v()])}catch(z){n("refreshAllProviders",z)}}async function $(){try{return await gt().startOAuthLogin()}catch{return null}}async function D(){try{return await gt().pollOAuthLogin()}catch{return null}}async function R(){try{await gt().cancelOAuthLogin()}catch{}}function H(z){const q=b(z);o({thinking:q})}return{models:u,starredModelIds:d,providers:h,draftModel:p,skillsBySession:f,loadSkillsForSession:g,loadModels:v,refreshOAuthProviderModels:y,loadProviders:C,setModel:L,toggleStarModel:I,activateSkill:k,addProvider:M,deleteProvider:E,refreshProvider:P,refreshAllProviders:A,startOAuthLogin:$,pollOAuthLogin:D,cancelOAuthLogin:R,setThinking:H}}const IE="kimiWeb.compaction",mce=["queued","working","suspended","completed","failed"];function $E(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function gce(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function vce(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:$E(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=gce();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function yce(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of mce)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const kce=/^read[_-]?media(?:file)?$/i,bce=/^data:([^;]+);base64,(.*)$/s,_ce=/^<(image|video|audio)\s+path="([^"]+)">$/,wce=/Mime type:\s*([^.\s]+)/i,Sce=/Size:\s*(\d+)\s*bytes/i,Cce=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function xce(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 Ace(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 Tce(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function Mce(e,t){if(!kce.test(e))return;const n=Ace(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=_ce.exec(h);p&&(o=p[1],s=p[2]);const m=wce.exec(h);m?.[1]&&(i=m[1]);const _=Sce.exec(h);_?.[1]&&(r=Number(_[1]));const b=Cce.exec(h);b?.[1]&&b[2]&&(l=`${b[1]}x${b[2]}`);continue}const f=Tce(d);f&&(a=f)}if(a===null)return;const c=bce.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=xce(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Ece(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 s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
264
|
-
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
265
|
-
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Ice(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 $ce(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function Nce(e,t){const n=e.split(`
|
|
266
|
-
`),s=t.split(`
|
|
267
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Lce(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Nce(t.old_text,t.new_text)}:{kind:"diff",path:s,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 s=typeof t.plan=="string"?t.plan:"",o=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:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Pce(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 Oce(e){return e.metadata?.origin?.kind==="compaction_summary"}function Rce(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Dce(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 NE(e,t,n,s=!0,o=[],i={}){const r=[];let l=1;const a=new Map;for(const p of t)a.set(p.toolCallId,p);const c=new Map;for(const p of o){if(p.kind!=="subagent")continue;const m=[p.parentToolCallId,p.id].filter(_=>typeof _=="string"&&_.length>0);for(const _ of m){const b=c.get(_)??[];b.push(p),c.set(_,b)}}for(const[p,m]of c.entries())c.set(p,m.toSorted($ce));let u=null;function d(p=!1){if(!u)return;const m=u;if(u=null,!p||!s)for(let _=0;_<m.tools.length;_++){const b=m.tools[_];if(b.status!=="running")continue;const g={...b,status:"ok"};m.tools[_]=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 f(p,m){for(const _ of m)if(_.type==="text"){if(_.text){p.textParts.push(_.text);const b=p.blocks.at(-1);b&&b.kind==="text"?b.text+=`
|
|
270
|
-
`+_.text:p.blocks.push({kind:"text",text:_.text})}}else if(_.type==="thinking"){if(_.thinking){p.thinkingParts.push(_.thinking);const b=p.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
|
|
271
|
-
`+_.thinking:p.blocks.push({kind:"thinking",thinking:_.thinking})}}else if(_.type==="toolUse"){const b=c.get(_.toolCallId);if(b&&b.length>0){const y=b.filter(C=>C.swarmIndex!==void 0);if(y.length>1&&y.some(L=>{const I=$E(L);return I!=="completed"&&I!=="failed"}))continue}const g=a.get(_.toolCallId),v={id:_.toolCallId,name:_.toolName,arg:typeof _.input=="string"?_.input:JSON.stringify(_.input),status:"running",output:_.outputLines,planPath:_.toolName==="ExitPlanMode"?i[_.toolCallId]?.path:void 0};p.tools.push(v),p.blocks.push({kind:"tool",tool:v}),g&&(p.approval=Lce(g),p.approvalId=g.approvalId)}else if(_.type==="toolResult"){const b=p.tools.findIndex(g=>g.id===_.toolCallId);if(b!==-1){const g=p.tools[b],v={...g,status:_.isError?"error":"ok",output:Ece(_.output),media:_.isError?void 0:Mce(g.name,_.output)};v.name==="ExitPlanMode"&&!v.planPath&&(v.planPath=Dce(v.output)),p.tools[b]=v;const y=p.blocks.find(C=>C.kind==="tool"&&C.tool.id===_.toolCallId);y&&y.kind==="tool"&&(y.tool=v)}}}function h(p){if(p.type==="image"||p.type==="video"){const m=p.type,_=p.source;if(_.kind==="url")return{url:_.url,kind:m};if(_.kind==="base64")return{url:`data:${_.mediaType};base64,${_.data}`,kind:m};if(_.kind==="file"&&n)return{url:n(_.fileId),kind:m}}if(p.type==="file"&&n){if(p.mediaType.startsWith("image/"))return{url:n(p.fileId),kind:"image"};if(p.mediaType.startsWith("video/"))return{url:n(p.fileId),kind:"video"}}}for(const p of e){if(p.role==="system")continue;if(Oce(p)){d();const v=p.metadata?.[IE];r.push({id:p.id,role:"compaction",no:l,text:p.content.filter(y=>y.type==="text").map(y=>y.text).join(`
|
|
272
|
-
`),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(p.role==="user"){if(d(),!Pce(p))continue;const v=p.metadata?.origin,y=v?.kind==="skill_activation"&&v?.trigger==="user-slash",C=v?.kind==="plugin_command"&&v?.trigger==="user-slash",L=[],I=[];for(const k of p.content){k.type==="text"&&(y?L.push(v.skillArgs??""):C?L.push(v.commandArgs??""):L.push(k.text));const M=h(k);M&&I.push({url:M.url,kind:M.kind,alt:k.type==="file"?k.name:void 0})}r.push({id:p.id,role:"user",no:l++,text:L.join(`
|
|
273
|
-
`),images:I.length>0?I:void 0,skillActivation:y?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:C?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:p.createdAt});continue}if(p.role==="tool"){u&&f(u,p.content);continue}const m=p.promptId;Rce(u,m)?u!==null&&u.promptId===void 0&&m!==void 0&&(u.promptId=m):(d(),u={id:p.id,promptId:m,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:p.durationMs});const b=u;if(b===null)continue;const g=JSON.stringify(p.content);b.promptId!==void 0&&b.seenSigs.has(g)||(b.seenSigs.add(g),f(b,p.content))}return d(!0),r}function Bce(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=ee({}),l=W(()=>{const I=e.activeSessionId;if(!I)return null;const k=r.value[I];return k?{parentId:I,agentId:k.agentId}:null}),a=W(()=>l.value?.parentId??null),c=W(()=>l.value!==null),u=W(()=>{const I=l.value;return I?!!e.sideChatSendingByAgent[I.agentId]:!1}),d=W(()=>{const I=l.value;return I?e.sideChatSendingByAgent[I.agentId]?!0:(e.tasksBySession[I.parentId]??[]).some(k=>k.id===I.agentId&&k.status==="running"):!1}),f=W(()=>{const I=l.value;if(!I)return[];const k=e.sideChatMessagesByAgent[I.agentId]??[];return NE(k,[],M=>gt().getFileUrl(M),d.value,[])});function h(I,k){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[I]:k(e.sideChatMessagesByAgent[I]??[])}}function p(I,k){h(I,M=>[...M,k])}function m(I){h(I,k=>{const M=[...k].reverse().findIndex(P=>P.role==="user");if(M===-1)return k;const E=k.length-1-M;return k.filter((P,A)=>A!==E)})}function _(I,k){h(I,M=>{const E=[...M];for(let P=E.length-1;P>=0;P-=1){const A=E[P];if(A.role==="user")return E[P]={...A,promptId:A.promptId??k},E}return M})}function b(I,k,M){M&&h(I,E=>{const P=E.at(-1);if(P?.role==="assistant"){const A=P.content[0],$=A?.type==="text"?A.text:"";return[...E.slice(0,-1),{...P,content:[{type:"text",text:`${$}${M}`}]}]}return[...E,{id:s(),sessionId:k,role:"assistant",content:[{type:"text",text:M}],createdAt:new Date().toISOString()}]})}function g(I,k,M){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[I]:!1},!M)return;const P=(e.sideChatMessagesByAgent[I]??[]).at(-1);(P?.role==="assistant"&&P.content[0]?.type==="text"?P.content[0].text:"").trim().length>0||b(I,k,M)}async function v(I){const k=e.activeSessionId;if(k){if(!r.value[k]){let M;try{({agentId:M}=await gt().startBtw(k))}catch(E){n("openSideChat",E,{sessionId:k});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:e.sideChatMessagesByAgent[M]??[]},r.value={...r.value,[k]:{agentId:M}},o(),i()?.markSideChannelAgent(M)}I&&I.trim()&&await C(I.trim())}}function y(){const I=e.activeSessionId;if(!I)return;const{[I]:k,...M}=r.value;r.value=M}async function C(I){const k=l.value,M=I.trim();if(!k||!M)return;const E=k.parentId,P=k.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!0};const A={id:s(),sessionId:E,role:"user",content:[{type:"text",text:M}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(P,A);try{const $=await gt().submitPrompt(E,{content:[{type:"text",text:M}],agentId:P});_(P,$.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[E]:[...e.sideChatUserMessageIdsBySession[E]??[],$.userMessageId]}}catch($){n("sendSideChatPrompt",$,{sessionId:E}),m(P),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!1}}}function L(I){if(!r.value[I])return;const{[I]:k,...M}=r.value;r.value=M}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:b,finishSideChatAgent:g,openSideChat:v,closeSideChat:y,sendSideChatPrompt:C,clearSideChatForSession:L}}function Fce(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 Wce(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
274
|
-
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Fce(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const E1="/sessions/";function KC(e){const{pathname:t}=e;if(!t.startsWith(E1))return;const n=t.slice(E1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function Hce(e){return e===void 0||e.length===0?"/":`${E1}${encodeURIComponent(e)}`}const zce=50,Uce=40402,qce=40410,jce=40902;function sv(e){return Zr(e)&&e.code===jce}const Vce=40904;function Kce(e){return Zr(e)&&e.code===Vce}const Al=Es({}),mf=Es({}),ov=Es({});function Gce(e,t){const{t:n}=zn.global,{confirm:s}=nl(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:h,appendSession:p,forgetSession:m,setActiveSessionId:_,updateSessionMessages:b,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,subscribeToSessionEvents:C,hasLoadedMessages:L,refreshSessionStatus:I,persistSessionProfile:k,mergedWorkspaces:M,workspacesView:E,status:P,workspaceIdForSession:A,savePermissionToStorage:$,savePlanModeToStorage:D,saveSwarmModeToStorage:R,saveGoalModeToStorage:H,draftModes:z,saveUnread:q,saveActiveWorkspaceToStorage:Q,saveHiddenWorkspacesToStorage:X,goalErrorMessage:ue,resetFastMoon:ge,initialized:xe,selectedDiffPath:ke,fileDiffLines:ze,fileDiffLoading:qe}=t;async function Ue(oe){if(e.messagesLoadingMoreBySession[oe])return;const Se=e.messagesBySession[oe];if(!Se||Se.length===0)return;const Te=Se[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[oe]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[oe]:!1};try{const Fe=await gt().listMessages(oe,{beforeId:Te,pageSize:zce}),nt=[...Fe.items].reverse();b(oe,lt=>[...nt,...lt]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[oe]:Fe.hasMore}}catch(Fe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[oe]:!0},l("loadOlderMessages",Fe,{sessionId:oe})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[oe]:!1}}}function Le(oe){o.loadTasksForSession(oe),ne(oe),I(oe),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,oe)||r.loadSkillsForSession(oe)}async function le(oe){const Se=e.activeSessionId;if(Se){ke.value=oe,ze.value=[],qe.value=!0;try{const Fe=await gt().getFileDiff(Se,oe);if(ke.value!==oe)return;ze.value=Wce(Fe.diff)}catch(Te){ke.value===oe&&(ze.value=[]),console.warn("[loadFileDiff] diff unavailable for",oe,Te)}finally{ke.value===oe&&(qe.value=!1)}}}function F(){ke.value=null,ze.value=[],qe.value=!1}async function ne(oe){try{const Te=await gt().getGitStatus(oe);e.gitStatusBySession={...e.gitStatusBySession,[oe]:Te}}catch{}}async function te(){try{const Se=await gt().getAuth();e.authReady=Se.ready,e.defaultModel=Se.defaultModel,e.managedProviderStatus=Se.managedProvider?.status??null}catch{}}async function U(){try{const oe=gt();e.config=await oe.getConfig()}catch{}}async function Y(oe){try{const Te=await gt().setConfig(oe);return e.config=Te,e.defaultModel=Te.defaultModel??null,!0}catch(Se){return l("setConfig",Se),!1}}const fe=100,se=5,ce=30,j=720*60*1e3;async function G(){const oe=gt(),Se=[];let Te;for(;;){const Fe=await oe.listSessions({pageSize:fe,beforeId:Te,excludeEmpty:!0});if(Se.push(...Fe.items),!Fe.hasMore||Fe.items.length===0)break;Te=Fe.items[Fe.items.length-1].id}return Se}async function re(oe){const Se=gt(),Te=[],Fe=Date.now(),nt=Yt=>Fe-new Date(Yt.updatedAt).getTime();let lt,Bt=!1,On=!0;for(;;){let Yt;try{Yt=await Se.listSessions({workspaceId:oe,pageSize:se,beforeId:lt,excludeEmpty:!0})}catch(tn){if(On)throw tn;break}if(Bt=Yt.hasMore,Yt.items.length===0)break;const Po=Yt.items[Yt.items.length-1],Oo=nt(Po)>=j;if(!On&&Oo){const tn=Yt.items.findIndex(Vn=>nt(Vn)>=j),Zn=tn>=0?tn+1:Yt.items.length;Te.push(...Yt.items.slice(0,Zn)),Bt=Yt.hasMore||Zn<Yt.items.length;break}if(Te.push(...Yt.items),On=!1,!Yt.hasMore||Oo)break;lt=Po.id}return{workspaceId:oe,page:{items:Te,hasMore:Bt}}}async function me(){const oe=e.workspaces;if(oe.length===0){const lt=await G().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsFullyLoaded=!0,lt}const Se=await Promise.all(oe.map(lt=>re(lt.id).catch(()=>({workspaceId:lt.id,page:{items:[],hasMore:!1}})))),Te=[],Fe={},nt={};for(const{workspaceId:lt,page:Bt}of Se)Te.push(...Bt.items),Fe[lt]=Bt.hasMore,nt[lt]=Bt.items.length>0?Bt.items[Bt.items.length-1].id:void 0;return e.sessionsHasMoreByWorkspace=Fe,e.sessionsCursorByWorkspace=nt,e.sessionsFullyLoaded=!1,Te.sort((lt,Bt)=>new Date(Bt.updatedAt).getTime()-new Date(lt.updatedAt).getTime()),Te}async function Ae(oe){if(e.sessionsLoadingMoreByWorkspace[oe]||e.sessionsHasMoreByWorkspace[oe]===!1)return;const Se=e.sessionsCursorByWorkspace[oe];if(Se!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[oe]:!0};try{const Te=await gt().listSessions({workspaceId:oe,pageSize:ce,beforeId:Se,excludeEmpty:!0}),Fe=new Set(e.sessions.map(lt=>lt.id)),nt=Te.items.filter(lt=>!Fe.has(lt.id));nt.length>0&&d([...e.sessions,...nt]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[oe]:Te.items.length>0?Te.items[Te.items.length-1].id:Se},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[oe]:Te.hasMore}}catch(Te){l("loadMoreSessions",Te)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[oe]:!1}}}}async function Ee(){if(e.sessionsFullyLoaded)return;const oe=await G().catch(()=>null);if(oe===null)return;d(oe),e.sessionsFullyLoaded=!0;const Se={};for(const Te of e.workspaces)Se[Te.id]=!1;e.sessionsHasMoreByWorkspace=Se}async function ae(){e.loading=!0;try{const oe=gt();await Promise.all([oe.getHealth().catch(()=>null),oe.getMeta().then(Bt=>{e.serverVersion=Bt.serverVersion,e.availableOpenInApps=Bt.openInApps}).catch(()=>null),r.loadModels()]),await te(),await U(),await Ce();const Se=await me();d(Se);const Te=Se[0],Fe=e.activeWorkspaceId;!(Fe!==null&&M.value.some(Bt=>Bt.id===Fe))&&Te&&tt(A(Te)),et();const lt=typeof window<"u"?KC(window.location):void 0;!e.activeSessionId&<!==void 0&&(e.sessions.some(On=>On.id===lt)||await Qn(lt))&&await Ke(lt,{urlMode:"replace"}),!e.activeSessionId&&Se.length>0&&await Ke(Se[0].id,{urlMode:"replace"})}catch(oe){l("load",oe)}finally{e.loading=!1,xe.value=!0}}async function Ce(){try{const oe=gt(),[Se,Te]=await Promise.all([oe.listWorkspaces().catch(()=>[]),oe.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Xe(Se),e.fsHome=Te.home||null,e.recentRoots=Te.recentRoots}catch{}}function Xe(oe){const Se=Gd();return Object.keys(Se).length===0?oe:oe.map(Te=>{const Fe=Se[Te.root];return Fe!==void 0?{...Te,name:Fe}:Te})}function tt(oe){e.activeWorkspaceId=oe,Q(oe)}function xt(oe){tt(oe);const Se=e.sessions.filter(Te=>A(Te)===oe);if(Se.length>0){const Te=Se[0];Te&&Te.id!==e.activeSessionId&&Ke(Te.id)}else _(void 0),Kt(void 0,"push")}function wt(oe){const Se=Gd()[oe.root],Te=Se!==void 0?{...oe,name:Se}:oe;e.hiddenWorkspaceRoots.includes(Te.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(lt=>lt!==Te.root),X(e.hiddenWorkspaceRoots));const Fe=e.workspaces.findIndex(lt=>lt.id===Te.id||lt.root===Te.root);if(Fe===-1){e.workspaces=[Te,...e.workspaces];return}const nt=[...e.workspaces];nt[Fe]=Te,e.workspaces=nt}function It(oe){if(oe.type==="workspaceCreated"||oe.type==="workspaceUpdated"){wt(oe.workspace);return}const Se=e.workspaces.find(Fe=>Fe.id===oe.workspaceId)?.root??oe.root;if(Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],X(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Fe=>Fe.id!==oe.workspaceId&&Fe.root!==Se),e.activeWorkspaceId===oe.workspaceId||e.activeWorkspaceId===Se){const Fe=E.value[0]?.id??null;if(e.activeWorkspaceId=Fe,Fe)Q(Fe);else try{oc($t.activeWorkspace)}catch{}_(void 0),e.sessionLoading=!1,F(),Kt(void 0,"replace")}}function Wt(){_(void 0),Kt(void 0,"push")}function _t(oe){tt(oe),Wt(),F()}async function Ht(oe,Se,Te){const Fe=M.value.find(nt=>nt.id===oe);if(Fe)try{const nt=gt();let lt,Bt=Fe.root;try{const tn=await nt.addWorkspace({root:Fe.root});lt=tn.id,Bt=tn.root,wt(tn)}catch{}const On=r.draftModel.value??void 0,Yt=await nt.createSession({workspaceId:lt,cwd:Bt,model:On});r.draftModel.value=null;const Po=On!==void 0&&(!Yt.model||Yt.model.length===0)?{...Yt,model:On}:Yt;h(Po),tt(Yt.workspaceId??lt??oe),await Ke(Yt.id);const Oo=Yt.id;z.planMode&&(e.planModeBySession={...e.planModeBySession,[Oo]:!0},D()),z.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Oo]:!0},R()),z.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Oo]:!0},H()),z.planMode=!1,z.swarmMode=!1,z.goalMode=!1,await Mt(Yt.id,Se,Te)}catch(nt){l("startSessionAndSendPrompt",nt)}}async function $n(oe){const Se=oe.trim();if(!Se)return!1;const Te=gt();try{const Fe=await Te.addWorkspace({root:Se});return wt(Fe),_t(Fe.id),!0}catch{return!1}}async function Sn(oe){try{return await gt().browseFs(oe)}catch{return{path:"",parent:null,entries:[]}}}async function Vt(){try{return await gt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Kt(oe,Se){if(Se==="none"||typeof window>"u"||!window.history)return;const Te=Hce(oe);if(window.location.pathname!==Te)try{Se==="push"?window.history.pushState(null,"",Te):window.history.replaceState(null,"",Te)}catch{}}async function Qn(oe){try{const Se=await gt().getSession(oe);return e.sessions.some(Te=>Te.id===Se.id)||p(Se),!0}catch{return!1}}function st(){const oe=KC(window.location);if(oe===void 0){_(void 0);return}if(oe!==e.activeSessionId){if(e.sessions.some(Se=>Se.id===oe)){Ke(oe,{urlMode:"none"});return}(async()=>{if(await Qn(oe)){await Ke(oe,{urlMode:"none"});return}const Se=e.sessions[0];Se?await Ke(Se.id,{urlMode:"replace"}):(_(void 0),Kt(void 0,"replace"))})()}}let Nn=!1;function et(){Nn||typeof window>"u"||(Nn=!0,window.addEventListener("popstate",st))}async function Ke(oe,Se){const Te=L(oe),Fe=!Te&&u.has(oe);u.delete(oe);try{Kt(oe,Se?.urlMode??"push"),e.sessionLoading=!Te&&!Fe,_(oe),ge(),e.unreadBySession[oe]&&(e.unreadBySession={...e.unreadBySession,[oe]:!1},q({[oe]:!1})),F();const nt=e.sessions.find(lt=>lt.id===oe);if(nt){const lt=A(nt);e.activeWorkspaceId!==lt&&tt(lt)}if(Te)C(oe);else if(await y(oe)==="not-found")return;Le(oe)}catch(nt){l("selectSession",nt,{sessionId:oe})}finally{e.activeSessionId===oe&&(e.sessionLoading=!1)}}async function Mt(oe,Se,Te){c.add(oe),e.sendingBySession={...e.sendingBySession,[oe]:!0};const Fe=g();try{const nt=gt(),lt=[];Se&<.push({type:"text",text:Se});for(const Vn of Te??[])Vn.kind==="video"?lt.push({type:"video",source:{kind:"file",fileId:Vn.fileId}}):lt.push({type:"image",source:{kind:"file",fileId:Vn.fileId}});if(lt.length===0)return c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},!1;const Bt={id:Fe,sessionId:oe,role:"user",content:lt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(oe,Vn=>[...Vn,Bt]);const On=e.sessions.find(Vn=>Vn.id===oe),Yt=(On?.model&&On.model.length>0?On.model:e.defaultModel)??void 0,Po=e.planModeBySession[oe]??!1,Oo=e.swarmModeBySession[oe]??!1,tn=e.goalModeBySession[oe]??!1;if(tn&&Se)try{await nt.updateSession(oe,{goalObjective:Se.trim()})}catch(Vn){return l("createGoal",Vn,{sessionId:oe}),c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},b(oe,_s=>_s.some(Ls=>Ls.id===Fe)?_s.filter(Ls=>Ls.id!==Fe):_s),!1}const Zn=await nt.submitPrompt(oe,{content:lt,model:Yt,thinking:e.thinking,permissionMode:e.permission,planMode:Po,swarmMode:Oo});return tn&&(e.goalModeBySession={...e.goalModeBySession,[oe]:!1},H()),e.promptIdBySession={...e.promptIdBySession,[oe]:Zn.promptId},b(oe,Vn=>{const _s=Vn.findIndex(cs=>cs.id===Fe);if(_s===-1)return Vn;const Ls=[...Vn];return Ls[_s]={...Ls[_s],promptId:Ls[_s].promptId??Zn.promptId},Ls}),v()?.bindNextPromptId(oe,Zn.promptId),!0}catch(nt){return c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},b(oe,lt=>lt.some(Bt=>Bt.id===Fe)?lt.filter(Bt=>Bt.id!==Fe):lt),l("sendPrompt",nt,{sessionId:oe}),!1}}async function Ft(oe,Se){const Te=e.activeSessionId;if(Te){if(a.value!=="idle"||c.has(Te)){zt(oe,Se);return}await Mt(Te,oe,Se)}}async function vn(oe,Se){const Te=e.activeSessionId;if(!Te)return;const Fe=e.queuedBySession[Te]??[],nt=[],lt=[];for(const tn of Fe){const Zn=tn.text.trim();Zn&&nt.push(Zn),tn.attachments?.length&<.push(...tn.attachments)}const Bt=oe.trim();if(Bt&&nt.push(Bt),Se?.length&<.push(...Se),nt.length===0&<.length===0)return;Fe.length>0&&(e.queuedBySession={...e.queuedBySession,[Te]:[]});const On=nt.join(`
|
|
275
|
-
|
|
276
|
-
`);if(a.value==="idle"&&!c.has(Te)){await Mt(Te,On,lt);return}const Yt=[];On&&Yt.push({type:"text",text:On});for(const tn of lt)tn.kind==="video"?Yt.push({type:"video",source:{kind:"file",fileId:tn.fileId}}):Yt.push({type:"image",source:{kind:"file",fileId:tn.fileId}});const Po=g(),Oo={id:Po,sessionId:Te,role:"user",content:Yt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Te,tn=>[...tn,Oo]);try{const tn=gt(),Zn=e.sessions.find(Ls=>Ls.id===Te),Vn=(Zn?.model&&Zn.model.length>0?Zn.model:e.defaultModel)??void 0,_s=await tn.submitPrompt(Te,{content:Yt,model:Vn,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Te]??!1,swarmMode:e.swarmModeBySession[Te]??!1});if(b(Te,Ls=>{const cs=Ls.findIndex(ll=>ll.id===Po);if(cs===-1)return Ls;const ws=[...Ls];return ws[cs]={...ws[cs],promptId:ws[cs].promptId??_s.promptId},ws}),_s.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Te]:_s.promptId},v()?.bindNextPromptId(Te,_s.promptId);return}try{await tn.steerPrompts(Te,[_s.promptId])}catch{}}catch(tn){b(Te,Zn=>Zn.filter(Vn=>Vn.id!==Po)),l("steer",tn,{sessionId:Te})}}async function rn(oe,Se){try{const Fe=await gt().uploadFile({file:oe,name:Se});return{fileId:Fe.id,name:Fe.name,mediaType:Fe.mediaType}}catch(Te){return l("uploadImage",Te),null}}function zt(oe,Se){const Te=e.activeSessionId;if(!Te)return;const Fe=e.queuedBySession[Te]??[];e.queuedBySession={...e.queuedBySession,[Te]:[...Fe,{text:oe,attachments:Se}]}}async function ms(){const oe=e.activeSessionId;if(!oe)return;const Se=e.sessions.find(nt=>nt.id===oe);let Te=e.promptIdBySession[oe];if(Te===void 0){const nt=Se?.currentPromptId;nt?.startsWith("prompt_")&&(Te=nt)}const Fe=gt();if(Te!==void 0)try{if((await Fe.abortPrompt(oe,Te)).aborted)return;const lt={...e.promptIdBySession};delete lt[oe],e.promptIdBySession=lt}catch(nt){if(Zr(nt)&&nt.code===Uce){const lt={...e.promptIdBySession};delete lt[oe],e.promptIdBySession=lt}else{l("abortCurrentPrompt",nt,{sessionId:oe});return}}try{await Fe.abortSession(oe)}catch(nt){l("abortCurrentPrompt",nt,{sessionId:oe})}}function Ln(oe,Se){const Te=e.approvalsBySession[oe]??[];e.approvalsBySession={...e.approvalsBySession,[oe]:Te.filter(Fe=>Fe.approvalId!==Se)}}function yn(oe,Se){const Te=e.questionsBySession[oe]??[];e.questionsBySession={...e.questionsBySession,[oe]:Te.filter(Fe=>Fe.questionId!==Se)}}async function jn(oe,Se){const Te=e.activeSessionId;if(Te&&!mf[oe]){mf[oe]=!0;try{const Fe=gt(),nt={decision:Se.decision,scope:Se.scope,feedback:Se.feedback,selectedLabel:Se.selectedLabel};await Fe.respondApproval(Te,oe,nt),Ln(Te,oe)}catch(Fe){sv(Fe)?Ln(Te,oe):l("respondApproval",Fe,{sessionId:Te})}finally{delete mf[oe]}}}async function zs(oe,Se){const Te=e.activeSessionId;if(Te&&!Al[oe]){Al[oe]="answer";try{await gt().respondQuestion(Te,oe,Se),yn(Te,oe)}catch(Fe){sv(Fe)?yn(Te,oe):l("respondQuestion",Fe,{sessionId:Te})}finally{delete Al[oe]}}}async function Pt(oe){const Se=e.activeSessionId;if(Se&&!Al[oe]){Al[oe]="dismiss";try{await gt().dismissQuestion(Se,oe),yn(Se,oe)}catch(Te){sv(Te)?yn(Se,oe):l("dismissQuestion",Te,{sessionId:Se})}finally{delete Al[oe]}}}async function bs(oe){const Se=e.activeSessionId;if(Se&&!ov[oe]){ov[oe]=!0;try{await gt().cancelTask(Se,oe);const Fe=e.tasksBySession[Se]??[];e.tasksBySession={...e.tasksBySession,[Se]:Fe.map(nt=>nt.id===oe?{...nt,status:"cancelled"}:nt)}}catch(Te){Kce(Te)||l("cancelTask",Te,{sessionId:Se})}finally{delete ov[oe]}}}function pn(oe){const Se=e.activeSessionId;Se?(e.planModeBySession={...e.planModeBySession,[Se]:oe},D(),k({planMode:oe})):z.planMode=oe}function Ns(){const oe=e.activeSessionId,Se=oe?e.planModeBySession[oe]??!1:z.planMode;pn(!Se)}function Lo(oe){const Se=e.activeSessionId;Se?(e.swarmModeBySession={...e.swarmModeBySession,[Se]:oe},R(),k({swarmMode:oe})):z.swarmMode=oe}async function ti(){const oe=e.activeSessionId,Te=!(oe?e.swarmModeBySession[oe]??!1:z.swarmMode);Te&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Lo(Te)}function Je(oe){const Se=e.activeSessionId;Se?(e.goalModeBySession={...e.goalModeBySession,[Se]:oe},H()):z.goalMode=oe}function it(){const oe=e.activeSessionId,Se=oe?e.goalModeBySession[oe]??!1:z.goalMode;Je(!Se)}async function at(oe){const Se=oe.trim();if(!Se||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:Se}),variant:"primary"}))return;const Te=e.activeSessionId;if(Te){try{await gt().updateSession(Te,{goalObjective:Se})}catch(Fe){l("createGoal",Fe,{sessionId:Te,message:ue(Fe)});return}await Ft(Se)}}function pt(oe){const Se=e.activeSessionId;Se&&Promise.resolve(gt().updateSession(Se,{goalControl:oe})).catch(Te=>{l("controlGoal",Te,{sessionId:Se,message:ue(Te)})})}function ni(oe){e.permission=oe,$(oe),k({permissionMode:oe})}function hi(oe){const Se=[...e.warnings];Se.splice(oe,1),e.warnings=Se}async function Ie(oe,Se){try{await gt().updateSession(oe,{title:Se}),f(oe,Fe=>({...Fe,title:Se}))}catch(Te){l("renameSession",Te,{sessionId:oe})}}async function _e(oe,Se){const Te=e.workspaces.find(nt=>nt.id===oe)?.root,Fe=()=>{e.workspaces=e.workspaces.map(nt=>nt.id===oe?{...nt,name:Se}:nt)};try{if(await gt().updateWorkspace(oe,{name:Se}),Te!==void 0){const nt=Gd();Te in nt&&(delete nt[Te],c_(nt))}Fe()}catch(nt){if(Te!==void 0&&Zr(nt)&&nt.code===qce){c_({...Gd(),[Te]:Se}),Fe();return}l("renameWorkspace",nt)}}async function Re(oe){const Se=e.workspaces.find(lt=>lt.id===oe)?.root??M.value.find(lt=>lt.id===oe)?.root??oe,Te=e.activeSessionId?e.sessions.find(lt=>lt.id===e.activeSessionId):void 0,Fe=e.activeWorkspaceId===oe||e.activeWorkspaceId===Se,nt=!!(Te&&(Te.cwd===Se||Te.workspaceId===oe||A(Te)===oe));Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],X(e.hiddenWorkspaceRoots));try{await gt().deleteWorkspace(oe)}catch{}if(e.workspaces=e.workspaces.filter(lt=>lt.id!==oe&<.root!==Se),Fe||nt){const lt=E.value[0]?.id??null;if(e.activeWorkspaceId=lt,lt)Q(lt);else try{oc($t.activeWorkspace)}catch{}}(Fe||nt)&&(_(void 0),e.sessionLoading=!1,F(),Kt(void 0,"replace"))}async function ln(oe){try{await gt().archiveSession(oe),m(oe),i.clearSideChatForSession(oe);const{[oe]:Te,...Fe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Fe,e.activeSessionId===oe){const nt=e.sessions[0];nt?await Ke(nt.id,{urlMode:"replace"}):(_(void 0),Kt(void 0,"replace"))}}catch(Se){l("archiveSession",Se,{sessionId:oe})}}async function Ut(){try{await gt().logout(),await te(),await ae()}catch(oe){l("logout",oe)}}function as(oe){const Se=e.activeSessionId;Se&>().compactSession(Se,oe).catch(Te=>{l("compact",Te,{sessionId:Se})})}async function Bn(oe){const Se=oe??e.activeSessionId;if(Se)try{const Te=await gt().forkSession(Se);h(Te),await Ke(Te.id)}catch(Te){l("fork",Te,{sessionId:Se})}}async function vo(oe=1){const Se=e.activeSessionId;if(!Se)return null;const Te=(()=>{const Fe=e.messagesBySession[Se]??[];for(let nt=Fe.length-1;nt>=0;nt--){const lt=Fe[nt];if(lt.role==="user"&&!(lt.metadata?.origin&<.metadata.origin.kind!=="user"))return lt.content.filter(Bt=>Bt.type==="text").map(Bt=>Bt.text).join(`
|
|
277
|
-
`)}return null})();try{return await gt().undoSession(Se,oe),await y(Se),Te}catch(Fe){return l("undo",Fe,{sessionId:Se}),null}}function si(oe){const Se=e.activeSessionId;if(!Se)return;const Te=e.queuedBySession[Se]??[];if(oe<0||oe>=Te.length)return;const Fe=[...Te];Fe.splice(oe,1),e.queuedBySession={...e.queuedBySession,[Se]:Fe}}function gs(oe,Se){const Te=e.activeSessionId;if(!Te)return;const Fe=e.queuedBySession[Te]??[];if(oe===Se||oe<0||oe>=Fe.length||Se<0||Se>=Fe.length)return;const nt=[...Fe],[lt]=nt.splice(oe,1);lt!==void 0&&(nt.splice(Se,0,lt),e.queuedBySession={...e.queuedBySession,[Te]:nt})}async function il(oe){const Se=e.activeSessionId;if(!Se)return[];try{return(await gt().listDirectory(Se,{path:oe,includeGitStatus:!0})).items}catch{return[]}}async function rl(oe){const Se=e.activeSessionId;if(!Se)return null;try{const Fe=await gt().readFile(Se,{path:oe});return{path:Fe.path,content:Fe.content,encoding:Fe.encoding,mime:Fe.mime,languageId:Fe.languageId,isBinary:Fe.isBinary,size:Fe.size,lineCount:Fe.lineCount}}catch{return null}}const gc=10485760;function dt(oe){const Se=e.activeSessionId;return Se?gt().getFileDownloadUrl(Se,oe):null}async function he(oe,Se){const Te=e.activeSessionId;if(!Te)return!1;try{return await gt().openFile(Te,{path:oe,line:Se}),!0}catch(Fe){return l("openFile",Fe,{sessionId:Te}),!1}}async function Ne(oe){const Se=e.activeSessionId;if(!Se)return;const Te=P.value.cwd||".";try{await gt().openInApp(Se,oe,Te)}catch(Fe){l("openInApp",Fe,{sessionId:Se})}}async function Cn(oe){const Se=e.activeSessionId;if(!Se)return!1;try{return await gt().revealFile(Se,{path:oe}),!0}catch(Te){return l("revealFile",Te,{sessionId:Se}),!1}}async function ud(oe){if(/^(https?:|data:|blob:)/i.test(oe))return oe;const Se=e.activeSessionId;if(!Se)return oe;let Te=oe;if(Te.startsWith("/")){const Fe=e.sessions.find(nt=>nt.id===Se)?.cwd;if(Fe&&(Te===Fe||Te.startsWith(Fe.endsWith("/")?Fe:`${Fe}/`))){if(Te=Te.slice(Fe.length).replace(/^\//,""),!Te)return oe}else return oe}try{const nt=await gt().readFile(Se,{path:Te,length:gc});return!nt.isBinary||nt.encoding!=="base64"||nt.truncated?oe:`data:${nt.mime};base64,${nt.content}`}catch{return oe}}async function Us(oe){const Se=e.activeSessionId;if(!Se)return[];try{return(await gt().searchFiles(Se,{query:oe,limit:20})).items.map(nt=>({path:nt.path,name:nt.name}))}catch{return[]}}return{loadFileDiff:le,clearFileDiff:F,loadGitStatus:ne,checkAuth:te,loadConfig:U,updateConfig:Y,listAllSessionsGlobal:G,load:ae,loadWorkspaces:Ce,loadMoreSessions:Ae,loadAllSessions:Ee,selectWorkspace:tt,openWorkspace:xt,upsertWorkspacePreserveOrder:wt,applyWorkspaceEvent:It,clearActiveSession:Wt,openWorkspaceDraft:_t,startSessionAndSendPrompt:Ht,addWorkspaceByPath:$n,browseFs:Sn,getFsHome:Vt,writeSessionUrl:Kt,fetchSessionIntoList:Qn,onSessionRoutePopState:st,bindSessionRoute:et,selectSession:Ke,submitPromptInternal:Mt,sendPrompt:Ft,steerPrompt:vn,uploadImage:rn,enqueue:zt,unqueue:si,reorderQueue:gs,abortCurrentPrompt:ms,respondApproval:jn,respondQuestion:zs,dismissQuestion:Pt,pendingQuestionActions:Al,pendingApprovalActions:mf,cancelTask:bs,setPlanMode:pn,togglePlanMode:Ns,setSwarmMode:Lo,toggleSwarmMode:ti,setGoalMode:Je,toggleGoalMode:it,createGoal:at,controlGoal:pt,setPermission:ni,dismissWarning:hi,renameSession:Ie,renameWorkspace:_e,deleteWorkspace:Re,archiveSession:ln,logout:Ut,compact:as,forkSession:Bn,undo:vo,listDir:il,readFileContent:rl,getFileDownloadUrl:dt,openWorkspaceFile:he,openInApp:Ne,revealWorkspaceFile:Cn,resolveImageUrl:ud,searchFiles:Us,loadOlderMessages:Ue,refreshSessionSidecars:Le}}const Yce="kimiWeb.optimisticUserMessage";function Xce(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Qce(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 Zce(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function iv(e){return e.role==="user"&&e.metadata?.[Yce]===!0}function Jce(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function GC(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function eue(e,t){const n=GC(e),s=GC(t);return n.text===s.text&&n.media===s.media}function tue(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(iv(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(iv(o)&&Jce(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(iv(o)&&eue(o,t))return s}return-1}function nue(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function sue(e,t,n){const s=Qce(e);switch(Zce(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[IE]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"){const a=tue(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},s.messagesBySession[o]=c;break}}s.messagesBySession[o]=[...r,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=nue(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i];l[r]={...t.task,outputLines:i[r].outputLines,text:i[r].text},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;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 o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?zn.global.t("warnings.errorLabel"):zn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function oue(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function iue(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||Xl(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:oue(a.status)}]:[]})}}return[]}const Ai=mE(),Nl=tce(),Dp=ace(),LE=$t.permission,PE=$t.activeWorkspace,OE=$t.thinking,RE=$t.planMode,DE=$t.swarmMode,BE=$t.goalMode,YC=40401,FE=$t.onboarded,rue=["off","low","medium","high","xhigh","max"];oc($t.codeFont);oc($t.theme);function lue(){try{const e=Xn(LE);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function aue(e){try{es(LE,e)}catch{}}function cue(){try{const e=Xn(OE);if(e&&rue.includes(e))return e}catch{}return"high"}function uue(e){try{es(OE,e)}catch{}}function rv(e){const t=Xn(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const s={};for(const[o,i]of Object.entries(n))i===!0&&(s[o]=!0);return s}catch{return{}}}function gy(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);es(e,JSON.stringify(n))}catch{}}function WE(){gy(RE,be.planModeBySession)}function HE(){gy(DE,be.swarmModeBySession)}function zE(){gy(BE,be.goalModeBySession)}function due(){try{return Xn(PE)}catch{return null}}const UE=$t.hiddenWorkspaces;function fue(){try{const e=Xn(UE);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function pue(e){try{es(UE,JSON.stringify(e))}catch{}}function hue(e){try{es(PE,e)}catch{}}function mue(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const be=Es({...Xce(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:lue(),thinking:cue(),planModeBySession:rv(RE),swarmModeBySession:rv(DE),goalModeBySession:rv(BE),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:c0(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:due(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:fue(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsFullyLoaded:!1}),$h=Es({planMode:!1,swarmMode:!1,goalMode:!1});function qE(e){be.sessions=e}function Nh(e,t){be.sessions=be.sessions.map(n=>n.id===e?t(n):n)}function gue(e){be.sessions=[e,...be.sessions.filter(t=>t.id!==e.id)]}function vue(e){be.sessions=[...be.sessions,e]}function yue(e){be.sessions=be.sessions.filter(t=>t.id!==e)}function jE(){const e=be.activeSessionId;e&&be.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(be.unreadBySession={...be.unreadBySession,[e]:!1},u0({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===$t.unread&&(be.unreadBySession=c0(),jE())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&jE()});function vy(e){be.activeSessionId=e}function kue(e){be.messagesBySession=e}function bue(e,t){be.messagesBySession={...be.messagesBySession,[e]:t}}function VE(e,t){be.messagesBySession={...be.messagesBySession,[e]:t(be.messagesBySession[e]??[])}}function _ue(e){const{[e]:t,...n}=be.messagesBySession;be.messagesBySession=n}function KE(e){Ii?.unsubscribe(e),Vu.flush(),yue(e),_ue(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 Oh[e],s3.delete(e),Ph.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],WE(),HE(),zE()}const GE=ee(null),YE=ee([]),XE=ee(!1),QE=ee(!1);async function Lh(e){let t;try{t=await gt().getSessionStatus(e)}catch{return}Nh(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 ZE(e){const t=be.activeSessionId;t&&Promise.resolve(gt().updateSession(t,e)).then(()=>Lh(t)).catch(()=>{})}const JE=$t.conversationToc;function wue(){try{const e=Xn(JE);return e===null?!0:e==="true"}catch{return!0}}function Sue(e){try{es(JE,e?"true":"false")}catch{}}const e3=ee(wue());function Cue(e){e3.value=e,Sue(e)}function xue(e){try{return Xn(e)??""}catch{return""}}const t3=ee(xue(FE)==="1");function Aue(e){t3.value=e;try{es(FE,e?"1":"0")}catch{}}let Ii=null,XC=0;function n3(){return XC+=1,`msg_opt_${Date.now().toString(36)}_${XC}`}const Ph=new Set;function Tue(e,t,n){const s={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},o=sue(s,e,{sessionId:t,seq:n});qE(o.sessions),vy(o.activeSessionId),kue(o.messagesBySession),be.approvalsBySession=o.approvalsBySession,be.planReviewByToolCallId=o.planReviewByToolCallId,be.questionsBySession=o.questionsBySession,be.tasksBySession=o.tasksBySession,be.goalBySession=o.goalBySession,be.lastSeqBySession=o.lastSeqBySession,be.compactionBySession=o.compactionBySession,be.config=o.config??null,be.warnings=o.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 Mue(e,t){Tue(e,t.sessionId,t.seq);const n=Rs.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&Rs.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?Rs.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?Rs.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&Rs.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;be.promptIdBySession[s]!==e.message.promptId&&(be.promptIdBySession={...be.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===be.activeSessionId&&Ai.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&Hde(e.sessionId,e.status),e.type==="questionRequested"&&zde(e.sessionId,e.question)}const Vu=Xae(({appEvent:e,meta:t})=>Mue(e,t),({appEvent:e})=>Gae(e));function yy(){if(Ii!==null||typeof WebSocket>"u")return;be.connection="connecting",Ii=gt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){yt.applyWorkspaceEvent(t);return}Vu({appEvent:t,meta:n})},onResync(t,n,s){Vu.flush(),s!==void 0&&(Oh[t]=s),Wue.request(t)},onError(t,n,s){ky({severity:"error",title:zn.global.t("warnings.wsTitle"),message:n,details:[Fn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){be.connected=t,be.connection=t?"connected":"disconnected"}})}const Oh={},s3=new Set;function Eue(e){return Zr(e)&&e.code===YC?!0:typeof e=="object"&&e!==null&&e.code===YC}function Fn(e,t){if(!(t==null||t===""))return{label:zn.global.t(`warnings.details.${e}`),value:o3(t)}}function o3(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 Iue(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function $ue(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Nue(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Lue(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function QC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function Pue(e,t,n){const s=kE(t),o=Zr(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Fn("operation",e),Fn("sessionId",n??be.activeSessionId),Fn("connection",be.connection),Fn("timestamp",Lue(i??Date.now()))];return s?l.push(Fn("duration",QC(r)),Fn("request",`${t.method} ${t.path}`),Fn("endpoint",t.url),Fn("requestId",t.requestId),Fn("phase",t.phase),Fn("timeout",`${t.timeoutMs}ms`),Fn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Fn("contentType",t.contentType),Fn("responsePreview",t.bodyPreview),Fn("cause",t.cause)):o?l.push(Fn("duration",QC(r)),Fn("code",t.code),Fn("requestId",t.requestId),Fn("message",t.message),Fn("details",t.details)):l.push(Fn("errorName",Iue(t)),Fn("message",$ue(t)??o3(t)),Fn("stack",Nue(t))),l.filter(a=>a!==void 0)}function Oue(e,t,n={}){const s=kE(t),o=Zr(t),i=n.title??(s?zn.global.t("warnings.daemonNetworkTitle"):o?zn.global.t("warnings.daemonApiTitle"):zn.global.t("warnings.operationFailedTitle")),r=n.message??(s?zn.global.t("warnings.daemonNetworkMessage"):o?t.message:zn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Pue(e,t,n.sessionId)}}function ky(e){be.warnings=[...be.warnings,e]}function Rh(e,t,n){ky(Oue(e,t,n))}const Rue={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function Due(e){if(!Zr(e))return;const t=Rue[e.code];return t?zn.global.t(t):void 0}async function Bue(e){if(KE(e),be.activeSessionId!==e)return;const t=be.sessions[0];t?await yt.selectSession(t.id,{urlMode:"replace"}):(vy(void 0),be.sessionLoading=!1,yt.writeSessionUrl(void 0,"replace"))}const ZC=new Set;async function Fue(e){if(!ZC.has(e)){ZC.add(e);try{const t=await gt().getSessionWarnings(e),n=zn.global.t("warnings.noteLabel");for(const s of t)ky(`${n}: ${s.message}`)}catch{}}}async function i3(e){try{const n=await gt().getSessionSnapshot(e);Vu.flush(),Nh(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),bue(e,n.messages),be.messagesHasMoreBySession={...be.messagesHasMoreBySession,[e]:n.hasMoreMessages},be.approvalsBySession={...be.approvalsBySession,[e]:n.pendingApprovals};for(const s of n.pendingApprovals){const o=s.display;o?.kind==="plan_review"&&typeof o.plan=="string"&&o.plan.length>0&&(be.planReviewByToolCallId={...be.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return be.questionsBySession={...be.questionsBySession,[e]:n.pendingQuestions},be.lastSeqBySession={...be.lastSeqBySession,[e]:n.asOfSeq},Oh[e]=n.epoch,yy(),Ii&&(Ii.seedSnapshot(e,n),Ii.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),Fue(e),"ok"}catch(t){return Eue(t)?(await Bue(e),"not-found"):(Rh("getSessionSnapshot",t,{title:zn.global.t("warnings.sessionSnapshotTitle"),message:zn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Wue=Vae(i3);function Hue(e){return Object.prototype.hasOwnProperty.call(be.messagesBySession,e)}function zue(e){if(yy(),Ii){Vu.flush();const t=be.lastSeqBySession[e]??0,n=Oh[e];Ii.subscribe(e,{seq:t,epoch:n})}}function Dh(e){const t=be.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Rs.sideChatTargetBySession.value[e]?.agentId,o=(be.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&be.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function by(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return zn.global.t("sessions.justNow");if(i<1)return`${Math.round(o/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=o/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 Uue=3e4,Ku=ee(0);let lv=null;function que(){lv===null&&(lv=setInterval(()=>{Ku.value=(Ku.value+1)%Number.MAX_SAFE_INTEGER},Uue),lv.unref?.())}function jue(e,t){const n=e.split(`
|
|
278
|
-
`),s=t.split(`
|
|
279
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Vue(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:jue(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}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 s=typeof t.plan=="string"?t.plan:"",o=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:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Kue(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 Gue(e){const t=be.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function Yue(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=zn.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=zn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??Gue(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const Xue=W(()=>{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}}),Que=W(()=>(Ku.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:by(e.updatedAt,e.status),status:e.status,busy:Dh(e.id)})))),Zue=W(()=>be.activeSessionId??""),Jue=W(()=>{const e=be.activeSessionId;return e?Wn.skillsBySession.value[e]??[]:[]}),ede=W(()=>{const e=be.activeSessionId;return e?be.sendingBySession[e]??!1:!1}),Rs=Bce(be,{pushOperationFailure:Rh,nextOptimisticMsgId:n3,connectEventsIfNeeded:yy,getEventConn:()=>Ii}),cd=W(()=>{const e=be.activeSessionId;if(!e)return[];const t=Rs.sideChatTargetBySession.value[e]?.agentId;return(be.tasksBySession[e]??[]).filter(n=>n.id!==t)}),r3=dce(be,cd),tde=W(()=>{const e=be.activeSessionId;if(!e)return[];const t=new Set(be.sideChatUserMessageIdsBySession[e]??[]),n=(be.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=be.approvalsBySession[e]??[];return NE(n,s,o=>gt().getFileUrl(o),Bh.value!=="idle",cd.value,be.planReviewByToolCallId)}),nde=W(()=>(r3.taskClock.value,cd.value.map(Yue))),l3=W(()=>vce(cd.value)),Ma=W(()=>{const e=be.activeSessionId;return e?be.goalBySession[e]??null:null}),sde=W(()=>{const e=be.activeSessionId;return e?iue(be.messagesBySession[e]??[]):[]}),ode=W(()=>{const e=be.activeSessionId;return e?be.compactionBySession[e]??null:null}),ide=W(()=>be.connection),rde=W(()=>be.loading),lde=W(()=>be.sessionLoading),ade=W(()=>{const e=be.activeSessionId;return e?be.messagesLoadingMoreBySession[e]??!1:!1}),cde=W(()=>{const e=be.activeSessionId;return e?be.messagesHasMoreBySession[e]??!1:!1}),ude=W(()=>{const e=be.activeSessionId;return e?be.messagesLoadMoreErrorBySession[e]??!1:!1}),dde=W(()=>be.serverVersion),fde=W(()=>be.permission),pde=W(()=>be.thinking),a3=W(()=>{const e=be.activeSessionId;return e?be.planModeBySession[e]??!1:$h.planMode}),hde=W(()=>{const e=be.activeSessionId;return e?be.swarmModeBySession[e]??!1:$h.swarmMode}),mde=W(()=>{const e=be.activeSessionId;return e?be.goalModeBySession[e]??!1:$h.goalMode}),gde=W(()=>{const e=yce(l3.value);return{plan:a3.value,goal:Ma.value&&Ma.value.status!=="complete"?{status:Ma.value.status,turnsUsed:Ma.value.turnsUsed,elapsedMs:Ma.value.wallClockMs}:null,swarm:e.total>0?e:null}}),vde=W(()=>{const e=be.activeSessionId;if(!e)return[];const t=gt();return(be.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(s=>({fileId:s.fileId,kind:s.kind,url:t.getFileUrl(s.fileId)}))}))}),yde=W(()=>be.warnings),kde=W(()=>{const e=be.activeSessionId;return e?(be.questionsBySession[e]??[]).map(Kue):[]}),bde=W(()=>{const e=be.activeSessionId;return e?(be.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:Vue(t),agentName:t.agentName})):[]}),Bh=W(()=>{const e=be.activeSessionId;return e?(be.approvalsBySession[e]??[]).length>0?"awaiting-approval":(be.questionsBySession[e]??[]).length>0?"awaiting-question":Dh(e)?"running":"idle":"idle"}),Wn=hce(be,{pushOperationFailure:Rh,refreshSessionStatus:Lh,persistSessionProfile:ZE,activity:Bh,inFlightPromptSessions:Ph,saveThinkingToStorage:uue,updateSession:Nh,updateSessionMessages:VE}),Bp=W(()=>{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}),_de=W(()=>{const e=be.activeSessionId;return e?be.gitStatusBySession[e]?.pullRequest??null:null}),wde=W(()=>{const e=be.activeSessionId;if(!e)return[];const t=be.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),Sde=W(()=>{const e=be.activeSessionId;if(!e)return null;const t=be.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),c3=W(()=>{const e=be.sessions.find(r=>r.id===be.activeSessionId),t=Bp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Wn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??be.defaultModel)??"—",o=Wn.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:be.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Bp.value!==null}}),Cde=W(()=>YE.value),xde=W(()=>be.sessions.find(t=>t.id===be.activeSessionId)?.usage.totalCostUsd??0),Ade=W(()=>be.authReady),Tde=W(()=>be.defaultModel),Mde=W(()=>be.managedProviderStatus),Ede=W(()=>be.config),Ide=W(()=>{const e=be.activeSessionId;if(!e)return{};const t=be.gitStatusBySession[e];return t?{...t.entries}:{}});function lc(e){return be.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const _y=W(()=>jae({workspaces:be.workspaces,sessions:be.sessions,hiddenWorkspaceRoots:be.hiddenWorkspaceRoots,activeRoot:be.sessions.find(e=>e.id===be.activeSessionId)?.cwd,activeBranch:Bp.value?.branch??null,sessionsHasMoreByWorkspace:be.sessionsHasMoreByWorkspace})),Fp=ee(iL()),ac=ee(rL()==="manual"?"manual":"recent");Ge(()=>[_y.value.map(e=>e.id).join("\0"),be.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=yL(n,Fp.value);s!==null&&(Fp.value=s,lA(s))});const Kl=W(()=>{const e=_y.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:mue(t.root,be.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(ac.value==="recent"){const t=new Map;for(const n of be.sessions){if(n.parentSessionId)continue;const s=lc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return _L(e,t)}return kL(e,Fp.value)}),u3=W(()=>{const e=be.activeWorkspaceId,t=Kl.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),$de=W(()=>{const e=u3.value;return e?Kl.value.find(t=>t.id===e)??null:null}),Nde=W(()=>{Ku.value;const e=new Set(Kl.value.map(n=>n.id)),t=new Map(Kl.value.map(n=>[n.id,n.name]));return be.sessions.filter(n=>!n.parentSessionId&&e.has(lc(n))).map(n=>{const s=lc(n);return{id:n.id,title:n.title,time:by(n.updatedAt,n.status),status:n.status,busy:Dh(n.id),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),Lde=W(()=>{Ku.value;const e=new Map;for(const t of be.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=lc(t),s={id:t.id,title:t.title,time:by(t.updatedAt,t.status),status:t.status,busy:Dh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Kl.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:be.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:be.sessionsLoadingMoreByWorkspace[t.id]??!1}))});function Pde(e){Fp.value=e,lA(e),ac.value!=="manual"&&(ac.value="manual",aA("manual"))}function Ode(e){ac.value!==e&&(ac.value=e,aA(e))}const d3=W(()=>{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}),Rde=W(()=>{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}),Dde=W(()=>{const e={};for(const[t,n]of Object.entries(be.unreadBySession))n&&(e[t]=!0);return e}),Bde=W(()=>{const e={},t=d3.value;for(const n of be.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=lc(n);e[o]=(e[o]??0)+s}return e}),Fde=W(()=>be.recentRoots),Wde=W(()=>be.availableOpenInApps),yt=Gce(be,{taskPoller:r3,sideChat:Rs,modelProvider:Wn,pushOperationFailure:Rh,activity:Bh,inFlightPromptSessions:Ph,sessionsKnownEmpty:s3,setSessions:qE,updateSession:Nh,upsertSessionFront:gue,appendSession:vue,forgetSession:KE,setActiveSessionId:vy,updateSessionMessages:VE,nextOptimisticMsgId:n3,getEventConn:()=>Ii,syncSessionFromSnapshot:i3,subscribeToSessionEvents:zue,hasLoadedMessages:Hue,refreshSessionStatus:Lh,persistSessionProfile:ZE,mergedWorkspaces:_y,workspacesView:Kl,status:c3,workspaceIdForSession:lc,savePermissionToStorage:aue,savePlanModeToStorage:WE,saveSwarmModeToStorage:HE,saveGoalModeToStorage:zE,draftModes:$h,saveUnread:u0,saveActiveWorkspaceToStorage:hue,saveHiddenWorkspacesToStorage:pue,goalErrorMessage:Due,resetFastMoon:Ai.resetFastMoon,initialized:QE,selectedDiffPath:GE,fileDiffLines:YE,fileDiffLoading:XE});function Hde(e,t){if(Ph.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?(Ai.resetFastMoon(),yt.loadGitStatus(e),Lh(e)):t==="idle"&&(be.unreadBySession={...be.unreadBySession,[e]:!0},u0({[e]:!0})),Nl.maybeNotifyCompletion(e,{isActiveAndVisible:e===be.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:be.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{yt.selectSession(e)}}),t==="idle"&&Dp.maybePlayCompletionSound();const n=be.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;be.queuedBySession={...be.queuedBySession,[e]:o},s!==void 0&&yt.submitPromptInternal(e,s.text,s.attachments).then(i=>{if(!i){const r=be.queuedBySession[e]??[];be.queuedBySession={...be.queuedBySession,[e]:[s,...r]}}})}function zde(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Nl.maybeNotifyQuestion(e,{isActiveAndVisible:e===be.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:be.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{yt.selectSession(e)}}),Dp.maybePlayQuestionSound()}function Ude(){return que(),{workspace:Xue,sessions:Que,activeSessionId:Zue,workspacesView:Kl,workspaceSortMode:ac,visibleWorkspace:$de,activeWorkspaceId:u3,sessionsForView:Nde,workspaceGroups:Lde,attentionBySession:d3,pendingBySession:Rde,attentionByWorkspace:Bde,unreadBySession:Dde,recentRoots:Fde,turns:tde,tasks:nde,activeAppTasks:cd,todos:sde,goal:Ma,swarms:l3,activationBadges:gde,compaction:ode,status:c3,sessionCost:xde,fileDiff:Cde,selectedDiffPath:GE,fileDiffLoading:XE,changes:wde,gitInfo:Bp,gitDiffStats:Sde,activePullRequest:_de,changesByPath:Ide,pendingApprovals:bde,availableOpenInApps:Wde,connection:ide,loading:rde,sessionLoading:lde,loadingMoreMessages:ade,hasMoreMessages:cde,loadMoreMessagesError:ude,serverVersion:dde,initialized:QE,permission:fde,thinking:pde,planMode:a3,swarmMode:hde,goalMode:mde,queued:vde,warnings:yde,questions:kde,activity:Bh,isSending:ede,fastMoon:Ai.fastMoon,models:Wn.models,starredModelIds:Wn.starredModelIds,providers:Wn.providers,uiFontSize:Ai.uiFontSize,setUiFontSize:Ai.setUiFontSize,conversationToc:e3,setConversationToc:Cue,colorScheme:Ai.colorScheme,setColorScheme:Ai.setColorScheme,accent:Ai.accent,setAccent:Ai.setAccent,notifyOnComplete:Nl.notifyOnComplete,notifyOnQuestion:Nl.notifyOnQuestion,notifyPermission:Nl.notifyPermission,setNotifyOnComplete:Nl.setNotifyOnComplete,setNotifyOnQuestion:Nl.setNotifyOnQuestion,soundOnComplete:Dp.soundOnComplete,setSoundOnComplete:Dp.setSoundOnComplete,onboarded:t3,setOnboarded:Aue,load:yt.load,selectSession:yt.selectSession,clearActiveSession:yt.clearActiveSession,loadOlderMessages:yt.loadOlderMessages,loadWorkspaces:yt.loadWorkspaces,loadMoreSessions:yt.loadMoreSessions,loadAllSessions:yt.loadAllSessions,selectWorkspace:yt.selectWorkspace,openWorkspace:yt.openWorkspace,openWorkspaceDraft:yt.openWorkspaceDraft,startSessionAndSendPrompt:yt.startSessionAndSendPrompt,addWorkspaceByPath:yt.addWorkspaceByPath,browseFs:yt.browseFs,getFsHome:yt.getFsHome,sendPrompt:yt.sendPrompt,steerPrompt:yt.steerPrompt,sideChatVisible:Rs.sideChatVisible,sideChatSessionId:Rs.sideChatSessionId,sideChatTurns:Rs.sideChatTurns,sideChatRunning:Rs.sideChatRunning,sideChatSending:Rs.sideChatSending,openSideChat:Rs.openSideChat,closeSideChat:Rs.closeSideChat,sendSideChatPrompt:Rs.sendSideChatPrompt,uploadImage:yt.uploadImage,abortCurrentPrompt:yt.abortCurrentPrompt,respondApproval:yt.respondApproval,respondQuestion:yt.respondQuestion,dismissQuestion:yt.dismissQuestion,pendingQuestionActions:yt.pendingQuestionActions,pendingApprovalActions:yt.pendingApprovalActions,cancelTask:yt.cancelTask,setPermission:yt.setPermission,setThinking:Wn.setThinking,setPlanMode:yt.setPlanMode,togglePlanMode:yt.togglePlanMode,setSwarmMode:yt.setSwarmMode,toggleSwarmMode:yt.toggleSwarmMode,setGoalMode:yt.setGoalMode,toggleGoalMode:yt.toggleGoalMode,createGoal:yt.createGoal,controlGoal:yt.controlGoal,enqueue:yt.enqueue,dismissWarning:yt.dismissWarning,renameSession:yt.renameSession,renameWorkspace:yt.renameWorkspace,deleteWorkspace:yt.deleteWorkspace,reorderWorkspaces:Pde,setWorkspaceSortMode:Ode,archiveSession:yt.archiveSession,compact:yt.compact,forkSession:yt.forkSession,undo:yt.undo,unqueue:yt.unqueue,reorderQueue:yt.reorderQueue,searchFiles:yt.searchFiles,loadGitStatus:yt.loadGitStatus,loadFileDiff:yt.loadFileDiff,clearFileDiff:yt.clearFileDiff,listDir:yt.listDir,readFileContent:yt.readFileContent,getFileDownloadUrl:yt.getFileDownloadUrl,openWorkspaceFile:yt.openWorkspaceFile,openInApp:yt.openInApp,revealWorkspaceFile:yt.revealWorkspaceFile,resolveImageUrl:yt.resolveImageUrl,refreshOAuthProviderModels:Wn.refreshOAuthProviderModels,loadModels:Wn.loadModels,loadProviders:Wn.loadProviders,skills:Jue,activateSkill:Wn.activateSkill,setModel:Wn.setModel,toggleStarModel:Wn.toggleStarModel,addProvider:Wn.addProvider,deleteProvider:Wn.deleteProvider,refreshProvider:Wn.refreshProvider,refreshAllProviders:Wn.refreshAllProviders,authReady:Ade,defaultModel:Tde,managedProviderStatus:Mde,config:Ede,updateConfig:yt.updateConfig,checkAuth:yt.checkAuth,startOAuthLogin:Wn.startOAuthLogin,pollOAuthLogin:Wn.pollOAuthLogin,cancelOAuthLogin:Wn.cancelOAuthLogin,logout:yt.logout}}function qde({client:e,authLogoRef:t}){const n=W(()=>e.authReady.value),s=W(()=>e.initialized.value&&!n.value),o="/login",i=ee(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ge(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return wn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function jde({running:e,showAuthGate:t}){const{t:n}=Nt(),s=["◐","◓","◑","◒"],o=ee(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ge(e,c=>{c?r():l()},{immediate:!0});const a=W(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});n$(()=>{typeof document<"u"&&(document.title=a.value)}),wn(()=>{l()})}const f3=ee(typeof window>"u"?0:window.innerWidth);let gf=0,Wp=!1;function I1(){f3.value=window.innerWidth}function Vde(){Wp||typeof window>"u"||(window.addEventListener("resize",I1),Wp=!0,I1())}function Kde(){!Wp||typeof window>"u"||(window.removeEventListener("resize",I1),Wp=!1)}function p3(e,t,n){return Math.max(t,e-n)}function $1(e,t,n){return Math.min(n,Math.max(t,e))}function h3(){return _n(()=>{gf+=1,Vde()}),hs(()=>{gf=Math.max(0,gf-1),gf===0&&Kde()}),{viewportWidth:f3}}const Gde="kimi-web.file-preview-width",Ea=320;function Yde({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=h3(),i=W(()=>Math.max(0,o.value-t.value)),r=W(()=>p3(i.value,Ea,Ea));function l(te){return $1(Math.round(te),Ea,r.value)}function a(){return l(i.value/2)}const c=W(()=>a()),u=ee(c.value),d=W(()=>$1(u.value,Ea,r.value)),f=ee(null),h=W(()=>{const te=f.value;if(!te)return null;const Y=e.turns.value.find(fe=>fe.id===te.turnId)?.blocks?.[te.blockIndex];return Y?.kind==="thinking"?Y.thinking:null}),p=W(()=>h.value!==null);function m(te){const U=f.value;if(U&&U.turnId===te.turnId&&U.blockIndex===te.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=te}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const b=ee(null),g=W(()=>{const te=b.value;if(!te)return null;const U=e.turns.value.find(Y=>Y.id===te.turnId);return U?.role==="compaction"&&U.text?U.text:null}),v=W(()=>g.value!==null);function y(te){if(b.value?.turnId===te.turnId){b.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",b.value=te}function C(){b.value=null,n.value==="compaction"&&(n.value=null)}const L=ee(null);function I(te){const U=e.activeAppTasks.value,Y=U.find(se=>se.id===te)??U.find(se=>se.parentToolCallId===te);if(Y)return Y.id;const fe=U.filter(se=>se.kind==="subagent"&&!se.parentToolCallId);if(fe.length===1)return fe[0].id}const k=W(()=>{const te=L.value;if(!te)return null;const U=e.activeAppTasks.value.find(Y=>Y.id===te.subagentId);return U?Ice(U):null}),M=W(()=>k.value!==null);function E(te){const U=I(te);if(U){if(L.value?.subagentId===U){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:U},n.value="agent"}}function P(){L.value=null,n.value==="agent"&&(n.value=null)}const A=ee(null),$=W(()=>{const te=A.value;if(!te)return null;const U=DP(e.turns.value,te);return U?{id:te,title:td(U.name),path:RP(U.arg),lines:U.status==="error"?null:vA(U),output:U.output}:null}),D=W(()=>$.value!==null);function R(te){if(n.value==="toolDiff"&&A.value===te){H();return}n.value="toolDiff",A.value=te}function H(){A.value=null,n.value==="toolDiff"&&(n.value=null)}const z=ee("list"),q=ee(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 ue(te){z.value="detail",q.value=te,await e.loadFileDiff(te)}async function ge(te){await e.openSideChat(te),n.value="btw"}function xe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ke(){n.value==="btw"&&(n.value=null)}const ze=W(()=>e.sideChatVisible.value),qe=W(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||M.value)&&(n.value!=="toolDiff"||D.value)&&(n.value!=="btw"||ze.value)),Ue=ee(!1),Le=ee({});function le(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return b.value?{kind:"compaction",...b.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return A.value?{kind:"toolDiff",toolId:A.value}:null;case"btw":return{kind:"btw"};default:return null}}function F(te){if(te)switch(te.kind){case"thinking":f.value={turnId:te.turnId,blockIndex:te.blockIndex},n.value="thinking";break;case"compaction":b.value={turnId:te.turnId},n.value="compaction";break;case"agent":L.value={subagentId:te.subagentId},n.value="agent";break;case"toolDiff":A.value=te.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ne(){return n.value==="thinking"&&p.value?(_(),!0):n.value==="compaction"&&v.value?(C(),!0):n.value==="agent"&&M.value?(P(),!0):n.value==="toolDiff"&&D.value?(H(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(X(),!0):n.value==="btw"?(xe(),!0):!1}return Ge(e.activeSessionId,(te,U)=>{if(U){const Y=le();Y?Le.value[U]=Y:delete Le.value[U]}s(),_(),C(),P(),H(),X(),ke(),te&&F(Le.value[te])}),{PREVIEW_WIDTH_KEY:Gde,PREVIEW_MIN:Ea,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:C,agentPanelMember:k,agentPanelVisible:M,openAgentPanel:E,closeAgentPanel:P,toolDiffTarget:$,toolDiffVisible:D,openToolDiff:R,closeToolDiff:H,detailDiffMode:z,detailDiffPath:q,openDiffDetail:Q,closeDiffDetail:X,selectDiffFile:ue,btwVisible:ze,openSideChatTab:ge,closeSideChat:xe,hideSideChatPanel:ke,sidePanelVisible:qe,panelDragging:Ue,closeOpenSidePanel:ne}}const Xde=$t.sidebarWidth,JC=$t.sidebarCollapsed,ex=270,av=170,Qde=36,Zde=320;function Jde(e={}){const{viewportWidth:t}=h3(),n=ee(ex),s=ee(!1),o=W(()=>{const c=Zde+(Cx(e.previewOpen)?Ea:0);return p3(t.value,av,c)}),i=W(()=>s.value?Qde:$1(n.value,av,o.value));function r(){try{s.value=Xn(JC)==="true"}catch{s.value=!1}}function l(){try{es(JC,String(s.value))}catch{}}function a(){s.value=!s.value,l()}return{SIDEBAR_WIDTH_KEY:Xde,SIDEBAR_DEFAULT:ex,SIDEBAR_MIN:av,sidebarMax:o,sessionColWidth:n,sidebarCollapsed:s,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function efe({client:e,detailTarget:t}){const{t:n}=Nt(),s=ee(null),o=ee(null),i=ee(!1),r=ee(null),l=ee(null);let a=0;const c=W(()=>{const y=l.value;return y?e.getFileDownloadUrl(y):null}),u=W(()=>s.value!==null);function d(y){return y.length>1?y.replace(/\/+$/,""):y}function f(y){const C=[];for(const L of y.split(/[\\/]+/))if(!(!L||L===".")){if(L===".."){C.pop();continue}C.push(L)}return C.join("/")}function h(y){const C=y.trim();if(!C)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(C))return{error:n("filePreview.errors.unsupportedPath")};if(C.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const L=d(e.status.value.cwd);if(C.startsWith("/")){if(!L||C!==L&&!C.startsWith(`${L}/`))return{error:n("filePreview.errors.outsideWorkspace")};const k=C===L?"":C.slice(L.length+1);if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const M=f(k);return M?{path:M}:{error:n("filePreview.errors.isDirectory")}}if(C.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const I=f(C);return I?{path:I}:{error:n("filePreview.errors.emptyPath")}}async function p(y){const C=s.value;if(t.value==="file"&&C&&C.path===y.path&&C.line===y.line){b();return}const L=++a;t.value="file",o.value=null,r.value=null,i.value=!0,s.value=y,l.value=null;const I=h(y.path);if("error"in I){i.value=!1,r.value=I.error;return}l.value=I.path;try{const k=await e.readFileContent(I.path);if(L!==a)return;k?o.value={...k,path:k.path||I.path}:o.value={path:I.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(k){if(L!==a)return;r.value=k instanceof Error?k.message:n("filePreview.errors.loadFailed")}finally{L===a&&(i.value=!1)}}function m(y){return/^data:([^;,]+)/i.exec(y)?.[1]}function _(y){y.kind==="image"&&(t.value="file",s.value=null,l.value=null,r.value=null,i.value=!1,o.value={path:y.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:y.mimeType??m(y.url)??"image/*",sourceUrl:y.url,isBinary:!0,size:y.bytes??0})}function b(){s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function g(){const y=o.value?.path??s.value?.path;y&&e.openWorkspaceFile(y,s.value?.line)}function v(){const y=o.value?.path??s.value?.path;y&&e.revealWorkspaceFile(y)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:p,openMediaPreview:_,closeFilePreview:b,openPreviewInEditor:g,revealPreviewFile:v}}const tfe=640,nfe=`(max-width: ${tfe}px)`;function sfe(){const e=ee(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(nfe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),wn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),wn(()=>t.removeListener(n))),e}const ofe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},ife={class:"server-auth-card"},rfe={class:"server-auth-body"},lfe={class:"server-auth-foot"},afe=Ve({__name:"ServerAuthDialog",setup(e){const t=ee(""),n=ee(null),s=ee(!1);_n(()=>{vt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,_E(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(w(),N("div",ofe,[T("div",ife,[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"},[je(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),T("code",null,"KIMI_CODE_PASSWORD"),je("). ")])],-1)),T("div",rfe,[Z(Za,{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:s.value,onKeydown:i},null,8,["modelValue","disabled"])]),T("div",lfe,[Z(Ot,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:de(()=>[je(O(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),cfe=ft(afe,[["__scopeId","data-v-82150ea4"]]),ufe={class:"app-shell"},dfe={key:1,class:"auth-page"},ffe={class:"auth-page-inner"},pfe={class:"auth-page-copy"},hfe={key:0,class:"sidebar-rail"},mfe=["aria-label","aria-hidden"],gfe=Ve({__name:"App",setup(e){const t=$ae(),n=ee(!t);let s=null;const o=Ude();Pn("resolveImage",o.resolveImageUrl);const{t:i}=Nt(),r=pi(),l=sfe(),a=ee(!1),c=ee(!1),u=W(()=>{const dt=o.activeSessionId.value;return o.sessions.value.find(he=>he.id===dt)?.title??""}),d=W(()=>o.visibleWorkspace.value?.sessionCount??0),f=W(()=>o.activity.value!=="idle"),h=ee(null),{showAuthGate:p,blinkAuthLogo:m}=qde({client:o,authLogoRef:h});jde({running:f,showAuthGate:p});function _(dt){return dt==="off"?"high":"off"}const b=ee(!o.onboarded.value);function g(){o.setOnboarded(!0),b.value=!1}function v(){b.value=!0}_n(()=>{o.load(),qe(),document.addEventListener("keydown",y,!0),s=Lae(()=>{n.value=!0})}),wn(()=>{document.removeEventListener("keydown",y,!0),s!==null&&(s(),s=null)});function y(dt){dt.key==="Escape"&&(ms.value||Qn()&&(dt.stopPropagation(),dt.preventDefault()))}const C=ee(null),L=ee(!1);Ge(o.activeSessionId,()=>{L.value=!0,vt(()=>{L.value=!1})});const{previewTarget:I,previewFile:k,previewLoading:M,previewError:E,previewDownloadUrl:P,previewExternalActions:A,openFilePreview:$,openMediaPreview:D,closeFilePreview:R,openPreviewInEditor:H,revealPreviewFile:z}=efe({client:o,detailTarget:C}),q=W(()=>C.value!==null),{SIDEBAR_WIDTH_KEY:Q,SIDEBAR_DEFAULT:X,SIDEBAR_MIN:ue,sidebarMax:ge,sessionColWidth:xe,sidebarCollapsed:ke,sideWidth:ze,loadSidebarCollapsed:qe,toggleSidebarCollapse:Ue}=Jde({previewOpen:q}),{PREVIEW_WIDTH_KEY:Le,PREVIEW_MIN:le,previewDefaultWidth:F,previewMax:ne,previewWidth:te,previewPanelWidth:U,thinkingPanelText:Y,thinkingVisible:fe,openThinkingPanel:se,closeThinkingPanel:ce,compactionPanelText:j,compactionPanelVisible:G,openCompactionPanel:re,closeCompactionPanel:me,agentPanelMember:Ae,openAgentPanel:Ee,closeAgentPanel:ae,toolDiffTarget:Ce,openToolDiff:Xe,closeToolDiff:tt,detailDiffMode:xt,detailDiffPath:wt,openDiffDetail:It,closeDiffDetail:Wt,selectDiffFile:_t,btwVisible:Ht,openSideChatTab:$n,closeSideChat:Sn,sidePanelVisible:Vt,panelDragging:Kt,closeOpenSidePanel:Qn}=Yde({client:o,sideWidth:ze,detailTarget:C,closeFilePreview:R}),st=ee(null),Nn=ee(!1),et=ee(!1),Ke=ee(!1),Mt=ee(!1),Ft=ee(!1),vn=ee(!1),rn=ee(null),zt=ee(null),ms=W(()=>Aa.value>0||Nn.value||et.value||Ke.value||Mt.value||Ft.value||vn.value||b.value||a.value||c.value),Ln=ee(!1),yn=ee(!1),jn=ee(!1),zs=ee(!1),Pt=ee(!1);async function bs(){Ln.value=!0,yn.value=!1,Nn.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{yn.value=!0}finally{Ln.value=!1}}async function pn(){jn.value=!0,zs.value=!1,et.value=!0;try{await o.loadProviders()}catch{zs.value=!0}finally{jn.value=!1}}function Ns(){Ke.value=!0}async function Lo(dt){Nn.value=!1,await o.setModel(dt)}async function ti(dt){await o.addProvider(dt)}async function Je(dt){await o.deleteProvider(dt)}async function it(dt){await o.refreshProvider(dt)}async function at(dt){Pt.value=!0;try{await o.updateConfig(dt)&&await o.checkAuth()}finally{Pt.value=!1}}async function pt(){return o.startOAuthLogin()}async function ni(){return o.pollOAuthLogin()}async function hi(){return o.cancelOAuthLogin()}async function Ie(){Ke.value=!1,await o.checkAuth(),await o.load()}async function _e(dt){await o.undo(1),await vt(),st.value?.loadComposerForEdit(dt)}function Re(dt){if(dt==="/compact"||dt.startsWith("/compact ")){o.compact(dt.slice(8).trim()||void 0);return}if(dt==="/swarm"||dt.startsWith("/swarm ")){const he=dt.slice(6).trim();he==="on"?o.setSwarmMode(!0):he==="off"?o.setSwarmMode(!1):he?(o.setSwarmMode(!0),o.sendPrompt(he)):o.toggleSwarmMode();return}if(dt==="/goal"||dt.startsWith("/goal ")){const he=dt.slice(5).trim();he==="pause"||he==="resume"||he==="cancel"?o.controlGoal(he):he?o.createGoal(he):o.toggleGoalMode();return}if(dt==="/btw"||dt.startsWith("/btw ")){const he=dt.slice(4).trim();!he&&o.sideChatVisible.value?Sn():$n(he||void 0);return}switch(dt){case"/new":case"/clear":il();break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const he=o.permission.value,Ne=he==="manual"?"auto":he==="auto"?"yolo":"manual";o.setPermission(Ne);break}case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(_(o.thinking.value));break;case"/help":o.dismissWarning(-1);break;case"/status":Ft.value=!0;break;case"/model":bs();break;case"/provider":break;case"/login":Ns();break;default:{const he=dt.indexOf(" "),Ne=(he===-1?dt:dt.slice(0,he)).slice(1),Cn=he===-1?void 0:dt.slice(he+1).trim()||void 0;Ne&&o.activateSkill(Ne,Cn);break}}}function ln(dt){o.unqueue(dt)}function Ut(dt){o.unqueue(dt)}function as(dt){o.reorderQueue(dt.from,dt.to)}async function Bn(dt){const he=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&he){await o.startSessionAndSendPrompt(he,dt.text,dt.attachments);return}if(!o.activeSessionId.value&&!he){rn.value=dt,Mt.value=!0;return}o.sendPrompt(dt.text,dt.attachments)}async function vo(dt){if(zt.value=null,!await o.addWorkspaceByPath(dt)){zt.value=i("workspace.addFailed");return}Mt.value=!1;const Ne=rn.value;rn.value=null;const Cn=o.activeWorkspaceId.value;Ne&&Cn&&await o.startSessionAndSendPrompt(Cn,Ne.text,Ne.attachments)}function si(){rn.value=null,zt.value=null,Mt.value=!1}function gs(){vt(()=>{st.value?.focusComposer()})}function il(){const dt=o.activeWorkspaceId.value;dt?o.openWorkspaceDraft(dt):o.clearActiveSession(),gs()}function rl(dt){o.openWorkspaceDraft(dt),gs()}function gc(dt){dt&&window.open(dt,"_blank","noopener")}return(dt,he)=>(w(),N("div",ufe,[n.value?(w(),ve(cfe,{key:0})):ie("",!0),S(p)?(w(),N("section",dfe,[T("div",ffe,[(w(),N("svg",{ref_key:"authLogoRef",ref:h,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:he[0]||(he[0]=kt(()=>{},["prevent"])),onClick:he[1]||(he[1]=(...Ne)=>S(m)&&S(m)(...Ne))},[...he[94]||(he[94]=[Q1('<defs data-v-be38ef52><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-be38ef52><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-be38ef52></rect><g class="ch-eyes" fill="#000" data-v-be38ef52><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-be38ef52></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-be38ef52></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-be38ef52></rect>',2)])],544)),T("div",pfe,[T("h1",null,O(S(i)("app.authPageTitle")),1),T("p",null,O(S(i)("app.authPageMessage")),1)]),Z(Ot,{class:"auth-page-btn",variant:"primary",onClick:Ns},{default:de(()=>[Z(Ye,{name:"log-in",size:"md"}),T("span",null,O(S(i)("app.authPageLogin")),1)]),_:1})])])):(w(),N("div",{key:2,class:De(["app",{mobile:S(l),"sidebar-collapsed":S(ke)&&!S(l)}]),style:Qt({"--side-w":S(ze)+"px","--preview-w":S(U)+"px"})},[S(l)?(w(),ve(wie,{key:1,workspace:S(o).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:S(o).status.value.branch,"session-count":d.value,onOpenSwitcher:he[17]||(he[17]=Ne=>a.value=!0),onOpenSettings:he[18]||(he[18]=Ne=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),N(Pe,{key:0},[In(Z(Q8,{"col-width":S(ze),"active-workspace":S(o).visibleWorkspace.value,"active-workspace-id":S(o).activeWorkspaceId.value,sessions:S(o).sessionsForView.value,groups:S(o).workspaceGroups.value,"active-id":S(o).activeSessionId.value,"attention-by-session":S(o).attentionBySession.value,"pending-by-session":S(o).pendingBySession.value,"unread-by-session":S(o).unreadBySession.value,"workspace-sort-mode":S(o).workspaceSortMode.value,onSelect:he[2]||(he[2]=Ne=>S(o).selectSession(Ne)),onCreate:il,onCreateInWorkspace:he[3]||(he[3]=Ne=>rl(Ne)),onSelectWorkspace:he[4]||(he[4]=Ne=>S(o).openWorkspace(Ne)),onAddWorkspace:he[5]||(he[5]=Ne=>Mt.value=!0),onRename:he[6]||(he[6]=(Ne,Cn)=>S(o).renameSession(Ne,Cn)),onArchive:he[7]||(he[7]=Ne=>S(o).archiveSession(Ne)),onFork:he[8]||(he[8]=Ne=>S(o).forkSession(Ne)),onRenameWorkspace:he[9]||(he[9]=(Ne,Cn)=>S(o).renameWorkspace(Ne,Cn)),onDeleteWorkspace:he[10]||(he[10]=Ne=>S(o).deleteWorkspace(Ne)),onReorderWorkspaces:he[11]||(he[11]=Ne=>S(o).reorderWorkspaces(Ne)),onSetWorkspaceSortMode:he[12]||(he[12]=Ne=>S(o).setWorkspaceSortMode(Ne)),onLoadMoreSessions:he[13]||(he[13]=Ne=>void S(o).loadMoreSessions(Ne)),onLoadAllSessions:he[14]||(he[14]=Ne=>void S(o).loadAllSessions()),onOpenSettings:he[15]||(he[15]=Ne=>vn.value=!0),onCollapse:S(Ue)},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"]),[[Ko,!S(ke)]]),In(Z(m_,{"storage-key":S(Q),"default-width":S(X),min:S(ue),max:S(ge),"onUpdate:width":he[16]||(he[16]=Ne=>xe.value=Ne)},null,8,["storage-key","default-width","min","max"]),[[Ko,!S(ke)]]),S(ke)?(w(),N("div",hfe,[Z(ht,{text:S(i)("sidebar.expandSidebar")},{default:de(()=>[Z(dn,{size:"sm",label:S(i)("sidebar.expandSidebar"),onClick:S(Ue)},{default:de(()=>[Z(Ye,{name:"panel-expand",size:"sm"})]),_:1},8,["label","onClick"])]),_:1},8,["text"])])):ie("",!0)],64)),Z(qZ,{ref_key:"conversationPaneRef",ref:st,mobile:S(l),turns:S(o).turns.value,"session-id":S(o).activeSessionId.value,approvals:S(o).pendingApprovals.value,changes:S(o).changes.value,"git-info":S(o).gitInfo.value,tasks:S(o).tasks.value,todos:S(o).todos.value,goal:S(o).goal.value,swarms:S(o).swarms.value,"activation-badges":S(o).activationBadges.value,status:S(o).status.value,thinking:S(o).thinking.value,"plan-mode":S(o).planMode.value,"swarm-mode":S(o).swarmMode.value,"goal-mode":S(o).goalMode.value,models:S(o).models.value,"starred-ids":S(o).starredModelIds.value,skills:S(o).skills.value,questions:S(o).questions.value,"pending-question-actions":S(o).pendingQuestionActions,"pending-approval-actions":S(o).pendingApprovalActions,running:f.value,queued:S(o).queued.value,"search-files":S(o).searchFiles,"upload-image":S(o).uploadImage,sending:S(o).isSending.value,"fast-moon":S(o).fastMoon.value,"file-reload-key":S(o).activeSessionId.value,"session-loading":S(o).sessionLoading.value,compaction:S(o).compaction.value,"has-more-messages":S(o).hasMoreMessages.value,"loading-more":S(o).loadingMoreMessages.value,"loading-more-error":S(o).loadMoreMessagesError.value,"load-older-messages":S(o).loadOlderMessages,"workspace-name":S(o).visibleWorkspace.value?.name,"workspace-root":S(o).visibleWorkspace.value?.root??S(o).status.value.cwd,"git-diff-stats":S(o).gitDiffStats.value,workspaces:S(o).workspacesView.value,"active-workspace-id":S(o).activeWorkspaceId.value,"session-title":u.value,pr:S(o).activePullRequest.value,"conversation-toc":S(o).conversationToc.value,onOpenChanges:he[19]||(he[19]=Ne=>S(It)()),onSelectWorkspace:he[20]||(he[20]=Ne=>rl(Ne)),onAddWorkspace:he[21]||(he[21]=Ne=>Mt.value=!0),onOpenPr:gc,onSubmit:he[22]||(he[22]=Ne=>Bn(Ne)),onSteer:he[23]||(he[23]=Ne=>S(o).steerPrompt(Ne.text,Ne.attachments)),onApproval:he[24]||(he[24]=(Ne,Cn)=>S(o).respondApproval(Ne,Cn)),onCancelTask:he[25]||(he[25]=Ne=>S(o).cancelTask(Ne)),onAnswer:he[26]||(he[26]=(Ne,Cn)=>S(o).respondQuestion(Ne,Cn)),onDismiss:he[27]||(he[27]=Ne=>S(o).dismissQuestion(Ne)),onCommand:Re,onInterrupt:he[28]||(he[28]=Ne=>S(o).abortCurrentPrompt()),onUnqueue:ln,onEditQueued:Ut,onReorderQueue:as,onSetPermission:he[29]||(he[29]=Ne=>S(o).setPermission(Ne)),onSetThinking:he[30]||(he[30]=Ne=>S(o).setThinking(Ne)),onTogglePlan:he[31]||(he[31]=Ne=>S(o).togglePlanMode()),onToggleSwarm:he[32]||(he[32]=Ne=>S(o).toggleSwarmMode()),onToggleGoal:he[33]||(he[33]=Ne=>S(o).toggleGoalMode()),onCreateGoal:he[34]||(he[34]=Ne=>S(o).createGoal(Ne)),onControlGoal:he[35]||(he[35]=Ne=>S(o).controlGoal(Ne)),onRefreshGitStatus:he[36]||(he[36]=Ne=>S(o).activeSessionId.value&&S(o).loadGitStatus(S(o).activeSessionId.value)),onRenameSession:he[37]||(he[37]=(Ne,Cn)=>S(o).renameSession(Ne,Cn)),onForkSession:he[38]||(he[38]=Ne=>S(o).forkSession(Ne)),onArchiveSession:he[39]||(he[39]=Ne=>S(o).archiveSession(Ne)),onCompact:he[40]||(he[40]=Ne=>S(o).compact()),onPickModel:he[41]||(he[41]=Ne=>bs()),onSelectModel:he[42]||(he[42]=Ne=>S(o).setModel(Ne)),onOpenFile:he[43]||(he[43]=Ne=>S($)(Ne)),onOpenMedia:he[44]||(he[44]=Ne=>S(D)(Ne)),onOpenThinking:he[45]||(he[45]=Ne=>S(se)(Ne)),onOpenCompaction:he[46]||(he[46]=Ne=>S(re)(Ne)),onOpenAgent:he[47]||(he[47]=Ne=>S(Ee)(Ne)),onOpenToolDiff:he[48]||(he[48]=Ne=>S(Xe)(Ne)),onEditMessage:_e},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"]),S(Vt)&&!S(l)?(w(),ve(m_,{key:2,"storage-key":S(Le),"default-width":S(F),min:S(le),max:S(ne),reverse:"","aria-label":S(i)("layout.resizePreviewAria"),"onUpdate:width":he[49]||(he[49]=Ne=>te.value=Ne),"onUpdate:dragging":he[50]||(he[50]=Ne=>Kt.value=Ne)},null,8,["storage-key","default-width","min","max","aria-label"])):ie("",!0),!S(l)||S(Vt)?(w(),N("aside",{key:3,class:De(["global-preview",{open:S(Vt),mobile:S(l),"no-anim":S(Kt)||L.value}]),role:"complementary","aria-label":S(i)("layout.detailPanelAria"),"aria-hidden":!S(Vt)},[C.value==="thinking"&&S(fe)?(w(),ve(yC,{key:0,text:S(Y)??"",onClose:S(ce)},null,8,["text","onClose"])):C.value==="compaction"&&S(G)?(w(),ve(yC,{key:1,text:S(j)??"",subtitle:S(i)("conversation.summaryTitle"),onClose:S(me)},null,8,["text","subtitle","onClose"])):C.value==="agent"&&S(Ae)?(w(),ve(dee,{key:2,member:S(Ae),onClose:S(ae)},null,8,["member","onClose"])):C.value==="btw"&&S(Ht)?(w(),ve(Nee,{key:3,turns:S(o).sideChatTurns.value,running:S(o).sideChatRunning.value,sending:S(o).sideChatSending.value,onSend:he[51]||(he[51]=Ne=>S(o).sendSideChatPrompt(Ne)),onClose:S(Sn)},null,8,["turns","running","sending","onClose"])):C.value==="diff"?(w(),ve(rte,{key:4,mode:S(xt),changes:S(o).changes.value,"git-info":S(o).gitInfo.value,"file-diff":S(o).fileDiff.value,"selected-diff-path":S(o).selectedDiffPath.value,"file-diff-loading":S(o).fileDiffLoading.value,closable:"",onOpen:S(_t),onBack:he[52]||(he[52]=Ne=>{xt.value="list",wt.value=null,S(o).clearFileDiff()}),onClose:S(Wt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):C.value==="toolDiff"&&S(Ce)?(w(),ve(Cee,{key:5,target:S(Ce),onClose:S(tt)},null,8,["target","onClose"])):C.value==="file"?(w(),ve(VJ,{key:6,file:S(k),loading:S(M),error:S(E),line:S(I)?.line,"download-url":S(P),closable:"","external-actions":S(A),"open-file":S($),onClose:S(R),onOpenExternal:S(H),onReveal:S(z)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ie("",!0)],10,mfe)):ie("",!0),Nn.value?(w(),ve(xte,{key:4,models:S(o).models.value,current:S(o).status.value.modelId,"starred-ids":S(o).starredModelIds.value,loading:Ln.value,unavailable:yn.value,onSelect:he[53]||(he[53]=Ne=>Lo(Ne)),onToggleStar:he[54]||(he[54]=Ne=>S(o).toggleStarModel(Ne)),onClose:he[55]||(he[55]=Ne=>Nn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ie("",!0),vn.value?(w(),ve(foe,{key:5,"color-scheme":S(o).colorScheme.value,accent:S(o).accent.value,"ui-font-size":S(o).uiFontSize.value,"auth-ready":S(o).authReady.value,"account-model":S(o).defaultModel.value,notify:S(o).notifyOnComplete.value,"notify-question":S(o).notifyOnQuestion.value,"notify-permission":S(o).notifyPermission.value,sound:S(o).soundOnComplete.value,"conversation-toc":S(o).conversationToc.value,config:S(o).config.value,models:S(o).models.value,"config-saving":Pt.value,"server-version":S(o).serverVersion.value,onSetColorScheme:he[56]||(he[56]=Ne=>S(o).setColorScheme(Ne)),onSetAccent:he[57]||(he[57]=Ne=>S(o).setAccent(Ne)),onSetUiFontSize:he[58]||(he[58]=Ne=>S(o).setUiFontSize(Ne)),onSetNotify:he[59]||(he[59]=Ne=>S(o).setNotifyOnComplete(Ne)),onSetNotifyQuestion:he[60]||(he[60]=Ne=>S(o).setNotifyOnQuestion(Ne)),onSetSound:he[61]||(he[61]=Ne=>S(o).setSoundOnComplete(Ne)),onSetConversationToc:he[62]||(he[62]=Ne=>S(o).setConversationToc(Ne)),onUpdateConfig:he[63]||(he[63]=Ne=>at(Ne)),onLogin:he[64]||(he[64]=()=>{vn.value=!1,Ns()}),onLogout:S(o).logout,onOpenOnboarding:he[65]||(he[65]=()=>{vn.value=!1,v()}),onOpenProviders:he[66]||(he[66]=()=>{vn.value=!1,pn()}),onClose:he[67]||(he[67]=Ne=>vn.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),et.value?(w(),ve(Xte,{key:6,providers:S(o).providers.value,loading:jn.value,unavailable:zs.value,onAdd:he[68]||(he[68]=Ne=>ti(Ne)),onRefresh:he[69]||(he[69]=Ne=>it(Ne)),onDelete:he[70]||(he[70]=Ne=>Je(Ne)),onOpenLogin:he[71]||(he[71]=()=>{et.value=!1,Ns()}),onClose:he[72]||(he[72]=Ne=>et.value=!1)},null,8,["providers","loading","unavailable"])):ie("",!0),Ft.value?(w(),ve(tie,{key:7,status:S(o).status.value,thinking:S(o).thinking.value,"plan-mode":S(o).planMode.value,"swarm-mode":S(o).swarmMode.value,"cost-usd":S(o).sessionCost.value,onClose:he[73]||(he[73]=Ne=>Ft.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ie("",!0),Mt.value?(w(),ve(Foe,{key:8,"browse-fs":S(o).browseFs,"get-fs-home":S(o).getFsHome,"default-path":S(o).visibleWorkspace.value?.root??S(o).status.value.cwd,error:zt.value,onAdd:he[74]||(he[74]=Ne=>vo(Ne)),onClose:si},null,8,["browse-fs","get-fs-home","default-path","error"])):ie("",!0),Z(Vr,{name:"gload-fade"},{default:de(()=>[S(o).initialized.value?ie("",!0):(w(),ve(kle,{key:0}))]),_:1}),b.value&&!S(p)?(w(),ve(hle,{key:9,onComplete:g,onSkip:g})):ie("",!0),Z(pie,{warnings:S(o).warnings.value,onDismiss:S(o).dismissWarning},null,8,["warnings","onDismiss"]),S(r)?(w(),ve(Yle,{key:10})):ie("",!0),Z(Uoe),S(l)?(w(),ve(qie,{key:11,modelValue:a.value,"onUpdate:modelValue":he[75]||(he[75]=Ne=>a.value=Ne),groups:S(o).workspaceGroups.value,"active-workspace-id":S(o).activeWorkspaceId.value,"active-id":S(o).activeSessionId.value,"attention-by-session":S(o).attentionBySession.value,"attention-by-workspace":S(o).attentionByWorkspace.value,onSelect:he[76]||(he[76]=Ne=>S(o).selectSession(Ne)),onCreate:il,onCreateInWorkspace:he[77]||(he[77]=Ne=>rl(Ne)),onAddWorkspace:he[78]||(he[78]=Ne=>Mt.value=!0),onRename:he[79]||(he[79]=(Ne,Cn)=>S(o).renameSession(Ne,Cn)),onArchive:he[80]||(he[80]=Ne=>S(o).archiveSession(Ne)),onDeleteWorkspace:he[81]||(he[81]=Ne=>S(o).deleteWorkspace(Ne)),onLoadMore:he[82]||(he[82]=Ne=>void S(o).loadMoreSessions(Ne))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ie("",!0),S(l)?(w(),ve(Bre,{key:12,modelValue:c.value,"onUpdate:modelValue":he[83]||(he[83]=Ne=>c.value=Ne),status:S(o).status.value,thinking:S(o).thinking.value,"plan-mode":S(o).planMode.value,"swarm-mode":S(o).swarmMode.value,"color-scheme":S(o).colorScheme.value,"ui-font-size":S(o).uiFontSize.value,"auth-ready":S(o).authReady.value,"conversation-toc":S(o).conversationToc.value,"server-version":S(o).serverVersion.value,onPickModel:he[84]||(he[84]=Ne=>bs()),onSetThinking:he[85]||(he[85]=Ne=>S(o).setThinking(Ne)),onTogglePlan:he[86]||(he[86]=Ne=>S(o).togglePlanMode()),onToggleSwarm:he[87]||(he[87]=Ne=>S(o).toggleSwarmMode()),onSetPermission:he[88]||(he[88]=Ne=>S(o).setPermission(Ne)),onSetColorScheme:he[89]||(he[89]=Ne=>S(o).setColorScheme(Ne)),onSetUiFontSize:he[90]||(he[90]=Ne=>S(o).setUiFontSize(Ne)),onSetConversationToc:he[91]||(he[91]=Ne=>S(o).setConversationToc(Ne)),onLogin:he[92]||(he[92]=()=>{c.value=!1,Ns()}),onLogout:S(o).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ie("",!0)],6)),Ke.value?(w(),ve(Ane,{key:3,"on-start-o-auth-login":pt,"on-poll-o-auth-login":ni,"on-cancel-o-auth-login":hi,onSuccess:Ie,onClose:he[93]||(he[93]=Ne=>Ke.value=!1)})):ie("",!0)]))}}),vfe=ft(gfe,[["__scopeId","data-v-be38ef52"]]);Rne();np(vfe).use(zn).mount("#app");export{kI as $,j1 as A,c$ as B,ss as C,gpe as D,lx as E,Pe as F,Q1 as G,je as H,Z as I,zI as J,Hfe as K,Mi as L,Ve as M,O4 as N,jfe as O,Vfe as P,Yfe as Q,Bf as R,Ua as S,nh as T,Kfe as U,J1 as V,qfe as W,ype as X,Gfe as Y,dpe as Z,kfe as _,Rx as a,Bs as a$,$s as a0,P1 as a1,Tfe as a2,W1 as a3,i4 as a4,un as a5,uc as a6,Lfe as a7,_pe as a8,Dfe as a9,Hx as aA,b$ as aB,A$ as aC,_n as aD,x$ as aE,C$ as aF,O1 as aG,S$ as aH,wn as aI,z1 as aJ,KI as aK,w as aL,N4 as aM,$fe as aN,Pn as aO,xx as aP,Ife as aQ,Uf as aR,Es as aS,Wf as aT,ee as aU,ipe as aV,Q4 as aW,ot as aX,Tn as aY,M$ as aZ,zfe as a_,Wfe as aa,Ffe as ab,Bfe as ac,lpe as ad,wpe as ae,jt as af,d4 as ag,eh as ah,Fr as ai,nr as aj,Jn as ak,rpe as al,xo as am,jr as an,Or as ao,Zfe as ap,Jfe as aq,hn as ar,vt as as,g4 as at,De as au,yfe as av,Qt as aw,k$ as ax,w$ as ay,hs as az,Efe as b,lq as b$,hpe as b0,Cu as b1,Yf as b2,fpe as b3,qr as b4,BI as b5,_fe as b6,Yl as b7,e$ as b8,ppe as b9,go as bA,Ko as bB,f4 as bC,cpe as bD,Ge as bE,n$ as bF,Pfe as bG,s$ as bH,tpe as bI,de as bJ,Xfe as bK,In as bL,ai as bM,ape as bN,kt as bO,Nfe as bP,fn as bQ,ao as bR,$pe as bS,Xq as bT,MM as bU,Lpe as bV,xU as bW,V0 as bX,Npe as bY,e1 as bZ,Fpe as b_,bfe as ba,O as bb,vf as bc,Ufe as bd,Xt as be,Cfe as bf,Sfe as bg,Cx as bh,ope as bi,wfe as bj,S as bk,Zu as bl,bpe as bm,vpe as bn,D4 as bo,Ofe as bp,npe as bq,t$ as br,kpe as bs,Qfe as bt,Rfe as bu,Ox as bv,tp as bw,V4 as bx,T2 as by,Av as bz,upe as c,rq as c0,U0 as c1,iq as c2,Mpe as c3,yU as c4,Tpe as c5,Tp as c6,Cpe as c7,oq as c8,wM as c9,Bpe as ca,xpe as cb,Hpe as cc,r1 as cd,Oa as ce,o1 as cf,zpe as cg,Wpe as ch,Ipe as ci,wo as cj,Ape as ck,Epe as cl,TU as cm,Dpe as cn,i1 as co,s1 as cp,Rpe as cq,Spe as cr,Ope as cs,Ppe as ct,spe as d,Wr as e,xfe as f,Vr as g,W4 as h,Afe as i,Mfe as j,Zo as k,Yu as l,ps as m,Vp as n,sr as o,mpe as p,W as q,np as r,ve as s,ie as t,N as u,T as v,X$ as w,epe as x,Y$ as y,Z4 as z};
|