@moonshot-ai/kimi-code 0.23.6 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/main.mjs +94545 -41570
  2. package/dist-web/assets/{CodeBlockNode-B5sM5iYb.js → CodeBlockNode--cMVMvaD.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-DJ0XaWcQ.js → CodeBlockShell.vue_vue_type_style_index_0_lang-DkL0l1V_.js} +1 -1
  4. package/dist-web/assets/DesignSystemView-Dyj5tvMI.css +1 -0
  5. package/dist-web/assets/DesignSystemView-GbzPebf3.js +13 -0
  6. package/dist-web/assets/{Tooltip-BzkYFuS-.js → Tooltip-Ck9N0lEl.js} +1 -1
  7. package/dist-web/assets/{arc-hZy2ybJx.js → arc-BWGqy2UA.js} +1 -1
  8. package/dist-web/assets/{architectureDiagram-3BPJPVTR-Dme2VOsk.js → architectureDiagram-3BPJPVTR-mUgmRLbZ.js} +1 -1
  9. package/dist-web/assets/{blockDiagram-GPEHLZMM-DPYxkkxc.js → blockDiagram-GPEHLZMM-R0PSMA9C.js} +1 -1
  10. package/dist-web/assets/{c4Diagram-AAUBKEIU-BaBOqczU.js → c4Diagram-AAUBKEIU-CbRoqn4Y.js} +1 -1
  11. package/dist-web/assets/channel-Dkvx9pgo.js +1 -0
  12. package/dist-web/assets/{chunk-2J33WTMH-D12pYaz9.js → chunk-2J33WTMH-BgdbLCzY.js} +1 -1
  13. package/dist-web/assets/{chunk-4BX2VUAB-BXPJT0AD.js → chunk-4BX2VUAB-BjVqrZsb.js} +1 -1
  14. package/dist-web/assets/{chunk-55IACEB6-BTJjSIMx.js → chunk-55IACEB6-vfTspjvT.js} +1 -1
  15. package/dist-web/assets/{chunk-727SXJPM-BorazSkv.js → chunk-727SXJPM-BOx5PWA4.js} +1 -1
  16. package/dist-web/assets/{chunk-AQP2D5EJ-3eB1WiGE.js → chunk-AQP2D5EJ-B1E9C4Td.js} +1 -1
  17. package/dist-web/assets/{chunk-FMBD7UC4-BN6eq3TW.js → chunk-FMBD7UC4-Df1Y6ISb.js} +1 -1
  18. package/dist-web/assets/{chunk-ND2GUHAM-CzHkIi39.js → chunk-ND2GUHAM-Bez1HURS.js} +1 -1
  19. package/dist-web/assets/{chunk-QZHKN3VN-CAAkvUsl.js → chunk-QZHKN3VN-tkKX6Q71.js} +1 -1
  20. package/dist-web/assets/classDiagram-4FO5ZUOK-D2Bct7OK.js +1 -0
  21. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-D2Bct7OK.js +1 -0
  22. package/dist-web/assets/{cose-bilkent-S5V4N54A-CO12pcZF.js → cose-bilkent-S5V4N54A-CJ2MVt0e.js} +1 -1
  23. package/dist-web/assets/{dagre-BM42HDAG-BHHr0pRl.js → dagre-BM42HDAG-OTtBLo46.js} +1 -1
  24. package/dist-web/assets/{diagram-2AECGRRQ-OR0kYM7N.js → diagram-2AECGRRQ-XiNyaYnO.js} +1 -1
  25. package/dist-web/assets/{diagram-5GNKFQAL-BuWjKSqL.js → diagram-5GNKFQAL-BlIfSHzF.js} +1 -1
  26. package/dist-web/assets/{diagram-KO2AKTUF-VPe8ZEiS.js → diagram-KO2AKTUF-nsDPaMCq.js} +1 -1
  27. package/dist-web/assets/{diagram-LMA3HP47-BvTXlHih.js → diagram-LMA3HP47-Dzs1NlAK.js} +1 -1
  28. package/dist-web/assets/{diagram-OG6HWLK6-goJtZNF9.js → diagram-OG6HWLK6-DS7pZXR7.js} +1 -1
  29. package/dist-web/assets/{erDiagram-TEJ5UH35-DRnuyJ1R.js → erDiagram-TEJ5UH35-DVBSYJWC.js} +1 -1
  30. package/dist-web/assets/{flowDiagram-I6XJVG4X-CWAtDH7Q.js → flowDiagram-I6XJVG4X-BfI6v7Fm.js} +1 -1
  31. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DpNy6QeS.js → ganttDiagram-6RSMTGT7-DeQxHXH6.js} +1 -1
  32. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-D7ekpdjQ.js → gitGraphDiagram-PVQCEYII-AwCWO2qH.js} +1 -1
  33. package/dist-web/assets/{index-BPhahMpb.js → index-4XDR0dLV.js} +1 -1
  34. package/dist-web/assets/index-DILMH5vD.js +325 -0
  35. package/dist-web/assets/{index-De7eXGys.js → index-bBT3xvAJ.js} +2 -2
  36. package/dist-web/assets/index-fzG0L2x7.css +1 -0
  37. package/dist-web/assets/{index10-B4kCqL2q.js → index10-CEkQu_GO.js} +1 -1
  38. package/dist-web/assets/{index11-CdYjVQZ3.js → index11-CQsnWOL1.js} +1 -1
  39. package/dist-web/assets/{index5-CuGXaX2S.js → index5-D3mN0q-1.js} +1 -1
  40. package/dist-web/assets/{index6-Bu6r1Fdb.js → index6-X2_QEqKR.js} +1 -1
  41. package/dist-web/assets/{index7-BBWbs1u4.js → index7-DwTyDXWL.js} +1 -1
  42. package/dist-web/assets/{index8-B1e6fpQC.js → index8-DVszZ_QU.js} +2 -2
  43. package/dist-web/assets/{infoDiagram-5YYISTIA-DWJMi_CT.js → infoDiagram-5YYISTIA-DcvFupZ9.js} +1 -1
  44. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-DKnaDM-v.js → ishikawaDiagram-YF4QCWOH-Dr_9jlZ2.js} +1 -1
  45. package/dist-web/assets/{journeyDiagram-JHISSGLW-CuTF_v7K.js → journeyDiagram-JHISSGLW-B8Bl1l7f.js} +1 -1
  46. package/dist-web/assets/{kanban-definition-UN3LZRKU-7ZkgOrqm.js → kanban-definition-UN3LZRKU-DEsZeBp1.js} +1 -1
  47. package/dist-web/assets/{linear-BZuIfHuU.js → linear-D1XVpWDR.js} +1 -1
  48. package/dist-web/assets/{mermaid.core-BU-yVv7K.js → mermaid.core-BkZly3Xv.js} +4 -4
  49. package/dist-web/assets/{mindmap-definition-RKZ34NQL-DME_lWCk.js → mindmap-definition-RKZ34NQL-Bna83V-D.js} +1 -1
  50. package/dist-web/assets/{pieDiagram-4H26LBE5-Co1VItYc.js → pieDiagram-4H26LBE5-Cam9RjI7.js} +1 -1
  51. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DpswDnET.js → quadrantDiagram-W4KKPZXB-oC9ccOFM.js} +1 -1
  52. package/dist-web/assets/{requirementDiagram-4Y6WPE33-BeRdWb9K.js → requirementDiagram-4Y6WPE33-DfFS2yCW.js} +1 -1
  53. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-_DYbW6pt.js → sankeyDiagram-5OEKKPKP-BVdOnz7E.js} +1 -1
  54. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-DHiijecn.js → sequenceDiagram-3UESZ5HK-Dru_zABA.js} +1 -1
  55. package/dist-web/assets/{stateDiagram-AJRCARHV-DCZ1rX02.js → stateDiagram-AJRCARHV-CkaDYGbg.js} +1 -1
  56. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BZhwJEM-.js +1 -0
  57. package/dist-web/assets/{timeline-definition-PNZ67QCA-CUBRS-qH.js → timeline-definition-PNZ67QCA-CcLLZupA.js} +1 -1
  58. package/dist-web/assets/{vennDiagram-CIIHVFJN-C98FTG2Y.js → vennDiagram-CIIHVFJN-DJuDAa8E.js} +1 -1
  59. package/dist-web/assets/{vue.runtime.esm-bundler-DPzO-Tma.js → vue.runtime.esm-bundler-D8_2k_mF.js} +1 -1
  60. package/dist-web/assets/{wardley-L42UT6IY-Bmyzb8p9.js → wardley-L42UT6IY-CDHFB4H4.js} +1 -1
  61. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-CxFNYY1a.js → wardleyDiagram-YWT4CUSO-D5_Z1oK0.js} +1 -1
  62. package/dist-web/assets/{xychartDiagram-2RQKCTM6-ySyVEQA-.js → xychartDiagram-2RQKCTM6-CFW74y_e.js} +1 -1
  63. package/dist-web/index.html +2 -2
  64. package/package.json +14 -10
  65. package/dist-web/assets/DesignSystemView-CrA0fNau.js +0 -13
  66. package/dist-web/assets/DesignSystemView-prdQJClv.css +0 -1
  67. package/dist-web/assets/channel--SU3IV4L.js +0 -1
  68. package/dist-web/assets/classDiagram-4FO5ZUOK-Cev__UDN.js +0 -1
  69. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Cev__UDN.js +0 -1
  70. package/dist-web/assets/index-DZAkQfN3.js +0 -322
  71. package/dist-web/assets/index-u0HjHtha.css +0 -1
  72. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Cw0BsNEk.js +0 -1
@@ -0,0 +1,325 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-GbzPebf3.js","assets/DesignSystemView-Dyj5tvMI.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode--cMVMvaD.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-DkL0l1V_.js","assets/index8-DVszZ_QU.js","assets/index11-CQsnWOL1.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 zp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Jt={},Sc=[],vi=()=>{},n4=()=>!1,Od=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Up=e=>e.startsWith("onUpdate:"),wn=Object.assign,ny=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},rE=Object.prototype.hasOwnProperty,dn=(e,t)=>rE.call(e,t),_t=Array.isArray,Cc=e=>Qc(e)==="[object Map]",Ea=e=>Qc(e)==="[object Set]",Cb=e=>Qc(e)==="[object Date]",lE=e=>Qc(e)==="[object RegExp]",$t=e=>typeof e=="function",En=e=>typeof e=="string",ei=e=>typeof e=="symbol",fn=e=>e!==null&&typeof e=="object",sy=e=>(fn(e)||$t(e))&&$t(e.then)&&$t(e.catch),s4=Object.prototype.toString,Qc=e=>s4.call(e),aE=e=>Qc(e).slice(8,-1),qp=e=>Qc(e)==="[object Object]",jp=e=>En(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ma=zp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},cE=/-\w/g,Fs=Vp(e=>e.replace(cE,t=>t.slice(1).toUpperCase())),uE=/\B([A-Z])/g,$o=Vp(e=>e.replace(uE,"-$1").toLowerCase()),Kp=Vp(e=>e.charAt(0).toUpperCase()+e.slice(1)),rh=Vp(e=>e?`on${Kp(e)}`:""),js=(e,t)=>!Object.is(e,t),Ac=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},o4=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Gp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Th=e=>{const t=En(e)?Number(e):NaN;return isNaN(t)?e:t};let Ab;const Yp=()=>Ab||(Ab=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),dE="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",fE=zp(dE);function Gt(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=En(s)?gE(s):Gt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(En(e)||fn(e))return e}const hE=/;(?![^(]*\))/g,pE=/:([^]+)/,mE=/\/\*[^]*?\*\//g;function gE(e){const t={};return e.replace(mE,"").split(hE).forEach(n=>{if(n){const s=n.split(pE);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Pe(e){let t="";if(En(e))t=e;else if(_t(e))for(let n=0;n<e.length;n++){const s=Pe(e[n]);s&&(t+=s+" ")}else if(fn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function dxe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!En(t)&&(e.class=Pe(t)),n&&(e.style=Gt(n)),e}const vE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",yE=zp(vE);function i4(e){return!!e||e===""}function kE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Lr(e[s],t[s]);return n}function Lr(e,t){if(e===t)return!0;let n=Cb(e),s=Cb(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=ei(e),s=ei(t),n||s)return e===t;if(n=_t(e),s=_t(t),n||s)return n&&s?kE(e,t):!1;if(n=fn(e),s=fn(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||!Lr(e[r],t[r]))return!1}}return String(e)===String(t)}function Zp(e,t){return e.findIndex(n=>Lr(n,t))}const r4=e=>!!(e&&e.__v_isRef===!0),O=e=>En(e)?e:e==null?"":_t(e)||fn(e)&&(e.toString===s4||!$t(e.toString))?r4(e)?O(e.value):JSON.stringify(e,l4,2):String(e),l4=(e,t)=>r4(t)?l4(e,t.value):Cc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[U1(s,i)+" =>"]=o,n),{})}:Ea(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>U1(n))}:ei(t)?U1(t):fn(t)&&!_t(t)&&!qp(t)?String(t):t,U1=(e,t="")=>{var n;return ei(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function bE(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 $s;class a4{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&&$s&&($s.active?(this.parent=$s,this.index=($s.scopes||($s.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=$s;try{return $s=this,t()}finally{$s=n}}}on(){++this._on===1&&(this.prevScope=$s,$s=this)}off(){if(this._on>0&&--this._on===0){if($s===this)$s=this.prevScope;else{let t=$s;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 xE(e){return new a4(e)}function oy(){return $s}function iy(e,t=!1){$s&&$s.cleanups.push(e)}let Bn;const q1=new WeakSet;class Nh{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,$s&&($s.active?$s.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,q1.has(this)&&(q1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||u4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Mb(this),d4(this);const t=Bn,n=Li;Bn=this,Li=!0;try{return this.fn()}finally{f4(this),Bn=t,Li=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ay(t);this.deps=this.depsTail=void 0,Mb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?q1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){wg(this)&&this.run()}get dirty(){return wg(this)}}let c4=0,Uu,qu;function u4(e,t=!1){if(e.flags|=8,t){e.next=qu,qu=e;return}e.next=Uu,Uu=e}function ry(){c4++}function ly(){if(--c4>0)return;if(qu){let t=qu;for(qu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Uu;){let t=Uu;for(Uu=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 d4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function f4(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),ay(s),_E(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function wg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(h4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function h4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ad)||(e.globalVersion=ad,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!wg(e))))return;e.flags|=2;const t=e.dep,n=Bn,s=Li;Bn=e,Li=!0;try{d4(e);const o=e.fn(e._value);(t.version===0||js(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Bn=n,Li=s,f4(e),e.flags&=-3}}function ay(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)ay(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function _E(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function fxe(e,t){e.effect instanceof Nh&&(e=e.effect.fn);const n=new Nh(e);t&&wn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function hxe(e){e.effect.stop()}let Li=!0;const p4=[];function Fr(){p4.push(Li),Li=!1}function Or(){const e=p4.pop();Li=e===void 0?!0:e}function Mb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Bn;Bn=void 0;try{t()}finally{Bn=n}}}let ad=0;class wE{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 Qp{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(!Bn||!Li||Bn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Bn)n=this.activeLink=new wE(Bn,this),Bn.deps?(n.prevDep=Bn.depsTail,Bn.depsTail.nextDep=n,Bn.depsTail=n):Bn.deps=Bn.depsTail=n,m4(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=Bn.depsTail,n.nextDep=void 0,Bn.depsTail.nextDep=n,Bn.depsTail=n,Bn.deps===n&&(Bn.deps=s)}return n}trigger(t){this.version++,ad++,this.notify(t)}notify(t){ry();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ly()}}}function m4(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)m4(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ih=new WeakMap,ga=Symbol(""),Sg=Symbol(""),cd=Symbol("");function so(e,t,n){if(Li&&Bn){let s=Ih.get(e);s||Ih.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Qp),o.map=s,o.key=n),o.track()}}function Sr(e,t,n,s,o,i){const r=Ih.get(e);if(!r){ad++;return}const l=a=>{a&&a.trigger()};if(ry(),t==="clear")r.forEach(l);else{const a=_t(e),c=a&&jp(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===cd||!ei(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(cd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ga)),Cc(e)&&l(r.get(Sg)));break;case"delete":a||(l(r.get(ga)),Cc(e)&&l(r.get(Sg)));break;case"set":Cc(e)&&l(r.get(ga));break}}ly()}function SE(e,t){const n=Ih.get(e);return n&&n.get(t)}function Ya(e){const t=on(e);return t===e?t:(so(t,"iterate",cd),Go(e)?t:t.map(Oi))}function Xp(e){return so(e=on(e),"iterate",cd),e}function Qi(e,t){return Rr(e)?Wc(bl(e)?Oi(t):t):Oi(t)}const CE={__proto__:null,[Symbol.iterator](){return j1(this,Symbol.iterator,e=>Qi(this,e))},concat(...e){return Ya(this).concat(...e.map(t=>_t(t)?Ya(t):t))},entries(){return j1(this,"entries",e=>(e[1]=Qi(this,e[1]),e))},every(e,t){return dr(this,"every",e,t,void 0,arguments)},filter(e,t){return dr(this,"filter",e,t,n=>n.map(s=>Qi(this,s)),arguments)},find(e,t){return dr(this,"find",e,t,n=>Qi(this,n),arguments)},findIndex(e,t){return dr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return dr(this,"findLast",e,t,n=>Qi(this,n),arguments)},findLastIndex(e,t){return dr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return dr(this,"forEach",e,t,void 0,arguments)},includes(...e){return V1(this,"includes",e)},indexOf(...e){return V1(this,"indexOf",e)},join(e){return Ya(this).join(e)},lastIndexOf(...e){return V1(this,"lastIndexOf",e)},map(e,t){return dr(this,"map",e,t,void 0,arguments)},pop(){return wu(this,"pop")},push(...e){return wu(this,"push",e)},reduce(e,...t){return Eb(this,"reduce",e,t)},reduceRight(e,...t){return Eb(this,"reduceRight",e,t)},shift(){return wu(this,"shift")},some(e,t){return dr(this,"some",e,t,void 0,arguments)},splice(...e){return wu(this,"splice",e)},toReversed(){return Ya(this).toReversed()},toSorted(e){return Ya(this).toSorted(e)},toSpliced(...e){return Ya(this).toSpliced(...e)},unshift(...e){return wu(this,"unshift",e)},values(){return j1(this,"values",e=>Qi(this,e))}};function j1(e,t,n){const s=Xp(e),o=s[t]();return s!==e&&!Go(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const AE=Array.prototype;function dr(e,t,n,s,o,i){const r=Xp(e),l=r!==e&&!Go(e),a=r[t];if(a!==AE[t]){const d=a.apply(e,i);return l?Oi(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Qi(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 Eb(e,t,n,s){const o=Xp(e),i=o!==e&&!Go(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Qi(e,c)),n.call(this,c,Qi(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?Qi(e,a):a}function V1(e,t,n){const s=on(e);so(s,"iterate",cd);const o=s[t](...n);return(o===-1||o===!1)&&tm(n[0])?(n[0]=on(n[0]),s[t](...n)):o}function wu(e,t,n=[]){Fr(),ry();const s=on(e)[t].apply(e,n);return ly(),Or(),s}const ME=zp("__proto__,__v_isRef,__isVue"),g4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ei));function EE(e){ei(e)||(e=String(e));const t=on(this);return so(t,"has",e),t.hasOwnProperty(e)}class v4{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?w4:_4:i?x4:b4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=_t(t);if(!o){let a;if(r&&(a=CE[n]))return a;if(n==="hasOwnProperty")return EE}const l=Reflect.get(t,n,ps(t)?t:s);if((ei(n)?g4.has(n):ME(n))||(o||so(t,"get",n),i))return l;if(ps(l)){const a=r&&jp(n)?l:l.value;return o&&fn(a)?$h(a):a}return fn(l)?o?$h(l):Ps(l):l}}class y4 extends v4{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=_t(t)&&jp(n);if(!this._isShallow){const c=Rr(i);if(!Go(s)&&!Rr(s)&&(i=on(i),s=on(s)),!r&&ps(i)&&!ps(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:dn(t,n),a=Reflect.set(t,n,s,ps(t)?t:o);return t===on(o)&&(l?js(s,i)&&Sr(t,"set",n,s):Sr(t,"add",n,s)),a}deleteProperty(t,n){const s=dn(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Sr(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!ei(n)||!g4.has(n))&&so(t,"has",n),s}ownKeys(t){return so(t,"iterate",_t(t)?"length":ga),Reflect.ownKeys(t)}}class k4 extends v4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const TE=new y4,NE=new k4,IE=new y4(!0),$E=new k4(!0),Cg=e=>e,bf=e=>Reflect.getPrototypeOf(e);function LE(e,t,n){return function(...s){const o=this.__v_raw,i=on(o),r=Cc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?Cg:t?Wc:Oi;return!t&&so(i,"iterate",a?Sg:ga),wn(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 xf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function FE(e,t){const n={get(o){const i=this.__v_raw,r=on(i),l=on(o);e||(js(o,l)&&so(r,"get",o),so(r,"get",l));const{has:a}=bf(r),c=t?Cg:e?Wc:Oi;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&&so(on(o),"iterate",ga),o.size},has(o){const i=this.__v_raw,r=on(i),l=on(o);return e||(js(o,l)&&so(r,"has",o),so(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=on(l),c=t?Cg:e?Wc:Oi;return!e&&so(a,"iterate",ga),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return wn(n,e?{add:xf("add"),set:xf("set"),delete:xf("delete"),clear:xf("clear")}:{add(o){const i=on(this),r=bf(i),l=on(o),a=!t&&!Go(o)&&!Rr(o)?l:o;return r.has.call(i,a)||js(o,a)&&r.has.call(i,o)||js(l,a)&&r.has.call(i,l)||(i.add(a),Sr(i,"add",a,a)),this},set(o,i){!t&&!Go(i)&&!Rr(i)&&(i=on(i));const r=on(this),{has:l,get:a}=bf(r);let c=l.call(r,o);c||(o=on(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?js(i,u)&&Sr(r,"set",o,i):Sr(r,"add",o,i),this},delete(o){const i=on(this),{has:r,get:l}=bf(i);let a=r.call(i,o);a||(o=on(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Sr(i,"delete",o,void 0),c},clear(){const o=on(this),i=o.size!==0,r=o.clear();return i&&Sr(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=LE(o,e,t)}),n}function Jp(e,t){const n=FE(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(dn(n,o)&&o in s?n:s,o,i)}const OE={get:Jp(!1,!1)},RE={get:Jp(!1,!0)},BE={get:Jp(!0,!1)},DE={get:Jp(!0,!0)},b4=new WeakMap,x4=new WeakMap,_4=new WeakMap,w4=new WeakMap;function PE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ps(e){return Rr(e)?e:em(e,!1,TE,OE,b4)}function HE(e){return em(e,!1,IE,RE,x4)}function $h(e){return em(e,!0,NE,BE,_4)}function pxe(e){return em(e,!0,$E,DE,w4)}function em(e,t,n,s,o){if(!fn(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=PE(aE(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function bl(e){return Rr(e)?bl(e.__v_raw):!!(e&&e.__v_isReactive)}function Rr(e){return!!(e&&e.__v_isReadonly)}function Go(e){return!!(e&&e.__v_isShallow)}function tm(e){return e?!!e.__v_raw:!1}function on(e){const t=e&&e.__v_raw;return t?on(t):e}function mt(e){return!dn(e,"__v_skip")&&Object.isExtensible(e)&&o4(e,"__v_skip",!0),e}const Oi=e=>fn(e)?Ps(e):e,Wc=e=>fn(e)?$h(e):e;function ps(e){return e?e.__v_isRef===!0:!1}function Q(e){return S4(e,!1)}function Ta(e){return S4(e,!0)}function S4(e,t){return ps(e)?e:new WE(e,t)}class WE{constructor(t,n){this.dep=new Qp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:on(t),this._value=n?t:Oi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Go(t)||Rr(t);t=s?t:on(t),js(t,n)&&(this._rawValue=t,this._value=s?t:Oi(t),this.dep.trigger())}}function mxe(e){e.dep&&e.dep.trigger()}function C(e){return ps(e)?e.value:e}function C4(e){return $t(e)?e():C(e)}const zE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return ps(o)&&!ps(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function A4(e){return bl(e)?e:new Proxy(e,zE)}class UE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Qp,{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 qE(e){return new UE(e)}function gxe(e){const t=_t(e)?new Array(e.length):{};for(const n in e)t[n]=M4(e,n);return t}class jE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=ei(n)?n:String(n),this._raw=on(t);let o=!0,i=t;if(!_t(t)||ei(this._key)||!jp(this._key))do o=!tm(i)||Go(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ps(this._raw[this._key])){const n=this._object[this._key];if(ps(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return SE(this._raw,this._key)}}class VE{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 vxe(e,t,n){return ps(e)?e:$t(e)?new VE(e):fn(e)&&arguments.length>1?M4(e,t,n):Q(e)}function M4(e,t,n){return new jE(e,t,n)}class KE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ad-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Bn!==this)return u4(this,!0),!0}get value(){const t=this.dep.track();return h4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function GE(e,t,n=!1){let s,o;return $t(e)?s=e:(s=e.get,o=e.set),new KE(s,o,n)}const yxe={GET:"get",HAS:"has",ITERATE:"iterate"},kxe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},_f={},Lh=new WeakMap;let ul;function bxe(){return ul}function YE(e,t=!1,n=ul){if(n){let s=Lh.get(n);s||Lh.set(n,s=[]),s.push(e)}}function ZE(e,t,n=Jt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Go(y)||o===!1||o===0?Cr(y,1):Cr(y);let u,d,f,h,p=!1,m=!1;if(ps(e)?(d=()=>e.value,p=Go(e)):bl(e)?(d=()=>c(e),p=!0):_t(e)?(m=!0,p=e.some(y=>bl(y)||Go(y)),d=()=>e.map(y=>{if(ps(y))return y.value;if(bl(y))return c(y);if($t(y))return a?a(y,2):y()})):$t(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Fr();try{f()}finally{Or()}}const y=ul;ul=u;try{return a?a(e,3,[h]):e(h)}finally{ul=y}}:d=vi,t&&o){const y=d,M=o===!0?1/0:o;d=()=>Cr(y(),M)}const x=oy(),k=()=>{u.stop(),x&&x.active&&ny(x.effects,u)};if(i&&t){const y=t;t=(...M)=>{y(...M),k()}}let g=m?new Array(e.length).fill(_f):_f;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const M=u.run();if(o||p||(m?M.some((L,$)=>js(L,g[$])):js(M,g))){f&&f();const L=ul;ul=u;try{const $=[M,g===_f?void 0:m&&g[0]===_f?[]:g,h];g=M,a?a(t,3,$):t(...$)}finally{ul=L}}}else u.run()};return l&&l(v),u=new Nh(d),u.scheduler=r?()=>r(v,!1):v,h=y=>YE(y,!1,u),f=u.onStop=()=>{const y=Lh.get(u);if(y){if(a)a(y,4);else for(const M of y)M();Lh.delete(u)}},t?s?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),k.pause=u.pause.bind(u),k.resume=u.resume.bind(u),k.stop=k,k}function Cr(e,t=1/0,n){if(t<=0||!fn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ps(e))Cr(e.value,t,n);else if(_t(e))for(let s=0;s<e.length;s++)Cr(e[s],t,n);else if(Ea(e)||Cc(e))e.forEach(s=>{Cr(s,t,n)});else if(qp(e)){for(const s in e)Cr(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Cr(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 E4=[];function QE(e){E4.push(e)}function XE(){E4.pop()}function xxe(e,t){}const _xe={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"},JE={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 Rd(e,t,n,s){try{return s?e(...s):e()}catch(o){Xc(o,t,n)}}function bi(e,t,n,s){if($t(e)){const o=Rd(e,t,n,s);return o&&sy(o)&&o.catch(i=>{Xc(i,t,n)}),o}if(_t(e)){const o=[];for(let i=0;i<e.length;i++)o.push(bi(e[i],t,n,s));return o}}function Xc(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Jt;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){Fr(),Rd(i,null,10,[e,a,c]),Or();return}}eT(e,n,o,s,r)}function eT(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const po=[];let Gi=-1;const Mc=[];let dl=null,lc=0;const T4=Promise.resolve();let Fh=null;function gt(e){const t=Fh||T4;return e?t.then(this?e.bind(this):e):t}function tT(e){let t=Gi+1,n=po.length;for(;t<n;){const s=t+n>>>1,o=po[s],i=ud(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function cy(e){if(!(e.flags&1)){const t=ud(e),n=po[po.length-1];!n||!(e.flags&2)&&t>=ud(n)?po.push(e):po.splice(tT(t),0,e),e.flags|=1,N4()}}function N4(){Fh||(Fh=T4.then(I4))}function Oh(e){_t(e)?Mc.push(...e):dl&&e.id===-1?dl.splice(lc+1,0,e):e.flags&1||(Mc.push(e),e.flags|=1),N4()}function Tb(e,t,n=Gi+1){for(;n<po.length;n++){const s=po[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;po.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Rh(e){if(Mc.length){const t=[...new Set(Mc)].sort((n,s)=>ud(n)-ud(s));if(Mc.length=0,dl){dl.push(...t);return}for(dl=t,lc=0;lc<dl.length;lc++){const n=dl[lc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}dl=null,lc=0}}const ud=e=>e.id==null?e.flags&2?-1:1/0:e.id;function I4(e){try{for(Gi=0;Gi<po.length;Gi++){const t=po[Gi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Rd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Gi<po.length;Gi++){const t=po[Gi];t&&(t.flags&=-2)}Gi=-1,po.length=0,Rh(),Fh=null,(po.length||Mc.length)&&I4()}}let ac,wf=[];function $4(e,t){var n,s;ac=e,ac?(ac.enabled=!0,wf.forEach(({event:o,args:i})=>ac.emit(o,...i)),wf=[]):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=>{$4(i,t)}),setTimeout(()=>{ac||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,wf=[])},3e3)):wf=[]}let Gs=null,nm=null;function dd(e){const t=Gs;return Gs=e,nm=e&&e.type.__scopeId||null,t}function wxe(e){nm=e}function Sxe(){nm=null}const Cxe=e=>Me;function Me(e,t=Gs,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Wh(-1);const i=dd(t);let r;try{r=e(...o)}finally{dd(i),s._d&&Wh(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Ln(e,t){if(Gs===null)return e;const n=Hd(Gs),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Jt]=t[o];i&&($t(i)&&(i={mounted:i,updated:i}),i.deep&&Cr(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Yi(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&&(Fr(),bi(a,n,8,[e.el,l,e,t]),Or())}}function In(e,t){if(Ks){let n=Ks.provides;const s=Ks.parent&&Ks.parent.provides;s===n&&(n=Ks.provides=Object.create(s)),n[e]=t}}function Vt(e,t,n=!1){const s=Ys();if(s||va){let o=va?va._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&$t(t)?t.call(s&&s.proxy):t}}function Axe(){return!!(Ys()||va)}const nT=Symbol.for("v-scx"),sT=()=>Vt(nT);function oT(e,t){return Bd(e,null,t)}function Mxe(e,t){return Bd(e,null,{flush:"post"})}function iT(e,t){return Bd(e,null,{flush:"sync"})}function Qe(e,t,n){return Bd(e,t,n)}function Bd(e,t,n=Jt){const{immediate:s,deep:o,flush:i,once:r}=n,l=wn({},n),a=t&&s||!t&&i!=="post";let c;if(_a){if(i==="sync"){const h=sT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=vi,h.resume=vi,h.pause=vi,h}}const u=Ks;l.call=(h,p,m)=>bi(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{ks(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():cy(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=ZE(e,t,l);return _a&&(c?c.push(f):a&&f()),f}function rT(e,t,n){const s=this.proxy,o=En(e)?e.includes(".")?L4(s,e):()=>s[e]:e.bind(s,s);let i;$t(t)?i=t:(i=t.handler,n=t);const r=Jc(this),l=Bd(o,i.bind(s),n);return r(),l}function L4(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 ll=new WeakMap,F4=Symbol("_vte"),O4=e=>e.__isTeleport,ra=e=>e&&(e.disabled||e.disabled===""),lT=e=>e&&(e.defer||e.defer===""),Nb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Ib=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ag=(e,t)=>{const n=e&&e.to;return En(n)?t?t(n):null:n},aT={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:x,parentNode:k}}=c,g=ra(t.props);let{dynamicChildren:v}=t;const y=($,_,E)=>{$.shapeFlag&16&&u($.children,_,E,o,i,r,l,a)},M=($=t)=>{const _=ra($.props),E=$.target=Ag($.props,p),N=Mg(E,$,m,h);E&&(r!=="svg"&&Nb(E)?r="svg":r!=="mathml"&&Ib(E)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(E),_||(y($,E,N),Lu($,!1)))},L=$=>{const _=()=>{if(ll.get($)===_){if(ll.delete($),ra($.props)){const E=k($.el)||n;y($,E,$.anchor),Lu($,!0)}M($)}};ll.set($,_),ks(_,i)};if(e==null){const $=t.el=m(""),_=t.anchor=m("");if(h($,n,s),h(_,n,s),lT(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,_),Lu(t,!0)),M()}else{t.el=e.el;const $=t.anchor=e.anchor,_=ll.get(e);if(_){_.flags|=8,ll.delete(e),L(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=ra(e.props),S=F?n:E,I=F?$:N;if(r==="svg"||Nb(E)?r="svg":(r==="mathml"||Ib(E))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),ky(e,t,!0)):a||d(e,t,S,I,o,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Sf(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Ag(t.props,p);R&&Sf(t,R,null,c,0)}else F&&Sf(t,E,N,c,1);Lu(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||!ra(f),p=ll.get(e);if(p&&(p.flags|=8,ll.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let m=0;m<l.length;m++){const x=l[m];s(x,t,n,h,!!x.dynamicChildren)}},move:Sf,hydrate:cT};function Sf(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),!ll.has(e)&&(!d||ra(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function cT(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(x,k){let g=k;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,x._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(x,k){k.anchor=d(r(x),k,l(x),n,s,o,i)}const p=t.target=Ag(t.props,a),m=ra(t.props);if(p){const x=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,x),t.targetAnchor||Mg(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,x),t.targetAnchor||Mg(p,t,u,c),d(x&&r(x),t,p,n,s,o,i))),Lu(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const sm=aT;function Lu(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 Mg(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[F4]=r,e&&(s(i,e,o),s(r,e,o)),r}const di=Symbol("_leaveCb"),Su=Symbol("_enterCb");function R4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return yn(()=>{e.isMounted=!0}),ms(()=>{e.isUnmounting=!0}),e}const ii=[Function,Array],B4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ii,onEnter:ii,onAfterEnter:ii,onEnterCancelled:ii,onBeforeLeave:ii,onLeave:ii,onAfterLeave:ii,onLeaveCancelled:ii,onBeforeAppear:ii,onAppear:ii,onAfterAppear:ii,onAppearCancelled:ii},D4=e=>{const t=e.subTree;return t.component?D4(t.component):t},uT={name:"BaseTransition",props:B4,setup(e,{slots:t}){const n=Ys(),s=R4();return()=>{const o=t.default&&uy(t.default(),!0),i=o&&o.length?P4(o):n.subTree?re():void 0;if(!i)return;const r=on(e),{mode:l}=r;if(s.isLeaving)return K1(i);const a=$b(i);if(!a)return K1(i);let c=fd(a,r,s,n,d=>c=d);a.type!==xs&&Al(a,c);let u=n.subTree&&$b(n.subTree);if(u&&u.type!==xs&&!Ni(u,a)&&D4(n).type!==xs){let d=fd(u,r,s,n);if(Al(u,d),l==="out-in"&&a.type!==xs)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},K1(i);l==="in-out"&&a.type!==xs?d.delayLeave=(f,h,p)=>{const m=H4(s,u);m[String(u.key)]=u,f[di]=()=>{h(),f[di]=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 P4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==xs){t=n;break}}return t}const dT=uT;function H4(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 fd(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:x,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),M=H4(n,e),L=(E,N)=>{E&&bi(E,s,9,N)},$=(E,N)=>{const F=N[1];L(E,N),_t(E)?E.every(S=>S.length<=1)&&F():E.length<=1&&F()},_={mode:r,persisted:l,beforeEnter(E){let N=a;if(!n.isMounted)if(i)N=x||a;else return;E[di]&&E[di](!0);const F=M[y];F&&Ni(e,F)&&F.el[di]&&F.el[di](),L(N,[E])},enter(E){if(M[y]===e)return;let N=c,F=u,S=d;if(!n.isMounted)if(i)N=k||c,F=g||u,S=v||d;else return;let I=!1;E[Su]=B=>{I||(I=!0,B?L(S,[E]):L(F,[E]),_.delayedLeave&&_.delayedLeave(),E[Su]=void 0)};const R=E[Su].bind(null,!1);N?$(N,[E,R]):R()},leave(E,N){const F=String(e.key);if(E[Su]&&E[Su](!0),n.isUnmounting)return N();L(f,[E]);let S=!1;E[di]=R=>{S||(S=!0,N(),R?L(m,[E]):L(p,[E]),E[di]=void 0,M[F]===e&&delete M[F])};const I=E[di].bind(null,!1);M[F]=e,h?$(h,[E,I]):I()},clone(E){const N=fd(E,t,n,s,o);return o&&o(N),N}};return _}function K1(e){if(Dd(e))return e=Br(e),e.children=null,e}function $b(e){if(!Dd(e))return O4(e.type)&&e.children?P4(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&$t(n.default))return n.default()}}function Al(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Al(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 uy(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===Be?(r.patchFlag&128&&o++,s=s.concat(uy(r.children,t,l))):(t||r.type!==xs)&&s.push(l!=null?Br(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Ye(e,t){return $t(e)?wn({name:e.name},t,{setup:e}):e}function Exe(){const e=Ys();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function dy(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Txe(e){const t=Ys(),n=Ta(null);if(t){const o=t.refs===Jt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Lb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Bh=new WeakMap;function Ec(e,t,n,s,o=!1){if(_t(e)){e.forEach((m,x)=>Ec(m,t&&(_t(t)?t[x]:t),n,s,o));return}if(Nr(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ec(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Hd(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Jt?l.refs={}:l.refs,d=l.setupState,f=on(d),h=d===Jt?n4:m=>Lb(u,m)?!1:dn(f,m),p=(m,x)=>!(x&&Lb(u,x));if(c!=null&&c!==a){if(Fb(t),En(c))u[c]=null,h(c)&&(d[c]=null);else if(ps(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if($t(a))Rd(a,l,12,[r,u]);else{const m=En(a),x=ps(a);if(m||x){const k=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)_t(g)&&ny(g,i);else if(_t(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)):x&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{k(),Bh.delete(e)};g.id=-1,Bh.set(e,g),ks(g,n)}else Fb(e),k()}}}function Fb(e){const t=Bh.get(e);t&&(t.flags|=8,Bh.delete(e))}let Ob=!1;const Za=()=>{Ob||(console.error("Hydration completed but contains mismatches."),Ob=!0)},fT=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",hT=e=>e.namespaceURI.includes("MathML"),Cf=e=>{if(e.nodeType===1){if(fT(e))return"svg";if(hT(e))return"mathml"}},mc=e=>e.nodeType===8;function pT(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),Rh(),y._vnode=v;return}d(y.firstChild,v,null,null,null),Rh(),y._vnode=v},d=(v,y,M,L,$,_=!1)=>{_=_||!!y.dynamicChildren;const E=mc(v)&&v.data==="[",N=()=>m(v,y,M,L,$,E),{type:F,ref:S,shapeFlag:I,patchFlag:R}=y;let B=v.nodeType;y.el=v,R===-2&&(_=!1,y.dynamicChildren=null);let P=null;switch(F){case xl:B!==3?y.children===""?(a(y.el=o(""),r(v),v),P=v):P=N():(v.data!==y.children&&(Za(),v.data=y.children),P=i(v));break;case xs:g(v)?(P=i(v),k(y.el=v.content.firstChild,v,M)):B!==8||E?P=N():P=i(v);break;case Nc:if(E&&(v=i(v),B=v.nodeType),B===1||B===3){P=v;const z=!y.children.length;for(let W=0;W<y.staticCount;W++)z&&(y.children+=P.nodeType===1?P.outerHTML:P.data),W===y.staticCount-1&&(y.anchor=P),P=i(P);return E?i(P):P}else N();break;case Be:E?P=p(v,y,M,L,$,_):P=N();break;default:if(I&1)(B!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?P=N():P=f(v,y,M,L,$,_);else if(I&6){y.slotScopeIds=$;const z=r(v);if(E?P=x(v):mc(v)&&v.data==="teleport start"?P=x(v,v.data,"teleport end"):P=i(v),t(y,z,null,M,L,Cf(z),_),Nr(y)&&!y.type.__asyncResolved){let W;E?(W=ie(Be),W.anchor=P?P.previousSibling:z.lastChild):W=v.nodeType===3?Xe(""):ie("div"),W.el=v,y.component.subTree=W}}else I&64?B!==8?P=N():P=y.type.hydrate(v,y,M,L,$,_,e,h):I&128&&(P=y.type.hydrate(v,y,M,L,Cf(r(v)),$,_,e,d))}return S!=null&&Ec(S,null,L,y),P},f=(v,y,M,L,$,_)=>{_=_||!!y.dynamicChildren;const{type:E,props:N,patchFlag:F,shapeFlag:S,dirs:I,transition:R}=y,B=E==="input"||E==="option";if(B||F!==-1){I&&Yi(y,null,M,"created");let P=!1;if(g(v)){P=r3(null,R)&&M&&M.vnode.props&&M.vnode.props.appear;const W=v.content.firstChild;if(P){const ee=W.getAttribute("class");ee&&(W.$cls=ee),R.beforeEnter(W)}k(W,v,M),y.el=v=W}if(S&16&&!(N&&(N.innerHTML||N.textContent))){let W=h(v.firstChild,y,v,M,L,$,_);for(W&&!Af(v,1)&&Za();W;){const ee=W;W=W.nextSibling,l(ee)}}else if(S&8){let W=y.children;W[0]===`
15
+ `&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(W=W.slice(1));const{textContent:ee}=v;ee!==W&&ee!==W.replace(/\r\n|\r/g,`
16
+ `)&&(Af(v,0)||Za(),v.textContent=y.children)}if(N){if(B||!_||F&48){const W=v.tagName.includes("-");for(const ee in N)(B&&(ee.endsWith("value")||ee==="indeterminate")||Od(ee)&&!ma(ee)||ee[0]==="."||W&&!ma(ee))&&s(v,ee,null,N[ee],void 0,M)}else if(N.onClick)s(v,"onClick",null,N.onClick,void 0,M);else if(F&4&&bl(N.style))for(const W in N.style)N.style[W]}let z;(z=N&&N.onVnodeBeforeMount)&&To(z,M,y),I&&Yi(y,null,M,"beforeMount"),((z=N&&N.onVnodeMounted)||I||P)&&u3(()=>{z&&To(z,M,y),P&&R.enter(v),I&&Yi(y,null,M,"mounted")},L)}return v.nextSibling},h=(v,y,M,L,$,_,E)=>{E=E||!!y.dynamicChildren;const N=y.children,F=N.length;let S=!1;for(let I=0;I<F;I++){const R=E?N[I]:N[I]=Io(N[I]),B=R.type===xl;v?(B&&!E&&I+1<F&&Io(N[I+1]).type===xl&&(a(o(v.data.slice(R.children.length)),M,i(v)),v.data=R.children),v=d(v,R,L,$,_,E)):B&&!R.children?a(R.el=o(""),M):(S||(S=!0,Af(M,1)||Za()),n(null,R,M,null,L,$,Cf(M),_))}return v},p=(v,y,M,L,$,_)=>{const{slotScopeIds:E}=y;E&&($=$?$.concat(E):E);const N=r(v),F=h(i(v),y,N,M,L,$,_);return F&&mc(F)&&F.data==="]"?i(y.anchor=F):(Za(),a(y.anchor=c("]"),N,F),F)},m=(v,y,M,L,$,_)=>{if(Af(v.parentElement,1)||Za(),y.el=null,_){const F=x(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const E=i(v),N=r(v);return l(v),n(null,y,N,E,M,L,Cf(N),$),M&&(M.vnode.el=y.el,rm(M,y.el)),E},x=(v,y="[",M="]")=>{let L=0;for(;v;)if(v=i(v),v&&mc(v)&&(v.data===y&&L++,v.data===M)){if(L===0)return i(v);L--}return v},k=(v,y,M)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let $=M;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const Rb="data-allow-mismatch",mT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Af(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Rb);)e=e.parentElement;const n=e&&e.getAttribute(Rb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(mT[t])}}const gT=Yp().requestIdleCallback||(e=>setTimeout(e,1)),vT=Yp().cancelIdleCallback||(e=>clearTimeout(e)),Nxe=(e=1e4)=>t=>{const n=gT(t,{timeout:e});return()=>vT(n)};function yT(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 Ixe=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(yT(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},$xe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Lxe=(e=[])=>(t,n)=>{En(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 kT(e,t){if(mc(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(mc(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Nr=e=>!!e.type.__asyncLoader;function Ii(e){$t(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const 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((x,k)=>{a(m,()=>x(f()),()=>k(m),d+1)});throw m}).then(m=>p!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Ye({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,x){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||x()},v=i?()=>{const y=i(g,M=>kT(p,M));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Ks;if(dy(p),u)return()=>Mf(u,p);const m=v=>{c=null,Xc(v,p,13,!s)};if(l&&p.suspense||_a)return h().then(v=>()=>Mf(v,p)).catch(v=>(m(v),()=>s?ie(s,{error:v}):null));const x=Q(!1),k=Q(),g=Q(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!x.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),h().then(()=>{x.value=!0,p.parent&&Dd(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(x.value&&u)return Mf(u,p);if(k.value&&s)return ie(s,{error:k.value});if(n&&!g.value)return Mf(n,p)}}})}function Mf(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=ie(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Dd=e=>e.type.__isKeepAlive,bT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Ys(),s=n.ctx;if(!s.renderer)return()=>{const 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,M,L)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,M,g.slotScopeIds,L),ks(()=>{$.isDeactivated=!1,$.a&&Ac($.a);const _=g.props&&g.props.onVnodeMounted;_&&To(_,$.parent,g)},l)},s.deactivate=g=>{const v=g.component;Ph(v.m),Ph(v.a),c(g,f,null,1,l),ks(()=>{v.da&&Ac(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&To(y,v.parent,g),v.isDeactivated=!0},l)};function h(g){G1(g),u(g,n,l,!0)}function p(g){o.forEach((v,y)=>{const M=Rg(Nr(v)?v.type.__asyncResolved||{}:v.type);M&&!g(M)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!Ni(v,r))?h(v):r&&G1(r),o.delete(g),i.delete(g)}Qe(()=>[e.include,e.exclude],([g,v])=>{g&&p(y=>Fu(g,y)),v&&p(y=>!Fu(v,y))},{flush:"post",deep:!0});let x=null;const k=()=>{x!=null&&(Hh(n.subTree.type)?ks(()=>{o.set(x,Ef(n.subTree))},n.subTree.suspense):o.set(x,Ef(n.subTree)))};return yn(k),fy(k),ms(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,M=Ef(v);if(g.type===M.type&&g.key===M.key){G1(M);const L=M.component.da;L&&ks(L,y);return}h(g)})}),()=>{if(x=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Ml(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=Ef(v);if(y.type===xs)return r=null,y;const M=y.type,L=Rg(Nr(y)?y.type.__asyncResolved||{}:M),{include:$,exclude:_,max:E}=e;if($&&(!L||!Fu($,L))||_&&L&&Fu(_,L))return y.shapeFlag&=-257,r=y,v;const N=y.key==null?M:y.key,F=o.get(N);return y.el&&(y=Br(y),v.shapeFlag&128&&(v.ssContent=y)),x=N,F?(y.el=F.el,y.component=F.component,y.transition&&Al(y,y.transition),y.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),E&&i.size>parseInt(E,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,Hh(v.type)?v:y}}},Fxe=bT;function Fu(e,t){return _t(e)?e.some(n=>Fu(n,t)):En(e)?e.split(",").includes(t):lE(e)?(e.lastIndex=0,e.test(t)):!1}function xT(e,t){W4(e,"a",t)}function _T(e,t){W4(e,"da",t)}function W4(e,t,n=Ks){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(om(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Dd(o.parent.vnode)&&wT(s,t,n,o),o=o.parent}}function wT(e,t,n,s){const o=om(t,e,s,!0);Sn(()=>{ny(s[t],o)},n)}function G1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ef(e){return e.shapeFlag&128?e.ssContent:e}function om(e,t,n=Ks,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Fr();const l=Jc(n),a=bi(t,n,e,r);return l(),Or(),a});return s?o.unshift(i):o.push(i),i}}const Pr=e=>(t,n=Ks)=>{(!_a||e==="sp")&&om(e,(...s)=>t(...s),n)},ST=Pr("bm"),yn=Pr("m"),z4=Pr("bu"),fy=Pr("u"),ms=Pr("bum"),Sn=Pr("um"),CT=Pr("sp"),AT=Pr("rtg"),MT=Pr("rtc");function ET(e,t=Ks){om("ec",e,t)}const hy="components",TT="directives";function NT(e,t){return py(hy,e,!0,t)||e}const U4=Symbol.for("v-ndc");function Vs(e){return En(e)?py(hy,e,!1)||e:e||U4}function Oxe(e){return py(TT,e)}function py(e,t,n=!0,s=!1){const o=Gs||Ks;if(o){const i=o.type;if(e===hy){const l=Rg(i,!1);if(l&&(l===t||l===Fs(t)||l===Kp(Fs(t))))return i}const r=Bb(o[e]||i[e],t)||Bb(o.appContext[e],t);return!r&&s?i:r}}function Bb(e,t){return e&&(e[t]||e[Fs(t)]||e[Kp(Fs(t))])}function st(e,t,n,s){let o;const i=n&&n[s],r=_t(e);if(r||En(e)){const l=r&&bl(e);let a=!1,c=!1;l&&(a=!Go(e),c=Rr(e),e=Xp(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?Wc(Oi(e[u])):Oi(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(fn(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 q4(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(_t(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 Fn(e,t,n={},s,o){if(Gs.ce||Gs.parent&&Nr(Gs.parent)&&Gs.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),ke(Be,null,[ie("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),b();const r=i&&my(i(n)),l=n.key||r&&r.key,a=ke(Be,{key:(l&&!ei(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 my(e){return e.some(t=>Ml(t)?!(t.type===xs||t.type===Be&&!my(t.children)):!0)?e:null}function Rxe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:rh(s)]=e[s];return n}const Eg=e=>e?m3(e)?Hd(e):Eg(e.parent):null,ju=wn(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=>Eg(e.parent),$root:e=>Eg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>gy(e),$forceUpdate:e=>e.f||(e.f=()=>{cy(e.update)}),$nextTick:e=>e.n||(e.n=gt.bind(e.proxy)),$watch:e=>rT.bind(e)}),Y1=(e,t)=>e!==Jt&&!e.__isScriptSetup&&dn(e,t),Tg={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(Y1(s,t))return r[t]=1,s[t];if(o!==Jt&&dn(o,t))return r[t]=2,o[t];if(dn(i,t))return r[t]=3,i[t];if(n!==Jt&&dn(n,t))return r[t]=4,n[t];Ng&&(r[t]=0)}}const c=ju[t];let u,d;if(c)return t==="$attrs"&&so(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Jt&&dn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,dn(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Y1(o,t)?(o[t]=n,!0):s!==Jt&&dn(s,t)?(s[t]=n,!0):dn(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!==Jt&&l[0]!=="$"&&dn(e,l)||Y1(t,l)||dn(i,l)||dn(s,l)||dn(ju,l)||dn(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},IT=wn({},Tg,{get(e,t){if(t!==Symbol.unscopables)return Tg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!fE(t)}});function Bxe(){return null}function Dxe(){return null}function Pxe(e){}function Hxe(e){}function Wxe(){return null}function zxe(){}function Uxe(e,t){return null}function qxe(){return j4().slots}function Pd(){return j4().attrs}function j4(e){const t=Ys();return t.setupContext||(t.setupContext=y3(t))}function hd(e){return _t(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function jxe(e,t){const n=hd(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?_t(o)||$t(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function Vxe(e,t){return!e||!t?e||t:_t(e)&&_t(t)?e.concat(t):wn({},hd(e),hd(t))}function Kxe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Gxe(e){const t=Ys(),n=_a;let s=e();md(),n&&Ic(!1);const o=()=>{Jc(t),n&&Ic(!0)},i=()=>{Ys()!==t&&t.scope.off(),md(),n&&Ic(!1)};return sy(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let Ng=!0;function $T(e){const t=gy(e),n=e.proxy,s=e.ctx;Ng=!1,t.beforeCreate&&Db(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:x,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:y,render:M,renderTracked:L,renderTriggered:$,errorCaptured:_,serverPrefetch:E,expose:N,inheritAttrs:F,components:S,directives:I,filters:R}=t;if(c&&LT(c,s,null),r)for(const z in r){const W=r[z];$t(W)&&(s[z]=W.bind(n))}if(o){const z=o.call(n,n);fn(z)&&(e.data=Ps(z))}if(Ng=!0,i)for(const z in i){const W=i[z],ee=$t(W)?W.bind(n,n):$t(W.get)?W.get.bind(n,n):vi,U=!$t(W)&&$t(W.set)?W.set.bind(n):vi,Z=D({get:ee,set:U});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>Z.value,set:ce=>Z.value=ce})}if(l)for(const z in l)V4(l[z],s,n,z);if(a){const z=$t(a)?a.call(n):a;Reflect.ownKeys(z).forEach(W=>{In(W,z[W])})}u&&Db(u,e,"c");function P(z,W){_t(W)?W.forEach(ee=>z(ee.bind(n))):W&&z(W.bind(n))}if(P(ST,d),P(yn,f),P(z4,h),P(fy,p),P(xT,m),P(_T,x),P(ET,_),P(MT,L),P(AT,$),P(ms,g),P(Sn,y),P(CT,E),_t(N))if(N.length){const z=e.exposed||(e.exposed={});N.forEach(W=>{Object.defineProperty(z,W,{get:()=>n[W],set:ee=>n[W]=ee,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===vi&&(e.render=M),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),I&&(e.directives=I),E&&dy(e)}function LT(e,t,n=vi){_t(e)&&(e=Ig(e));for(const s in e){const o=e[s];let i;fn(o)?"default"in o?i=Vt(o.from||s,o.default,!0):i=Vt(o.from||s):i=Vt(o),ps(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Db(e,t,n){bi(_t(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function V4(e,t,n,s){let o=s.includes(".")?L4(n,s):()=>n[s];if(En(e)){const i=t[e];$t(i)&&Qe(o,i)}else if($t(e))Qe(o,e.bind(n));else if(fn(e))if(_t(e))e.forEach(i=>V4(i,t,n,s));else{const i=$t(e.handler)?e.handler.bind(n):t[e.handler];$t(i)&&Qe(o,i,e)}}function gy(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=>Dh(a,c,r,!0)),Dh(a,t,r)),fn(t)&&i.set(t,a),a}function Dh(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Dh(e,i,n,!0),o&&o.forEach(r=>Dh(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=FT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const FT={data:Pb,props:Hb,emits:Hb,methods:Ou,computed:Ou,beforeCreate:co,created:co,beforeMount:co,mounted:co,beforeUpdate:co,updated:co,beforeDestroy:co,beforeUnmount:co,destroyed:co,unmounted:co,activated:co,deactivated:co,errorCaptured:co,serverPrefetch:co,components:Ou,directives:Ou,watch:RT,provide:Pb,inject:OT};function Pb(e,t){return t?e?function(){return wn($t(e)?e.call(this,this):e,$t(t)?t.call(this,this):t)}:t:e}function OT(e,t){return Ou(Ig(e),Ig(t))}function Ig(e){if(_t(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function co(e,t){return e?[...new Set([].concat(e,t))]:t}function Ou(e,t){return e?wn(Object.create(null),e,t):t}function Hb(e,t){return e?_t(e)&&_t(t)?[...new Set([...e,...t])]:wn(Object.create(null),hd(e),hd(t??{})):t}function RT(e,t){if(!e)return t;if(!t)return e;const n=wn(Object.create(null),e);for(const s in t)n[s]=co(e[s],t[s]);return n}function K4(){return{app:null,config:{isNativeTag:n4,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 BT=0;function DT(e,t){return function(s,o=null){$t(s)||(s=wn({},s)),o!=null&&!fn(o)&&(o=null);const i=K4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:BT++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:p9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&$t(u.install)?(r.add(u),u.install(c,...d)):$t(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||ie(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,Hd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(bi(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=va;va=c;try{return u()}finally{va=d}}};return c}}let va=null;function Yxe(e,t,n=Jt){const s=Ys(),o=Fs(t),i=$o(t),r=G4(e,o),l=qE((a,c)=>{let u,d=Jt,f;return iT(()=>{const h=e[o];js(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(!js(p,u)&&!(d!==Jt&&js(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),js(h,p)&&js(h,d)&&!js(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Jt:l,done:!1}:{done:!0}}}},l}const G4=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Fs(t)}Modifiers`]||e[`${$o(t)}Modifiers`];function PT(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Jt;let o=n;const i=t.startsWith("update:"),r=i&&G4(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>En(u)?u.trim():u)),r.number&&(o=n.map(Gp)));let l,a=s[l=rh(t)]||s[l=rh(Fs(t))];!a&&i&&(a=s[l=rh($o(t))]),a&&bi(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,bi(c,e,6,o)}}const HT=new WeakMap;function Y4(e,t,n=!1){const s=n?HT:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!$t(e)){const a=c=>{const u=Y4(c,t,!0);u&&(l=!0,wn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(fn(e)&&s.set(e,null),null):(_t(i)?i.forEach(a=>r[a]=null):wn(r,i),fn(e)&&s.set(e,r),r)}function im(e,t){return!e||!Od(t)?!1:(t=t.slice(2).replace(/Once$/,""),dn(e,t[0].toLowerCase()+t.slice(1))||dn(e,$o(t))||dn(e,t))}function lh(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,x=dd(e);let k,g;try{if(n.shapeFlag&4){const y=o||s,M=y;k=Io(c.call(M,y,u,d,h,f,p)),g=l}else{const y=t;k=Io(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:zT(l)}}catch(y){Vu.length=0,Xc(y,e,1),k=ie(xs)}let v=k;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:M}=v;y.length&&M&7&&(i&&y.some(Up)&&(g=UT(g,i)),v=Br(v,g,!1,!0))}return n.dirs&&(v=Br(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Al(v,n.transition),k=v,dd(x),k}function WT(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Ml(o)){if(o.type!==xs||o.children==="v-if"){if(n)return;n=o}}else return}return n}const zT=e=>{let t;for(const n in e)(n==="class"||n==="style"||Od(n))&&((t||(t={}))[n]=e[n]);return t},UT=(e,t)=>{const n={};for(const s in e)(!Up(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function qT(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?Wb(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(Z4(r,s,f)&&!im(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?Wb(s,r,c):!0:!!r;return!1}function Wb(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(Z4(t,e,i)&&!im(n,i))return!0}return!1}function Z4(e,t,n){const s=e[n],o=t[n];return n==="style"&&fn(s)&&fn(o)?!Lr(s,o):s!==o}function rm({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 Q4={},X4=()=>Object.create(Q4),J4=e=>Object.getPrototypeOf(e)===Q4;function jT(e,t,n,s=!1){const o={},i=X4();e.propsDefaults=Object.create(null),e3(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:HE(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function VT(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=on(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(im(e.emitsOptions,f))continue;const h=t[f];if(a)if(dn(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=Fs(f);o[p]=$g(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{e3(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!dn(t,d)&&((u=$o(d))===d||!dn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=$g(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!dn(t,d))&&(delete i[d],c=!0)}c&&Sr(e.attrs,"set","")}function e3(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(ma(a))continue;const c=t[a];let u;o&&dn(o,u=Fs(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:im(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=on(n),c=l||Jt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=$g(o,a,d,c[d],e,!dn(c,d))}}return r}function $g(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=dn(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&$t(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Jc(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===$o(n))&&(s=!0))}return s}const KT=new WeakMap;function t3(e,t,n=!1){const s=n?KT:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!$t(e)){const u=d=>{a=!0;const[f,h]=t3(d,t,!0);wn(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 fn(e)&&s.set(e,Sc),Sc;if(_t(i))for(let u=0;u<i.length;u++){const d=Fs(i[u]);zb(d)&&(r[d]=Jt)}else if(i)for(const u in i){const d=Fs(u);if(zb(d)){const f=i[u],h=r[d]=_t(f)||$t(f)?{type:f}:wn({},f),p=h.type;let m=!1,x=!0;if(_t(p))for(let k=0;k<p.length;++k){const g=p[k],v=$t(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(x=!1)}else m=$t(p)&&p.name==="Boolean";h[0]=m,h[1]=x,(m||dn(h,"default"))&&l.push(d)}}const c=[r,l];return fn(e)&&s.set(e,c),c}function zb(e){return e[0]!=="$"&&!ma(e)}const vy=e=>e==="_"||e==="_ctx"||e==="$stable",yy=e=>_t(e)?e.map(Io):[Io(e)],GT=(e,t,n)=>{if(t._n)return t;const s=Me((...o)=>yy(t(...o)),n);return s._c=!1,s},n3=(e,t,n)=>{const s=e._ctx;for(const o in e){if(vy(o))continue;const i=e[o];if($t(i))t[o]=GT(o,i,s);else if(i!=null){const r=yy(i);t[o]=()=>r}}},s3=(e,t)=>{const n=yy(t);e.slots.default=()=>n},o3=(e,t,n)=>{for(const s in t)(n||!vy(s))&&(e[s]=t[s])},YT=(e,t,n)=>{const s=e.slots=X4();if(e.vnode.shapeFlag&32){const o=t._;o?(o3(s,t,n),n&&o4(s,"_",o,!0)):n3(t,s)}else t&&s3(e,t)},ZT=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Jt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:o3(o,t,n):(i=!t.$stable,n3(t,o)),r=t}else t&&(s3(e,t),r={default:1});if(i)for(const l in o)!vy(l)&&r[l]==null&&delete o[l]},ks=u3;function QT(e){return i3(e)}function XT(e){return i3(e,pT)}function i3(e,t){const n=Yp();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=vi,insertStaticContent:p}=e,m=(q,ne,ge,ue=null,ye=null,j=null,te=void 0,pe=null,Se=!!ne.dynamicChildren)=>{if(q===ne)return;q&&!Ni(q,ne)&&(ue=le(q),ce(q,ye,j,!0),q=null),ne.patchFlag===-2&&(Se=!1,ne.dynamicChildren=null);const{type:Ie,ref:Fe,shapeFlag:he}=ne;switch(Ie){case xl:x(q,ne,ge,ue);break;case xs:k(q,ne,ge,ue);break;case Nc:q==null&&g(ne,ge,ue,te);break;case Be:S(q,ne,ge,ue,ye,j,te,pe,Se);break;default:he&1?M(q,ne,ge,ue,ye,j,te,pe,Se):he&6?I(q,ne,ge,ue,ye,j,te,pe,Se):(he&64||he&128)&&Ie.process(q,ne,ge,ue,ye,j,te,pe,Se,G)}Fe!=null&&ye?Ec(Fe,q&&q.ref,j,ne||q,!ne):Fe==null&&q&&q.ref!=null&&Ec(q.ref,null,j,q,!0)},x=(q,ne,ge,ue)=>{if(q==null)s(ne.el=l(ne.children),ge,ue);else{const ye=ne.el=q.el;ne.children!==q.children&&c(ye,ne.children)}},k=(q,ne,ge,ue)=>{q==null?s(ne.el=a(ne.children||""),ge,ue):ne.el=q.el},g=(q,ne,ge,ue)=>{[q.el,q.anchor]=p(q.children,ne,ge,ue,q.el,q.anchor)},v=({el:q,anchor:ne},ge,ue)=>{let ye;for(;q&&q!==ne;)ye=f(q),s(q,ge,ue),q=ye;s(ne,ge,ue)},y=({el:q,anchor:ne})=>{let ge;for(;q&&q!==ne;)ge=f(q),o(q),q=ge;o(ne)},M=(q,ne,ge,ue,ye,j,te,pe,Se)=>{if(ne.type==="svg"?te="svg":ne.type==="math"&&(te="mathml"),q==null)L(ne,ge,ue,ye,j,te,pe,Se);else{const Ie=q.el&&q.el._isVueCE?q.el:null;try{Ie&&Ie._beginPatch(),E(q,ne,ye,j,te,pe,Se)}finally{Ie&&Ie._endPatch()}}},L=(q,ne,ge,ue,ye,j,te,pe)=>{let Se,Ie;const{props:Fe,shapeFlag:he,transition:Ne,dirs:Je}=q;if(Se=q.el=r(q.type,j,Fe&&Fe.is,Fe),he&8?u(Se,q.children):he&16&&_(q.children,Se,null,ue,ye,Z1(q,j),te,pe),Je&&Yi(q,null,ue,"created"),$(Se,q,q.scopeId,te,ue),Fe){for(const At in Fe)At!=="value"&&!ma(At)&&i(Se,At,null,Fe[At],j,ue);"value"in Fe&&i(Se,"value",null,Fe.value,j),(Ie=Fe.onVnodeBeforeMount)&&To(Ie,ue,q)}Je&&Yi(q,null,ue,"beforeMount");const it=r3(ye,Ne);it&&Ne.beforeEnter(Se),s(Se,ne,ge),((Ie=Fe&&Fe.onVnodeMounted)||it||Je)&&ks(()=>{try{Ie&&To(Ie,ue,q),it&&Ne.enter(Se),Je&&Yi(q,null,ue,"mounted")}finally{}},ye)},$=(q,ne,ge,ue,ye)=>{if(ge&&h(q,ge),ue)for(let j=0;j<ue.length;j++)h(q,ue[j]);if(ye){let j=ye.subTree;if(ne===j||Hh(j.type)&&(j.ssContent===ne||j.ssFallback===ne)){const te=ye.vnode;$(q,te,te.scopeId,te.slotScopeIds,ye.parent)}}},_=(q,ne,ge,ue,ye,j,te,pe,Se=0)=>{for(let Ie=Se;Ie<q.length;Ie++){const Fe=q[Ie]=pe?_r(q[Ie]):Io(q[Ie]);m(null,Fe,ne,ge,ue,ye,j,te,pe)}},E=(q,ne,ge,ue,ye,j,te)=>{const pe=ne.el=q.el;let{patchFlag:Se,dynamicChildren:Ie,dirs:Fe}=ne;Se|=q.patchFlag&16;const he=q.props||Jt,Ne=ne.props||Jt;let Je;if(ge&&Xl(ge,!1),(Je=Ne.onVnodeBeforeUpdate)&&To(Je,ge,ne,q),Fe&&Yi(ne,q,ge,"beforeUpdate"),ge&&Xl(ge,!0),(he.innerHTML&&Ne.innerHTML==null||he.textContent&&Ne.textContent==null)&&u(pe,""),Ie?N(q.dynamicChildren,Ie,pe,ge,ue,Z1(ne,ye),j):te||W(q,ne,pe,null,ge,ue,Z1(ne,ye),j,!1),Se>0){if(Se&16)F(pe,he,Ne,ge,ye);else if(Se&2&&he.class!==Ne.class&&i(pe,"class",null,Ne.class,ye),Se&4&&i(pe,"style",he.style,Ne.style,ye),Se&8){const it=ne.dynamicProps;for(let At=0;At<it.length;At++){const xt=it[At],wt=he[xt],Kt=Ne[xt];(Kt!==wt||xt==="value")&&i(pe,xt,wt,Kt,ye,ge)}}Se&1&&q.children!==ne.children&&u(pe,ne.children)}else!te&&Ie==null&&F(pe,he,Ne,ge,ye);((Je=Ne.onVnodeUpdated)||Fe)&&ks(()=>{Je&&To(Je,ge,ne,q),Fe&&Yi(ne,q,ge,"updated")},ue)},N=(q,ne,ge,ue,ye,j,te)=>{for(let pe=0;pe<ne.length;pe++){const Se=q[pe],Ie=ne[pe],Fe=Se.el&&(Se.type===Be||!Ni(Se,Ie)||Se.shapeFlag&198)?d(Se.el):ge;m(Se,Ie,Fe,null,ue,ye,j,te,!0)}},F=(q,ne,ge,ue,ye)=>{if(ne!==ge){if(ne!==Jt)for(const j in ne)!ma(j)&&!(j in ge)&&i(q,j,ne[j],null,ye,ue);for(const j in ge){if(ma(j))continue;const te=ge[j],pe=ne[j];te!==pe&&j!=="value"&&i(q,j,pe,te,ye,ue)}"value"in ge&&i(q,"value",ne.value,ge.value,ye)}},S=(q,ne,ge,ue,ye,j,te,pe,Se)=>{const Ie=ne.el=q?q.el:l(""),Fe=ne.anchor=q?q.anchor:l("");let{patchFlag:he,dynamicChildren:Ne,slotScopeIds:Je}=ne;Je&&(pe=pe?pe.concat(Je):Je),q==null?(s(Ie,ge,ue),s(Fe,ge,ue),_(ne.children||[],ge,Fe,ye,j,te,pe,Se)):he>0&&he&64&&Ne&&q.dynamicChildren&&q.dynamicChildren.length===Ne.length?(N(q.dynamicChildren,Ne,ge,ye,j,te,pe),(ne.key!=null||ye&&ne===ye.subTree)&&ky(q,ne,!0)):W(q,ne,ge,Fe,ye,j,te,pe,Se)},I=(q,ne,ge,ue,ye,j,te,pe,Se)=>{ne.slotScopeIds=pe,q==null?ne.shapeFlag&512?ye.ctx.activate(ne,ge,ue,te,Se):R(ne,ge,ue,ye,j,te,Se):B(q,ne,Se)},R=(q,ne,ge,ue,ye,j,te)=>{const pe=q.component=p3(q,ue,ye);if(Dd(q)&&(pe.ctx.renderer=G),g3(pe,!1,te),pe.asyncDep){if(ye&&ye.registerDep(pe,P,te),!q.el){const Se=pe.subTree=ie(xs);k(null,Se,ne,ge),q.placeholder=Se.el}}else P(pe,q,ne,ge,ye,j,te)},B=(q,ne,ge)=>{const ue=ne.component=q.component;if(qT(q,ne,ge))if(ue.asyncDep&&!ue.asyncResolved){z(ue,ne,ge);return}else ue.next=ne,ue.update();else ne.el=q.el,ue.vnode=ne},P=(q,ne,ge,ue,ye,j,te)=>{const pe=()=>{if(q.isMounted){let{next:he,bu:Ne,u:Je,parent:it,vnode:At}=q;{const cn=l3(q);if(cn){he&&(he.el=At.el,z(q,he,te)),cn.asyncDep.then(()=>{ks(()=>{q.isUnmounted||Ie()},ye)});return}}let xt=he,wt;Xl(q,!1),he?(he.el=At.el,z(q,he,te)):he=At,Ne&&Ac(Ne),(wt=he.props&&he.props.onVnodeBeforeUpdate)&&To(wt,it,he,At),Xl(q,!0);const Kt=lh(q),vt=q.subTree;q.subTree=Kt,m(vt,Kt,d(vt.el),le(vt),q,ye,j),he.el=Kt.el,xt===null&&rm(q,Kt.el),Je&&ks(Je,ye),(wt=he.props&&he.props.onVnodeUpdated)&&ks(()=>To(wt,it,he,At),ye)}else{let he;const{el:Ne,props:Je}=ne,{bm:it,m:At,parent:xt,root:wt,type:Kt}=q,vt=Nr(ne);if(Xl(q,!1),it&&Ac(it),!vt&&(he=Je&&Je.onVnodeBeforeMount)&&To(he,xt,ne),Xl(q,!0),Ne&&me){const cn=()=>{q.subTree=lh(q),me(Ne,q.subTree,q,ye,null)};vt&&Kt.__asyncHydrate?Kt.__asyncHydrate(Ne,q,cn):cn()}else{wt.ce&&wt.ce._hasShadowRoot()&&wt.ce._injectChildStyle(Kt,q.parent?q.parent.type:void 0);const cn=q.subTree=lh(q);m(null,cn,ge,ue,q,ye,j),ne.el=cn.el}if(At&&ks(At,ye),!vt&&(he=Je&&Je.onVnodeMounted)){const cn=ne;ks(()=>To(he,xt,cn),ye)}(ne.shapeFlag&256||xt&&Nr(xt.vnode)&&xt.vnode.shapeFlag&256)&&q.a&&ks(q.a,ye),q.isMounted=!0,ne=ge=ue=null}};q.scope.on();const Se=q.effect=new Nh(pe);q.scope.off();const Ie=q.update=Se.run.bind(Se),Fe=q.job=Se.runIfDirty.bind(Se);Fe.i=q,Fe.id=q.uid,Se.scheduler=()=>cy(Fe),Xl(q,!0),Ie()},z=(q,ne,ge)=>{ne.component=q;const ue=q.vnode.props;q.vnode=ne,q.next=null,VT(q,ne.props,ue,ge),ZT(q,ne.children,ge),Fr(),Tb(q),Or()},W=(q,ne,ge,ue,ye,j,te,pe,Se=!1)=>{const Ie=q&&q.children,Fe=q?q.shapeFlag:0,he=ne.children,{patchFlag:Ne,shapeFlag:Je}=ne;if(Ne>0){if(Ne&128){U(Ie,he,ge,ue,ye,j,te,pe,Se);return}else if(Ne&256){ee(Ie,he,ge,ue,ye,j,te,pe,Se);return}}Je&8?(Fe&16&&X(Ie,ye,j),he!==Ie&&u(ge,he)):Fe&16?Je&16?U(Ie,he,ge,ue,ye,j,te,pe,Se):X(Ie,ye,j,!0):(Fe&8&&u(ge,""),Je&16&&_(he,ge,ue,ye,j,te,pe,Se))},ee=(q,ne,ge,ue,ye,j,te,pe,Se)=>{q=q||Sc,ne=ne||Sc;const Ie=q.length,Fe=ne.length,he=Math.min(Ie,Fe);let Ne;for(Ne=0;Ne<he;Ne++){const Je=ne[Ne]=Se?_r(ne[Ne]):Io(ne[Ne]);m(q[Ne],Je,ge,null,ye,j,te,pe,Se)}Ie>Fe?X(q,ye,j,!0,!1,he):_(ne,ge,ue,ye,j,te,pe,Se,he)},U=(q,ne,ge,ue,ye,j,te,pe,Se)=>{let Ie=0;const Fe=ne.length;let he=q.length-1,Ne=Fe-1;for(;Ie<=he&&Ie<=Ne;){const Je=q[Ie],it=ne[Ie]=Se?_r(ne[Ie]):Io(ne[Ie]);if(Ni(Je,it))m(Je,it,ge,null,ye,j,te,pe,Se);else break;Ie++}for(;Ie<=he&&Ie<=Ne;){const Je=q[he],it=ne[Ne]=Se?_r(ne[Ne]):Io(ne[Ne]);if(Ni(Je,it))m(Je,it,ge,null,ye,j,te,pe,Se);else break;he--,Ne--}if(Ie>he){if(Ie<=Ne){const Je=Ne+1,it=Je<Fe?ne[Je].el:ue;for(;Ie<=Ne;)m(null,ne[Ie]=Se?_r(ne[Ie]):Io(ne[Ie]),ge,it,ye,j,te,pe,Se),Ie++}}else if(Ie>Ne)for(;Ie<=he;)ce(q[Ie],ye,j,!0),Ie++;else{const Je=Ie,it=Ie,At=new Map;for(Ie=it;Ie<=Ne;Ie++){const Zt=ne[Ie]=Se?_r(ne[Ie]):Io(ne[Ie]);Zt.key!=null&&At.set(Zt.key,Ie)}let xt,wt=0;const Kt=Ne-it+1;let vt=!1,cn=0;const Kn=new Array(Kt);for(Ie=0;Ie<Kt;Ie++)Kn[Ie]=0;for(Ie=Je;Ie<=he;Ie++){const Zt=q[Ie];if(wt>=Kt){ce(Zt,ye,j,!0);continue}let bn;if(Zt.key!=null)bn=At.get(Zt.key);else for(xt=it;xt<=Ne;xt++)if(Kn[xt-it]===0&&Ni(Zt,ne[xt])){bn=xt;break}bn===void 0?ce(Zt,ye,j,!0):(Kn[bn-it]=Ie+1,bn>=cn?cn=bn:vt=!0,m(Zt,ne[bn],ge,null,ye,j,te,pe,Se),wt++)}const Un=vt?JT(Kn):Sc;for(xt=Un.length-1,Ie=Kt-1;Ie>=0;Ie--){const Zt=it+Ie,bn=ne[Zt],Pn=ne[Zt+1],rt=Zt+1<Fe?Pn.el||a3(Pn):ue;Kn[Ie]===0?m(null,bn,ge,rt,ye,j,te,pe,Se):vt&&(xt<0||Ie!==Un[xt]?Z(bn,ge,rt,2):xt--)}}},Z=(q,ne,ge,ue,ye=null)=>{const{el:j,type:te,transition:pe,children:Se,shapeFlag:Ie}=q;if(Ie&6){Z(q.component.subTree,ne,ge,ue);return}if(Ie&128){q.suspense.move(ne,ge,ue);return}if(Ie&64){te.move(q,ne,ge,G);return}if(te===Be){s(j,ne,ge);for(let he=0;he<Se.length;he++)Z(Se[he],ne,ge,ue);s(q.anchor,ne,ge);return}if(te===Nc){v(q,ne,ge);return}if(ue!==2&&Ie&1&&pe)if(ue===0)pe.persisted&&!j[di]?s(j,ne,ge):(pe.beforeEnter(j),s(j,ne,ge),ks(()=>pe.enter(j),ye));else{const{leave:he,delayLeave:Ne,afterLeave:Je}=pe,it=()=>{q.ctx.isUnmounted?o(j):s(j,ne,ge)},At=()=>{const xt=j._isLeaving||!!j[di];j._isLeaving&&j[di](!0),pe.persisted&&!xt?it():he(j,()=>{it(),Je&&Je()})};Ne?Ne(j,it,At):At()}else s(j,ne,ge)},ce=(q,ne,ge,ue=!1,ye=!1)=>{const{type:j,props:te,ref:pe,children:Se,dynamicChildren:Ie,shapeFlag:Fe,patchFlag:he,dirs:Ne,cacheIndex:Je,memo:it}=q;if(he===-2&&(ye=!1),pe!=null&&(Fr(),Ec(pe,null,ge,q,!0),Or()),Je!=null&&(ne.renderCache[Je]=void 0),Fe&256){ne.ctx.deactivate(q);return}const At=Fe&1&&Ne,xt=!Nr(q);let wt;if(xt&&(wt=te&&te.onVnodeBeforeUnmount)&&To(wt,ne,q),Fe&6)Y(q.component,ge,ue);else{if(Fe&128){q.suspense.unmount(ge,ue);return}At&&Yi(q,null,ne,"beforeUnmount"),Fe&64?q.type.remove(q,ne,ge,G,ue):Ie&&!Ie.hasOnce&&(j!==Be||he>0&&he&64)?X(Ie,ne,ge,!1,!0):(j===Be&&he&384||!ye&&Fe&16)&&X(Se,ne,ge),ue&&fe(q)}const Kt=it!=null&&Je==null;(xt&&(wt=te&&te.onVnodeUnmounted)||At||Kt)&&ks(()=>{wt&&To(wt,ne,q),At&&Yi(q,null,ne,"unmounted"),Kt&&(q.el=null)},ge)},fe=q=>{const{type:ne,el:ge,anchor:ue,transition:ye}=q;if(ne===Be){oe(ge,ue);return}if(ne===Nc){y(q);return}const j=()=>{o(ge),ye&&!ye.persisted&&ye.afterLeave&&ye.afterLeave()};if(q.shapeFlag&1&&ye&&!ye.persisted){const{leave:te,delayLeave:pe}=ye,Se=()=>te(ge,j);pe?pe(q.el,j,Se):Se()}else j()},oe=(q,ne)=>{let ge;for(;q!==ne;)ge=f(q),o(q),q=ge;o(ne)},Y=(q,ne,ge)=>{const{bum:ue,scope:ye,job:j,subTree:te,um:pe,m:Se,a:Ie}=q;Ph(Se),Ph(Ie),ue&&Ac(ue),ye.stop(),j&&(j.flags|=8,ce(te,q,ne,ge)),pe&&ks(pe,ne),ks(()=>{q.isUnmounted=!0},ne)},X=(q,ne,ge,ue=!1,ye=!1,j=0)=>{for(let te=j;te<q.length;te++)ce(q[te],ne,ge,ue,ye)},le=q=>{if(q.shapeFlag&6)return le(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const ne=f(q.anchor||q.el),ge=ne&&ne[F4];return ge?f(ge):ne};let He=!1;const de=(q,ne,ge)=>{let ue;q==null?ne._vnode&&(ce(ne._vnode,null,null,!0),ue=ne._vnode.component):m(ne._vnode||null,q,ne,null,null,null,ge),ne._vnode=q,He||(He=!0,Tb(ue),Rh(),He=!1)},G={p:m,um:ce,m:Z,r:fe,mt:R,mc:_,pc:W,pbc:N,n:le,o:e};let ae,me;return t&&([ae,me]=t(G)),{render:de,hydrate:ae,createApp:DT(de,ae)}}function Z1({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 Xl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function r3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ky(e,t,n=!1){const s=e.children,o=t.children;if(_t(s)&&_t(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]=_r(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&ky(r,l)),l.type===xl&&(l.patchFlag===-1&&(l=o[i]=_r(l)),l.el=r.el),l.type===xs&&!l.el&&(l.el=r.el)}}function JT(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 l3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:l3(t)}function Ph(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function a3(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?a3(t.subTree):null}const Hh=e=>e.__isSuspense;let Lg=0;const e9={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)t9(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}n9(e,t,n,s,o,r,l,a,c)}},hydrate:s9,normalize:o9},Zxe=e9;function pd(e,t){const n=e.props&&e.props[t];$t(n)&&n()}function t9(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=c3(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?(pd(e,"onPending"),pd(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),Tc(f,e.ssFallback)):f.resolve(!1,!0)}function n9(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:x,isHydrating:k}=d;if(m)d.pendingBranch=f,Ni(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():x&&(k||(a(p,h,n,s,o,null,i,r,l),Tc(d,h)))):(d.pendingId=Lg++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),x?(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),Tc(d,h))):p&&Ni(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&&Ni(p,f))a(p,f,n,s,o,d,i,r,l),Tc(d,f);else if(pd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Lg++,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 c3(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:x}}=c;let k;const g=i9(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?Th(e.props.timeout):void 0,y=i,M={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:Lg++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,$=!1){const{vnode:_,activeBranch:E,pendingBranch:N,pendingId:F,effects:S,parentComponent:I,container:R,isInFallback:B}=M;let P=!1;if(M.isHydrating)M.isHydrating=!1;else if(!L){P=E&&N.transition&&N.transition.mode==="out-in";let ee=!1;P&&(E.transition.afterLeave=()=>{F===M.pendingId&&(f(N,R,i===y&&!ee?p(E):i,0),Oh(S),B&&_.ssFallback&&(_.ssFallback.el=null))}),E&&!M.isFallbackMountPending&&(m(E.el)===R&&(i=p(E),ee=!0),h(E,I,M,!0),!P&&B&&_.ssFallback&&ks(()=>_.ssFallback.el=null,M)),P||f(N,R,i,0)}M.isFallbackMountPending=!1,Tc(M,N),M.pendingBranch=null,M.isInFallback=!1;let z=M.parent,W=!1;for(;z;){if(z.pendingBranch){z.effects.push(...S),W=!0;break}z=z.parent}!W&&!P&&Oh(S),M.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),pd(_,"onResolve")},fallback(L){if(!M.pendingBranch)return;const{vnode:$,activeBranch:_,parentComponent:E,container:N,namespace:F}=M;pd($,"onFallback");const S=p(_),I=()=>{M.isFallbackMountPending=!1,M.isInFallback&&(d(null,L,N,S,E,null,F,l,a),Tc(M,L))},R=L.transition&&L.transition.mode==="out-in";R&&(M.isFallbackMountPending=!0,_.transition.afterLeave=I),M.isInFallback=!0,h(_,E,null,!0),R||I()},move(L,$,_){M.activeBranch&&f(M.activeBranch,L,$,_),M.container=L},next(){return M.activeBranch&&p(M.activeBranch)},registerDep(L,$,_){const E=!!M.pendingBranch;E&&M.deps++;const N=L.vnode.el;L.asyncDep.catch(F=>{Xc(F,L,0)}).then(F=>{if(L.isUnmounted||M.isUnmounted||M.pendingId!==L.suspenseId)return;md(),L.asyncResolved=!0;const{vnode:S}=L;Fg(L,F,!1),N&&(S.el=N);const I=!N&&L.subTree.el;$(L,S,m(N||L.subTree.el),N?null:p(L.subTree),M,r,_),I&&(S.placeholder=null,x(I)),rm(L,S.el),E&&--M.deps===0&&M.resolve()})},unmount(L,$){M.isUnmounted=!0,M.activeBranch&&h(M.activeBranch,n,L,$),M.pendingBranch&&h(M.pendingBranch,n,L,$)}};return M}function s9(e,t,n,s,o,i,r,l,a){const c=t.suspense=c3(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 o9(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Ub(s?n.default:n),e.ssFallback=s?Ub(n.fallback):ie(xs)}function Ub(e){let t;if($t(e)){const n=xa&&e._c;n&&(e._d=!1,b()),e=e(),n&&(e._d=!0,t=oo,d3())}return _t(e)&&(e=WT(e)),e=Io(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function u3(e,t){t&&t.pendingBranch?_t(e)?t.effects.push(...e):t.effects.push(e):Oh(e)}function Tc(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,rm(s,o))}function i9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Be=Symbol.for("v-fgt"),xl=Symbol.for("v-txt"),xs=Symbol.for("v-cmt"),Nc=Symbol.for("v-stc"),Vu=[];let oo=null;function b(e=!1){Vu.push(oo=e?null:[])}function d3(){Vu.pop(),oo=Vu[Vu.length-1]||null}let xa=1;function Wh(e,t=!1){xa+=e,e<0&&oo&&t&&(oo.hasOnce=!0)}function f3(e){return e.dynamicChildren=xa>0?oo||Sc:null,d3(),xa>0&&oo&&oo.push(e),e}function T(e,t,n,s,o,i){return f3(w(e,t,n,s,o,i,!0))}function ke(e,t,n,s,o){return f3(ie(e,t,n,s,o,!0))}function Ml(e){return e?e.__v_isVNode===!0:!1}function Ni(e,t){return e.type===t.type&&e.key===t.key}function Qxe(e){}const h3=({key:e})=>e??null,ah=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?En(e)||ps(e)||$t(e)?{i:Gs,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,s=0,o=null,i=e===Be?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&h3(t),ref:t&&ah(t),scopeId:nm,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:Gs};return l?(xy(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=En(n)?8:16),xa>0&&!r&&oo&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&oo.push(a),a}const ie=r9;function r9(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===U4)&&(e=xs),Ml(e)){const l=Br(e,t,!0);return n&&xy(l,n),xa>0&&!i&&oo&&(l.shapeFlag&6?oo[oo.indexOf(e)]=l:oo.push(l)),l.patchFlag=-2,l}if(f9(e)&&(e=e.__vccOpts),t){t=l9(t);let{class:l,style:a}=t;l&&!En(l)&&(t.class=Pe(l)),fn(a)&&(tm(a)&&!_t(a)&&(a=wn({},a)),t.style=Gt(a))}const r=En(e)?1:Hh(e)?128:O4(e)?64:fn(e)?4:$t(e)?2:0;return w(e,t,n,s,o,r,i,!0)}function l9(e){return e?tm(e)||J4(e)?wn({},e):e:null}function Br(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?_n(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&h3(c),ref:t&&t.ref?n&&i?_t(i)?i.concat(ah(t)):[i,ah(t)]:ah(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!==Be?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&&Br(e.ssContent),ssFallback:e.ssFallback&&Br(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Al(u,a.clone(u)),u}function Xe(e=" ",t=0){return ie(xl,null,e,t)}function by(e,t){const n=ie(Nc,null,e);return n.staticCount=t,n}function re(e="",t=!1){return t?(b(),ke(xs,null,e)):ie(xs,null,e)}function Io(e){return e==null||typeof e=="boolean"?ie(xs):_t(e)?ie(Be,null,e.slice()):Ml(e)?_r(e):ie(xl,null,String(e))}function _r(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Br(e)}function xy(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_t(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),xy(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!J4(t)?t._ctx=Gs:o===3&&Gs&&(Gs.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else $t(t)?(t={default:t,_ctx:Gs},n=32):(t=String(t),s&64?(n=16,t=[Xe(t)]):n=8);e.children=t,e.shapeFlag|=n}function _n(...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=Pe([t.class,s.class]));else if(o==="style")t.style=Gt([t.style,s.style]);else if(Od(o)){const i=t[o],r=s[o];r&&i!==r&&!(_t(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Up(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function To(e,t,n,s=null){bi(e,t,7,[n,s])}const a9=K4();let c9=0;function p3(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||a9,i={uid:c9++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new a4(!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:t3(s,o),emitsOptions:Y4(s,o),emit:null,emitted:null,propsDefaults:Jt,inheritAttrs:s.inheritAttrs,ctx:Jt,data:Jt,props:Jt,attrs:Jt,slots:Jt,refs:Jt,setupState:Jt,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=PT.bind(null,i),e.ce&&e.ce(i),i}let Ks=null;const Ys=()=>Ks||Gs;let zh,Ic;{const e=Yp(),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)}};zh=t("__VUE_INSTANCE_SETTERS__",n=>Ks=n),Ic=t("__VUE_SSR_SETTERS__",n=>_a=n)}const Jc=e=>{const t=Ks;return zh(e),e.scope.on(),()=>{e.scope.off(),zh(t)}},md=()=>{Ks&&Ks.scope.off(),zh(null)};function m3(e){return e.vnode.shapeFlag&4}let _a=!1;function g3(e,t=!1,n=!1){t&&Ic(t);const{props:s,children:o}=e.vnode,i=m3(e);jT(e,s,i,t),YT(e,o,n||t);const r=i?u9(e,t):void 0;return t&&Ic(!1),r}function u9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Tg);const{setup:s}=n;if(s){Fr();const o=e.setupContext=s.length>1?y3(e):null,i=Jc(e),r=Rd(s,e,0,[e.props,o]),l=sy(r);if(Or(),i(),(l||e.sp)&&!Nr(e)&&dy(e),l){if(r.then(md,md),t)return r.then(a=>{Fg(e,a,t)}).catch(a=>{Xc(a,e,0)});e.asyncDep=r}else Fg(e,r,t)}else v3(e,t)}function Fg(e,t,n){$t(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:fn(t)&&(e.setupState=A4(t)),v3(e,n)}let Uh,Og;function Xxe(e){Uh=e,Og=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,IT))}}const Jxe=()=>!Uh;function v3(e,t,n){const s=e.type;if(!e.render){if(!t&&Uh&&!s.render){const o=s.template||gy(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=wn(wn({isCustomElement:i,delimiters:l},r),a);s.render=Uh(o,c)}}e.render=s.render||vi,Og&&Og(e)}{const o=Jc(e);Fr();try{$T(e)}finally{Or(),o()}}}const d9={get(e,t){return so(e,"get",""),e[t]}};function y3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,d9),slots:e.slots,emit:e.emit,expose:t}}function Hd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(A4(mt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ju)return ju[n](e)},has(t,n){return n in t||n in ju}})):e.proxy}function Rg(e,t=!0){return $t(e)?e.displayName||e.name:e.name||t&&e.__name}function f9(e){return $t(e)&&"__vccOpts"in e}const D=(e,t)=>GE(e,t,_a);function vn(e,t,n){try{Wh(-1);const s=arguments.length;return s===2?fn(t)&&!_t(t)?Ml(t)?ie(e,null,[t]):ie(e,t):ie(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Ml(n)&&(n=[n]),ie(e,t,n))}finally{Wh(1)}}function e_e(){}function t_e(e,t,n,s){const o=n[s];if(o&&h9(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function h9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(js(n[s],t[s]))return!1;return xa>0&&oo&&oo.push(e),!0}const p9="3.5.35",n_e=vi,s_e=JE,o_e=ac,i_e=$4,m9={createComponentInstance:p3,setupComponent:g3,renderComponentRoot:lh,setCurrentRenderingInstance:dd,isVNode:Ml,normalizeVNode:Io,getComponentPublicInstance:Hd,ensureValidVNode:my,pushWarningContext:QE,popWarningContext:XE},r_e=m9,l_e=null,a_e=null,c_e=null;/**
17
+ * @vue/runtime-dom v3.5.35
18
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
+ * @license MIT
20
+ **/let Bg;const qb=typeof window<"u"&&window.trustedTypes;if(qb)try{Bg=qb.createPolicy("vue",{createHTML:e=>e})}catch{}const k3=Bg?e=>Bg.createHTML(e):e=>e,g9="http://www.w3.org/2000/svg",v9="http://www.w3.org/1998/Math/MathML",vr=typeof document<"u"?document:null,jb=vr&&vr.createElement("template"),y9={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"?vr.createElementNS(g9,e):t==="mathml"?vr.createElementNS(v9,e):n?vr.createElement(e,{is:n}):vr.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>vr.createTextNode(e),createComment:e=>vr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>vr.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{jb.innerHTML=k3(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=jb.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]}},Xr="transition",Cu="animation",zc=Symbol("_vtc"),b3={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},x3=wn({},B4,b3),k9=e=>(e.displayName="Transition",e.props=x3,e),El=k9((e,{slots:t})=>vn(dT,_3(e),t)),Jl=(e,t=[])=>{_t(e)?e.forEach(n=>n(...t)):e&&e(...t)},Vb=e=>e?_t(e)?e.some(t=>t.length>1):e.length>1:!1;function _3(e){const t={};for(const S in e)S in b3||(t[S]=e[S]);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=b9(o),m=p&&p[0],x=p&&p[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:M,onBeforeAppear:L=k,onAppear:$=g,onAppearCancelled:_=v}=t,E=(S,I,R,B)=>{S._enterCancelled=B,al(S,I?u:l),al(S,I?c:r),R&&R()},N=(S,I)=>{S._isLeaving=!1,al(S,d),al(S,h),al(S,f),I&&I()},F=S=>(I,R)=>{const B=S?$:g,P=()=>E(I,S,R);Jl(B,[I,P]),Kb(()=>{al(I,S?a:i),Ki(I,S?u:l),Vb(B)||Gb(I,s,m,P)})};return wn(t,{onBeforeEnter(S){Jl(k,[S]),Ki(S,i),Ki(S,r)},onBeforeAppear(S){Jl(L,[S]),Ki(S,a),Ki(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,I){S._isLeaving=!0;const R=()=>N(S,I);Ki(S,d),S._enterCancelled?(Ki(S,f),Dg(S)):(Dg(S),Ki(S,f)),Kb(()=>{S._isLeaving&&(al(S,d),Ki(S,h),Vb(y)||Gb(S,s,x,R))}),Jl(y,[S,R])},onEnterCancelled(S){E(S,!1,void 0,!0),Jl(v,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),Jl(_,[S])},onLeaveCancelled(S){N(S),Jl(M,[S])}})}function b9(e){if(e==null)return null;if(fn(e))return[Q1(e.enter),Q1(e.leave)];{const t=Q1(e);return[t,t]}}function Q1(e){return Th(e)}function Ki(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[zc]||(e[zc]=new Set)).add(t)}function al(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[zc];n&&(n.delete(t),n.size||(e[zc]=void 0))}function Kb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let x9=0;function Gb(e,t,n,s){const o=e._endId=++x9,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=w3(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 w3(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${Xr}Delay`),i=s(`${Xr}Duration`),r=Yb(o,i),l=s(`${Cu}Delay`),a=s(`${Cu}Duration`),c=Yb(l,a);let u=null,d=0,f=0;t===Xr?r>0&&(u=Xr,d=r,f=i.length):t===Cu?c>0&&(u=Cu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Xr:Cu:null,f=u?u===Xr?i.length:a.length:0);const h=u===Xr&&/\b(?:transform|all)(?:,|$)/.test(s(`${Xr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Yb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Zb(n)+Zb(e[s])))}function Zb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Dg(e){return(e?e.ownerDocument:document).body.offsetHeight}function _9(e,t,n){const s=e[zc];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const qh=Symbol("_vod"),S3=Symbol("_vsh"),pi={name:"show",beforeMount(e,{value:t},{transition:n}){e[qh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Au(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),Au(e,!0),s.enter(e)):s.leave(e,()=>{Au(e,!1)}):Au(e,t))},beforeUnmount(e,{value:t}){Au(e,t)}};function Au(e,t){e.style.display=t?e[qh]:"none",e[S3]=!t}function w9(){pi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const C3=Symbol("");function u_e(e){const t=Ys();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>jh(i,o))},s=()=>{const o=e(t.proxy);t.ce?jh(t.ce,o):Pg(t.subTree,o),n(o)};z4(()=>{Oh(s)}),yn(()=>{Qe(s,vi,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Sn(()=>o.disconnect())})}function Pg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Pg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)jh(e.el,t);else if(e.type===Be)e.children.forEach(n=>Pg(n,t));else if(e.type===Nc){let{el:n,anchor:s}=e;for(;n&&(jh(n,t),n!==s);)n=n.nextSibling}}function jh(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=bE(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[C3]=s}}const S9=/(?:^|;)\s*display\s*:/;function C9(e,t,n){const s=e.style,o=En(n);let i=!1;if(n&&!o){if(t)if(En(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Ru(s,l,"")}else for(const r in t)n[r]==null&&Ru(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?M9(e,r,!En(t)&&t?t[r]:void 0,l)||Ru(s,r,l):Ru(s,r,"")}}else if(o){if(t!==n){const r=s[C3];r&&(n+=";"+r),s.cssText=n,i=S9.test(n)}}else t&&e.removeAttribute("style");qh in e&&(e[qh]=i?s.display:"",e[S3]&&(s.display="none"))}const Qb=/\s*!important$/;function Ru(e,t,n){if(_t(n))n.forEach(s=>Ru(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=A9(e,t);Qb.test(n)?e.setProperty($o(s),n.replace(Qb,""),"important"):e[s]=n}}const Xb=["Webkit","Moz","ms"],X1={};function A9(e,t){const n=X1[t];if(n)return n;let s=Fs(t);if(s!=="filter"&&s in e)return X1[t]=s;s=Kp(s);for(let o=0;o<Xb.length;o++){const i=Xb[o]+s;if(i in e)return X1[t]=i}return t}function M9(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&En(s)&&n===s}const Jb="http://www.w3.org/1999/xlink";function ex(e,t,n,s,o,i=yE(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Jb,t.slice(6,t.length)):e.setAttributeNS(Jb,t,n):n==null||i&&!i4(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ei(n)?String(n):n)}function tx(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?k3(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=i4(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 Ar(e,t,n,s){e.addEventListener(t,n,s)}function E9(e,t,n,s){e.removeEventListener(t,n,s)}const nx=Symbol("_vei");function T9(e,t,n,s,o=null){const i=e[nx]||(e[nx]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=N9(t);if(s){const c=i[t]=L9(s,o);Ar(e,l,c,a)}else r&&(E9(e,l,r,a),i[t]=void 0)}}const sx=/(?:Once|Passive|Capture)$/;function N9(e){let t;if(sx.test(e)){t={};let s;for(;s=e.match(sx);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):$o(e.slice(2)),t]}let J1=0;const I9=Promise.resolve(),$9=()=>J1||(I9.then(()=>J1=0),J1=Date.now());function L9(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(_t(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&&bi(c,t,5,l)}}else bi(o,t,5,[s])};return n.value=e,n.attached=$9(),n}const ox=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,F9=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?_9(e,s,r):t==="style"?C9(e,n,s):Od(t)?Up(t)||T9(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):O9(e,t,s,r))?(tx(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ex(e,t,s,r,i,t!=="value")):e._isVueCE&&(R9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!En(s)))?tx(e,Fs(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),ex(e,t,s,r))};function O9(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&ox(t)&&$t(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return ox(t)&&En(n)?!1:t in e}function R9(e,t){const n=e._def.props;if(!n)return!1;const s=Fs(t);return Array.isArray(n)?n.some(o=>Fs(o)===s):Object.keys(n).some(o=>Fs(o)===s)}const ix={};function B9(e,t,n){let s=Ye(e,t);qp(s)&&(s=wn({},s,t));class o extends _y{constructor(r){super(s,r,n)}}return o.def=s,o}const d_e=((e,t)=>B9(e,t,e7)),D9=typeof HTMLElement<"u"?HTMLElement:class{};class _y extends D9{constructor(t,n={},s=Gh){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!==Gh?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(wn({},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 _y){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,gt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!_t(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Th(this._props[a])),(l||(l=Object.create(null)))[Fs(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)dn(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=_t(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(Fs))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):ix;const o=Fs(t);n&&this._numberProps&&this._numberProps[o]&&(s=Th(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===ix?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($o(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute($o(t),n+""):n||this.removeAttribute($o(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),J9(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,wn(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,qp(r[0])?wn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),$o(i)!==i&&o($o(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 P9(e){const t=Ys(),n=t&&t.ce;return n||null}function f_e(){const e=P9();return e&&e.shadowRoot}function h_e(e="$style"){{const t=Ys();if(!t)return Jt;const n=t.type.__cssModules;if(!n)return Jt;const s=n[e];return s||Jt}}const A3=new WeakMap,M3=new WeakMap,Vh=Symbol("_moveCb"),rx=Symbol("_enterCb"),H9=e=>(delete e.props.mode,e),W9=H9({name:"TransitionGroup",props:wn({},x3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ys(),s=R4();let o,i;return fy(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!V9(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(U9),o.forEach(q9);const l=o.filter(j9);Dg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Ki(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Vh]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Vh]=null,al(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=on(e),l=_3(r);let a=r.tag||Be;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),Al(u,fd(u,l,s,n)),A3.set(u,E3(u.el)))}i=t.default?uy(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Al(u,fd(u,l,s,n))}return ie(a,null,i)}}}),z9=W9;function U9(e){const t=e.el;t[Vh]&&t[Vh](),t[rx]&&t[rx]()}function q9(e){M3.set(e,E3(e.el))}function j9(e){const t=A3.get(e),n=M3.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 E3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function V9(e,t,n){const s=e.cloneNode(),o=e[zc];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}=w3(s);return i.removeChild(s),r}const Tl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _t(t)?n=>Ac(t,n):t};function K9(e){e.target.composing=!0}function lx(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const yi=Symbol("_assign");function ax(e,t,n){return t&&(e=e.trim()),n&&(e=Gp(e)),e}const wo={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[yi]=Tl(o);const i=s||o.props&&o.props.type==="number";Ar(e,t?"change":"input",r=>{r.target.composing||e[yi](ax(e.value,n,i))}),(n||i)&&Ar(e,"change",()=>{e.value=ax(e.value,n,i)}),t||(Ar(e,"compositionstart",K9),Ar(e,"compositionend",lx),Ar(e,"change",lx))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[yi]=Tl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Gp(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)}},Kh={deep:!0,created(e,t,n){e[yi]=Tl(n),Ar(e,"change",()=>{const s=e._modelValue,o=Uc(e),i=e.checked,r=e[yi];if(_t(s)){const l=Zp(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(Ea(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(N3(e,i))})},mounted:cx,beforeUpdate(e,t,n){e[yi]=Tl(n),cx(e,t,n)}};function cx(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(_t(t))o=Zp(t,s.props.value)>-1;else if(Ea(t))o=t.has(s.props.value);else{if(t===n)return;o=Lr(t,N3(e,!0))}e.checked!==o&&(e.checked=o)}const T3={created(e,{value:t},n){e.checked=Lr(t,n.props.value),e[yi]=Tl(n),Ar(e,"change",()=>{e[yi](Uc(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[yi]=Tl(s),t!==n&&(e.checked=Lr(t,s.props.value))}},Hg={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=Ea(t);Ar(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Gp(Uc(r)):Uc(r));e[yi](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,gt(()=>{e._assigning=!1})}),e[yi]=Tl(s)},mounted(e,{value:t}){ux(e,t)},beforeUpdate(e,t,n){e[yi]=Tl(n)},updated(e,{value:t}){e._assigning||ux(e,t)}};function ux(e,t){const n=e.multiple,s=_t(t);if(!(n&&!s&&!Ea(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=Uc(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Zp(t,l)>-1}else r.selected=t.has(l);else if(Lr(Uc(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Uc(e){return"_value"in e?e._value:e.value}function N3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const G9={created(e,t,n){Tf(e,t,n,null,"created")},mounted(e,t,n){Tf(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Tf(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Tf(e,t,n,s,"updated")}};function I3(e,t){switch(e){case"SELECT":return Hg;case"TEXTAREA":return wo;default:switch(t){case"checkbox":return Kh;case"radio":return T3;default:return wo}}}function Tf(e,t,n,s,o){const r=I3(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function Y9(){wo.getSSRProps=({value:e})=>({value:e}),T3.getSSRProps=({value:e},t)=>{if(t.props&&Lr(t.props.value,e))return{checked:!0}},Kh.getSSRProps=({value:e},t)=>{if(_t(e)){if(t.props&&Zp(e,t.props.value)>-1)return{checked:!0}}else if(Ea(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},G9.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=I3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const Z9=["ctrl","shift","alt","meta"],Q9={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)=>Z9.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(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=Q9[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},X9={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Xi=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=$o(o.key);if(t.some(r=>r===i||X9[r]===i))return e(o)}))},$3=wn({patchProp:F9},y9);let Ku,dx=!1;function L3(){return Ku||(Ku=QT($3))}function F3(){return Ku=dx?Ku:XT($3),dx=!0,Ku}const J9=((...e)=>{L3().render(...e)}),p_e=((...e)=>{F3().hydrate(...e)}),Gh=((...e)=>{const t=L3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=R3(s);if(!o)return;const i=t._component;!$t(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,O3(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),e7=((...e)=>{const t=F3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=R3(s);if(o)return n(o,!0,O3(o))},t});function O3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function R3(e){return En(e)?document.querySelector(e):e}let fx=!1;const m_e=()=>{fx||(fx=!0,Y9(),w9())};/*!
21
+ * shared v11.4.5
22
+ * (c) 2026 kazuya kawaguchi
23
+ * Released under the MIT License.
24
+ */function t7(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Yh=typeof window<"u",Fl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),n7=(e,t,n)=>s7({l:e,k:t,s:n}),s7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),ws=e=>typeof e=="number"&&isFinite(e),B3=e=>Sy(e)==="[object Date]",qc=e=>Sy(e)==="[object RegExp]",lm=e=>tn(e)&&Object.keys(e).length===0,Ss=Object.assign,o7=Object.create,Mn=(e=null)=>o7(e);let hx;const da=()=>hx||(hx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Mn());function px(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function i7(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const r7=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,l7=/^(?:href|src|action|formaction)$/i;function wy(e){return r7.test(e)}function a7(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+=wy(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function mx(e,t){if(l7.test(e)&&wy(t))return"about:blank";const n=e.toLowerCase()==="style"?a7(t):t;return i7(n)}function c7(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${mx(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${mx(s,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,s,o)=>wy(o)?`${s}about:blank`:n),e}const u7=Object.prototype.hasOwnProperty;function gi(e,t){return u7.call(e,t)}const os=Array.isArray,Vn=e=>typeof e=="function",yt=e=>typeof e=="string",ln=e=>typeof e=="boolean",an=e=>e!==null&&typeof e=="object",d7=e=>an(e)&&Vn(e.then)&&Vn(e.catch),D3=Object.prototype.toString,Sy=e=>D3.call(e),tn=e=>Sy(e)==="[object Object]",f7=e=>e==null?"":os(e)||tn(e)&&e.toString===D3?JSON.stringify(e,null,2):String(e);function Cy(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Nf=e=>!an(e)||os(e);function ch(e,t){if(Nf(e)||Nf(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__"&&(an(s[i])&&!an(o[i])&&(o[i]=Array.isArray(s[i])?[]:Mn()),Nf(o[i])||Nf(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 h7(e,t,n){return{line:e,column:t,offset:n}}function Wg(e,t,n){return{start:e,end:t}}const mn={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},p7=17;function am(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 m7(e){throw e}const qi=" ",g7="\r",eo=`
29
+ `,v7="\u2028",y7="\u2029";function k7(e){const t=e;let n=0,s=1,o=1,i=0;const r=$=>t[$]===g7&&t[$+1]===eo,l=$=>t[$]===eo,a=$=>t[$]===y7,c=$=>t[$]===v7,u=$=>r($)||l($)||a($)||c($),d=()=>n,f=()=>s,h=()=>o,p=()=>i,m=$=>r($)||a($)||c($)?eo:t[$],x=()=>m(n),k=()=>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 M($=0){i=$}function L(){const $=n+i;for(;$!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:x,currentPeek:k,next:g,peek:v,reset:y,resetPeek:M,skipToPeek:L}}const fr=void 0,b7=".",gx="'",x7="tokenizer";function _7(e,t={}){const n=t.location!==!1,s=k7(e),o=()=>s.index(),i=()=>h7(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,te,pe,...Se){const Ie=c();if(te.column+=pe,te.offset+=pe,u){const Fe=n?Wg(Ie.startLoc,te):null,he=am(j,Fe,{domain:x7,args:Se});u(he)}}function f(j,te,pe){j.endLoc=i(),j.currentType=te;const Se={type:te};return n&&(Se.loc=Wg(j.startLoc,j.endLoc)),pe!=null&&(Se.value=pe),Se}const h=j=>f(j,13);function p(j,te){return j.currentChar()===te?(j.next(),te):(d(mn.EXPECTED_TOKEN,i(),0,te),"")}function m(j){let te="";for(;j.currentPeek()===qi||j.currentPeek()===eo;)te+=j.currentPeek(),j.peek();return te}function x(j){const te=m(j);return j.skipToPeek(),te}function k(j){if(j===fr)return!1;const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te===95}function g(j){if(j===fr)return!1;const te=j.charCodeAt(0);return te>=48&&te<=57}function v(j,te){const{currentType:pe}=te;if(pe!==2)return!1;m(j);const Se=k(j.currentPeek());return j.resetPeek(),Se}function y(j,te){const{currentType:pe}=te;if(pe!==2)return!1;m(j);const Se=j.currentPeek()==="-"?j.peek():j.currentPeek(),Ie=g(Se);return j.resetPeek(),Ie}function M(j,te){const{currentType:pe}=te;if(pe!==2)return!1;m(j);const Se=j.currentPeek()===gx;return j.resetPeek(),Se}function L(j,te){const{currentType:pe}=te;if(pe!==7)return!1;m(j);const Se=j.currentPeek()===".";return j.resetPeek(),Se}function $(j,te){const{currentType:pe}=te;if(pe!==8)return!1;m(j);const Se=k(j.currentPeek());return j.resetPeek(),Se}function _(j,te){const{currentType:pe}=te;if(!(pe===7||pe===11))return!1;m(j);const Se=j.currentPeek()===":";return j.resetPeek(),Se}function E(j,te){const{currentType:pe}=te;if(pe!==9)return!1;const Se=()=>{const Fe=j.currentPeek();return Fe==="{"?k(j.peek()):Fe==="@"||Fe==="|"||Fe===":"||Fe==="."||Fe===qi||!Fe?!1:Fe===eo?(j.peek(),Se()):F(j,!1)},Ie=Se();return j.resetPeek(),Ie}function N(j){m(j);const te=j.currentPeek()==="|";return j.resetPeek(),te}function F(j,te=!0){const pe=(Ie=!1,Fe="")=>{const he=j.currentPeek();return he==="{"||he==="@"||!he?Ie:he==="|"?!(Fe===qi||Fe===eo):he===qi?(j.peek(),pe(!0,qi)):he===eo?(j.peek(),pe(!0,eo)):!0},Se=pe();return te&&j.resetPeek(),Se}function S(j,te){const pe=j.currentChar();return pe===fr?fr:te(pe)?(j.next(),pe):null}function I(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36}function R(j){return S(j,I)}function B(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36||te===45}function P(j){return S(j,B)}function z(j){const te=j.charCodeAt(0);return te>=48&&te<=57}function W(j){return S(j,z)}function ee(j){const te=j.charCodeAt(0);return te>=48&&te<=57||te>=65&&te<=70||te>=97&&te<=102}function U(j){return S(j,ee)}function Z(j){let te="",pe="";for(;te=W(j);)pe+=te;return pe}function ce(j){let te="";for(;;){const pe=j.currentChar();if(pe==="\\"){const Se=j.peek();Se==="{"||Se==="}"||Se==="@"||Se==="|"||Se==="\\"?(te+=pe+Se,j.next(),j.next()):(j.resetPeek(),te+=pe,j.next())}else{if(pe==="{"||pe==="}"||pe==="@"||pe==="|"||!pe)break;if(pe===qi||pe===eo)if(F(j))te+=pe,j.next();else{if(N(j))break;te+=pe,j.next()}else te+=pe,j.next()}}return te}function fe(j){x(j);let te="",pe="";for(;te=P(j);)pe+=te;const Se=j.currentChar();if(Se&&Se!=="}"&&Se!==fr&&Se!==qi&&Se!==eo&&Se!==" "){const Ie=G(j);return d(mn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe+Ie),pe+Ie}return j.currentChar()===fr&&d(mn.UNTERMINATED_CLOSING_BRACE,i(),0),pe}function oe(j){x(j);let te="";return j.currentChar()==="-"?(j.next(),te+=`-${Z(j)}`):te+=Z(j),j.currentChar()===fr&&d(mn.UNTERMINATED_CLOSING_BRACE,i(),0),te}function Y(j){return j!==gx&&j!==eo}function X(j){x(j),p(j,"'");let te="",pe="";for(;te=S(j,Y);)te==="\\"?pe+=le(j):pe+=te;const Se=j.currentChar();return Se===eo||Se===fr?(d(mn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Se===eo&&(j.next(),p(j,"'")),pe):(p(j,"'"),pe)}function le(j){const te=j.currentChar();switch(te){case"\\":case"'":return j.next(),`\\${te}`;case"u":return He(j,te,4);case"U":return He(j,te,6);default:return d(mn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,te),""}}function He(j,te,pe){p(j,te);let Se="";for(let Ie=0;Ie<pe;Ie++){const Fe=U(j);if(!Fe){d(mn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${te}${Se}${j.currentChar()}`);break}Se+=Fe}return`\\${te}${Se}`}function de(j){return j!=="{"&&j!=="}"&&j!==qi&&j!==eo}function G(j){x(j);let te="",pe="";for(;te=S(j,de);)pe+=te;return pe}function ae(j){let te="",pe="";for(;te=R(j);)pe+=te;return pe}function me(j){const te=pe=>{const Se=j.currentChar();return Se==="{"||Se==="@"||Se==="|"||Se==="("||Se===")"||!Se||Se===qi?pe:(pe+=Se,j.next(),te(pe))};return te("")}function q(j){x(j);const te=p(j,"|");return x(j),te}function ne(j,te){let pe=null;switch(j.currentChar()){case"{":return te.braceNest>=1&&d(mn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),pe=f(te,2,"{"),x(j),te.braceNest++,pe;case"}":return te.braceNest>0&&te.currentType===2&&d(mn.EMPTY_PLACEHOLDER,i(),0),j.next(),pe=f(te,3,"}"),te.braceNest--,te.braceNest>0&&x(j),te.inLinked&&te.braceNest===0&&(te.inLinked=!1),pe;case"@":return te.braceNest>0&&d(mn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=ge(j,te)||h(te),te.braceNest=0,pe;default:{let Ie=!0,Fe=!0,he=!0;if(N(j))return te.braceNest>0&&d(mn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,pe;if(te.braceNest>0&&(te.currentType===4||te.currentType===5||te.currentType===6))return d(mn.UNTERMINATED_CLOSING_BRACE,i(),0),te.braceNest=0,ue(j,te);if(Ie=v(j,te))return pe=f(te,4,fe(j)),x(j),pe;if(Fe=y(j,te))return pe=f(te,5,oe(j)),x(j),pe;if(he=M(j,te))return pe=f(te,6,X(j)),x(j),pe;if(!Ie&&!Fe&&!he)return pe=f(te,12,G(j)),d(mn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe.value),x(j),pe;break}}return pe}function ge(j,te){const{currentType:pe}=te;let Se=null;const Ie=j.currentChar();switch((pe===7||pe===8||pe===11||pe===9)&&(Ie===eo||Ie===qi)&&d(mn.INVALID_LINKED_FORMAT,i(),0),Ie){case"@":return j.next(),Se=f(te,7,"@"),te.inLinked=!0,Se;case".":return x(j),j.next(),f(te,8,".");case":":return x(j),j.next(),f(te,9,":");default:return N(j)?(Se=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,Se):L(j,te)||_(j,te)?(x(j),ge(j,te)):$(j,te)?(x(j),f(te,11,ae(j))):E(j,te)?(x(j),Ie==="{"?ne(j,te)||Se:f(te,10,me(j))):(pe===7&&d(mn.INVALID_LINKED_FORMAT,i(),0),te.braceNest=0,te.inLinked=!1,ue(j,te))}}function ue(j,te){let pe={type:13};if(te.braceNest>0)return ne(j,te)||h(te);if(te.inLinked)return ge(j,te)||h(te);switch(j.currentChar()){case"{":return ne(j,te)||h(te);case"}":return d(mn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(te,3,"}");case"@":return ge(j,te)||h(te);default:{if(N(j))return pe=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,pe;if(F(j))return f(te,0,ce(j));break}}return pe}function ye(){const{currentType:j,offset:te,startLoc:pe,endLoc:Se}=a;return a.lastType=j,a.lastOffset=te,a.lastStartLoc=pe,a.lastEndLoc=Se,a.offset=o(),a.startLoc=i(),s.currentChar()===fr?f(a,13):ue(s,a)}return{nextToken:ye,currentOffset:o,currentPosition:i,context:c}}const w7="parser",S7=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,C7=/\\([\\@{}|])/g;function A7(e,t){return t}function M7(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 E7(e={}){const t=e.location!==!1,{onError:n}=e;function s(k,g,v,y,...M){const L=k.currentPosition();if(L.offset+=y,L.column+=y,n){const $=t?Wg(v,L):null,_=am(g,$,{domain:w7,args:M});n(_)}}function o(k,g,v){const y={type:k};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(k,g,v,y){t&&(k.end=g,k.loc&&(k.loc.end=v))}function r(k,g){const v=k.context(),y=o(3,v.offset,v.startLoc);return y.value=g.replace(C7,A7),i(y,k.currentOffset(),k.currentPosition()),y}function l(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:M}=v,L=o(5,y,M);return L.index=parseInt(g,10),k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function a(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:M}=v,L=o(4,y,M);return L.key=g,k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function c(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:M}=v,L=o(9,y,M);return L.value=g.replace(S7,M7),k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:y,lastStartLoc:M}=v,L=o(8,y,M);return g.type!==11?(s(k,mn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),L.value="",i(L,y,M),{nextConsumeToken:g,node:L}):(g.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ji(g)),L.value=g.value||"",i(L,k.currentOffset(),k.currentPosition()),{node:L})}function d(k,g){const v=k.context(),y=o(7,v.offset,v.startLoc);return y.value=g,i(y,k.currentOffset(),k.currentPosition()),y}function f(k){const g=k.context(),v=o(6,g.offset,g.startLoc);let y=k.nextToken();if(y.type===8){const M=u(k);v.modifier=M.node,y=M.nextConsumeToken||k.nextToken()}switch(y.type!==9&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(y)),y=k.nextToken(),y.type===2&&(y=k.nextToken()),y.type){case 10:y.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(y)),v.key=d(k,y.value||"");break;case 4:y.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(y)),v.key=a(k,y.value||"");break;case 5:y.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(y)),v.key=l(k,y.value||"");break;case 6:y.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(y)),v.key=c(k,y.value||"");break;default:{s(k,mn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const M=k.context(),L=o(7,M.offset,M.startLoc);return L.value="",i(L,M.offset,M.startLoc),v.key=L,i(v,M.offset,M.startLoc),{nextConsumeToken:y,node:v}}}return i(v,k.currentOffset(),k.currentPosition()),{node:v}}function h(k){const g=k.context(),v=g.currentType===1?k.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,M=o(2,v,y);M.items=[];let L=null;do{const E=L||k.nextToken();switch(L=null,E.type){case 0:E.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(E)),M.items.push(r(k,E.value||""));break;case 5:E.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(E)),M.items.push(l(k,E.value||""));break;case 4:E.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(E)),M.items.push(a(k,E.value||""));break;case 6:E.value==null&&s(k,mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,ji(E)),M.items.push(c(k,E.value||""));break;case 7:{const N=f(k);M.items.push(N.node),L=N.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const $=g.currentType===1?g.lastOffset:k.currentOffset(),_=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(M,$,_),M}function p(k,g,v,y){const M=k.context();let L=y.items.length===0;const $=o(1,g,v);$.cases=[],$.cases.push(y);do{const _=h(k);L||(L=_.items.length===0),$.cases.push(_)}while(M.currentType!==13);return L&&s(k,mn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i($,k.currentOffset(),k.currentPosition()),$}function m(k){const g=k.context(),{offset:v,startLoc:y}=g,M=h(k);return g.currentType===13?M:p(k,v,y,M)}function x(k){const g=_7(k,Ss({},e)),v=g.context(),y=o(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=k),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(k)),v.currentType!==13&&s(g,mn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:x}}function ji(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 T7(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function vx(e,t){for(let n=0;n<e.length;n++)Ay(e[n],t)}function Ay(e,t){switch(e.type){case 1:vx(e.cases,t),t.helper("plural");break;case 2:vx(e.items,t);break;case 6:{Ay(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 N7(e,t={}){const n=T7(e);n.helper("normalize"),e.body&&Ay(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function I7(e){const t=e.body;return t.type===2?yx(t):t.cases.forEach(n=>yx(n)),e}function yx(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=Cy(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 cc(e){switch(e.t=e.type,e.type){case 0:{const t=e;cc(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++)cc(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++)cc(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;cc(t.key),t.k=t.key,delete t.key,t.modifier&&(cc(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 $7(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,x){r.code+=m}function c(m,x=!0){const k=x?s:"";a(o?k+" ".repeat(m):k)}function u(m=!0){const x=++r.indentLevel;m&&c(x)}function d(m=!0){const x=--r.indentLevel;m&&c(x)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function L7(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),jc(e,t.key),t.modifier?(e.push(", "),jc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function F7(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&&(jc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function O7(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&&(jc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function R7(e,t){t.body?jc(e,t.body):e.push("null")}function jc(e,t){const{helper:n}=e;switch(t.type){case 0:R7(e,t);break;case 1:O7(e,t);break;case 2:F7(e,t);break;case 6:L7(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 B7=(e,t={})=>{const n=yt(t.mode)?t.mode:"normal",s=yt(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=$7(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Cy(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),jc(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 D7(e,t={}){const n=Ss({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=E7(n).parse(e);return s?(i&&I7(l),o&&cc(l),{ast:l,code:""}):(N7(l,n),B7(l,n))}/*!
31
+ * core-base v11.4.5
32
+ * (c) 2026 kazuya kawaguchi
33
+ * Released under the MIT License.
34
+ */function P7(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(da().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(da().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function er(e){return an(e)&&My(e)===0&&(gi(e,"b")||gi(e,"body"))}const P3=["b","body"];function H7(e){return Ol(e,P3)}const H3=["c","cases"];function W7(e){return Ol(e,H3,[])}const W3=["s","static"];function z7(e){return Ol(e,W3)}const z3=["i","items"];function U7(e){return Ol(e,z3,[])}const U3=["t","type"];function My(e){return Ol(e,U3)}const q3=["v","value"];function If(e,t){const n=Ol(e,q3);if(n!=null)return n;throw gd(t)}const j3=["m","modifier"];function q7(e){return Ol(e,j3)}const V3=["k","key"];function j7(e){const t=Ol(e,V3);if(t)return t;throw gd(6)}function Ol(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(gi(e,o)&&e[o]!=null)return e[o]}return n}const K3=[...P3,...H3,...W3,...z3,...V3,...j3,...q3,...U3];function gd(e){return new Error(`unhandled node type: ${e}`)}function e0(e){return n=>V7(n,e)}function V7(e,t){const n=H7(t);if(n==null)throw gd(0);if(My(n)===1){const i=W7(n);return e.plural(i.reduce((r,l)=>[...r,kx(e,l)],[]))}else return kx(e,n)}function kx(e,t){const n=z7(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=U7(t).reduce((o,i)=>[...o,zg(e,i)],[]);return e.normalize(s)}}function zg(e,t){const n=My(t);switch(n){case 3:return If(t,n);case 9:return If(t,n);case 4:{const s=t;if(gi(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(gi(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw gd(n)}case 5:{const s=t;if(gi(s,"i")&&ws(s.i))return e.interpolate(e.list(s.i));if(gi(s,"index")&&ws(s.index))return e.interpolate(e.list(s.index));throw gd(n)}case 6:{const s=t,o=q7(s),i=j7(s);return e.linked(zg(e,i),o?zg(e,o):void 0,e.type)}case 7:return If(t,n);case 8:return If(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const K7=e=>e;let $f=Mn();function G7(e,t={}){let n=!1;const s=t.onError||m7;return t.onError=o=>{n=!0,s(o)},{...D7(e,t),detectError:n}}function Y7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yt(e)){ln(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||K7)(e),o=$f[s];if(o)return o;const{ast:i,detectError:r}=G7(e,{...t,location:!1,jit:!0}),l=e0(i);return r?l:$f[s]=l}else{const n=e.cacheKey;if(n){const s=$f[n];return s||($f[n]=e0(e))}else return e0(e)}}let vd=null;function Z7(e){vd=e}function Q7(e,t,n){vd&&vd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const X7=J7("function:translate");function J7(e){return t=>vd&&vd.emit(e,t)}const Mr={INVALID_ARGUMENT:p7,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},eN=24;function Er(e){return am(e,null,void 0)}function Ey(e,t){return t.locale!=null?bx(t.locale):bx(e.locale)}let t0;function bx(e){if(yt(e))return e;if(Vn(e)){if(e.resolvedOnce&&t0!=null)return t0;if(e.constructor.name==="Function"){const t=e();if(d7(t))throw Er(Mr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return t0=t}else throw Er(Mr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Er(Mr.NOT_SUPPORT_LOCALE_TYPE)}function tN(e,t,n){return[...new Set([n,...os(t)?t:an(t)?Object.keys(t):yt(t)?[t]:[n]])]}function Ug(e,t,n){const s=yt(n)?n:yd,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;os(r);)r=xx(i,r,t);const l=os(t)||!tn(t)?t:t.default?t.default:null;r=yt(l)?[l]:l,os(r)&&xx(i,r,!1),o.__localeChainCache.set(s,i)}return i}function xx(e,t,n){let s=!0;for(let o=0;o<t.length&&ln(s);o++){const i=t[o];yt(i)&&(s=nN(e,t[o],n))}return s}function nN(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=sN(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function sN(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),(os(n)||tn(n))&&n[o]&&(s=n[o])}return s}const Rl=[];Rl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Rl[1]={w:[1],".":[2],"[":[4],o:[7]};Rl[2]={w:[2],i:[3,0],0:[3,0]};Rl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Rl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Rl[5]={"'":[4,0],o:8,l:[5,0]};Rl[6]={'"':[4,0],o:8,l:[6,0]};const oN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function iN(e){return oN.test(e)}function rN(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 lN(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 aN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:iN(t)?rN(t):"*"+t}function cN(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=aN(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=lN(i),d=Rl[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 _x=new Map;function uN(e,t){return an(e)?e[t]:null}function dN(e,t){if(!an(e))return null;let n=_x.get(t);if(n||(n=cN(t),n&&_x.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(K3.includes(r)&&er(o)||!an(o)||!gi(o,r))return null;const l=o[r];if(l===void 0||Vn(o))return null;o=l,i++}return o}const fN="11.4.5",cm=-1,yd="en-US",Zh="",wx=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function hN(){return{upper:(e,t)=>t==="text"&&yt(e)?e.toUpperCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yt(e)?e.toLowerCase():t==="vnode"&&an(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yt(e)?wx(e):t==="vnode"&&an(e)&&"__v_isVNode"in e?wx(e.children):e}}let G3;function pN(e){G3=e}let Y3;function mN(e){Y3=e}let Z3;function gN(e){Z3=e}let Q3=null;const vN=e=>{Q3=e},yN=()=>Q3;let X3=null;const Sx=e=>{X3=e},kN=()=>X3;let Cx=0;function bN(e={}){const t=Vn(e.onWarn)?e.onWarn:t7,n=yt(e.version)?e.version:fN,s=yt(e.locale)||Vn(e.locale)?e.locale:yd,o=Vn(s)?yd:s,i=os(e.fallbackLocale)||tn(e.fallbackLocale)||yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=tn(e.messages)?e.messages:n0(o),l=tn(e.datetimeFormats)?e.datetimeFormats:n0(o),a=tn(e.numberFormats)?e.numberFormats:n0(o),c=Ss(Mn(),e.modifiers,hN()),u=e.pluralRules||Mn(),d=Vn(e.missing)?e.missing:null,f=ln(e.missingWarn)||qc(e.missingWarn)?e.missingWarn:!0,h=ln(e.fallbackWarn)||qc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,x=Vn(e.postTranslation)?e.postTranslation:null,k=tn(e.processor)?e.processor:null,g=ln(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Vn(e.messageCompiler)?e.messageCompiler:G3,M=Vn(e.messageResolver)?e.messageResolver:Y3||uN,L=Vn(e.localeFallbacker)?e.localeFallbacker:Z3||tN,$=an(e.fallbackContext)?e.fallbackContext:void 0,_=e,E=an(_.__datetimeFormatters)?_.__datetimeFormatters:new Map,N=an(_.__numberFormatters)?_.__numberFormatters:new Map,F=an(_.__meta)?_.__meta:{};Cx++;const S={version:n,cid:Cx,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:x,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:M,localeFallbacker:L,fallbackContext:$,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=E,S.__numberFormatters=N,__INTLIFY_PROD_DEVTOOLS__&&Q7(S,n,F),S}const n0=e=>({[e]:Mn()});function Ty(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return yt(l)?l:t}else return t}function Mu(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function xN(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function _N(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(xN(e,t[s]))return!0;return!1}function Ax(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!yt(t[0])&&!B3(t[0])&&!ws(t[0]))return Zh;const[a,c,u,d]=qg(...t),f=ln(u.missingWarn)?u.missingWarn:e.missingWarn;ln(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ey(e,u),m=r(e,o,p);if(!yt(a)||a===""){const L=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let x={},k,g=null;const v="datetime format";for(let L=0;L<m.length&&(k=m[L],x=n[k]||{},g=x[a],!tn(g));L++)Ty(e,a,k,f,v);if(!tn(g)||!yt(k))return s?cm:a;let y=`${k}__${a}`;lm(d)||(y=`${y}__${JSON.stringify(d)}`);let M=l.get(y);return M||(M=new Intl.DateTimeFormat(k,Ss({},g,d)),l.set(y,M)),h?M.formatToParts(c):M.format(c)}const J3=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function qg(...e){const[t,n,s,o]=e,i=Mn();let r=Mn(),l;if(yt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Er(Mr.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 Er(Mr.INVALID_ISO_DATE_ARGUMENT)}}else if(B3(t)){if(isNaN(t.getTime()))throw Er(Mr.INVALID_DATE_ARGUMENT);l=t}else if(ws(t))l=t;else throw Er(Mr.INVALID_ARGUMENT);return yt(n)?i.key=n:tn(n)&&Object.keys(n).forEach(a=>{J3.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(s)?i.locale=s:tn(s)&&(r=s),tn(o)&&(r=o),[i.key||"",l,i,r]}function Mx(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function Ex(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!ws(t[0]))return Zh;const[a,c,u,d]=jg(...t),f=ln(u.missingWarn)?u.missingWarn:e.missingWarn;ln(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Ey(e,u),m=r(e,o,p);if(!yt(a)||a===""){const L=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let x={},k,g=null;const v="number format";for(let L=0;L<m.length&&(k=m[L],x=n[k]||{},g=x[a],!tn(g));L++)Ty(e,a,k,f,v);if(!tn(g)||!yt(k))return s?cm:a;let y=`${k}__${a}`;lm(d)||(y=`${y}__${JSON.stringify(d)}`);let M=l.get(y);return M||(M=new Intl.NumberFormat(k,Ss({},g,d)),l.set(y,M)),h?M.formatToParts(c):M.format(c)}const eA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function jg(...e){const[t,n,s,o]=e,i=Mn();let r=Mn();if(!ws(t))throw Er(Mr.INVALID_ARGUMENT);const l=t;return yt(n)?i.key=n:tn(n)&&Object.keys(n).forEach(a=>{eA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(s)?i.locale=s:tn(s)&&(r=s),tn(o)&&(r=o),[i.key||"",l,i,r]}function Tx(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const wN=e=>e,SN=e=>"",CN="text",AN=e=>e.length===0?"":Cy(e),MN=f7;function s0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function EN(e){const t=ws(e.pluralIndex)?e.pluralIndex:-1;return ws(e.named?.count)?e.named.count:ws(e.named?.n)?e.named.n:t}function TN(e={}){const t=e.locale,n=EN(e),s=yt(t)&&Vn(e.pluralRules?.[t])?e.pluralRules[t]:s0,o=s===s0?void 0:s0,i=k=>k[s(n,k.length,o)],r=e.list||[],l=k=>r[k],a=e.named||Mn();ws(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=k=>a[k];function u(k,g){const v=Vn(e.messages)?e.messages(k,!!g):an(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):SN)}const d=k=>e.modifiers?e.modifiers[k]:wN,f=Vn(e.processor?.normalize)?e.processor.normalize:AN,h=Vn(e.processor?.interpolate)?e.processor.interpolate:MN,p=yt(e.processor?.type)?e.processor.type:CN,x={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,y]=g;let M="text",L="";g.length===1?an(v)?(L=v.modifier||L,M=v.type||M):yt(v)&&(L=v||L):g.length===2&&(yt(v)&&(L=v||L),yt(y)&&(M=y||M));const $=u(k,!0)(x),_=$===""||$===void 0?k:$,E=M==="vnode"&&os(_)&&L?_[0]:_;return L?d(L)(E,M):E},message:u,type:p,interpolate:h,normalize:f,values:Ss(Mn(),r,a)};return x}const Nx=()=>"",fi=e=>Vn(e);function Ix(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Vg(...t),u=ln(c.missingWarn)?c.missingWarn:e.missingWarn,d=ln(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=ln(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=yt(c.default)||ln(c.default)?ln(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(yt(p)||Vn(p)),x=Ey(e,c);f&&NN(c);let[k,g,v]=h?[a,x,l[x]||Mn()]:tA(e,a,x,r,d,u),y=k,M=a;if(!h&&!(yt(y)||er(y)||fi(y))&&m&&(y=p,M=y),!h&&(!(yt(y)||er(y)||fi(y))||!yt(g)))return o?cm:a;let L=!1;const $=()=>{L=!0},_=fi(y)?y:nA(e,a,g,y,M,$);if(L)return y;const E=LN(e,g,v,c),N=TN(E),F=IN(e,_,N);let S=s?s(F,a):F;if(f&&yt(S)&&(S=c7(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:yt(a)?a:fi(y)?y.key:"",locale:g||(fi(y)?y.locale:""),format:yt(y)?y:fi(y)?y.source:"",message:S};I.meta=Ss({},e.__meta,yN()||{}),X7(I)}return S}function NN(e){os(e.list)?e.list=e.list.map(t=>yt(t)?px(t):t):an(e.named)&&Object.keys(e.named).forEach(t=>{yt(e.named[t])&&(e.named[t]=px(e.named[t]))})}function tA(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=Mn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||Mn(),(h=a(d,t))===null&&(h=d[t]),!(yt(h)||er(h)||fi(h)));m++)if(!_N(f,u)){const x=Ty(e,t,f,i,p);x!==t&&(h=x)}return[h,f,d]}function nA(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(fi(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,$N(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function IN(e,t,n){return t(n)}function Vg(...e){const[t,n,s]=e,o=Mn();if(!yt(t)&&!ws(t)&&!fi(t)&&!er(t))throw Er(Mr.INVALID_ARGUMENT);const i=ws(t)?String(t):(fi(t),t);return ws(n)?o.plural=n:yt(n)?o.default=n:tn(n)&&!lm(n)?o.named=n:os(n)&&(o.list=n),ws(s)?o.plural=s:yt(s)?o.default=s:tn(s)&&Ss(o,s),[i,o]}function $N(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>n7(t,n,r)}}function LN(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[x,,k]=tA(u||e,h,t,l,a,c);m=x??r(k,h)}if(yt(m)||er(m)){let x=!1;const g=nA(e,h,t,m,h,()=>{x=!0});return x?Nx:g}else return fi(m)?m:Nx}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),ws(s.plural)&&(f.pluralIndex=s.plural),f}P7();/*!
35
+ * vue-i18n v11.4.5
36
+ * (c) 2026 kazuya kawaguchi
37
+ * Released under the MIT License.
38
+ */const FN="11.4.5";function ON(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(da().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(da().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(da().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(da().__INTLIFY_PROD_DEVTOOLS__=!1)}const vo={UNEXPECTED_RETURN_TYPE:eN,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 Lo(e,...t){return am(e,null,void 0)}const Kg=Fl("__translateVNode"),Gg=Fl("__datetimeParts"),Yg=Fl("__numberParts"),sA=Fl("__setPluralRules"),oA=Fl("__injectWithOption"),gc=Fl("__dispose");function kd(e){if(!an(e)||er(e))return e;for(const t in e)if(gi(e,t))if(!t.includes("."))an(e[t])&&kd(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]]=Mn()),!an(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(er(o)?K3.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!er(o)){const r=o[n[s]];an(r)&&kd(r)}}return e}function Ny(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=tn(n)?n:os(s)?Mn():{[e]:Mn()};if(os(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Mn(),ch(c,r[a])):ch(c,r)}else yt(l)&&ch(JSON.parse(l),r)}),o==null&&i)for(const l in r)gi(r,l)&&kd(r[l]);return r}function iA(e){return e.type}function rA(e,t,n){let s=an(t.messages)?t.messages:Mn();"__i18nGlobal"in n&&(s=Ny(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(an(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(an(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function $x(e){return ie(xl,null,e,0)}function bd(){return Ys()}const Lx="__INTLIFY_META__",Fx=()=>[],RN=()=>!1;let Ox=0;function Rx(e){return((t,n,s,o)=>e(n,s,bd()||void 0,o))}const BN=()=>{const e=bd();let t=null;return e&&(t=iA(e)[Lx])?{[Lx]:t}:null};function Qh(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=Yh?Q:Ta;let r=ln(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:yt(e.locale)?e.locale:yd),a=i(t&&r?t.fallbackLocale.value:yt(e.fallbackLocale)||os(e.fallbackLocale)||tn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Ny(l.value,e)),u=i(tn(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(tn(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:ln(e.missingWarn)||qc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:ln(e.fallbackWarn)||qc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:ln(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,x=Vn(e.missing)?e.missing:null,k=Vn(e.missing)?Rx(e.missing):null,g=Vn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:ln(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const M=t?t.modifiers:tn(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,$;$=(()=>{s&&Sx(null);const he={version:FN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:M,pluralRules:L,missing:k===null?void 0:k,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"}};he.datetimeFormats=u.value,he.numberFormats=d.value,he.__datetimeFormatters=tn($)?$.__datetimeFormatters:void 0,he.__numberFormatters=tn($)?$.__numberFormatters:void 0;const Ne=bN(he);return s&&Sx(Ne),Ne})(),Mu($,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const N=D({get:()=>l.value,set:he=>{$.locale=he,l.value=he}}),F=D({get:()=>a.value,set:he=>{$.fallbackLocale=he,a.value=he,Mu($,l.value,he)}}),S=D(()=>c.value),I=D(()=>u.value),R=D(()=>d.value);function B(){return Vn(g)?g:null}function P(he){g=he,$.postTranslation=he}function z(){return x}function W(he){he!==null&&(k=Rx(he)),x=he,$.missing=k}const ee=(he,Ne,Je,it,At,xt)=>{E();let wt;try{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=t?kN():void 0),wt=he($)}finally{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=void 0)}if(Je!=="translate exists"&&ws(wt)&&wt===cm||Je==="translate exists"&&!wt){const[Kt,vt]=Ne();return t&&p?it(t):At(Kt)}else{if(xt(wt))return wt;throw Lo(vo.UNEXPECTED_RETURN_TYPE)}};function U(...he){return ee(Ne=>Reflect.apply(Ix,null,[Ne,...he]),()=>Vg(...he),"translate",Ne=>Reflect.apply(Ne.t,Ne,[...he]),Ne=>Ne,Ne=>yt(Ne))}function Z(...he){const[Ne,Je,it]=he;if(it&&!an(it))throw Lo(vo.INVALID_ARGUMENT);return U(Ne,Je,Ss({resolvedMessage:!0},it||{}))}function ce(...he){return ee(Ne=>Reflect.apply(Ax,null,[Ne,...he]),()=>qg(...he),"datetime format",Ne=>Reflect.apply(Ne.d,Ne,[...he]),()=>Zh,Ne=>yt(Ne)||os(Ne))}function fe(...he){return ee(Ne=>Reflect.apply(Ex,null,[Ne,...he]),()=>jg(...he),"number format",Ne=>Reflect.apply(Ne.n,Ne,[...he]),()=>Zh,Ne=>yt(Ne)||os(Ne))}function oe(he){return he.map(Ne=>yt(Ne)||ws(Ne)||ln(Ne)?$x(String(Ne)):Ne)}const X={normalize:oe,interpolate:he=>he,type:"vnode"};function le(...he){return ee(Ne=>{let Je;const it=Ne;try{it.processor=X,Je=Reflect.apply(Ix,null,[it,...he])}finally{it.processor=null}return Je},()=>Vg(...he),"translate",Ne=>Ne[Kg](...he),Ne=>[$x(Ne)],Ne=>os(Ne))}function He(...he){return ee(Ne=>Reflect.apply(Ex,null,[Ne,...he]),()=>jg(...he),"number format",Ne=>Ne[Yg](...he),Fx,Ne=>yt(Ne)||os(Ne))}function de(...he){return ee(Ne=>Reflect.apply(Ax,null,[Ne,...he]),()=>qg(...he),"datetime format",Ne=>Ne[Gg](...he),Fx,Ne=>yt(Ne)||os(Ne))}function G(he){L=he,$.pluralRules=L}function ae(he,Ne){return ee(()=>{if(!he)return!1;const Je=yt(Ne)?Ne:l.value,it=yt(Ne)?[Je]:Ug($,a.value,Je);for(let At=0;At<it.length;At++){const xt=ne(it[At]);let wt=$.messageResolver(xt,he);if(wt===null&&(wt=xt[he]),er(wt)||fi(wt)||yt(wt))return!0}return!1},()=>[he],"translate exists",Je=>Reflect.apply(Je.te,Je,[he,Ne]),RN,Je=>ln(Je))}function me(he){let Ne=null;const Je=Ug($,a.value,l.value);for(let it=0;it<Je.length;it++){const At=c.value[Je[it]]||{},xt=$.messageResolver(At,he);if(xt!=null){Ne=xt;break}}return Ne}function q(he){const Ne=me(he);return Ne??(t?t.tm(he)||{}:{})}function ne(he){return c.value[he]||{}}function ge(he,Ne){if(o){const Je={[he]:Ne};for(const it in Je)gi(Je,it)&&kd(Je[it]);Ne=Je[he]}c.value[he]=Ne,$.messages=c.value}function ue(he,Ne){c.value[he]=c.value[he]||{};const Je={[he]:Ne};if(o)for(const it in Je)gi(Je,it)&&kd(Je[it]);Ne=Je[he],ch(Ne,c.value[he]),$.messages=c.value}function ye(he){return u.value[he]||{}}function j(he,Ne){u.value[he]=Ne,$.datetimeFormats=u.value,Mx($,he,Ne)}function te(he,Ne){u.value[he]=Ss(u.value[he]||{},Ne),$.datetimeFormats=u.value,Mx($,he,Ne)}function pe(he){return d.value[he]||{}}function Se(he,Ne){d.value[he]=Ne,$.numberFormats=d.value,Tx($,he,Ne)}function Ie(he,Ne){d.value[he]=Ss(d.value[he]||{},Ne),$.numberFormats=d.value,Tx($,he,Ne)}Ox++,t&&Yh&&(Qe(t.locale,he=>{r&&(l.value=he,$.locale=he,Mu($,l.value,a.value))}),Qe(t.fallbackLocale,he=>{r&&(a.value=he,$.fallbackLocale=he,Mu($,l.value,a.value))}));const Fe={id:Ox,locale:N,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(he){r=he,he&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Mu($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return M},get pluralRules(){return L||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(he){f=he,$.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(he){h=he,$.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(he){p=he},get fallbackFormat(){return m},set fallbackFormat(he){m=he,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(he){v=he,$.warnHtmlMessage=he},get escapeParameter(){return y},set escapeParameter(he){y=he,$.escapeParameter=he},t:U,getLocaleMessage:ne,setLocaleMessage:ge,mergeLocaleMessage:ue,getPostTranslationHandler:B,setPostTranslationHandler:P,getMissingHandler:z,setMissingHandler:W,[sA]:G};return Fe.datetimeFormats=I,Fe.numberFormats=R,Fe.rt=Z,Fe.te=ae,Fe.tm=q,Fe.d=ce,Fe.n=fe,Fe.getDateTimeFormat=ye,Fe.setDateTimeFormat=j,Fe.mergeDateTimeFormat=te,Fe.getNumberFormat=pe,Fe.setNumberFormat=Se,Fe.mergeNumberFormat=Ie,Fe[oA]=n,Fe[Kg]=le,Fe[Gg]=de,Fe[Yg]=He,Fe}function DN(e){const t=yt(e.locale)?e.locale:yd,n=yt(e.fallbackLocale)||os(e.fallbackLocale)||tn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Vn(e.missing)?e.missing:void 0,o=ln(e.silentTranslationWarn)||qc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=ln(e.silentFallbackWarn)||qc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=ln(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=tn(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Vn(e.postTranslation)?e.postTranslation:void 0,d=yt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=ln(e.sync)?e.sync:!0;let p=e.messages;if(tn(e.sharedMessages)){const M=e.sharedMessages;p=Object.keys(M).reduce(($,_)=>{const E=$[_]||($[_]={});return Ss(E,M[_]),$},p||{})}const{__i18n:m,__root:x,__injectWithOption:k}=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:x,__injectWithOption:k}}function Zg(e={}){const t=Qh(DN(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 ln(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=ln(o)?!o:o},get silentFallbackWarn(){return ln(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=ln(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 PN(e,t,n){return{beforeCreate(){const s=bd();if(!s)throw Lo(vo.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=Bx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Zg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Bx(e,o);else{this.$i18n=Zg({__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&&rA(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=bd();if(!s)throw Lo(vo.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 Bx(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[sA](t.pluralizationRules||e.pluralizationRules);const n=Ny(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 Iy={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function HN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Be?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Mn())}function lA(){return Be}const WN=Ye({name:"i18n-t",props:Ss({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ws(e)||!isNaN(e)}},Iy),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Mn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=yt(e.plural)?+e.plural:e.plural);const u=HN(t,a);return o[Kg](e.keypath,u,c)},r=Ss(Mn(),s),l=yt(e.tag)||an(e.tag)?e.tag:lA();return an(l)?vn(l,r,{default:i}):vn(l,r,i())}}}),Dx=WN;function zN(e){return os(e)&&!yt(e[0])}function aA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Mn();e.locale&&(c.locale=e.locale),yt(e.format)?c.key=e.format:an(e.format)&&(yt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?Ss(Mn(),h,{[p]:e.format[p]}):h,Mn()));const d=s(e.value,c,u);let f=[c.key];return os(d)?f=d.map((h,p)=>{const m=o[h.type],x=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return zN(x)&&(x[0].key=`${h.type}-${p}`),x}):yt(d)&&(f=[d]),f},l=Ss(Mn(),i),a=yt(e.tag)||an(e.tag)?e.tag:lA();return an(a)?vn(a,l,{default:r}):vn(a,l,r())}}const UN=Ye({name:"i18n-n",props:Ss({value:{type:Number,required:!0},format:{type:[String,Object]}},Iy),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return aA(e,t,eA,(...s)=>n[Yg](...s))}}),Px=UN;function qN(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 jN(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Lo(vo.UNEXPECTED_ERROR);const c=qN(e,l.$),u=Hx(a);return[Reflect.apply(c.t,c,[...Wx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Yh&&(r.__i18nWatcher=Qe(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Yh&&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=Hx(l);r.textContent=Reflect.apply(a.t,a,[...Wx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Hx(e){if(yt(e))return{path:e};if(tn(e)){if(!("path"in e))throw Lo(vo.REQUIRED_VALUE,"path");return e}else throw Lo(vo.INVALID_VALUE)}function Wx(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return yt(n)&&(r.locale=n),ws(o)&&(r.plural=o),ws(i)&&(r.plural=i),[t,l,r]}function VN(e,t,...n){const s=tn(n[0])?n[0]:{};(ln(s.globalInstall)?s.globalInstall:!0)&&([Dx.name,"I18nT"].forEach(i=>e.component(i,Dx)),[Px.name,"I18nN"].forEach(i=>e.component(i,Px)),[qx.name,"I18nD"].forEach(i=>e.component(i,qx))),e.directive("t",jN(t))}const KN=Fl("global-vue-i18n");function GN(e={}){const t=__VUE_I18N_LEGACY_API__&&ln(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=ln(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=YN(e,t),r=Fl("");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),tn(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=nI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&VN(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(PN(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 Tt(e={}){const t=bd();if(t==null)throw Lo(vo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Lo(vo.NOT_INSTALLED);const n=ZN(t),s=XN(n),o=iA(t),i=QN(e,o);if(i==="global")return rA(s,e,o),s;if(i==="parent"){let a=zx(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Lo(vo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Ss({},e),u=zx(n,t);c.__root=u||s;const d=Qh(c);return a.__composerExtend&&(d[gc]=a.__composerExtend(d)),oy()&&iy(()=>{const h=d[gc];h&&(h(),delete d[gc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Ss({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=Qh(a),r.__composerExtend&&(l[gc]=r.__composerExtend(l)),eI(r,t,l),r.__setInstance(t,l)}return l}function YN(e,t){const n=xE(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Zg(e)):n.run(()=>Qh(e));if(s==null)throw Lo(vo.UNEXPECTED_ERROR);return[n,s]}function ZN(e){const t=Vt(e.isCE?KN:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Lo(e.isCE?vo.NOT_INSTALLED_WITH_PROVIDE:vo.UNEXPECTED_ERROR);return t}function QN(e,t){return lm(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function XN(e){return e.mode==="composition"?e.global:e.global.__composer}function zx(e,t,n=!1){let s=null;const o=t.root;let i=JN(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[oA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function JN(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function eI(e,t,n){yn(()=>{},t),Sn(()=>{const s=n;e.__deleteInstance(t);const o=s[gc];o&&(o(),delete s[gc])},t)}const tI=["locale","fallbackLocale","availableLocales"],Ux=["t","rt","d","n","tm","te"];function nI(e,t){const n=Object.create(null);return tI.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Lo(vo.UNEXPECTED_ERROR);const r=ps(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,Ux.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Lo(vo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Ux.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const sI=Ye({name:"i18n-d",props:Ss({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Iy),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return aA(e,t,J3,(...s)=>n[Gg](...s))}}),qx=sI;ON();pN(Y7);mN(dN);gN(Ug);if(__INTLIFY_PROD_DEVTOOLS__){const e=da();e.__INTLIFY__=!0,Z7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const oI="modulepreload",iI=function(e){return"/"+e},jx={},mo=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=iI(c),c in jx)return;jx[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":oI,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)})},Lt={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",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",notifyOnApproval:"kimi-web.notify-on-approval",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 Vx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function rs(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function gs(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Vc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function um(e){const t=rs(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Wd(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function $y(){const e=rs(Lt.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 Ly(e){const n={...$y()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];gs(Lt.unread,JSON.stringify(n))}function rI(){const e=um(Lt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function o0(e){Wd(Lt.collapsedWorkspaces,Array.from(e))}function lI(){const e=um(Lt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function cA(e){Wd(Lt.workspaceOrder,Array.from(e))}function Lf(){const e=um(Lt.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 Kx(e){Wd(Lt.workspaceNameOverrides,e)}function aI(){return rs(Lt.workspaceSort)}function uA(e){gs(Lt.workspaceSort,e)}const Gx=Lt.clientId,cI="kimi-code-web",uI="web";function dI(){return{serverHttpUrl:hI(),clientId:vI(),clientName:cI,clientVersion:yI(),clientUiMode:uI}}function fI(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function hI(e){const t=fI(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function pI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function mI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return pI(e)}function vc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function gI(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 vI(){const e=rs(Gx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return gs(Gx,t),t}function yI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function kI(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function bI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function io(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 xI(e)}function xI(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 _I(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 wI(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 SI(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 CI(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const AI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Yx(e){return e.replace(/[&<>"']/g,t=>AI[t]??t)}function MI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function EI(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 Zx(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return Zx(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 Zx(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function i0(e,t){const n=Yx(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(MI(Yx(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const uc=Q(0),TI=["type","disabled","aria-label"],NI=Ye({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),T("button",{ref_key:"el",ref:n,class:Pe(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Fn(s.$slots,"default",{},void 0,!0)],10,TI))}}),dt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Dn=dt(NI,[["__scopeId","data-v-c9e67023"]]),II={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function $I(e,t){return b(),T("svg",II,[...t[0]||(t[0]=[w("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const LI=mt({name:"kimi-add-conversation",render:$I}),FI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function OI(e,t){return b(),T("svg",FI,[...t[0]||(t[0]=[w("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const RI=mt({name:"kimi-folder",render:OI}),BI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DI=["clip-path"],PI=["id"];function HI(e,t){return b(),T("svg",BI,[w("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[w("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,DI),w("defs",null,[w("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[w("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,PI)])])}const WI=mt({name:"kimi-folder-open",render:HI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),zI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function UI(e,t){return b(),T("svg",zI,[...t[0]||(t[0]=[w("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),w("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),w("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const qI=mt({name:"kimi-more",render:UI}),jI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VI(e,t){return b(),T("svg",jI,[...t[0]||(t[0]=[w("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const KI=mt({name:"kimi-search",render:VI}),GI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YI(e,t){return b(),T("svg",GI,[...t[0]||(t[0]=[w("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),w("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const ZI=mt({name:"kimi-setting",render:YI}),QI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XI(e,t){return b(),T("svg",QI,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),w("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const JI=mt({name:"tabler-layout-sidebar-left-collapse",render:XI}),e$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t$(e,t){return b(),T("svg",e$,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),w("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const n$=mt({name:"tabler-layout-sidebar-left-expand",render:t$}),s$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o$(e,t){return b(),T("svg",s$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const i$=mt({name:"ri-add-line",render:o$}),r$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function l$(e,t){return b(),T("svg",r$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const a$=mt({name:"ri-alert-line",render:l$}),c$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u$(e,t){return b(),T("svg",c$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const d$=mt({name:"ri-archive-line",render:u$}),f$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h$(e,t){return b(),T("svg",f$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const p$=mt({name:"ri-arrow-down-line",render:h$}),m$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g$(e,t){return b(),T("svg",m$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const v$=mt({name:"ri-arrow-down-s-line",render:g$}),y$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k$(e,t){return b(),T("svg",y$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const b$=mt({name:"ri-arrow-go-back-line",render:k$}),x$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _$(e,t){return b(),T("svg",x$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const w$=mt({name:"ri-arrow-right-line",render:_$}),S$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C$(e,t){return b(),T("svg",S$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const A$=mt({name:"ri-arrow-right-s-line",render:C$}),M$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function E$(e,t){return b(),T("svg",M$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const Qx=mt({name:"ri-arrow-up-line",render:E$}),T$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N$(e,t){return b(),T("svg",T$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const I$=mt({name:"ri-braces-line",render:N$}),$$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L$(e,t){return b(),T("svg",$$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const F$=mt({name:"ri-calendar-close-line",render:L$}),O$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function R$(e,t){return b(),T("svg",O$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const B$=mt({name:"ri-calendar-schedule-line",render:R$}),D$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function P$(e,t){return b(),T("svg",D$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const H$=mt({name:"ri-calendar-todo-line",render:P$}),W$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z$(e,t){return b(),T("svg",W$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const U$=mt({name:"ri-check-line",render:z$}),q$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function j$(e,t){return b(),T("svg",q$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const V$=mt({name:"ri-close-line",render:j$}),K$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G$(e,t){return b(),T("svg",K$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const Y$=mt({name:"ri-code-line",render:G$}),Z$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q$(e,t){return b(),T("svg",Z$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const X$=mt({name:"ri-collapse-diagonal-line",render:Q$}),J$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eL(e,t){return b(),T("svg",J$,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const tL=mt({name:"ri-download-line",render:eL}),nL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sL(e,t){return b(),T("svg",nL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const oL=mt({name:"ri-draggable",render:sL}),iL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rL(e,t){return b(),T("svg",iL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const lL=mt({name:"ri-equalizer-line",render:rL}),aL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cL(e,t){return b(),T("svg",aL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const uL=mt({name:"ri-expand-diagonal-line",render:cL}),dL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fL(e,t){return b(),T("svg",dL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const hL=mt({name:"ri-external-link-line",render:fL}),pL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mL(e,t){return b(),T("svg",pL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const gL=mt({name:"ri-file-add-line",render:mL}),vL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yL(e,t){return b(),T("svg",vL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const kL=mt({name:"ri-file-copy-line",render:yL}),bL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xL(e,t){return b(),T("svg",bL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const _L=mt({name:"ri-file-edit-line",render:xL}),wL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SL(e,t){return b(),T("svg",wL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const Xx=mt({name:"ri-file-line",render:SL}),CL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AL(e,t){return b(),T("svg",CL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const ML=mt({name:"ri-file-text-line",render:AL}),EL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TL(e,t){return b(),T("svg",EL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const NL=mt({name:"ri-flashlight-line",render:TL}),IL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $L(e,t){return b(),T("svg",IL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const LL=mt({name:"ri-folder-add-line",render:$L}),FL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OL(e,t){return b(),T("svg",FL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const RL=mt({name:"ri-folder-fill",render:OL}),BL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DL(e,t){return b(),T("svg",BL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const PL=mt({name:"ri-git-fork-line",render:DL}),HL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WL(e,t){return b(),T("svg",HL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const zL=mt({name:"ri-git-pull-request-line",render:WL}),UL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qL(e,t){return b(),T("svg",UL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const jL=mt({name:"ri-global-line",render:qL}),VL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KL(e,t){return b(),T("svg",VL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const Jx=mt({name:"ri-image-line",render:KL}),GL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YL(e,t){return b(),T("svg",GL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const ZL=mt({name:"ri-information-line",render:YL}),QL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XL(e,t){return b(),T("svg",QL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const JL=mt({name:"ri-links-line",render:XL}),eF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tF(e,t){return b(),T("svg",eF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const nF=mt({name:"ri-list-check",render:tF}),sF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oF(e,t){return b(),T("svg",sF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const iF=mt({name:"ri-list-unordered",render:oF}),rF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lF(e,t){return b(),T("svg",rF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const aF=mt({name:"ri-login-box-line",render:lF}),cF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uF(e,t){return b(),T("svg",cF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const dF=mt({name:"ri-mail-line",render:uF}),fF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hF(e,t){return b(),T("svg",fF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const pF=mt({name:"ri-message-line",render:hF}),mF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gF(e,t){return b(),T("svg",mF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const vF=mt({name:"ri-pause-fill",render:gF}),yF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kF(e,t){return b(),T("svg",yF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const bF=mt({name:"ri-pencil-line",render:kF}),xF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _F(e,t){return b(),T("svg",xF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const wF=mt({name:"ri-play-fill",render:_F}),SF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CF(e,t){return b(),T("svg",SF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const AF=mt({name:"ri-question-line",render:CF}),MF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function EF(e,t){return b(),T("svg",MF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const TF=mt({name:"ri-sort-desc",render:EF}),NF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IF(e,t){return b(),T("svg",NF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const $F=mt({name:"ri-sparkling-line",render:IF}),LF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FF(e,t){return b(),T("svg",LF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const OF=mt({name:"ri-star-fill",render:FF}),RF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BF(e,t){return b(),T("svg",RF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const DF=mt({name:"ri-star-line",render:BF}),PF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HF(e,t){return b(),T("svg",PF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const WF=mt({name:"ri-stop-fill",render:HF}),zF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UF(e,t){return b(),T("svg",zF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const qF=mt({name:"ri-subtract-line",render:UF}),jF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VF(e,t){return b(),T("svg",jF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const KF=mt({name:"ri-target-line",render:VF}),GF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YF(e,t){return b(),T("svg",GF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const ZF=mt({name:"ri-terminal-box-line",render:YF}),QF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XF(e,t){return b(),T("svg",QF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const JF=mt({name:"ri-time-line",render:XF}),eO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tO(e,t){return b(),T("svg",eO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const nO=mt({name:"ri-tools-line",render:tO}),sO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oO(e,t){return b(),T("svg",sO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const iO=mt({name:"ri-user-line",render:oO}),rO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
39
+ <path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
40
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
41
+ </svg>
42
+ `,lO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
43
+ <path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
44
+ </svg>
45
+ `,aO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
+ <g clip-path="url(#clip0_4626_2033)">
47
+ <path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
48
+ </g>
49
+ <defs>
50
+ <clipPath id="clip0_4626_2033">
51
+ <rect width="24" height="24" fill="white"/>
52
+ </clipPath>
53
+ </defs>
54
+ </svg>
55
+ `,cO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
56
+ <path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
57
+ <path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
58
+ <path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
59
+ </svg>
60
+ `,uO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
61
+ <path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
62
+ </svg>
63
+ `,dO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
64
+ <path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
65
+ <path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
66
+ </svg>
67
+ `,fO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',hO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',pO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',mO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',gO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',vO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',yO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',kO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',bO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',xO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',e_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',_O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',wO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',SO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',CO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',AO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',MO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',EO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',TO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',NO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',IO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',$O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',LO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',FO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',OO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',RO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',BO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',t_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',DO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',PO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',HO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',WO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',zO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',UO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',qO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',n_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',jO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',VO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',KO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',GO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',YO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',ZO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',QO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',XO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',JO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',eR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',tR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',nR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',sR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',oR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',iR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',rR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',lR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',aR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',cR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',uR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',dR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',fR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',dA={sm:14,md:16,lg:20};function kt(e,t){return{component:e,svg:t}}const fA={plus:kt(i$,pO),"chat-new":kt(LI,rO),"calendar-close":kt(F$,wO),"calendar-schedule":kt(B$,SO),"calendar-todo":kt(H$,CO),close:kt(V$,MO),check:kt(U$,AO),archive:kt(d$,gO),search:kt(KI,uO),copy:kt(kL,RO),link:kt(JL,VO),"external-link":kt(hL,FO),download:kt(tL,NO),undo:kt(b$,kO),send:kt(Qx,e_),image:kt(Jx,n_),settings:kt(ZI,dO),sliders:kt(lL,$O),"log-in":kt(aF,YO),"chevron-down":kt(v$,yO),"chevron-right":kt(A$,xO),"arrow-up":kt(Qx,e_),"arrow-down":kt(p$,vO),"arrow-right":kt(w$,bO),minus:kt(qF,lR),"panel-collapse":kt(JI,fO),"panel-expand":kt(n$,hO),expand:kt(uL,LO),collapse:kt(X$,TO),list:kt(iF,GO),sort:kt(TF,nR),grip:kt(oL,IO),folder:kt(WI,aO),"folder-closed":kt(RI,lO),"folder-plus":kt(LL,HO),"folder-solid":kt(RL,WO),file:kt(Xx,t_),"file-text":kt(ML,DO),"file-edit":kt(_L,BO),"file-plus":kt(gL,OO),"file-off":kt(Xx,t_),"image-off":kt(Jx,n_),code:kt(Y$,EO),terminal:kt(ZF,cR),pencil:kt(bF,JO),tool:kt(nO,dR),glob:kt(I$,_O),globe:kt(jL,qO),"check-list":kt(nF,KO),bolt:kt(NL,PO),"git-fork":kt(PL,zO),"git-pull-request":kt(zL,UO),message:kt(pF,QO),mail:kt(dF,ZO),user:kt(iO,fR),info:kt(ZL,jO),"help-circle":kt(AF,tR),"alert-triangle":kt(a$,mO),clock:kt(JF,uR),sparkles:kt($F,sR),target:kt(KF,aR),pause:kt(vF,XO),play:kt(wF,eR),stop:kt(WF,rR),star:kt(OF,oR),"star-outline":kt(DF,iR),"dots-horizontal":kt(qI,cO)};function hR(e){return fA[e]}function pR(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function dc(e,t="md"){const n=fA[e];return n?pR(n.svg,dA[t]):""}const g_e=[["Actions",["plus","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],je=Ye({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=D(()=>hR(t.name)),s=D(()=>dA[t.size]);return(o,i)=>n.value?(b(),ke(Vs(n.value.component),{key:0,class:"kw-icon",width:s.value,height:s.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):re("",!0)}}),mR={key:0,class:"ui-dialog__head"},gR={class:"ui-dialog__titles"},vR={key:0,class:"ui-dialog__title"},yR={key:1,class:"ui-dialog__desc"},kR={class:"ui-dialog__body"},bR={key:1,class:"ui-dialog__foot"},xR='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',_R=Ye({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=Q(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(xR)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?o.value?.querySelector(d)??null:o.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),o.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===h?(d.preventDefault(),p.focus()):!d.shiftKey&&m===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Qe(()=>n.open,async d=>{if(d){uc.value+=1,i=document.activeElement,await gt();const f=a(),h=l();(f??h[0]??o.value)?.focus()}else uc.value=Math.max(0,uc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),ms(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(uc.value=Math.max(0,uc.value-1))}),(d,f)=>(b(),ke(sm,{to:"body"},[e.open?(b(),T("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[w("div",{ref_key:"panel",ref:o,class:Pe(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(b(),T("div",mR,[Fn(d.$slots,"head",{},()=>[w("div",gR,[e.title?(b(),T("div",vR,O(e.title),1)):re("",!0),e.description?(b(),T("div",yR,O(e.description),1)):re("",!0)])],!0),ie(Dn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Me(()=>[ie(je,{name:"close",size:"md"})]),_:1})])):re("",!0),w("div",kR,[Fn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(b(),T("div",bR,[Fn(d.$slots,"foot",{},void 0,!0)])):re("",!0)],2)],32)):re("",!0)]))}}),Hr=dt(_R,[["__scopeId","data-v-3dce23a4"]]),wR={class:"sd-head"},SR=["placeholder","aria-label"],CR=["aria-selected","onClick","onMousemove"],AR={class:"sd-meta"},MR=["innerHTML"],ER={class:"sd-time"},TR=["innerHTML"],NR=["innerHTML"],IR={key:1,class:"sd-empty"},$R={class:"sd-hint"},LR=200,FR=Ye({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q(!0),r=Q(""),l=Q(null),a=Q(null),c=D(()=>{const k=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",M=v.lastPrompt??"",L=v.workspaceName??"",$=k.length>0&&y.toLowerCase().includes(k),_=k.length>0&&M.toLowerCase().includes(k),E=k.length>0&&L.toLowerCase().includes(k);if(!(k.length>0&&!$&&!_&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:M?EI(M,r.value):""}),g.length>=LR))break}return g}),u=Q(0);Qe(r,()=>{u.value=0});function d(k){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,k))}async function f(){await gt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(k){u.value=d(u.value+k),f()}function p(k){o("select",k),o("close")}function m(){const k=c.value[u.value];k&&p(k.session.id)}function x(k){k.key==="ArrowDown"?(k.preventDefault(),h(1)):k.key==="ArrowUp"?(k.preventDefault(),h(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return yn(()=>{l.value?.focus()}),(k,g)=>(b(),ke(Hr,{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:Me(()=>[w("div",wR,[ie(je,{class:"sd-search-icon",name:"search",size:"md"}),Ln(w("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:x},null,40,SR),[[wo,r.value]])])]),foot:Me(()=>[w("span",$R,O(C(n)("sidebar.searchHint")),1)]),default:Me(()=>[w("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(b(!0),T(Be,{key:0},st(c.value,(v,y)=>(b(),T("button",{key:v.session.id,class:Pe(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:M=>p(v.session.id),onMousemove:M=>u.value=y},[w("span",AR,[ie(je,{class:"sd-folder",name:"folder-closed",size:"sm"}),w("span",{class:"sd-ws",innerHTML:C(i0)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,MR),w("span",ER,O(v.session.time),1)]),w("span",{class:"sd-title",innerHTML:C(i0)(v.session.title,v.inTitle?r.value:"")},null,8,TR),v.snippetText?(b(),T("span",{key:0,class:"sd-snippet",innerHTML:C(i0)(v.snippetText,r.value)},null,8,NR)):re("",!0)],42,CR))),128)):(b(),T("div",IR,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),OR=dt(FR,[["__scopeId","data-v-a678f802"]]),RR=["aria-label"],BR=Ye({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(b(),T("span",{class:Pe(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[w("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[w("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),w("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,RR))}}),Ho=dt(BR,[["__scopeId","data-v-e5c5b17d"]]),DR={key:0,class:"ui-badge__dot","aria-hidden":"true"},PR=Ye({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(b(),T("span",{class:Pe(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(b(),T("span",DR)):re("",!0),Fn(t.$slots,"default",{},void 0,!0)],2))}}),Fo=dt(PR,[["__scopeId","data-v-5bc5cd6d"]]),xd=Q(null);function hA(e){const t=xd.value;t&&(xd.value=null,t.resolve(e))}function HR(e){return xd.value&&hA(!1),new Promise(t=>{xd.value={...e,resolve:t}})}function Wr(){return{current:xd,confirm:HR,settle:hA}}const WR=Ye({__name:"Menu",setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),T("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Fn(s.$slots,"default",{},void 0,!0)],512))}}),gl=dt(WR,[["__scopeId","data-v-60e6cd8d"]]),zR={key:0,class:"ui-menu-sep",role:"separator"},UR=["disabled"],qR=Ye({__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?(b(),T("div",zR)):(b(),T("button",{key:1,class:Pe(["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))},[Fn(t.$slots,"default",{},void 0,!0)],10,UR))}}),gn=dt(qR,[["__scopeId","data-v-f940771a"]]),Jr=6,el=8,jR=150,VR=Ye({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Q(),s=Q(),o=Q(!1),i=Q(!1),r=Q({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const x=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let M=t.placement;M==="top"&&x.top-Jr-g<el?M="bottom":M==="bottom"&&x.bottom+Jr+g>y-el?M="top":M==="left"&&x.left-Jr-k<el?M="right":M==="right"&&x.right+Jr+k>v-el&&(M="left");let L=0,$=0;M==="top"?(L=x.top-Jr-g,$=x.left+x.width/2-k/2):M==="bottom"?(L=x.bottom+Jr,$=x.left+x.width/2-k/2):M==="left"?(L=x.top+x.height/2-g/2,$=x.left-Jr-k):(L=x.top+x.height/2-g/2,$=x.right+Jr),$=Math.min(Math.max($,el),v-el-k),L=Math.min(Math.max(L,el),y-el-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(L)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,gt(()=>{u(),i.value=!0})},jR))}function f(){window.clearTimeout(l),o.value=!1,i.value=!1}function h(){o.value&&f()}function p(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return yn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const x=m.firstElementChild??null;x!==a&&(f(),p(x??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ms(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,x)=>(b(),T(Be,null,[w("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Fn(m.$slots,"default",{},void 0,!0)],512),(b(),ke(sm,{to:"body"},[Ln(w("div",{ref_key:"bubble",ref:s,class:Pe(["ui-tip__bubble",{positioned:i.value}]),style:Gt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[pi,o.value]])]))],64))}}),Yt=dt(VR,[["__scopeId","data-v-4c261eb6"]]),KR={class:"row"},GR={class:"lead","aria-hidden":"true"},YR={key:1,class:"unread-dot"},ZR={class:"left"},QR=["onKeydown"],XR={class:"act"},JR={class:"ts"},eB={class:"menu-time"},tB=Ye({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:s}=Tt(),{confirm:o}=Wr(),i=e,r=n;function l(I){const R=new Date(I);if(Number.isNaN(R.getTime()))return I;const B=P=>String(P).padStart(2,"0");return`${R.getFullYear()}-${B(R.getMonth()+1)}-${B(R.getDate())} ${B(R.getHours())}:${B(R.getMinutes())}`}const a=D(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Q(!1),u=Q(null),d=Q(null),f=Q({});function h(I){const R=I.target;d.value?.el?.contains(R)||u.value?.el?.contains(R)||x()}function p(){const I=u.value?.el;if(!I)return;const R=d.value?.el,B=I.getBoundingClientRect(),P=4,z=8,W=R?.offsetHeight??0,ee=R?.offsetWidth??0;let U=B.bottom+P;U+W>window.innerHeight-z&&(U=Math.max(z,B.top-W-P));let Z=B.right-ee;Z<z&&(Z=z),f.value={top:`${Math.round(U)}px`,left:`${Math.round(Z)}px`}}async function m(I){if(I.stopPropagation(),c.value){x();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",x),await gt(),p()}function x(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",x)}Sn(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",x)});const k=Q(!1),g=Q(""),v=Q(null);async function y(){x(),k.value=!0,g.value=i.session.title,await gt();try{v.value?.focus(),v.value?.select()}catch{}}function M(){const I=g.value.trim();I&&r("rename",i.session.id,I),k.value=!1}function L(){k.value=!1}const $=Q(!1),_=Q(!1);async function E(){const I=await io(i.session.id);$.value=I,_.value=!I,setTimeout(()=>{$.value=!1,_.value=!1,x()},1500)}function N(){x(),r("fork",i.session.id)}function F(){x(),r("export",i.session.id)}async function S(){x(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:x}),(I,R)=>(b(),T("div",{class:Pe(["se",{on:e.active}]),onClick:R[4]||(R[4]=B=>r("select",e.session.id))},[w("div",KR,[w("span",GR,[e.session.busy?(b(),ke(Ho,{key:0,size:"sm"})):e.unread?(b(),T("span",YR)):re("",!0)]),w("div",ZR,[k.value?Ln((b(),T("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":R[0]||(R[0]=B=>g.value=B),class:"rename-input",onClick:R[1]||(R[1]=bt(()=>{},["stop"])),onKeydown:[Xi(bt(M,["stop"]),["enter"]),Xi(bt(L,["stop"]),["esc"])],onBlur:M},null,40,QR)),[[wo,g.value]]):(b(),T("span",{key:1,class:"t",onDblclick:bt(y,["stop"])},O(e.session.title),33))]),ie(Yt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:Me(()=>[!k.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(b(),ke(Fo,{key:0,variant:"info",size:"sm"},{default:Me(()=>[Xe(O(C(s)("workspace.awaitingAnswer")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(Yt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:Me(()=>[!k.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(b(),ke(Fo,{key:0,variant:"warning",size:"sm"},{default:Me(()=>[Xe(O(C(s)("workspace.awaitingPermission")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(Yt,{text:C(s)("workspace.abortedTitle")},{default:Me(()=>[!k.value&&e.session.status==="aborted"?(b(),ke(Fo,{key:0,variant:"danger",size:"sm"},{default:Me(()=>[Xe(O(C(s)("workspace.aborted")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),w("span",XR,[w("span",JR,O(e.session.time),1),k.value?re("",!0):(b(),ke(Dn,{key:0,ref_key:"kebabRef",ref:u,class:Pe(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:R[2]||(R[2]=bt(B=>m(B),["stop"]))},{default:Me(()=>[ie(je,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(b(),ke(sm,{to:"body"},[c.value?(b(),ke(gl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Gt(f.value),onClick:R[3]||(R[3]=bt(()=>{},["stop"]))},{default:Me(()=>[ie(gn,{danger:_.value,onClick:E},{default:Me(()=>[ie(je,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(_.value?C(s)("sidebar.copyFailed"):$.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie(gn,{separator:""}),ie(gn,{onClick:y},{default:Me(()=>[ie(je,{name:"pencil",size:"sm"}),Xe(" "+O(C(s)("sidebar.rename")),1)]),_:1}),ie(gn,{onClick:N},{default:Me(()=>[ie(je,{name:"git-fork",size:"sm"}),Xe(" "+O(C(s)("sidebar.fork")),1)]),_:1}),ie(gn,{onClick:F},{default:Me(()=>[ie(je,{name:"download",size:"sm"}),Xe(" "+O(C(s)("sidebar.export")),1)]),_:1}),ie(gn,{danger:"",onClick:S},{default:Me(()=>[ie(je,{name:"archive",size:"sm"}),Xe(" "+O(C(s)("sidebar.archive")),1)]),_:1}),ie(gn,{separator:""}),w("div",eB,O(a.value),1)]),_:1},8,["style"])):re("",!0)]))],2))}}),nB=dt(tB,[["__scopeId","data-v-f34e9e88"]]),sB={class:"gh-top"},oB={class:"gh-name"},iB=["inert"],rB=["disabled"],lB={class:"show-more-label"},aB={class:"show-more-label"},cB={key:2,class:"group-empty"},uB=Ye({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=D({get:()=>s.renameValue,set:f=>o("updateRenameValue",f)}),r=D(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const f=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!f.some(h=>h.id===s.activeId)){const h=s.group.sessions.find(p=>p.id===s.activeId);if(h)return[...f,h]}return f}),l=D(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(f){s.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(f,h)=>(b(),T("div",{class:Pe(["group",{dragging:e.dragging}])},[w("div",{class:Pe(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=bt(p=>o("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>o("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>o("wsDragend"))},[w("div",sB,[e.isCollapsed(e.group.workspace.id)?(b(),ke(je,{key:0,class:"gh-folder",name:"folder-closed"})):(b(),ke(je,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(b(),ke(Yt,{key:2,text:e.group.workspace.root},{default:Me(()=>[w("span",oB,O(e.group.workspace.name),1)]),_:1},8,["text"])):Ln((b(),T("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=Xi(p=>o("confirmRename"),["enter"])),h[2]||(h[2]=Xi(p=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>o("cancelRename")),onClick:h[4]||(h[4]=bt(()=>{},["stop"]))},null,544)),[[wo,i.value]]),e.renamingId!==e.group.workspace.id?(b(),T("div",{key:4,class:Pe(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ie(Dn,{class:Pe(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=bt(p=>o("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Me(()=>[ie(je,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ie(Dn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=bt(p=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Me(()=>[ie(je,{name:"chat-new"})]),_:1},8,["label"])],2)):re("",!0)])],34),w("div",{class:Pe(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(b(!0),T(Be,null,st(r.value,p=>(b(),ke(nB,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=m=>o("selectSession",m)),onRename:h[11]||(h[11]=(m,x)=>o("renameSession",m,x)),onArchive:h[12]||(h[12]=m=>o("archiveSession",m)),onFork:h[13]||(h[13]=m=>o("forkSession",m)),onExport:h[14]||(h[14]=m=>o("exportSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(b(),T("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=bt(p=>o("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",lB,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,rB)):re("",!0),l.value?(b(),T("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=bt(p=>o("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",aB,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):re("",!0),e.group.sessions.length===0?(b(),T("div",cB,O(C(n)("sidebar.noSessions")),1)):re("",!0)],10,iB)],2))}}),dB=dt(uB,[["__scopeId","data-v-cdac739a"]]),fB="kimi_desktop",hB="platform",s_="kimi-desktop",o_="kimi-desktop-platform";function pB(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(fB)?(sessionStorage.setItem(s_,"1"),e=!0):e=e||sessionStorage.getItem(s_)==="1";const s=n.get(hB);s?(sessionStorage.setItem(o_,s),t=s):t=sessionStorage.getItem(o_)}catch{}return{isDesktop:e,platform:t}}const Qg=pB(),mB=Qg.isDesktop,$c=Qg.isDesktop&&Qg.platform==="darwin",gB={class:"ui-kbd"},vB=Ye({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(b(),T("span",gB,[(b(!0),T(Be,null,st(e.keys,s=>(b(),T("kbd",{key:s,class:"ui-kbd__key"},O(s),1))),128))]))}}),pr=dt(vB,[["__scopeId","data-v-32292ed8"]]),yB=["disabled","aria-pressed"],kB=Ye({__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?(b(),T("button",{key:0,class:Pe(["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))},[Fn(t.$slots,"default",{},void 0,!0)],10,yB)):(b(),T("span",{key:1,class:Pe(["ui-pill",{"is-active":e.active}])},[Fn(t.$slots,"default",{},void 0,!0)],2))}}),uh=dt(kB,[["__scopeId","data-v-317ace1a"]]),bB={class:"ch"},xB={class:"ch-brand"},_B={class:"ch-backend-ep"},wB={class:"btn-wrap"},SB={class:"search-input"},CB={key:0,class:"empty"},AB={class:"side-section-label"},MB={class:"side-section-title"},EB={class:"side-section-actions"},TB=["onDragover","onDrop"],NB={class:"side-footer"},IB={class:"section-menu-check"},$B={class:"section-menu-check"},LB={class:"section-menu-check"},FB={class:"backend-menu-name"},OB={class:"backend-menu-url"},RB=1e3,BB=Ye({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=Wr(),o=!1,i=Q(null),r=D(()=>""),l=["default","multi"];function a(Ze){const Ue=i.value?.presets[Ze]??"";return Ue?bI(Ue):""}function c(Ze){const Ue=i.value;return Ue!==null&&Ue.current===Ue.presets[Ze]}const u=e,d=t,f=Q(!1),h=x()?["⌘","K"]:["Ctrl","K"];function p(){d("loadAllSessions"),f.value=!0}function m(Ze){(Ze.metaKey||Ze.ctrlKey)&&Ze.key.toLowerCase()==="k"&&(Ze.preventDefault(),p())}yn(()=>window.addEventListener("keydown",m)),ms(()=>window.removeEventListener("keydown",m));function x(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const Ze=navigator.userAgentData;return Ze?.platform==="macOS"||Ze?.platform==="iOS"}const k=Q(!1);function g(Ze){k.value=Ze.target.scrollTop>0}const v=Q(new Set(rI()));function y(Ze){return v.value.has(Ze)}function M(Ze){const Ue=new Set(v.value);Ue.has(Ze)?Ue.delete(Ze):Ue.add(Ze),v.value=Ue,o0(Ue)}function L(){const Ze=new Set(u.groups.map(Ue=>Ue.workspace.id));v.value=Ze,o0(Ze)}function $(){const Ze=new Set;v.value=Ze,o0(Ze)}const _=D(()=>u.groups.length>0&&u.groups.every(Ze=>v.value.has(Ze.workspace.id))),E=Q(new Set);function N(Ze){return E.value.has(Ze)}function F(Ze){const Ue=new Set(E.value);Ue.has(Ze)?Ue.delete(Ze):Ue.add(Ze),E.value=Ue}function S(Ze){if(!E.value.has(Ze)){const Ue=new Set(E.value);Ue.add(Ze),E.value=Ue}d("loadMoreSessions",Ze)}const I=Q(null),R=Q(null);function B(Ze){I.value=Ze}function P(){I.value=null,R.value=null}function z(Ze){const Ue=Ze.currentTarget.getBoundingClientRect();return Ze.clientY<Ue.top+Ue.height/2?"before":"after"}function W(Ze,Ue){I.value===null||I.value===Ue||(Ze.preventDefault(),Ze.dataTransfer&&(Ze.dataTransfer.dropEffect="move"),R.value={id:Ue,position:z(Ze)})}function ee(Ze){const Ue=I.value,Ft=R.value?.id===Ze?R.value.position:"before";if(R.value=null,I.value=null,!Ue||Ue===Ze)return;const jt=SI(u.groups.map(en=>en.workspace.id),Ue,Ze,Ft);d("reorderWorkspaces",jt)}function U(Ze,Ue){Ue.target.closest(".gh-more, .gh-add")||M(Ze)}function Z(Ze){d("select",Ze)}const ce=Q(null),fe=Q(""),oe=Q(null);function Y(){return oe}function X(Ze,Ue){ce.value=Ze,fe.value=Ue,gt().then(()=>oe.value?.focus())}function le(){const Ze=ce.value,Ue=fe.value.trim();Ze&&Ue&&d("renameWorkspace",Ze,Ue),ce.value=null}function He(){ce.value=null}function de(Ze){fe.value=Ze}const G=Q(!1),ae=Q(null),me=Q({}),q=Q(null);function ne(Ze){q.value?.el&&!q.value.el.contains(Ze.target)&&ue()}function ge(Ze,Ue){Ue.preventDefault(),Ue.stopPropagation(),ae.value=Ze,me.value={top:`${Ue.clientY}px`,left:`${Ue.clientX}px`},G.value=!0,document.addEventListener("mousedown",ne,!0)}function ue(){G.value=!1,document.removeEventListener("mousedown",ne,!0),ae.value=null}function ye(){ae.value&&io(ae.value.root),ue()}function j(){ae.value&&X(ae.value.id,ae.value.name),ue()}async function te(){const Ze=ae.value;Ze&&(ue(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ze.name}),variant:"danger"})&&d("deleteWorkspace",Ze.id))}const pe=Q(null),Se=Q(null),Ie=Q({}),Fe=Q(null);function he(Ze){const Ue=Ze.target;Ue.closest(".gh-more")||Ue.closest(".ws-menu")||Je()}async function Ne(Ze,Ue){if(pe.value===Ze.id){Je();return}const Ft=Ue.currentTarget;Se.value=Ze,pe.value=Ze.id,document.addEventListener("mousedown",he),window.addEventListener("resize",Je),await gt();const jt=Fe.value?.el,en=Ft.getBoundingClientRect(),Qt=4,un=8,Wn=jt?.offsetHeight??0,Nt=jt?.offsetWidth??0;let fs=en.bottom+Qt;fs+Wn>window.innerHeight-un&&(fs=Math.max(un,en.top-Wn-Qt));let ts=en.right-Nt;ts<un&&(ts=un),Ie.value={top:`${Math.round(fs)}px`,left:`${Math.round(ts)}px`}}function Je(){pe.value=null,Se.value=null,document.removeEventListener("mousedown",he),window.removeEventListener("resize",Je)}function it(Ze){io(Ze.root),Je()}function At(Ze){X(Ze.id,Ze.name),Je()}async function xt(Ze){Je(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ze.name}),variant:"danger"})&&d("deleteWorkspace",Ze.id)}const wt=Q(!1),Kt=Q({}),vt=Q(null);function cn(Ze){const Ue=Ze.target;Ue.closest(".side-section-kebab")||Ue.closest(".section-menu")||Un()}async function Kn(Ze){if(wt.value){Un();return}const Ue=Ze.currentTarget;wt.value=!0,document.addEventListener("mousedown",cn),window.addEventListener("resize",Un),await gt();const Ft=vt.value?.el,jt=Ue.getBoundingClientRect(),en=4,Qt=8,un=Ft?.offsetHeight??0,Wn=Ft?.offsetWidth??0;let Nt=jt.bottom+en;Nt+un>window.innerHeight-Qt&&(Nt=Math.max(Qt,jt.top-un-en));let fs=jt.right-Wn;fs<Qt&&(fs=Qt),Kt.value={top:`${Math.round(Nt)}px`,left:`${Math.round(fs)}px`}}function Un(){wt.value=!1,document.removeEventListener("mousedown",cn),window.removeEventListener("resize",Un)}function Zt(Ze){d("setWorkspaceSortMode",Ze),Un()}const bn=Q(!1),Pn=Q({}),rt=Q(null);function Hn(Ze){const Ue=Ze.target;Ue.closest(".ch-backend")||Ue.closest(".backend-menu")||xn()}async function Os(Ze){if(i.value===null)return;if(bn.value){xn();return}const Ue=Ze.currentTarget;bn.value=!0,document.addEventListener("mousedown",Hn),window.addEventListener("resize",xn),await gt();const Ft=rt.value?.el,jt=Ue.getBoundingClientRect(),en=4,Qt=8,un=Ft?.offsetHeight??0;let Wn=jt.bottom+en;Wn+un>window.innerHeight-Qt&&(Wn=Math.max(Qt,jt.top-un-en)),Pn.value={top:`${Math.round(Wn)}px`,left:`${Math.round(Math.max(Qt,jt.left))}px`}}function xn(){bn.value=!1,document.removeEventListener("mousedown",Hn),window.removeEventListener("resize",xn)}async function ls(Ze){if(c(Ze)){xn();return}if(await kI(Ze)===null){xn();return}window.location.reload()}ms(()=>{document.removeEventListener("mousedown",ne,!0),document.removeEventListener("mousedown",he),document.removeEventListener("mousedown",cn),document.removeEventListener("mousedown",Hn),window.removeEventListener("resize",Je),window.removeEventListener("resize",Un),window.removeEventListener("resize",xn)});const As=Q(null);let nn;function as(){const Ze=As.value;Ze&&(Ze.classList.remove("blink-now"),Ze.getBoundingClientRect(),Ze.classList.add("blink-now"),clearTimeout(nn),nn=setTimeout(()=>Ze.classList.remove("blink-now"),300))}const hn=Ii(()=>mo(()=>import("./DesignSystemView-GbzPebf3.js"),__vite__mapDeps([0,1]))),cs=Q(!1);let us,On=!1;function es(Ze){On=!1,clearTimeout(us),Ze.currentTarget.setPointerCapture?.(Ze.pointerId),us=setTimeout(()=>{On=!0,cs.value=!0},RB)}function ds(Ze){clearTimeout(us);const Ue=Ze.currentTarget;Ue.hasPointerCapture?.(Ze.pointerId)&&Ue.releasePointerCapture(Ze.pointerId)}function Ht(){if(On){On=!1;return}as()}return ms(()=>{clearTimeout(us)}),(Ze,Ue)=>(b(),T("aside",{class:Pe(["side",{"macos-desktop":C($c),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Gt({width:e.collapsed?"0px":e.colWidth+"px"})},[w("div",{class:"col",style:Gt({width:e.colWidth+"px"})},[w("div",bB,[w("div",xB,[C($c)?re("",!0):(b(),T(Be,{key:0},[(b(),T("svg",{ref_key:"logoRef",ref:As,class:Pe(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Ht,onPointerdown:es,onPointerup:ds,onPointercancel:ds},[...Ue[22]||(Ue[22]=[by('<defs data-v-00288d28><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-00288d28><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-00288d28></rect><g class="ch-eyes" fill="#000" data-v-00288d28><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-00288d28></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-00288d28></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-00288d28></rect>',2)])],34)),Ue[23]||(Ue[23]=w("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(b(),ke(uh,{key:0,class:"ch-backend",clickable:i.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:r.value}),onClick:Os},{default:Me(()=>[w("span",{class:Pe(["ch-backend-kind",`is-${e.backend}`])},O(e.backend),3),w("span",_B," · "+O(r.value),1),i.value!==null?(b(),ke(je,{key:0,name:"chevron-down",size:"sm"})):re("",!0)]),_:1},8,["clickable","title"])):re("",!0)],64))]),C($c)?re("",!0):(b(),ke(Dn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Ue[0]||(Ue[0]=bt(Ft=>d("collapse"),["stop"]))},{default:Me(()=>[ie(je,{name:"panel-collapse"})]),_:1},8,["label"]))]),w("div",wB,[w("button",{class:"btn-new-chat",type:"button",onClick:Ue[1]||(Ue[1]=bt(Ft=>d("create"),["stop"]))},[ie(je,{name:"chat-new"}),w("span",null,O(C(n)("sidebar.newChat")),1)]),re("",!0)]),w("div",{class:Pe(["search-wrap",{"search-wrap--scrolled":k.value}])},[w("button",{class:"search",type:"button",onClick:p},[ie(je,{class:"search-icon",name:"search"}),w("span",SB,O(C(n)("sidebar.search")),1),ie(pr,{keys:C(h)},null,8,["keys"])])],2),w("div",{class:"sessions",onScroll:g},[e.groups.length===0?(b(),T("div",CB,O(C(n)("workspace.noWorkspace")),1)):(b(),T(Be,{key:1},[w("div",AB,[w("span",MB,O(C(n)("sidebar.workspaces")),1),w("div",EB,[ie(Dn,{class:"side-section-toggle",size:"sm",label:_.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Ue[3]||(Ue[3]=bt(Ft=>_.value?$():L(),["stop"]))},{default:Me(()=>[_.value?(b(),ke(je,{key:0,name:"expand"})):(b(),ke(je,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(Dn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":wt.value,onClick:Ue[4]||(Ue[4]=bt(Ft=>Kn(Ft),["stop"]))},{default:Me(()=>[ie(je,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(b(!0),T(Be,null,st(e.groups,Ft=>(b(),T("div",{key:Ft.workspace.id,class:Pe(["ws-drop-target",{"drop-before":R.value?.id===Ft.workspace.id&&R.value.position==="before","drop-after":R.value?.id===Ft.workspace.id&&R.value.position==="after"}]),onDragover:jt=>W(jt,Ft.workspace.id),onDrop:jt=>ee(Ft.workspace.id)},[ie(dB,{group:Ft,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":ce.value,"rename-value":fe.value,"rename-input-ref":Y(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":pe.value,dragging:I.value===Ft.workspace.id,"is-collapsed":y,"is-expanded":N,onGroupClick:U,onGroupContextmenu:ge,onToggleWsMenu:Ne,onCreateInWorkspace:Ue[5]||(Ue[5]=jt=>d("createInWorkspace",jt)),onSelectSession:Z,onRenameSession:Ue[6]||(Ue[6]=(jt,en)=>d("rename",jt,en)),onArchiveSession:Ue[7]||(Ue[7]=jt=>d("archive",jt)),onForkSession:Ue[8]||(Ue[8]=jt=>d("fork",jt)),onExportSession:Ue[9]||(Ue[9]=jt=>d("export",jt)),onLoadMore:S,onToggleExpand:F,onConfirmRename:le,onCancelRename:He,onUpdateRenameValue:de,onWsDragstart:B,onWsDragend:P},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,TB))),128))],64))],32),w("div",NB,[w("button",{class:"btn-settings",type:"button",onClick:Ue[10]||(Ue[10]=bt(Ft=>d("openSettings"),["stop"]))},[ie(je,{name:"settings"}),w("span",null,O(C(n)("settings.title")),1)])])],4),G.value?(b(),ke(gl,{key:0,ref_key:"ghMenuRef",ref:q,class:"gh-menu",style:Gt(me.value),onClick:Ue[11]||(Ue[11]=bt(()=>{},["stop"]))},{default:Me(()=>[ie(gn,{onClick:ye},{default:Me(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(gn,{onClick:j},{default:Me(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1}),ie(gn,{danger:"",onClick:te},{default:Me(()=>[Xe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),pe.value!==null&&Se.value?(b(),ke(gl,{key:1,ref_key:"wsMenuRef",ref:Fe,class:"ws-menu",style:Gt(Ie.value),onClick:Ue[15]||(Ue[15]=bt(()=>{},["stop"]))},{default:Me(()=>[ie(gn,{onClick:Ue[12]||(Ue[12]=Ft=>it(Se.value))},{default:Me(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie(gn,{separator:""}),ie(gn,{onClick:Ue[13]||(Ue[13]=Ft=>At(Se.value))},{default:Me(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1}),ie(gn,{separator:""}),ie(gn,{danger:"",onClick:Ue[14]||(Ue[14]=Ft=>xt(Se.value))},{default:Me(()=>[Xe(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),wt.value?(b(),ke(gl,{key:2,ref_key:"sectionMenuRef",ref:vt,class:"section-menu",style:Gt(Kt.value),onClick:Ue[18]||(Ue[18]=bt(()=>{},["stop"]))},{default:Me(()=>[ie(gn,{onClick:Ue[16]||(Ue[16]=Ft=>Zt("manual"))},{default:Me(()=>[w("span",IB,[e.workspaceSortMode==="manual"?(b(),ke(je,{key:0,name:"check",size:"sm"})):re("",!0)]),Xe(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),ie(gn,{onClick:Ue[17]||(Ue[17]=Ft=>Zt("recent"))},{default:Me(()=>[w("span",$B,[e.workspaceSortMode==="recent"?(b(),ke(je,{key:0,name:"check",size:"sm"})):re("",!0)]),Xe(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):re("",!0),bn.value?(b(),ke(gl,{key:3,ref_key:"backendMenuRef",ref:rt,class:"backend-menu",style:Gt(Pn.value),onClick:Ue[19]||(Ue[19]=bt(()=>{},["stop"]))},{default:Me(()=>[(b(),T(Be,null,st(l,Ft=>ie(gn,{key:Ft,onClick:jt=>ls(Ft)},{default:Me(()=>[w("span",LB,[c(Ft)?(b(),ke(je,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",FB,O(Ft),1),w("span",OB,O(a(Ft)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):re("",!0),f.value?(b(),ke(OR,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:Z,onClose:Ue[20]||(Ue[20]=Ft=>f.value=!1)},null,8,["sessions","active-id"])):re("",!0),(b(),ke(sm,{to:"body"},[cs.value?(b(),ke(C(hn),{key:0,onClose:Ue[21]||(Ue[21]=Ft=>cs.value=!1)})):re("",!0)]))],6))}}),DB=dt(BB,[["__scopeId","data-v-00288d28"]]);function PB(e){try{const t=rs(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function HB(e,t){try{gs(e,String(t))}catch{}}function WB(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(C4(o),Math.max(s,Math.round(k))):n}const l=Q(r(PB(t)??n)),a=Q(!1);function c(k){const g=r(k);l.value=g,HB(t,g)}let u=0,d=0,f=null,h=-1;function p(k){if(!a.value)return;const g=k.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function x(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,h=k.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return ms(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:x}}const zB=["aria-label"],UB=Ye({__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}=Tt(),{width:i,dragging:r,onPointerDown:l}=WB({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Qe(i,a=>s("update:width",a)),Qe(r,a=>s("update:dragging",a)),(a,c)=>(b(),T("div",{class:Pe(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[w("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,zB))}}),i_=dt(UB,[["__scopeId","data-v-ad762f1c"]]),qB={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},jB={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…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},VB={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},KB={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},GB={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},YB={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",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"},ZB={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},QB={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"},XB={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"},JB={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"},eD={justNow:"just now"},tD={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"},nD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},sD={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"},oD={panelTitle:"Thinking",close:"Close"},iD={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"},rD={},lD={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},aD={searching:"Searching…",noMatch:"No matches"},cD={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."}},uD={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve 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"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},dD={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},fD={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},hD={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",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},pD={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},mD={preview:"预览",confirm:"确认",cancel:"取消"},gD={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},vD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},yD={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},kD={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},bD={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},xD={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",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:" · 思考",thinkingSuffixEffort:" · {level}"},_D={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 后重试"},wD={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 关闭"},SD={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},CD={justNow:"刚刚"},AD={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:"拒绝并退出"},MD={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},ED={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:"展开"},TD={panelTitle:"思考过程",close:"关闭"},ND={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},ID={},$D={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},LD={searching:"搜索中…",noMatch:"无匹配"},FD={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:"目标描述太长了,请精简后重试。"}},OD={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},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 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},RD={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},BD={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},DD={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},PD={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},HD={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"},WD={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},zD={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},UD={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},qD={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},jD={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},VD={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"},KD={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},GD={en:{common:qB,app:jB,sidebar:VB,workspace:KB,conversation:GB,status:YB,composer:ZB,login:QB,providers:XB,model:JB,sessions:eD,approval:tD,question:nD,tasks:sD,thinking:oD,diff:iD,fileTree:rD,filePreview:lD,mention:aD,warnings:cD,commands:uD,tools:dD,layout:fD,mobile:hD,theme:pD,onboarding:HD,settings:zD,header:qD,sideChat:VD},zh:{common:mD,app:gD,sidebar:vD,workspace:yD,conversation:kD,status:bD,composer:xD,login:_D,providers:wD,model:SD,sessions:CD,approval:AD,question:MD,tasks:ED,thinking:TD,diff:ND,fileTree:ID,filePreview:$D,mention:LD,warnings:FD,commands:OD,tools:RD,layout:BD,mobile:DD,theme:PD,onboarding:WD,settings:UD,header:jD,sideChat:KD}},pA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function YD(){const e=rs(Lt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const An=GN({legacy:!1,locale:YD(),fallbackLocale:"en",messages:GD});function mA(e){An.global.locale.value=e,gs(Lt.locale,e)}const no=An.global.t,ZD={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},QD={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function Na(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return QD[t]??t}function Ia(e){const t=ZD[Na(e)];return t?no(t):e}const XD={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function dm(e){const t=Na(e);let n=XD[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),dc(n,"sm")}const gA=80;function JD(e,t=gA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function eP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function tP(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 Xt(e){return typeof e=="string"&&e.length>0?e:void 0}function cl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function nP(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 r0(e){return Xt(e.path)??Xt(e.file_path)??Xt(e.filePath)??Xt(e.filename)}const sP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function oP(e){const t=Xt(e);if(!t)return;const n=sP[t];return n?no(n):t}function iP(e){const t=cl(e.value),n=Xt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return no("tools.goal.turns",{value:t});case"tokens":return no("tools.goal.tokens",{value:t});case"milliseconds":return no("tools.goal.milliseconds",{value:t});case"seconds":return no("tools.goal.seconds",{value:t});case"minutes":return no("tools.goal.minutes",{value:t});case"hours":return no("tools.goal.hours",{value:t});default:return no("tools.goal.budget",{value:t,unit:n})}}const rP=64;function _d(e,t,n=!1){const s=(o,i=gA)=>n?o.trim():JD(o,i);try{const o=tP(t);if(!n&&eP(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(Na(e)){case"read":{const r=r0(o);if(!r)return i();const l=cl(o.offset)??cl(o.line_start)??cl(o.start_line),a=cl(o.limit)??cl(o.length),c=cl(o.line_end)??cl(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=r0(o);return r?s(`${r} ${no("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=r0(o);return r?s(r):i()}case"bash":{const r=Xt(o.command)??Xt(o.cmd)??Xt(o.script);return r?s(r,rP):i()}case"grep":case"search":{const r=Xt(o.pattern)??Xt(o.query)??Xt(o.regex),l=Xt(o.path)??Xt(o.glob)??Xt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Xt(o.pattern)??Xt(o.glob)??Xt(o.query),l=Xt(o.path)??Xt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Xt(o.path)?s(Xt(o.path)):i()}case"ls":{const r=Xt(o.path)??Xt(o.dir)??Xt(o.directory)??Xt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Xt(o.url)??Xt(o.uri);return r?s(nP(r)):i()}case"todo":case"task":{const r=Xt(o.description)??Xt(o.title)??Xt(o.prompt)??Xt(o.name)??Xt(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(no("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Xt(o.objective),l=Xt(o.completionCriterion);return r&&l?s(no("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?s(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=iP(o);return r?s(r):i()}case"updategoal":{if(n)return i();const r=oP(o.status);return r?s(no("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function lP(e){try{switch(Na(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return no("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 no("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?no("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const aP=Ye({__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=D(()=>n(t.status));return(o,i)=>(b(),T("span",{class:Pe(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),wd=dt(aP,[["__scopeId","data-v-e36198e5"]]),cP=["innerHTML"],uP={class:"bh-text"},dP={class:"a"},fP={key:0,class:"p"},hP={class:"rt"},pP=["aria-label"],mP={key:0,class:"tm"},gP=["inert"],vP={class:"bb-pad"},yP=Ye({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,s=Vt("pinScroll",()=>{}),o=Q(null);function i(){n("toggle");const r=o.value;r&&gt(()=>s(r))}return(r,l)=>(b(),T("div",{class:Pe(["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"}])},[w("div",{class:"bh",ref_key:"bhEl",ref:o,onClick:i},[e.icon?(b(),T("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,cP)):re("",!0),w("span",uP,[w("span",dP,O(e.name),1),ie(Yt,{text:e.arg},{default:Me(()=>[e.arg?(b(),T("span",fP,O(e.arg),1)):re("",!0)]),_:1},8,["text"])]),w("span",hP,[w("span",{class:Pe(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(b(),ke(je,{key:0,name:"check",size:"sm"})):e.status==="error"?(b(),ke(je,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(b(),ke(wd,{key:2,status:"suspended"})):(b(),ke(wd,{key:3,status:"running"}))],10,pP),Fn(r.$slots,"trailing"),e.time?(b(),T("span",mP,O(e.time),1)):re("",!0)]),e.expandable?(b(),ke(je,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):re("",!0)],512),w("div",{class:Pe(["bb",{open:e.open}]),inert:!e.open},[w("div",vP,[Fn(r.$slots,"default")])],10,gP)],2))}}),fm=dt(yP,[["__scopeId","data-v-fef8aad2"]]),kP={key:0,class:"at-type"},bP={key:1,class:"at-task"},xP={key:2,class:"bb-code"},_P=Ye({__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}=Tt(),s=e,o=t;function i(k){if(!k)return{};try{const g=JSON.parse(k);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=D(()=>i(s.tool.arg)),l=D(()=>!!s.tool.output&&s.tool.output.length>0),a=D(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Q(s.tool.defaultExpanded===!0&&a.value),u=D(()=>s.tool.status),d=D(()=>Ia(s.tool.name)),f=D(()=>dm(s.tool.name)),h=D(()=>r.value.description||r.value.subagentType||""),p=Vt("resolveAgentTaskId"),m=D(()=>p?p(s.tool.id)!==void 0:!0);function x(){a.value&&(c.value=!c.value)}return Qe(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(b(),ke(fm,{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:x},{trailing:Me(()=>[m.value?(b(),T("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=bt(v=>o("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):re("",!0)]),default:Me(()=>[r.value.subagentType?(b(),T("div",kP,O(r.value.subagentType),1)):re("",!0),r.value.prompt?(b(),T("div",bP,O(r.value.prompt),1)):re("",!0),l.value?(b(),T("div",xP,[(b(!0),T(Be,null,st(e.tool.output??[],(v,y)=>(b(),T("div",{key:y},O(v),1))),128))])):re("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),wP=dt(_P,[["__scopeId","data-v-14ef8750"]]);function SP(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const s=[];for(const o of n){if(!o||typeof o!="object")continue;const i=o,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];s.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return s}catch{return[]}}const Ff={recognized:!1,answers:{},note:""};function CP(e){const t=e?.[0];if(!t)return Ff;let n;try{n=JSON.parse(t)}catch{return Ff}if(!n||typeof n!="object"||Array.isArray(n))return Ff;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return Ff;const o={};for(const[i,r]of Object.entries(s))typeof r=="string"?o[i]=r:r===!0&&(o[i]=!0);return{recognized:!0,answers:o,note:typeof n.note=="string"?n.note:""}}function AP(e,t,n){return e[t]??e[`q_${n}`]}const MP=/^opt_\d+_(\d+)$/;function EP(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const s=n.get(e);if(s!==void 0)return{selected:new Set([s]),otherText:"",indeterminate:!1};const o=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){o.add(a);continue}const c=MP.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const TP={key:0,class:"chip"},NP={key:0,class:"au-dismissed"},IP={key:1,class:"au-list"},$P={class:"au-q"},LP={key:0,class:"au-hdr"},FP={class:"au-qtext"},OP={class:"au-opts"},RP={class:"au-glyph"},BP={class:"au-label"},DP={key:0,class:"au-desc"},PP={key:0,class:"au-opt sel"},HP={class:"au-glyph"},WP={class:"au-label"},zP={key:1,class:"au-opt sel"},UP={class:"au-label"},qP={key:2,class:"au-raw"},jP=80,VP=Ye({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Tt();function s($,_=jP){const E=$.trim();return E.length>_?E.slice(0,_-1)+"…":E}const o=D(()=>SP(t.tool.arg)),i=D(()=>CP(t.tool.output)),r=D(()=>i.value.recognized),l=D(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=D(()=>o.value.map(($,_)=>EP(AP(i.value.answers,$.question,_),$.options))),c=D(()=>Object.keys(i.value.answers).length);function u($,_){return a.value[$]?.selected.has(_)??!1}function d($){return a.value[$]?.otherText??""}function f($){return a.value[$]?.indeterminate??!1}function h($,_){return $?_?"■":"□":_?"●":"○"}const p=D(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const $=o.value[0]?.question??"",_=s($);return o.value.length<=1?_:`${_} ${n("tools.ask.more",{count:o.value.length-1})}`}),m=D(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),x=D(()=>!!t.tool.output&&t.tool.output.length>0),k=D(()=>r.value&&(o.value.length>0||l.value)||x.value),g=Q(t.tool.defaultExpanded===!0&&k.value),v=D(()=>t.tool.status),y=D(()=>Ia(t.tool.name)),M=D(()=>dm(t.tool.name));function L(){k.value&&(g.value=!g.value)}return Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),($,_)=>(b(),ke(fm,{status:v.value,icon:M.value,name:y.value,arg:g.value?"":p.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:L},{trailing:Me(()=>[m.value?(b(),T("span",TP,O(m.value),1)):re("",!0)]),default:Me(()=>[l.value?(b(),T("div",NP,O(i.value.note),1)):r.value?(b(),T("div",IP,[(b(!0),T(Be,null,st(o.value,(E,N)=>(b(),T("div",{key:N,class:"au-block"},[w("div",$P,[E.header?(b(),T("span",LP,O(E.header),1)):re("",!0),w("span",FP,O(E.question),1)]),w("div",OP,[(b(!0),T(Be,null,st(E.options,(F,S)=>(b(),T("div",{key:S,class:Pe(["au-opt",{sel:u(N,S)}])},[w("span",RP,O(h(E.multiSelect,u(N,S))),1),w("span",BP,O(F.label),1),F.description?(b(),T("span",DP,O(F.description),1)):re("",!0)],2))),128)),d(N)?(b(),T("div",PP,[w("span",HP,O(h(E.multiSelect,!0)),1),w("span",WP,O(d(N)),1)])):re("",!0),f(N)?(b(),T("div",zP,[_[0]||(_[0]=w("span",{class:"au-glyph"},"●",-1)),w("span",UP,O(C(n)("tools.ask.answered")),1)])):re("",!0)])]))),128))])):(b(),T("div",qP,[(b(!0),T(Be,null,st(e.tool.output??[],(E,N)=>(b(),T("div",{key:N},O(E),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),KP=dt(VP,[["__scopeId","data-v-a9a0f259"]]),GP=1e6,r_=5e3;function l_(e){if(e==="")return[];const t=e.split(`
68
+ `);return t.at(-1)===""&&t.pop(),t}function YP(e,t){const n=l_(e),s=l_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>r_||i>r_||(o+1)*(i+1)>GP)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 ZP(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 vA(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 yA(e){const t=Na(e.name);if(t!=="edit"&&t!=="write")return null;const n=vA(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:YP(s,o)}return null}function QP(e){const t=vA(e);return t&&typeof t.path=="string"?t.path:void 0}function XP(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const JP={key:0,class:"bb-empty"},a_=50,eH=Ye({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=D(()=>t.lines??[]),s=D(()=>n.value.length>a_),o={"--tool-output-visible-lines":String(a_)};return(i,r)=>(b(),T("div",{class:Pe(["bb-code tool-output-block",{scroll:s.value}]),style:o},[n.value.length===0&&e.emptyText?(b(),T("div",JP,O(e.emptyText),1)):re("",!0),(b(!0),T(Be,null,st(n.value,(l,a)=>(b(),T("div",{key:a},O(l),1))),128))],2))}}),kA=dt(eH,[["__scopeId","data-v-262bbea0"]]),tH={key:0,class:"chip"},nH={key:0,class:"bb-summary"},sH=Ye({__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=D(()=>n.tool.status),i=D(()=>Ia(n.tool.name)),r=D(()=>dm(n.tool.name)),l=D(()=>_d(n.tool.name,n.tool.arg)),a=D(()=>_d(n.tool.name,n.tool.arg,!0)),c=D(()=>yA(n.tool)),u=D(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:x,removed:k}=ZP(m);if(x||k)return`+${x} −${k}`}return""}),d=D(()=>!!n.tool.output&&n.tool.output.length>0),f=Q(!1),h=D(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,x)=>(b(),ke(fm,{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:Me(()=>[u.value?(b(),T("span",tH,O(u.value),1)):re("",!0)]),default:Me(()=>[a.value?(b(),T("div",nH,O(a.value),1)):re("",!0),ie(kA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),oH=dt(sH,[["__scopeId","data-v-74e1da99"]]),iH={key:0,class:"chip"},rH={key:0,class:"bb-summary"},lH=Ye({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=D(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=D(()=>!!t.tool.output&&t.tool.output.length>0),o=D(()=>s.value||n.value),i=Q(t.tool.defaultExpanded===!0&&o.value),r=D(()=>t.tool.status),l=D(()=>Ia(t.tool.name)),a=D(()=>dm(t.tool.name)),c=D(()=>_d(t.tool.name,t.tool.arg)),u=D(()=>_d(t.tool.name,t.tool.arg,!0)),d=D(()=>lP({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 Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(h,p)=>(b(),ke(fm,{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:Me(()=>[d.value?(b(),T("span",iH,O(d.value),1)):re("",!0)]),default:Me(()=>[u.value?(b(),T("div",rH,O(u.value),1)):re("",!0),ie(kA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),aH=dt(lH,[["__scopeId","data-v-aa4edcb0"]]),cH={class:"media-title"},uH=["src","alt"],dH=["src"],fH=["src"],hH=Ye({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=D(()=>{const c=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?(b(),T("div",{key:0,class:Pe(["media-tool",{mob:e.mobile}])},[ie(Yt,{text:o.value.path||l.value},{default:Me(()=>[w("div",cH,O(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(b(),ke(Yt,{key:0,text:o.value.path||l.value},{default:Me(()=>[w("button",{type:"button",class:"media-image-button",onClick:a},[w("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,uH)])]),_:1},8,["text"])):o.value.kind==="video"?(b(),T("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,dH)):(b(),T("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,fH))],2)):re("",!0)}}),pH=dt(hH,[["__scopeId","data-v-bec13b73"]]),mH=/<summary>([\s\S]*?)<\/summary>/,gH=/<resume_hint>([\s\S]*?)<\/resume_hint>/,l0=/<subagent\b([^>]*)>|<\/subagent>/g,vH="</subagent>",c_=/(completed|failed|aborted):\s*(\d+)/g,u_=/([a-z_]+)="([^"]*)"/g;function yH(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function kH(e){const t={};u_.lastIndex=0;let n;for(;(n=u_.exec(e))!==null;)t[n[1]]=yH(n[2]);return t}function bH(e){const t={completed:0,failed:0,aborted:0};c_.lastIndex=0;let n;for(;(n=c_.exec(e))!==null;){const s=n[1];t[s]=Number(n[2])}return t}function xH(e,t){const n=kH(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function _H(e){const t=[],n=[];l0.lastIndex=0;let s;for(;(s=l0.exec(e))!==null;)if(s[0]===vH){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(xH(o.attrs,e.slice(o.bodyStart,s.index)))}else n.length===0?n.push({attrs:s[1]??"",bodyStart:l0.lastIndex}):n.push(null);return t}function wH(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
69
+ `):e;if(!t.includes("<agent_swarm_result>"))return null;const n=mH.exec(t)?.[1]?.trim()??"",{completed:s,failed:o,aborted:i}=bH(n),r=gH.exec(t)?.[1]?.trim(),l=_H(t),a=s+o+i;return{summary:n,completed:s,failed:o,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function d_(e){return e?e.split(`
70
+ `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function SH(e){return e.suspendedReason||d_(e.text)||d_(e.outputLines?.join(`
71
+ `))||e.summary||""}function CH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
72
+ `):e.summary??""}function AH(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function f_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
73
+ `)[0]??"",phase:AH(e.outcome),body:e.body}}function MH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function EH(e,t){const n=e.map(o=>({id:o.id,name:o.name,activity:SH(o),phase:o.phase,body:CH(o)}));if(!t)return n;const s=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(i=>MH(i,o))).map((o,i)=>f_(o,i));return n.length>0?[...n,...s]:t.subagents.map((o,i)=>f_(o,i))}const TH=["aria-expanded"],NH={class:"title"},IH={key:0,class:"meta"},$H={key:1,class:"sum-txt"},LH={class:"rt"},FH={class:"status"},OH={key:0,class:"chip"},RH={key:1,class:"tm"},BH={class:"body"},DH={class:"overview"},PH={class:"overview-line"},HH={class:"big"},WH={key:0,class:"lbl"},zH={key:1,class:"lbl"},UH={key:2,class:"lbl"},qH={key:0,class:"seg","aria-hidden":"true"},jH={key:1,class:"legend"},VH=["aria-expanded","onClick"],KH={class:"mname"},GH={class:"mact"},YH={class:"mphase"},ZH={key:1,class:"fallback-output"},QH={key:2,class:"waiting"},XH=Ye({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Tt(),n=e;function s(N){if(!N)return{};try{const F=JSON.parse(N),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const o=Vt("resolveSwarmMembers"),i=D(()=>s(n.tool.arg)),r=D(()=>Ia(n.tool.name)),l=D(()=>i.value.description??""),a=D(()=>o?.(n.tool.id)??[]),c=D(()=>wH(n.tool.output)),u=D(()=>n.tool.status),d=D(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=D(()=>EH(a.value,c.value)),h=D(()=>{const N={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)N[F.phase]++;return N}),p=D(()=>f.value.length||i.value.itemCount||0),m=D(()=>h.value.completed+h.value.failed),x=D(()=>h.value.working+h.value.suspended+h.value.queued),k=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],g=D(()=>k.map(({phase:N,cls:F})=>({phase:N,count:h.value[N],cls:F})).filter(N=>N.count>0)),v=Q(!1);function y(){v.value=!v.value}const M=D(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
74
+ `).trim()),L=Q(new Set);function $(N){const F=new Set(L.value);F.has(N)?F.delete(N):F.add(N),L.value=F}function _(N){return L.value.has(N)}function E(N){return t(`tools.swarm.phase${N[0].toUpperCase()}${N.slice(1)}`)}return(N,F)=>(b(),T("div",{class:Pe(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[w("button",{class:"head",type:"button","aria-expanded":v.value,onClick:y},[ie(je,{class:"ic",name:"git-pull-request",size:"sm"}),w("span",NH,O(r.value),1),l.value?(b(),T("span",IH,"·")):re("",!0),l.value?(b(),T("span",$H,O(l.value),1)):re("",!0),w("span",LH,[w("span",FH,[d.value==="ok"?(b(),ke(je,{key:0,name:"check",size:"sm"})):d.value==="error"?(b(),ke(je,{key:1,name:"close",size:"sm"})):(b(),ke(wd,{key:2,status:"running"}))]),m.value>0||p.value>0?(b(),T("span",OH,O(m.value)+" / "+O(p.value),1)):re("",!0),e.tool.timing?(b(),T("span",RH,O(e.tool.timing),1)):re("",!0)]),ie(je,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,TH),Ln(w("div",BH,[w("div",DH,[w("div",PH,[w("span",HH,O(C(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(b(),T("span",WH,O(C(t)("tools.swarm.runningSub",{count:x.value})),1)):c.value?(b(),T("span",zH,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(b(),T("span",UH,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(b(),T("div",qH,[(b(!0),T(Be,null,st(g.value,S=>(b(),T("span",{key:S.phase,class:Pe(S.cls),style:Gt({flex:S.count})},null,6))),128))])):re("",!0),g.value.length>1?(b(),T("div",jH,[(b(!0),T(Be,null,st(g.value,S=>(b(),T("span",{key:S.phase},[w("i",{class:Pe(["lg-dot",S.cls])},null,2),Xe(O(E(S.phase))+" "+O(S.count),1)]))),128))])):re("",!0)]),f.value.length>0?(b(!0),T(Be,{key:0},st(f.value,S=>(b(),T("div",{key:S.id,class:Pe(["member",[`phase-${S.phase}`,{open:_(S.id)}]])},[w("button",{class:"member-head",type:"button","aria-expanded":_(S.id),onClick:I=>$(S.id)},[ie(wd,{class:"row-dot",status:S.phase},null,8,["status"]),ie(Yt,{text:S.name},{default:Me(()=>[w("span",KH,O(S.name),1)]),_:2},1032,["text"]),S.activity?(b(),ke(Yt,{key:0,text:S.activity},{default:Me(()=>[w("span",GH,O(S.activity),1)]),_:2},1032,["text"])):re("",!0),w("span",YH,O(E(S.phase)),1),ie(je,{class:"mcar",name:_(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,VH),Ln(w("div",{class:"member-body"},O(S.body),513),[[pi,_(S.id)]])],2))),128)):M.value?(b(),T("div",ZH,O(M.value),1)):(b(),T("div",QH,O(C(t)("tools.swarm.waiting")),1))],512),[[pi,v.value]])],2))}}),JH=dt(XH,[["__scopeId","data-v-3b95ba79"]]);function eW(e){if(e.media&&e.status==="ok")return pH;const t=Na(e.name);return t==="edit"||t==="write"||t==="multi_edit"?oH:t==="task"?wP:t==="agentswarm"?JH:t==="askuserquestion"?KP:aH}const bA=Ye({__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=D(()=>eW(n.tool));return(i,r)=>(b(),ke(Vs(o.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>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","data-scroll-anchor-id"]))}});function h_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function tW(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 hm(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 nW(e){return!(e.tool.status==="ok"&&e.tool.media)}function sW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function oW(e){const t=hm(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(nW(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 iW(e){return hm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
75
+
76
+ `)}function rW(e){const t=[];for(const n of hm(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
77
+ > ${n.thinking.split(`
78
+ `).join(`
79
+ > `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const s=n.tool.output.join(`
80
+ `);t.push(`\`\`\`
81
+ [${n.tool.name}]
82
+ ${s}
83
+ \`\`\``)}return t.join(`
84
+
85
+ `)}function xA(e){return e.tool.id||`tool-${e.sourceIndex}`}function lW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?xA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const aW=["aria-expanded"],cW={class:"tg-title"},uW={class:"tg-meta"},dW=["inert"],fW={class:"tool-group-body-inner"},hW=Ye({__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=Q(!0),i=D(()=>n.tools.length),r=D(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Tt(),a=D(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){o.value=!o.value}const u=Vt("pinScroll",()=>{}),d=Q(null);function f(){c();const h=d.value;h&&gt(()=>u(h))}return(h,p)=>(b(),T("div",{class:Pe(["tool-group",{open:o.value}])},[w("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":o.value,onClick:f},[ie(wd,{status:r.value},null,8,["status"]),ie(je,{class:"tg-ic",name:"list",size:"sm"}),w("span",cW,O(C(l)("tools.group.title",i.value)),1),w("span",uW,"· "+O(a.value),1),ie(je,{class:"tg-car",name:"chevron-right",size:"sm"})],8,aW),w("div",{class:Pe(["tool-group-body",{open:o.value}]),inert:!o.value},[w("div",fW,[(b(!0),T(Be,null,st(e.tools,(m,x)=>(b(),ke(bA,{key:C(xA)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(sW)(x,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=k=>s("openMedia",k)),onOpenFile:p[1]||(p[1]=k=>s("openFile",k)),onOpenToolDiff:p[2]||(p[2]=k=>s("openToolDiff",k)),onOpenAgent:p[3]||(p[3]=k=>s("openAgent",k))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,dW)],2))}}),pW=dt(hW,[["__scopeId","data-v-37eb334f"]]);var mW=Object.create,Fy=Object.defineProperty,gW=Object.getOwnPropertyDescriptor,_A=Object.getOwnPropertyNames,vW=Object.getPrototypeOf,yW=Object.prototype.hasOwnProperty,wA=(e,t)=>function(){return t||(0,e[_A(e)[0]])((t={exports:{}}).exports,t),t.exports},SA=e=>{let t={};for(var n in e)Fy(t,n,{get:e[n],enumerable:!0});return t},kW=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=_A(t),i=0,r=o.length,l;i<r;i++)l=o[i],!yW.call(e,l)&&l!==n&&Fy(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=gW(t,l))||s.enumerable});return e},CA=(e,t,n)=>(n=e!=null?mW(vW(e)):{},kW(Fy(n,"default",{value:e,enumerable:!0}),e));function bW(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 xW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function _W(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 wW(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
86
+ `:`<hr class="footnotes-sep">
87
+ `)+`<section class="footnotes">
88
+ <ol class="footnotes-list">
89
+ `}function SW(){return`</ol>
90
+ </section>
91
+ `}function CW(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 AW(){return`</li>
92
+ `}function MW(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 EW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=_W,e.renderer.rules.footnote_block_open=wW,e.renderer.rules.footnote_block_close=SW,e.renderer.rules.footnote_open=CW,e.renderer.rules.footnote_close=AW,e.renderer.rules.footnote_anchor=MW,e.renderer.rules.footnote_caption=xW,e.renderer.rules.footnote_anchor_name=bW;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 x=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,y=h,M=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=M;for(;h<f;){const _=l.src.charCodeAt(h);if(n(_))_===9?L+=4-L%4:L++;else break;h++}l.tShift[a]=h-y,l.sCount[a]=L-M,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]=k,l.sCount[a]=g,l.bMarks[a]=x;const $=new l.Token("footnote_reference_close","",-1);return $.level=--l.level,l.tokens.push($),!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 x=new l.Token("footnote_open","",1);if(x.meta={id:p,label:h[p].label},l.tokens.push(x),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 M=new l.Token("paragraph_close","p",-1);M.block=!0,a.push(M)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let k;l.tokens[l.tokens.length-1].type==="paragraph_close"?k=l.tokens.pop():k=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:p,subId:v,label:h[p].label},l.tokens.push(y)}k&&l.tokens.push(k),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",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 TW(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 NW(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 IW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function $W(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(IW,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function LW(e){e.inline.ruler.after("emphasis","sub",$W)}const FW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function OW(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(FW,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function RW(e){e.inline.ruler.after("emphasis","sup",OW)}var BW=wA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,x){x=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},x),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,y=2;y<g.length;y++)o(g,y)&&(i(g[y],v,x,k.Token),v+=1,n(g[y-2],"class",x.liClass),n(g[s(g,y-2)],"class",x.ulClass))})};function n(m,x,k){var g=m.attrIndex(x),v=[x,k];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,x){for(var k=m[x].level-1,g=x-1;g>=0;g--)if(m[g].level===k)return g;return-1}function o(m,x){return d(m[x])&&f(m[x-1])&&h(m[x-2])&&p(m[x])}function i(m,x,k,g){var v=k.idPrefix+x;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,k,g)),k.divWrap&&(m.children.unshift(c(k,g)),m.children.push(u(g)))}function r(m,x,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",x]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,x){var k=new x("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,x){var k=new x("checkbox_open","div",0);return k.attrs=[["class",m.divClass]],k}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),DW=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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))),PW=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),a0;const HW=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]]),WW=(a0=String.fromCodePoint)!==null&&a0!==void 0?a0: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 zW(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=HW.get(e))!==null&&t!==void 0?t:e}var Ds;(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"})(Ds||(Ds={}));const UW=32;var vl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(vl||(vl={}));function Xg(e){return e>=Ds.ZERO&&e<=Ds.NINE}function qW(e){return e>=Ds.UPPER_A&&e<=Ds.UPPER_F||e>=Ds.LOWER_A&&e<=Ds.LOWER_F}function jW(e){return e>=Ds.UPPER_A&&e<=Ds.UPPER_Z||e>=Ds.LOWER_A&&e<=Ds.LOWER_Z||Xg(e)}function VW(e){return e===Ds.EQUALS||jW(e)}var Bs;(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"})(Bs||(Bs={}));var pl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(pl||(pl={}));var KW=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Bs.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=pl.Strict}startEntity(e){this.decodeMode=e,this.state=Bs.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Bs.EntityStart:return e.charCodeAt(t)===Ds.NUM?(this.state=Bs.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Bs.NamedEntity,this.stateNamedEntity(e,t));case Bs.NumericStart:return this.stateNumericStart(e,t);case Bs.NumericDecimal:return this.stateNumericDecimal(e,t);case Bs.NumericHex:return this.stateNumericHex(e,t);case Bs.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|UW)===Ds.LOWER_X?(this.state=Bs.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Bs.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(Xg(s)||qW(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(Xg(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===Ds.SEMI)this.consumed+=1;else if(this.decodeMode===pl.Strict)return 0;return this.emitCodePoint(zW(this.result),this.consumed),this.errors&&(e!==Ds.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&vl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=GW(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===pl.Attribute&&(o===0||VW(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&vl.VALUE_LENGTH)>>14,o!==0){if(i===Ds.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==pl.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]&vl.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]&~vl.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Bs.NamedEntity:return this.result!==0&&(this.decodeMode!==pl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Bs.NumericDecimal:return this.emitNumericEntity(0,2);case Bs.NumericHex:return this.emitNumericEntity(0,3);case Bs.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Bs.EntityStart:return 0}}};function AA(e){let t="";const n=new KW(e,s=>t+=WW(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 GW(e,t,n,s){const o=(t&vl.BRANCH_LENGTH)>>7,i=t&vl.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 YW=AA(DW);AA(PW);function Oy(e,t=pl.Legacy){return YW(e,t)}var ZW=CA(BW());const p_={};function QW(e){let t=p_[e];if(t)return t;t=p_[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 pm(e,t){typeof t!="string"&&(t=pm.defaultChars);const n=QW(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})}pm.defaultChars=";/?:@&=+$,#";pm.componentChars="";var Jg=pm;const m_={};function XW(e){let t=m_[e];if(t)return t;t=m_[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 mm(e,t,n){typeof t!="string"&&(n=t,t=mm.defaultChars),typeof n>"u"&&(n=!0);const s=XW(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}mm.defaultChars=";/?:@&=+$,-_.!~*'()#";mm.componentChars="-_.!~*'()";var MA=mm;function Ry(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 Xh(){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 JW=/^([a-z0-9.+-]+:)/i,ez=/:[0-9]*$/,tz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,nz=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
93
+ `," "]),sz=["'"].concat(nz),g_=["%","/","?",";","#"].concat(sz),v_=["/","?","#"],oz=255,y_=/^[+a-z0-9A-Z_-]{0,63}$/,iz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,k_={javascript:!0,"javascript:":!0},b_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function rz(e,t){if(e&&e instanceof Xh)return e;const n=new Xh;return n.parse(e,t),n}Xh.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=tz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=JW.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&&k_[r])&&(i=i.substr(2),this.slashes=!0)),!k_[r]&&(o||r&&!b_[r])){let c=-1;for(let p=0;p<v_.length;p++)s=i.indexOf(v_[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<g_.length;p++)s=i.indexOf(g_[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,x=p.length;m<x;m++){const k=p[m];if(k&&!k.match(y_)){let g="";for(let v=0,y=k.length;v<y;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(y_)){const v=p.slice(0,m),y=p.slice(m+1),M=k.match(iz);M&&(v.push(M[1]),y.unshift(M[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>oz&&(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),b_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Xh.prototype.parseHost=function(e){let t=ez.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 By=rz,EA=SA({decode:()=>Jg,encode:()=>MA,format:()=>Ry,parse:()=>By}),TA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,NA=/[\0-\x1F\x7F-\x9F]/,lz=/[\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]/,IA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,az=/[\$\+<->\^`\|~\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]/,$A=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,cz=SA({Any:()=>TA,Cc:()=>NA,Cf:()=>lz,P:()=>IA,S:()=>az,Z:()=>$A}),uz=Object.defineProperty,LA=e=>{let t={};for(var n in e)uz(t,n,{get:e[n],enumerable:!0});return t},_s=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}`}},dz=LA({arrayReplaceAt:()=>yz,assign:()=>gz,countLines:()=>ss,escapeHtml:()=>Mz,escapeRE:()=>Tz,fromCodePoint:()=>Cd,has:()=>mz,isMdAsciiPunct:()=>tp,isPunctChar:()=>ep,isPunctCode:()=>ev,isSpace:()=>vz,isString:()=>hz,isValidEntityCode:()=>vm,isWhiteSpace:()=>Sd,lib:()=>Nz,mdurl:()=>EA,normalizeReference:()=>gm,ucmicro:()=>Jh,unescapeAll:()=>Ad,unescapeMd:()=>_z});const Jh=cz;function fz(e){return Object.prototype.toString.call(e)}function hz(e){return fz(e)==="[object String]"}const pz=Object.prototype.hasOwnProperty;function mz(e,t){return pz.call(e,t)}function gz(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 vz(e){return e===9||e===32}function Sd(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 ep(e){return Jh.P.test(e)||Jh.S.test(e)}const x_=new Map;function ev(e){if(tp(e))return!0;const t=x_.get(e);if(t!==void 0)return t;const n=ep(String.fromCharCode(e));return x_.set(e,n),n}function tp(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 gm(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function yz(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function vm(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 Cd(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 FA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,kz=new RegExp(`${FA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),bz=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function xz(e,t){if(t.charCodeAt(0)===35&&bz.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return vm(s)?Cd(s):e}const n=Oy(e);return n!==e?n:e}function _z(e){return e.includes("\\")?e.replace(FA,"$1"):e}function Ad(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(kz,(t,n,s)=>n||xz(t,s))}const wz=/[&<>"]/,Sz=/[&<>"]/g,Cz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Az(e){return Cz[e]}function Mz(e){return wz.test(e)?e.replace(Sz,Az):e}const Ez=/[.?*+^$[\]\\(){}|-]/g;function Tz(e){return e.replace(Ez,"\\$&")}const Nz={mdurl:EA,ucmicro:Jh};function ss(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
94
+ `,n+1))!==-1;)t++;return t}const Iz=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,$z=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Lz=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Dy=["references","footnotes","abbreviations","abbr","abbrs"],Py=Symbol.for("markdown-it-ts.global-state"),Hy=Object.prototype.hasOwnProperty;function __(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $i(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _l(e){if(Array.isArray(e))return e.map(t=>_l(t));if($i(e)){const t={};for(const n of Object.keys(e))t[n]=_l(e[n]);return t}return e}function np(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$i(e)?Object.keys(e):[]}function tv(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(!tv(e[n],t[n]))return!1;return!0}if($i(e)||$i(t)){if(!$i(e)||!$i(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(!Hy.call(t,o)||!tv(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function OA(e,t){if(Array.isArray(e))return e[Number(t)];if($i(e))return e[t]}function Fz(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=_l(t[n]);return e}if($i(e)&&$i(t)){for(const n of Object.keys(e))Hy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=_l(t[n]);return e}return _l(t)}function Oz(e,t,n){const s=n.ownedKeys??[],o=e[t];if($i(o)||Array.isArray(o)){const i=new Set(np(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=_l(OA(n.value,r)):delete o[r];!n.existed&&np(o).length===0&&delete e[t];return}n.existed?e[t]=_l(n.value):delete e[t]}function Wy(e){const t=e[Py];return __(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&__(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function Rz(e,t){Object.defineProperty(e,Py,{value:t,enumerable:!1,configurable:!0,writable:!0})}function No(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Iz.test(e)?"footnote-definition":$z.test(e)?"abbreviation-definition":Lz.test(e)?"reference-definition":null}function zd(e){return Wy(e)?.reason??null}function Lc(e,t,n){if(zd(e)&&Dr(e),!t)return n();zy(e,t);try{const s=n();return Uy(e),s}catch(s){throw Dr(e),s}}function zy(e,t){try{Dr(e);const n={};for(const s of Dy)n[s]=Hy.call(e,s)?{existed:!0,value:_l(e[s])}:{existed:!1};Rz(e,{reason:t,snapshot:n})}catch{}}function Uy(e){const t=Wy(e);if(t)for(const n of Dy){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!$i(o)&&!Array.isArray(o))continue;const i=new Set(np(s.existed?s.value:void 0));s.ownedKeys=np(o).filter(r=>i.has(r)?!tv(o[r],OA(s.value,r)):!0)}}function Dr(e){const t=Wy(e);if(t){for(const n of Dy){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){Oz(e,n,s);continue}s.existed?e[n]=Fz(e[n],s.value):delete e[n]}delete e[Py]}}const nv=Symbol.for("markdown-it-ts.diagnostics");function ym(e,t){if(e)try{const n=e[nv];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[nv]=s,s}catch{return}}function yr(e){return ym(e,!1)}function Bz(e){if(e)try{const t=e[nv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function uo(e){Bz(e)}function bs(e,t){const n=ym(e,!0);n&&(n.strategy=t)}function c0(e,t){const n=ym(e,!0);n&&(n.chunk=t)}function RA(e,t){const n=ym(e,!0);n&&(n.unbounded=t)}function Dz(e){const t={};e=e||{},t.src_Any=TA.source,t.src_Cc=NA.source,t.src_Z=$A.source,t.src_P=IA.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 sv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function km(e){return Object.prototype.toString.call(e)}function Pz(e){return km(e)==="[object String]"}function Hz(e){return km(e)==="[object Object]"}function Wz(e){return km(e)==="[object RegExp]"}function w_(e){return km(e)==="[object Function]"}function zz(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const BA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Uz(e){return Object.keys(e||{}).reduce(function(t,n){return t||BA.hasOwnProperty(n)},!1)}const qz={"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}}},jz="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]",Vz="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Kz(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function S_(){return function(e,t){t.normalize(e)}}function sp(e){const t=e.re=Dz(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(jz),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,Hz(a)){Wz(a.validate)?c.validate=Kz(a.validate):w_(a.validate)?c.validate=a.validate:i(l,a),w_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=S_();return}if(Pz(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:S_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(zz).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 DA(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 ti(e,t){if(!(this instanceof ti))return new ti(e,t);t||Uz(e)&&(t=e,e={}),this.__opts__=sv({},BA,t),this.__schemas__=sv({},qz,e),this.__compiled__={},this.__tlds__=Vz,this.__tlds_replaced__=!1,this.re={},sp(this)}ti.prototype.add=function(t,n){return this.__schemas__[t]=n,sp(this),this};ti.prototype.set=function(t){return this.__opts__=sv(this.__opts__,t),this};ti.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)};ti.prototype.pretest=function(t){return this.re.pretest.test(t)};ti.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};ti.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 DA(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};ti.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 DA(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};ti.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(),sp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,sp(this),this)};ti.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ti.prototype.onCompile=function(){};var PA=ti,Gz=wA({"../../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,x=Math.floor,k=String.fromCharCode;function g(B){throw new RangeError(p[B])}function v(B,P){const z=[];let W=B.length;for(;W--;)z[W]=P(B[W]);return z}function y(B,P){const z=B.split("@");let W="";z.length>1&&(W=z[0]+"@",B=z[1]),B=B.replace(h,".");const ee=v(B.split("."),P).join(".");return W+ee}function M(B){const P=[];let z=0;const W=B.length;for(;z<W;){const ee=B.charCodeAt(z++);if(ee>=55296&&ee<=56319&&z<W){const U=B.charCodeAt(z++);(U&64512)==56320?P.push(((ee&1023)<<10)+(U&1023)+65536):(P.push(ee),z--)}else P.push(ee)}return P}const L=B=>String.fromCodePoint(...B),$=function(B){return B>=48&&B<58?26+(B-48):B>=65&&B<91?B-65:B>=97&&B<123?B-97:36},_=function(B,P){return B+22+75*(B<26)-((P!=0)<<5)},E=function(B,P,z){let W=0;for(B=z?x(B/700):B>>1,B+=x(B/P);B>m*26>>1;W+=36)B=x(B/m);return x(W+(m+1)*B/(B+38))},N=function(B){const P=[],z=B.length;let W=0,ee=128,U=72,Z=B.lastIndexOf("-");Z<0&&(Z=0);for(let ce=0;ce<Z;++ce)B.charCodeAt(ce)>=128&&g("not-basic"),P.push(B.charCodeAt(ce));for(let ce=Z>0?Z+1:0;ce<z;){const fe=W;for(let Y=1,X=36;;X+=36){ce>=z&&g("invalid-input");const le=$(B.charCodeAt(ce++));le>=36&&g("invalid-input"),le>x((2147483647-W)/Y)&&g("overflow"),W+=le*Y;const He=X<=U?1:X>=U+26?26:X-U;if(le<He)break;const de=36-He;Y>x(2147483647/de)&&g("overflow"),Y*=de}const oe=P.length+1;U=E(W-fe,oe,fe==0),x(W/oe)>2147483647-ee&&g("overflow"),ee+=x(W/oe),W%=oe,P.splice(W++,0,ee)}return String.fromCodePoint(...P)},F=function(B){const P=[];B=M(B);const z=B.length;let W=128,ee=0,U=72;for(const fe of B)fe<128&&P.push(k(fe));const Z=P.length;let ce=Z;for(Z&&P.push("-");ce<z;){let fe=2147483647;for(const Y of B)Y>=W&&Y<fe&&(fe=Y);const oe=ce+1;fe-W>x((2147483647-ee)/oe)&&g("overflow"),ee+=(fe-W)*oe,W=fe;for(const Y of B)if(Y<W&&++ee>2147483647&&g("overflow"),Y===W){let X=ee;for(let le=36;;le+=36){const He=le<=U?1:le>=U+26?26:le-U;if(X<He)break;const de=X-He,G=36-He;P.push(k(_(He+de%G,0))),X=x(de/G)}P.push(k(_(X,0))),U=E(ee,oe,ce===Z),ee=0,++ce}++ee,++W}return P.join("")},R={version:"2.3.1",ucs2:{decode:M,encode:L},decode:N,encode:F,toASCII:function(B){return y(B,function(P){return f.test(P)?"xn--"+F(P):P})},toUnicode:function(B){return y(B,function(P){return d.test(P)?N(P.slice(4).toLowerCase()):P})}};t.exports=R})}),HA=CA(Gz());function qy(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=Ad(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=Ad(e.slice(t,o)),i.pos=o,i.ok=!0),i}var WA=qy;const dh=-2;function Yz(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 dh}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return dh;if(r===91){o++,i++;continue}i++}return-1}function jy(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=Yz(l,t,a,n);if(f!==dh)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 op=jy;function Vy(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+=Ad(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+=Ad(e.slice(t,i)),r}var zA=Vy;function bm(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 Ky(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function Zz(e,t,n){const s=bm(e,t),o=[t,n];s<0?Ky(e,o):e.attrs[s]=o}function Qz(e,t){const n=bm(e,t);return n>=0?e.attrs[n][1]:null}function Xz(e,t,n){const s=bm(e,t);s<0?Ky(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var Jz=LA({attrGet:()=>Qz,attrIndex:()=>bm,attrJoin:()=>Xz,attrPush:()=>Ky,attrSet:()=>Zz,parseLinkDestination:()=>qy,parseLinkLabel:()=>jy,parseLinkTitle:()=>Vy});function eU(e){return e.includes("\r")||e.includes("\0")}function UA(e){return typeof e=="string"?e:e.toString()}function tU(e){if(e.inlineMode){const t=new _s("inline","",0);t.content=UA(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 nU=/^([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])?)*)$/,sU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function oU(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(sU.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(nU.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 iU=oU;function rU(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(`
95
+ `)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var lU=rU;function C_(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 aU(e){const t=e.tokens_meta,n=e.tokens_meta.length;C_(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&C_(t[s].delimiters)}var cU=aU;function uU(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 A_(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 dU(e){const t=e.tokens_meta,n=e.tokens_meta.length;A_(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&A_(e,t[s].delimiters)}const M_={tokenize:uU,postProcess:dU};function qA(e){return Oy(e)}function Gy(e){return e>=48&&e<=57}function fU(e){const t=e|32;return Gy(e)||t>=97&&t<=102}function jA(e){const t=e|32;return t>=97&&t<=122}function hU(e){return jA(e)||Gy(e)}function pU(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?fU(l):Gy(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function mU(e,t,n){let s=t+1;if(s>=n||!jA(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&hU(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 qA(o)!==o?o:null}function gU(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=pU(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=vm(i)?Cd(i):Cd(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=mU(e.src,n,s);if(o){const i=qA(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 vU=gU;const VA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),ov=new Array(128),KA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);ov[e]=`\\${t}`,KA[e]=VA[e]?t:ov[e]}function E_(e,t,n){e.pending&&e.pushPending();const s=new _s("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 yU(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):(E_(e,KA[i],ov[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 E_(e,i<256&&VA[i]?r:l,l),e.pos=n+1,!0}var kU=yU;function bU(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 xU=bU;const GA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,YA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",_U=new RegExp(`^(?:${GA}|${YA}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),wU=new RegExp(`^(?:${GA}|${YA})`);function ZA(e){return e===32||e===9||e===10||e===12||e===13}function SU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||ZA(t)}function CU(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(!ZA(n))return!1}return!1}function AU(e){const t=e|32;return t>=97&&t<=122}function MU(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&&!AU(i))return!1;const r=o.slice(s).match(_U);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,SU(l)&&e.linkLevel++,CU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var EU=MU;function TU(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=op(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=WA(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=zA(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=op(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[gm(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 x=e.push("image","img",0);x.attrs=[["src",u],["alt",""]],x.children=m,x.content=s,a&&x.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var NU=TU;function IU(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=op(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=WA(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=zA(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=op(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[gm(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),x=[["href",r]];m.attrs=x,l&&x.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 $U=IU;function QA(e){const t=e|32;return t>=97&&t<=122}function LU(e){return e>=48&&e<=57}function FU(e){return QA(e)||LU(e)||e===43||e===45||e===46}function OU(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&FU(e.charCodeAt(t));)t--;return t++,t>=e.length||!QA(e.charCodeAt(t))?null:e.slice(t)}function RU(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 BU(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=OU(e.pending);if(!o)return!1;const i=RU(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 DU(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 PU=DU;function HU(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 T_(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 WU(e){const t=e.delimiters;T_(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&T_(e,n[s].delimiters)}const N_={tokenize:HU,postProcess:WU};function I_(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 zU(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||I_(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!I_(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var UU=zU;function Yy(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function qU(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 jU(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:Yy(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function Fc(e,t,n,s,o,i){const r=XA(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=jU(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=Yy()}function VU(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=qU(o.samples)}return t.completedAt=Yy(),t}var $_=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}},JA=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 _s("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 _s(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 _s(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=Sd(l),u=Sd(a),d=ev(l),f=ev(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}}};JA.prototype.Token=_s;const KU=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function e6(e){return!KU.test(e)}var GU=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new $_,this.ruler2=new $_,this.ruler.push("text",UU),this.ruler.push("linkify",BU),this.ruler.push("newline",PU),this.ruler.push("escape",kU),this.ruler.push("backticks",lU),this.ruler.push("strikethrough",N_.tokenize),this.ruler.push("emphasis",M_.tokenize),this.ruler.push("link",$U),this.ruler.push("image",NU),this.ruler.push("autolink",iU),this.ruler.push("html_inline",EU),this.ruler.push("entity",vU),this.ruler2.push("balance_pairs",cU),this.ruler2.push("strikethrough",N_.postProcess),this.ruler2.push("emphasis",M_.postProcess),this.ruler2.push("fragments_join",xU),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(Fc(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(Fc(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()&&e6(e)){const a=new _s("text","",0);a.content=e,s.push(a);return}const o=new JA(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();Fc(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 YU(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&&e6(i.content)){const r=new _s("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const ZU=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,QU=/[0-9a-z]/i;function XU(e){return/^<a[>\s]/i.test(e)}function JU(e){return/^<\/a\s*>/i.test(e)}function eq(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(!ZU.test(s)||!QU.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 tq(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"&&(XU(l.content)&&i>0&&i--,JU(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=>eq(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 x=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(x)?x=e.md.normalizeLinkText(`mailto:${x}`).replace(/^mailto:/,""):x=e.md.normalizeLinkText(x):x=e.md.normalizeLinkText(`http://${x}`).replace(/^http:\/\//,"");const k=p.index;if(k>f){const M=new _s("text","",0);M.content=a.slice(f,k),M.level=d,u.push(M)}const g=new _s("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new _s("text","",0);v.content=x,v.level=d,u.push(v);const y=new _s("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 _s("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const nq=/\r\n?|\n/g,sq=/\0/g;function oq(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(nq,`
96
+ `)),s&&(o=o.replace(sq,"�")),e.src=o}const t6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,iq=/\((?:c|tm|r)\)/i,rq=/\((c|tm|r)\)/gi,lq={c:"©",r:"®",tm:"™"};function aq(e,t){return lq[t.toLowerCase()]}function cq(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(rq,aq)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function uq(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&t6.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 dq(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(""):"");iq.test(s)&&cq(n.children||[]),t6.test(s)&&uq(n.children||[])}}var fq=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 hq=/['"]/,L_=/['"]/g,F_="’";function Of(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function pq(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;){L_.lastIndex=c;const d=L_.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 x=32;if(c<u)x=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const k=tp(m)||ep(String.fromCharCode(m)),g=tp(x)||ep(String.fromCharCode(x)),v=Sd(m),y=Sd(x);if(y?f=!1:g&&(v||k||(f=!1)),v?h=!1:k&&(y||g||(h=!1)),x===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=k,h=g),!f&&!h){p&&(r.content=Of(r.content,d.index,F_));continue}if(h)for(n=s.length-1;n>=0;n--){let M=s[n];if(s[n].level<l)break;if(M.single===p&&s[n].level===l){M=s[n];let L,$;p?(L=o[2]||"‘",$=o[3]||"’"):(L=o[0]||"“",$=o[1]||"”"),r.content=Of(r.content,d.index,$),e[M.token].content=Of(e[M.token].content,M.pos,L),c+=$.length-1,M.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=Of(r.content,d.index,F_))}}}function mq(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("");!hq.test(s)||!n.children||pq(n.children,e)}}function gq(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 vq=/^(?:vbscript|javascript|file|data):/,yq=/^data:image\/(?:gif|png|jpeg|webp);/,n6=["http:","https:","mailto:"];function s6(e){const t=e.trim().toLowerCase();return vq.test(t)?yq.test(t):!0}function o6(e){const t=By(e,!0);if(t.hostname&&(!t.protocol||n6.includes(t.protocol)))try{t.hostname=HA.default.toASCII(t.hostname)}catch{}return MA(Ry(t))}function i6(e){const t=By(e,!0);if(t.hostname&&(!t.protocol||n6.includes(t.protocol)))try{t.hostname=HA.default.toUnicode(t.hostname)}catch{}return Jg(Ry(t),`${Jg.defaultChars}%`)}function kq(e){switch(e){case 9:case 32:return!0}return!1}function bq(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=[],x=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const E=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!E){let F=a[y]+1,S,I;o.charCodeAt(u)===32?(u++,F++,I=!1,S=!0):o.charCodeAt(u)===9?(S=!0,(c[y]+F)%4===3?(u++,F++,I=!1):I=!0):S=!1;let R=F;for(h.push(i[y]),i[y]=u;u<d;){const B=o.charCodeAt(u);if(kq(B))B===9?R+=4-(R+c[y]+(I?1:0))%4:R++;else break;u++}v=u>=d,p.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=R-F,x.push(l[y]),l[y]=u-i[y];continue}if(v)break;let N=!1;for(let F=0,S=k.length;F<S;F++)if(k[F](e,y,n,!0)){N=!0;break}if(N){e.lineMax=y,e.blkIndent!==0&&(h.push(i[y]),p.push(c[y]),x.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}h.push(i[y]),p.push(c[y]),x.push(l[y]),m.push(a[y]),a[y]=-1}const M=e.blkIndent;e.blkIndent=0;const L=e.push("blockquote_open","blockquote",1);L.markup=">";const $=[t,0];L.map=$,e.md.block.tokenize(e,t,y);const _=e.push("blockquote_close","blockquote",-1);_.markup=">",e.lineMax=f,e.parentType=g,$[1]=e.line;for(let E=0;E<x.length;E++)i[E+t]=h[E],l[E+t]=x[E],a[E+t]=m[E],c[E+t]=p[E];return e.blkIndent=M,!0}function xq(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)}
97
+ `,i.map=[t,e.line],!0}function _q(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 O_=["","h1","h2","h3","h4","h5","h6"],R_=["","#","##","###","####","#####","######"];function B_(e){switch(e){case 9:case 32:return!0}return!1}function wq(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&&!B_(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&B_(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",O_[d],1);h.markup=R_[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",O_[d],-1);return m.markup=R_[d],!0}function Sq(e){switch(e){case 9:case 32:return!0}return!1}function Cq(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&&!Sq(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 Qa=[[/^<(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(`${wU.source}\\s*$`),/^$/,!1]];function Aq(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<Qa.length&&!Qa[l][0].test(r);l++);if(l===Qa.length)return!1;if(s)return Qa[l][2];let a=t+1;if(!Qa[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),Qa[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 D_(e){switch(e){case 9:case 32:return!0}return!1}const Gu={Pipe:1,ParagraphTerminator:2};function Mq(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 r6=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|=Gu.Pipe|Gu.ParagraphTerminator),!a)if(D_(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,Mq(f)&&(c|=Gu.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 _s(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new _s(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,x=this.bsCount,k=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+x[u])%4:p++;else if(f-d<k[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const 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 x=i.charCodeAt(p);if(D_(x))x===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("")}};r6.prototype.Token=_s;function Eq(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function l6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function a6(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&Gu.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:Eq(n,s,o)}const P_=["","h1","h2"];function Tq(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=l6(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],M=l[p];if(y>=M)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(y),h===45||h===61)){let $=y+1,_=$;for(;$<M&&o.charCodeAt($)===h;)$++;for(_=$;$<M;){const E=o.charCodeAt($);if(E!==9&&E!==32)break;$++}if($>=M){f=h===61?1:2;break}if(_-y>1)continue}if(a[p]<0||u&&!a6(e,p,o,y,M))continue;let L=!1;for(let $=0,_=s.length;$<_;$++)if(s[$](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 M=l[t];for(;M>y;){const L=o.charCodeAt(M-1);if(L!==9&&L!==32)break;M--}m=o.slice(y,M)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const x=h===61?"=":"-",k=e.push("heading_open",P_[f],1);k.markup=x,k.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",P_[f],-1);return v.markup=x,e.parentType=d,!0}function c6(e){switch(e){case 9:case 32:return!0}return!1}function H_(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&&!c6(i.charCodeAt(l))?-1:l}function W_(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),!c6(c))?-1:a}function Nq(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 Iq=["0","1","2","3","4","5","6","7","8","9"];function $q(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 Lq(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,x=e.eMarks,k=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=x[l])return!1;const y=h.charCodeAt(v);if(y>=48&&y<=57){if(f=W_(e,l),f<0||(u=!0,r=v,d=Nq(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=H_(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=x[l])return!1;if(s)return!0;const M=h.charCodeAt(f-1),L=String.fromCharCode(M);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const $=[l,0];e.tokens[e.tokens.length-1].map=$,e.tokens[e.tokens.length-1].markup=L;let _=!1;const E=e.tokens.length-1,N=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,o=x[l];const S=k[l]+f-(p[l]+m[l]);let I=S;for(;i<o;){const oe=h.charCodeAt(i);if(oe===9)I+=4-(I+g[l])%4;else if(oe===32)I++;else break;i++}const R=i;let B;R>=o?B=1:B=I-S,B>4&&(B=1);const P=S+B,z=e.push("list_item_open","li",1);z.markup=L;const W=[l,0];z.map=W,u&&(z.info=f-r-1===1?Iq[h.charCodeAt(r)-48]:h.slice(r,f-1));const ee=e.tight,U=e.tShift[l],Z=e.sCount[l],ce=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=P,e.tight=!0,e.tShift[l]=R-p[l],e.sCount[l]=I,R>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||_)&&(a=!1),_=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ce,e.tShift[l]=U,e.sCount[l]=Z,e.tight=ee,e.push("list_item_close","li",-1).markup=L,l=e.line,W[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let fe=!1;for(let oe=0,Y=N.length;oe<Y;oe++)if(N[oe](e,l,n,!0)){fe=!0;break}if(fe)break;if(u){if(f=W_(e,l),f<0)break;r=p[l]+m[l]}else if(f=H_(e,l),f<0)break;if(M!==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,$[1]=l,e.line=l,e.parentType=F,a&&$q(e,E),!0}function z_(e){return e===9||e===32}function Fq(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=l6(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 M=i.charCodeAt(v);if(M===42||M===45||M===43){if(v+1>=y||z_(i.charCodeAt(v+1)))break}else if(M>=48&&M<=57&&v+1<y){let L=v+1;for(;;){if(L>=y){L=-1;break}const $=i.charCodeAt(L++);if($>=48&&$<=57){if(L-v>=10){L=-1;break}continue}if(($===41||$===46)&&(L>=y||z_(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const x=r[f]+l[f],k=a[f];if(d&&!a6(e,f,i,x,k))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 Rf(e){switch(e){case 9:case 32:return!0}return!1}function Oq(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 M=!1;if(e.sCount[v]-e.blkIndent>3&&(M=!0),e.sCount[v]<0&&(M=!0),!M){const _=e.parentType;e.parentType="reference";let E=!1;for(let N=0,F=l.length;N<F;N++)if(l[N](e,v,y,!0)){E=!0;break}if(e.parentType=_,E)return null}const L=e.bMarks[v]+e.tShift[v],$=e.eMarks[v];return e.src.slice(L,$+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(!Rf(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(!Rf(v))break}let x=e.md.helpers.parseLinkTitle(c,o,i);for(;x.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,x=e.md.helpers.parseLinkTitle(c,o,i,x)}let k;for(o<i&&m!==o&&x.ok?(k=x.str,o=x.pos):(k="",o=h,r=p);o<i&&Rf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&k)for(k="",o=h,r=p;o<i&&Rf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=gm(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:k,href:f}),e.line=r),!0):!1}function u0(e){switch(e){case 9:case 32:return!0}return!1}const Rq=65536;function d0(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function Bq(e,t){if(e.lineFlags)return(e.lineFlags[t]&Gu.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 U_(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 Dq(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&&!u0(l)||r===45&&u0(l)||!Bq(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!u0(y))return!1;i++}let a=d0(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const M=c[y].trim();if(!M){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(M))return!1;M.charCodeAt(M.length-1)===58?u.push(M.charCodeAt(0)===58?"center":"right"):M.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=d0(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=U_(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 x=e.push("thead_open","thead",1);x.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let y=0;y<c.length;y++){const M=e.push("th_open","th",1);u[y]&&(M.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,$=h.length;L<$;L++)if(h[L](e,o,n,!0)){y=!0;break}if(y||(a=d0(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=U_(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>Rq))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=g=[t+2,0]}const M=e.push("tr_open","tr",1);M.map=[o,o+1];for(let L=0;L<d;L++){const $=e.push("td_open","td",1);u[L]&&($.attrs=[["style",`text-align:${u[L]}`]]);const _=e.push("inline","",0);_.content=c[L]?c[L].trim():"",_.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 Pq=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 Fc(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 Bf=[["table",Dq,["paragraph","reference"]],["code",xq],["fence",_q,["paragraph","reference","blockquote","list"]],["blockquote",bq,["paragraph","reference","blockquote","list"]],["hr",Cq,["paragraph","reference","blockquote","list"]],["list",Lq,["paragraph","reference","blockquote"]],["reference",Oq],["html_block",Aq,["paragraph","reference","blockquote"]],["heading",wq,["paragraph","reference","blockquote"]],["lheading",Tq],["paragraph",Fq]];var Hq=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Pq;for(let e=0;e<Bf.length;e++)this.ruler.push(Bf[e][0],Bf[e][1],{alt:(Bf[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 x=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const k=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Fc(e.env,"block",f[m].name,k-x,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 r6(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}},u6=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}};u6.prototype.Token=_s;const q_=[["normalize",oq],["block",tU],["inline",YU],["linkify",tq],["replacements",dq],["smartquotes",mq],["text_join",gq]],Wq={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},zq={parseLinkLabel:jy,parseLinkDestination:qy,parseLinkTitle:Vy};function Uq(){return{...Wq}}function qq(){return{...zq}}var jq=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Hq,this.inline=new GU,this.ruler=new fq;for(let e=0;e<q_.length;e++){const[t,n]=q_[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:Uq(),helpers:qq(),normalizeLink:o6,normalizeLinkText:i6,validateLink:s6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new PA),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 u6(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();Fc(e.env,"core",t[n].name,o-s,!0,!1)}VU(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&eU(e))return this.parse(UA(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 Vq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function ip(e){return!Vq.test(e)}function Bu(e,t){const n=e.indexOf(`
98
+ `,t);return n===-1?e.length:n}function fh(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 j_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function f0(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Kq(e){if(e.length>3)return ip(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 Gq=["","h1","h2","h3","h4","h5","h6"],Yq=["","#","##","###","####","#####","######"],V_=0,h0=1,p0=2;function Ko(e,t,n,s){const o=new _s(e,t,n);return o.level=s,o.block=!0,o}function d6(e,t,n){const s=Ko("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new _s("text","",0);return o.content=e,s.children=[o],s}function Zq(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(!ip(u))return!1;const d=Gq[i],f=Yq[i],h=Ko("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(d6(u,o,1));const p=Ko("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function Qq(e,t,n){const s=Ko("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(d6(t,n,1)),e.push(Ko("paragraph_close","p",-1,0))}function Xq(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function m0(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function Jq(e,t){const n=Ko("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function ej(e,t,n){const s=Ko("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=Ko("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=Ko("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new _s("text","",0);r.content=t,i.children=[r],e.push(i);const l=Ko("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Ko("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function tj(e){const t=Ko("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function nj(e,t,n,s){if(!j_(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=Bu(e,l);if(j_(e,l,c)&&fh(e,l+3,c)){const u=Ko("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 sj(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?V_:p0,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Bu(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(!fh(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!Zq(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=m0(e,h),l+=1+r-h;continue}if(c===45){if(!f0(e,r,a))return null;const h=l;let p=r,m=l,x=null,k=null;for(;p<e.length;){const y=Bu(e,p);if(!f0(e,p,y))break;const M=p+2,L=y===M+1?e[M]:e.slice(M,y);if(!Kq(L))return null;x===null&&(x=Jq(t,h)),k=ej(t,L,m),p=y<e.length?y+1:y,m++}if(x===null||k===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=Bu(e,g);if(!fh(e,g,y)){if(f0(e,g,y))return null;break}g=y<e.length?y+1:y,v++}x.map[1]=v,k.map[1]=v,tj(t),r=g,l=v;continue}if(c===96){const h=nj(e,r,a,l);if(!h)return null;t.push(h.token),r=m0(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=Xq(e,r,a);let d;if(n===p0?d=ip(u):n===h0&&u===s?d=o:(d=ip(u),n===V_?(i&&(n=u===s?h0:p0),s=u,o=d,i=!0):n===h0&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!fh(e,f,Bu(e,f)))return null;Qq(t,u,l),r=m0(e,f),l+=1+r-f}return t}const oj=/[&<>"]/,K_=/[&<>"]/g,ij=/&/g,rj=/[<>"]/g,lj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function g0(e){return lj[e]||e}function $n(e){if(e.length===0)return"";if(e.length<32)return oj.test(e)?e.replace(K_,g0):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(ij,"&amp;"):t?e.replace(K_,g0):e.replace(rj,g0)}const aj=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),cj=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function f6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(aj,(t,n,s)=>{if(n)return n;if(cj.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return vm(i)?Cd(i):"�"}const o=Oy(t);return o!==t?o:t})}const uj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,dj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,fj=/"/g;function yc(e,t){const n=e.indexOf(`
99
+ `,t);return n===-1?e.length:n}function rp(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 Df(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function hj(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!rp(e,t,yc(e,t))}function G_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function pj(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function Zy(e){return dj.test(e)?uj.test(e)?null:e.replace(fj,"&quot;"):e}function mj(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=Zy(e.slice(i,r));return a===null?null:`<h${s}>${a}</h${s}>
100
+ `}function Y_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function gj(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
101
+ `;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
102
+ `}function vj(e,t,n){const s=t+2;if(n===s+1)return gj(e,s);const o=Zy(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
103
+ `}function yj(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 kj(e,t,n,s){if(!G_(e,t,n))return null;const o=yj(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=yc(e,l);if(G_(e,l,a)&&rp(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-${$n(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${$n(c)}</code></pre>
104
+ `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function Z_(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=yc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!rp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=mj(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=Df(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=yc(e,m);if(!Y_(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const x=e.slice(t,m);let k;if(x===r)k=l;else{let v=t;for(k=`<ul>
105
+ `;v<m;){const y=yc(e,v),M=vj(e,v,y);if(M===null)return null;k+=M,v=y<e.length?y+1:y}k+=`</ul>
106
+ `,r=x,l=k}let g=Df(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=yc(e,g);if(!rp(e,g,v)){if(Y_(e,g,v))return null;break}g=v<e.length?v+1:v}s?o.push(k):n+=k,t=g;continue}if(d===96){const m=kj(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=Df(e,m.nextPos);continue}const f=pj(e,t,u);let h;if(f===a)h=c;else{const m=Zy(f);if(m===null)return null;h=`<p>${m}</p>
107
+ `,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&hj(e,p))return null;s?o.push(h):n+=h,t=Df(e,p)}return s?o.join(""):n}const bj={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function lp(e,t,n={},s){uo(n);const o={...bj,...s||{}},i=No(t);if(o.fallbackOnGlobalState!==!1&&i)return c0(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Lc(n,i,()=>e.core.parse(t,n,e).tokens);let r=hh(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Sj(r,o.maxChunks)),ph(t,r))return c0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Lc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return c0(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),Lc(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&&_j(f,l),wj(a,f),l+=u.lineCount}return a})}function hh(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(`
108
+ `,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=Cj(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 M=y-g;M>=3&&(u?u.marker===v&&M>=u.length&&(u=null):u={marker:v,length:M})}}const x=p-f;o+=x,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=x);const k=m;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(k)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(p)}f=p}return n&&d(e.length),s}function ph(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!xj(e,t[o].end))return!0;return!1}function xj(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 _j(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 wj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Sj(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 Cj(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 h6=4e6,p6=8e4,Aj=1e4,Mj=200,Ej=1e4,Tj=200;function m6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Nj(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 tl(e){return e.length===0?0:ss(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Ij(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 $j(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
109
+ `,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 Lj(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 Ij(e,n+1,e.length-1)?!$j(e,t):!1}function Fj(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??Ej:e.options.fullChunkSizeChars??Aj),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Tj:e.options.fullChunkSizeLines??Mj);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 Ud=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=tl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=hh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(ph(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,tl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!Lj(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,tl(this.pending)),null;const n=hh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,tl(this.pending)),null;const s=ph(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:tl(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=hh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=ph(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:tl(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:tl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+tl(this.pending);return Fj(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(zd(e)&&Dr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=No(t);n&&(zy(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&&Nj(r,a),this.options.retainTokens!==!1&&m6(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&&Uy(t),n}catch(s){throw this.markedGlobalStateReason&&(Dr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){RA(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 Oj(e,t,n={},s={}){uo(n);const o=new Ud(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function Rj(e,t,n={},s={}){uo(n);const o=new Ud(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function Bj(e,t,n,s={},o={}){uo(s);const i=new Ud(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 Dj(e,t,n,s={},o={}){uo(s);const i=new Ud(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 g6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??h6,o=e.options.autoUnboundedThresholdLines??p6;return t>=s||n>=o}function v6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??h6))return"yes";const s=e.options.autoUnboundedThresholdLines??p6;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function Yu(e,t,n={},s={}){uo(n);const o=No(t);if(zd(n)&&Dr(n),s.fallbackOnGlobalState!==!1&&o)return RA(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:ss(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),Lc(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Ud(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){m6(i,l)}});if(o&&zy(n,o),r.feed(t),r.flushForce(n),o&&(Uy(n),s.fallbackOnGlobalState===!1)){const l=yr(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const Oc=(e,t,n)=>e<t?t:e>n?n:e;function y6(e){return e.experimental?{...e,...e.experimental}:e}const Q_=[{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"}],X_=[{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 k6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Pj(e,t=Math.max(0,e/40|0),n={}){const s=y6(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<Q_.length;l++){const a=Q_[l];if(e<=a.max){if(a.strategy!=="adaptive")return k6(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Oc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Oc(Math.ceil(t/i),150,700),maxChunks:Oc(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 J_(e,t=Math.max(0,e/40|0),n={}){const s=y6(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<X_.length;l++){const a=X_[l];if(e<=a.max){if(a.strategy!=="adaptive")return k6(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Oc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Oc(Math.ceil(t/i),150,700),maxChunks:Oc(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 Hj={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"]}}},Wj={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zj={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 xm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function mh(e,t){if(xm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const ew=e=>xm(e)?e:Promise.resolve(e);function Zu(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 $n(e)}}function Nl(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Zu(t[0])}="${$n(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Zu(o[0])}="${$n(o[1])}"`}return n}function b6(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 Qu(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
110
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${$n(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
111
+ `;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${Nl(r)}>${t}</code></pre>
112
+ `}return`<pre><code${Nl(e.attrs)}>${t}</code></pre>
113
+ `}function ap(e){return!e.attrs||e.attrs.length===0?`<code>${$n(e.content)}</code>`:`<code${Nl(e.attrs)}>${$n(e.content)}</code>`}function iv(e){const t=$n(e.content);return e.attrs?`<pre${Nl(e.attrs)}><code>${t}</code></pre>
114
+ `:`<pre><code>${t}</code></pre>
115
+ `}function Uj(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="${$n(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${$n(n[0][1])}">`}return null}function tw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Zu(t[0][0])}="${$n(t[0][1])}">`:t.length===2?`<a ${Zu(t[0][0])}="${$n(t[0][1])}" ${Zu(t[1][0])}="${$n(t[1][1])}">`:`<a${Nl(t)}>`}function qj(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 nw(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 cp(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+Nl(n);return s===0&&t&&(i+=" /"),`${i}>`}const jj={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Pf=Object.prototype.hasOwnProperty,Tn={code_inline(e,t){return ap(e[t])},code_block(e,t){return iv(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?f6(i.info).trim():"",{langName:l,langAttrs:a}=b6(r),c=n.highlight,u=$n(i.content);if(!c)return Qu(i,u,r,l,n);const d=c(i.content,l,a);return xm(d)?d.then(f=>Qu(i,f||u,r,l,n)):Qu(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]],cp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
116
+ `:`<br>
117
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
118
+ `:`<br>
119
+ `:`
120
+ `},text(e,t){return $n(e[t].content)},text_special(e,t){return $n(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function sw(e,t,n){const s=e.info?f6(e.info).trim():"",{langName:o,langAttrs:i}=b6(s),r=t.highlight,l=$n(e.content);if(!r)return Qu(e,l,s,o,t);const a=r(e.content,o,i);if(xm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Qu(e,a||l,s,o,t)}function Hf(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===Tn.text)return l.content.length===0?"":$n(l.content);break;case"text_special":if(o.text_special===Tn.text_special)return l.content.length===0?"":$n(l.content);break;case"softbreak":if(o.softbreak===Tn.softbreak)return r;break;case"hardbreak":if(o.hardbreak===Tn.hardbreak)return i;break;case"html_inline":if(o.html_inline===Tn.html_inline)return l.content;break;case"code_inline":if(o.code_inline===Tn.code_inline)return ap(l);break}const a=o[l.type];if(!a)return cp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:mh(c,l.type)}var Vj=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Tn}}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,x="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,y=k>0&&e[k-1].hidden?`
121
+ `:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const $=e[k+1],_=e[k+2],E=e[k+3];if($.type==="paragraph_open"&&$.hidden&&_.type==="inline"&&E.type==="paragraph_close"&&E.hidden){x+=`${y}<li>${this.renderInlineTokens(_.children||[],s,o)}`,k+=3;continue}}if(k+2<e.length){const $=e[k+1],_=e[k+2];if($.type==="inline"&&_.nesting===-1&&_.tag===g.tag&&!_.hidden){const E=Uj(g,y);if(E!==null){x+=`${E+this.renderInlineTokens($.children||[],s,o)}</${g.tag}>
122
+ `,k+=2;continue}}}if(v==="inline"){const $=g.children||[];if($.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=s.xhtmlOut?`<br />
123
+ `:`<br>
124
+ `,p=s.breaks?h:`
125
+ `,m=!0);const _=$[0];switch(_.type){case"text":if(l===Tn.text){x+=$n(_.content);continue}break;case"text_special":if(a===Tn.text_special){x+=$n(_.content);continue}break;case"softbreak":if(c===Tn.softbreak){x+=p;continue}break;case"hardbreak":if(u===Tn.hardbreak){x+=h;continue}break;case"html_inline":if(d===Tn.html_inline){x+=_.content;continue}break;case"code_inline":if(f===Tn.code_inline){x+=ap(_);continue}break}}x+=this.renderInlineTokens($,s,o);continue}const M=i[v];if(!M){const $=g.attrs;if(!g.hidden){if(!$||$.length===0)switch(v){case"hr":x+=r?`<hr />
126
+ `:`<hr>
127
+ `;continue;case"heading_open":x+=`<${g.tag}>`;continue;case"heading_close":x+=`</${g.tag}>
128
+ `;continue;case"paragraph_open":x+=`${y}<p>`;continue;case"paragraph_close":x+=`</p>
129
+ `;continue;case"list_item_open":{const _=e[k+1];x+=y+(_&&(_.type==="inline"||_.hidden||_.nesting===-1&&_.tag==="li")?"<li>":`<li>
130
+ `);continue}case"list_item_close":x+=`</li>
131
+ `;continue;case"bullet_list_open":x+=`${y}<ul>
132
+ `;continue;case"bullet_list_close":x+=`</ul>
133
+ `;continue;case"blockquote_open":x+=y+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
134
+ `);continue;case"blockquote_close":x+=`</blockquote>
135
+ `;continue;case"ordered_list_open":x+=`${y}<ol>
136
+ `;continue;case"ordered_list_close":x+=`</ol>
137
+ `;continue;case"table_open":x+=`${y}<table>
138
+ `;continue;case"table_close":x+=`</table>
139
+ `;continue;case"thead_open":x+=`${y}<thead>
140
+ `;continue;case"thead_close":x+=`</thead>
141
+ `;continue;case"tbody_open":x+=`${y}<tbody>
142
+ `;continue;case"tbody_close":x+=`</tbody>
143
+ `;continue;case"tr_open":x+=`${y}<tr>
144
+ `;continue;case"tr_close":x+=`</tr>
145
+ `;continue;case"td_open":x+=`${y}<td>`;continue;case"td_close":x+=`</td>
146
+ `;continue;case"th_open":x+=`${y}<th>`;continue;case"th_close":x+=`</th>
147
+ `;continue}else if($.length===1){const _=$[0];if(v==="ordered_list_open"&&_[0]==="start"){x+=`${y}<ol start="${$n(_[1])}">
148
+ `;continue}if(v==="td_open"&&_[0]==="style"){x+=`${y}<td style="${$n(_[1])}">`;continue}if(v==="th_open"&&_[0]==="style"){x+=`${y}<th style="${$n(_[1])}">`;continue}}}x+=this.renderToken(e,k,s);continue}if(v==="code_block"&&M===Tn.code_block){x+=iv(g);continue}if(v==="fence"&&M===Tn.fence){x+=sw(g,s);continue}if(v==="html_block"&&M===Tn.html_block){x+=g.content;continue}const L=M(e,k,s,o,this);typeof L=="string"?x+=L:x+=mh(L,g.type)}return x}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 ew(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 Nl(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?`
149
+ `:"",u=a?`>
150
+ `:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+Nl(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(Pf.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),Pf.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(Pf.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(Pf.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...jj,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===Tn.code_block)return iv(t);if(i==="html_block"&&o.html_block===Tn.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):cp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Tn.fence)return sw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:mh(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,x=t.xhtmlOut===!0,k=x?`<br />
151
+ `:`<br>
152
+ `,g=t.breaks?k:`
153
+ `;if(e.length===1)return Hf(e,t,n,this,s,k,g);let v="";for(let y=0;y<e.length;y++){const M=e[y];if(M.type==="link_open"&&!u&&!d&&y+2<e.length){const _=e[y+1];if(e[y+2].type==="link_close"&&qj(_)){const E=`${tw(M)+Hf([_],t,n,this,s,k,g)}</a>`;if(r===Tn.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=E+g,y+=3;continue}v+=E,y+=2;continue}}if(M.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${tw(M)}</a>`,y+=1;continue}if(M.type==="em_open"&&!f&&!h&&y+2<e.length){const _=e[y+1];if(e[y+2].type==="em_close"&&nw(_)){v+=`<em>${Hf([_],t,n,this,s,k,g)}</em>`,y+=2;continue}}if(M.type==="strong_open"&&!p&&!m&&y+2<e.length){const _=e[y+1];if(e[y+2].type==="strong_close"&&nw(_)){v+=`<strong>${Hf([_],t,n,this,s,k,g)}</strong>`,y+=2;continue}}switch(M.type){case"text":if(o===Tn.text){const _=M.content.length===0?"":$n(M.content);if(a===Tn.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=_+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=_;continue}break;case"text_special":if(i===Tn.text_special){M.content.length!==0&&(v+=$n(M.content));continue}break;case"softbreak":if(r===Tn.softbreak){v+=g;continue}break;case"hardbreak":if(l===Tn.hardbreak){v+=k;continue}break;case"html_inline":if(a===Tn.html_inline){for(v+=M.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===Tn.code_inline){v+=ap(M);continue}break}const L=s[M.type];if(!L){v+=M.block?this.renderToken(e,y,t):cp(M,x);continue}const $=L(e,y,t,n,this);typeof $=="string"?v+=$:v+=mh($,M.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 ew(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+=`
154
+ `;break}}return s}},Kj=Vj;const Gj=[],v0=4096;function Yj(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
155
+ `,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 Zj(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 Qj(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(!x6(e[n],t[n]))return!1;return!0}function x6(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||!Zj(e.attrs,t.attrs)||!Qj(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function ow(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var Xj=class{core;cache=null;stats=ow();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=ow(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(uo(s??o?.env),!o||s&&s!==o.env){const I=s??{},R=!!n.__explicitStreamChunkFallbackSetting,B=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,P=!!n.options?.streamChunkedFallback,z=!R&&B,W=P||z,ee=n.options?.streamChunkAdaptive!==!1,U=n.options?.streamChunkTargetChunks??8,Z=n.options?.streamChunkSizeChars,ce=n.options?.streamChunkSizeLines,fe=n.options?.streamChunkMaxChunks,oe=!!n.__explicitStreamChunkConfig,Y=n.options?.autoTuneChunks!==!1,X=n.options?.streamChunkFenceAware??!0,le=n.options?.streamLargeCachePolicy??"retain",He=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,de=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let G,ae=!1;if(le==="skip"&&(ae=e.length>=He,!ae&&de!==void 0&&(G=ss(e),ae=G>=de)),ae){const q=this.parseFullDocument(e,I,n,G,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!yr(I)?.unbounded}),q.tokens}else if(W){const q=(pe,Se,Ie)=>pe<Se?Se:pe>Ie?Ie:pe;G===void 0&&(G=ss(e));const ne=Y&&!oe?J_(e.length,G,n.options):null,ge=ne?.maxChunkChars??(ee?q(Math.ceil(e.length/U),8e3,64e3):Z??1e4),ue=ne?.maxChunkLines??(ee?q(Math.ceil(G/U),150,700):ce??200),ye=ne?.maxChunks??(ee?q(Math.ceil(e.length/64e3),U,32):fe),j=e.length>0&&e.charCodeAt(e.length-1)===10,te=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ne?.strategy!=="plain";if((P||te)&&(e.length>=ge*2||G>=ue*2)&&j){const pe=lp(n,e,I,{maxChunkChars:ge,maxChunkLines:ue,fenceAware:ne?.fenceAware??X,maxChunks:ye});return this.cache={src:e,tokens:pe,env:I,lineCount:G,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,G),this.recordChunkedParseResult(I,P?"explicit-initial-large-doc":"default-initial-large-doc"),pe}}const me=this.parseFullDocument(e,I,n,G);return G=me.lineCount,this.cache={src:e,tokens:me.tokens,env:I,lineCount:G,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,G),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!yr(I)?.unbounded}),me.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",bs(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=No(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):No(e),a=r||l;if(a){const I=s??o.env;Dr(I);const R=No(e),B=this.parseFullDocument(e,I,n),P=B.tokens,z=B.lineCount;return this.cache={src:e,tokens:P,env:I,lineCount:z,lastSegment:void 0,globalStateReason:R},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!yr(I)?.unbounded}),P}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 I=s??o.env,R=this.parseFullDocument(e,I,n),B=R.tokens,P=R.lineCount;return this.cache={src:e,tokens:B,env:I,lineCount:P,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!yr(I)?.unbounded}),B}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const I=o.lineCount??ss(o.src);let R=3;u.length>5e3?R=8:u.length>1e3?R=6:u.length>200&&(R=4),R=Math.min(R,I);let B=null;const P=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,W=n.options?.streamContextParseMinLines??2;let ee;const U=()=>(ee===void 0&&(ee=ss(u)),ee),Z=this.canDirectlyParseAppend(o),ce=Z&&this.shouldUseUnboundedAppend(e,o,u);let fe=!1;if(!Z)switch(P){case"lines":fe=U()>=W;break;case"constructs":if(u.length>=z){fe=!0;break}if(Yj(u)){fe=!0;break}fe=U()>=W;break;case"chars":default:fe=u.length>=z}if(R>0&&fe){const X=this.getTailLines(o.src,R)+u;try{const le=this.core.parse(X,o.env,n).tokens,He=le.findIndex(de=>de.map&&typeof de.map[1]=="number"&&de.map[1]>R);if(He!==-1){const de=le.slice(He),G=I-R;G!==0&&this.shiftTokenLines(de,G),B={tokens:de}}}catch{B=null}}else B=null;if(!B){const X=I;if(ce)B={tokens:Yu(n,u,o.env,{mode:"stream"})},X>0&&this.shiftTokenLines(B.tokens,X);else{const le=this.core.parse(u,o.env,n);X>0&&this.shiftTokenLines(le.tokens,X),B=le}}let oe=0;if(o.tokens.length>0&&B.tokens.length>0){const X=o.tokens[o.tokens.length-1],le=B.tokens[0];try{X.type==="inline"&&le.type==="inline"&&(le.children&&le.children.length>0&&(X.children||(X.children=[]),this.appendTokens(X.children,le.children)),X.content=(X.content||"")+(le.content||""),oe=1)}catch{oe=0}}const Y=o.tokens.length;if(B.tokens.length>oe){const X=o.tokens,le=B.tokens,He=Math.min(X.length,le.length-oe);let de=0;for(let G=He;G>0;G--){let ae=!0;for(let me=0;me<G;me++){const q=X[X.length-G+me],ne=le[oe+me];if(!x6(q,ne)){ae=!1;break}}if(ae){de=G;break}}de>0&&(oe+=de),le.length>oe&&this.appendTokens(o.tokens,le,oe)}if(o.src=e,o.globalStateReason=null,o.lineCount=I+(ee??U()),o.tokens.length>Y){const X=this.getLastSegment(o.tokens,e,Y,o.tokens.length,e.length-u.length,I);X?o.lastSegment=X:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ce&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",bs(o.env,{area:"stream",path:ce?"stream-unbounded-append":"stream-append",reason:ce?"large-delta":"safe-append",unbounded:ce}),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",bs(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,x=!h&&!u&&p,k=m||x,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,_=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let N=u&&o.lineCount!==void 0?o.lineCount+ss(u):void 0;if(k){N===void 0&&(N=ss(e));const I=(U,Z,ce)=>U<Z?Z:U>ce?ce:U,R=_&&!$?J_(e.length,N,n.options):null,B=R?.maxChunkChars??(g?I(Math.ceil(e.length/v),8e3,64e3):y??1e4),P=R?.maxChunkLines??(g?I(Math.ceil(N/v),150,700):M??200),z=R?.maxChunks??(g?I(Math.ceil(e.length/64e3),v,32):L),W=e.length>0&&e.charCodeAt(e.length-1)===10,ee=x&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((m||ee)&&(e.length>=B*2||N>=P*2)&&W){const U=lp(n,e,d,{maxChunkChars:B,maxChunkLines:P,fenceAware:R?.fenceAware??E,maxChunks:z});return this.cache={src:e,tokens:U,env:d,lineCount:N,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,N),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),U}}const F=this.parseFullDocument(e,d,n,N),S=F.tokens;return N=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:N,lastSegment:void 0,globalStateReason:No(e)},this.updateCacheLineCount(this.cache,N),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",bs(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!yr(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=yr(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",bs(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!yr(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",bs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=No(e);zd(t)&&Dr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?v6(n,e.length,s):"no";if(r==="yes"){const a=Yu(n,e,t);return bs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?ss(e):0)}}let l=s;if(r==="need-lines"&&(l=ss(e),g6(n,e.length,l))){const a=Yu(n,e,t);return bs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?ss(e):0),{tokens:Lc(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:ss(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
156
+ `))return null;const 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(`
157
+ `);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+ss(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(`
158
+ `,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??Gj}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??ss(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(-v0))+t,s=No(n);return e.globalStateCarry=n.length>v0?n.slice(n.length-v0):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(`
159
+ `,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(`
160
+ `,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??ss(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+ss(i);t.lineCount=m;const x=this.getDocLineCount(e,m);return r.map&&(r.map[1]=x),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:x,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 x=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??ss(t.src);t.tokens.splice(x,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=k+ss(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(`
161
+ `);if(t<0)return null;const n=e.indexOf(`
162
+ `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,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=ss(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 iw={default:Wj,zero:zj,commonmark:Hj};function Jj(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function eV(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 rw(e){return e.experimental?{...e,...e.experimental}:e}function ci(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 lw(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(ci(t,o)||ci(e,o))return!0}return!1}function aw(e,t,n){return ci(t,n)||ci(e,n)}function cw(e,t){const n=yr(e)?.chunk;if(n?.fallback){bs(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}bs(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function tV(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=iw[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=rw(n),typeof n.quotes=="string"){const _=n.quotes;_.length>=4?n.quotes=[_[0],_[1],_[2],_[3]]:n.quotes=["“","”","‘","’"]}let r=lw(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=lw(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=aw(i?.options,o,"fullChunkedFallback"),c=aw(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new jq;let p=null;const m=()=>(p||(p=new Kj(n)),p);let x=null;const k=()=>(x||(x=new Xj(h)),x);let g=null;const v=()=>(g||(g=new PA),g),y=_=>!u&&!!d&&!eV(_,d),M=(_,E)=>s==="default"&&!u&&p===null&&f!==null&&_.parse===f&&y(_)&&!_.stream.enabled&&E<(_.options.autoUnboundedThresholdChars??4e6)&&_.options.html===!1&&_.options.xhtmlOut===!1&&_.options.breaks===!1&&_.options.langPrefix==="language-"&&_.options.linkify===!1&&_.options.typographer===!1&&_.options.highlight===null,L=(_,E)=>s==="default"&&!u&&y(_)&&!_.stream.enabled&&!_.options.fullChunkedFallback&&E<(_.options.autoUnboundedThresholdChars??4e6)&&_.options.html===!1&&_.options.linkify===!1&&_.options.typographer===!1,$={core:h,block:h.block,inline:h.inline,get linkify(){const _=v();return Object.defineProperty(this,"linkify",{value:_,writable:!0,configurable:!0}),_},get renderer(){const _=m();return Object.defineProperty(this,"renderer",{value:_,writable:!0,configurable:!0}),_},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(_){const E=rw(_);return this.options={...this.options,...E},(ci(_,"fullChunkSizeChars")||ci(_,"fullChunkSizeLines")||ci(_,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ci(_,"streamChunkSizeChars")||ci(_,"streamChunkSizeLines")||ci(_,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ci(_,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ci(_,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,x&&(x.reset(),x.resetStats())),this},configure(_){const E=typeof _=="string"?iw[_]:_;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const N=E.components;N.core?.rules&&this.core.ruler.enableOnly(N.core.rules),N.block?.rules&&this.block.ruler.enableOnly(N.block.rules),N.inline?.rules&&this.inline.ruler.enableOnly(N.inline.rules),N.inline2?.rules&&this.inline.ruler2.enableOnly(N.inline2.rules)}return this},enable(_,E){const N=Array.isArray(_)?_:[_],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const R=I.enable(N,!0);for(let B=0;B<R.length;B++)S.add(R[B])}if(!E){const I=N.filter(R=>!S.has(R));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(_,E){const N=Array.isArray(_)?_:[_],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of F){if(!I)continue;const R=I.disable(N,!0);for(let B=0;B<R.length;B++)S.add(R[B])}if(!E){const I=N.filter(R=>!S.has(R));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(_,...E){const N=typeof _=="function"?_:_&&typeof _.default=="function"?_.default:void 0;if(!N)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...E],S=_;return u=!0,N.apply(S,F),this},render(_,E){if(M(this,_.length)){E!==void 0&&uo(E);const S=Z_(_);if(S!==null)return E!==void 0&&bs(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=E??{},F=this.parse(_,N);return m().render(F,this.options,N)},async renderAsync(_,E){if(M(this,_.length)){E!==void 0&&uo(E);const S=Z_(_);if(S!==null)return E!==void 0&&bs(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=E??{},F=this.parse(_,N);return m().renderAsync(F,this.options,N)},renderIterable(_,E={}){const N=this.parseIterable(_,E);return m().render(N,this.options,E)},async renderAsyncIterable(_,E={}){const N=await this.parseAsyncIterable(_,E);return m().renderAsync(N,this.options,E)},renderInline(_,E={}){const N=this.parseInline(_,E);return m().render(N,this.options,E)},validateLink:s6,normalizeLink:o6,normalizeLinkText:i6,utils:dz,helpers:{...Jz},parse(_,E){if(typeof _!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&uo(E),L(this,_.length)){const I=sj(_);if(I!==null)return E!==void 0&&bs(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const N=E??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const I=v6(this,_.length);if(I==="yes"){const R=Yu(this,_,N);return bs(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}I==="need-lines"&&(F=ss(_))}if(!this.stream.enabled){const I=_.length,R=this.options.autoTuneChunks!==!1,B=r,P=!a&&y(this),z=!!this.options.fullChunkedFallback,W=P&&I>=2e5;let ee;(z||W||F!==void 0)&&(ee=F??ss(_));const U=(z||W)&&R&&!B?Pj(I,ee,this.options):null;if(z||W){const Z=ee??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||Z>=(this.options.fullChunkThresholdLines??400):W){if(U&&U.strategy!=="plain"){const ce=lp(this,_,N,{maxChunkChars:U.maxChunkChars,maxChunkLines:U.maxChunkLines,fenceAware:U.fenceAware,maxChunks:U.maxChunks});return E&&cw(E,z?"explicit-full-chunk":"default-large-string"),ce}if(z){const ce=(ae,me,q)=>ae<me?me:ae>q?q:ae,fe=this.options.fullChunkAdaptive!==!1,oe=this.options.fullChunkTargetChunks??8,Y=ce(Math.ceil(I/oe),8e3,64e3),X=ce(Math.ceil(Z/oe),150,700),le=fe?Y:this.options.fullChunkSizeChars??1e4,He=fe?X:this.options.fullChunkSizeLines??200,de=fe?ce(Math.ceil(I/64e3),oe,32):this.options.fullChunkMaxChunks,G=lp(this,_,N,{maxChunkChars:le,maxChunkLines:He,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:de});return E&&cw(E,"explicit-full-chunk"),G}}}if(F!==void 0&&y(this)&&g6(this,I,ee??F)){const Z=Yu(this,_,N);return bs(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),Z}}const S=No(_);return bs(E,{area:"parse",path:"plain",reason:"default-plain"}),Lc(N,S,()=>h.parse(_,N,this).tokens)},parseIterable(_,E={}){return uo(E),Oj(this,_,E)},parseAsyncIterable(_,E={}){return uo(E),Rj(this,_,E)},parseIterableToSink(_,E,N={}){return uo(N),Bj(this,_,E,N)},parseAsyncIterableToSink(_,E,N={}){return uo(N),Dj(this,_,E,N)},parseInline(_,E={}){if(typeof _!="string")throw new TypeError("Input data should be a String");uo(E),zd(E)&&Dr(E);const N=h.createState(_,E,this);return N.inlineMode=!0,h.process(N),N.tokens}};if($.stream={enabled:!!n.stream,parse(_,E){return $.stream.enabled?k().parse(_,E,$):$.parse(_,E??{})},reset(){k().reset()},peek(){return x?x.peek():[]},stats(){return x?x.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){x&&x.resetStats()}},i?.components){const _=i.components;_.core?.rules&&$.core.ruler.enableOnly(_.core.rules),_.block?.rules&&$.block.ruler.enableOnly(_.block.rules),_.inline?.rules&&$.inline.ruler.enableOnly(_.inline.rules),_.inline2?.rules&&$.inline.ruler2.enableOnly(_.inline2.rules)}return d=Jj($),f=$.parse,$}var nV=tV;const _6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],sV=["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"],w6=["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"],oV=["svg","g","path"],iV=["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"],rV=["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"],lV=["action","data","href","src","srcset","poster","xlink:href","formaction"],aV=["script"],cV=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],$a=new Set(_6),uV=new Set(w6),Md=new Set([..._6,...sV,...w6,...oV]),S6=new Set([...Md,...iV]),dV=new Set(rV),fV=new Set(lV),qd=new Set(aV),C6=new Set(cV);function A6(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 hV={amp:"&",bsol:"\\",colon:":",newline:`
163
+ `,sol:"/",tab:" "};function M6(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 hV[String(o??"").toLowerCase()]??t})}const Wf=new Set(["http","https","mailto","tel"]),pV=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),ea=new Set(["http","https"]);function E6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function mV(e,t,n){if(!Xu(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function Xu(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function gV(e,t){return t==="href"||t==="xlink:href"?Xu(e,t)?Wf:ea:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?ea:(Xu(e,t),Wf)}function ya(e,t={}){const n=A6(M6(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=E6(n);return i?i==="file"?!mV(n,s,o):Xu(s,o)?pV.has(i):!gV(s,o).has(i):!1}function vV(e){const t=M6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=E6(A6(t).toLowerCase());return n==="http"||n==="https"}function yV(e,t={}){const n=String(e??"").trim();return n?ya(n,t)?"":n:""}function uw(e){return yV(e,{tagName:"img",attrName:"src"})}function kV(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,m,x){return f[h].nesting===1&&f[h].attrJoin("class",t),x.renderToken(f,h,p,m,x)}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 x,k=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(x=g+1;x<=v&&r[(x-g)%a]===f.src[x];x++);const y=Math.floor((x-g)/a);if(y<i)return!1;x-=(x-g)%a;const M=f.src.slice(g,x),L=f.src.slice(x,v);if(!c(L,M))return!1;if(m)return!0;let $=h;for(;$++,!($>=p||(g=f.bMarks[$]+f.tShift[$],v=f.eMarks[$],g<v&&f.sCount[$]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[$]-f.blkIndent>=4)){for(x=g+1;x<=v&&r[(x-g)%a]===f.src[x];x++);if(!(Math.floor((x-g)/a)<y)&&(x-=(x-g)%a,x=f.skipSpaces(x),!(x<v))){k=!0;break}}const _=f.parentType,E=f.lineMax;f.parentType="container",f.lineMax=$;const N=f.push("container_"+t+"_open","div",1);N.markup=M,N.block=!0,N.info=L,N.map=[h,$],f.md.block.tokenize(f,h+1,$);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,x),F.block=!0,f.parentType=_,f.lineMax=E,f.line=$+(k?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function bV(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 x=0;x<a.length;x++){const k=a[x];if(k==="\\"){x++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=x;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 xV(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(kV,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
164
+ `}})}),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 M=0,L=-1;for(let $=0;$<m.length;$++)if(m[$]==="{"?M++:m[$]==="}"&&M--,M===0){L=$+1;break}L>0&&(h=m.slice(0,L))}h||(f=d||void 0)}if(o)return!0;const x=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=s;){const M=i.bMarks[k]+i.tShift[k],L=i.eMarks[k];if(i.src.slice(M,L).trim()===":::"){g=!0;break}k++}g||(k=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&&!x},f&&v.attrSet("data-args",f),h)try{const M=JSON.parse(h);for(const[L,$]of Object.entries(M)){const _=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,_?JSON.stringify($):String($))}}catch{const M=bV(h);if(M)for(const[L,$]of Object.entries(M)){const _=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,_?JSON.stringify($):String($))}else v.attrSet("data-attrs",h)}const y=[];for(let M=n+1;M<k;M++){const L=i.bMarks[M]+i.tShift[M],$=i.eMarks[M];y.push(i.src.slice(L,$))}if(y.some(M=>M.trim().length>0)){let M=y.join(`
165
+ `);M.endsWith(`
166
+ `)||(M+=`
167
+ `),M.endsWith(`
168
+
169
+ `)||(M+=`
170
+ `);const L=i.tokens[i.tokens.length-1];L&&(L.raw=M);const $=[];i.md.block.parse(M,i.md,i.env,$),i.tokens.push(...$)}return g&&i.push("vmr_container_close","div",-1),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Yo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xn(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 _m(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 _V=/^[a-z][a-z0-9_-]*$/;function dw(e){return _V.test(String(e??"").trim().toLowerCase())}function xi(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return dw(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)?"":dw(o)?o:""}function eu(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=xi(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function wV(...e){const t=new Set,n=[];for(const s of e)for(const o of eu(s))t.has(o)||(t.add(o),n.push(o));return n}function SV(e){const t=eu(e);return{key:t.join(","),tags:t}}function T6(e){return xi(e)}function CV(e,t){const n=String(e??""),s=xi(t);if(!s)return!1;const o=Yo(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 N6(e,t){const n=xi(t);return!!n&&!Md.has(n)&&!CV(e,n)}function AV(e,t){const n=String(e??""),s=xi(t);if(!s)return n;const o=Yo(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 I6=$a,MV=Md,$6=new Set(uV);$6.delete("details");const EV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,TV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,rv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,NV=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function up(e){return(e.match(rv)?.[1]??"").toLowerCase()}function Qy(e){return/^\s*<\s*\//.test(e)}function Xy(e,t){return I6.has(t)||/\/\s*>\s*$/.test(e)}function IV(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=up(i);if(r===t){if(Qy(i)){if(n===0)return s;n--;continue}Xy(i,r)||n++}}return-1}function $V(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=up(o);if(i===t){if(Qy(o)){n>0&&n--;continue}Xy(o,i)||n++}}return n}function fw(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Yo(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 LV(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Yo(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 dp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function FV(e){const t=e;return t.meta||(t.meta={}),t.meta}function y0(e,t,n){const s=FV(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function OV(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Yo(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(`
171
+ `),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();y0(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*${Yo(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const x=m??(h.type==="html_inline"?up(p):"");if(!(x&&t.has(x))){r(p);return}const k=Qy(p),g=!k&&Xy(p,x);if(k){if(!s.length||s[s.length-1].tag!==x){r(p);return}c(p);return}if(r(p),g){y0(h,p,"");return}s.push({tag:x,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,x=!0;for(const k of h.children){const g=dp(k),v=k.type==="html_inline"?up(g):"",y=v&&t.has(v);let M=g;if(x&&p&&g&&(s.length||y)){const L=p.indexOf(g,m);if(L!==-1)a(p.slice(m,L)),M=p.slice(L,L+g.length),m=L+g.length;else{if(s.length&&!y)continue;x=!1}}f(k,M,v)}x&&p&&m<p.length&&s.length&&a(p.slice(m)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=dp(h),m=h.type==="html_block"?u(p):null;if(m){c(`${o?`
172
+ `:""}${m}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)y0(h.token,h.raw,h.inner)}function RV(e){return/^\s*<\s*[!?]/.test(e)}function BV(e){const t=new Set(MV);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 hw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function DV(e,t){let n=null;for(const i of e.matchAll(EV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();hw(l,t)&&Xn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(TV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();hw(l,t)&&Xn(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 PV(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function HV(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(PV(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(rv);if(!h){i("<",c),u=d+1;continue}const p=Xn(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),x=(h[1]??"").toLowerCase();t.has(x)?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=DV(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+=dp(a),o=s.buffer;const c=Xn(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=dp(a),u=(c.match(rv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Xn(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 WV=["a","span","strong","em","b","i","u"];function zV(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=xi(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=xi(String(v??""));y&&p.add(y)}const x=BV(Array.from(p)),k=new Set(WV);for(const v of p)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:x,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!x.has(v)||$6.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 x={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},x,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[x]},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 x of h){const k=x;if(k.type!=="inline"||!Array.isArray(k.children))continue;const g=String(k.content??""),v=k.children.length?k.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=HV(v,p);if(k.children=y.children,y.pendingBuffer){const M=g.lastIndexOf(y.pendingBuffer);if(M!==-1){const L=g.slice(0,M);k.content=L,typeof k.raw=="string"&&(k.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}OV(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:x}=s(f),k=[];for(let g=0;g<h.length;g++){const v=h[g];if(k.length>0){const[M,L]=k[k.length-1];if(g!==L){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const $=String(v.content??v.raw??"");if($){const _=h[L],E=`${String(_.content||"")}
173
+ ${$}`,N=Xn(E),F=N===-1?null:fw(E,M,N+1);if(F){const S=E.slice(0,F.end),I=E.slice(F.end);_.content=S,_.loading=!1,h.splice(g,1),k.pop();const R=d(_,I)?[]:c(I,u(h,g,"paragraph"));R.length&&h.splice(g,0,...R),g--;continue}_.content=E,_.loading!==!1&&(_.loading=!0)}h.splice(g,1),g--;continue}}const y=o(v);if(y){if(RV(y))continue;const M=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!M||!x(M))continue;if(i(v,y),!L)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(y)&&LV(y,M)>0&&k.push([M,g]);else if(k.length>0&&M&&k[k.length-1][0]===M){const[,$]=k[k.length-1],_=h[$];_.content=`${String(_.content||"")}
174
+ ${y}`,_.loading=!1,k.pop(),h.splice(g,1),g--}continue}else if(k.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const M=v.content||"",L=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(M);if(M){const[,$]=k[k.length-1],_=h[$];_.content=`${_.content||""}
175
+ ${M}`,_.loading!==!1&&(_.loading=!L)}L&&k.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=$=>{let _=g.get($);return _||(_=new RegExp(`<\\s*${$}\\b`,"i"),g.set($,_)),_},M=$=>{let _=v.get($);return _||(_=new RegExp(`<\\s*\\/\\s*${$}\\s*>`,"i"),v.set($,_)),_},L=[];for(let $=0;$<h.length;$++){const _=h[$],E=String(_.content??"");if(L.length>0){const F=L[L.length-1],S=h[F.index],I=_.type==="html_block"?M(F.tag).exec(E):null;if(I){const P=I.index+I[0].length,z=E.slice(0,P),W=E.slice(P);S.content=`${String(S.content??"")}
176
+ ${z}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),L.pop();const ee=d(S,W)?[]:c(W,u(h,$,"paragraph"));ee.length?h.splice($,1,...ee):(h.splice($,1),$--);continue}if(_.type!=="inline")continue;const R=Array.isArray(_.children)?_.children:[],B=IV(R,F.tag);if(B!==-1){const P=R.slice(0,B+1),z=R.slice(B+1),W=P.map(ee=>String(ee?.content??ee?.raw??"")).join("");if(S.content=`${String(S.content??"")}
177
+ ${W}`,Array.isArray(S.children)&&S.children.push(...P),z.length){const ee=z.map(U=>String(U.content??U.raw??"")).join("");if(ee.trim()){const U=ee.replace(/^\s+/,"");if(d(S,ee))h.splice($,1),$--;else if(U.startsWith("<"))h.splice($,1,{type:"html_block",content:U});else{const Z=c(ee,u(h,$,"paragraph"));h.splice($,1,...Z)}}else h.splice($,1),$--}else h.splice($,1),$--;L.pop();continue}S.content=`${String(S.content??"")}
178
+ ${E}`,Array.isArray(S.children)&&S.children.push(...R),h.splice($,1),$--;continue}if(_.type!=="inline")continue;const N=Array.isArray(_.children)?_.children:[];for(const F of m)if((N.length?$V(N,F):y(F).test(E)&&!M(F).test(E)?1:0)>0){L.push({tag:F,index:$});break}}}{let g=0;for(let v=0;v<h.length;v++){const y=h[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const _=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(_.startsWith("!")||_.startsWith("?")){v.loading=!1;continue}if(m.has(_)){const B=String(v.content??""),P=Xn(B),z=P===-1?null:fw(B,_,P+1);v.loading=z?!1:v.loading!==void 0?v.loading:!0;const W=z?.start??-1,ee=z?z.end-z.start:0;if(W!==-1){const U=B.slice(0,W+ee);let Z="";P!==-1&&P<W&&(Z=B.slice(P+1,W)),v.children=[{type:_,content:Z,raw:U,attrs:[],tag:_,loading:!1}],v.content=U,v.raw=U;const ce=c(B.slice(W+ee)||"","text");ce.length&&h.splice(g+1,0,...ce)}else v.children=[{type:_,content:"",raw:B,attrs:[],tag:_,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(_))continue;v.type="inline";const E=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let N;for(;(N=E.exec(v.content||""))!==null;)N[1],N[2]||N[3]||N[4];const F=String(v.content??""),S=new RegExp(`<\\/\\s*${_}\\s*>`,"i").exec(F),I=S?S.index:-1,R=S?S[0].length:0;if(I!==-1){const B=F.slice(0,I+R),P=(F.slice(I+R)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:B,tag:_,loading:!1}],v.content=B,v.raw=B,P&&h.splice(g+1,0,P.startsWith("<")?{type:"html_block",content:P}:{type:"text",content:P,raw:P})}else v.children=[{type:"html_block",content:v.content,tag:_,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const _=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=v.children[1],N=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&N===_)continue;p.has(_)?(v.children[0].loading=!0,v.children[0].tag=_,v.children.push({type:"html_inline",tag:_,loading:!0,content:`</${_}>`})):v.children=[{type:"html_block",loading:!0,tag:_,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 _=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(_))continue;v.children=[{type:"html_block",loading:!1,tag:_,content:v.children.map(E=>E.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),M=v,L=M.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(M.children.length=0);continue}const $=String(L.content??y).match(NV)?.[1]?.toLowerCase()??"";if($){if(/\/\s*>\s*$/.test(y)||I6.has($)){M.children=[{type:"html_inline",content:y}];continue}M.children.length=0}}})}function UV(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 qV(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&&!UV(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 L6=/\.([a-z0-9]{1,15})$/i,jV=/[_()[\]{}<>]/u,VV=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,KV=/[?#@]/u,GV=/[\\/]/u,YV=/^[\p{L}\p{N}./\\-]+$/u,ZV=/^[A-Za-z0-9-]{1,63}$/u,QV=/^xn--[a-z0-9-]{2,59}$/i,XV=/^(?:[A-Z]{1,6}|\d{1,8})$/u,JV=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,eK=/文件名\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,tK=/文件名\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,nK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,sK=new Set(["ai","md","py","rs","sh","zip"]),F6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),oK=new Set([...F6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),iK=new Set(["com","dev","io","page","site"]),rK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),lK=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 Ed(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function k0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Ed(n)?n:void 0}function pw(e,t){if(!Ed(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 mw(e){const t=jd(e);return Ed(t)?t:void 0}function aK(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function gw(e,t){if(!Ed(t))return;const n=String(e??"").trim().split(/\s+/u).map(aK).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>fp(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>fp(o,{marketTicker:!0}))&&(s.marketTicker=!0),Ed(s)?s:void 0}function Bl(e,t=!1){let n;return{options(s){return t||s==null?pw(e,n):pw(e,k0(mw(s),gw(s,n)))},remember(s){const o=mw(s);n=t?k0(n,o):k0(o,gw(s,n))},reset(){n=void 0}}}function vw(e){return ZV.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function cK(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return vw(n)||QV.test(n)?t.every(vw):!1}function O6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function uK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function dK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function R6(e,t,n){const s=uK(t);return O6(e)&&dK(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function jd(e){const t=String(e??"");return{explicitFilename:eK.test(t),filename:tK.test(t),marketTicker:nK.test(t)}}function fK(e){return cK(e.split(/[\\/]/)[0]??"")}function hK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function pK(e){if(jV.test(e)||!YV.test(e))return!0;if(GV.test(e))return!fK(e);const t=e.replace(L6,"");return O6(t)?!0:t.split(".").filter(Boolean).some(hK)}function mK(e,t,n){if(!(n?oK:F6).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?JV:XV).test(s)}function fp(e,t={}){if(!e||VV.test(e)||KV.test(e))return!1;const n=e.match(L6);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return mK(e,s,t.marketTicker===!0)?!0:lK.has(s)?!sK.has(s)||t.filename?!0:pK(e):!!(t.explicitFilename&&iK.has(s)||t.filename&&rK.has(s))}const yw=["!"];function Eo(e){return{type:"text",content:e,raw:e}}function ta(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 na(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 nl(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 gK(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(Eo(t))}}function kw(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 vK(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function yK(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 kK(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 bK(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=xK(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function xK(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=jd(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=kK(e,s,i),l=vK(o);if(o.markup==="linkify"&&r&&!R6(r,l,t)&&fp(r,n)){e.splice(s,i-s+1,Eo(r));continue}const a=kw(l,yw);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=kw(u.content,yw);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let k=c+1;k<i;k++){const g=e[k];g?.type==="text"&&typeof g.content=="string"&&(p+=g.content)}u.content=h,u.raw=h;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let x=l;if(a!==-1)x=l.slice(0,a);else if(p){const k=encodeURI(p);if(k&&l.endsWith(k))x=l.slice(0,l.length-k.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(x=l.slice(0,v))}}x!==l&&yK(o,x),p&&e.splice(i+1,0,Eo(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(Eo(r));const c=i[1],u=l[1].length;ta(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(nl(c,d,!e[s+4]?.content?.startsWith(")"))),na(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(Eo(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(Eo(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=""),ta(a,f),a.push(nl(c,h,!e[s+4]?.content?.startsWith(")"))),na(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(Eo(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(nl(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(Eo(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(nl(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(Eo(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;ta(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,x=e[p];if(m===1&&x.type==="em_close")break;if(m===2&&x.type==="strong_close")break;if(m===3&&(x.type==="em_close"||x.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;na(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(Eo(l)),ta(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(nl(a,c,u)),na(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(Eo(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(Eo(r)),ta(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(nl(l,a,c)),na(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(Eo(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(Eo(r)),ta(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(nl(a,c,d)),na(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=[];ta(a,2),a.push(nl(r,l,!1)),na(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;gK(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function _K(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=wK(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function wK(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 SK(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=CK(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function CK(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 x=u+1;for(;x<e.length&&e[x].type==="text"&&e[x].content==="";)x++;const k=e[x];h==="__"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){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 x=u+1;for(;x<e.length&&e[x].type==="text"&&e[x].content==="";)x++;const k=e[x];h==="_"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,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=AK(l),l}function AK(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=MK(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 MK(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 EK(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=FK(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 bw(){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 xw(){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 _w(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 B6(e,t){if(!e.startsWith("|")||e.includes(`
179
+ `)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function b0(e){return B6(e)!==null}function D6(e){return/^:?-+:?$/.test(e.trim())}function TK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(D6)}function NK(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function IK(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(D6)&&NK(n)}function $K(e){return e==="|"||e==="|:"}function LK(e){const t=B6(e);return t!==null&&t.every(n=>!n.includes(":"))}function FK(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(`
180
+ `)[0]??"",[a="",c="",...u]=r.split(`
181
+ `),d=!t&&!r.includes(`
182
+ `)&&/\r?\n$/.test(n)&&b0(r);if(!t&&(r.includes(`
183
+ `)&&u.length===0&&b0(a)&&IK(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>_w(p)),h=[...bw(),...f,...xw()];s.splice(o-1,3,...h)}else if(r.includes(`
184
+ `)&&u.length===0&&b0(a)&&TK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>_w(p)),h=[...bw(),...f,...xw()];s.splice(o-1,3,...h)}else r.includes(`
185
+ `)&&u.length===0&&LK(a)&&$K(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function OK(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 RK=OK;const BK=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],hp=BK.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),DK=/\\[a-z]+/i,P6="(?:\\\\|\\u0008)",PK=new RegExp(String.raw`${P6}(?:${hp})\s*\{[^}]+\}`,"i"),HK=new RegExp(String.raw`(?:${P6})?(?:${hp})\s*\{`,"i"),WK=/\\(?:text|frac|left|right|times)/,zK=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,UK=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,qK=/[A-Z]+\s*\([^)]+\)/i,jK=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,VK=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,KK=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,GK={"\b":"\\b","\v":"\\v","\f":"\\f"};function YK(e){let t="";for(const n of e)t+=GK[n]??n;return t}function kc(e){if(!e)return!1;const t=YK(e),n=t.trim();if(KK.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=DK.test(t),o=PK.test(t),i=HK.test(t),r=WK.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=zK.test(t)&&!UK.test(t),c=qK.test(t),u=jK.test(n),d=VK.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 H6="__markstreamMathPluginApplied",lv=80,W6=2e4,ww=W6+4096;function z6(e){return!!e[H6]}function ZK(e){e[H6]=!0}const U6=["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"],QK=["cdot","mathbf{","partial","mu_{"],q6=U6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),j6="[ \r\b\f\v]",XK=new RegExp(`([^\\\\])(${QK.map(e=>e).join("|")})+`,"g"),JK=/span\{([^}]+)\}/,eG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,tG=/(^|[^\\])\\\r?\n/g,nG=/(^|[^\\])\\$/g,sG=new RegExp(`(${j6})|(${q6})\\b`,"g"),Sw=new Map,Cw=new Map;function oG(e){if(!e)return sG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=Sw.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${j6})|(${o})\\b`,"g");return Sw.set(n,i),i}function iG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=Cw.get(s);if(o)return o;const i=e?[hp,q6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),hp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Cw.set(s,r),r}const Aw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Mw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Ew(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 sl(e,t){const n=t?.commands??U6,s=t?.escapeExclamation??!0,o=t?.commands==null,i=oG(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&Aw[u]!==void 0)return`\\${Aw[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=iG(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(JK,"span\\{$1\\}").replace(eG,"\\operatorname{span}\\{$1\\}"),l=l.replace(tG,`$1\\\\
186
+ `),l=l.replace(nG,"$1\\\\"),l=l.replace(XK,"$1\\$2"),l}function Tw(e){const t=e.trim();return!(!kc(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 V6(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 pp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function rG(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 Vd(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function av(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(Vd(e,s)){n=s+1;continue}return s}return-1}function x0(e,t){let n=t;for(;n<e.length;){const s=av(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 Du(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(!Vd(e,o))return o;s=o+Math.max(1,t.length)}return-1}function Nw(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=pp(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Vd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Jy(e,t,n){const s=Nd(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!Nd(s.slice(0,o)).trim()||Vd(s,o))return-1;const i=V6(s);if(pp(i,o))return-1;const r=Nw(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Nw(s,n,0,o,i))return-1;return o}function Td(e){return e===" "||e===" "}function Nd(e){let t=e.length;for(;t>0&&Td(e[t-1]);)t--;return e.slice(0,t)}function Iw(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
187
+ `&&t++;return t}function $w(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function lG(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(!Td(o))return!1}return n>=3}function aG(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 cG(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(aG)}function uG(e){let t=0;if(!$w(e[t]))return!1;for(;$w(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Td(e[t+1])}function K6(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&&Td(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Td(t[1])||uG(t)||lG(t)||cG(t))}function Lw(e,t){return e?t?`${e}
188
+ ${t}`:e:t}function cv(e){const t=String(e??"").trim();return t?kc(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 G6(e){if(e.length<=ww)return{source:e,lineOffset:0};let t=e.length-ww;const n=e.indexOf(`
189
+ `,t);return n===-1?{source:"",lineOffset:Iw(e)}:(t=n+1,{source:e.slice(t),lineOffset:Iw(e.slice(0,t))})}function Y6(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=G6(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-lv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=Nd(s[r]);if(l&&!K6(l)){for(const[a,c]of i)if(Jy(l,a,c)!==-1)return!0}}return!1}function dG(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=G6(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-lv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=Nd(o[l]);for(const[c,u]of r){const d=Jy(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>lv){h=!0;break}const m=o[p],x=Du(m,u);if(x!==-1){const k=Lw(f,m.slice(0,x));if(!cv(k)){h=!0;break}const g=m.slice(x+u.length),v=g.trim()?`suffix:${Fw(g)}`:"nosuffix";return["closed",c,s+l,d,s+p,x,Fw(k),v].join(":")}if(K6(m)){h=!0;break}if(f=Lw(f,m),f.length>W6){h=!0;break}}if(!h&&cv(f))return["pending",c,s+l,d].join(":")}}return null}function _0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function fG(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 w0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function hG(e,t){ZK(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]===`
190
+ `||g[y]==="\r"&&g[y+1]===`
191
+ `))return v;const M=g.slice(v,y),L=a.push("text","",0);return L.content=M,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 M=a.push("text","",0);return M.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,x=p;const k=p;for(const[g,v]of f){const y=a.src,M=V6(y),L=rG(y,u);let $=!1;g==="$$"&&m!==k&&(m=k);let _=-1,E=-1,N=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const B=a.push("text_special","",0);B.content=S==="\\)"?")":"(",B.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let B=0;for(;B<S.length;){const P=av(S,B);if(P===-1){const X=S.slice(B);if(X){const le=a.push("text","",0);le.content=X,a.pos=a.pos+X.length,m=a.pos}break}if(P>0&&S[P-1]==="$"||P+1<S.length&&S[P+1]==="$"){const X=S.slice(B,P+1);if(X){const le=a.push("text","",0);le.content=X,a.pos=a.pos+X.length,m=a.pos}B=P+1;continue}const z=S.slice(B,P);if(z){const X=a.push("text","",0);X.content=z,a.pos=a.pos+z.length,m=a.pos}const W=x0(S,P+1);if(W===-1){const X=S.slice(P),le=a.push("text","",0);le.content=X,a.pos=a.pos+X.length,m=a.pos;break}const ee=S.slice(P+1,W),U=ee.includes("`"),Z=!ee||!ee.trim(),ce=S[W+1],fe=_0(ee,ce),oe=w0(ee);if(!U&&!Z&&!fe&&!oe){const X=a.push("math_inline","math",0);X.content=sl(ee,t),X.markup="$",X.raw=`$${ee}$`,X.loading=!1,a.pos=a.pos+(W-P+1),m=a.pos,B=W+1;continue}const Y=a.push("text","",0);Y.content="$",a.pos=a.pos+1,m=a.pos,B=P+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const z=S.slice(0,I),W=a.push("text","",0);W.content=z,a.pos=a.pos+z.length,m=a.pos}const B=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,z,W]=B,ee=W.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),U=ee?ee[1]:W,Z=ee&&ee[2]?ee[2]:null,ce=a.push("image","img",0);ce.attrs=[["src",U],["alt",z]],Z&&ce.attrs.push(["title",Z]),ce.content=z,ce.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+B[0].length,m=a.pos;const fe=S.slice(I+B[0].length);fe&&F(fe);return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,m=a.pos;return}const R=a.push("text","",0);R.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=y.length);){const S=y.indexOf(g,m);if(S===-1)break;if(Vd(y,S)){m=S+Math.max(1,g.length);continue}const I=pp(M,S);if(I){m=I[1];continue}const R=pp(L,S);if(R){m=R[1];continue}if(S===_&&m===E){if(N++,N>2){m=S+Math.max(1,g.length);continue}}else N=0,_=S,E=m;if(g==="("&&S>0){let fe=S-1;for(;fe>=0&&y[fe]===" ";)fe--;if(fe>=0&&y[fe]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&y[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<y.length-1&&y[S+1]==="$"){m=S+2;continue}const B=g==="$"?x0(y,S+g.length):RK(y,S+g.length,g,v);if(B===-1){const fe=y.slice(S+g.length);if(fe.includes(g)){m=y.indexOf(g,S+g.length);continue}if(B===-1){const oe=g==="$"&&fG(fe);if(u&&!c&&!oe&&kc(fe)&&!fe.includes("`")){if(m=S+g.length,$=!0,!l){a.pending="";const Y=x?y.slice(x,m):y.slice(0,m),X=Mw(Y)%2===1;if(x)F(y.slice(x,m));else{let le=y.slice(0,m);le.endsWith(g)&&(le=le.slice(0,le.length-g.length)),F(le)}if(X){const le=Ew(Y)?.marker??"**",He=a.push("strong_open","",0);He.markup=le;const de=a.push("math_inline","math",0);de.content=sl(fe,t),de.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",de.raw=`${g}${fe}${v}`,de.loading=!0,He.content=fe,a.push("strong_close","",0)}else{const le=a.push("math_inline","math",0);le.content=sl(fe,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${fe}${v}`,le.loading=!0}a.pos=y.length}m=y.length,x=m}break}}const P=y.slice(S+g.length,B),z=P.includes("`"),W=!P||!P.trim(),ee=g==="$",U=y[B+v.length],Z=ee&&_0(P,U),ce=ee&&w0(P);if(c?z||W||Z||ce:z||W||Z||ce||!ee&&!kc(P)){m=B+v.length;const fe=y.slice(a.pos,m);a.pending||(F(fe),x=m);continue}if($=!0,!l){const fe=y.slice(a.pos-(a.pending??"").length,S);let oe=y.slice(0,m)?y.slice(x,S):fe;const Y=Mw(oe)%2===1;S!==a.pos&&Y&&(oe=a.pending+y.slice(a.pos,S));const X=Y?Ew(oe):null,le=X?.marker??"**";if(a.pending!==oe)if(a.pending="",Y)if(X){const He=oe.slice(X.index+le.length);F(oe.slice(0,X.index));const de=a.push("strong_open","",0);de.markup=le;const G=a.push("text","",0);G.content=He,a.push("strong_close","",0)}else F(oe);else F(oe);if(Y){const He=a.push("strong_open","",0);He.markup=le;const de=a.push("math_inline","math",0);de.content=sl(P,t),de.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",de.raw=`${g}${P}${v}`,de.loading=!1;const G=y.slice(B+v.length).startsWith(le);return G&&a.push("strong_close","",0),a.pos=d(y,B+v.length),m=a.pos,x=m,G||a.push("strong_close","",0),!0}else{const He=a.push("math_inline","math",0);He.content=sl(P,t),He.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",He.raw=`${g}${P}${v}`,He.loading=!1}}return m=d(y,B+v.length),x=m,a.pos=m,!0}if($){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let S=m;for(;!(S>=y.length);){const I=av(y,S);if(I===-1)break;if(I+1<y.length&&y[I+1]==="$"){S=I+2;continue}if(I>0&&y[I-1]==="$"){S=I+1;continue}const R=x0(y,I+1);if(R===-1)break;const B=y.slice(I+1,R),P=B.includes("`"),z=!B||!B.trim(),W=y[R+1],ee=_0(B,W),U=w0(B);if(!P&&!z&&!ee&&!U){const Z=y.slice(m,I);Z&&F(Z);const ce=a.push("math_inline","math",0);ce.content=sl(B,t),ce.markup="$",ce.raw=`$${B}$`,ce.loading=!1,m=R+1,S=R+1}else F("$"),S=I+1}S<y.length&&F(y.slice(S))}else m<y.length&&F(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(),x=!1,k="",g="",v=!1,y="",M=!1;for(const[Z,ce]of h)if(m.startsWith(Z))if(Z.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){x=!0,k=Z,g=ce;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){x=!0,k=Z,g=ce;break}continue}else{const fe=u.tokens[u.tokens.length-1];if(fe&&fe.type==="list_item_open"&&fe.mark==="-"&&m.slice(Z.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const oe=m.indexOf("]");if(m.slice(oe).trim()!=="]")continue;const Y=m.slice(Z.length,oe);if(Z==="["?Tw(Y):kc(Y)){x=!0,k=Z,g=ce;break}continue}}else{x=!0,k=Z,g=ce;break}else if((Z==="$$"||Z==="\\[")&&m.endsWith(Z)&&l+1<a){const fe=Jy(m,Z,ce);if(fe===-1)continue;y=Nd(m.slice(0,fe)),M=!0;const oe=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(oe,u.eMarks[l+1]).trim(),v=!0,x=!0,k=Z,g=ce;break}if(!x)return!1;if(c&&!M)return!0;const L=m.indexOf(k),$=L+k.length,_=!f&&k==="["?m.indexOf("\\]",$):-1,E=_>=0?"\\]":g,N=_>=0?_:Du(m,g,$);if(!v&&N>k.length){const Z=m.slice(L+k.length,N),ce=u.push("math_block","math",0);ce.content=sl(Z),ce.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ce.map=[l,l+1],ce.raw=`${k}${Z}${E}`,ce.block=!0,ce.loading=!1,u.line=l+1;const fe=m.slice(N+E.length);return fe.trim()&&n(u,fe,l),!0}let F=l,S="",I=!1,R="",B=l;const P=v?m:m===k?"":m.slice(k.length),z=!f&&k==="\\["?"]":"",W=Du(P,g);if(W!==-1){const Z=W;S=P.slice(0,Z),R=P.slice(Z+g.length),B=v?l+1:l,I=!0,F=B}else for(P&&!v&&(S=P),F=l+1;F<a;F++){const Z=u.bMarks[F]+u.tShift[F],ce=u.eMarks[F],fe=u.src.slice(Z,ce),oe=fe.trim();if(!f&&k==="["&&oe==="\\]"){g="\\]",I=!0;break}if(z&&fe.trim()===z){g=z,I=!0;break}if(oe===g){I=!0;break}else if(!f&&k==="["&&fe.includes("\\]")){I=!0;const Y=fe.indexOf("\\]");g="\\]";const X=fe.slice(0,Y);X&&(S+=(S?`
192
+ `:"")+X),R=fe.slice(Y+g.length),B=F;break}else if(Du(fe,g)!==-1){I=!0;const Y=Du(fe,g),X=fe.slice(0,Y);X&&(S+=(S?`
193
+ `:"")+X),R=fe.slice(Y+g.length),B=F;break}S+=(S?`
194
+ `:"")+fe}if((!d||f)&&!I)return!1;const ee=/^\s*!\[/.test(S);if(!(M?!ee&&cv(S):k==="$$"?!ee:k==="["?Tw(S):kc(S)))return!1;if(c)return!0;y&&n(u,y,l);const U=u.push("math_block","math",0);return U.content=sl(S),U.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",U.raw=`${k}${S}${S.startsWith(`
195
+ `)?`
196
+ `:""}${g}`,U.map=[l,F+1],U.block=!0,U.loading=!I,u.line=F+1,R.trim()&&n(u,R,B),!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 pG(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 mG(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 nV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!ya(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&hG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&xV(i),e.enableFixIndentedCodeBlock!==!1&&qV(i),bK(i),SK(i),_K(i),EK(i),pG(i),zV(i,{customHtmlTags:e.customHtmlTags}),i}function ka(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=>ka(n))),t}function gG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function vG(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 yG(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function zf(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(...Jn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const Ow=/\r?\n[ \t]*`+\s*$/,Z6=["diff ","index ","--- ","+++ ","@@ "],kG=/\r?\n/;function bG(e){const t=String(e??"");return t?Z6.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function Rw(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function xG(e,t){const n=[],s=[],o=[],i=[],r=e.split(kG),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!Z6.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{Rw(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&&bG(p)||c(p)}(t||o.length>0||i.length>0)&&Rw(n,s,o,i);const d=n.join(`
197
+ `),f=s.join(`
198
+ `);return{original:t&&l&&d?`${d}
199
+ `:d,updated:t&&l&&f?`${f}
200
+ `:f}}function ek(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(Ow.test(a)&&(a=a.replace(Ow,"")),r){const{original:c,updated:u}=xG(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 _G(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function wG(){return{type:"hardbreak",raw:`\\
201
+ `}}function SG(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(...Jn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let S0=null;const C0=new WeakMap;function Bw(){return S0||(S0={customTagSet:null,allowedTagSet:Cm()}),S0}function Q6(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function X6(e){return/^<\s*\//.test(e)}function J6(e,t){return/\/\s*>\s*$/.test(t)||$a.has(e)}function CG(e){if(!e||e.length===0)return Bw();const t=C0.get(e);if(t)return t;const n=e.map(xi).filter(Boolean);if(!n.length){const o=Bw();return C0.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:Cm({customHtmlTags:e})};return C0.set(e,s),s}function eM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function AG(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function mp(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 MG(e,t,n){const s=e.slice();return mp(s,"href")||s.push(["href",t]),n!=null&&!mp(s,"title")&&s.push(["title",n]),s}function uv(e){return e.map(eM).join("")}function gh(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:gh(s.children)});continue}t.push(s)}return t}function EG(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=Q6(r),a=X6(r),c=J6(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function A0(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?EG(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:uv(s),innerTokens:o,nextIndex:i}}function TG(e,t,n,s,o,i,r){const l=String(e.content??""),a=Q6(l),{customTagSet:c,allowedTagSet:u}=CG(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!A0(t,n,a).closed){const M=eM(e);return[{type:"text",content:M,raw:M},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=X6(l),f=J6(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const M=A0(t,n,a),L=_m(l),$=M.innerTokens,_=String(mp(L,"href")??""),E=mp(L,"title"),N=E==null?null:String(E),F=MG(L,_,N),S=gh($.length?s($,o,i,r):[]),I=$.length?uv($):_||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:_,title:N,text:I,attrs:F,children:S,loading:!M.closed,raw:M.html||l},M.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=A0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:gh(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=gh(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let m=h.html||l,x=!h.closed,k=!1;if(!h.closed){const M=`</${a}>`;m.toLowerCase().includes(M.toLowerCase())||(m+=M),k=!0,x=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const M=y[1],L=y[2]||y[3]||y[4]||"";g.push([M,L])}if(c?.has(a)){const M=AG(e);return[{type:a,tag:a,attrs:g,content:M?M.inner:h.innerTokens.length?uv(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:M?.raw??m,loading:e.loading||x,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:x,autoClosed:k},h.nextIndex]}function tM(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=>tM(t)).join(""):String(e.content??"")}function NG(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>tM(t)).join("")}function Dw(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=NG(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 IG(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function $G(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(...Jn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function LG(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 gp(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 FG(e,t,n){const s=e.slice();return gp(s,"href")||s.push(["href",t]),n!=null&&!gp(s,"title")&&s.push(["title",n]),s}function Uf(e,t,n){const s=e[t],o=LG(s.attrs),i=String(gp(o,"href")??""),r=gp(o,"title"),l=r==null?null:String(r),a=FG(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(x=>x.type==="strong_open")){const x=String(h.content??""),k=String(h.raw??x),g=ka(h);g.content=x.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=Jn(f,void 0,void 0,n),m=p.map(x=>{const k=x;return"content"in x?String(k.content??""):String(k.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:p,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function Pw(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 OG(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Hw(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(...Jn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const RG=/\\([\\()[\]`$|*_\-!])/g;function BG(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(RG,"$1")===t))return n}function Eu(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(...Jn(l,BG(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function DG(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(...Jn(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 PG(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(...Jn(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 HG(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const WG=/[^~]*~{2,}[^~]+/,zG=/\*\*/,UG=/[[_*^~]/,qG=/\\([\\()[\]`$|*_\-!])/g,tk=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),jG=/\s/u,VG=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,KG=/\p{P}/u,GG=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,YG=/:\/\//;function ZG(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 nM(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&&tk.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Il(e){return!!e&&jG.test(e)}function $l(e){return!!e&&(VG.test(e)||KG.test(e))}function QG(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||Il(s)?!1:!($l(s)&&n&&!Il(n)&&!$l(n))}function XG(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||Il(n)?!1:!($l(n)&&s&&!Il(s)&&!$l(s))}function JG(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?nM(e,s):t.indexOf("*",s);if(i===-1)break;if(XG(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function eY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||Il(s)?!1:!($l(s)&&n&&!Il(n)&&!$l(n))}function tY(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||Il(n)?!1:!($l(n)&&s&&!Il(s)&&!$l(s))}function nY(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(tY(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function sY(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&&tk.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function oY(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&tk.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function iY(e,t,n){const s=oY(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 rY=/[\p{L}\p{N}]/u,lY=/^[\p{L}\p{N}]+$/u;function dv(e){return e?rY.test(e):!1}function sM(e){return e?lY.test(e):!1}function Ju(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:dv(s)&&dv(o)}}function aY(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=Ju(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(!sM(e.slice(s.end,o.start)))return o.end}return-1}function cY(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function uY(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=Ju(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function dY(e){return e?GG.test(e)||YG.test(e):!1}function fY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Jn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=jd(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(G,ae){const me=e.length===1?t:String(ae.content??""),q=[],ne=aY(G);if(ne!==-1){M(G.slice(0,ne),G.slice(0,ne));const ue=G.slice(ne);return ue&&(N({type:"text",content:ue,raw:ue}),u--),u++,!0}if(WG.test(G)){const ue=G.indexOf("~~");ue!==-1&&q.push({type:"strikethrough",index:ue})}if(zG.test(G)){const ue=G.indexOf("**");ue!==-1&&q.push({type:"strong",index:ue})}if(/[^*]*\*[^*]+/.test(G)){const ue=me?nM(me,0):G.indexOf("*");if(me&&ue===-1)return!1;ue!==-1&&q.push({type:"emphasis",index:ue})}q.sort((ue,ye)=>ue.index!==ye.index?ue.index-ye.index:ue.type===ye.type?0:ue.type==="strong"?-1:ye.type==="strong"?1:0);const ge=q[0];if(!ge)return!1;if(ge.type==="strikethrough"){const ue=ge.index,ye=ue>-1?G.slice(0,ue):"";if(ye&&M(ye,ye),ue===-1)return u++,!0;const j=G.indexOf("~~",ue+2),te=j===-1?G.slice(ue+2):G.slice(ue+2,j),pe=j===-1?"":G.slice(j+2),{node:Se}=Hw([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:te,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),y(Se),pe&&(N({type:"text",content:pe,raw:pe}),u--),u++,!0}if(ge.type==="strong"){const ue=ge.index,ye=ue>-1?G.slice(0,ue):"";if(ye&&M(ye,ye),ue===-1)return u++,!0;if(t&&ue===0){let Fe=!1,he=0;for(;he<G.length&&G[he]==="*";)he++;if(t.startsWith("\\*")&&(Fe=!0),Fe){let Ne=0,Je=0;for(;Je<t.length&&Ne<he;)if(t[Je]==="\\"&&Je+1<t.length&&t[Je+1]==="*")Ne+=1,Je+=2;else{if(t[Je]==="*")break;Je++}if(Ne>=2)return M(G,G),u++,!0}}if(t&&(G.match(/\*/g)||[]).length>ZG(t))return M(G.slice(ye.length),G.slice(ye.length)),u++,!0;const j=Ju(G,ue);if(j.len>=3){const Fe=uY(G,ue+j.len);if(Fe!==-1){const he=G.slice(ue+j.len,Fe);if(cY(he)){const{node:Ne}=Eu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:he,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(Ne);const Je=G.slice(Fe+3);return Je&&(N({type:"text",content:Je,raw:Je}),u--),u++,!0}}}if(!eY(G,ue)){const Fe=G.slice(ue,ue+j.len);M(Fe,Fe);const he=G.slice(ue+j.len);return he&&(N({type:"text",content:he,raw:he}),u--),u++,!0}const te=nY(G,ue+2);let pe="",Se="";if(te.index!==-1){pe=G.slice(ue+2,te.index),Se=G.slice(te.index+2);const Fe=te.index,he=Ju(G,Fe);if(j.intraword&&he.intraword&&!sM(pe)||!pe&&j.len>=4&&j.intraword)return M(G.slice(ye.length),G.slice(ye.length)),u++,!0}else{if(d||te.sawInvalidClose||j.intraword)return M(G.slice(ye.length),G.slice(ye.length)),u++,!0;pe=G.slice(ue+2),Se=""}if(!pe&&/^\*+$/.test(Se))return M(G,G),u++,!0;const{node:Ie}=Eu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return p(),y(Ie),Se&&(N({type:"text",content:Se,raw:Se}),u--),u++,!0}if(ge.type==="emphasis"){let ue=ge.index;ue===-1&&(ue=0);const ye=G.slice(0,ue);if(ye&&M(ye,ye),!QG(G,ue)){M(G[ue],G[ue]);const Fe=G.slice(ue+1);return Fe&&(N({type:"text",content:Fe,raw:Fe}),u--),u++,!0}const j=Ju(G,ue),te=JG(me,G,ue+1),pe=te.index,Se=e[u+1];if(s?.final&&Se?.type==="em_open"&&pe!==-1&&G.slice(ue+1,pe).trim()!==G.slice(ue+1,pe)||pe===-1&&(te.sawInvalidClose||s?.final||j.intraword||!dv(G[ue+1])))return M(G.slice(ue),G.slice(ue)),u++,!0;const{node:Ie}=zf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe>-1?G.slice(ue+1,pe):G.slice(ue+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),y(Ie),pe!==-1&&pe<G.length-1){const Fe=G.slice(pe+1);Fe&&(N({type:"text",content:Fe,raw:Fe}),u--)}return u++,!0}return!1}function x(G,ae){if(!G.includes("`"))return!1;const q=(Se=>{for(let Ie=0;Ie<Se.length;Ie++){if(Se[Ie]!=="`")continue;let Fe=0;for(let he=Ie-1;he>=0&&Se[he]==="\\";he--)Fe++;if(Fe%2===0)return Ie}return-1})(G);if(q===-1)return!1;let ne=1;for(let Se=q+1;Se<G.length&&G[Se]==="`";Se++)ne++;const ge="`".repeat(ne),ue=q+ne,ye=G.indexOf(ge,ue);if(ye===-1){if(ne===1){const Ie=G.slice(0,q),Fe=G.slice(q+1);return Ie&&(m(Ie,ae)?u--:M(Ie,Ie)),g({type:"inline_code",code:Fe,raw:String(Fe)}),u++,!0}let Se=G;for(let Ie=u+1;Ie<e.length;Ie++)Se+=String((e[Ie].content??"")+(e[Ie].markup??""));return u=e.length-1,M(Se,Se),u++,!0}p();const j=G.slice(0,q),te=G.slice(q+ne,ye),pe=G.slice(ye+ne);return j&&(m(j,ae)?u--:M(j,j)),g({type:"inline_code",code:te,raw:String(te??"")}),pe&&(N({type:"text",content:pe,raw:pe}),u--),u++,!0}function k(G){const ae=l?.__markdownIt;if(!ae||e.length<=1||!e.some(ge=>ge?.type==="math_inline")||!UG.test(G))return null;const me=ae.parseInline(G,{__markstreamFinal:!!s?.final});if(!Array.isArray(me)||me.length===0)return null;const q=(me.find(ge=>ge?.type==="inline")?.children??[]).filter(ge=>!(ge?.type==="text"&&String(ge.content??"")===""));if(!q.length||!q.some(ge=>ge?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===G)return null;const ne=Jn(q,G,n,s);return ne.length?ne:null}function g(G){p(),a.push(G)}function v(G){p();const ae=ka(G);a.push(ae)}function y(G){g(G)}function M(G,ae){c?(c.content+=G,c.raw+=ae??G):(c={type:"text",content:String(G??""),raw:String(ae??G??"")},a.push(c))}function L(G,ae){if(!G)return;const me=Jn([{...ae,type:"text",content:G,raw:G}],G,n,s);if(me.length===1&&me[0]?.type==="text"){const q=me[0];M(String(q.content??""),String(q.raw??q.content??""));return}for(const q of me)y(q)}function $(G,ae){return String(G.markup??"").startsWith(ae)}function _(G){return G.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function E(G,ae){let me=G;const q=String(ae.content??"");return me.endsWith("\\")&&!$(ae,"\\\\")&&!q.endsWith("\\\\")&&(me=me.slice(0,-1)),me.endsWith("(")&&!$(ae,"\\(")&&!q.endsWith("\\(")&&(me=me.slice(0,-1)),/\*+$/.test(me)&&!$(ae,"\\*")&&!q.endsWith("\\*")&&(me=me.replace(/\*+$/,"")),me}for(;u<e.length;){const G=e[u];N(G)}function N(G){switch(G.type){case"text":S(G);break;case"softbreak":c?(c.content+=`
202
+ `,c.raw+=`
203
+ `):(c={type:"text",content:`
204
+ `,raw:`
205
+ `},a.push(c)),u++;break;case"code_inline":y(IG(G)),u++;break;case"html_inline":{const[ae,me]=TG(G,e,u,Jn,t,n,s);y(ae),u=me;break}case"link_open":I(G);break;case"image":fe(G)||(p(),y(Dw(G)),u++);break;case"strong_open":{p();const{node:ae,nextIndex:me}=Eu(e,u,G.content,s);y(ae),u=me;break}case"em_open":{p();const{node:ae,nextIndex:me}=zf(e,u,s);y(ae),u=me;break}case"s_open":{p();const{node:ae,nextIndex:me}=Hw(e,u,s);y(ae),u=me;break}case"mark_open":{p();const{node:ae,nextIndex:me}=SG(e,u,s);y(ae),u=me;break}case"ins_open":{p();const{node:ae,nextIndex:me}=$G(e,u,s);y(ae),u=me;break}case"sub_open":{p();const{node:ae,nextIndex:me}=DG(e,u,s);y(ae),u=me;break}case"sup_open":{p();const{node:ae,nextIndex:me}=PG(e,u,s);y(ae),u=me;break}case"sub":p(),y({type:"subscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`~${String(G.content??"")}~`}),u++;break;case"sup":p(),y({type:"superscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`^${String(G.content??"")}^`}),u++;break;case"emoji":{p();const ae=e[u-1];ae?.type==="text"&&/\|:-+/.test(String(ae.content??""))?M("",""):y(yG(G)),u++;break}case"checkbox":p(),y(gG(G)),u++;break;case"checkbox_input":p(),y(vG(G)),u++;break;case"footnote_ref":p(),y(_G(G)),u++;break;case"footnote_anchor":{p();const ae=G.meta??{};g({type:"footnote_anchor",id:String(ae.label??G.content??""),raw:String(G.content??"")}),u++;break}case"hardbreak":p(),y(wG()),u++;break;case"fence":p(),y(ek(e[u])),u++;break;case"math_inline":p(),!G.content&&G.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(Pw({...G,content:e[u+1].content})),u+=2):y(Pw(G)),u++;break;case"reference":B(G);break;case"text_special":M(String(G.content??""),String(G.content??"")),u++;break;default:{const ae=G;if(G.type==="link"&&ae.href!=null&&s?.validateLink&&!s.validateLink(String(ae.href))){p();const me=String(ae.text??"");M(me,me),u++}else oe(G)||z(G)||ee(G)||P(G)||v(G),u++;break}}}function F(G,ae,me,q){const ne=HG({...ae,content:G});if(c){c.content+=E(ne.content,ae),c.raw+=ne.raw;return}const ge=me?.tag==="br"&&e[u-2]?.content==="[";q||(ne.content=E(ne.content,ae)),c=ne,c.center=ge,a.push(c)}function S(G){const ae=String(G.content??""),me=e.length===1&&ae.includes("\\")&&typeof t=="string"?String(t):"";let q=me?sY(me):ae.replace(qG,"$1");if(G.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const ne=q.indexOf("$");ne!==-1&&ne===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let ge=a.length,ue="";for(let pe=a.length-1;pe>=0;pe--){const Se=a[pe];if(Se.type!=="text")break;ge=pe,ue=String(Se.content??"")+ue}ge<a.length&&(q.startsWith(ue)?(c=null,a.length=ge):c=a[a.length-1]);const ye=e[u+1];if((q==="`"||q==="|"||q==="$")&&!$(G,`\\${q}`)||/^\*+$/.test(q)&&!$(G,"\\*")){u++;return}if(!ye&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(ce(q)||Y(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){F(q,G,e[u-1],ye),u++;return}if(de(q))return;const j=e[u-1];if(q==="["&&!ye?.markup?.includes("*")&&!$(G,"\\[")||q==="]"&&!j?.markup?.includes("*")&&!$(G,"\\]")){u++;return}if(x(ae,G)||He(q)||(e[u+1]?.type!=="link_open"||_(q))&&le(q,G))return;const te=k(ae);if(te){p();for(const pe of te)y(pe);u++;return}m(q,G)||(F(q,G,j,ye),u++)}function I(G){if(R(G))return;if(X()){const{node:ye,nextIndex:j}=Uf(e,u,s),te=String(ye.text||ye.href||"");M(te,te),u=j;return}p();const{node:ae,nextIndex:me}=Uf(e,u,s);u=me;const q=ae.text||ae.href||"";if(G.markup==="linkify"&&!R6(q,ae.href,t)&&fp(q,l?.__linkifyDemotionContext)){M(q,q);return}const ne=ae.children.length===1&&ae.children[0]?.type==="text";if(ae.loading&&t&&ae.text===ae.href&&ne){const ye=fY(t,ae.href);ye&&(ae.text=ye,ae.children=[{type:"text",content:ye,raw:ye}],ae.raw=`[${ye}](${ae.href}${ae.title?` "${ae.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(ae.href)){M(ae.text,ae.text);return}const ge=G.attrs?.find(([ye])=>ye==="href")?.[1],ue=String(ge??"");if(t&&ue){const ye=t.indexOf("](");if(ye!==-1){const j=t.indexOf(")",ye+2);j===-1?ae.loading=!0:ae.loading&&t.slice(ye+2,j).includes(ue)&&(ae.loading=!1)}}P(ae)||g(ae)}function R(G){if(G.markup!=="linkify")return!1;const{node:ae,nextIndex:me}=Uf(e,u,s);return W(ae,me)?(u=me,!0):!1}function B(G){p(),y(OG(G)),u++}function P(G){if(G.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const me=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!me)return!1;const q=G,ne=String(q.href??""),ge=String(q.text??""),ue=String(me[2]??""),ye=ne.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ne||!(ge===ne||ge===ye||dY(ge)))return!1;const j=String(me[1]??"");return j?(ae.content=j,ae.raw=j):a.pop(),g({...G,text:ue,children:[{type:"text",content:ue,raw:ue}],raw:`[${ue}](${ne}${q.title?` "${q.title}"`:""})`}),!0}function z(G){if(G.type!=="link")return!1;const ae=G,me=String(ae.href??"");return me?W({href:me,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},u+1):!1}function W(G,ae){const me=a[a.length-1];if(me?.type!=="image"||me.src||!me.loading||!String(me.raw??"").endsWith("]("))return!1;const q=e[ae],ne=String(q?.content??"");if(q?.type!=="text"||!ne.startsWith(")"))return!1;a.pop(),c=null;const ge=String(me.alt??"");g({type:"image",src:G.href,alt:ge,title:G.title,raw:`![${ge}](${G.href}${G.title?` "${G.title}"`:""})`,loading:!!G.loading});const ue=ne.slice(1),ye=ka(q);return ye.content=ue,ye.raw=ue,h()[ae]=ye,!0}function ee(G){if(G.type!=="link")return!1;const ae=a[a.length-1],me=e[u-1];if(!ae||ae.type!=="text"||me?.type!=="text")return!1;const q=String(ae.content??""),ne=String(me.content??"");if(!q.endsWith("!")||!ne.endsWith("!")||$(me,"\\!"))return!1;const ge=q.slice(0,-1);ge?(ae.content=ge,ae.raw=ge,c=ae):(a.pop(),c=null);const ue=G,ye=String(ue.text??ue.children?.map(pe=>String(pe?.content??pe?.raw??"")).join("")??""),j=String(ue.href??""),te=ue.title==null||ue.title===""?null:String(ue.title);return g({type:"image",src:j,alt:ye,title:te,raw:`![${ye}](${j}${te?` "${te}"`:""})`,loading:!!ue.loading}),!0}function U(G,ae="",me=null){const q=String(G.alt??G.raw??"");return{type:"link",href:ae,title:me,text:q,children:[G],raw:`[${q}](${ae}${me?` "${me}"`:""})`,loading:!0}}function Z(G){const ae=G.startsWith("![")?G:`![${G}`,me=ae.slice(2),q=me.indexOf("](");return{type:"image",src:"",alt:q===-1?me.replace(/\]$/,""):me.slice(0,q),title:null,raw:ae,loading:!0}}function ce(G){const ae=G.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&iY(t,ae,"["))return!1;const me=G.slice(0,ae);return me&&M(me,me),g(U(Z(G.slice(ae+1)))),u++,!0}function fe(G){if(s?.final)return!1;const ae=e[u-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||$(ae,"\\["))return!1;const me=a[a.length-1];if(me?.type==="text"&&me.content.endsWith("[")){const q=me.content.slice(0,-1);q?(me.content=q,me.raw=q,c=me):(a.pop(),c=null)}return g(U(Dw(G))),u++,!0}function oe(G){if(G.type!=="link")return!1;const ae=G,me=String(ae.raw??""),q=String(ae.text??"");if(!me.startsWith("[![")&&!q.startsWith("!["))return!1;const ne=ae.title==null||ae.title===""?null:String(ae.title);return g(U({type:"image",src:String(ae.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:ne,raw:me.startsWith("[![")?me.slice(1):me,loading:!0})),!0}function Y(G){if(!G.startsWith("]("))return!1;const ae=e[u-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&$(ae,"\\["))return!1;const me=a[a.length-1];if(me?.type!=="image"&&me?.type!=="link")return!1;const q=me,ne=me?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,ge=ne?ne.children[0]:a.pop();if(!ge||ge.type!=="image")return!1;const ue=e[u+1];let ye=String(ne?.href??""),j=ne?.title==null?null:String(ne.title),te=!0;if(ue?.type==="link_open"){const{node:Se,nextIndex:Ie}=Uf(e,u+1,s);ye=Se.href,j=Se.title,te=!0,u=Ie}else{if(ye=G.slice(2),ye.includes('"')){const Se=ye.split('"');ye=String(Se[0]??"").trim(),j=Se[1]==null?null:String(Se[1]).trim()}u++}const pe=U(ge,ye,j);return pe.loading=te,g(pe),!0}function X(){const G=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&G?.type==="text"&&String(G.content??"").endsWith("[")&&$(G,"\\[")}function le(G,ae){const me=G.indexOf("[");if(me===-1)return!1;let q=G.slice(0,me);const ne=G.indexOf("](",me);if(ne!==-1){const ge=e[u+2];let ue=G.slice(me+1,ne);if(ue.includes("[")){const Fe=ue.indexOf("[");q+=G.slice(0,me+Fe+1);const he=me+Fe+1;ue=G.slice(he+1,ne)}const ye=e[u+1];if(G.endsWith("](")&&ye?.type==="link_open"&&ge){const Fe=e[u+4];let he=4,Ne=!0;if(Fe?.type==="text"){const it=String(Fe.content??"");if(it.startsWith(")")){Ne=!1;const At=it.slice(1);if(At){const xt=ka(Fe);xt.content=At,xt.raw=At,h()[u+4]=xt}else he++}else it==="."&&he++}L(q,ae);const Je=String(ge.content??"");return s?.validateLink&&!s.validateLink(Je)?M(ue,ue):g({type:"link",href:Je,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:Ne}),u+=he,!0}const j=G.indexOf(")",ne),te=j!==-1?G.slice(ne+2,j):"",pe=j===-1;let Se=q.match(/\*+$/);if(Se&&(q=q.replace(/\*+$/,"")),L(q,ae),Se||(Se=ue.match(/^\*+/)),!d&&Se){const Fe=Se[0].length;ue=ue.replace(/^\*+/,"").replace(/\*+$/,"");const he=[];if(Fe===1?he.push({type:"em_open",tag:"em",nesting:1}):Fe===2?he.push({type:"strong_open",tag:"strong",nesting:1}):Fe===3&&(he.push({type:"strong_open",tag:"strong",nesting:1}),he.push({type:"em_open",tag:"em",nesting:1})),he.push({type:"link",href:te,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:pe}),Fe===1){he.push({type:"em_close",tag:"em",nesting:-1});const{node:Ne}=zf(he,0,s);y(Ne)}else if(Fe===2){he.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Eu(he,0,void 0,s);y(Ne)}else if(Fe===3){he.push({type:"em_close",tag:"em",nesting:-1}),he.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Eu(he,0,void 0,s);y(Ne)}else{const{node:Ne}=zf(he,0,s);y(Ne)}}else s?.validateLink&&!s.validateLink(te)?M(ue,ue):g({type:"link",href:te,title:null,text:ue,children:[{type:"text",content:ue,raw:ue}],loading:pe});const Ie=j!==-1?G.slice(j+1):"";return Ie&&(N({type:"text",content:Ie,raw:Ie}),u--),u++,!0}return!1}function He(G){const ae=G.indexOf("![");if(ae===-1)return!1;const me=G.slice(0,ae);return me&&!c?c={type:"text",content:me,raw:me}:me&&c&&(c.content+=me),c&&(a.push(c),c=null),g(Z(G.slice(ae))),u++,!0}function de(G){if(!(G?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=G.slice(1).match(/[^\s\]]/);if(ae===null)return u++,!0;if(ae&&/x/i.test(ae[0])){const me=ae[0]==="x"||ae[0]==="X";return g({type:"checkbox_input",checked:me,raw:me?"[x]":"[ ]"}),u++,!0}return!1}return a}function hY(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 pY(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 mY(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function tu(e,t,n){const s=e[t],o=[],i=Bl(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=mY(c)?ka(c):c,d=e[a-1];u!==c&&(pY(u),hY(u));const f=String(u.content??"");l.push({type:"paragraph",children:Jn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=nu(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]=tu(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=sk(e,a,i.options(),nk);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(`
206
+ `)},r+1]}function gY(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Bl(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:Jn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=tu(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=nu(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=wm(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}
207
+ ${r.map(c=>c.raw).join(`
208
+ `)}
209
+ :::`},a+1]}const vY=new Set(["warning","info","note","tip","danger","caution"]);function yY(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 vY.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function kY(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=yY(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=Bl(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 x=f[m];if(x.type==="text"&&/:+/.test(x.content)){h=m;break}}const p={type:"paragraph",children:Jn((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]=tu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=nu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=wm(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}
210
+ ${l.map(d=>d.raw).join(`
211
+ `)}
212
+ :::`},c+1]}const bY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function xY(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=bY.exec(String(s.info??""));return o?gY(e,t,o,n):null}const nk={parseContainer:(e,t,n)=>kY(e,t,n),matchAdmonition:xY};function nu(e,t,n){const s=[],o=Bl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:Jn(r.children||[],String(r.content??""),void 0,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]=tu(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=nu(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=sk(e,i,o.options(),nk);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(`
213
+ `)},i+1]}function _Y(e){if(e.info?.startsWith("diff"))return ek(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 wY(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=Bl(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=Jn(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:Jn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
214
+ `)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
215
+ `)},o+1]}function SY(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=Bl(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:Jn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
216
+ `)}`},l+1]}function CY(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:Jn(a.children||[],c,void 0,n),raw:c}}function AY(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=Xn(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=Xn(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 oM(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=Xn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=$a.has(n),l=_m(o),a=(s===-1?-1:AY(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
217
+ </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function MY(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 EY(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 iM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function rM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return iM(n)?n:void 0}function TY(e,t,n){const s=rM(jd(t),n);if(!iM(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 NY(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=EY(e[c].attrs),x=a.length,k=!f&&!r,g=k?o?.cells[x]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Jn(h.children||[],p,void 0,TY(n,g,k?u:void 0)),raw:p,align:m}),k&&(u=rM(u,jd(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(`
218
+ `)},s+1]}function IY(){return{type:"thematic_break",raw:"---"}}let M0=null;const E0=new WeakMap;function Ww(){return M0||(M0={allowedTagSet:Cm(),customTagSet:null}),M0}function $Y(e){if(!e||e.length===0)return Ww();const t=E0.get(e);if(t)return t;const n=e.map(xi).filter(Boolean);if(!n.length){const o=Ww();return E0.set(e,o),o}const s={allowedTagSet:Cm({customHtmlTags:e}),customTagSet:new Set(n)};return E0.set(e,s),s}function LY(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=Bl(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:Jn(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]=tu(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=nu(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=wm(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+=`
219
+ `,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
220
+ `),f+=`
221
+ `),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 FY(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function OY(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function RY(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Yo(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Yo(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=Xn(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=Xn(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 BY(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=Xn(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 x=m+1;return{raw:e.slice(r,x),end:x}}d=m+1;continue}if(f(p)){const m=Xn(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 fv(e){return Number.isFinite(e)&&e>0?e:0}function DY(e,t){const n=fv(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
222
+ `&&(s++,s===n))return o+1;return e.length}function wm(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[CY(e,t,n),t+3];case"code_block":return[_Y(s),t+1];case"fence":return[ek(s),t+1];case"math_block":return[MY(s),t+1];case"html_block":{const o=oM(s),i=o.tag?$Y(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)?DY(l,Number(s.map?.[0]??0)):0,u=BY(l,r,Math.max(fv(a),fv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=Xn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),m=f===-1?null:RY(d,r,f+1),x=m?.start??-1;let k="";f!==-1&&(x!==-1&&f<x?k=d.slice(f+1,x):k=d.slice(f+1)),x===-1&&(k=OY(k,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 $=y[2]||y[3]||y[4]||"";g.push([L,$])}const M=!n?.final&&!p&&m==null;return[{type:r,tag:r,content:FY(k),raw:String(u?.raw??o.raw??d),loading:M,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=NY(e,t,n);return[o,i]}case"dl_open":{const[o,i]=wY(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=SY(e,t,n);return[o,i]}case"hr":return[IY(),t+1]}return null}function sk(e,t,n,s){const o=wm(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 LY(e,t,n)}return null}function PY(){return{type:"hardbreak",raw:`\\
223
+ `}}function HY(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:Jn(s.children||[],o,void 0,n),raw:o}}const zw=new WeakMap,Sm=new WeakMap,WY=["$$","\\["];function Kc(){return typeof performance<"u"?performance.now():Date.now()}function ok(e,t,n){e&&(e[t]=(e[t]??0)+n)}function lM(e){return e.__timing}function T0(e,t,n){return t&&ok(t,"parseMarkdownToStructureTotalMs",Kc()-n),e}function Uw(e,t,n){if(!n)return Qw(e,t);const s=Kc(),o=Qw(e,t);return ok(n,"processTokensMs",Kc()-s),o}function zY(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=eu(t);return n.length?new Set(n):null}function UY(e,t){const n=e;let s=zw.get(n);s||(s=new Map,zw.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 qY(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qf(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]=la(o.value,n))}}function la(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(la(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(la(l,t),la(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(la(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),qf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),qf(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),qf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!qY(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),qf(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=la(i[r],t);return o}function aM(e,t=!0){if(!t)return ka(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=>aM(a,t)):t&&r&&typeof r=="object"&&(l=la(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function qw(e,t=!0){return e.map(n=>aM(n,t))}function cM(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 jY(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 VY(e){Sm.delete(e)}function KY(e,t,n){Sm.set(e,{source:t,key:n,pendingCandidate:n===null&&Y6(t)})}function GY(e){return e.endsWith("$")||e.endsWith("\\")}function YY(e){const t=Math.max(e.lastIndexOf(`
224
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return WY.some(s=>n.endsWith(s))}function ZY(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||YY(e)&&/[\r\n]/.test(t)):!1}function QY(e,t){if(!z6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=Sm.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&&!ZY(o.source,l)&&!GY(t)){o.source=t;return}}const i=dG(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),KY(e,t,i)}function XY(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function JY(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 N0(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&&JY(e,t)}function jw(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function eZ(e){for(let t=0;t+5<e.length;t++)if(jw(e,t)&&jw(e,t+3)&&N0(e[t],e[t+3])&&N0(e[t+1],e[t+4])&&N0(e[t+2],e[t+5]))return!0;return!1}function tZ(e,t,n){return z6(e)&&Y6(t)&&eZ(n)}function nZ(e){const t=Sm.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function Vw(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!cM(e,s)||(QY(e,t),nZ(e)))return e.parse(t,n);const o=e.stream.parse(t,UY(e,n));if(tZ(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!XY(s))return o;const i=lM(s);if(!i)return qw(o,!0);const r=Kc(),l=qw(o,!0);return ok(i,"tokenCloneMs",Kc()-r),l}function Cm(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Md;const n=new Set(Md);for(const s of eu(t))s&&n.add(s);return n}function sZ(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 Kw(e){return{type:"paragraph",children:e,raw:e.map(sZ).join("")}}function Gw(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=zY(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(Kw(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(Kw(c)),a}function oZ(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 ed(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function iZ(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*${Yo(t)}\s*>\s*$`,"i").test(n)}function ik(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Yo(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=Xn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if($a.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*${Yo(s)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Yo(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=Xn(e.slice(p));if(m===-1)return null;u--;const x=p+m+1;if(u===0)return{raw:e.slice(r,x),start:r,end:x,closed:!0};d=x;continue}if(f(p)){const m=Xn(e.slice(p));if(m===-1)return null;const x=e.slice(p,p+m+1);/\/\s*>$/.test(x)||u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function rZ(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]===`
225
+ `){n++;continue}return-1}return s===t.length?n:-1}function lZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
226
+ </${t}>`}function Yw(e){return e.replace(/\r\n/g,`
227
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function aZ(e,t,n){return n?e.includes(n,t)?!0:Yw(e.slice(Math.max(0,t))).includes(Yw(n)):!1}function cZ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
228
+ `&&n++,n):e[n]===`
229
+ `?n+1:t}function Zw(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 uZ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function rk(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Yo(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function uM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const dZ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),fZ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function hZ(e){return/\n\s*\n/.test(e)||fZ.test(e)}function pZ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>dZ.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 mZ(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"||C6.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=Xn(l);if(a===-1)return o;const c=rk(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=td(u,t,uM(n,s));return pZ(u,d)?{...o,children:d}:o})}function td(e,t,n){return e.trim()?fM(e,t,{...n,__disableStreamParse:!0}):[]}function gZ(e,t,n){const s=td(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function vZ(e,t,n){const s=oM({content:e}),o=Xn(e),i=rk(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=gZ(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function yZ(e,t,n){const s=Xn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=ik(o,"summary",0);if(!i)return td(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...td(r,t,n),vZ(i.raw,t,n),...td(l,t,n)]}function dM(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=ed(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!Zw(c)){r.push(c);continue}const f=String(c.raw??ed(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 ee=a+1;ee<e.length;ee++){const U=e[ee];if(Zw(U)){p++;continue}if(uZ(U)&&(p--,p===0)){m=ee;break}}const x=ik(t,"details",h),k=m===-1&&x?.closed===!0,g=k?(()=>{const ee=rk(f,"details");return ee!==-1?f.slice(0,ee):f})():f,[v]=dM(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,h+f.length),y=yZ(g,n,uM(s,o)),M=m===-1?"</details>":String(e[m].raw??ed(e[m])??"</details>"),L=k||m!==-1&&x?.closed===!0,$=M.replace(/[\t\r\n ]+$/,""),_=L?(()=>{const ee=(x?.raw??"").lastIndexOf($);return ee===-1?t.length:h+ee})():t.length,E=Xn(f),N=k&&E!==-1?h+E+1:h+f.length,F=t.slice(N,_===-1?t.length:_),S=n.parse(F,{__markstreamFinal:o}),I=n.renderer.render(S,n.options,{__markstreamFinal:o}),R=_+$.length,B=L?Math.max(_+M.length,cZ(t,R)):t.length,P=L?t.slice(_,B):M,z=L?t.slice(h,B):t.slice(h),W=k&&E!==-1?f.slice(0,E+1):f;if(r.push({...c,tag:"details",attrs:_m(f.slice(0,E+1)),raw:z,content:`${W}${I}${P}`,children:[...y,...v],loading:!o&&!L}),l=L?B:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function kZ(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=ed(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=ik(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),h=lZ(u.raw,c,u.closed),p=!t&&!u.closed,m=d!==h||f!==u.raw||!!r.loading!==p,x=Xn(u.raw),k=x===-1?"":u.raw.slice(0,x+1),g=k?_m(k):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=g.length?g:void 0,!m)continue;let v=rZ(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&iZ(s[y],c)){s.splice(y,1);continue}const M=ed(s[y]);if(!M)break;const L=u.raw.indexOf(M,v);if(L===-1){if(aZ(n,u.end,M))break;s.splice(y,1);continue}v=L+M.length,s.splice(y,1)}}return s}function bZ(e){const t=l=>l===" "||l===" "||l===`
230
+ `||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 x=m.charCodeAt(0);return x>=65&&x<=90||x>=97&&x<=122},u=m=>{const x=m.charCodeAt(0);return x>=48&&x<=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 x=l[a];if(t(x)||x==="<"||x===">"||x==='"'||x==="'"||x==="`")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 M=v;for(;M<g.length&&g[M]===y;)M++;const L=M-v;return L<3?null:{markerChar:y,markerLen:L,rest:g.slice(M)}},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 x=0;const k=l.split(/\r?\n/);for(const g of k){const v=x,y=x+g.length;if(a<v)break;const M=m(g);if(M){const L=M.markerChar,$=M.markerLen;c?L===u&&$>=d&&/^\s*$/.test(M.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=$)}if(a<=y)break;x=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===`
231
+ `||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]===`
232
+ `||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function xZ(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 x=0;x<p.length;x++){const k=p[x];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=p=>{let m=!1,x=!1;for(let k=0;k<p.length;k++){const g=p[k];if(g==="\\"){k++;continue}if(!x&&g==="'"){m=!m;continue}if(!m&&g==='"'){x=!x;continue}if(!m&&!x&&g===">")return k}return-1},l=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const x=p[m];if(x!=="`"&&x!=="~")return null;let k=m;for(;k<p.length&&p[k]===x;)k++;const g=k-m;return g<3?null:{markerChar:x,markerLen:g,rest:p.slice(k)}},a=(p,m)=>{if(i(p))return-1;const x=p.replace(/^[ \t]+/,"");if(!x||x.startsWith(">")||x.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(x))return-1;let k=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){s(v)||(k=!0),g++;continue}const y=r(p.slice(g));if(y===-1){k=!0,g++;continue}const M=p.slice(g,g+y+1);let L=1;for(;L<M.length&&s(M[L]);)L++;if(L>=M.length){k=!0,g++;continue}const $=M[L];if($==="!"||$==="?"){k=!0,g+=y+1;continue}if($==="/"){k=!0,g+=y+1;continue}const _=L;for(;L<M.length&&o(M[L]);)L++;if(L===_){k=!0,g++;continue}const E=M.slice(_,L).toLowerCase(),N=M[L];if(N&&N!==" "&&N!==" "&&N!==">"&&N!=="/"){k=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),S=/\/\s*>$/.test(M),I=F.test(p.slice(g+y+1)),R=F.test(e.slice(m+g+y+1)),B=/[\r\n]/.test(e.slice(m+g+y+1));if(k&&n.has(E)&&!S&&!I&&(R||B))return g;k=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
233
+ `,h),m=p!==-1,x=m&&p>h&&e[p-1]==="\r",k=m?x?p-1:p:e.length,g=e.slice(h,k),v=m?x?`\r
234
+ `:`
235
+ `:"",y=l(g);let M=g;if(!c&&!y){const L=a(g,h);if(L!==-1){const $=v||`
236
+ `;M=`${g.slice(0,L).replace(/[ \t]+$/,"")}${$}${$}${g.slice(L).replace(/^[ \t]+/,"")}`}}f+=M,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 _Z(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 x=m+1;for(;x<d.length&&s(d[x]);)x++;if(x>=d.length||d[x]!=="/"){m=d.indexOf("<",m+1);continue}for(x++;x<d.length&&s(d[x]);)x++;if(x+p.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<p.length;v++){const y=d[x+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==p[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=x+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 x=f+m;if(l(d,x+1,p))return d;const k=i(d.slice(x+1));return k?`${d.slice(0,x+1)}
237
+ ${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
238
+ `,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
239
+ `:`
240
+ `,u=d+1}return c}function wZ(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 x=m-h;return x<3?null:{markerChar:p,markerLen:x,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(`
241
+ `,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,x=e.slice(d,m),k=h?p?`\r
242
+ `:`
243
+ `:"",g=o(x),v=g?.prefix??"",y=g?.content??x,M=i(y);M&&(l?M.markerChar===a&&M.markerLen>=c&&/^\s*$/.test(M.rest)&&(l=!1,a="",c=0):(l=!0,a=M.markerChar,c=M.markerLen));let L=y;if(!l&&L.includes("</"))for(const $ of r)L=L.replace($,(_,E,N,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return _;const S=F.slice(0,N).replace(/^[\t ]+/,"");if(S.length>0){const I=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!R||I!==R)return _}return`${E}
244
+
245
+ `});if(v){const $=v+L.split(`
246
+ `).join(`
247
+ ${v}`);u+=$}else u+=L;u+=k,d=h?f+1:e.length}return u}function SZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const s=S=>S===" "||S===" ",o=S=>{if(!S)return!1;if(S[0]===" ")return!0;let I=0;for(let R=0;R<S.length;R++){const B=S[R];if(B===" "){if(I++,I>=4)return!0;continue}if(B===" ")return!0;break}return!1},i=S=>{const I=S.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||S==="_"||S==="-"||S===":"},r=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;return S.slice(I)},l=S=>{let I=0,R=!1,B=0;for(;I<S.length;){for(;I<S.length&&s(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(R=!0,I++;I<S.length&&s(S[I]);)I++;B=I}if(!R)return null;const P=S.slice(0,B);return{prefix:P,key:P.replace(/[ \t]+$/,""),content:S.slice(B)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const R=S[I];if(R!==" "&&R!==" ")return!1}return!0},u=S=>{if(o(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let R=1;for(;R<I.length&&s(I[R]);)R++;if(R>=I.length||I[R]==="/"||I[R]==="!"||I[R]==="?")return"";const B=R;for(;R<I.length&&i(I[R]);)R++;if(R===B)return"";const P=I.slice(B,R).toLowerCase();if(!n.has(P))return"";const z=I[R];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":P},d=S=>{if(o(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let R=1;for(;R<I.length&&s(I[R]);)R++;if(R>=I.length)return null;const B=I[R]==="/";if(B)for(R++;R<I.length&&s(I[R]);)R++;const P=I[R];if(!P||P==="!"||P==="?")return null;const z=R;for(;R<I.length&&i(I[R]);)R++;if(R===z)return null;const W=I.slice(z,R).toLowerCase();if(!n.has(W))return null;const ee=I[R];if(ee&&ee!==" "&&ee!==" "&&ee!==">"&&ee!=="/")return null;if(B)return{type:"close",name:W};if(/\/\s*>\s*$/.test(I))return{type:"open",name:W,complete:!0};const U=I.indexOf(">",R);if(U!==-1){const Z=I.slice(U+1);if(new RegExp(`<\\s*\\/\\s*${W}\\s*>`,"i").test(Z))return{type:"open",name:W,complete:!0}}return{type:"open",name:W,complete:!1}},f=S=>{if(o(S))return null;const I=r(S).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const R=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const B=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!B?.[1]||!B[2])return null;const P=B[1].toLowerCase();return P===B[2].toLowerCase()?P:null};let h=!1,p="",m=0;const x=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;const R=S[I];if(R!=="`"&&R!=="~")return null;let B=I;for(;B<S.length&&S[B]===R;)B++;const P=B-I;return P<3?null:{markerChar:R,markerLen:P,rest:S.slice(B)}},k=S=>x(S),g=S=>{const I=r(S);return I?o(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},v=(S,I,R)=>{let B=S,P=0;for(;B<e.length;){const z=e.indexOf(`
248
+ `,B),W=z!==-1,ee=W&&z>B&&e[z-1]==="\r",U=W?ee?z-1:z:e.length,Z=e.slice(B,U),ce=l(Z),fe=ce?.key??"";if(P>0&&I&&fe!==I)break;const oe=ce?.content??Z,Y=d(oe);if(Y?.name===R){if(Y.type==="open")Y.complete||P++;else if(P>0&&(P--,P===0))return!1}else if(P>0&&(c(oe)||g(oe)))return!0;if(W)B=z+1;else break}return!1};let y="",M=0,L=!0,$=!1,_=!1,E=`
249
+ `;const N=[];let F="";for(;M<e.length;){const S=e.indexOf(`
250
+ `,M),I=S!==-1,R=I&&S>M&&e[S-1]==="\r",B=I?R?S-1:S:e.length,P=e.slice(M,B),z=I?R?`\r
251
+ `:`
252
+ `:"",W=l(P),ee=W?.key??"",U=W?.content??P,Z=k(U);Z&&(h?Z.markerChar===p&&Z.markerLen>=m&&/^\s*$/.test(Z.rest)&&(h=!1,p="",m=0):(h=!0,p=Z.markerChar,m=Z.markerLen));const ce=N.length>0;if(!h&&!ce){const oe=u(U),Y=!!oe&&!L&&$&&_&&v(M,ee,oe);oe&&!L&&(!$||Y)&&(ee&&F&&ee===F?y+=`${ee}${E}`:ee||(y+=E))}if(y+=P,y+=z,z&&(E=z),!h){const oe=d(U);if(oe){if(oe.type==="open")oe.complete||N.push(oe.name);else for(let Y=N.length-1;Y>=0;Y--)if(N[Y]===oe.name){N.length=Y;break}}}const fe=c(U);L=fe,$=!fe&&a(U),_=!fe&&!!f(U),F=ee,M=I?S+1:e.length}return y}function fM(e,t,n={}){const s=lM(n),o=s?Kc():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(jY(t,n)&&(t.stream.reset(),VY(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,x=>x.startsWith(`
253
+ `)?`
254
+ `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,x=>x.startsWith(`
255
+ `)?`
256
+ `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,x=>x.startsWith(`
257
+ `)?`
258
+ `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
259
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,x=>x.startsWith(`
260
+ `)?`
261
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(x,k,g)=>`${k}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,x=>x.startsWith(`
262
+ `)?`
263
+ `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
264
+ `))),n.customHtmlTags?.length&&r.includes("<")){const x=eu(n.customHtmlTags);if(x.length&&(r=xZ(r,x),r=_Z(r,x),r=SZ(r,x),r=wZ(r,x),r.includes("</")))for(const k of x){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${k}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=bZ(r));const l=oZ(r);if(l){const x=n.preTransformTokens,k=n.postTransformTokens;if(cM(t,n)||typeof x=="function"||typeof k=="function"){const g=Vw(t,r,{__markstreamFinal:i},n),v=typeof x=="function"&&x(g)||g;typeof k=="function"&&k(v)}return T0(l,s,o)}const a=Vw(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return T0([],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=Uw(d,p,s);if(u&&typeof u=="function"){const x=u(d);if(Array.isArray(x)){const k=x[0],g=k?.type;k&&typeof g=="string"?m=Uw(x,void 0,s):m=x}}if(m=kZ(m,i,r),m=dM(m,r,t,n,i)[0],m=mZ(m,t,n,i),i){const x=new WeakSet,k=g=>{if(!g||typeof g!="object"||x.has(g))return;if(x.add(g),Array.isArray(g)){for(const y of g)k(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))k(y)};k(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),T0(m,s,o)}function Qw(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=Bl(t);let o=0;for(;o<e.length;){const i=sk(e,o,s.options(),nk);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=HY(e,o,s.options(l)),c=Gw(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]=tu(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=nu(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(PY()),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=Jn(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=Gw(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const CZ=new Set([...qd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),AZ=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"]),Xw=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function Jw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function MZ(e){return typeof e=="string"?e:e==null?"":String(e)}function hM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function ml(e){return MZ(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function pM(e){return ml(e).replace(/`/g,"&#96;")}function Am(e){return String(e??"").trim().toLowerCase()}function lk(e,t="safe"){const n=Am(e);return n?t==="escape"?!0:t==="trusted"?qd.has(n):!AZ.has(n):!1}function mM(e,t="safe"){const n=Am(e);return n?t==="escape"?!0:t==="trusted"?qd.has(n):CZ.has(n):!1}function eS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${pM(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||ya(o,{tagName:t,attrName:"srcset"})})}function gM(e,t,n,s){return dV.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?EZ(t,s):!!(fV.has(e)&&t&&ya(t,{tagName:s,attrName:e}))}function aa(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function vM(e,t,n,s=!1){if(t!=="safe"||Am(n)!=="a")return e;const o=aa(e,"href");if(s&&(!o||!e[o])){const a=aa(e,"target"),c=aa(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=aa(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=aa(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 tS(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!hM(r)||gM(l,i,t,n)||(s[r]=i)}return vM(s,t,n,!!aa(e,"href"))}function yM(e,t){const n=e.toLowerCase();return S6.has(n)?!1:Jw(t,n)||Jw(t,e)}function ak(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!hM(r)||gM(l,i,t,n)||(s[r]=i)}return vM(s,t,n,!!aa(e,"href"))}function vp(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 hv(e,t="safe",n){const s=ak(vp(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function TZ(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 NZ(e){const t={};for(const[n,s]of Object.entries(e))t[n]=TZ(s,n);return t}function nS(e){return e.trim().length>0}function IZ(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);nS(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);nS(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||$a.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function $Z(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||$a.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function LZ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${ml(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${ml(s)}`:` ${ml(s)}="${pM(o)}"`).join("");return e.type==="self_closing"?`&lt;${ml(t)}${n} /&gt;`:`&lt;${ml(t)}${n}&gt;`}function FZ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;Xw.lastIndex=0;let n;for(;(n=Xw.exec(e))!==null;)if(yM(n[1],t))return!0;return!1}function Rc(e,t="safe"){if(!e)return"";if(t==="escape")return ml(e);const n=$Z(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(ml(r.content??""));continue}const l=Am(r.tagName);if(!l)continue;if(mM(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"&&lk(l,t)){o.push(LZ(r));continue}if(r.type==="self_closing"){o.push(`<${l}${eS(tS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${eS(tS(r.attrs??{},t,l))}>`),$a.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 OZ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],sS="http://www.w3.org/2000/svg",RZ=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"]),DZ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),PZ=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 WZ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function zZ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function UZ(e){const t=e.nodeName.toLowerCase();return t==="use"?WZ(e):t==="image"?zZ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():HZ.has(t)}function qZ(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 jZ(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")?ya(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ya(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":ya(i,{tagName:s,attrName:o})?"":i:""}function VZ(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 kM(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 bM(e){const t=kM(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=VZ(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function oS(e){const t=kM(e);return OZ.some(n=>n.test(t))||bM(t)}function KZ(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 jf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function xM(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(!RZ.has(s)){if(s==="br"){t.push(`
265
+ `);return}for(const o of Array.from(n.childNodes))xM(o,t)}}function GZ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];xM(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=jf(t.getAttribute("width")),i=jf(t.getAttribute("height")),r=jf(t.getAttribute("x")),l=jf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(sS,"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(sS,"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 YZ(e){GZ(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"&&oS(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&&oS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(DZ.has(r)&&i.value){const l=jZ(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(PZ.has(r)&&i.value&&bM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=qZ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}KZ(n)}}function v_e(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 YZ(n),ZZ(n)?null:n}catch{return null}}function ZZ(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){UZ(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 iS=[];function I0(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function QZ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function XZ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function rS(e=`editor-${Date.now()}`,t={}){const n=mG(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(iS.length)for(const f of iS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(LW),n.use(RW),n.use(NW);const i=ZW,r=i.default??i;n.use(r),n.use(TW),n.use(EW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,m=!!h.env?.__markstreamFinal,x=p.split(/\r?\n/);for(const k of h.tokens){if(k.type!=="fence"||!k.map||!k.markup)continue;const g=k.map[0],v=k.map[1],y=k.markup,M=y[0],L=y.length,$=x[Math.max(0,v-1)]??"";let _=0;for(;_<$.length&&($[_]===" "||$[_]===" ");)_++;let E=0;for(;_+E<$.length&&$[_+E]===M;)E++;let N=_+E;for(;N<$.length&&($[N]===" "||$[N]===" ");)N++;const F=m?!0:v>g+1&&E>=L&&N===$.length,S=k;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,m=p.pos;if(p.src[m]!=="~")return!1;const x=p.src[m-1],k=p.src[m+1];if(/\d/.test(x)&&/\d/.test(k)){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(),x=String(p.content??""),k=btoa(unescape(encodeURIComponent(x))),g=QZ(m),v=I0(g),y=XZ(`editor-${e}-${h}-${g}`),M=I0(o("common.copy"));return`<div class="code-block" data-code="${k}" data-lang="${v}" id="${y}">
266
+ <div class="code-header">
267
+ <span class="code-lang">${I0(g.toUpperCase())}</span>
268
+ <button class="copy-button" data-code="${k}">${M}</button>
269
+ </div>
270
+ <div class="code-editor"></div>
271
+ </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 x=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(x))return!1;const k=p.src.slice(p.pos+m[0].length);if(k.startsWith("](")||k.startsWith("(")||u(k))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}function JZ({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 _M({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}:JZ({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const lS=new WeakMap;function eQ(e){let t=lS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},lS.set(e,t)),t}function aS(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 ck(e){return!!(e.themes?.length||e.langs?.length)}function wM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function tQ(e,t){return!t?.length||e.registeredAllLangs?!0:wM(e.registeredLangs,t)}function $0(e,t){return ck(t)&&wM(e.registeredThemes,t.themes)&&tQ(e,t.langs)}function nQ(e,t){if(!ck(t))return t;const n=aS(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:aS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const sQ={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 oQ(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function SM(e){const t=oQ(e);return sQ[t]??t}function CM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>SM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function AM(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 iQ(e){return AM(e)?.join("\0")??""}function MM(e,t){const n=AM(e),s=CM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function yp(e,t){return`${iQ(e)}\0\0${CM(t)?.join("\0")??""}`}function y_e(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=MM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:yp(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function k_e(e,t={},n){if(!e)return"ready";const s=MM(t.themes,t.langs),o=yp(s.themes,s.langs),i=n&&n===o?n:o,r=eQ(e);if(r.completed.has(i))return"ready";if($0(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)||$0(r,s))return r.completed.add(i),"ready";const c=nQ(r,s),u=yp(c.themes,c.langs);return r.completed.has(u)||$0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(ck(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 Xa(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function cS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var rQ=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=uS();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=uS();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,x=uQ(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(x-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=cQ(this.source.slice(this.visible.length),k,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond: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=Xa(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Xa(s,1e3,1)),this.normalizedTargetLatencyMs=Xa(o,900,1),this.normalizedCatchUpLatencyMs=Xa(i,350,1),this.normalizedCatchUpThreshold=cS(r,600),this.normalizedStartDelayMs=cS(a,80),this.maxCommitFps=Math.trunc(Xa(l,30,1)),this.maxCharsPerCommit=Math.trunc(Xa(c,80,1)),this.flushOnFinish=u,this.segmenter=aQ(),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 lQ(e={},t){const n=new rQ(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 aQ(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function cQ(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 uS(){return typeof performance<"u"?performance.now():Date.now()}function uQ(e,t,n){return Math.min(n,Math.max(t,e))}var dQ=(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 pv=Symbol.for("markstream-vue:node-lifecycle"),dS='<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>',fS='<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>',fQ={id:"material",core:{"":fS,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:fS,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:dS,csharp:dS,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:()=>mo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},mv=new Map;let hS="material";const bc=new Map,pS=new Map;let gv=null;function hQ(e){mv.set(e.id,e)}function pQ(e){return dQ(this,null,function*(){var t,n,s;if(bc.has(e.id))return(t=bc.get(e.id))!=null?t:null;let o=pS.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(bc.set(e.id,i),gv?.(),i)).catch(()=>(bc.set(e.id,null),null)),pS.set(e.id,o)),o})}const mQ=Ta(0);gv=()=>{mQ.value++},hQ(fQ);const gQ={"":"",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 uk(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=gQ[n])!=null?t:n}function b_e(e){const t=uk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function x_e(e){return(function(s){const o=mv.get(hS);if(!o)return;const i=o.core[s];if(i)return i;const r=bc.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!bc.has(o.id)&&pQ(o)})(uk(e))||((n=(t=mv.get(hS))==null?void 0:t.fallback)!=null?n:"");var t,n}const __e={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 EM=!1;function w_e(){return EM}function S_e(){EM=!0}var Mm=(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 Vo=null,vh=!1,Em=fk;function Tm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function dk(){try{const e=globalThis;return Tm(e?.katex)}catch{return null}}function fk(){return Mm(null,null,function*(){const e=dk();if(e)return e;const t=yield mo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield mo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Tm(t)})}function vQ(e){Em=e,Vo=null,vh=!1}function yQ(e){vQ(fk)}function TM(){return typeof Em=="function"}function C_e(){var e;const t=Em;if(!t||t===fk)return null;if(Vo)return Vo;const n=dk();if(n)return Vo=n,Vo;try{const s=t();return s&&typeof s?.then!="function"?(Vo=(e=Tm(s))!=null?e:s,Vo):null}catch{return null}}function hk(){return Mm(this,null,function*(){var e;const t=dk();if(t)return Vo=t,Vo;if(Vo)return Vo;if(vh)return null;const n=Em;if(!n)return vh=!0,null;try{const s=yield n();if(s)return Vo=(e=Tm(s))!=null?e:s,Vo}catch{}return vh=!0,null})}function NM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let yl=null,fl=null;const hi=new Map,Tr=new Map;let kp=5;const fa=new Set;function Id(){if(hi.size<kp&&fa.size){const e=Array.from(fa);fa.clear();for(const t of e)try{t()}catch{}}}function kQ(e){yl=e,fl=null,yl.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=hi.get(n);if(i)if(hi.delete(n),clearTimeout(i.timeoutId),Id(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Tr.set(a,s),Tr.size>200){const c=Tr.keys().next().value;Tr.delete(c)}}i.resolve(s)}},yl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of hi.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));hi.clear(),Id()}}function bQ(){var e;yl&&((e=yl.terminate)==null||e.call(yl)),yl=null,fl=null}function xQ(e,t=!0,n=2e3,s){return Mm(this,null,function*(){performance.now();const o=NM(e);if(!TM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(fl)return Promise.reject(fl);const i=`${t?"d":"i"}:${o}`,r=Tr.get(i);if(r)return Promise.resolve(r);const l=yl||(fl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),fl.name="WorkerInitError",fl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(fl);if(hi.size>=kp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=hi.size,a.max=kp,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(()=>{hi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Id()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),hi.has(u)&&hi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Id()},{once:!0});const f=a,h=c;hi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function A_e(e,t=!0,n){const s=`${t?"d":"i"}:${NM(e)}`;if(Tr.set(s,n),Tr.size>200){const o=Tr.keys().next().value;Tr.delete(o)}}const _Q="WORKER_BUSY";function wQ(e=2e3,t){return hi.size<kp?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),fa.delete(r),n())};if(fa.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,fa.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>Id()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),fa.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Tu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function M_e(e){return Mm(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:Tu.timeout,c=(i=s.waitTimeout)!=null?i:Tu.waitTimeout,u=(r=s.backoffMs)!=null?r:Tu.backoffMs,d=(l=s.maxRetries)!=null?l:Tu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Tu.maxRetries,h=s.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield xQ(t,n,a,h)}catch(m){if(m?.code!==_Q||p>=f)throw m;if(p++,yield wQ(c,h).catch(()=>{}),h?.aborted){const x=new Error("Aborted");throw x.name="AbortError",x}u>0&&(yield new Promise(x=>globalThis.setTimeout(x,u*p)))}}})}function xc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function SQ(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 vv(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=SQ(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 yv(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 IM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function kv(e,t=360,n=500){return IM(e,t,n)}function bv(e,t=360,n=500){return IM(e,t,n)}var CQ=Object.defineProperty,AQ=Object.defineProperties,MQ=Object.getOwnPropertyDescriptors,mS=Object.getOwnPropertySymbols,EQ=Object.prototype.hasOwnProperty,TQ=Object.prototype.propertyIsEnumerable,gS=(e,t,n)=>t in e?CQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$M=(e,t)=>{for(var n in t||(t={}))EQ.call(t,n)&&gS(e,n,t[n]);if(mS)for(var n of mS(t))TQ.call(t,n)&&gS(e,n,t[n]);return e},pk=(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 mk=()=>mo(()=>import("./mermaid.core-BkZly3Xv.js").then(e=>e.bn),[]);let mr=null,gk=mk;function NQ(e){gk=e,mr=null}function IQ(e){NQ(mk)}function $Q(){return typeof gk=="function"}function vS(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=$M({},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},AQ(n,MQ(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function yS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=$M({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 E_e(){return pk(this,null,function*(){if(mr)return mr;const e=(function(){try{const s=globalThis;return vS(s?.mermaid)}catch{return null}})();if(e)return mr=e,yS(mr),mr;const t=gk;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===mk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(mr=vS(n),yS(mr),mr):null})}let ho=null,hl=null;const qs=new Map;let kS=5,bS=!1;const LQ="WORKER_BUSY",FQ="MERMAID_DISABLED";function OQ(e){ho=e,hl=null;const t=e;ho.onmessage=n=>{if(ho!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=qs.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},ho.onerror=n=>{var s,o;if(ho===t)if(qs.size!==0){try{bS?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 qs.entries())r.reject(new Error(`Worker error: ${n.message}`));qs.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},ho.onmessageerror=n=>{var s,o;if(ho===t)if(qs.size!==0){try{bS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of qs.entries())r.reject(new Error("Worker messageerror"));qs.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function RQ(){var e;if(ho)try{for(const[t,n]of qs.entries())n.reject(new Error("Worker cleared"));qs.clear(),(e=ho.terminate)==null||e.call(ho)}catch{}ho=null,hl=null}function LM(e,t,n=1400){if(!$Q()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=FQ,Promise.reject(o)}if(hl)return Promise.reject(hl);const s=ho||(hl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),hl.name="WorkerInitError",hl.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(hl);if(qs.size>=kS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=LQ,o.inFlight=qs.size,o.max=kS,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),qs.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};qs.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return qs.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=qs.get(r);f&&f.reject(d)},n)})}function T_e(e,t,n=1400){return pk(this,null,function*(){try{return yield LM("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function N_e(e,t,n=1400){return pk(this,null,function*(){try{return yield LM("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function I_e(){if(ho)try{for(const[e,t]of qs.entries())t.reject(new Error("Worker terminated"));qs.clear(),ho.terminate()}finally{ho=null}}var BQ=Object.defineProperty,DQ=Object.defineProperties,PQ=Object.getOwnPropertyDescriptors,xS=Object.getOwnPropertySymbols,HQ=Object.prototype.hasOwnProperty,WQ=Object.prototype.propertyIsEnumerable,_S=(e,t,n)=>t in e?BQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))HQ.call(t,n)&&_S(e,n,t[n]);if(xS)for(var n of xS(t))WQ.call(t,n)&&_S(e,n,t[n]);return e},Pt=(e,t)=>DQ(e,PQ(t)),Qn=(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 zQ="__global__",L0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",xv=(()=>{const e=globalThis;if(e[L0])return e[L0];const t={scopedCustomComponents:{},revision:Ta(0)};return e[L0]=t,t})(),wS=xv.revision,UQ=Symbol("markstreamCustomComponents"),qQ=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 Kd(e){return qQ.has(String(e).trim().toLowerCase())}function jQ(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function F0(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([xi(n),xi(jQ(n))]))!o||Kd(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function Cs(e){const t=Vt(UQ,null);return D(()=>{var n;return wS.value,(function(s,o={}){return wS.value,lt(lt(lt({},F0(xv.scopedCustomComponents[zQ]||{})),F0(o)),F0((function(i){return i&&xv.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const VQ=["aria-label"],KQ={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"},GQ={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"},kn=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Zo=kn(Ye({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),T("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),T("svg",GQ,[...n[1]||(n[1]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),w("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(b(),T("svg",KQ,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,VQ))}),[["__scopeId","data-v-be21ab83"]]);Zo.install=e=>{e.component(Zo.__name,Zo)};const YQ={class:"emoji-node"},Oo=kn(Ye({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),T("span",YQ,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Oo.install=e=>{e.component(Oo.__name,Oo)};const ZQ=["id"],QQ=["title"],Qo=kn(Ye({__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)=>(b(),T("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[w("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,QQ)],8,ZQ))}}),[["__scopeId","data-v-c1463a29"]]);Qo.install=e=>{e.component(Qo.__name,Qo)};const FM=(()=>{try{return!1}catch{}return!1})();function O0(e){FM&&console.warn(e)}function SS(e,t="safe",n){return ak(e,t,n)}function OM(e){return NZ(e)}function R0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function vk(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=hv((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),R0(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),R0(r.value)]):Object.entries(o).map(([r,l])=>[r,R0(l)]):null,t,n);var o;if(!s)return;const i=OM(vp(s));return Object.keys(i).length>0?i:void 0}function CS(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 Nu(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function B0(e,t,n,s,o,i,r=!1){const l=(function(d,f){return yM(d,f)})(e,s);if(qd.has(e.toLowerCase())||!l&&mM(e,i))return null;if(!l&&lk(e,i))return r?[CS(e,t,!0)]:[CS(e,t),...n,`</${e}>`];const a=ak(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=OM(a);return vn(d,Pt(lt({},f),{key:u}),n.length>0?n:void 0)}return vn(e,Pt(lt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function RM(e,t){return FZ(e,t)}function bp(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=B0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Nu(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=B0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Nu(c[c.length-1].children,m):Nu(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&O0(`Auto-closing unclosed tag: <${p.tagName}>`)}else O0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=B0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Nu(c[c.length-1].children,f):Nu(u,f),O0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(IZ(e),t,n)}catch(o){return s=o,FM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const XQ=["innerHTML"],Xo=kn(Ye({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Vt("markstreamHtmlPolicy",void 0),s=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=Cs(()=>t.customId),i=Ye({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Rc(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=bp(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!RM(l,o.value))return{mode:"html",content:Rc(l,s.value)};const a=bp(l,o.value,s.value);return a===null?{mode:"html",content:Rc(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),T("span",{key:0,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ie(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(b(),T("span",{key:1,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(b(),T("span",{key:2,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,XQ))}}),[["__scopeId","data-v-d17f12b0"]]);Xo.install=e=>{e.component(Xo.__name,Xo)};const JQ={class:"inline-code"},eX={key:0},ro=kn(Ye({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Pd(),s=Vt("markstreamFade",void 0),o=Vt("markstreamTextStreamState",void 0),i=Vt("markstreamStreamVersion",void 0),r=D(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=D(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=D(()=>!l.value),u=D(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Q(t.node.code),f=Q("");let h=i?.value;const p=Q(0);function m(){return d.value+f.value}function x(){f.value&&(d.value=m(),f.value="")}Qe([()=>t.node.code,u,l,()=>i?.value],([g,v,y,M])=>{const L=String(g??""),$=u.value,_=M!==h;h=M;const E=_M({nextContent:L,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:_});d.value=E.settledContent,f.value=E.streamedDelta,E.appended&&(p.value+=1),$&&o?.set($,L)},{immediate:!0}),Qe(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const k=D(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(b(),T("code",JQ,[c.value?(b(),T(Be,{key:0},[Xe(O(a.value),1)],64)):(b(),T(Be,{key:1},[d.value?(b(),T("span",eX,O(d.value),1)):re("",!0),f.value?(b(),T("span",{key:1,class:Pe(["inline-code-stream-delta",[k.value]]),onAnimationend:x},O(f.value),35)):re("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);ro.install=e=>{e.component(ro.__name,ro)};const _v=Q(!1),AS=Q(""),MS=Q("top"),nd=Q(null),sd=Q(null),wv=Q(null),Sv=Q(null),ES=Q(null);let yh=null,kh=null,Cv=0;function BM(){yh&&(clearTimeout(yh),yh=null),kh&&(clearTimeout(kh),kh=null)}let Vf=!1,Kf=null,TS=!1;function tX(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Cv;BM();const l=()=>Qn(null,null,function*(){var a,c;if(yield(function(){return Qn(this,null,function*(){if(!Vf&&!TS&&typeof document<"u"){Kf!=null||(Kf=Qn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([mo(()=>import("./vue.runtime.esm-bundler-D8_2k_mF.js"),[]),mo(()=>import("./Tooltip-Ck9N0lEl.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:_v.value,"anchor-el":nd.value,content:AS.value,placement:MS.value,id:sd.value,originX:wv.value,originY:Sv.value,isDark:(p=ES.value)!=null?p:void 0})}}).mount(h),Vf=!0}));try{yield Kf}catch(u){Vf=!1,Kf=null,TS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Vf&&r===Cv){sd.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,nd.value=e,AS.value=t,MS.value=n,wv.value=(a=o?.x)!=null?a:null,Sv.value=(c=o?.y)!=null?c:null,ES.value=typeof i=="boolean"?i:null,_v.value=!0;try{e.setAttribute("aria-describedby",sd.value)}catch{}}});s?l():yh=setTimeout(l,80)}function nX(e=!1){Cv+=1,BM();const t=()=>{if(nd.value&&sd.value)try{nd.value.removeAttribute("aria-describedby")}catch{}_v.value=!1,nd.value=null,sd.value=null,wv.value=null,Sv.value=null};e?t():kh=setTimeout(t,120)}const Av={"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..."},Mv=e=>{var t;return(t=Av[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 NS(e){return{t(t){if(e.te&&Av[t]&&!e.te(t))return Mv(t);const n=e.t(t);return n===t&&Av[t]?Mv(t):n}}}function sX(){const e=(function(){var t,n;try{const s=Ys(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return NS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return NS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Mv}}function oX(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 iX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],rX={key:1,class:"image-placeholder"},lX={key:1,class:"image-node__raw-text"},aX={key:0,class:"image-shimmer-overlay"},cX={key:1,class:"image-node__raw-text"},uX={key:2,class:"image-error"},wl=kn(Ye({__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=Q(!1),i=Q(!1),r=Q(""),l=Q("primary"),a=Q(null),c=Pd(),u=Vt(pv,null);let d="",f=null;const h=D(()=>uw(n.node.src)),p=D(()=>uw(n.fallbackSrc)),m=D(()=>r.value),x=D(()=>!n.lazy),k=D(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=D(()=>l.value==="failed"),v=D(()=>!x.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=D(()=>oX(n,c));function M(R=y.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function L(R=y.value){R&&gt(()=>{M(R)})}function $(){f&&(clearTimeout(f),f=null)}function _(){const R=y.value;R&&d!==R&&(d&&u?.markSettled(d),$(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(L(R),E())},8e3)))}function E(){return Qn(this,null,function*(){const R=d;R&&($(),d="",yield gt(),M(R),u?.markSettled(R))})}function N(){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 F(){o.value=!0,i.value=!1,s("load",m.value),L()}function S(R){R.preventDefault(),o.value&&!i.value&&s("click",[R,m.value])}const{t:I}=sX();return Qe([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}),Qe([k,o,i,m,()=>n.lazy],([R,B,P,z,W])=>R&&z&&!P?B?(E(),void L()):W?(_(),void L()):void(B||P||_()):(E(),void L()),{flush:"post",immediate:!0}),ms(()=>{(function(){const R=d;R&&($(),d="",u?.markSettled(R))})()}),(R,B)=>{var P,z,W,ee,U;return b(),T("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[k.value?(b(),T("img",{key:0,src:m.value,alt:String((z=(P=n.node.alt)!=null?P:n.node.title)!=null?z:""),title:String((ee=(W=n.node.title)!=null?W:n.node.alt)!=null?ee:""),class:Pe(["image-node__img",{"is-loading":!x.value&&!o.value,"is-loaded":x.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:x.value?"high":void 0,decoding:x.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(U=n.node.alt)!=null?U:C(I)("image.preview"),onError:N,onLoad:F,onClick:S},null,42,iX)):re("",!0),e.node.loading&&!i.value?(b(),T("span",rX,[n.usePlaceholder?Fn(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[0]||(B[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),T("span",lX,O(e.node.raw),1))])):re("",!0),ie(El,{name:"shimmer-fade"},{default:Me(()=>[v.value&&!e.node.loading?(b(),T("span",aX,[n.usePlaceholder?Fn(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[1]||(B[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),T("span",cX,O(e.node.raw),1))])):re("",!0)]),_:3}),g.value?(b(),T("span",uX,[Fn(R.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[2]||(B[2]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("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)),w("span",null,O(C(I)("image.loadError")),1)],!0)])):re("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);wl.install=e=>{e.component(wl.__name,wl)};const dX={key:2},nr=Ye({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Cs(()=>t.customId),s=Vt("markstreamHtmlPolicy",void 0),o=Vt("markstreamNestedRendererProps",void 0),i=D(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=D(()=>{var p,m;const x=(p=o?.value)!=null?p:{};return Pt(lt({},x),{customId:(m=t.customId)!=null?m:x.customId,htmlPolicy:i.value})}),l=Ii({loader:()=>Promise.resolve().then(()=>Sk),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),c=D(()=>!!(a.value&&n.value[t.node.type]&&!Kd(String(t.node.type)))),u=D(()=>c.value?vk(t.node,i.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=D(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(b(),ke(Vs(a.value),_n({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:Me(()=>[d.value?(b(),ke(C(l),_n({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?(b(),ke(C(l),_n({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"])):re("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(b(),ke(Vs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(b(),T("span",dX,O(h.value),1)):re("",!0)}}),fX=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],hX={key:0,translate:"no",class:"markstream-pre__diff-code"},pX={class:"markstream-pre__diff-number","aria-hidden":"true"},mX={class:"markstream-pre__diff-content"},gX={class:"markstream-pre__diff-content-inner"},vX={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},yX=["textContent"],jo=Ye({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=D(()=>{var S,I,R;const B=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((R=String(B).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=D(()=>`language-${n.value}`),o=D(()=>{var S,I,R,B,P;return((S=t.node)==null?void 0:S.diff)===!0?String((R=(I=t.node)==null?void 0:I.code)!=null?R:""):(function(z,W){const ee=String(z??"");return W?ee:ee.replace(/\r\n$|\n$|\r$/,"")})((B=t.node)==null?void 0:B.code,((P=t.node)==null?void 0:P.loading)===!0)}),i=D(()=>o.value.split(/\r\n|\n|\r/)),r=D(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=D(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=D(()=>l.value&&t.diffInline===!0),c=D(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",R={}){const B=u(S);return{code:S,kind:B&&I!=="hunk"&&!R.preserveBlankKind?"context":I,empty:B}}function f(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function x(S,I){const R=f(S),B=f(I),P=(function(ce,fe){const oe=ce.length,Y=fe.length;if((oe+1)*(Y+1)>15e5)return null;const X=Y+1,le=new Uint32Array((oe+1)*(Y+1));for(let ae=1;ae<=oe;ae++)for(let me=1;me<=Y;me++){const q=ae*X+me;if(ce[ae-1]===fe[me-1])le[q]=le[(ae-1)*X+(me-1)]+1;else{const ne=le[(ae-1)*X+me],ge=le[ae*X+(me-1)];le[q]=ne>=ge?ne:ge}}const He=[];let de=oe,G=Y;for(;de>0&&G>0;)ce[de-1]===fe[G-1]?(He.push({originalIndex:de-1,modifiedIndex:G-1}),de--,G--):le[(de-1)*X+G]>=le[de*X+(G-1)]?de--:G--;return He.reverse(),He})(R,B);if(P){const ce=[];let fe=0,oe=0;for(const Y of P){for(;fe<Y.originalIndex;)ce.push(Pt(lt({},d(R[fe],"removed",{preserveBlankKind:h(R,fe)})),{key:`inline-removed-source-${fe}`,number:""})),fe++;for(;oe<Y.modifiedIndex;)ce.push(Pt(lt({},d(B[oe],"added",{preserveBlankKind:h(B,oe)})),{key:`inline-added-source-${oe}`,number:oe+1})),oe++;ce.push(Pt(lt({},d(B[Y.modifiedIndex])),{key:`inline-context-source-${Y.originalIndex}-${Y.modifiedIndex}`,number:Y.modifiedIndex+1})),fe=Y.originalIndex+1,oe=Y.modifiedIndex+1}for(;fe<R.length;)ce.push(Pt(lt({},d(R[fe],"removed",{preserveBlankKind:h(R,fe)})),{key:`inline-removed-source-${fe}`,number:""})),fe++;for(;oe<B.length;)ce.push(Pt(lt({},d(B[oe],"added",{preserveBlankKind:h(B,oe)})),{key:`inline-added-source-${oe}`,number:oe+1})),oe++;return ce}const z=[];let W=0,ee=R.length-1,U=B.length-1;for(;W<=ee&&W<=U&&R[W]===B[W];)z.push(Pt(lt({},d(B[W])),{key:`inline-prefix-${W}`,number:W+1})),W++;const Z=[];for(;ee>=W&&U>=W&&R[ee]===B[U];)Z.unshift(Pt(lt({},d(B[U])),{key:`inline-suffix-${U}`,number:U+1})),ee--,U--;for(let ce=W;ce<=ee;ce++)z.push(Pt(lt({},d(R[ce],"removed",{preserveBlankKind:h(R,ce)})),{key:`inline-removed-source-${ce}`,number:""}));for(let ce=W;ce<=U;ce++)z.push(Pt(lt({},d(B[ce],"added",{preserveBlankKind:h(B,ce)})),{key:`inline-added-source-${ce}`,number:ce+1}));return z.concat(Z)}const k=D(()=>{var S,I,R,B;const P=(function(U){const Z=U.some(fe=>p(fe)),ce=U.some(fe=>m(fe));return Z&&ce||(function(){var fe,oe,Y,X;if(n.value==="diff")return!0;const le=(X=(Y=String((oe=(fe=t.node)==null?void 0:fe.raw)!=null?oe:"").split(/\r?\n/,1)[0])==null?void 0:Y.trim())!=null?X:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(le)})()&&(Z||ce)})(i.value),z=(function(){var U,Z;return((U=t.node)==null?void 0:U.originalCode)!=null||((Z=t.node)==null?void 0:Z.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:P?(function(U){const Z=[];let ce=1;for(const[fe,oe]of U.entries())if(oe.startsWith("@@"))Z.push(Pt(lt({},d(oe,"hunk")),{key:`inline-hunk-${fe}`,number:""}));else if(p(oe))Z.push(Pt(lt({},d(oe.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${fe}`,number:""}));else if(m(oe))Z.push(Pt(lt({},d(oe.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${fe}`,number:ce++}));else{const Y=oe.startsWith(" ")?oe.slice(1):oe;Z.push(Pt(lt({},d(Y)),{key:`inline-context-${fe}`,number:ce})),ce++}return Z})(i.value):x((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!P&&z){const U=f((R=t.node)==null?void 0:R.originalCode),Z=f((B=t.node)==null?void 0:B.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((ce,fe)=>{const oe=Z[fe]===ce?"context":"removed";return Pt(lt({},d(ce,oe,{preserveBlankKind:h(U,fe)})),{key:`original-${fe}`,number:fe+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((ce,fe)=>{const oe=U[fe]===ce?"context":"added";return Pt(lt({},d(ce,oe,{preserveBlankKind:h(Z,fe)})),{key:`modified-${fe}`,number:fe+1})})}]}const W=[],ee=[];for(const U of i.value)if(U.startsWith("@@"))W.push(d(U,"hunk")),ee.push(d(U,"hunk"));else if(U.startsWith("-")&&!U.startsWith("---"))W.push(d(U.slice(1),"removed",{preserveBlankKind:!0}));else if(U.startsWith("+")&&!U.startsWith("+++"))ee.push(d(U.slice(1),"added",{preserveBlankKind:!0}));else{const Z=U.startsWith(" ")?U.slice(1):U;W.push(d(Z)),ee.push(d(Z))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:W.map((U,Z)=>Pt(lt({},U),{key:`original-${Z}`,number:Z+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ee.map((U,Z)=>Pt(lt({},U),{key:`modified-${Z}`,number:Z+1}))}]}),g=D(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Q(null),y=Q([]);let M=null,L=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function _(S,I){var R;if(!S)return I;const B=S.querySelector(".markstream-pre__diff-content"),P=B?.getBoundingClientRect(),z=(R=P?.height)!=null?R:0;return Math.max(I,Math.ceil(z))}function E(){typeof window<"u"&&(M!=null&&window.cancelAnimationFrame(M),M=window.requestAnimationFrame(()=>{(function(){var S,I;M=null;const R=v.value;if(!R||!l.value)return void(y.value.length&&(y.value=[]));const B=(function(ce){const fe=window.getComputedStyle(ce),oe=$(fe.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const Y=$(fe.lineHeight);return Y>0?Y:18})(R),P=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),W=Math.max(P.length,z.length),ee=[];for(let ce=0;ce<W;ce++){const fe=_((S=P[ce])!=null?S:null,B),oe=_((I=z[ce])!=null?I:null,B),Y=Math.max(B,fe,oe);ee.push({rowHeight:Y,originalHeight:fe,modifiedHeight:oe})}var U,Z;U=y.value,Z=ee,U.length===Z.length&&U.every((ce,fe)=>{const oe=Z[fe];return oe&&Math.abs(ce.rowHeight-oe.rowHeight)<=.5&&Math.abs(ce.originalHeight-oe.originalHeight)<=.5&&Math.abs(ce.modifiedHeight-oe.modifiedHeight)<=.5})||(y.value=ee)})()}))}function N(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{E()}),L.observe(S))}function F(S,I){const R=y.value[S];if(!R)return;const B=I==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(B)}px`}}return Qe(v,S=>{N(S),gt(()=>E())},{flush:"post"}),Qe([l,k],()=>{N(v.value),gt(()=>E())},{flush:"post",immediate:!0}),ms(()=>{M!=null&&(window.cancelAnimationFrame(M),M=null),L?.disconnect(),L=null}),(S,I)=>(b(),T("pre",{ref_key:"preRef",ref:v,style:Gt(c.value),class:Pe([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?(b(),T("code",hX,[(b(!0),T(Be,null,st(k.value,R=>(b(),T("span",{key:R.key,class:Pe(["markstream-pre__diff-pane",R.className])},[(b(!0),T(Be,null,st(R.lines,(B,P)=>(b(),T("span",{key:B.key,class:Pe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${B.kind}`,{"markstream-pre__diff-line--empty":B.empty}]]),style:Gt(F(P,R.key))},[I[0]||(I[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",pX,O(B.number),1),w("span",mX,[w("span",gX,O(B.code),1)])],6))),128))],2))),128))])):(b(),T(Be,{key:1},[t.showLineNumbers?(b(),T("span",vX,[(b(!0),T(Be,null,st(r.value,R=>(b(),T("span",{key:R,class:"markstream-pre__line-number"},O(R),1))),128))])):re("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,yX)],64))],14,fX))}});jo.install=e=>{e.component(jo.__name,jo)};const D0=Ta(!1);let IS=null;const kX={key:0},is=kn(Ye({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(IS||(IS=hk().then(k=>{D0.value=!!k}).catch(()=>{D0.value=!1})),$h(D0)),s=Pd(),o=Vt("markstreamFade",void 0),i=Vt("markstreamTextStreamState",void 0),r=Vt("markstreamStreamVersion",void 0),l=D(()=>{const k=s.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),a=D(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=D(()=>{var k;const g=(k=s["index-key"])!=null?k:s.indexKey;return g==null||g===""?"":String(g)}),u=Q(t.node.content),d=Q("");let f=r?.value;const h=Q(0);function p(){return u.value+d.value}function m(){d.value&&(u.value=p(),d.value="")}Qe([()=>t.node.content,c,a,()=>r?.value],([k,g,v,y])=>{const M=String(k??""),L=c.value,$=y!==f;f=y;const _=_M({nextContent:M,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=_.settledContent,d.value=_.streamedDelta,_.appended&&(h.value+=1),L&&i?.set(L,M)},{immediate:!0}),Qe(a,k=>{var g;k||(g=p(),u.value=g,d.value="")});const x=D(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,g)=>(b(),T("span",{class:Pe([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(b(),T("span",kX,O(u.value),1)):re("",!0),d.value?(b(),T("span",{key:1,class:Pe(["text-node-stream-delta",[x.value]]),onAnimationend:m},O(d.value),35)):re("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);is.install=e=>{e.component(is.__name,is)};const DM=Ye({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return vn(jo,Pt(lt({},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"}))}}}),P0=Ii({loader:()=>Qn(null,null,function*(){try{return(yield mo(()=>import("./CodeBlockNode--cMVMvaD.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),jo}}),loadingComponent:DM,delay:0,suspensible:!1}),Ri=Ii(()=>Qn(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 vn(is,Pt(lt({},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 hk())return(yield mo(()=>import("./index6-X2_QEqKR.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 vn(is,Pt(lt({},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:""}$`}}))}})),PM=Ii(()=>Qn(null,null,function*(){try{if(yield hk())return(yield mo(()=>import("./index5-D3mN0q-1.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 vn(is,Pt(lt({},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:""}$$`}}))}})),yo=kn(Ye({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),T("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"]]);yo.install=e=>{e.component(yo.__name,yo)};const bX={class:"superscript-node"},Ro=kn(Ye({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:is,inline_code:ro,link:xo,html_inline:Xo,strong:ko,emphasis:_o,footnote_reference:Qo,strikethrough:bo,highlight:Jo,insert:Do,subscript:Bo,emoji:Oo,math_inline:Ri,reference:yo},n.value));return(o,i)=>(b(),T("sup",bX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),ke(C(nr),{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"]]);Ro.install=e=>{e.component(Ro.__name,Ro)};const xX={class:"subscript-node"},Bo=kn(Ye({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:is,inline_code:ro,link:xo,html_inline:Xo,strong:ko,emphasis:_o,footnote_reference:Qo,strikethrough:bo,highlight:Jo,insert:Do,superscript:Ro,emoji:Oo,math_inline:Ri,reference:yo},n.value));return(o,i)=>(b(),T("sub",xX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),ke(C(nr),{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"]]);Bo.install=e=>{e.component(Bo.__name,Bo)};const _X={class:"strong-node"},ko=kn(Ye({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:is,inline_code:ro,link:xo,html_inline:Xo,emphasis:_o,strikethrough:bo,highlight:Jo,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Qo,math_inline:Ri,reference:yo},n.value));return(o,i)=>(b(),T("strong",_X,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),ke(C(nr),{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"]]);ko.install=e=>{e.component(ko.__name,ko)};const wX={class:"strikethrough-node"},bo=kn(Ye({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:is,inline_code:ro,link:xo,html_inline:Xo,strong:ko,emphasis:_o,highlight:Jo,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Qo,math_inline:Ri,reference:yo},n.value));return(o,i)=>(b(),T("del",wX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),ke(C(nr),{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"]]);bo.install=e=>{e.component(bo.__name,bo)};const SX=["href","title","aria-label","aria-hidden","target","rel"],CX=["aria-hidden"],AX={class:"link-text-wrapper relative inline-flex"},MX={class:"leading-[normal] link-text"},xo=kn(Ye({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Vt("markstreamShowTooltips",void 0),s=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=D(()=>{var k,g,v,y,M;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(k=t.animationOpacity)!=null?k:.35,_=Math.max(.12,Math.min(.5*$,$)),E={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String($),"--underline-rest-opacity":String(_),"--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):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=Cs(()=>t.customId),r=D(()=>lt({text:is,strong:ko,strikethrough:bo,emphasis:_o,image:wl,html_inline:Xo,inline_code:ro},i.value)),l=Pd(),a=D(()=>{var k,g;const v=(k=t.node)==null?void 0:k.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const M of v)Array.isArray(M)&&M[0]&&(y[String(M[0])]=String((g=M[1])!=null?g:""));else for(const[M,L]of Object.entries(v))M&&L!=null&&L!==!1&&(y[M]=L===!0?"":String(L));return SS(y,"safe","a")}),c=D(()=>lt(lt({},l),a.value)),u=D(()=>{var k,g;return SS({href:String((g=(k=t.node)==null?void 0:k.href)!=null?g:"")},"safe","a").href}),d=D(()=>{if(!u.value)return;const k=c.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(vV(u.value)?"_blank":void 0)}),f=D(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!u.value)return;const k=c.value.rel,g=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=D(()=>{const k=lt({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){s.value&&nX()}const x=D(()=>{var k,g;const v=(k=t.node)==null?void 0:k.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(k,g)=>{var v,y;return e.node.loading?(b(),T("span",_n({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[w("span",AX,[w("span",MX,[ie(C(is),{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]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,CX)):(b(),T("a",_n({key:0,class:"link-node",href:u.value,title:s.value?"":x.value,"aria-label":`Link: ${x.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:g[0]||(g[0]=M=>(function(L){var $,_,E,N;if(!s.value)return;const F=L,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,I=(($=t.node)==null?void 0:$.title)||((_=u.value)!=null&&_.includes("xn--")&&((N=(E=t.node)==null?void 0:E.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";tX(L.currentTarget,I,"top",!1,S)})(M)),onMouseleave:m}),[(b(!0),T(Be,null,st(e.node.children,(M,L)=>(b(),ke(C(nr),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,SX))}}}),[["__scopeId","data-v-367e6ca4"]]);xo.install=e=>{e.component(xo.__name,xo)};const EX={class:"insert-node"},Do=kn(Ye({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:is,inline_code:ro,link:xo,html_inline:Xo,strong:ko,emphasis:_o,strikethrough:bo,highlight:Jo,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Qo,math_inline:Ri,reference:yo},n.value));return(o,i)=>(b(),T("ins",EX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),ke(C(nr),{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"]]);Do.install=e=>{e.component(Do.__name,Do)};const TX={class:"highlight-node"},Jo=kn(Ye({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:is,inline_code:ro,link:xo,html_inline:Xo,strong:ko,emphasis:_o,strikethrough:bo,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Qo,math_inline:Ri,reference:yo},n.value));return(o,i)=>(b(),T("mark",TX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),ke(C(nr),{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"]]);Jo.install=e=>{e.component(Jo.__name,Jo)};const NX={class:"emphasis-node"},_o=kn(Ye({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>lt({text:is,inline_code:ro,link:xo,html_inline:Xo,strong:ko,strikethrough:bo,highlight:Jo,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,footnote_reference:Qo,math_inline:Ri,reference:yo},n.value));return(o,i)=>(b(),T("em",NX,[(b(!0),T(Be,null,st(e.node.children,(r,l)=>(b(),ke(C(nr),{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"]]);_o.install=e=>{e.component(_o.__name,_o)};const IX={class:"hard-break"},Sl=kn(Ye({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),T("br",IX))}),[["__scopeId","data-v-50c58f70"]]);Sl.install=e=>{e.component(Sl.__name,Sl)};const $d=Ye({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=mt({checkbox:Zo,checkbox_input:Zo,emoji:Oo,emphasis:_o,hardbreak:Sl,highlight:Jo,inline_code:ro,insert:Do,link:xo,reference:yo,strikethrough:bo,strong:ko,subscript:Bo,superscript:Ro,text:is}),s=Cs(()=>t.customId),o=D(()=>{const i=s.value;return Object.keys(i).length>0?lt(lt({},n),i):n});return(i,r)=>(b(!0),T(Be,null,st(e.nodes,(l,a)=>(b(),ke(C(nr),{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 Ev(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(Ev)}function xp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Ev))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(Ev)?o:null}function Gc(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 $X=["cite"],LX={key:0,dir:"auto",class:"paragraph-node"},FX=["custom-id"],bh=kn(Ye({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Cs(()=>t.customId),s=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),i=D(()=>xp(t.node.children,!s.value)),r=D(()=>t.fade!==!1||o.value?null:Gc(i.value));return In("markstreamShowTooltips",D(()=>t.showTooltips)),In("markstreamFade",D(()=>t.fade)),(l,a)=>(b(),T("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(b(),T("p",LX,[r.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,FX)):(b(),ke(C($d),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),ke(C(Po),{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,$X))}}),[["__scopeId","data-v-abfecebc"]]);bh.install=e=>{e.component(bh.__name,bh)};const OX={class:"definition-list"},RX={class:"definition-term"},BX={class:"definition-desc"},xh=kn(Ye({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),T("dl",OX,[(b(!0),T(Be,null,st(t.node.items,(o,i)=>(b(),T(Be,{key:i},[w("dt",RX,[ie(C(Po),{"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"])]),w("dd",BX,[ie(C(Po),{"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"]]);xh.install=e=>{e.component(xh.__name,xh)};const DX=["href","title"],od=kn(Ye({__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)=>(b(),T("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,DX))}}),[["__scopeId","data-v-e1eb37b6"]]);od.install=e=>{e.component(od.__name,od)};const PX=["id"],HX={class:"flex-1"},_h=Ye({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),T("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",HX,[ie(C(Po),{"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,PX))}});_h.install=e=>{e.component(_h.__name,_h)};const WX=["custom-id"],Tv=kn(Ye({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Cs(()=>t.customId),s=Vt("markstreamFade",void 0),o=D(()=>s?.value!==!1||n.value.text?null:Gc(t.node.children)),i=D(()=>lt({text:is,inline_code:ro,link:xo,image:wl,strong:ko,emphasis:_o,strikethrough:bo,highlight:Jo,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,checkbox:Zo,checkbox_input:Zo,footnote_reference:Qo,hardbreak:Sl,math_inline:Ri,reference:yo},n.value));return(r,l)=>(b(),ke(Vs(`h${e.node.level}`),_n({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Me(()=>[o.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,WX)):(b(!0),T(Be,{key:1},st(e.node.children,(a,c)=>(b(),ke(C(nr),{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=Tv;_p.install=e=>{e.component(Tv.__name,Tv)};const zX={key:0,dir:"auto",class:"paragraph-node"},UX=["custom-id"],qX={dir:"auto",class:"paragraph-node"},jX=["custom-id"],Bc=kn(Ye({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),s=Cs(()=>t.customId),o=D(()=>!!s.value.paragraph),i=D(()=>!!s.value.text),r=D(()=>{var h;return xp((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{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 x=p.slice(1);if(!x.every(g=>g?.type==="list"))return null;const k=xp([m]);return k?{paragraphChildren:k,nestedLists:x}:null});function a(){return t.fade===!1&&!i.value}const c=D(()=>a()?Gc(r.value):null),u=D(()=>{var h;return a()?Gc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return In("markstreamShowTooltips",D(()=>t.showTooltips)),In("markstreamFade",D(()=>t.fade)),(h,p)=>{var m,x;return b(),T("li",_n({class:"list-item",dir:"auto"},f.value),[r.value?(b(),T("p",zX,[c.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,UX)):(b(),ke(C($d),{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?(b(),T(Be,{key:1},[w("p",qX,[u.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,jX)):(b(),ke(C($d),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(b(!0),T(Be,null,st(l.value.nestedLists,(k,g)=>(b(),ke(C(Po),{key:g,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(b(),ke(C(Po),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(x=(m=n.value)==null?void 0:m.children)!=null?x:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=k=>h.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Bc.install=e=>{e.component(Bc.__name,Bc)};const Dc=kn(Ye({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Cs(()=>e.customId),n=D(()=>t.value.list_item||Bc);return(s,o)=>(b(),ke(Vs(e.node.ordered?"ol":"ul"),{class:Pe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Me(()=>[(b(!0),T(Be,null,st(e.node.items,(i,r)=>{var l;return b(),ke(Vs(n.value),_n({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"]]);Dc.install=e=>{e.component(Dc.__name,Dc)};const HM=Symbol("ViewportPriority");function VX(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Q(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 x(){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&&x())},{timeout:1200}))}Qe(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const k=(g,v)=>{const y=Q(!1);let M,L=!1;const $=new Promise(N=>{M=()=>{L||(L=!0,N())}}),_=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()};if(!o||!i.value)return y.value=!0,M(),{isVisible:y,whenVisible:$,destroy:_};const E=(function(N,F){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(B,P){var z,W,ee;return{root:(z=e?.(B??null))!=null?z:null,rootMargin:(W=P?.rootMargin)!=null?W:"300px",threshold:(ee=P?.threshold)!=null?ee:0}})(N,F);if(a&&(R=S,(I=c)&&I.root===R.root&&I.rootMargin===R.rootMargin&&I.threshold===R.threshold))return a;var I,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(B=>{for(const P of B)(P.isIntersecting||P.intersectionRatio>0)&&m(P.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const B of u.keys())a.observe(B);return a})(g,v);return E?(u.set(g,{resolve:M,visible:y}),E.observe(g),d.add(g),x(),{isVisible:y,whenVisible:$,destroy:_}):(y.value=!0,M(),{isVisible:y,whenVisible:$,destroy:_})};return In(HM,k),k}function KX(){var e,t;const n=Vt(HM,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=Q(!1);let p,m=!1;const x=new Promise(v=>{p=()=>{m||(m=!0,v())}}),k=()=>{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:x,destroy:k}):(h.value=!0,p(),{isVisible:h,whenVisible:x,destroy:k})}}const GX={key:2,class:"html-block-node__raw"},YX=["innerHTML"],ZX={key:1,class:"html-block-node__placeholder"},id=kn(Ye({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Vt("markstreamHtmlPolicy",void 0),s=Vt("markstreamNestedRendererProps",void 0),o=D(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=D(()=>{var L,$;const _=(L=s?.value)!=null?L:{};return Pt(lt({},_),{customId:($=t.customId)!=null?$:_.customId,htmlPolicy:o.value})}),r=Ii({loader:()=>Promise.resolve().then(()=>Sk),suspensible:!1}),l=D(()=>{const L=hv(t.node.attrs,o.value);if(!L)return;const $=vp(L);return Object.keys($).length>0?$:void 0}),a=D(()=>{const L=String(t.node.tag||"").trim(),$=hv(t.node.attrs,o.value,L);if(!$)return;const _=vp($);return Object.keys(_).length>0?_:void 0}),c=Cs(()=>t.customId),u=Ye({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Q(null),f=Q(typeof window>"u"),h=Q(t.node.content),p=D(()=>Array.isArray(t.node.children)?t.node.children:[]),m=D(()=>String(t.node.tag||"div")),x=D(()=>{const L=m.value.trim().toLowerCase();return C6.has(L)||lk(L,o.value)}),k=D(()=>p.value.length>0&&!!t.node.tag&&!x.value),g=D(()=>{var L,$,_;if(k.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=h.value)!=null?L:""};const E=($=h.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Rc(E,o.value)};if(t.node.loading){const F=bp(E,c.value,o.value);return F===null?{mode:"text",content:(_=t.node.raw)!=null?_:E}:{mode:"dynamic",nodes:F}}if(!RM(E,c.value))return{mode:"html",content:Rc(E,o.value)};const N=bp(E,c.value,o.value);return N===null?{mode:"html",content:Rc(E,o.value)}:{mode:"dynamic",nodes:N}}),v=KX(),y=Q(null),M=!!t.node.loading;return typeof window<"u"?(Qe(d,L=>{var $,_;if((_=($=y.value)==null?void 0:$.destroy)==null||_.call($),y.value=null,!M)return f.value=!0,void(h.value=t.node.content);if(!L)return void(f.value=!1);const E=v(L,{rootMargin:"400px"});y.value=E,f.value=E.isVisible.value,E.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Qe(()=>t.node.content,L=>{M&&!f.value||(h.value=L)})):f.value=!0,ms(()=>{var L,$;($=(L=y.value)==null?void 0:L.destroy)==null||$.call(L),y.value=null}),(L,$)=>(b(),ke(Vs(k.value?m.value:"div"),_n({ref_key:"htmlRef",ref:d,class:"html-block-node"},k.value?a.value:void 0),{default:Me(()=>[f.value?(b(),T(Be,{key:0},[g.value.mode==="structured"?(b(),ke(C(r),_n({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"?(b(),ke(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(b(),T("pre",GX,O(g.value.content),1)):(b(),T("div",_n({key:3},l.value,{innerHTML:g.value.content}),null,16,YX))],64)):(b(),T("div",ZX,[Fn(L.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);id.install=e=>{e.component(id.__name,id)};const QX={dir:"auto",class:"paragraph-node"},XX=["custom-id"],ba=kn(Ye({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Cs(()=>t.customId),s=Vt("markstreamHtmlPolicy",void 0),o=Vt("markstreamFade",void 0),i=Vt("markstreamParseOptions",void 0),r=Vt("markstreamCustomMarkdownIt",void 0),l=Vt("markstreamNestedRendererProps",void 0),a=D(()=>{var _;return(_=s?.value)!=null?_:"safe"}),c=D(()=>{var _;return(_=t.parseOptions)!=null?_:i?.value}),u=D(()=>{var _;return(_=t.customMarkdownIt)!=null?_:r?.value}),d=D(()=>{var _,E;return(E=t.customHtmlTags)!=null?E:(_=l?.value)==null?void 0:_.customHtmlTags}),f=D(()=>{var _,E;const N=(_=l?.value)!=null?_:{};return Pt(lt({},N),{customId:(E=t.customId)!=null?E:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Ii({loader:()=>Promise.resolve().then(()=>Sk),suspensible:!1});function p(_){var E;return _.type==="text"&&String((E=_.content)!=null?E:"").trim()===""}const m=D(()=>t.node.children.filter(_=>!p(_))),x=D(()=>m.value.length>0&&m.value.every(_=>_.type==="image"||(function(E){var N;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!p(I)):[]})(E);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(_))),k=D(()=>new Set(eu(d.value))),g=D(()=>{if(!x.value||m.value.length<=1)return t.node.children;const _=[];for(let E=0;E<t.node.children.length;E++){const N=t.node.children[E];if(!p(N)){_.push(N);continue}const F=_.length>0,S=t.node.children.slice(E+1).some(I=>!p(I));F&&S&&_.push(Pt(lt({},N),{content:" ",raw:" "}))}return _}),v=D(()=>o?.value===!1&&!n.value.text),y=D(()=>v.value?Gc(g.value):null);function M(_,E){return{node:_,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=D(()=>lt({inline_code:ro,image:wl,link:xo,hardbreak:Sl,emphasis:_o,strong:ko,strikethrough:bo,highlight:Jo,insert:Do,subscript:Bo,superscript:Ro,html_inline:Xo,html_block:id,emoji:Oo,checkbox:Zo,math_inline:Ri,checkbox_input:Zo,reference:yo,footnote_anchor:od,footnote_reference:Qo,text:is},n.value)),$=D(()=>g.value.map((_,E)=>{var N;const F=(function(S){var I,R,B,P;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||T6(S.content);if(z&&!k.value.has(z)&&N6((R=S.content)!=null?R:S.raw,z)){const W=String((P=(B=S.content)!=null?B:S.raw)!=null?P:"");return{child:{type:"text",content:W,raw:W},component:is,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Kd(String(S.type)))}})(_);return Pt(lt({},F),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:F.isCustomComponent?vk(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((N=F.child.content)!=null?N:""),originalChild:_})}));return(_,E)=>(b(),T("p",QX,[y.value!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(y.value),9,XX)):(b(!0),T(Be,{key:1},st($.value,N=>{return b(),T(Be,{key:N.key},[x.value&&p(N.originalChild)?(b(),T(Be,{key:0},[Xe(O((F=N.originalChild,String((S=F.content)!=null?S:""))),1)],64)):N.isCustomComponent?(b(),ke(Vs(N.component),_n({key:1,ref_for:!0},N.customAttrs,{node:N.child,loading:N.child.loading,"index-key":N.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Me(()=>[N.hasSlotChildren?(b(),ke(C(h),_n({key:0,ref_for:!0},f.value,{nodes:N.child.children,"index-key":N.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):N.slotContent?(b(),ke(C(h),_n({key:1,ref_for:!0},f.value,{content:N.slotContent,final:!N.child.loading,"index-key":`${N.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(b(),ke(Vs(N.component),_n({key:2,ref_for:!0},M(N.child,N.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);ba.install=e=>{e.component(ba.__name,ba)};const JX={class:"table-node-wrapper"},eJ=["aria-busy"],tJ={key:0},nJ=["custom-id"],sJ=["aria-label","onPointerdown"],oJ=["custom-id"],iJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},rd=kn(Ye({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var k;return(k=t.node.loading)!=null&&k}),s=D(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=Q(null),i=Q([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>i.value.some(k=>Number.isFinite(k)&&k>0)),c=D(()=>a.value?i.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);In("markstreamShowTooltips",D(()=>t.showTooltips)),In("markstreamFade",D(()=>t.fade));const u=Cs(()=>t.customId),d=D(()=>!!u.value.text),f=D(()=>!!u.value.paragraph),h=new WeakMap;function p(k){const g=t.fade===!1&&!d.value,v=!f.value,y=h.get(k);if(y?.children===k.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const M=xp(k.children,v,!0),L={simpleChildren:M,plainText:M&&g?Gc(M):null};return h.set(k,{children:k.children,textFastPath:g,paragraphFastPath:v,info:L}),L}function m(k){if(!r)return;k.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+k.clientX-r.startX))),M=[...r.widths];M[r.index]=y,M[r.index+1]=g-y,i.value=M}function x(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),r=null)}return Qe(l,()=>{x(),i.value=[]}),ms(x),(k,g)=>(b(),T("div",JX,[w("table",{ref_key:"tableRef",ref:o,class:Pe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),T("colgroup",tJ,[(b(!0),T(Be,null,st(e.node.header.cells,(v,y)=>(b(),T("col",{key:y,style:Gt(c.value[y])},null,4))),128))])):re("",!0),w("thead",null,[w("tr",null,[(b(!0),T(Be,null,st(e.node.header.cells,(v,y)=>(b(),T("th",{key:y,dir:"auto",class:Pe([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(v).plainText),9,nJ)):p(v).simpleChildren?(b(),ke(C($d),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(b(),ke(C(Po),{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]=M=>k.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(b(),T("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:M=>(function(L,$){if($.button!==0)return;const _=(function(){var F;const S=(F=o.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),E=_[L],N=_[L+1];E&&N&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:E,nextStartWidth:N,widths:_},i.value=_,window.addEventListener("pointermove",m),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x))})(y,M)},null,40,sJ)):re("",!0)],2))),128))])]),w("tbody",null,[(b(!0),T(Be,null,st(s.value,(v,y)=>(b(),T("tr",{key:y},[(b(!0),T(Be,null,st(v.cells,(M,L)=>(b(),T("td",{key:L,class:Pe([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(M).plainText!==null?(b(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(M).plainText),9,oJ)):p(M).simpleChildren?(b(),ke(C($d),{key:1,nodes:p(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),ke(C(Po),{key:2,nodes:M.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]=$=>k.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,eJ),ie(El,{name:"table-node-fade"},{default:Me(()=>[n.value?(b(),T("div",iJ,[Fn(k.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):re("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);rd.install=e=>{e.component(rd.__name,rd)};const rJ={class:"hr-node"},wh=kn({},[["render",function(e,t){return b(),T("hr",rJ)}],["__scopeId","data-v-39b2349c"]]);wh.install=e=>{e.component(wh.__name,wh)};const lJ={class:"unknown-node"},Nv=Ye({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),T("div",lJ,O(e.node.raw),1))}),Sh=kn(Ye({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),s=Cs(()=>t.customId),o=D(()=>lt({text:is,paragraph:ba,heading:_p,inline_code:ro,link:xo,image:wl,strong:ko,emphasis:_o,strikethrough:bo,insert:Do,subscript:Bo,superscript:Ro,checkbox:Zo,checkbox_input:Zo,hardbreak:Sl,math_inline:Ri,reference:yo,list:Dc,math_block:PM,table:rd},s.value));return(i,r)=>(b(),T("div",_n({class:n.value},e.node.attrs),[(b(!0),T(Be,null,st(e.node.children,(l,a)=>{return b(),ke(Vs((c=l.type,o.value[c]||Nv)),{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"]]);Sh.install=e=>{e.component(Sh.__name,Sh)};const aJ=["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"],$S=[[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 cJ(e){if(e<=255)return aJ[e];let t=0,n=$S.length-1;for(;t<=n;){const s=t+n>>1,o=$S[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const uJ=/[ \t\n\r\f]+/g,dJ=/[\t\n\r\f]| {2,}|^ | $/;let H0=null;const fJ=new RegExp("\\p{Script=Arabic}","u"),Nm=new RegExp("\\p{M}","u"),WM=new RegExp("\\p{Nd}","u");function LS(e){return fJ.test(e)}function FS(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 Ir(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(FS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(FS(n))return!0}}return!1}const hJ=new Set([" "," ","⁠","\uFEFF"]);function pJ(e){return Ir(e)}function Iv(e){return!(function(t){const n=wp(t);return n!==null&&(yk.has(n)||wa.has(n))})(e)&&!(function(t){const n=wp(t);return n!==null&&hJ.has(n)})(e)}const yk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Im=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),kk=new Set(["'","’"]),wa=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),mJ=new Set([":",".","،","؛"]),gJ=new Set(["၏"]),vJ=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function yJ(e){if(bk(e))return!0;let t=!1;for(const n of e)if(wa.has(n))t=!0;else if(!t||!Nm.test(n))return!1;return t}function kJ(e){for(const t of e)if(!yk.has(t)&&!wa.has(t))return!1;return e.length>0}function bJ(e){if(bk(e))return!0;for(const t of e)if(!Im.has(t)&&!kk.has(t)&&!Nm.test(t))return!1;return e.length>0}function bk(e){let t=!1;for(const n of e)if(n!=="\\"&&!Nm.test(n)){if(!(Im.has(n)||wa.has(n)||kk.has(n)))return!1;t=!0}return t}function zM(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 wp(e){if(e.length===0)return null;const t=zM(e,e.length);return e.slice(t)}function xJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Nm.test(s))n--;else{if(!Im.has(s)&&!kk.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function _J(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function OS(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 RS(e,t){return e&&t!==null&&mJ.has(t)}function wJ(e){const t=wp(e);return t!==null&&gJ.has(t)}function SJ(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 $v(e){let t=e.length;for(;t>0;){const n=zM(e,t),s=e.slice(n,t);if(vJ.has(s))return!0;if(!wa.has(s))return!1;t=n}return!1}function CJ(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
272
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const AJ=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ui(e){return e.length===1?e[0]:e.join("")}function MJ(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),ui(n)}function EJ(e,t,n,s){if(!AJ.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=CJ(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:ui(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:ui(r),isWordLike:a,kind:i,start:l}),o}function W0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const TJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function NJ(e,t){const n=e.texts[t];return!!n.startsWith("www.")||TJ.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function IJ(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const $J=new Set([":","-","/","×",",",".","+","–","—"]),BS=/^[A-Za-z0-9_]+[,:;]*$/,DS=/[,:;]+$/;function PS(e){for(const t of e)if(WM.test(t))return!0;return!1}function Ch(e){if(e.length===0)return!1;for(const t of e)if(!WM.test(t)&&!$J.has(t))return!1;return!0}function HS(e,t,n){var s,o,i;const r=(H0===null&&(H0=new Intl.Segmenter(void 0,{granularity:"word"})),H0);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],x=[],k=[],g=[],v=[];for(const _ of r.segment(e))for(const E of EJ(_.segment,(s=_.isWordLike)!=null&&s,_.index,n)){let N=function(){h[W]!==null&&(c[W]=[OS(a,h,p,W)],h[W]=null),c[W].push(E.text),u[W]=u[W]||E.isWordLike,m[W]=m[W]||I,x[W]=x[W]||R,k[W]=P,g[W]=z,v[W]=RS(x[W],B)};const F=E.kind==="text",S=_J(E.text,E.isWordLike,E.kind),I=Ir(E.text),R=LS(E.text),B=wp(E.text),P=$v(E.text),z=wJ(E.text),W=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[W]==="text"&&I&&m[W]&&k[W]||F&&l>0&&d[W]==="text"&&kJ(E.text)&&m[W]||F&&l>0&&d[W]==="text"&&g[W]?N():F&&l>0&&d[W]==="text"&&E.isWordLike&&R&&v[W]?(N(),u[W]=!0):S!==null&&l>0&&d[W]==="text"&&h[W]===S?p[W]=((o=p[W])!=null?o:1)+1:F&&!E.isWordLike&&l>0&&d[W]==="text"&&(yJ(E.text)||E.text==="-"&&u[W])?N():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,f[l]=E.start,h[l]=S,p[l]=S===null?0:1,m[l]=I,x[l]=R,k[l]=P,g[l]=z,v[l]=RS(R,B),l++)}for(let _=0;_<l;_++)h[_]===null?a[_]=ui(c[_]):a[_]=OS(a,h,p,_);for(let _=1;_<l;_++)d[_]==="text"&&!u[_]&&bk(a[_])&&d[_-1]==="text"&&(a[_-1]+=a[_],u[_-1]=u[_-1]||u[_],a[_]="");const y=Array.from({length:l},()=>null);let M=-1;for(let _=l-1;_>=0;_--){const E=a[_];if(E.length!==0){if(d[_]==="text"&&!u[_]&&bJ(E)&&M>=0&&d[M]==="text"){const N=(i=y[M])!=null?i:[];N.push(E),y[M]=N,f[M]=f[_],a[_]="";continue}M=_}}for(let _=0;_<l;_++){const E=y[_];E!=null&&(a[_]=MJ(E,a[_]))}let L=0;for(let _=0;_<l;_++){const E=a[_];E.length!==0&&(L!==_&&(a[L]=E,u[L]=u[_],d[L]=d[_],f[L]=f[_]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const $=(function(_){const E=_.texts.slice(),N=_.isWordLike.slice(),F=_.kinds.slice(),S=_.starts.slice();for(let I=0;I<E.length-1;I++){if(F[I]!=="text"||F[I+1]!=="text"||!Ir(E[I])||!Ir(E[I+1]))continue;const R=xJ(E[I]);R!==null&&(E[I]=R.head,E[I+1]=R.tail+E[I+1],S[I+1]=S[I]+R.head.length)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];for(let I=0;I<_.len;I++){const R=_.texts[I],B=_.kinds[I],P=_.isWordLike[I];if(B==="text"&&P&&BS.test(R)){const z=[R];let W=DS.test(R),ee=I+1;for(;W&&ee<_.len&&_.kinds[ee]==="text"&&_.isWordLike[ee]&&BS.test(_.texts[ee]);){const U=_.texts[ee];z.push(U),W=DS.test(U),ee++}E.push(ui(z)),N.push(!0),F.push("text"),S.push(_.starts[I]),I=ee-1;continue}E.push(R),N.push(P),F.push(B),S.push(_.starts[I])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];for(let I=0;I<_.len;I++){const R=_.texts[I];if(_.kinds[I]==="text"&&R.includes("-")){const B=R.split("-");let P=B.length>1;for(let z=0;z<B.length;z++){const W=B[z];if(!P)break;W.length!==0&&PS(W)&&Ch(W)||(P=!1)}if(P){let z=0;for(let W=0;W<B.length;W++){const ee=B[W],U=W<B.length-1?`${ee}-`:ee;E.push(U),N.push(!0),F.push("text"),S.push(_.starts[I]+z),z+=U.length}continue}}E.push(R),N.push(_.isWordLike[I]),F.push(_.kinds[I]),S.push(_.starts[I])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];for(let I=0;I<_.len;I++){const R=_.texts[I],B=_.kinds[I];if(B==="text"&&Ch(R)&&PS(R)){const P=[R];let z=I+1;for(;z<_.len&&_.kinds[z]==="text"&&Ch(_.texts[z]);)P.push(_.texts[z]),z++;E.push(ui(P)),N.push(!0),F.push("text"),S.push(_.starts[I]),I=z-1;continue}E.push(R),N.push(_.isWordLike[I]),F.push(B),S.push(_.starts[I])}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];for(let I=0;I<_.len;I++){const R=_.texts[I];if(E.push(R),N.push(_.isWordLike[I]),F.push(_.kinds[I]),S.push(_.starts[I]),!IJ(R))continue;const B=I+1;if(B>=_.len||W0(_.kinds[B]))continue;const P=[],z=_.starts[B];let W=B;for(;W<_.len&&!W0(_.kinds[W]);)P.push(_.texts[W]),W++;P.length>0&&(E.push(ui(P)),N.push(!0),F.push("text"),S.push(z),I=W-1)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=_.texts.slice(),N=_.isWordLike.slice(),F=_.kinds.slice(),S=_.starts.slice();for(let R=0;R<_.len;R++){if(F[R]!=="text"||!NJ(_,R))continue;const B=[E[R]];let P=R+1;for(;P<_.len&&!W0(F[P]);){B.push(E[P]),N[R]=!0;const z=E[P].includes("?");if(F[P]="text",E[P]="",P++,z)break}E[R]=ui(B)}let I=0;for(let R=0;R<E.length;R++){const B=E[R];B.length!==0&&(I!==R&&(E[I]=B,N[I]=N[R],F[I]=F[R],S[I]=S[R]),I++)}return E.length=I,N.length=I,F.length=I,S.length=I,{len:I,texts:E,isWordLike:N,kinds:F,starts:S}})((function(_){const E=[],N=[],F=[],S=[];let I=0;for(;I<_.len;){const R=[_.texts[I]];let B=_.isWordLike[I],P=_.kinds[I],z=_.starts[I];if(P==="glue"){const W=[R[0]],ee=z;for(I++;I<_.len&&_.kinds[I]==="glue";)W.push(_.texts[I]),I++;const U=ui(W);if(!(I<_.len&&_.kinds[I]==="text")){E.push(U),N.push(!1),F.push("glue"),S.push(ee);continue}R[0]=U,R.push(_.texts[I]),B=_.isWordLike[I],P="text",z=ee,I++}else I++;if(P==="text")for(;I<_.len&&_.kinds[I]==="glue";){const W=[];for(;I<_.len&&_.kinds[I]==="glue";)W.push(_.texts[I]),I++;const ee=ui(W);I<_.len&&_.kinds[I]==="text"?(R.push(ee,_.texts[I]),B=B||_.isWordLike[I],I++):R.push(ee)}E.push(ui(R)),N.push(B),F.push(P),S.push(z)}return{len:E.length,texts:E,isWordLike:N,kinds:F,starts:S}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let _=0;_<$.len-1;_++){const E=SJ($.texts[_]);E!==null&&($.kinds[_]!=="space"&&$.kinds[_]!=="preserved-space"||$.kinds[_+1]!=="text"||!LS($.texts[_+1])||($.texts[_]=E.space,$.isWordLike[_]=!1,$.kinds[_]=$.kinds[_]==="preserved-space"?"preserved-space":"space",$.texts[_+1]=E.marks+$.texts[_+1],$.starts[_+1]=$.starts[_]+E.space.length))}return $}function LJ(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 Ja=null;const WS=new Map;let ec=null;const FJ=new RegExp("\\p{Emoji_Presentation}","u"),OJ=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let z0=null;const zS=new Map;function Lv(){if(Ja!==null)return Ja;if(typeof OffscreenCanvas<"u")return Ja=new OffscreenCanvas(1,1).getContext("2d"),Ja;if(typeof document<"u")return Ja=document.createElement("canvas").getContext("2d"),Ja;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function ol(e,t){let n=t.get(e);return n===void 0&&(n={width:Lv().measureText(e).width,containsCJK:Ir(e)},t.set(e,n)),n}function $m(){if(ec!==null)return ec;if(typeof navigator>"u")return ec={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ec;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 ec={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ec}function UM(){return z0===null&&(z0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),z0}function RJ(e){return FJ.test(e)||e.includes("️")}function sa(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=UM();for(const a of l.segment(i))RJ(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function BJ(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 DJ(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function US(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+$m().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(y=u,M=d,L=a){l++,a=0,c=!1,f=-1,h=0}function m(y,M){c=!0,u=y+1,d=0,a=M}function x(y,M,L){c=!0,u=y,d=M+1,a=L}function k(y,M){c?(a+=M,u=y+1,d=0):m(y,M)}function g(y,M){const L=i[y];for(let $=M;$<L.length;$++){const _=L[$];c?a+_>r?(p(),x(y,$,_)):(a+=_,u=y,d=$+1):x(y,$,_)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=BJ(e,v),!(v>=s.length)));){const y=s[v],M=o[v],L=M==="space"||M==="preserved-space"||M==="tab"||M==="zero-width-break"||M==="soft-hyphen";if(c)if(a+y>r){if(L){k(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 k(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 U0=null;function PJ(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=$v(d),l=Im.has(d)}function u(d,f){s.push(d),i=i||f;const h=$v(d);r=d.length===1&&wa.has(d)&&r||h,l=!1}for(const d of(U0===null&&(U0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),U0).segment(e)){const f=d.segment,h=Ir(f);s.length!==0?l||yk.has(f)||wa.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 HJ(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Ir(e[0].text),i=Iv(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=Ir(a.text),u=Iv(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 WJ(e,t,n,s){const o=$m(),{cache:i,emojiCorrection:r}=(function($,_){Lv().font=$;const E=(function(S){let I=WS.get(S);return I||(I=new Map,WS.set(S,I)),I})($),N=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})($),F=_?(function(S,I){let R=zS.get(S);if(R!==void 0)return R;const B=Lv();B.font=S;const P=B.measureText("😀").width;if(R=0,P>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const W=z.getBoundingClientRect().width;document.body.removeChild(z),P-W>.5&&(R=P-W)}return zS.set(S,R),R})($,N):0;return{cache:E,fontSize:N,emojiCorrection:F}})(t,(l=e.normalized,OJ.test(l)));var l;const a=sa("-",ol("-",i),r),c=8*sa(" ",ol(" ",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,x=[],k=n?[]:null,g=Array.from({length:e.len});function v($,_,E,N,F,S,I){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(_),d.push(E),f.push(N),h.push(F),x.push(I),k!==null&&k.push($)}function y($,_,E,N,F){const S=ol($,i),I=sa($,S,r),R=_==="space"||_==="preserved-space"||_==="zero-width-break"?0:I,B=_==="space"||_==="zero-width-break"?0:I;if(F&&N&&$.length>1){let P="sum-graphemes";Ch($)?P="pair-context":o.preferPrefixWidthsForBreakableRuns&&(P="segment-prefixes");const z=(function(W,ee,U,Z,ce){if(ee.breakableFitAdvances!==void 0)return ee.breakableFitAdvances;const fe=UM(),oe=[];for(const He of fe.segment(W))oe.push(He.segment);if(oe.length<=1)return ee.breakableFitAdvances=null,ee.breakableFitAdvances;if(ce==="sum-graphemes"){const He=[];for(const de of oe){const G=ol(de,U);He.push(sa(de,G,Z))}return ee.breakableFitAdvances=He,ee.breakableFitAdvances}if(ce==="pair-context"||oe.length>96){const He=[];let de=null,G=0;for(const ae of oe){const me=sa(ae,ol(ae,U),Z);if(de===null)He.push(me);else{const q=de+ae,ne=ol(q,U);He.push(sa(q,ne,Z)-G)}de=ae,G=me}return ee.breakableFitAdvances=He,ee.breakableFitAdvances}const Y=[];let X="",le=0;for(const He of oe){X+=He;const de=sa(X,ol(X,U),Z);Y.push(de-le),le=de}return ee.breakableFitAdvances=Y,ee.breakableFitAdvances})($,S,i,r,P);return void v($,I,R,B,_,E,z)}v($,I,R,B,_,E,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const _=e.texts[$],E=e.isWordLike[$],N=e.kinds[$],F=e.starts[$];if(N==="soft-hyphen"){v(_,0,a,a,N,F,null);continue}if(N==="hard-break"){v(_,0,0,0,N,F,null);continue}if(N==="tab"){v(_,0,0,0,N,F,null);continue}const S=ol(_,i);if(N==="text"&&S.containsCJK){const I=PJ(_,o),R=s==="keep-all"?HJ(I):I;for(let B=0;B<R.length;B++){const P=R[B];y(P.text,"text",F+P.start,E,s==="keep-all"||!Ir(P.text))}continue}y(_,N,F,E,!0)}const M=(function($,_,E){const N=[];for(let F=0;F<$.length;F++){const S=$[F],I=S.startSegmentIndex<_.length?_[S.startSegmentIndex]:E,R=S.endSegmentIndex<_.length?_[S.endSegmentIndex]:E,B=S.consumedEndSegmentIndex<_.length?_[S.consumedEndSegmentIndex]:E;N.push({startSegmentIndex:I,endSegmentIndex:R,consumedEndSegmentIndex:B})}return N})(e.chunks,g,u.length),L=m===null?null:(function($,_){const E=(function(F){const S=F.length;if(S===0)return null;const I=new Array(S);let R=!1;for(let U=0;U<S;){const Z=F.charCodeAt(U);let ce=Z,fe=1;if(Z>=55296&&Z<=56319&&U+1<S){const Y=F.charCodeAt(U+1);Y>=56320&&Y<=57343&&(ce=Y-56320+(Z-55296<<10)+65536,fe=2)}const oe=cJ(ce);oe!=="R"&&oe!=="AL"&&oe!=="AN"||(R=!0);for(let Y=0;Y<fe;Y++)I[U+Y]=oe;U+=fe}if(!R)return null;let B=0;for(let U=0;U<S;U++){const Z=I[U];if(Z==="L"){B=0;break}if(Z==="R"||Z==="AL"){B=1;break}}const P=new Int8Array(S);for(let U=0;U<S;U++)P[U]=B;const z=1&B?"R":"L",W=z;let ee=W;for(let U=0;U<S;U++)I[U]==="NSM"?I[U]=ee:ee=I[U];ee=W;for(let U=0;U<S;U++){const Z=I[U];Z==="EN"?I[U]=ee==="AL"?"AN":"EN":Z!=="R"&&Z!=="L"&&Z!=="AL"||(ee=Z)}for(let U=0;U<S;U++)I[U]==="AL"&&(I[U]="R");for(let U=1;U<S-1;U++)I[U]==="ES"&&I[U-1]==="EN"&&I[U+1]==="EN"&&(I[U]="EN"),I[U]!=="CS"||I[U-1]!=="EN"&&I[U-1]!=="AN"||I[U+1]!==I[U-1]||(I[U]=I[U-1]);for(let U=0;U<S;U++){if(I[U]!=="EN")continue;let Z;for(Z=U-1;Z>=0&&I[Z]==="ET";Z--)I[Z]="EN";for(Z=U+1;Z<S&&I[Z]==="ET";Z++)I[Z]="EN"}for(let U=0;U<S;U++){const Z=I[U];Z!=="WS"&&Z!=="ES"&&Z!=="ET"&&Z!=="CS"||(I[U]="ON")}ee=W;for(let U=0;U<S;U++){const Z=I[U];Z==="EN"?I[U]=ee==="L"?"L":"EN":Z!=="R"&&Z!=="L"||(ee=Z)}for(let U=0;U<S;U++){if(I[U]!=="ON")continue;let Z=U+1;for(;Z<S&&I[Z]==="ON";)Z++;const ce=(U>0?I[U-1]:W)!=="L"?"R":"L";if(ce===((Z<S?I[Z]:W)!=="L"?"R":"L"))for(let fe=U;fe<Z;fe++)I[fe]=ce;U=Z-1}for(let U=0;U<S;U++)I[U]==="ON"&&(I[U]=z);for(let U=0;U<S;U++){const Z=I[U];1&P[U]?Z!=="L"&&Z!=="AN"&&Z!=="EN"||P[U]++:Z==="R"?P[U]++:Z!=="AN"&&Z!=="EN"||(P[U]+=2)}return P})($);if(E===null)return null;const N=new Int8Array(_.length);for(let F=0;F<_.length;F++)N[F]=E[_[F]];return N})(e.normalized,m);return k!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:x,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:M,segments:k}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:x,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:M}}function zJ(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return WJ((function(c,u,d="normal",f="normal"){const h=(function(x){const k=x??"normal";return k==="pre-wrap"?{mode:k,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:k,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(x){return/[\r\f]/.test(x)?x.replace(/\r\n/g,`
273
+ `).replace(/[\r\f]/g,`
274
+ `):x.replace(/\r\n/g,`
275
+ `)})(c):(function(x){if(!dJ.test(x))return x;let k=x.replace(uJ," ");return k.charCodeAt(0)===32&&(k=k.slice(1)),k.length>0&&k.charCodeAt(k.length-1)===32&&(k=k.slice(0,-1)),k})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(x){if(x.len<=1)return x;const k=[],g=[],v=[],y=[];let M=null,L=!1,$=0,_=!1,E=!1;function N(){M!==null&&(k.push(ui(M)),g.push(L),v.push("text"),y.push($),M=null)}for(let F=0;F<x.len;F++){const S=x.texts[F],I=x.kinds[F],R=x.isWordLike[F],B=x.starts[F];if(I==="text"){const P=pJ(S),z=Iv(S);if(M!==null&&_&&E){M.push(S),L=L||R,_=_||P,E=z;continue}N(),M=[S],L=R,$=B,_=P,E=z;continue}N(),k.push(S),g.push(R),v.push(I),y.push(B)}return N(),{len:k.length,texts:k,isWordLike:g,kinds:v,starts:y}})(HS(p,u,h)):HS(p,u,h);return lt({normalized:p,chunks:LJ(m,h)},m)})(s,$m(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const q0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Is=(()=>{const e=globalThis;if(e[q0])return e[q0];const t={configs:{},controllers:{},revision:Ta(0),preparedCache:new Map,blockEstimateCache:new Map};return e[q0]=t,t})();let Iu=null;const qS=Is.revision;function jS(e){var t;return e&&(t=Is.configs[e])!=null?t:null}function VS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function UJ(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function j0(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!UJ(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+=`
276
+ `)}return o.length>0?o:null}function V0(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Iu!=null)return Iu;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Iu=!!((i=r.getContext)!=null&&i.call(r,"2d")),Iu}catch{return Iu=!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=Is.blockEstimateCache.get(r);if(l)return Is.blockEstimateCache.delete(r),Is.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 x=`${m}\0${p}\0${h}`,k=Is.preparedCache.get(x);if(k)return Is.preparedCache.delete(x),Is.preparedCache.set(x,k),k.prepared;const g=zJ(h,p,{whiteSpace:m});for(Is.preparedCache.set(x,{prepared:g});Is.preparedCache.size>240;){const v=Is.preparedCache.keys().next().value;if(!v)break;Is.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const x=(function(k,g){return k.simpleLineWalkFastPath?US(k,g):(function(v,y){if(v.simpleLineWalkFastPath)return US(v,y);const{widths:M,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:_,breakableFitAdvances:E,discretionaryHyphenWidth:N,tabStopAdvance:F,chunks:S}=v;if(M.length===0||S.length===0)return 0;const I=$m(),R=I.lineFitEpsilon,B=y+R;let P=0,z=0,W=!1,ee=0,U=0,Z=-1,ce=0,fe=0,oe=null;function Y(){Z=-1,ce=0,fe=0,oe=null}function X(ne=ee,ge=U,ue=z){P++,z=0,W=!1,Y()}function le(ne,ge){W=!0,ee=ne+1,U=0,z=ge}function He(ne,ge,ue){W=!0,ee=ne,U=ge+1,z=ue}function de(ne,ge){W?(z+=ge,ee=ne+1,U=0):le(ne,ge)}function G(ne,ge,ue,ye){if(!ge)return;const j=ne==="tab"?0:L[ue],te=ne==="tab"?ye:$[ue];Z=ue+1,ce=z-ye+j,fe=z-ye+te,oe=ne}function ae(ne,ge){const ue=E[ne];for(let ye=ge;ye<ue.length;ye++){const j=ue[ye];W?z+j>B?(X(),He(ne,ye,j)):(z+=j,ee=ne,U=ye+1):He(ne,ye,j)}W&&ee===ne&&U===ue.length&&(ee=ne+1,U=0)}function me(ne){if(oe!=="soft-hyphen")return!1;const ge=E[ne];if(ge==null)return!1;const{fitCount:ue,fittedWidth:ye}=(function(j,te,pe,Se,Ie){let Fe=0,he=te;for(;Fe<j.length;){const Ne=he+j[Fe];if((Fe+1<j.length?Ne+Ie:Ne)>pe+Se)break;he=Ne,Fe++}return{fitCount:Fe,fittedWidth:he}})(ge,z,y,R,N);return ue!==0&&(z=ye,ee=ne,U=ue,Y(),ue===ge.length?(ee=ne+1,U=0,!0):(X(ne,ue,ye+N),ae(ne,ue),!0))}function q(ne){P++,Y()}for(let ne=0;ne<S.length;ne++){const ge=S[ne];if(ge.startSegmentIndex===ge.endSegmentIndex){q();continue}W=!1,z=0,ge.startSegmentIndex,ee=ge.startSegmentIndex,U=0,Y();let ue=ge.startSegmentIndex;for(;ue<ge.endSegmentIndex;){const ye=_[ue],j=ye==="space"||ye==="preserved-space"||ye==="tab"||ye==="zero-width-break"||ye==="soft-hyphen",te=ye==="tab"?DJ(z,F):M[ue];if(ye!=="soft-hyphen")if(W){if(z+te>B){const pe=z+(ye==="tab"?0:L[ue]),Se=z+(ye==="tab"?te:$[ue]);if(oe==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&ce<=B){X(Z,0,fe);continue}if(oe==="soft-hyphen"&&me(ue)){ue++;continue}if(j&&pe<=B){de(ue,te),X(ue+1,0,Se),ue++;continue}if(Z>=0&&ce<=B){if(ee>Z||ee===Z&&U>0){X();continue}const Ie=Z;X(Ie,0,fe),ue=Ie;continue}if(te>y&&E[ue]!==null){X(),ae(ue,0),ue++;continue}X();continue}de(ue,te),G(ye,j,ue,te),ue++}else te>y&&E[ue]!==null?ae(ue,0):le(ue,te),G(ye,j,ue,te),ue++;else W&&(ee=ue+1,U=0,Z=ue+1,ce=z+N,fe=z+N,oe=ye),ue++}if(W){const ye=Z===ge.consumedEndSegmentIndex?fe:z;X(ge.consumedEndSegmentIndex,0,ye)}}return P})(k,g)})(h,p);return{lineCount:x,height:x*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(Is.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Is.blockEstimateCache.size>4e3;){const h=Is.blockEstimateCache.keys().next().value;if(!h)break;Is.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function qM(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=j0(e.children);return i&&n.paragraph?V0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=j0(e.children),l=n.headings[i];return r&&l?V0(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=j0((o=i[0])==null?void 0:o.children);return r?V0(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=qM(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 Gf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function qJ(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(Gf(String((d=u.originalCode)!=null?d:"")),Gf(String((f=u.updatedCode)!=null?f:"")),Gf(String((h=u.code)!=null?h:""))):Gf((function(p,m){const x=String(p??"");return m?x:x.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,x;if(!p)return 0;const k=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((x=h?.padding)==null?void 0:x.bottom)=="number"?h.padding.bottom:22;return Math.max(0,k)+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 jJ(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function K0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=VS(s.lineHeight,1.5*VS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:jJ(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const VJ=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function KS(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))VJ.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const KJ=!1;function $_e(){return KJ}function GS(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 jM=Symbol("MarkstreamMathBlockMinHeightCache");function L_e(){return Vt(jM,null)}const GJ=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],YJ=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],ZJ=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),VM=["raw","content","code","originalCode","updatedCode"],YS=new WeakMap,ZS=new WeakMap;let QJ=1;function Ei(){return typeof performance<"u"?performance.now():Date.now()}function QS(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function mi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=YS.get(t);return n||(n=QJ++,YS.set(t,n)),String(n)}function XS(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:mi(t),customMarkdownIt:mi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:mi(e.validateLink),preTransformTokens:mi(e.preTransformTokens),postTransformTokens:mi(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function JS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
277
+ `,t-1)+1;return e.slice(n,t).trim()}function eC(e){const t=KM(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function KM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function GM(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 xk(e){const t=String(e??"");return`${t.length}:${GM(t)}`}function Fv(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?xk(r):`${r.length}:${GM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${mi(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:${mi(s)}`;const i=mi(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Fv(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}:${Fv(r[c],t,n+1)}`).join(";")}`}return typeof e}function Sp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function YM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Sp(s)?Ll(s,t,n+1):YM(s,t,n+1)).join(",")}`:Sp(e)?Ll(e,t,n):Fv(e,t,n)}function XJ(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!VM.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${xk(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${mi(o)}`:ZJ.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${YM(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${mi(o)}`:""}).filter(Boolean).join(";")}function JJ(e){return VM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${xk(n)}`:""}).filter(Boolean).join(";")}function Ll(e,t=new WeakMap,n=0){const s=ZS.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}:${mi(o)}`;const r=mi(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=>Ll(p,c,u+1)).join("|"):"";return[a.type,JJ(d),XJ(d,c,u),f.length,h].join(":")})(e,t,n);return ZS.set(o,l),l}function ZM(e,t){return Ll(e)===Ll(t)}function _k(e,t,n){const s=Ei(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ei()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function tC(e,t,n){return _k(t,n,()=>Ll(e))}function QM(e,t,n){return tC(e,n,"stabilizeSignatureMs")===tC(t,n,"stabilizeSignatureMs")}function G0(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function nC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function eee(e,t){return e.length===t.length&&e===t}function wk(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"||!eee(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(!Sp(d)||!Sp(f))return null;const h=wk(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function tee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=wk(e,t);return n??ZM(e,t)}function nee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return _k(n,"stabilizeSignatureMs",()=>{s=wk(e,t)}),s??QM(e,t,n)}function see(e,t){const n={};for(const s of GJ){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function oee(e,t){var n;const s=rS(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=Q(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ei();function m(){l&&(clearTimeout(l),l=void 0)}function x(){m();const E=t.renderContent.value;r.value!==E&&(r.value=E),p=Ei()}Qe([t.renderContent,t.effectiveFinal,i],([E,N,F])=>{r.value!==E&&(!F||N||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const R=I.slice(S.length);return!!R&&(!!eC(JS(I))||!(!R.includes(`
278
+
279
+ `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
280
+ `)&&!(function(B){const P=JS(B);if(eC(P))return!1;const z=KM(P);return z.length>=2&&z.some(W=>W.trim())})(I))})(r.value,E)?x():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const R=I.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(Ei()-p));S<=0?x():l=setTimeout(x,S)})())},{flush:"sync",immediate:!0}),iy(m);const k=D(()=>{var E,N,F,S;return wV(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(F=(N=t.customComponentsMap)==null?void 0:N.value)!=null?F:{},Object.entries(S).map(([I,R])=>{const B=xi(I);return R==null||!B||Kd(B)||S6.has(B)||qd.has(B)?"":B}).filter(Boolean)))}),g=D(()=>{const{key:E,tags:N}=SV(k.value);if(!E)return s;const F=o.get(E);if(F)return F;const S=rS(t.instanceMsgId,{customHtmlTags:N});return o.set(E,S),S}),v=D(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=D(()=>{var E,N;const F=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,I=k.value,R=S!=null,B=I.length>0;return R||B||F.streamParse==null?lt(lt(Pt(lt({},F),{streamParse:(N=F.streamParse)==null||N}),R?{final:S}:{}),B?{customHtmlTags:I}:{}):F}),M=D(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(N=>String(N).trim().toLowerCase()).filter(Boolean))}),L=D(()=>XS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=D(()=>XS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Qe([L,$],([E,N],[F,S])=>{F&&(E===F&&N===S||(x(),N!==S&&(a=[],d="")))},{flush:"sync"});const _=D(()=>{var E,N,F,S,I,R,B,P;if((E=e.nodes)!=null&&E.length)return a=[],d="",mt(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const W=t.debugPerformanceEnabled.value,ee=W?Ei():0,U=v.value,Z=L.value,ce=$.value;c&&Z!==c&&(function(ge){var ue,ye;(ye=(ue=ge.stream)==null?void 0:ue.reset)==null||ye.call(ue)})(U),u&&ce!==u&&(a=[],d="");const fe=a.length>0&&z.startsWith(d)&&ce===u,oe=W?QS(U):null,Y=W?{}:void 0,X=Y?Pt(lt({},y.value),{__timing:Y}):y.value,le=fM(z,U,X),He=W?Ei():0,de=W?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let G,ae=W?G0(le.length):void 0,me=0,q=0;if(fe){const ge=W?Ei():0;if(de){const ue=(function(ye,j,te){if(!j.length)return{nodes:ye,metrics:G0(ye.length)};const pe=(function(Fe,he,Ne){const Je=Math.min(Fe.length,he.length);for(let it=0;it<Je;it++)if(!nee(he[it],Fe[it],Ne))return it;return Fe.length===he.length?-1:Je})(ye,j,te);if(pe<0)return{nodes:j,metrics:{reusedNodeCount:ye.length,dirtyStartIndex:pe,stablePrefixNodeCount:ye.length,dirtyTailNodeCount:0}};const Se=ye.slice();let Ie=pe;for(let Fe=0;Fe<pe;Fe++)Se[Fe]=j[Fe];for(let Fe=pe;Fe<ye.length;Fe++){const he=j[Fe],Ne=ye[Fe];he&&QM(he,Ne,te)&&(Se[Fe]=he,Ie+=1)}return{nodes:Se,metrics:{reusedNodeCount:Ie,dirtyStartIndex:pe,stablePrefixNodeCount:pe,dirtyTailNodeCount:nC(pe,ye,j)}}})(le,a,de);G=ue.nodes,ae=ue.metrics}else{const ue=(function(ye,j){if(!j.length)return{nodes:ye,metrics:G0(ye.length)};const te=(function(Ie,Fe){const he=Math.min(Ie.length,Fe.length);for(let Ne=0;Ne<he;Ne++)if(!tee(Fe[Ne],Ie[Ne]))return Ne;return Ie.length===Fe.length?-1:he})(ye,j);if(te<0)return{nodes:j,metrics:{reusedNodeCount:ye.length,dirtyStartIndex:te,stablePrefixNodeCount:ye.length,dirtyTailNodeCount:0}};const pe=ye.slice();let Se=te;for(let Ie=0;Ie<te;Ie++)pe[Ie]=j[Ie];for(let Ie=te;Ie<ye.length;Ie++){const Fe=j[Ie],he=ye[Ie];Fe&&ZM(Fe,he)&&(pe[Ie]=Fe,Se+=1)}return{nodes:pe,metrics:{reusedNodeCount:Se,dirtyStartIndex:te,stablePrefixNodeCount:te,dirtyTailNodeCount:nC(te,ye,j)}}})(le,a);G=ue.nodes,ae=ue.metrics}me=W?Ei()-ge:0,q=ae?.dirtyStartIndex==null||ae.dirtyStartIndex<0?G.length:ae.dirtyStartIndex}else G=le;de?(function(ge,ue,ye=0){for(let j=Math.max(0,ye);j<ge.length;j++)_k(ue,"primeSignatureMs",()=>Ll(ge[j]))})(G,de,q):(function(ge,ue=0){for(let ye=Math.max(0,ue);ye<ge.length;ye++)Ll(ge[ye])})(G,q);const ne=W?Ei()-He:0;if(f+=1,d=z,c=Z,u=ce,a=G,W){const ge=QS(U),ue=typeof ge?.total=="number"&&ge.total>((N=oe?.total)!=null?N:0);t.logPerf(ue?"parse(stream)":"parse(sync)",lt(lt(lt({rendererId:t.instanceMsgId,ms:Math.round(Ei()-ee),nodes:G.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:ne,signatureMs:(F=de?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=de?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=de?.primeSignatureMs)!=null?I:0,signatureCallCount:(R=de?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(B=de?.stabilizeSignatureCallCount)!=null?B:0,primeSignatureCallCount:(P=de?.primeSignatureCallCount)!=null?P:0,stabilizeMs:me},ae??{}),Y?Object.fromEntries(YJ.map(ye=>{var j;return[ye,(j=Y[ye])!=null?j:0]})):{}),ge?{streamMode:ge.lastMode,streamDelta:see(ge,oe),streamStats:ge}:{}))}return mt(G)});return{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:M,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:_}}function iee(e){const{isClient:t}=e,n=Q(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 x=n.value,k=x.has(f);if(h){if(k)return;const v=new Set(x);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(x);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 ree(e={}){const t=Q(""),n=Q(""),s=Q(!1),o=lQ(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=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),c=D(()=>s.value&&a.value);return oy()&&iy(()=>{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 sC=/auto|scroll|overlay/i;function lee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return sC.test(t)||sC.test(n)}function aee(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 cee=Ye({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,s;return bv((s=xc(e.estimatedPreviewHeightPx))!=null?s:yv(String((n=e.node.code)!=null?n:"")))});return()=>vn("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?vn("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)"}},[vn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[vn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),vn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),vn("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},()=>vn("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,vn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[vn("div",{class:"absolute inset-0"},[vn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),uee=Ye({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,s;return kv((s=xc(e.estimatedPreviewHeightPx))!=null?s:vv(String((n=e.node.code)!=null?n:"")))});return()=>vn("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?vn("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)"}},[vn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[vn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),vn("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},()=>vn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[vn("span",{class:"action-icon block"})])))]):null,vn("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)"}},[vn("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"}})])])}}),dee=["data-custom-id"],fee={class:"m-0 p-0"},hee=["data-probe"],pee=["data-node-index","data-node-type"],XM=kn(Ye(Pt(lt({},{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=Ys(),r=Vt("markstreamNestedRendererProps",void 0);function l(A){var H,V;const K=s[A];return(function(se){const _e=i?.vnode.props;return!!_e&&(Object.prototype.hasOwnProperty.call(_e,se)||Object.prototype.hasOwnProperty.call(_e,String(se).replace(/[A-Z]/g,Ee=>`-${Ee.toLowerCase()}`)))})(A)?K:(V=(H=r?.value)==null?void 0:H[A])!=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=D(()=>{return(A=l("mode"))==="chat"||A==="minimal"||A==="docs"?A:"docs";var A}),u=D(()=>{const A=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return A===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:A===!1||c.value==="docs"?"monaco":"pre"}),d=D(()=>a[c.value]),f=D(()=>{var A;return(A=l("showTooltips"))!=null?A:d.value.showTooltips}),h=D(()=>{var A;return(A=l("fade"))!=null?A:d.value.fade}),p=D(()=>{var A;return(A=l("batchRendering"))!=null?A:d.value.batchRendering}),m=D(()=>{var A;return(A=l("initialRenderBatchSize"))!=null?A:d.value.initialRenderBatchSize}),x=D(()=>{var A;return(A=l("renderBatchSize"))!=null?A:d.value.renderBatchSize}),k=D(()=>{var A;return(A=l("renderBatchDelay"))!=null?A:d.value.renderBatchDelay}),g=D(()=>{var A;return(A=l("renderBatchBudgetMs"))!=null?A:d.value.renderBatchBudgetMs}),v=D(()=>{var A;return(A=l("renderBatchIdleTimeoutMs"))!=null?A:d.value.renderBatchIdleTimeoutMs}),y=D(()=>{var A;return(A=l("deferNodesUntilVisible"))!=null?A:d.value.deferNodesUntilVisible}),M=D(()=>{var A;return(A=l("maxLiveNodes"))!=null?A:d.value.maxLiveNodes}),L=D(()=>{var A;return(A=l("liveNodeBuffer"))!=null?A:d.value.liveNodeBuffer}),$=D(()=>{var A;return(A=l("nodeVirtual"))!=null?A:d.value.nodeVirtual}),_={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 x.value},get renderBatchDelay(){return k.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return M.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function E(A){o("height-change",A)}function N(A){o("virtual-state-change",A)}function F(A){o("anchor-change",A)}const S=Q(),I=Q(null),R=Q(null),B=Q(null),P=Ps({1:null,2:null,3:null,4:null,5:null,6:null}),z=Q(!1),W=new Map,ee=Q(0),U=Q(0),Z=Q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ce(){var A,H;if(((A=s.virtualScroll)==null?void 0:A.enabled)!==!0)return null;const V=(H=s.virtualScroll)==null?void 0:H.scrollRoot;return fe(typeof V=="function"?V():V)}function fe(A){return A?typeof HTMLElement<"u"&&A instanceof HTMLElement?A:typeof A=="object"&&"value"in A?fe(A.value):typeof A=="object"&&"$el"in A?fe(A.$el):null:null}const{isClient:oe,renderAsFragment:Y,debugPerformanceEnabled:X,resolvedShowTooltips:le,resolvedHtmlPolicy:He,inheritedSmoothStreaming:de,ownsTypewriterCursor:G}=(function(A){const H=typeof window<"u",V=Pd(),K=Vt("markstreamHtmlPolicy",void 0),se=Vt("markstreamTypewriterCursor",void 0),_e=Vt("markstreamSmoothStreaming",void 0),Ee=D(()=>A.renderAsFragment===!0),Te=D(()=>!!(A.debugPerformance&&H&&typeof console<"u")),We=D(()=>{var ze;if(typeof A.showTooltips=="boolean")return A.showTooltips;const Oe=(ze=V.showTooltips)!=null?ze:V["show-tooltips"];return Oe===""||Oe===!0||Oe==="true"||Oe!==!1&&Oe!=="false"&&void 0}),Le=D(()=>{var ze,Oe;return(Oe=(ze=A.htmlPolicy)!=null?ze:K?.value)!=null?Oe:"safe"}),Ve=D(()=>se?.value!==!0);return{isClient:H,renderAsFragment:Ee,debugPerformanceEnabled:Te,resolvedShowTooltips:We,resolvedHtmlPolicy:Le,inheritedSmoothStreaming:_e,inheritedTypewriterCursor:se,ownsTypewriterCursor:Ve}})(_),{resolveViewportRoot:ae,resolveScrollContainer:me,isReverseFlexScrollRoot:q,getNormalizedScrollTop:ne,getOffsetTopWithinRoot:ge}=(function(A,H){function V(){var Te,We;return(We=(Te=H.scrollRoot)==null?void 0:Te.call(H))!=null?We:null}function K(Te){if(typeof window>"u")return null;const We=V();if(We)return We;const Le=Te??A.value;if(!Le)return null;const Ve=Le.ownerDocument||document,ze=Ve.scrollingElement||Ve.documentElement;let Oe=Le;for(;Oe&&Oe!==Ve.body&&Oe!==ze;){if(lee(window.getComputedStyle(Oe))&&aee(Oe))return Oe;Oe=Oe.parentElement}return null}function se(Te){if(!H.isClient)return!1;try{const We=window.getComputedStyle(Te);return!!(We.display||"").toLowerCase().includes("flex")&&(We.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function _e(Te,We,Le){var Ve,ze;if(Le)return Ee(We);const Oe=Te.scrollTop;if(!se(Te))return Oe;const qe=Oe<0?-Oe:Oe;return Math.max(0,((Ve=Te.scrollHeight)!=null?Ve:0)-((ze=Te.clientHeight)!=null?ze:0))-qe}function Ee(Te){var We,Le,Ve,ze,Oe;const qe=Number((We=Te.scrollingElement)==null?void 0:We.scrollTop),et=Number((Ve=(Le=Te.documentElement)==null?void 0:Le.scrollTop)!=null?Ve:0),tt=Number((Oe=(ze=Te.body)==null?void 0:ze.scrollTop)!=null?Oe:0);return Math.max(0,Number.isFinite(qe)?qe:0,Number.isFinite(et)?et:0,Number.isFinite(tt)?tt:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(Te){var We,Le,Ve,ze;const Oe=V();if(Oe)return Oe;const qe=K((We=Te??A.value)!=null?We:null);if(qe)return qe;const et=(ze=(Ve=Te?.ownerDocument)!=null?Ve:(Le=A.value)==null?void 0:Le.ownerDocument)!=null?ze:typeof document<"u"?document:null;return et?.scrollingElement||et?.documentElement||null},isReverseFlexScrollRoot:se,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:function(Te,We){const Le=We.ownerDocument||Te.ownerDocument||document;if((function(qe,et){return qe===et.documentElement||qe===et.body||qe===et.scrollingElement})(We,Le))return Te.getBoundingClientRect().top+Ee(Le);const Ve=We.getBoundingClientRect(),ze=Te.getBoundingClientRect(),Oe=_e(We,Le,!1);return ze.top-Ve.top+Oe}}})(S,{isClient:oe,scrollRoot:ce});In("markstreamShowTooltips",le),In("markstreamHtmlPolicy",He),In("markstreamTypewriter",D(()=>_.typewriter!==!1)),In("markstreamFade",D(()=>_.fade!==!1)),In("markstreamTypewriterCursor",D(()=>!0)),In("markstreamTextStreamState",W),In("markstreamStreamVersion",ee),In("markstreamParseOptions",D(()=>_.parseOptions)),In("markstreamCustomMarkdownIt",D(()=>_.customMarkdownIt));const{smoothStreamingEnabled:ue,renderContent:ye,effectiveFinal:j}=(function(A,H){const V=ree(A.smoothStreamingOptions),K=D(()=>{var Le,Ve,ze;return A.smoothStreaming!==!1&&!((Le=A.nodes)!=null&&Le.length)&&(A.smoothStreaming===!0||!((Ve=H.inheritedSmoothStreaming)!=null&&Ve.value))&&(A.smoothStreaming===!0||A.typewriter===!0||((ze=A.maxLiveNodes)!=null?ze:0)<=0)}),se=Q(!H.isClient||A.smoothStreaming===!0);yn(()=>{se.value=!0});const _e=D(()=>se.value&&K.value),Ee=D(()=>{var Le;return _e.value?V.visible.value:(Le=A.content)!=null?Le:""}),Te=D(()=>{var Le,Ve;const ze=(Le=A.parseOptions)!=null?Le:{};return(Ve=A.final)!=null?Ve:ze.final}),We=D(()=>{const Le=Te.value;return _e.value&&Le!=null?!!Le&&V.caughtUp.value:Le});return Qe([()=>A.content,()=>A.nodes,_e,Te],([Le,Ve,ze,Oe])=>{if(Ve?.length)return void V.reset("");const qe=Le??"";if(!ze)return V.reset(qe),void(Oe&&V.finish({flush:!0}));const et=V.source.value;qe?qe===et||(qe.startsWith(et)?V.enqueue(qe.slice(et.length)):V.reset(qe)):V.reset(""),Oe&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:_e,renderContent:Ee,requestedFinal:Te,effectiveFinal:We}})(_,{isClient:oe,inheritedSmoothStreaming:de});In("markstreamSmoothStreaming",ue);const te=Q(!1);let pe="",Se=!1,Ie=null;function Fe(){oe&&Ie!=null&&(window.clearTimeout(Ie),Ie=null)}function he(){te.value=!1,Fe()}function Ne(A,H){if(!X.value)return;const V=(function(){if(!X.value)return null;const K=wt(Je),se=wt(it),_e=Math.max(xt,se);if(K<=0&&_e<=0)return null;const Ee={total:K,maxPerFrame:_e,byLabel:(Te=Je,Object.fromEntries(Array.from(Te.entries()).sort((We,Le)=>Le[1]-We[1]||We[0].localeCompare(Le[0]))))};var Te;return Je.clear(),it.clear(),xt=0,Ee})();console.info(`[markstream-vue][perf] ${A}`,V?Pt(lt({},H),{layoutReads:V}):H)}Qe([ye,()=>s.nodes,j],([A,H,V])=>{const K=A??"";return H?.length||V===!0?(he(),pe=K,void(Se=!0)):Se?(pe&&K.length>pe.length&&K.startsWith(pe)?(te.value=!0,oe&&(Fe(),Ie=window.setTimeout(()=>{var se;Ie=null,j.value===!0||(se=s.nodes)!=null&&se.length||(Ua(),te.value=!1,rr())},1200))):(K.length<pe.length||!K.startsWith(pe))&&he(),void(pe=K)):(pe=K,void(Se=!0))},{flush:"sync",immediate:!0});const Je=new Map,it=new Map;let At=!1,xt=0;function wt(A){let H=0;for(const V of A.values())H+=V;return H}function Kt(){xt=Math.max(xt,wt(it)),it.clear(),At=!1}function vt(A,H){return(function(V){var K,se;X.value&&(Je.set(V,((K=Je.get(V))!=null?K:0)+1),it.set(V,((se=it.get(V))!=null?se:0)+1),At||(At=!0,oe&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Kt):typeof queueMicrotask!="function"?setTimeout(Kt,0):queueMicrotask(Kt)))})(A),H()}const cn=_.customId?`renderer-${_.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Kn=(function(A){const H=new Map;return{scope:A,cache:H,clear:()=>H.clear()}})(cn),Un=D(()=>`${cn}:${ee.value}`);In(jM,Kn);const Zt=Cs(()=>_.customId),{effectiveCustomHtmlTagsSet:bn,mergedParseOptions:Pn,parsedNodes:rt}=oee(_,{instanceMsgId:cn,renderContent:ye,effectiveFinal:j,smoothStreamingEnabled:ue,debugPerformanceEnabled:X,customComponentsMap:Zt,logPerf:Ne});Qe(rt,()=>{Kn.clear(),ee.value+=1},{immediate:!0});const Hn=D(()=>({customId:_.customId,customHtmlTags:Pn.value.customHtmlTags,parseOptions:_.parseOptions,customMarkdownIt:_.customMarkdownIt,htmlPolicy:He.value,viewportPriority:_.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:_.codeBlockStream,codeBlockDarkTheme:_.codeBlockDarkTheme,codeBlockLightTheme:_.codeBlockLightTheme,codeBlockMonacoOptions:_.codeBlockMonacoOptions,renderCodeBlocksAsPre:_.renderCodeBlocksAsPre,codeBlockMinWidth:_.codeBlockMinWidth,codeBlockMaxWidth:_.codeBlockMaxWidth,codeBlockProps:_.codeBlockProps,mermaidProps:_.mermaidProps,d2Props:_.d2Props,infographicProps:_.infographicProps,showTooltips:le.value,themes:_.themes,langs:_.langs,isDark:_.isDark,typewriter:_.typewriter,smoothStreamingOptions:_.smoothStreamingOptions,parseCoalesceMs:_.parseCoalesceMs,fade:_.fade}));In("markstreamNestedRendererProps",Hn);const Os=D(()=>rt.value),xn=D(()=>rt.value.length),ls=Q(null),As=Q(null),nn=Q(null),as=Q(null),hn=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),cs=!hn&&_.customId?jS(_.customId):null,us=D(()=>cs?(qS.value,jS(_.customId)):null),On=D(()=>{var A;return!!(oe&&!Y.value&&_.customId&&!hn&&((A=us.value)!=null&&A.enabled))}),es=D(()=>{var A;return!!(!Y.value&&((A=s.virtualScroll)!=null&&A.enabled))}),ds=Q(!1);yn(()=>{ds.value=!0});const Ht=D(()=>!!(oe&&es.value));In("markstreamHostScrollManaged",Ht);const Ze=D(()=>!!(ds.value&&Ht.value)),Ue=D(()=>On.value||Ht.value),Ft=D(()=>On.value||Ze.value),jt=D(()=>{var A;return Ue.value&&((A=us.value)==null?void 0:A.textEstimation)!==!1}),en=D(()=>{var A;return Ue.value&&((A=us.value)==null?void 0:A.codeBlockEstimation)!==!1});function Qt(){const A=U.value||vt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(A)&&A>0?A:0}const un=D(()=>{const A=Qt();return A>0?Math.max(1,Math.round(A)):640}),Wn=D(()=>{var A;return Math.max(1,(A=_.maxLiveNodes)!=null?A:320)}),Nt=D(()=>{var A;return!Y.value&&_.nodeVirtual!==!1&&!(((A=_.maxLiveNodes)!=null?A:0)<=0)&&(_.nodeVirtual===!0?rt.value.length>0:rt.value.length>Wn.value)}),fs=D(()=>Nt.value||On.value||Ht.value),ts=D(()=>_.viewportPriority!==!1&&!z.value),Zs=VX(A=>{var H;return ae((H=A??S.value)!=null?H:null)},ts),{requestFrame:zn,cancelFrame:Gn,hasIdleCallback:Di,isTestEnv:Ms}=(function(A){const H=A.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=A.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=A.isClient&&typeof window.requestIdleCallback=="function",se=(function(){var _e;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ee=(_e=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:_e.value;return Ee?.env})();return{requestFrame:H,cancelFrame:V,hasIdleCallback:K,isTestEnv:se?.NODE_ENV==="test"}})({isClient:oe}),{resolvedBatchSize:_i,resolvedInitialBatch:So,batchingEnabled:Pi,incrementalRenderingActive:ni,renderedCount:vs,previousRenderContext:Co,adaptiveBatchSize:sr,previousBatchConfig:wi}=(function(A,H){var V;const K=D(()=>{var ze;const Oe=Math.trunc((ze=A.renderBatchSize)!=null?ze:80);return Number.isFinite(Oe)?Math.max(0,Oe):0}),se=D(()=>{var ze;const Oe=Math.trunc((ze=A.initialRenderBatchSize)!=null?ze:K.value);return Number.isFinite(Oe)?Math.max(0,Oe):K.value}),_e=D(()=>!H.renderAsFragment.value&&A.batchRendering!==!1&&K.value>0&&H.isClient&&!H.isTestEnv),Ee=Q(0),Te=Q({key:A.indexKey,total:0}),We=Q(Math.max(1,K.value||1)),Le=D(()=>{var ze;return _e.value&&((ze=A.maxLiveNodes)!=null?ze:0)<=0}),Ve=Q({batchSize:K.value,initial:se.value,delay:(V=A.renderBatchDelay)!=null?V:16,enabled:Le.value});return{resolvedBatchSize:K,resolvedInitialBatch:se,batchingEnabled:_e,incrementalRenderingActive:Le,renderedCount:Ee,previousRenderContext:Te,adaptiveBatchSize:We,previousBatchConfig:Ve}})(_,{isClient:oe,isTestEnv:Ms,renderAsFragment:Y}),Yn=new Map,ys=new Map,Ao=new WeakMap;let ct=null;const be=new WeakMap,$e=new Map,sn=Q(0),Ke=D(()=>(sn.value,Array.from(Yn.entries()).sort((A,H)=>A[0]-H[0]))),nt=Q(null),ot=Q(null);let Ot=null,ve=0,xe=null;const{activeRestoreAnchor:De,getRelativeScrollTopWithinContainer:Rt,setRelativeScrollTopWithinContainer:Dt,resolveAnchorOffset:Cn,clearRestoreReconcile:qn,scheduleRestoreReconcile:Hs,captureRestoreAnchor:J,restoreAnchor:we,getAnchorDrift:Ae}=(function(A){const{isClient:H,containerRef:V,parsedNodeCount:K,requestFrame:se,cancelFrame:_e,resolveScrollContainer:Ee,getNormalizedScrollTop:Te,getOffsetTopWithinRoot:We,isReverseFlexScrollRoot:Le,estimateIndexForOffset:Ve,estimateHeightRange:ze,getFallbackNodeHeight:Oe,clamp:qe}=A,et=Q(null);let tt=null,St=[];function ut(){const It=Ee(),qt=V.value;if(!It||!qt)return null;const zt=It.ownerDocument||qt.ownerDocument||document;if(It===zt.documentElement||It===zt.body||It===zt.scrollingElement){const pn=qt.getBoundingClientRect();return Math.max(0,-pn.top)}return Math.max(0,Te(It,zt,!1)-We(qt,It))}function ht(It){var qt;const zt=Ee(),pn=V.value;if(!zt||!pn)return;const qo=Math.max(0,It),ao=zt.ownerDocument||pn.ownerDocument||document,Ai=ao.defaultView||(typeof window<"u"?window:null);if(zt===ao.documentElement||zt===ao.body||zt===ao.scrollingElement){const Gr=Te(zt,ao,!0)+pn.getBoundingClientRect().top;return void((qt=Ai?.scrollTo)==null||qt.call(Ai,0,Math.max(0,Gr+qo)))}GS(zt,ao,We(pn,zt)+qo,{isReverseFlexScrollRoot:Gr=>{var Yr;return(Yr=Le?.(Gr))!=null&&Yr},getNormalizedScrollTop:Te})}function Et(It){const qt=K.value,zt=qe(It.nodeIndex,0,Math.max(0,qt-1));return ze(0,zt)+Math.max(0,It.offsetWithinNodePx)}function Ct(){if(tt!=null&&(_e?.(tt),tt=null),H)for(const It of St)window.clearTimeout(It);St=[]}function rn(It){const qt=Et(It),zt=ut();zt!=null&&Math.abs(zt-qt)<=.5||ht(qt)}return{activeRestoreAnchor:et,getRelativeScrollTopWithinContainer:ut,setRelativeScrollTopWithinContainer:ht,resolveAnchorOffset:Et,clearRestoreReconcile:Ct,applyRestoreAnchor:rn,scheduleRestoreReconcile:function(){et.value&&H&&tt==null&&(tt=se?se(()=>{tt=null,et.value&&rn(et.value)}):null,tt==null&&et.value&&rn(et.value))},captureRestoreAnchor:function(){const It=ut(),qt=K.value;if(It==null||qt<=0)return null;const zt=qe(Ve(It+1),0,qt-1),pn=ze(0,zt),qo=Oe(zt);return{nodeIndex:zt,offsetWithinNodePx:qe(It-pn,0,Math.max(0,qo-1))}},restoreAnchor:function(It){const qt=K.value;if(et.value={nodeIndex:qe(It.nodeIndex,0,Math.max(0,qt-1)),offsetWithinNodePx:Math.max(0,It.offsetWithinNodePx)},Ct(),rn(et.value),H)for(const zt of[0,120,280,480])St.push(window.setTimeout(()=>{et.value&&rn(et.value)},zt))},getAnchorDrift:function(It){const qt=ut();return qt==null?null:qt-Et(It)}}})({isClient:oe,containerRef:S,parsedNodeCount:xn,requestFrame:zn,cancelFrame:Gn,resolveScrollContainer:()=>nt.value||me(),getNormalizedScrollTop:ne,getOffsetTopWithinRoot:ge,isReverseFlexScrollRoot:q,estimateIndexForOffset:N1,estimateHeightRange:Kr,getFallbackNodeHeight:of,clamp:zs}),{nodeHeights:Re,heightStats:Ge,heightTreeSize:at,heightSumTree:Mt,heightKnownTree:Ut,averageNodeHeight:Wt,resetHeightMeasurements:hs,pruneHeightMeasurements:Si,rebuildHeightTrees:lo,recordNodeHeight:ns,removeNodeHeights:Qs,exportHeightCache:Es,importHeightCache:Xs,fenwickRangeSum:Ts}=(function(A={}){const H=Ps({}),V=Ps({total:0,count:0}),K=Q(0),se=Q([]),_e=Q([]);function Ee(){for(const Oe of Object.keys(H))delete H[Number(Oe)];V.total=0,V.count=0,K.value=0,se.value=[],_e.value=[]}function Te(Oe,qe,et){for(let tt=qe+1;tt<Oe.length;tt+=tt&-tt)Oe[tt]+=et}function We(Oe,qe){let et=0;for(let tt=qe+1;tt>0;tt-=tt&-tt)et+=Oe[tt];return et}function Le(Oe){K.value=Oe;const qe=new Array(Oe+1).fill(0),et=new Array(Oe+1).fill(0);for(const[tt,St]of Object.entries(H)){const ut=Number(tt),ht=Number(St);!Number.isFinite(ut)||ut<0||ut>=Oe||!Number.isFinite(ht)||ht<=0||(Te(qe,ut,ht),Te(et,ut,1))}se.value=qe,_e.value=et}function Ve(Oe){if(!Number.isInteger(Oe)||Oe<0)return!1;const qe=H[Oe];if(!Number.isFinite(qe)||qe<=0)return!1;if(delete H[Oe],V.total=Math.max(0,V.total-qe),V.count=Math.max(0,V.count-1),K.value>Oe){const et=se.value,tt=_e.value;et.length&&tt.length&&(Te(et,Oe,-qe),Te(tt,Oe,-1))}return!0}const ze=D(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:H,heightStats:V,heightTreeSize:K,heightSumTree:se,heightKnownTree:_e,averageNodeHeight:ze,resetHeightMeasurements:Ee,pruneHeightMeasurements:function(Oe){if(Oe<=0)return void Ee();let qe=0,et=0;for(const[tt,St]of Object.entries(H)){const ut=Number(tt),ht=Number(St);!Number.isFinite(ut)||ut<0||ut>=Oe||!Number.isFinite(ht)||ht<=0?delete H[ut]:(qe+=ht,et++)}V.total=qe,V.count=et},rebuildHeightTrees:Le,recordNodeHeight:function(Oe,qe,et={}){(function(tt,St,ut={}){var ht;if(!Number.isFinite(St)||St<=0)return!1;const Et=H[tt];if(Et&&(ut.allowShrink===!1&&St<Et||Math.abs(St-Et)<=1))return!1;if(H[tt]=St,Et?V.total+=St-Et:(V.total+=St,V.count++),K.value>tt){const Ct=se.value,rn=_e.value;if(Ct.length&&rn.length)if(Et){const It=St-Et;It!==0&&Te(Ct,tt,It)}else Te(Ct,tt,St),Te(rn,tt,1)}ut.notify!==!1&&((ht=A.onHeightRecorded)==null||ht.call(A))})(Oe,qe,Pt(lt({},et),{notify:!0}))},removeNodeHeight:function(Oe,qe={}){var et;const tt=Ve(Oe);return tt&&qe.notify!==!1&&((et=A.onHeightRecorded)==null||et.call(A)),tt},removeNodeHeights:function(Oe,qe={}){var et;let tt=0;for(const St of Oe)Ve(Number(St))&&tt++;return tt>0&&qe.notify!==!1&&((et=A.onHeightRecorded)==null||et.call(A)),tt},exportHeightCache:function(){return Object.entries(H).map(([Oe,qe])=>({index:Number(Oe),height:Number(qe)})).filter(Oe=>Number.isFinite(Oe.index)&&Oe.index>=0&&Number.isFinite(Oe.height)&&Oe.height>0).sort((Oe,qe)=>Oe.index-qe.index)},importHeightCache:function(Oe,qe={}){var et;if(!Array.isArray(Oe))return;const tt=K.value;let St=!1;if(qe.mode!=="merge"){const ut=Object.keys(H);if(ut.length>0){for(const ht of ut)delete H[Number(ht)];St=!0}}for(const ut of Oe){const ht=Number(ut.index),Et=Number(ut.height);if(!Number.isInteger(ht)||ht<0||tt>0&&ht>=tt||!Number.isFinite(Et)||Et<=0)continue;const Ct=H[ht];Ct&&Math.abs(Ct-Et)<=1||(H[ht]=Et,St=!0)}St&&((function(){let ut=0,ht=0;const Et=K.value;for(const[Ct,rn]of Object.entries(H)){const It=Number(Ct),qt=Number(rn);!Number.isFinite(It)||It<0||Et>0&&It>=Et||!Number.isFinite(qt)||qt<=0?delete H[It]:(ut+=qt,ht++)}V.total=ut,V.count=ht})(),tt>0&&Le(tt),(et=A.onHeightRecorded)==null||et.call(A))},fenwickRangeSum:function(Oe,qe,et){if(et<=qe)return 0;const tt=We(Oe,et-1);return qe<=0?tt:tt-We(Oe,qe-1)}}})({onHeightRecorded:()=>{oi(),Ht.value&&ku(),De.value&&Hs(),ot.value&&Ha(),Rn("node-resize")}});function Ci(){hs(),$e.clear()}function Hl(A){!Number.isInteger(A)||A<0||A>=rt.value.length||$e.set(A,au(A))}function Qd(A,H,V={}){const K=Re[A];ns(A,H,V);const se=Re[A];se&&se>0?Hl(A):K&&$e.delete(A)}function l2(A,H){const V=vt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,se;return(se=(K=Yn.get(A))==null?void 0:K.offsetHeight)!=null?se:0});return V>0?V:vt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function a2(A,H={}){Xs(A,H),x1()}const Ur=D(()=>{var A;return!Y.value&&_.deferNodesUntilVisible!==!1&&!(((A=_.maxLiveNodes)!=null?A:0)<=0)&&!Nt.value&&!(rt.value.length>900)&&ts.value}),c2=D(()=>!!Zs&&(Ur.value||Nt.value)),u2=D(()=>Nt.value||Ht.value),{liveNodeBufferResolved:ou,focusIndex:si,liveRange:Ws,updateLiveRange:Wl}=(function(A,H){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:se,clamp:_e}=H,Ee=D(()=>{var Le;return Math.max(0,(Le=A.liveNodeBuffer)!=null?Le:60)}),Te=Q(0),We=Ps({start:0,end:0});return{liveNodeBufferResolved:Ee,focusIndex:Te,liveRange:We,updateLiveRange:function(){const Le=V.value;if(!K.value||Le===0)return We.start=0,void(We.end=Le);const Ve=Math.min(se.value,Le),ze=Ee.value,Oe=_e(Te.value-ze,0,Math.max(0,Le-Ve));We.start=Oe,We.end=Math.min(Le,Oe+Ve)}}})(_,{parsedNodeCount:xn,virtualizationEnabled:Nt,maxLiveNodesResolved:Wn,clamp:zs}),Hi=new Map,zl=new Map,qr=new Map,Xd=[],or=new Map,jr=new Set,d2=Q(0);let Gm=!1;const f2=D(()=>(d2.value,jr.size)),Wo=new Map,Wi=new Map,h2=Q(0),Ym=D(()=>{h2.value;let A=0;for(const H of Wo.values())A+=Math.max(0,H);return A});let zo=null,Zm=!0,p2=[0],m2="";function oi(){Zm=!0}const Jd=D(()=>{if(!Nt.value)return rt.value.length;const A=ou.value,H=Math.max(Ws.end+A,So.value),V=Math.min(rt.value.length,H);return Math.max(vs.value,V)});function ef(){Gm||(Gm=!0,queueMicrotask(()=>{Gm=!1,d2.value+=1}))}function g2(A,H,V="node-resize"){if(!oe||typeof window>"u")return null;const K=window.setTimeout(()=>{jr.delete(K)&&ef();try{H()}finally{Rn(V)}},Math.max(0,A));return jr.add(K),ef(),K}function tf(A){oe&&A!=null&&(jr.delete(A)&&ef(),window.clearTimeout(A))}function v2(){if(oe&&typeof window<"u")for(const A of jr)window.clearTimeout(A);jr.size&&(jr.clear(),ef()),Xd.length=0,qr.clear()}function w8(A){var H,V;return(V=(H=as.value)==null?void 0:H[A])!=null?V:null}const{cancelScheduledFocusSync:Qm,scheduleFocusSync:zi}=(function(A){const{isClient:H,containerRef:V,virtualizationEnabled:K,requestFrame:se,cancelFrame:_e,syncFocusToScroll:Ee}=A;let Te=null;function We(){var Ve,ze,Oe;return(Oe=(ze=(Ve=V.value)==null?void 0:Ve.ownerDocument)==null?void 0:ze.defaultView)!=null?Oe:typeof window<"u"?window:null}function Le(){if(!Te)return;const Ve=We();Te.viaTimeout?Ve?Ve.clearTimeout(Te.id):clearTimeout(Te.id):_e?.(Te.id),Te=null}return{cancelScheduledFocusSync:Le,scheduleFocusSync:function(Ve={}){if(!K.value)return;if(!H)return void Ee(!0);if(Ve.immediate)return Le(),void Ee(!0);if(Te)return;const ze=()=>{Te=null,Ee()};if(se)return void(Te={id:se(ze),viaTimeout:!1});const Oe=We();Te={id:Oe?Oe.setTimeout(ze,16):setTimeout(ze,16),viaTimeout:!0}}}})({isClient:oe,containerRef:S,virtualizationEnabled:Nt,requestFrame:zn,cancelFrame:Gn,syncFocusToScroll:function(A=!1){var H;if(!Nt.value)return;const V=nt.value||me();if(!V)return;const K=V.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,se=K?.defaultView||(typeof window<"u"?window:null),_e=V===K?.documentElement||V===K?.body,Ee=rt.value.length;if(!_e&&Ee>0&&q(V)){const et=vt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),tt=vt("syncFocusToScroll.scrollTop",()=>V.scrollTop),St=tt<0?-tt:tt,ut=(function(Et){var Ct,rn;const It=rt.value;if(!It.length)return 0;if(Et<=0)return Math.max(0,It.length-1);if(Ue.value){const zt=(Ct=n1()[It.length])!=null?Ct:0;return C2(Math.max(0,zt-Et))}if(at.value===It.length){const zt=Kr(0,It.length);return N1(Math.max(0,zt-Et))}let qt=Et;for(let zt=It.length-1;zt>=0;zt--){const pn=(rn=Re[zt])!=null?rn:Wt.value;if(qt<=pn)return zt;qt-=pn}return 0})(Math.max(0,St)+.5*Math.max(0,et)),ht=zs(ut,0,Math.max(0,Ee-1));return void((A||Math.abs(ht-si.value)>1)&&(si.value=ht,Wl()))}const Te=_e?null:vt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),We=_e?0:Te.top,Le=_e?vt("syncFocusToScroll.viewport.clientHeight",()=>{var et,tt;return(tt=(et=se?.innerHeight)!=null?et:V.clientHeight)!=null?tt:0}):Te.bottom,Ve=Ke.value;let ze=null,Oe=null;for(const[et,tt]of Ve){if(!tt)continue;const St=vt("syncFocusToScroll.slot.getBoundingClientRect",()=>tt.getBoundingClientRect());St.bottom<=We||St.top>=Le||(ze==null&&(ze=et),Oe=et)}if(ze==null||Oe==null){const et=S.value;if(!et)return;const tt=_e?{top:0}:vt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),St=vt("syncFocusToScroll.fallback.scrollTop",()=>ne(V,K,_e)),ut=_e?(()=>{const Ct=vt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>et.getBoundingClientRect()),rn=(_e?0:tt.top)-Ct.top;return Math.max(0,rn)})():(()=>{const Ct=ge(et,V);return Math.max(0,St-Ct)})(),ht=_e?vt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,rn,It,qt;return(qt=(It=(rn=se?.innerHeight)!=null?rn:(Ct=K?.documentElement)==null?void 0:Ct.clientHeight)!=null?It:V.clientHeight)!=null?qt:0}):vt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),Et=N1(ut+.5*Math.max(0,ht));return si.value=zs(Et,0,Math.max(0,rt.value.length-1)),void Wl()}const qe=Math.round((ze+Oe)/2);!A&&Math.abs(qe-si.value)<=1||(si.value=zs(qe,0,Math.max(0,rt.value.length-1)),Wl())}}),{visibleNodeIndices:Xm,nodeVisibilityHandles:La,nodeVisibilityWatchStops:nf,nodeVisibilityFallbackTimers:y2,clearVisibilityFallback:sf,markNodeVisible:Vr,cleanupNodeVisibility:S8,destroyNodeVisibilityState:Jm}=iee({isClient:oe,shouldTrackVisibleNodeIndices:()=>Ur.value,shouldCleanupNodeVisibility:()=>Nt.value,onNodeMarkedVisible:A=>{Nt.value?zi():si.value=zs(A,0,Math.max(0,rt.value.length-1))},onNodeVisibilityCleaned:A=>{Yn.delete(A)&&K2()}}),{cleanupScrollListener:k2,setupScrollListener:C8}=(function(A){const{isClient:H,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:se,resolveScrollContainer:_e,scheduleFocusSync:Ee,onScroll:Te}=A;let We=null,Le=null;function Ve(){We&&(We(),We=null),Le=null,se.value=null}function ze(Oe){const qe=A.getScrollTop?A.getScrollTop(Oe):Oe.scrollTop;return Math.max(0,Number.isFinite(qe)?Math.abs(qe):0)}return{cleanupScrollListener:Ve,setupScrollListener:function(){if(!H)return;if(!((Oe=K?.value)!=null?Oe:V.value))return void Ve();var Oe;const qe=_e();if(!qe)return void Ve();if(se.value===qe&&We)return;Ve(),Le=ze(qe);const et=()=>{if(Te?.(),V.value){const tt=(function(St){const ut=ze(St),ht=Le;Le=ut;const Et=Math.max(480,.75*(St.clientHeight||0));return ht==null?ut>Et?{immediate:!0}:void 0:Math.abs(ut-ht)>Et?{immediate:!0}:void 0})(qe);tt?Ee(tt):Ee()}};qe.addEventListener("scroll",et,{passive:!0}),se.value=qe,We=()=>{qe.removeEventListener("scroll",et)}}}})({isClient:oe,virtualizationEnabled:Nt,listenerEnabled:u2,scrollRootElement:nt,resolveScrollContainer:me,scheduleFocusSync:zi,onScroll:function(){const A=ot.value;if(!A)return;const H=lu();if(!H||(function(K){if(hu()>=ve)return xe=null,!1;const se=xe;if(se==null)return!0;const _e=Math.abs(K.scrollTop-se)<=2;return _e||(xe=null),_e})(H))return;const V=F2(H);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,A.distanceFromBottomPx))>32)&&Pa("restore"):Pa("restore")},getScrollTop:A=>{var H;const V=A.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,K=A===V.documentElement||A===V.body||A===V.scrollingElement;return vt("scrollListener.getScrollTop",()=>ne(A,V,K))}});function zs(A,H,V){return Math.min(Math.max(A,H),V)}function e1(A){return A?.firstElementChild}function b2(A,H){var V;return A?(V=A.matches)!=null&&V.call(A,H)?A:A.querySelector(H):null}function x2(){if(!Ue.value)return void(U.value=0);const A=vt("updateExperimentContainerWidth.clientWidth",()=>{var H,V;return(V=(H=S.value)==null?void 0:H.clientWidth)!=null?V:0});U.value=A>0?A:0}let iu=null;function t1(){iu?.disconnect(),iu=null}const _2=Ii({loader:()=>Qn(null,null,function*(){return(yield mo(()=>import("./index8-DVszZ_QU.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:DM,delay:0,suspensible:!1});function w2(A){return A===_2}const S2=D(()=>u.value==="pre"?jo:u.value==="shiki"?_2:P0),Ul=D(()=>{const A=rt.value;if(!A.length||!Ue.value)return A.map(()=>null);const H=U.value||vt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(H)||H<=0?A.map(()=>null):A.map((V,K)=>{const se=Re[K],_e=typeof se=="number"&&se>0;if(jt.value&&!_e){const Te=qM(V,H,Z.value);if(Te)return Te}if(en.value&&V.type==="code_block"){const Te=(function(We){if(We.type!=="code_block")return null;const Le=rb(We,ff(We));return w2(Le)?"markdown":Le===jo?"pre":Le===S2.value||Le===P0?"monaco":null})(V);if(Te==="monaco"||Te==="markdown"||Te==="pre")return qJ(V,{rendererKind:Te,monacoOptions:_.codeBlockMonacoOptions,showHeader:((Ee=_.codeBlockProps)==null?void 0:Ee.showHeader)!==!1})}var Ee;return null})});function of(A){var H;const V=Re[A];if(Number.isFinite(V)&&V>0)return V;const K=(H=Ul.value[A])==null?void 0:H.height;return Number.isFinite(K)&&K>0?K:Math.max(Wt.value,(function(se){var _e,Ee,Te,We,Le,Ve,ze,Oe,qe,et,tt,St,ut;const ht=rt.value[se];if(!ht||typeof ht!="object")return 32;const Et=String((_e=ht.type)!=null?_e:""),Ct=Qt()||640;switch(Et){case"heading":return 44;case"paragraph":return Fa(String((Te=(Ee=ht.raw)!=null?Ee:ht.content)!=null?Te:""),Ct,34);case"list":{const rn=Array.isArray(ht.items)?ht.items.length:1;return Math.max(48,30*rn+12)}case"list_item":return Fa(String((Le=(We=ht.raw)!=null?We:ht.content)!=null?Le:""),Ct,34);case"blockquote":return Fa(String((ze=(Ve=ht.raw)!=null?Ve:ht.content)!=null?ze:""),Ct,56);case"table":{const rn=Array.isArray(ht.rows)?ht.rows.length:Array.isArray(ht.children)?ht.children.length:3;return Math.max(120,38*rn+48)}case"code_block":return Fa(String((qe=(Oe=ht.code)!=null?Oe:ht.raw)!=null?qe:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Fa(String((tt=(et=ht.raw)!=null?et:ht.content)!=null?tt:""),Ct,96);case"thematic_break":return 24;default:return Fa(String((ut=(St=ht.raw)!=null?St:ht.content)!=null?ut:""),Ct,40)}})(A))}function Fa(A,H,V,K=22){const se=String(A??"");if(!se)return V;const _e=Math.max(18,Math.floor(Math.max(320,H)/8)),Ee=se.split(/\r?\n/).length,Te=Math.ceil(se.length/_e),We=Math.max(1,Ee,Te);return Math.max(V,Math.ceil(We*K+12))}function ru(A){const H=Number(A);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function n1(){var A,H;const V=rt.value.length,K=ru(U.value||vt("getFallbackHeightPrefix.clientWidth",()=>{var Te;return((Te=S.value)==null?void 0:Te.clientWidth)||0})),se=((A=s.virtualScroll)==null?void 0:A.measurementKey)==null?"":String(s.virtualScroll.measurementKey),_e=[V,Ge.count,Math.round(Ge.total),Math.round(100*Wt.value),se,K,Ue.value?1:0,qS.value,ee.value].join(":");if(!Zm&&m2===_e)return p2;const Ee=new Array(V+1);Ee[0]=0;for(let Te=0;Te<V;Te++)Ee[Te+1]=Ee[Te]+(Ue.value?of(Te):(H=Re[Te])!=null?H:Wt.value);return p2=Ee,m2=_e,Zm=!1,Ee}function C2(A){var H,V;const K=rt.value.length;if(K<=0||A<=0)return 0;const se=n1();if(A>=((H=se[K])!=null?H:0))return K-1;let _e=0,Ee=K-1,Te=K-1;for(;_e<=Ee;){const We=_e+Ee>>1;((V=se[We+1])!=null?V:0)>=A?(Te=We,Ee=We-1):_e=We+1}return Te}function Kr(A,H){var V,K;if(A>=H)return 0;if(Ue.value)return(function(Ee,Te){var We,Le;const Ve=rt.value.length,ze=zs(Math.trunc(Ee),0,Ve),Oe=zs(Math.trunc(Te),ze,Ve);if(ze>=Oe)return 0;const qe=n1();return((We=qe[Oe])!=null?We:0)-((Le=qe[ze])!=null?Le:0)})(A,H);if(at.value!==rt.value.length){let Ee=0;for(let Te=A;Te<H;Te++)Ee+=(V=Re[Te])!=null?V:Wt.value;return Ee}const se=Mt.value,_e=Ut.value;if(!se.length||!_e.length){let Ee=0;for(let Te=A;Te<H;Te++)Ee+=(K=Re[Te])!=null?K:Wt.value;return Ee}return Ts(se,A,H)+(H-A-Ts(_e,A,H))*Wt.value}Qe(()=>rt.value.length,A=>{oi(),A<=0?Ci():(A<at.value&&Si(A),A!==at.value&&lo(A))},{immediate:!0});const A8=D(()=>{if(!Nt.value)return rt.value.map((K,se)=>({node:K,index:se}));const A=rt.value.length,H=zs(Ws.start,0,A),V=zs(Ws.end,H,A);return rt.value.slice(H,V).map((K,se)=>({node:K,index:H+se}))}),s1=D(()=>Nt.value?Kr(0,Math.min(Ws.start,rt.value.length)):0),o1=D(()=>{if(!Nt.value)return 0;const A=rt.value.length;return Kr(Math.min(Ws.end,A),A)});function A2(){if(!Ue.value)return 0;let A=0;const H=Ul.value;for(let V=0;V<H.length;V++){if(!H[V])continue;const K=Re[V];Number.isFinite(K)&&K>0||A++}return A}function M2(){const A=rt.value.length;return{totalNodes:A,measuredCount:Ge.count,estimatedCount:A2(),averageNodeHeight:Wt.value,topSpacerHeight:s1.value,bottomSpacerHeight:o1.value,estimatedTotalHeight:Kr(0,A),width:ql()}}function M8(){const A=rt.value,H=M2();return Pt(lt({},H),{probe:{paragraphReady:!!Z.value.paragraph,listItemReady:!!Z.value.listItem,listWrapperOverhead:Z.value.listWrapperOverhead,headingReadyLevels:Object.entries(Z.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:A.map((V,K)=>{var se,_e,Ee,Te,We,Le,Ve,ze,Oe;return{index:K,type:V.type,estimateKind:(_e=(se=Ul.value[K])==null?void 0:se.kind)!=null?_e:null,rendererKind:(Te=(Ee=Ul.value[K])==null?void 0:Ee.rendererKind)!=null?Te:null,estimatedHeight:(Le=(We=Ul.value[K])==null?void 0:We.height)!=null?Le:null,estimatedContentHeight:(ze=(Ve=Ul.value[K])==null?void 0:Ve.contentHeight)!=null?ze:null,measuredHeight:(Oe=Re[K])!=null?Oe:null}})})}function i1(){return s.indexKey!=null?String(s.indexKey):es.value?`virtual-${jn()}`:"markdown-renderer"}function E2(A){const H=String(A),V=`${i1()}-`;if(!H.startsWith(V))return null;const K=H.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const se=Number(K[1]);return!Number.isInteger(se)||se<0||se>=rt.value.length?null:se}function jn(){var A,H,V;const K=(A=s.virtualScroll)==null?void 0:A.sessionKey;return String(K!=null&&K!==""?K:(V=(H=s.indexKey)!=null?H:_.customId)!=null?V:cn)}function Ns(){var A;const H=(A=s.virtualScroll)==null?void 0:A.threadKey;return H==null||H===""?void 0:String(H)}function r1(A){var H;return(A??"")===((H=Ns())!=null?H:"")}function E8(){var A;const H=(A=s.virtualScroll)==null?void 0:A.measurementKey;return H==null?"":String(H)}function T8(){var A,H;const V=u.value,K=V==="monaco"?_.codeBlockMonacoOptions:void 0,se=_.codeBlockProps,_e=V==="shiki";return[_.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",_.codeBlockStream===!1?"code-static":"code-stream",Rs(_.codeBlockMinWidth),Rs(_.codeBlockMaxWidth),..._e?[yp((A=se?.themes)!=null?A:_.themes,(H=se?.langs)!=null?H:_.langs)]:[],Rs(K?.fontSize),Rs(K?.lineHeight),Rs(K?.fontFamily),Rs(K?.tabSize),Rs(K?.MAX_HEIGHT),Rs(K?.wordWrap),Rs(K?.wrappingIndent),Rs(K?.padding),Rs(se?.showHeader),Rs(se?.showCopyButton),Rs(se?.showExpandButton),Rs(se?.showPreviewButton),Rs(se?.showCollapseButton),Rs(se?.showFontSizeButtons)].join("\0")}function ir(){return[E8(),T8()].join("\0")}function ql(){return Qt()}const rf=D(()=>ru(ql())),Uo=D(()=>[ir(),rf.value].join("\0")),N8=D(()=>{var A;return es.value?["virtual",(A=Ns())!=null?A:"",jn(),Uo.value].join("\0"):s.indexKey});function Oa(){h2.value+=1}function l1(A){return!(!A||!Number.isInteger(A.index)||A.index<0||A.index>=rt.value.length||A.sessionKey!==jn()||A.threadKey!==Ns()||A.layoutEpochKey!==Uo.value)}function T2(A){const H=String(A),V=Wi.get(H);return V?l1(V)?V.index:null:E2(H)}function N2(A="async-node"){(Wo.size||Wi.size)&&(Wo.clear(),Wi.clear(),Oa(),Rn(A))}const Ra=Vt(pv,null),a1={reportHeight(A,H){if(!Ht.value)return;const V=T2(A);if(V==null)return;const K=Hi.get(V);if(!K)return;const se=Number(H),_e=l2(V,K);Qd(V,Number.isFinite(se)&&se>0?Math.max(se,_e||0):_e)},markPending(A){if(!Ht.value)return;const H=E2(A);H!=null&&(function(V,K){var se;const _e=Wi.get(V);if(_e&&l1(_e))return Wo.set(V,Math.max(0,(se=Wo.get(V))!=null?se:0)+1),Oa(),void Rn("async-node");Wo.set(V,1),Wi.set(V,(function(Ee){return{index:Ee,sessionKey:jn(),threadKey:Ns(),layoutEpochKey:Uo.value}})(K)),Oa(),Rn("async-node")})(String(A),H)},markSettled(A){if(!Ht.value)return;const H=String(A),V=T2(A);(V!=null||(function(K){return Wo.has(String(K))})(H))&&(function(K){var se;const _e=(se=Wo.get(K))!=null?se:0;return!(_e<=0||(_e<=1?(Wo.delete(K),Wi.delete(K)):Wo.set(K,_e-1),Oa(),_e===1&&Rn("async-node"),0))})(H)&&V!=null&&rr()}};function I8(){let A=0;for(const H of Hi.values())A+=vt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=H?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,A))}In(pv,{reportHeight(A,H){a1.reportHeight(A,H),Ra?.reportHeight(A,H)},markPending(A){a1.markPending(A),Ra?.markPending(A)},markSettled(A){a1.markSettled(A),Ra?.markSettled(A)}});let c1,u1=null,Ba=null;function lf(A){return A!==!1&&A!=null&&A!==""}function I2(){return Nt.value?(function(){if(!Nt.value)return!0;const A=rt.value.length,H=zs(Ws.start,0,A),V=zs(Ws.end,H,A);if(H>=V)return!0;for(let K=H;K<V;K++)if(!Yn.has(K)||I1(K)&&!Hi.has(K))return!1;return!0})():vs.value>=Jd.value}function d1(){return j.value===!0&&!te.value&&Ym.value===0&&jr.size===0&&or.size===0&&zo==null&&I2()}function $2(){var A,H;if(((A=s.virtualScroll)==null?void 0:A.settleMode)!=="manual"||u1===jn()&&c1===Ns())return!0;const V=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!lf(V)&&Ba===bu(V)}function f1(){return d1()&&$2()}function $8(A,H){return H.totalNodes<=0?A==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?A==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function jl(A="manual",H){const V=M2(),K=(function(se){return se||(j.value!==!0?rt.value.length>0?"streaming":"estimating":!I2()||or.size>0||zo!=null?"measuring":f1()?"settled":"settling")})(H);return{sessionKey:jn(),threadKey:Ns(),phase:K,nodeCount:V.totalNodes,liveRange:{start:Ws.start,end:Ws.end},renderedCount:vs.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:I8(),totalHeight:L2(),width:V.width,final:j.value===!0,stable:f1(),confidence:$8(K,V),reason:A}}function lu(){const A=nt.value||me(),H=S.value;if(!A||!H)return null;const V=A.ownerDocument||H.ownerDocument||document,K=A===V.documentElement||A===V.body||A===V.scrollingElement,se=vt("getScrollBox.scrollTop",()=>ne(A,V,K)),_e=vt("getScrollBox.scrollHeight",()=>{var Te,We,Le,Ve,ze;return K?Math.max((We=(Te=V.documentElement)==null?void 0:Te.scrollHeight)!=null?We:0,(Ve=(Le=V.body)==null?void 0:Le.scrollHeight)!=null?Ve:0,(ze=A.scrollHeight)!=null?ze:0):A.scrollHeight}),Ee=vt("getScrollBox.clientHeight",()=>{var Te;return K?((Te=V.documentElement)==null?void 0:Te.clientHeight)||A.clientHeight||0:A.clientHeight});return{root:A,doc:V,isViewportRoot:K,scrollTop:se,scrollHeight:_e,clientHeight:Ee}}function L2(){const A=rt.value.length,H=Math.max(0,Kr(0,A)),V=vt("getRendererLogicalHeight.offsetHeight",()=>{var se,_e;return(_e=(se=S.value)==null?void 0:se.offsetHeight)!=null?_e:0}),K=Math.max(0,V>0?V:vt("getRendererLogicalHeight.scrollHeight",()=>{var se,_e;return(_e=(se=S.value)==null?void 0:se.scrollHeight)!=null?_e:0}));return A<=0?Math.ceil(V):Nt.value?H>0?Math.max(1,Math.ceil(H),(function(){let se=s1.value+o1.value;for(const _e of Yn.values())_e&&(se+=Math.max(0,vt("getVirtualizedDomLogicalHeight.offsetHeight",()=>_e.offsetHeight||0)));return Math.ceil(Math.max(0,se))})(),(function(se,_e){return se<=0||_e<=0?0:_e<=se+Math.max(512,.05*se)?Math.ceil(_e):0})(H,K)):Math.max(1,Math.ceil(K)):Ht.value?H>0||Ge.count>0||A2()>0?(ni.value&&vs.value,Math.max(1,Math.ceil(K),Math.ceil(H))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(H))}function F2(A){const H=S.value;if(!H)return null;const V=vt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(se){return se.isViewportRoot?se.clientHeight:vt("getViewportBottomInRoot.getBoundingClientRect",()=>se.root.getBoundingClientRect().bottom)})(A)-V.bottom}function L8(A={}){const H=A.requireViewport!==!1,V=(function(_e=64){const Ee=lu(),Te=S.value;if(!Ee||!Te)return!1;const We=(function(Ve){if(Ve.isViewportRoot)return{top:0,bottom:Ve.clientHeight};const ze=vt("getVirtualViewportRect.getBoundingClientRect",()=>Ve.root.getBoundingClientRect());return{top:ze.top,bottom:ze.bottom}})(Ee),Le=vt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Te.getBoundingClientRect());return Le.bottom>=We.top-_e&&Le.top<=We.bottom+_e})();if(H&&!V)return null;const K=(function(){const _e=lu(),Ee=S.value;if(!_e||!Ee||Math.max(0,_e.scrollHeight-_e.scrollTop-_e.clientHeight)>64)return null;const Te=F2(_e);return Te==null?null:Te>=-8&&Te<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Te)}:null})();if(K)return{anchor:K,captured:!0};const se=J();if(se)return{anchor:{type:"node",nodeIndex:se.nodeIndex,offsetWithinNodePx:se.offsetWithinNodePx},captured:V};if(A.allowFallback===!0){const _e=(function(){const Ee=rt.value.length;return Ee<=0?null:{type:"node",nodeIndex:zs(si.value,0,Math.max(0,Ee-1)),offsetWithinNodePx:0}})();return _e?{anchor:_e,captured:!1}:null}return null}function h1(A){let H=2166136261;for(let V=0;V<A.length;V++)H^=A.charCodeAt(V),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function F8(A,H){let V=A;for(let K=0;K<H.length;K++)V^=H.charCodeAt(K),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const O8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function af(A,H=new WeakSet,V=0){if(A==null||typeof A=="number"||typeof A=="boolean")return String(A);if(typeof A=="string")return`s:${(function(K){const se=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${h1(se)}`})(A)}`;if(typeof A=="function")return"fn";if(typeof A!="object")return typeof A;if(H.has(A))return"cycle";if(V>=6)return"max-depth";H.add(A);try{if(Array.isArray(A)){if(A.length<=160){const Le=[];for(let Ve=0;Ve<A.length;Ve++)Le.push(af(A[Ve],H,V+1));return`a:${A.length}:${Le.join(",")}`}const _e=[],Ee=[],Te=Math.max(0,A.length-32);let We=2166136261;for(let Le=0;Le<A.length;Le++){const Ve=af(A[Le],H,V+1);We=F8(We,Ve),Le<32&&_e.push(Ve),Le>=Te&&Ee.push(Ve)}return[`a:${A.length}`,`h=${_e.join(",")}`,`t=${Ee.join(",")}`,`all=${(We>>>0).toString(36)}`].join(":")}const K=A,se=Object.keys(K).filter(_e=>{const Ee=K[_e];return _e!=="parent"&&_e!=="el"&&_e!=="component"&&(Ee==null||typeof Ee=="string"||typeof Ee=="number"||typeof Ee=="boolean"||O8.has(_e))}).sort();return`o:${se.length}:${se.map(_e=>`${_e}=${af(K[_e],H,V+1)}`).join(";")}`}finally{H.delete(A)}}let O2=-1,p1="";function au(A){const H=rt.value[A];return H?h1(af(H)):""}function m1(){const A=ee.value;if(O2===A)return p1;let H=2166136261;for(let V=0;V<rt.value.length;V++){const K=au(V);for(let se=0;se<K.length;se++)H^=K.charCodeAt(se),H=Math.imul(H,16777619)}return p1=(H>>>0).toString(36),O2=A,p1}function Da(A,H={}){var V;const K=H.includeHeightCache===!0,se=(V=H.includeContentHash)!=null?V:K,_e=K?(function(Te){const We=(function(){var tt,St;const ut=Number((St=(tt=s.virtualScroll)==null?void 0:tt.heightCacheLimit)!=null?St:5e3);return!Number.isFinite(ut)||ut<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ut))})();if(!Number.isFinite(We)||Te.length<=We)return Te;const Le=new Map,Ve=tt=>{!tt||Le.size>=We||Le.set(tt.index,tt)},ze=rt.value.length,Oe=zs(Ws.start-2*ou.value,0,ze),qe=zs(Ws.end+2*ou.value,Oe,ze);for(const tt of Te)tt.index>=Oe&&tt.index<qe&&Ve(tt);const et=Math.max(1,Math.ceil(Te.length/We));for(let tt=0;tt<Te.length&&Le.size<We;tt+=et)Ve(Te[tt]);for(let tt=Te.length-1;tt>=0&&Le.size<We;tt-=et)Ve(Te[tt]);return Array.from(Le.values()).sort((tt,St)=>tt.index-St.index).slice(0,We)})(Es().map(Te=>{var We;const Le=rt.value[Te.index];return Le?Pt(lt({},Te),{nodeType:String((We=Le.type)!=null?We:""),signature:au(Te.index)}):null}).filter(Te=>!!Te)):[],Ee=L8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Ee||_e.length||H.includeEmptyState===!0?Pt(lt({sessionKey:A.sessionKey,threadKey:A.threadKey},Ee?{anchor:Ee.anchor,anchorCaptured:Ee.captured}:{anchorCaptured:!1}),{metrics:A,width:A.width,contentHash:se?m1():void 0,measurementKey:ir()||void 0,heightCache:_e.length?_e:void 0}):null}function g1(A){var H,V;const K=lu();if(!K)return;const se=(function(Te){const We=S.value;if(!We)return null;const Le=ge(We,Te.root),Ve=rt.value.length,ze=vt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>We.offsetHeight||0),Oe=Math.max(0,ze>0?ze:Ve>0?vt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>We.scrollHeight||0):0),qe=L2();return Le+Math.max(Oe,qe)})(K);if(se==null)return;const _e=Math.max(0,A.distanceFromBottomPx),Ee=Math.max(0,se-K.clientHeight-_e);(function(Te){ve=hu()+120,xe=Te})(Ee),K.isViewportRoot?(V=(H=K.doc.defaultView)==null?void 0:H.scrollTo)==null||V.call(H,0,Ee):GS(K.root,K.doc,Ee,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:ne})}const v1=[];function R2(){if(oe)for(Ot!=null&&(Gn?.(Ot),Ot=null);v1.length;){const A=v1.pop();A!=null&&window.clearTimeout(A)}}function Pa(A){const H=!!ot.value;ot.value=null,ve=0,xe=null,R2(),H&&A&&Rn(A)}function Ha(){if(!ot.value||!oe||Ot!=null)return;const A=()=>{Ot=null;const H=ot.value;H&&g1(H)};Ot=zn?zn(A):null,Ot==null&&A()}function B2(A,H={}){const V=rt.value.length;return V<=0?[]:A.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=V)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(H.requireSignature&&!K.signature)&&!(H.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(se){var _e;const Ee=rt.value[se.index];return!(!Ee||se.nodeType&&se.nodeType!==String((_e=Ee.type)!=null?_e:"")||se.signature&&se.signature!==au(se.index))})(K))}function D2(A){const H=ru(ql()),V=ru(A);return H!==-1&&V!==-1&&H===V}function y1(A){var H;const V=Number(A?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((H=A?.metrics)==null?void 0:H.width);return Number.isFinite(K)&&K>0?K:null}function P2(A){var H;return A.sessionKey===jn()&&!!r1(A.threadKey)&&((H=A.measurementKey)!=null?H:"")===ir()&&!!D2(y1(A))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(H2(V)?K.some(se=>!!(se.nodeType||se.signature)):K.some(se=>!!se.signature))})(A)}function H2(A){return!!(A.contentHash&&A.contentHash===m1())}function R8(A){return!H2(A)}let Vl=null,Kl=null,cf=null,cu=null,uu=null;function k1(A){var H;const V=A.map(se=>{var _e,Ee;return[se.index,Math.round(10*se.height),(_e=se.nodeType)!=null?_e:"",(Ee=se.signature)!=null?Ee:""].join("")}).join(""),K=ru(ql());return[(H=Ns())!=null?H:"",jn(),ir(),rt.value.length,K,A.length,h1(V)].join(":")}function W2(A=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!Ht.value||!A?.length||rt.value.length<=0||!D2((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const V=B2(A,{requireSignature:!0});if(!V.length)return!1;const K=k1(V);return K===Vl?(Kl="standalone",!0):(a2(V,{mode:"merge"}),oi(),Vl=K,Kl="standalone",mu(),Rn("restore"),!0)}function b1(A,H={}){var V,K,se;if(!Ht.value||!A||A.sessionKey!==jn()||!r1(A.threadKey)||rt.value.length<=0)return!1;const _e=!!((V=A.heightCache)!=null&&V.length)&&!uf(),Ee=!A.anchor||A.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:A.anchor,Te=H.restoreAnchor===!0&&!!Ee&&!uf()&&Number(y1(A))>0;let We=!1;if((K=A.heightCache)!=null&&K.length&&P2(A)){const Ve=B2(A.heightCache,{requireCompatibilityMetadata:!A.contentHash,requireSignature:R8(A)});Ve.length&&(a2(Ve,{mode:"merge"}),oi(),Vl=k1(Ve),Kl="restore",mu(),We=!0)}if(_e||Te)return!1;if(!H.restoreAnchor||!Ee)return We&&Rn("restore"),!0;const Le=(function(Ve,ze){var Oe;const qe=Ve.anchor,et=qe?qe.type==="bottom"?`bottom:${Math.round(qe.distanceFromBottomPx)}`:`node:${qe.nodeIndex}:${Math.round(qe.offsetWithinNodePx)}`:"none";return[(Oe=Ns())!=null?Oe:"",jn(),ir(),rf.value,ze,et].join(":")})(A,(se=H.restoreToken)!=null?se:"imperative");return cf===Le?(We&&Rn("restore"),!0):(cf=Le,(function(Ve){const ze=()=>{if(Ve.type==="node")return Pa(),void we({nodeIndex:Ve.nodeIndex,offsetWithinNodePx:Ve.offsetWithinNodePx});if(qn(),De.value=null,ot.value=Ve,R2(),g1(Ve),oe)for(const Oe of[0,120,280,480])v1.push(window.setTimeout(()=>{const qe=ot.value;qe&&g1(qe)},Oe))};(function(Oe){if(!Nt.value)return!1;const qe=rt.value.length;return!(qe<=0||(si.value=Oe.type==="node"?zs(Oe.nodeIndex,0,qe-1):qe-1,Wl(),0))})(Ve)?gt(ze):ze()})(Ee),Rn("restore"),!0)}function uf(){const A=ql();return Number.isFinite(A)&&A>0}function z2(A){var H;return A.sessionKey===jn()&&!!r1(A.threadKey)&&(rt.value.length<=0||!(!((H=A.heightCache)!=null&&H.length)||uf())||!(!(A.anchor&&Number(y1(A))>0)||uf()))}function x1(){$e.clear();for(const A of Object.keys(Re)){const H=Number(A);Number.isInteger(H)&&H>=0&&H<rt.value.length&&Hl(H)}}function du(){zo!=null&&(Gn?.(zo),zo=null),$1()}function U2(){return!oe||Ms?Promise.resolve():new Promise(A=>{let H=!1,V=null;const K=()=>{H||(H=!0,V!=null&&window.clearTimeout(V),A())};if(zn)return zn(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function _1(A,H=Ns(),V=Uo.value){return jn()===A&&Ns()===H&&Uo.value===V}function w1(){return Qn(this,arguments,function*(A={}){var H,V,K,se,_e;const Ee=jn(),Te=Ns(),We=Uo.value,Le=(H=A.frames)!=null?H:2,Ve=(V=A.timeoutMs)!=null?V:120,ze=(K=A.reason)!=null?K:"manual",Oe=A.expectedSettledTokenKey,qe=A.flushPendingTimers===!0,et=jl(ze),tt=()=>Pt(lt({},et),{phase:et.final?"settling":et.phase,stable:!1,confidence:et.confidence==="final"?"mixed":et.confidence,reason:ze}),St=()=>_1(Ee,Te,We)&&(Oe==null||pu()===Oe);for(let Ct=0;Ct<Le;Ct++){if(yield gt(),!St()||(yield U2(),!St()))return tt();rr(),du()}if(yield(function(Ct){return!oe||Ct<=0?Promise.resolve():new Promise(rn=>window.setTimeout(rn,Ct))})(Ve),!St()||(qe&&v2(),rr(),du(),!St()))return tt();const ut=d1();ut&&(u1=Ee,c1=Te,((se=s.virtualScroll)==null?void 0:se.settleMode)==="manual"&&Oe!=null&&lf((_e=s.virtualScroll)==null?void 0:_e.settledToken)&&pu()===Oe&&(Ba=bu(s.virtualScroll.settledToken)));const ht=St()&&ut&&$2(),Et=jl(ze,ht?"final":void 0);return E1(Et,!0),Et})}let S1="content",Gl=null,Yl=null,C1=0,fu=null,Wa=null,A1=null,M1=null;function hu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function q2(A){var H,V;const K=fu;if(!K)return!0;const se=(V=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?V:1;return Math.abs(A.totalHeight-K.totalHeight)>se||A.sessionKey!==K.sessionKey||A.phase!==K.phase||A.stable!==K.stable||A.final!==K.final||A.threadKey!==K.threadKey||A.nodeCount!==K.nodeCount||A.measuredCount!==K.measuredCount||A.width!==K.width}function Rs(A){if(A==null)return"";if(typeof A=="string"||typeof A=="number"||typeof A=="boolean")return String(A);try{return JSON.stringify(A)}catch{return String(A)}}function pu(A=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return Rs(A)}function j2(A,H){var V,K;return[A,H.sessionKey,(V=H.threadKey)!=null?V:"",ir(),m1(),Rs((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function mu(){A1=null,M1=null,Wa=null}function B8(A){const H=A.heightCache;return H?.length?k1(H):""}function gu(A){var H,V,K;const se=A.metrics,_e=A.anchor?(Ee=A.anchor).type==="bottom"?`bottom:${Math.round(Ee.distanceFromBottomPx)}`:`node:${Ee.nodeIndex}:${Math.round(Ee.offsetWithinNodePx)}`:"none";var Ee;return[A.sessionKey,(H=A.threadKey)!=null?H:"",(V=A.measurementKey)!=null?V:ir(),(K=A.contentHash)!=null?K:"",B8(A),_e,A.anchorCaptured?1:0,se.liveRange.start,se.liveRange.end,se.renderedCount,se.nodeCount,Math.round(se.totalHeight),Math.round(se.width),se.phase,se.stable?1:0].join("\0")}function E1(A,H=!1){if(!Ht.value||(function(Ee=!1){return!Ee&&es.value&&!Ze.value})(H))return;const V=H||q2(A),K=(function(Ee,Te=!1){return Te||Ee.stable||Ee.phase==="final"?{state:Da(Ee,{includeHeightCache:!0})}:{state:Da(Ee)}})(A,H),se=K.state,_e=!!(se&&(V||(function(Ee,Te=!1){return!!Te||gu(Ee)!==Wa})(se,H)));if(V&&(E(A),fu=A,C1=hu()),se&&_e&&(N(se),se.anchor&&F(se.anchor),Wa=gu(se)),A.stable){const Ee=j2("settled",A);if(Ee!==A1){A1=Ee;const Te=Da(A,{includeHeightCache:!0});Te&&(N(Te),Wa=gu(Te)),(function(We){o("render-settled",We)})(A)}}if(A.phase==="final"){const Ee=j2("final",A);if(Ee!==M1){M1=Ee;const Te=Da(A,{includeHeightCache:!0});Te&&(N(Te),Wa=gu(Te)),(function(We){o("render-final",We)})(A)}}}function T1(){Gl!=null&&(Gn?.(Gl),Gl=null),Yl!=null&&oe&&(window.clearTimeout(Yl),Yl=null)}function V2(){Gl=null,Yl=null,(function(A){if(or.size>0||zo!=null)return!0;switch(A){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(S1)&&(rr(),du()),E1(jl(S1))}function Rn(A){var H,V;if(!Ht.value||(S1=A,Gl!=null||Yl!=null))return;const K=Math.max(0,(V=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?V:32),se=Math.max(0,K-(hu()-C1)),_e=()=>{Yl=null,Gl=zn?zn(V2):null,Gl==null&&V2()};oe&&se>0?Yl=window.setTimeout(_e,se):_e()}function N1(A){var H;if(A<=0)return 0;const V=rt.value;if(Ue.value)return C2(A);if(at.value===V.length&&Mt.value.length&&Ut.value.length){const se=Wt.value,_e=Mt.value,Ee=Ut.value,Te=ze=>ze<=0?0:Ts(_e,0,ze)+(ze-Ts(Ee,0,ze))*se;let We=0,Le=V.length-1,Ve=V.length-1;for(;We<=Le;){const ze=We+Le>>1;Te(ze+1)>=A?(Ve=ze,Le=ze-1):We=ze+1}return Ve}let K=A;for(let se=0;se<V.length;se++){const _e=(H=Re[se])!=null?H:Wt.value;if(K<=_e)return se;K-=_e}return Math.max(0,V.length-1)}function K2(){sn.value+=1}function I1(A){return!(ni.value&&A>=vs.value)&&(!Ur.value||A<So.value||Xm.value.has(A))}function za(A){const H=nf.get(A);H&&(H(),nf.delete(A));const V=La.get(A);V&&(V.destroy(),La.delete(A)),sf(A)}function G2(A,H){let V=!1;if(H){const _e=Yn.get(A);Yn.set(A,H),_e!==H&&(V=!0)}else Yn.delete(A)&&(V=!0);if(V&&K2(),H||sf(A),!c2.value||!Zs||!Nt.value&&Ur.value&&!z.value&&La.size>=640&&(z.value||(z.value=!0,Jm()),!c2.value||!Zs))return za(A),void(H&&Vr(A,!0));if(A<So.value&&!Nt.value||Xm.value.has(A))return za(A),void Vr(A,!0);if(!H)return void za(A);za(A);const K=Zs(H,{rootMargin:"400px"});if(!K)return;La.set(A,K),Vr(A,K.isVisible.value),Ur.value&&(function(_e){if(!oe||!Ur.value)return;sf(_e);const Ee=_e%17*23,Te=window.setTimeout(()=>{if(y2.delete(_e),!Ur.value||Xm.value.has(_e))return;const We=Yn.get(_e);if(!We)return;const Le=me(We),Ve=We.ownerDocument||document,ze=Ve.defaultView||window,Oe=!Le||Le===Ve.documentElement||Le===Ve.body,qe=!Oe&&Le?vt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Le.getBoundingClientRect()):null,et=Oe?0:qe.top,tt=Oe?vt("nodeVisibilityFallback.clientHeight",()=>{var ut,ht;return(ht=(ut=ze.innerHeight)!=null?ut:Le?.clientHeight)!=null?ht:0}):qe.bottom,St=vt("nodeVisibilityFallback.node.getBoundingClientRect",()=>We.getBoundingClientRect());St.bottom>=et-500&&St.top<=tt+500&&Vr(_e,!0)},1800+Ee);y2.set(_e,Te)})(A);let se=null;se=Qe(()=>K.isVisible.value,_e=>{if(_e){sf(A),Vr(A,!0),se?.(),nf.delete(A),La.get(A)===K&&La.delete(A);try{K.destroy()}catch{}}},{immediate:!0}),nf.set(A,se),Nt.value&&zi()}function $1(){zo=null;for(const[A,H]of or)or.delete(A),Hi.get(A)===H.el&&zl.get(A)===H.version&&Qd(A,H.height,{allowShrink:H.allowShrink})}function Ua(){zo!=null&&(Gn?.(zo),zo=null),or.clear()}function df(A,H){(function(V,K,se){var _e;if(!Number.isFinite(se)||se<=0||Hi.get(V)!==K)return;const Ee=zl.get(V);if(Ee==null)return;const Te=rt.value[V],We=te.value&&j.value!==!0&&!((_e=s.nodes)!=null&&_e.length)&&V>=rt.value.length-2,Le=!(Te?.loading===!0||We),Ve=or.get(V),ze=Ve?Ve.allowShrink&&Le:Le,Oe=Ve&&!ze?Math.max(Ve.height,se):se;or.set(V,{height:Oe,allowShrink:ze,version:Ee,el:K}),zo==null&&(zo=zn?zn($1):null,zo==null&&$1())})(A,H,l2(A,H))}function rr(){for(const[A,H]of Hi)H&&df(A,H)}function Y2(){ct?.disconnect(),ct=null,ys.clear()}function L1(){for(;Xd.length;)tf(Xd.pop())}Qe(Ze,A=>{A&&Rn("content")},{flush:"post"}),t({getVirtualMetrics:jl,captureVirtualState:function(A={}){var H;return Da(jl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:A.allowFallbackAnchor===!0,requireViewport:A.requireViewport===!0,includeEmptyState:(H=A.includeEmptyState)==null||H})},restoreVirtualState:function(A,H={}){const V=H.restoreAnchor===!0,K=H.restoreToken==null?"imperative":String(H.restoreToken);cu=A,uu={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!b1(A,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&z2(A)||(cu=null,uu=null)},forceMeasure:function(A="manual"){return Qn(this,null,function*(){yield gt(),yield U2(),rr(),du(),yield gt();const H=jl(A);return E1(H,!0),H})},settle:w1,scrollToNode:function(A,H="start"){Pa(),qn();const V=rt.value.length;if(V<=0)return;const K=zs(A,0,V-1),se=()=>{var _e;const Ee=Cn({nodeIndex:K,offsetWithinNodePx:0}),Te=of(K),We=lu(),Le=(_e=We?.clientHeight)!=null?_e:0,Ve=Rt();let ze=Ee;if(H==="center")ze=Ee-Le/2+Te/2;else if(H==="end")ze=Ee-Le+Te;else if(H==="nearest"&&Ve!=null){if(Ee>=Ve&&Ee+Te<=Ve+Le)return;ze=Ee<Ve?Ee:Ee-Le+Te}Dt(Math.max(0,ze)),zi({immediate:!0}),Nt.value&&(si.value=K,Wl())};if(Nt.value)return si.value=K,Wl(),void gt(se);se()}}),Qe(()=>fs.value,A=>{if(!A){Y2();for(const H of qr.values())for(const V of H)tf(V);qr.clear(),zl.clear(),L1(),Ua()}},{immediate:!0}),Qe(j,A=>{A&&(function(){if(oe&&j.value&&Hi.size){L1();for(const H of[80,240,640]){const V=g2(H,()=>{for(const[K,se]of Hi)se&&df(K,se)},"final");V!=null&&Xd.push(V)}}})(),Rn(A?"final":"content")}),Qe([()=>rt.value.length,()=>vs.value],()=>{ot.value&&Ha(),Rn("content")},{flush:"post",immediate:!0}),Qe([()=>Ws.start,()=>Ws.end],()=>{Rn("batch")},{flush:"post"});const{cleanupBatchScheduler:D8}=(function(A){const{props:H,isClient:V,isTestEnv:K,parsedNodesIdentity:se,parsedNodeCount:_e,desiredRenderedCount:Ee,datasetKey:Te,batchingEnabled:We,incrementalRenderingActive:Le,resolvedBatchSize:Ve,resolvedInitialBatch:ze,renderedCount:Oe,adaptiveBatchSize:qe,previousRenderContext:et,previousBatchConfig:tt,requestFrame:St,cancelFrame:ut,hasIdleCallback:ht,cleanupNodeVisibility:Et,onDatasetKeyChanged:Ct,onDatasetChanged:rn}=A;let It=null,qt=null,zt=!1,pn=null,qo=null,ao=0,Ai=!1,Gr=!1;const Yr=new Set,Ql=new Set;function hb(){if(V){It!=null&&(ut?.(It),It=null),qt!=null&&(window.clearTimeout(qt),qt=null),qo!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(qo),qo=null),ao+=1;for(const Js of Yr)ut?.(Js);Yr.clear();for(const Js of Ql)window.clearTimeout(Js);Ql.clear(),zt=!1,pn=null,Ai=!1,Gr=!1}}function yf(){return typeof performance<"u"?performance.now():Date.now()}function pb(Js){(function(lr){var Zr;if(!Le.value)return;const ar=Math.max(2,(Zr=H.renderBatchBudgetMs)!=null?Zr:6),cr=Math.max(1,Ve.value||1),Mi=Math.max(1,Math.floor(cr/4));lr>1.2*ar?qe.value=Math.max(Mi,Math.floor(.7*qe.value)):lr<.5*ar&&qe.value<cr&&(qe.value=Math.min(cr,Math.ceil(1.2*qe.value)))})(Js),Ai=!1;const Mo=Gr||Oe.value<Ee.value;Gr=!1,Mo&&vb()}function mb(Js,Mo={}){var lr,Zr;if(!Le.value)return;const ar=Ee.value;if(Oe.value>=ar)return;const cr=Math.max(1,Js),Mi=()=>{const Va=yf();let Ka=0;It=null,qt=null,qo=null,zt=!1;const Ga=pn??cr;pn=null;const W1=yf();Oe.value=Math.min(ar,Oe.value+Ga),Et(Oe.value),Ka=yf()-W1,(function(z1,yb){if(!V)return void pb(yb);Ai=!0;const kb=++ao;gt().then(()=>{var bb;if(kb!==ao)return;const oE=yf(),iE=Math.max(yb,oE-z1),xb=()=>{kb===ao&&pb(iE)};if(St){let wb=!1,ur=null;const Sb=()=>{wb||(wb=!0,xb())},kf=St(()=>{Yr.delete(kf),ur!=null&&(window.clearTimeout(ur),Ql.delete(ur),ur=null),Sb()});return Yr.add(kf),ur=window.setTimeout(()=>{ur!=null&&Ql.delete(ur),ur=null,ut?.(kf),Yr.delete(kf),Sb()},Math.max(32,(bb=H.renderBatchIdleTimeoutMs)!=null?bb:120)),void Ql.add(ur)}const _b=window.setTimeout(()=>{Ql.delete(_b),xb()},0);Ql.add(_b)})})(Va,Ka)};if(!V||Mo.immediate)return void Mi();const Qr=Math.max(0,(lr=H.renderBatchDelay)!=null?lr:16);if(pn=pn!=null?Math.max(pn,cr):cr,!zt){if(zt=!0,!K&&ht&&window.requestIdleCallback){const Va=Math.max(0,(Zr=H.renderBatchIdleTimeoutMs)!=null?Zr:120);return void(qo=window.requestIdleCallback(()=>Mi(),{timeout:Va}))}St&&!K?It=St(()=>{Qr!==0?qt=window.setTimeout(()=>Mi(),Qr):Mi()}):qt=window.setTimeout(()=>Mi(),Qr)}}function gb(Js,Mo={}){Ai?Gr=!0:Js==null?vb():mb(Js,Mo)}function vb(){Le.value&&mb(We.value?Math.max(1,Math.round(qe.value)):Math.max(1,Ve.value))}return Qe([se,_e,Te,Le,Ve,ze,()=>H.renderBatchDelay],()=>{var Js;const Mo=_e.value,lr=et.value,Zr=Te.value,ar=!Object.is(Zr,lr.key),cr=Mo!==lr.total,Mi=ar||cr;et.value={key:Zr,total:Mo};const Qr=tt.value,Va=(Js=H.renderBatchDelay)!=null?Js:16,Ka=Qr.batchSize!==Ve.value||Qr.initial!==ze.value||Qr.delay!==Va||Qr.enabled!==Le.value;tt.value={batchSize:Ve.value,initial:ze.value,delay:Va,enabled:Le.value},ar&&Ct(Mo),(Mi||Ka||!Le.value)&&hb(),(Mi||Ka)&&(qe.value=Math.max(1,Ve.value||1)),Mi&&rn();const Ga=Ee.value;if(!Mo)return Oe.value=0,void Et(0);if(!Le.value)return Oe.value=Ga,void Et(Oe.value);const W1=ar||lr.total===0;Oe.value=W1||Ka?Math.min(Ga,ze.value):Math.min(Oe.value,Ga);const z1=Math.max(1,ze.value||Ve.value||Mo);Oe.value<Ga?gb(z1,{immediate:!V}):Et(Oe.value)},{immediate:!0}),Qe(Ee,(Js,Mo)=>{Le.value&&(typeof Mo=="number"&&Js<=Mo||Js>Oe.value&&gb())}),{cleanupBatchScheduler:hb}})({props:_,isClient:oe,isTestEnv:Ms,parsedNodesIdentity:Os,parsedNodeCount:xn,desiredRenderedCount:Jd,datasetKey:N8,batchingEnabled:Pi,incrementalRenderingActive:ni,resolvedBatchSize:_i,resolvedInitialBatch:So,renderedCount:vs,adaptiveBatchSize:sr,previousRenderContext:Co,previousBatchConfig:wi,requestFrame:zn,cancelFrame:Gn,hasIdleCallback:Di,cleanupNodeVisibility:S8,onDatasetKeyChanged:A=>{Ua(),Ci(),oi(),mu(),A>0&&lo(A)},onDatasetChanged:()=>{Nt.value&&zi({immediate:!0})}});Qe([u2,Nt,()=>S.value,()=>ce()],([A,H])=>{if(!A)return k2(),void Qm();C8(),H?zi({immediate:!0}):Qm()},{flush:"post",immediate:!0}),Qe([()=>rt.value.length,()=>Nt.value],A=>Qn(null,[A],function*([H,V]){V&&H&&oe&&(yield gt(),zi({immediate:!0}))}),{flush:"post"}),Qe(Ue,A=>{A&&(function(){var H;if(ls.value&&As.value&&nn.value&&((H=as.value)!=null&&H[1]))return;const V=mt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=mt({type:"list_item",children:[V],raw:"- Probe paragraph text"}),se=mt({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});ls.value=V,As.value=K,nn.value=se;const _e={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ee=1;Ee<=6;Ee++)_e[Ee]=mt({type:"heading",level:Ee,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ee)} Probe heading`});as.value=_e})()},{immediate:!0}),Qe([()=>S.value,Ue],()=>{if(!Ue.value)return t1(),void(U.value=0);x2(),t1(),Ue.value&&S.value&&typeof ResizeObserver<"u"&&(iu=new ResizeObserver(()=>{x2(),De.value&&Hs(),ot.value&&Ha(),Rn("resize")}),iu.observe(S.value))},{immediate:!0}),Qe([Ue,un,Uo],()=>Qn(null,null,function*(){if(!Ue.value)return Z.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void oi();yield gt(),(function(){if(!Ue.value||typeof window>"u")return Z.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void oi();const A={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=b2(e1(I.value),".paragraph-node");A.paragraph=K0(I.value,H,"pre-wrap");const V=e1(R.value),K=V?.querySelector(".paragraph-node");A.listItem=K0(R.value,K,"pre-wrap");const se=vt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ee,Te;return(Te=(Ee=B.value)==null?void 0:Ee.offsetHeight)!=null?Te:0}),_e=vt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ee,Te;return(Te=(Ee=R.value)==null?void 0:Ee.offsetHeight)!=null?Te:0});A.listWrapperOverhead=Math.max(0,se-_e);for(let Ee=1;Ee<=6;Ee++){const Te=b2(e1(P[Ee]),`h${Ee}`);A.headings[Ee]=K0(P[Ee],Te,"pre-wrap")}Z.value=A,oi()})()}),{flush:"post",immediate:!0}),Qe(()=>rt.value.length,()=>{Nt.value&&zi({immediate:!0})}),Qe([Ue,U],()=>{oi(),Nt.value&&zi({immediate:!0}),De.value&&Hs(),ot.value&&Ha(),Rn("resize")},{immediate:!1}),Qe(()=>Ur.value,A=>{if(A)for(const[H,V]of Yn)G2(H,V);else{Jm();for(const[H,V]of Yn)V&&Vr(H,!0)}},{immediate:!1}),Qe([()=>_.viewportPriority,()=>rt.value.length],([A,H])=>{A!==!1?z.value&&H<=200&&(z.value=!1):z.value=!1}),Qe(()=>vs.value,()=>{Nt.value&&zi({immediate:!0})}),Qe([si,Wn,ou,()=>rt.value.length,Nt],()=>{Wl()},{immediate:!0});let vu=null,yu=!1,qa=null;function ku(){vu=null,u1=null,c1=void 0,Ba=null,mu()}function F1(){Ua(),Ci(),oi(),$e.clear();const A=rt.value.length;A>0&&lo(A),x1()}function O1(){T1(),v2(),fu=null,Vl=null,Kl=null,cf=null,cu=null,uu=null,yu=!1,ku(),N2("restore"),qn(),Pa()}function bu(A){var H;return[(H=Ns())!=null?H:"",jn(),ir(),rf.value,pu(A),rt.value.length,Math.round(Kr(0,rt.value.length)),Math.round(ql()),Ge.count,Math.round(Ge.total)].join(":")}function Z2(){return Qn(this,null,function*(){var A,H,V,K;const se=(A=s.virtualScroll)==null?void 0:A.settledToken,_e=pu(se),Ee=jn(),Te=Ns(),We=Uo.value;if(Ht.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&lf(se))if(d1()){if(bu(se)!==Ba&&!yu){yu=!0;try{const Le=yield w1({reason:"manual",expectedSettledTokenKey:_e}),Ve=pu()===_e;_1(Ee,Te,We)&&Le.sessionKey===Ee&&Le.threadKey===Te&&Ve&&Le.stable&&Le.phase==="final"&&(Ba=bu((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{yu=!1,yield gt();const Le=(K=s.virtualScroll)==null?void 0:K.settledToken,Ve=lf(Le)?bu(Le):"";_1(Ee,Te,We)&&Ve&&Ba!==Ve&&Z2()}}}else Rn("manual")})}Qe(Ht,(A,H)=>{if(A!==H){if(!A)return O1(),void T1();O1(),F1(),qa=Uo.value,Rn("content")}},{flush:"post"}),Qe([Ht,Uo],([A,H])=>{A?qa!=null?qa!==H&&(qa=H,(function(V="resize"){Ua(),Ci(),oi(),$e.clear();const K=rt.value.length;K>0&&lo(K),x1(),Vl=null,Kl=null,cf=null,fu=null,yu=!1,ku(),W2(),gt(()=>{rr(),De.value&&Hs(),ot.value&&Ha(),Rn(V)})})("resize")):qa=H:qa=null},{flush:"post",immediate:!0}),Qe([Ht,()=>jn(),()=>Ns()],([A])=>{A&&(O1(),F1(),N2("content"),Rn("content"))}),Qe([Ht,()=>jn(),()=>Ns(),Uo,()=>rt.value.length],([A])=>{A&&(function(H="async-node"){let V=!1;for(const[K,se]of Array.from(Wi.entries()))l1(se)||(Wi.delete(K),Wo.delete(K),V=!0);V&&(Oa(),Rn(H))})("async-node")},{flush:"post"}),Qe([Ht,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.sessionKey},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>s.indexKey,()=>ee.value],([A])=>{A&&(mu(),(function(H="content"){if(!Ht.value)return;const V=[],K=rt.value.length;for(const se of Array.from($e.keys())){if(se>=K){V.push(se);continue}const _e=au(se),Ee=$e.get(se);Ee!=null&&Ee!==_e&&V.push(se),$e.set(se,_e)}for(const se of Array.from($e.keys()))se>=K&&$e.delete(se);V.length&&((function(se,_e={}){const Ee=Array.from(se,Number);Qs(Ee,_e)>0&&(function(We){for(const Le of We)$e.delete(Le)})(Ee)})(V,{notify:!1}),oi(),ku(),De.value&&Hs(),ot.value&&Ha(),Rn(H))})("content"))},{flush:"post",immediate:!0}),Qe([Ht,()=>rt.value.length,()=>jn(),()=>Ns()],([A,H,V,K],[se,_e,Ee,Te])=>{A&&se&&V===Ee&&K===Te&&H!==_e&&ku()},{flush:"post"}),Qe([Ht,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.heightCache},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.heightCacheWidth},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>rt.value.length,()=>jn(),U],()=>{W2()},{flush:"post",immediate:!0}),Qe([Ht,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreAnchor},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey},()=>rt.value.length,()=>jn(),U],A=>Qn(null,[A],function*([H,V]){if(!H||!V)return;yield gt();const K=(function(){var se;const _e=(se=s.virtualScroll)==null?void 0:se.restoreAnchor;return _e==null||_e===!1?null:_e===!0?"true":String(_e)})();b1(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Qe([Ht,U,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.measurementKey}],([A])=>{var H;if(!A)return;const V=(H=s.virtualScroll)==null?void 0:H.restoreState;V&&Vl&&Kl==="restore"&&(P2(V)||(F1(),Vl=null,Kl=null,Rn("resize")))},{flush:"post"}),Qe([Ht,()=>rt.value.length,()=>jn(),U],A=>Qn(null,[A],function*([H]){var V;const K=cu,se=uu;H&&K&&(yield gt(),!b1(K,{restoreAnchor:se?.restoreAnchor===!0,restoreToken:(V=se?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:se?.allowUncapturedAnchor===!0})&&z2(K)||(cu=null,uu=null))}),{flush:"post",immediate:!0}),Qe([Ht,j,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settleMode},()=>jn(),()=>Ns(),Uo,Ym,f2,()=>vs.value,Jd,()=>Ge.count,()=>Ge.total],([A,H,V])=>{if(!A||H!==!0||V==="manual"||!f1())return;const K=(function(){var se;const _e=rt.value.length;return[(se=Ns())!=null?se:"",jn(),ir(),rf.value,_e,Math.round(Kr(0,_e)),Math.round(ql()),Ge.count,Math.round(Ge.total)].join(":")})();vu!==K&&(vu=K,w1({reason:"final"}).then(se=>{se.stable||vu!==K||(vu=null)}))},{flush:"post",immediate:!0}),Qe([Ht,j,()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settleMode},()=>{var A;return(A=s.virtualScroll)==null?void 0:A.settledToken},()=>jn(),()=>Ns(),Uo,Ym,f2,()=>vs.value,Jd,()=>rt.value.length,()=>Ge.count,()=>Ge.total],()=>{Z2()},{flush:"post",immediate:!0}),Qe([()=>rt.value.length,Nt,Wn,ou,()=>Ws.start,()=>Ws.end],([A,H,V,K,se,_e])=>{X.value&&Ne("virtualization",{nodes:A,virtualization:H,maxLiveNodes:V,buffer:K,focusIndex:si.value,scroll:H?(()=>{const Ee=nt.value||me();return Ee?{reverse:q(Ee),scrollTop:Math.round(Ee.scrollTop),scrollTopAbs:Math.round(Math.abs(Ee.scrollTop)),scrollHeight:Math.round(Ee.scrollHeight),clientHeight:Math.round(Ee.clientHeight)}:null})():null,liveRange:{start:se,end:_e},rendered:vs.value})}),Qe([()=>_.customId],([A],H,V)=>{if(!A||hn)return;const K=(function(se,_e){return se?(Is.controllers[se]=_e,()=>{Is.controllers[se]===_e&&delete Is.controllers[se]}):()=>{}})(A,{captureRestoreAnchor:J,restoreAnchor:we,getAnchorDrift:Ae,getReport:M8});V(()=>{K()})},{immediate:!0}),ms(()=>{(function(){if(Ht.value)try{rr(),du();const A=jl("manual");q2(A)&&(E(A),fu=A,C1=hu());const H=Da(A,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(N(H),H.anchor&&F(H.anchor),Wa=gu(H))}catch{}})(),D8(),Jm(),Fe(),Y2();for(const A of qr.values())for(const H of A)tf(H);qr.clear(),zl.clear(),$e.clear(),L1(),Ua(),t1(),qn(),Pa(),T1(),k2(),Qm()});const P8=Ii({loader:()=>Qn(null,null,function*(){try{return(yield mo(()=>import("./index11-CQsnWOL1.js"),__vite__mapDeps([8,5]))).default}catch(A){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".',A),jo}}),loadingComponent:uee,delay:0}),H8=Ii({loader:()=>Qn(null,null,function*(){try{return(yield mo(()=>import("./index10-CEkQu_GO.js"),[])).default}catch(A){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.',A),jo}}),loadingComponent:cee,delay:0}),W8=Ii(()=>Qn(null,null,function*(){try{return(yield mo(()=>import("./index7-DwTyDXWL.js"),[])).default}catch(A){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".',A),jo}})),Q2={text:is,paragraph:ba,heading:_p,code_block:P0,list:Dc,list_item:Bc,blockquote:bh,table:rd,definition_list:xh,footnote:_h,footnote_reference:Qo,footnote_anchor:od,admonition:Ah,vmr_container:Sh,hardbreak:Sl,link:xo,image:wl,thematic_break:wh,math_inline:Ri,math_block:PM,strong:ko,emphasis:_o,strikethrough:bo,highlight:Jo,insert:Do,subscript:Bo,superscript:Ro,emoji:Oo,checkbox:Zo,checkbox_input:Zo,inline_code:ro,html_inline:Xo,reference:yo,html_block:id},z8=D(()=>i1()),X2=D(()=>KS(_.codeBlockProps)),U8=D(()=>KS(_.codeBlockProps,{omit:["langs"]})),J2=D(()=>lt(lt({stream:_.codeBlockStream,darkTheme:_.codeBlockDarkTheme,lightTheme:_.codeBlockLightTheme,monacoOptions:_.codeBlockMonacoOptions,themes:_.themes,langs:u.value==="shiki"?_.langs:void 0,minWidth:_.codeBlockMinWidth,maxWidth:_.codeBlockMaxWidth},typeof le.value=="boolean"?{showTooltips:le.value}:{}),U8.value)),eb=D(()=>lt(Pt(lt({},J2.value),{langs:_.langs}),X2.value));function tb(A){return typeof A=="boolean"?A:void 0}const q8=D(()=>{const A=_.codeBlockProps||{},H={},V=tb(A.showLineNumbers);V!==void 0&&(H.showLineNumbers=V);const K=tb(A.diffInline);K!==void 0&&(H.diffInline=K);const se=(function(_e){const Ee=Number(_e);return Number.isFinite(Ee)&&Ee>0?Ee:void 0})(A.reservedHeightPx);return se!==void 0&&(H.reservedHeightPx=se),H}),j8=D(()=>lt(lt({stream:_.codeBlockStream,darkTheme:_.codeBlockDarkTheme,lightTheme:_.codeBlockLightTheme,themes:_.themes,langs:_.langs,minWidth:_.codeBlockMinWidth,maxWidth:_.codeBlockMaxWidth},typeof le.value=="boolean"?{showTooltips:le.value}:{}),X2.value)),V8=D(()=>lt({},_.mermaidProps||{})),nb=D(()=>lt({},_.d2Props||{})),K8=D(()=>lt({},_.infographicProps||{})),xu=D(()=>({typewriter:_.typewriter,fade:_.fade,customHtmlTags:Pn.value.customHtmlTags})),G8=D(()=>lt(lt({},xu.value),typeof le.value=="boolean"?{showTooltip:le.value}:{})),Y8=D(()=>lt(lt({},xu.value),typeof le.value=="boolean"?{showTooltips:le.value}:{})),Z8=D(()=>lt(lt({},xu.value),typeof le.value=="boolean"?{showTooltips:le.value}:{})),Q8=D(()=>lt(lt({},xu.value),typeof le.value=="boolean"?{showTooltips:le.value}:{}));function X8(A){return Array.isArray(A.children)&&A.children.length>0}const R1=D(()=>A8.value.map(A=>{var H,V,K,se,_e,Ee,Te,We;let Le=(function(ut){var ht,Et,Ct,rn,It,qt,zt;if(ut.type!=="code_block")return ut;const pn=ut,qo=[String((ht=pn.language)!=null?ht:""),String((Et=pn.loading)!=null?Et:""),String((Ct=pn.diff)!=null?Ct:""),String((rn=pn.code)!=null?rn:""),String((It=pn.originalCode)!=null?It:""),String((qt=pn.updatedCode)!=null?qt:""),String((zt=pn.raw)!=null?zt:"")].join("\0"),ao=be.get(pn);if(ao&&ao.signature===qo)return ao.node;const Ai=lt({},pn);return be.set(pn,{signature:qo,node:Ai}),Ai})(A.node);const Ve=ff(Le);let ze=rb(Le,Ve);if((Le.type==="html_block"||Le.type==="html_inline")&&ze===Q2[Le.type]){const ut=Le,ht=String((H=ut.tag)!=null?H:"").trim().toLowerCase()||T6(ut.content);if(ht){const Et=Zt.value[ht];if(bn.value.has(ht)&&Et)ze=Et,Le=Pt(lt({},ut),{type:ht,tag:ht,content:AV(ut.content,ht)});else if(N6((V=ut.content)!=null?V:ut.raw,ht)){const Ct=String((se=(K=ut.content)!=null?K:ut.raw)!=null?se:"");Le.type==="html_inline"?(ze=is,Le={type:"text",content:Ct,raw:Ct}):(ze=ba,Le={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const Oe=Le.type==="code_block"&&u.value==="pre"&&ze===jo&&!B1(Zt.value,Ve);let qe=lt({},(function(ut,ht,Et){const Ct=ht??ff(ut);if(ut.type==="code_block"){const rn=Ct?B1(Zt.value,Ct):void 0;if(Et&&u.value==="pre"&&!rn&&Et===jo)return q8.value;if(Et&&Ct&&Et===rn)return Ct==="mermaid"?ob(ut):Ct==="infographic"?ib(ut):Ct==="d2"||Ct==="d2lang"?nb.value:eb.value;if(Et&&Et===Zt.value.code_block)return eb.value;if(w2(Et))return j8.value}return Ct==="mermaid"?ob(ut):Ct==="infographic"?ib(ut):Ct==="d2"||Ct==="d2lang"?nb.value:ut.type==="link"?G8.value:ut.type==="list"?Y8.value:ut.type==="blockquote"?Z8.value:ut.type==="table"?Q8.value:ut.type==="code_block"?J2.value:xu.value})(Le,Ve,ze));const et=Ul.value[A.index];Le.type==="code_block"&&et?.kind==="code-block"&&(qe=Pt(lt({},qe),Oe?{reservedHeightPx:(_e=et.height)!=null?_e:et.contentHeight}:{estimatedHeightPx:et.height,estimatedContentHeightPx:et.contentHeight})),Oe||Le.type!=="code_block"||Ve!=="mermaid"||xc(qe.estimatedPreviewHeightPx)!=null||(qe=Pt(lt({},qe),{estimatedPreviewHeightPx:kv(vv(String((Ee=Le.code)!=null?Ee:"")))})),Oe||Le.type!=="code_block"||Ve!=="infographic"||xc(qe.estimatedPreviewHeightPx)!=null||(qe=Pt(lt({},qe),{estimatedPreviewHeightPx:bv(yv(String((Te=Le.code)!=null?Te:"")))})),Le.type==="math_block"&&(qe=Pt(lt({},qe),{cacheScope:Un.value}));const tt=(function(ut,ht){const Et=String(ut.type);return!Kd(Et)&&Zt.value[Et]===ht})(Le,ze),St=tt?vk(Le,He.value):void 0;return Pt(lt({},A),{node:Le,component:ze,bindings:qe,customBindings:lt(lt({},St??{}),qe),rendersCustomNode:tt,hasSlotChildren:X8(Le),slotContent:String((We=Le.content)!=null?We:""),isCodeBlock:Le.type==="code_block",indexKey:`${z8.value}-${A.index}`})}));function ff(A){var H;return A?.type==="code_block"?String((H=A.language)!=null?H:"").trim().toLowerCase():""}function B1(A,H){const V=H.trim().toLowerCase();if(V)for(const K of[V,uk(V),SM(V)]){const se=K&&A[K];if(se)return se}}function sb(A,H,V,K){var se,_e;const Ee=lt({},A.value);return xc(Ee.estimatedPreviewHeightPx)==null&&(Ee.estimatedPreviewHeightPx=K(V(String((se=H?.code)!=null?se:"")),void 0,Ee.maxHeight==="none"?null:(_e=xc(Ee.maxHeight))!=null?_e:void 0)),Ee}function ob(A){return sb(V8,A,vv,kv)}function ib(A){return sb(K8,A,yv,bv)}function rb(A,H){if(!A)return Nv;const V=Zt.value,K=V[String(A.type)];if(A.type==="code_block"){const se=H??ff(A),_e=se?B1(V,se):void 0;return _e||(u.value==="pre"?V.code_block||jo:se==="mermaid"?V.mermaid||P8:se==="infographic"?V.infographic||H8:se==="d2"||se==="d2lang"?V.d2||W8:K||V.code_block||S2.value)}return K||Q2[String(A.type)]||Nv}function D1(A){o("click",A)}function J8(A){var H;(H=A.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",A)}function eE(A){var H;(H=A.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",A)}function lb(A){o("mouseover",A)}function ab(A){o("mouseout",A)}const Zl=Q(null),Ui=Q(!1);let _u,ja=null,P1=0,hf=0,pf=0;const cb=["code_block","admonition","table","math_block","html_block","image","thematic_break"],tE=new Set(cb),ub=[".typewriter-cursor",".height-estimation-probes",...cb.map(A=>`[data-node-type="${A}"]`),"script","style"].join(",");function db(A){if(!A||typeof A!="object")return!1;const H=A.type;return typeof H=="string"&&tE.has(H)}function mf(A){var H,V;if(!A||typeof A!="object")return 0;const K=A,se=(V=(H=K.raw)!=null?H:K.content)!=null?V:K.code;if(typeof se=="string")return se.length;const _e=K.children;if(Array.isArray(_e))return _e.reduce((Te,We)=>Te+mf(We),0);const Ee=K.items;return Array.isArray(Ee)?Ee.reduce((Te,We)=>Te+mf(We),0):0}function gf(){_u&&(clearTimeout(_u),_u=void 0)}function fb(){P1+=1,ja!=null&&(Gn?.(ja),ja=null)}function vf(){fb(),Zl.value&&(Zl.value.style.visibility="hidden")}function nE(A){var H;if(A.nodeType!==Node.TEXT_NODE||!((H=A.textContent)!=null?H:"").trim())return!1;const V=A.parentElement;return!!V&&!V.closest(ub)}function sE(A){let H=A.lastChild;for(;H;){if(nE(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const V=H;if(!V.matches(ub)&&V.lastChild){H=V.lastChild;continue}}for(;H&&H!==A&&!H.previousSibling;)H=H.parentNode;if(!H||H===A)break;H=H.previousSibling}return null}function H1(){if(!oe||!Ui.value||ja!=null)return;const A=P1,H=()=>{ja=null,A===P1&&(function(){var V,K;if(!(oe&&Ui.value&&S.value&&Zl.value))return;const se=S.value,_e=Zl.value;_e.style.visibility="hidden";const Ee=(function(){const ze=R1.value;for(let Oe=ze.length-1;Oe>=0;Oe--){const qe=ze[Oe];if(!qe||db(qe.node)||!I1(qe.index))continue;const et=Yn.get(qe.index);if(!et)continue;const tt=sE(et);if(tt)return tt}return null})();if(!Ee)return;let Te=0,We=0,Le=20,Ve=!1;if(Ee?.textContent){const ze=Ee.textContent.length,Oe=document.createRange();Oe.setStart(Ee,Math.max(0,ze-1)),Oe.setEnd(Ee,ze);const qe=typeof Oe.getClientRects=="function"?Oe.getClientRects():void 0,et=(K=qe?.[qe.length-1])!=null?K:(V=Ee.parentElement)==null?void 0:V.getBoundingClientRect();if(et){const tt=vt("typewriterCursor.root.getBoundingClientRect",()=>se.getBoundingClientRect());Te=et.right-tt.left+se.scrollLeft,We=et.top-tt.top+se.scrollTop,Le=et.height||Le,Ve=!0}Oe.detach()}Ve&&(_e.style.transform=`translate(${Math.max(0,Te)}px, ${Math.max(0,We)}px)`,_e.style.height=`${Le}px`,_e.style.visibility="visible")})()};zn?ja=zn(H):H()}return Qe([ye,()=>s.content,()=>s.nodes,()=>_.typewriter,j],()=>Qn(null,null,function*(){var A,H;if(!oe||Y.value||!G.value)return;if(j.value)return Ui.value=!1,gf(),void vf();if((A=s.nodes)!=null&&A.length)return Ui.value=!1,gf(),vf(),hf=((H=s.content)!=null?H:"").length,void(pf=ye.value.length);const V=(function(){var Te,We;return(Te=s.nodes)!=null&&Te.length?s.nodes.reduce((Le,Ve)=>Le+mf(Ve),0):((We=s.content)!=null?We:"").length})(),K=(function(){var Te;return(Te=s.nodes)!=null&&Te.length?s.nodes.reduce((We,Le)=>We+mf(Le),0):ye.value.length})(),se=!db(rt.value[rt.value.length-1]),_e=V>hf,Ee=K>pf;if(_.typewriter===!1||!se||!_e&&!Ee)return _.typewriter!==!1&&se||(Ui.value=!1,vf()),hf=V,void(pf=K);hf=V,pf=K,Ui.value=!0,Zl.value&&(Zl.value.style.visibility="hidden"),gf(),yield gt(),H1(),_u=setTimeout(()=>{_u=void 0,Ui.value=!1},3e3)}),{flush:"post",immediate:!0}),Qe(Ui,A=>Qn(null,null,function*(){A?(yield gt(),H1()):vf()}),{flush:"post"}),Qe([()=>vs.value,()=>Ws.start,()=>Ws.end],()=>Qn(null,null,function*(){oe&&!Y.value&&G.value&&Ui.value&&(yield gt(),H1())}),{flush:"post"}),ms(()=>{gf(),fb(),Kn.clear()}),(A,H)=>{const V=NT("NodeRenderer",!0);return C(Y)?(b(!0),T(Be,{key:0},st(R1.value,K=>(b(),T(Be,{key:K.index},[K.rendersCustomNode?(b(),ke(Vs(K.component),_n({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onClick:D1,onMouseover:lb,onMouseout:ab,onCopy:H[0]||(H[0]=se=>o("copy",se)),onHandleArtifactClick:H[1]||(H[1]=se=>o("handleArtifactClick",se))}),{default:Me(()=>[K.hasSlotChildren?(b(),ke(V,_n({key:0,ref_for:!0},Hn.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?(b(),ke(V,_n({key:1,ref_for:!0},Hn.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"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ke(Vs(K.component),_n({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onClick:D1,onMouseover:lb,onMouseout:ab,onCopy:H[2]||(H[2]=se=>o("copy",se)),onHandleArtifactClick:H[3]||(H[3]=se=>o("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),T("div",{key:1,ref_key:"containerRef",ref:S,class:Pe(["markstream-vue markdown-renderer",[{dark:_.isDark},{virtualized:Nt.value},{"virtual-scroll-coordinated":Ze.value}]]),"data-custom-id":_.customId,onClick:D1,onMouseover:J8,onMouseout:eE},[Ft.value||Nt.value?(b(),T(Be,{key:0},[Ft.value?(b(),T("div",{key:0,class:"height-estimation-probes",style:Gt({width:`${un.value}px`}),"aria-hidden":"true"},[w("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[ie(C(ba),{node:ls.value,"index-key":"probe-paragraph"},null,8,["node"])],512),w("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[w("ul",fee,[ie(C(Bc),{node:As.value,"index-key":"probe-list-item"},null,8,["node"])])],512),w("div",{ref_key:"listProbeWrapperRef",ref:B,class:"node-content","data-probe":"list"},[ie(C(Dc),{node:nn.value,"index-key":"probe-list"},null,8,["node"])],512),(b(),T(Be,null,st(6,K=>w("div",{key:`probe-heading-${K}`,ref_for:!0,ref:se=>(function(_e,Ee){_e<1||_e>6||(P[_e]=Ee)})(K,se),class:"node-content","data-probe":`heading-${K}`},[ie(C(_p),{node:w8(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,hee)),64))],4)):re("",!0),Nt.value?(b(),T("div",{key:1,class:"node-spacer",style:Gt({height:`${s1.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],64)):re("",!0),(b(!0),T(Be,null,st(R1.value,K=>(b(),T("div",{key:K.index,ref_for:!0,ref:se=>G2(K.index,se),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[I1(K.index)?(b(),T("div",{key:0,ref_for:!0,ref:se=>(function(_e,Ee){var Te;Ee||(function(ze){const Oe=`${i1()}-${ze}`;let qe=!1;for(const et of Array.from(Wo.keys())){const tt=Wi.get(et);(tt?.index===ze||et===Oe||et.startsWith(`${Oe}-`))&&(Wo.delete(et),Wi.delete(et),qe=!0)}qe&&(Oa(),Rn("async-node"))})(_e),or.delete(_e),(function(ze){var Oe;const qe=((Oe=zl.get(ze))!=null?Oe:0)+1;zl.set(ze,qe)})(_e);const We=qr.get(_e);if(We){for(const ze of We)tf(ze);qr.delete(_e)}if((function(ze){const Oe=ys.get(ze);Oe&&(ct?.unobserve(Oe),Ao.delete(Oe),ys.delete(ze))})(_e),!Ee||!fs.value)return Hi.delete(_e),void zl.delete(_e);Hi.set(_e,Ee);const Le=()=>{df(_e,Ee)};queueMicrotask(Le);const Ve=(ct||typeof ResizeObserver>"u"||(ct=new ResizeObserver(ze=>{if(ze.length)for(const Oe of ze){const qe=Ao.get(Oe.target),et=ys.get(qe??-1);qe!=null&&et&&df(qe,et)}else rr()})),ct);if(Ve&&(ys.set(_e,Ee),Ao.set(Ee,_e),Ve.observe(Ee)),typeof window<"u"){const ze=((Te=rt.value[_e])==null?void 0:Te.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(ze.length){const Oe=ze.map(qe=>g2(qe,Le,"node-resize")).filter(qe=>qe!=null);Oe.length&&qr.set(_e,Oe)}}})(K.index,se),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(b(),ke(Vs(K.component),_n({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[8]||(H[8]=se=>o("copy",se)),onHandleArtifactClick:H[9]||(H[9]=se=>o("handleArtifactClick",se))}),{default:Me(()=>[K.hasSlotChildren?(b(),ke(V,_n({key:0,ref_for:!0},Hn.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?(b(),ke(V,_n({key:1,ref_for:!0},Hn.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"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ke(Vs(K.component),_n({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[10]||(H[10]=se=>o("copy",se)),onHandleArtifactClick:H[11]||(H[11]=se=>o("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),ke(El,{key:0,name:"fade",css:_.fade!==!1,appear:_.fade!==!1},{default:Me(()=>[K.rendersCustomNode?(b(),ke(Vs(K.component),_n({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[4]||(H[4]=se=>o("copy",se)),onHandleArtifactClick:H[5]||(H[5]=se=>o("handleArtifactClick",se))}),{default:Me(()=>[K.hasSlotChildren?(b(),ke(V,_n({key:0,ref_for:!0},Hn.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?(b(),ke(V,_n({key:1,ref_for:!0},Hn.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"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),ke(Vs(K.component),_n({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":_.customId,"is-dark":_.isDark,onCopy:H[6]||(H[6]=se=>o("copy",se)),onHandleArtifactClick:H[7]||(H[7]=se=>o("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),T("div",{key:1,class:"node-placeholder",style:Gt({height:`${of(K.index)}px`})},null,4))],8,pee))),128)),Ui.value?(b(),T("span",{key:1,ref_key:"typewriterCursorRef",ref:Zl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):re("",!0),Nt.value?(b(),T("div",{key:2,class:"node-spacer",style:Gt({height:`${o1.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],42,dee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Po=XM;Po.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Po.__name,Po.name].filter(n=>!!n));for(const n of t)e.component(n,XM)};const Sk=Object.freeze(Object.defineProperty({__proto__:null,default:Po},Symbol.toStringTag,{value:"Module"})),mee={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"},gee={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"},vee={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"},yee={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"},kee={class:"admonition-title"},bee=["aria-expanded","aria-controls"],xee=["id"],Ah=kn(Ye({__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=D(()=>{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=Q(!!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)=>(b(),T("div",{class:Pe(["admonition",[`admonition-${s.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(b(),T("svg",mee,[...u[1]||(u[1]=[w("circle",{cx:"12",cy:"12",r:"10"},null,-1),w("path",{d:"M12 16v-4"},null,-1),w("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(b(),T("svg",gee,[...u[2]||(u[2]=[w("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),w("path",{d:"M9 18h6"},null,-1),w("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(b(),T("svg",vee,[...u[3]||(u[3]=[w("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),w("path",{d:"M12 9v4"},null,-1),w("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(b(),T("svg",yee,[...u[4]||(u[4]=[w("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),w("path",{d:"M12 8v4"},null,-1),w("path",{d:"M12 16h.01"},null,-1)])])):re("",!0),w("span",kee,O(i.value),1),s.node.collapsible?(b(),T("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),T("svg",{style:Gt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[w("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,bee)):re("",!0)]),Ln(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(Po),{"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,xee),[[pi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Ah.install=e=>{e.component(Ah.__name,Ah)};const JM=()=>mo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Yf=null,_ee=JM;function F_e(){return Qn(this,null,function*(){if(Yf)return Yf;const e=_ee;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===JM?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(Yf=(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),Yf):null})}function O_e(){return!1}function R_e(){return Qn(this,null,function*(){return null})}const Zf=Q(!1);let oC=!1;function Y0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function wee(){return!oC&&typeof window<"u"&&typeof document<"u"&&(oC=!0,Zf.value=Y0(),new MutationObserver(()=>{Zf.value=Y0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Zf.value=Y0()})),Zf}const e5=["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"],See=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Ov=[...e5].sort((e,t)=>t.length-e.length).join("|"),Z0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Ov}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Ov})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),t5=/[),.;!?,。;!?)]+$/;function Cee(e){const t=e.toLowerCase();return e5.some(n=>t.endsWith(`.${n}`))}function Aee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Ov}))["']`,"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 Mee(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(t5,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=See.has(i),a=Cee(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 Eee(e,t={}){const n=[];Z0.lastIndex=0;let s;for(;(s=Z0.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(t5,""),u=a.length-c.length;a=c;const d=Mee(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&&(Z0.lastIndex-=u)}return n}const Tee=12e4,Nee=6e4,Iee=32,$ee=3e4,iC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Lee(e){let t=0,n=0,s=0;iC.lastIndex=0;let o;for(;(o=iC.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=Tee||n>=Nee||t>=Iee||s>=$ee?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Fee(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Oee(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Ree={key:1,class:"diff-wrap"},Bee={class:"diff-bar"},Dee=["aria-label","onClick"],Pee={class:"diff-pre"},Hee={key:0,class:"diff-sign"},Wee={class:"diff-text"},zee="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",rC="github-light",lC="github-dark",Uee=Ye({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){yQ(),IQ(),bQ(),RQ(),kQ(new Fee),OQ(new Oee);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Tt(),s=Vt("resolveImage"),o=Q(null),i=e,r=D(()=>!i.streaming),l=D(()=>Aee(i.text??"")),a=D(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Lee(i.text??"")),c=wee(),u=D(()=>!i.streaming),d=Ps(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(R){return!/^(https?:|data:|blob:)/i.test(R)}function x(R){if(!s)return;const B=[];for(const P of[h,p]){P.lastIndex=0;let z;for(;(z=P.exec(R))!==null;)B.push(z[2]??"")}for(const P of B)!P||!m(P)||d.has(P)||f.has(P)||(f.add(P),s(P).then(z=>{d.set(P,z!==P?z:"")}).catch(()=>{d.set(P,"")}).finally(()=>{f.delete(P)}))}function k(R){if(!s)return R;const B=P=>{if(!m(P))return null;const z=d.get(P);return z===void 0?zee:z===""?null:z};return R.replace(h,(P,z,W,ee)=>{const U=B(W);return U===null?P:`${z}${U}${ee}`}).replace(p,(P,z,W,ee)=>{const U=B(W);return U===null?P:`${z}${U}${ee}`})}Qe(()=>i.text,R=>x(R??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),B=[];let P=R.nextNode();for(;P;){const z=P,W=z.parentElement;W&&!W.closest("a, pre, .md-file-link, svg")&&z.data.trim().length>0&&B.push(z),P=R.nextNode()}for(const z of B){const W=Eee(z.data,{aliases:l.value});if(W.length===0||!z.parentNode)continue;const ee=document.createDocumentFragment();let U=0;for(const Z of W){Z.start>U&&ee.append(document.createTextNode(z.data.slice(U,Z.start)));const ce=document.createElement("button");ce.type="button",ce.className="md-file-link",ce.textContent=Z.text,ce.title=Z.line?`${Z.path}:${Z.line}`:Z.path,ce.addEventListener("click",fe=>{fe.preventDefault(),fe.stopPropagation(),i.openFile?.({path:Z.path,line:Z.line})}),ee.append(ce),U=Z.end}U<z.data.length&&ee.append(document.createTextNode(z.data.slice(U))),z.parentNode.replaceChild(ee,z)}}function v(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function y(R){let B=R.length;for(const P of["#","?"]){const z=R.indexOf(P);z!==-1&&z<B&&(B=z)}return R.slice(0,B)}function M(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const B of R){if(B.dataset.mdLinkHandled==="true"||B.closest("svg"))continue;const P=B.getAttribute("href")??"";v(P)&&(B.dataset.mdLinkHandled="true",B.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(P)})}))}}function L(){gt().then(()=>{g(),M()})}Qe(()=>i.text,L),Qe(()=>i.streaming,L);let $=null;yn(()=>{L(),o.value&&($=new MutationObserver(L),$.observe(o.value,{childList:!0,subtree:!0}))}),Sn(()=>{$?.disconnect()});const _={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,N=D(()=>{const R=k(i.text??""),B=[];let P=0;E.lastIndex=0;let z;for(;(z=E.exec(R))!==null;){const ee=z[1]??"",U=R.slice(P,z.index)+(ee||"");U.trim()&&B.push({kind:"md",text:U}),B.push({kind:"diff",code:z[2]??""}),P=E.lastIndex}const W=R.slice(P);return(W.trim()||B.length===0)&&B.push({kind:"md",text:W}),B});function F(R){return R.split(`
281
+ `).map(B=>B.startsWith("@@")?{type:"hunk",sign:"",text:B}:/^\+(?!\+\+)/.test(B)?{type:"add",sign:"+",text:B.slice(1)}:/^-(?!--)/.test(B)?{type:"del",sign:"-",text:B.slice(1)}:B.startsWith(" ")?{type:"ctx",sign:"",text:B.slice(1)}:{type:"ctx",sign:"",text:B})}const S=Q(null);function I(R,B){io(R).then(P=>{P&&(S.value=B,setTimeout(()=>{S.value=null},1400))})}return(R,B)=>(b(),T("div",{ref_key:"mdRef",ref:o,class:"md"},[(b(!0),T(Be,null,st(N.value,(P,z)=>(b(),T(Be,{key:z},[P.kind==="md"?(b(),ke(C(Po),{key:0,content:P.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":rC,"code-block-dark-theme":lC,themes:[rC,lC],"code-block-props":_,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"])):(b(),T("div",Ree,[w("div",Bee,[B[0]||(B[0]=w("span",{class:"diff-lang"},"diff",-1)),ie(Yt,{text:C(n)("filePreview.copyCode")},{default:Me(()=>[w("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:W=>I(P.code,z)},[ie(je,{name:S.value===z?"check":"copy",size:"sm"},null,8,["name"])],8,Dee)]),_:2},1032,["text"])]),w("pre",Pee,[w("code",null,[(b(!0),T(Be,null,st(F(P.code),(W,ee)=>(b(),T("span",{key:ee,class:Pe(["diff-line",`diff-${W.type}`])},[W.type!=="hunk"?(b(),T("span",Hee,O(W.sign),1)):re("",!0),w("span",Wee,O(W.text),1)],2))),128))])])]))],64))),128))],512))}}),Lm=dt(Uee,[["__scopeId","data-v-135142ed"]]),qee={class:"tc-anim"},jee={class:"prev-anim"},Vee={class:"prev"},Kee=Ye({__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=D(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=D(()=>n.foldable&&o.value.length>1),r=D(()=>n.streaming||!i.value),l=D(()=>o.value.at(-1)??""),a=Q(null);return yn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Qe(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||gt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(b(),T("div",{class:Pe(["think",{mob:e.mobile}])},[i.value?(b(),T("div",{key:0,class:Pe(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[w("div",qee,[w("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),w("div",jee,[w("span",Vee,O(l.value),1)])],2)):(b(),T("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),Gee=dt(Kee,[["__scopeId","data-v-fdc551ea"]]),Yee={class:"activity-notice",role:"status"},Zee={"aria-hidden":"true"},Qee={class:"an-label"},Xee=Ye({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(b(),T("div",Yee,[w("span",Zee,[ie(Ho,{size:"sm"})]),w("span",Qee,O(e.label),1)]))}}),Jee=dt(Xee,[["__scopeId","data-v-0d497074"]]);function ete(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 tte=Ye({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Tt(),s=Q(!1),o=D(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=D(()=>s.value?o.value:ete(t.time,n("conversation.yesterday")));function r(){s.value=!s.value}return(l,a)=>(b(),T("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},O(i.value),1))}}),n5=dt(tte,[["__scopeId","data-v-9672fbd5"]]);function nte(e){return e.length===1?`0${e}`:e}function ste(e,t){return`${String(Number(e))}:${nte(t)}`}const aC=e=>/^\d+$/.test(e);function ote(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[s,o,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(s==="*"&&o==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(s);if(u&&o==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(s==="0"&&o==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(o);if(s==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(aC(s)&&aC(o)&&c){const f=ste(o,s);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const ite=["data-turn-id"],rte={class:"cn-bubble"},lte={class:"cn-title"},ate={key:0,class:"cn-prompt"},cte={class:"cn-meta"},ute={key:0,class:"cn-meta-item"},dte={key:1,class:"cn-meta-item"},fte=["aria-label"],hte=["title"],pte=Ye({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Tt(),s=D(()=>t.cron),o=D(()=>s.value?.missedCount!==void 0),i=D(()=>o.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=D(()=>{const u=s.value?.cron;return u?ote(u,n):""}),l=D(()=>o.value?"error":"ok"),a=D(()=>{const u=s.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=D(()=>t.text??"");return(u,d)=>(b(),T("div",{class:Pe(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[w("div",rte,[w("span",lte,O(i.value),1),c.value?(b(),T("span",ate,O(c.value),1)):re("",!0)]),w("div",cte,[ie(je,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(b(),T("span",ute,O(r.value),1)):re("",!0),a.value?(b(),T("span",dte,O(a.value),1)):re("",!0),w("span",{class:Pe(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(b(),ke(je,{key:0,name:"check",size:"sm"})):(b(),ke(je,{key:1,name:"close",size:"sm"}))],10,fte),s.value?.jobId?(b(),T("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:s.value.jobId})},O(s.value.jobId),9,hte)):re("",!0),e.createdAt?(b(),ke(n5,{key:3,time:e.createdAt},null,8,["time"])):re("",!0)])],10,ite))}}),mte=dt(pte,[["__scopeId","data-v-a62a6587"]]),gte=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],s5=500,Cp=256*1024,cC=200,Q0=16384,X0=500,J0=50,eg=50,vte=6,yte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,kte=/^[A-Za-z0-9+/=_-]{200,}$/;let tg=null;function Bi(){if(tg!==null)return tg;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=rs(Lt.debug)==="1"),tg=e,e}const Cl=[],_c=[];let Pu=0;const ca=[];let Hu=0,bte=1;const Ap=new TextEncoder,xte=new Set(gte),Ck=Q(0),Wu=Ta(!1);function _te(){return Cl}function wte(){Cl.length=0,_c.length=0,Pu=0,ca.length=0,Hu=0,Ck.value++}function zr(e){if(!Wu.value){try{const t={id:bte++,ts:Date.now(),source:e.source,kind:String(Pc(e.kind)),label:String(Pc(e.label)),sessionId:e.sessionId===void 0?void 0:String(Pc(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Dl(e.detail)},n=JSON.stringify(t),s=Ap.encode(n).byteLength;if(s>Cp)return;for(Cl.push(t),_c.push(n),Pu+=s+(_c.length>1?1:0);Cl.length>s5||Pu>Cp;){const o=_c.shift();Cl.shift(),o!==void 0&&(Pu-=Ap.encode(o).byteLength,_c.length>0&&(Pu-=1))}}catch{return}Ck.value++}}function tc(e){if(typeof e=="string")return e.length<=cC?e:e.slice(0,cC)}function ri(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Ste(e,t){if(xte.has(e))try{const n={ts:Date.now(),event:e,sessionId:tc(t?.sessionId),status:tc(t?.status),seq:ri(t?.seq),durationMs:ri(t?.durationMs),messageCount:ri(t?.messageCount),contentCount:ri(t?.contentCount),mediaCount:ri(t?.mediaCount),sessionCount:ri(t?.sessionCount),workspaceCount:ri(t?.workspaceCount),promptId:tc(t?.promptId),zipBytes:ri(t?.zipBytes),errorName:tc(t?.errorName),errorCode:ri(t?.errorCode),requestId:tc(t?.requestId),phase:tc(t?.phase),httpStatus:ri(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:ri(t?.line),col:ri(t?.col)},s=JSON.stringify(n),o=Ap.encode(s).byteLength;if(o>Cp)return;for(ca.push(s),Hu+=o+(ca.length>1?1:0);ca.length>s5||Hu>Cp;){const i=ca.shift();i!==void 0&&(Hu-=Ap.encode(i).byteLength,ca.length>0&&(Hu-=1))}}catch{return}}function Pc(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return kte.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>X0?`${i.slice(0,X0)}… [+${i.length-X0} chars]`:i}if(n!=="object")return String(e);if(t>=vte)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,J0).map(r=>Pc(r,t+1));return e.length>J0&&i.push(`[+${e.length-J0} more items]`),i}const s={},o=Object.entries(e);for(const[i,r]of o.slice(0,eg))s[i]=yte.test(i)?"[redacted]":Pc(r,t+1);return o.length>eg&&(s._truncatedKeys=o.length-eg),s}function Dl(e){if(e===void 0)return;const t=Pc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Q0)return{_truncated:`detail JSON was ${n.length} chars; first ${Q0} kept`,preview:n.slice(0,Q0)}}catch{return"[unserializable detail]"}return t}function Qf(e){Bi()&&zr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Dl(e.body)}})}function nc(e){if(!Bi())return;const t=e.code!==0;zr({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:Dl(e.data)}})}function il(e){Bi()&&zr({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 sc(e,t){Bi()&&zr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Dl(t)})}function Cte(e){if(!Bi())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;zr({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:Dl(e)})}function Ate(e){if(!Bi())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);zr({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Dl(t.payload)})}const Mte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Ete(e,t,n){Bi()&&zr({source:"client",kind:`client:${e}`,label:`${Mte[e]} ${t}`,detail:Dl(n)})}function wr(e,t){Bi()&&zr({source:"client",kind:"client:event",label:`· ${e}`,detail:Dl(t)})}function Ls(e,t){Ste(e,t),zr({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let ng=!1,Xf=null;function Tte(){if(ng)return()=>Xf?.();ng=!0;const e=[];try{if(typeof window<"u"){const n=o=>{Ls("window:error",{status:"failed",errorName:o.error instanceof Error?o.error.name:"Error",line:o.lineno,col:o.colno})},s=o=>{const i=o.reason;Ls("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",s),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",s)})}}catch{}if(Bi())for(const n of["error","warn","log","info","debug"]){const s=console[n];if(typeof s!="function")continue;const o=(...i)=>{try{Ete(n,i.map(Nte).join(" "),i.length>1?i:i[0])}catch{}s.apply(console,i)};console[n]=o,e.push(()=>{console[n]===o&&(console[n]=s)})}const t=()=>{if(Xf===t){for(const n of e.toReversed())n();Xf=null,ng=!1}};return Xf=t,t}function Nte(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 o5(e=Cl){if(typeof document>"u")return;const t=new Blob([Ite(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let s;try{s=document.createElement("a"),s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(s),s.click()}finally{s?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Ite(e=Cl){return e===Cl?_c.join(`
282
+ `):e.map(t=>JSON.stringify(t)).join(`
283
+ `)}function $te(){return ca.join(`
284
+ `)}function i5(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 Rv(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Bv(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 Lte(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function Ti(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:Bv(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:i5(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 ld(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 uC(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 Ak(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:uC(e.source)};case"video":return{type:"video",source:uC(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 Dv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Ak),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Fte(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 Ote(e){return{content:e.content.map(Fte),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 Rte(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function r5(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 Bte(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Dte(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Bte),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function l5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Dte),createdAt:e.created_at}}function Pte(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 Hte(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=Pte(s);return{answers:t,method:e.method,note:e.note}}function Mh(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function dC(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 rl(e,t){const n=e[t];return typeof n=="string"?n:void 0}function oc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function li(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function a5(e){if(!e||typeof e!="object")return null;const t=e,n=rl(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:rl(t,"goalId")??rl(t,"goal_id")??"goal",objective:rl(t,"objective")??"",completionCriterion:rl(t,"completionCriterion")??rl(t,"completion_criterion"),status:n,turnsUsed:oc(t,"turnsUsed")??oc(t,"turns_used")??0,tokensUsed:oc(t,"tokensUsed")??oc(t,"tokens_used")??0,wallClockMs:oc(t,"wallClockMs")??oc(t,"wall_clock_ms")??0,terminalReason:rl(t,"terminalReason")??rl(t,"terminal_reason"),budget:{tokenBudget:li(o,"tokenBudget")??li(o,"token_budget"),remainingTokens:li(o,"remainingTokens")??li(o,"remaining_tokens"),turnBudget:li(o,"turnBudget")??li(o,"turn_budget"),remainingTurns:li(o,"remainingTurns")??li(o,"remaining_turns"),wallClockBudgetMs:li(o,"wallClockBudgetMs")??li(o,"wall_clock_budget_ms"),remainingWallClockMs:li(o,"remainingWallClockMs")??li(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Wte(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ti(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ti(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:ld(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:ld(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:Bv(t.payload.status),previousStatus:Bv(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:i5(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=a5(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:Dv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Ak),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:r5(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:l5(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:Mh(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:Pv(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 zte(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function fC(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 Pv(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 Ute(e){return e.session_id}function qte(e){return e.seq}const jte="main",Vte=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","error"]);function kr(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 Kte(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 hC(){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 fo(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ia(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ai(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Gte(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=fo(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=fo(t,"goalId")??fo(t,"goal_id")??"goal",r=fo(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:fo(t,"completionCriterion")??fo(t,"completion_criterion"),status:o,turnsUsed:ia(t,"turnsUsed")??ia(t,"turns_used")??0,tokensUsed:ia(t,"tokensUsed")??ia(t,"tokens_used")??0,wallClockMs:ia(t,"wallClockMs")??ia(t,"wall_clock_ms")??0,terminalReason:fo(t,"terminalReason")??fo(t,"terminal_reason"),budget:{tokenBudget:ai(s,"tokenBudget")??ai(s,"token_budget"),remainingTokens:ai(s,"remainingTokens")??ai(s,"remaining_tokens"),turnBudget:ai(s,"turnBudget")??ai(s,"turn_budget"),remainingTurns:ai(s,"remainingTurns")??ai(s,"remaining_turns"),wallClockBudgetMs:ai(s,"wallClockBudgetMs")??ai(s,"wall_clock_budget_ms"),remainingWallClockMs:ai(s,"remainingWallClockMs")??ai(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function wc(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 Yte(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=fo(t,"name")??fo(t,"toolName")??"tool",s=Ia(Zte(n)),o=Qte(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=fo(n,"text");if(o)return sg(o);const i=fo(n,"message");if(i)return sg(i)}const s=fo(t,"message");if(s)return sg(s)}return null}function Zte(e){return e.replace(/_\d+$/,"")}const pC=2e3;function sg(e){return e.length>pC?`${e.slice(0,pC)}…`:e}function Qte(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return _d(e,n)}function Xte(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=fo(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=wc(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=Yte(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=wc(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 $u(e){return{...e,content:e.content.map(t=>({...t}))}}function mC(e,t,n){const s={id:kr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Jte(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 ene(e){return Array.isArray(e)?e.map(t=>Ak(t)):[]}function gC(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 tne(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 nne(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 vC(e,t){e.messages.find(n=>n.id===t)}function sne(e,t,n,s,o,i){const r={id:kr("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 og(e,t){return e.messages.find(n=>n.id===t)}function yC(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 one(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=hC(),e.set(u,d)),d}function s(u){e.set(u,hC())}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??kr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=mC(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 x=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:x}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:$u(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,x=[],k=m?.agentId;if(typeof k=="string"&&k!==jte){const g=t.has(k);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:k,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:k,reason:m?.reason}];if(Vte.has(u))return Xte(p,f,k,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)&&x.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=ene(m?.content);if(y.length===0)break;p.currentPromptId=g;const M=Jte(p,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());x.push({type:"messageCreated",message:$u(M)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??kr("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0;break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=kr("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v)),p.turnTextLen=0,p.turnThinkLen=0;const y=mC(p,f,v);p.currentAssistantMsgId=y.id,x.push({type:"messageCreated",message:$u(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"){x.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const M=gC(p,g,"thinking",v);if(M<0)break;p.turnThinkLen+=v.length,x.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:M,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"){x.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const M=gC(p,g,"text",v);if(M<0)break;p.turnTextLen+=v.length,x.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:M,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 M=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};tne(p,g,M,L,$);const _=og(p,g);_&&_.content.length-1,p.toolStartTimes.set(M,Date.now()),_&&x.push({type:"messageUpdated",sessionId:f,messageId:g,content:_.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=nne(m??{});g&&v&&x.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=kr("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=m?.toolCallId,M=m?.output,L=m?.isError??!1;p.toolStartTimes.get(y)??Date.now(),p.toolStartTimes.delete(y);const $=sne(p,f,y,M,L,v);x.push({type:"messageCreated",message:$u($)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=Kte(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){vC(p,g);const y=og(p,g);y&&x.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(M=>({...M})),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),x.push({type:"sessionUsageUpdated",sessionId:f,usage:yC(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=ia(m??{},"durationMs");if(g){vC(p,g);const L=og(p,g);L&&x.push({type:"messageUpdated",sessionId:f,messageId:g,content:L.content.map($=>({...$})),status:v==="failed"||v==="blocked"?"error":"completed",durationMs:y})}p.turnCount++;const M=yC(p);x.push({type:"sessionUsageUpdated",sessionId:f,usage:M}),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:kr("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),x.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=wc(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&x.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=wc(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&x.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=wc(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&x.push({type:"taskCreated",sessionId:f,task:v}),x.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=wc(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&x.push({type:"taskCreated",sessionId:f,task:v}),x.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{x.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{x.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):kr("task_"),M=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:An.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;x.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:M,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;x.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??{};x.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}),x.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{x.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{x.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=Gte(m?.snapshot??null);x.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=fo(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:kr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(y),x.push({type:"messageCreated",message:$u(y)})}break}}return x}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const ine=new Set(["server_hello","ack","ping","resync_required","error","pong"]),kC=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","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),rne=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"]),lne=new Set(["assistant.delta","thinking.delta"]);function ane(e,t){if(ine.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return lne.has(s)?cne(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?rne.has(s)?{route:"protocol"}:kC.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:kC.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function cne(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 zu 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 gr 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 $r(e){return e instanceof zu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function c5(e){return e instanceof gr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Us="kimi-web.server-credential",une="token",dne=10080*60*1e3;let Ji;const Hv=new Set;function fne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(une);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 Wv(e){return{version:1,credential:e,expiresAt:Date.now()+dne}}function hne(e){return JSON.stringify(e)}function Mk(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function zv(e){globalThis.localStorage?.setItem(Us,hne(e))}function pne(){try{const e=globalThis.localStorage?.getItem(Us);if(e){const n=Mk(e);if(n===void 0){const s=Wv(e);let o=!1;try{zv(s),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(Us)===e&&globalThis.localStorage?.removeItem(Us),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Us)}catch{}return o?s:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Us),globalThis.localStorage?.getItem(Us)===e&&globalThis.localStorage?.removeItem(Us);return}const t=globalThis.sessionStorage?.getItem(Us);if(t){const n=Wv(t);let s=!1;try{zv(n),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Us),s=!0}catch{}return s?n:void 0}return}catch{return}}function mne(){const e=fne();return e?(d5(e),!0):(Ji=pne(),Ji!==void 0)}function u5(){if(Ji!==void 0){if(Ji.expiresAt<=Date.now()){gne(Ji);return}return Ji.credential}}function gne(e){Ji=void 0;try{globalThis.sessionStorage?.removeItem(Us);const t=globalThis.localStorage?.getItem(Us),n=t==null?void 0:Mk(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Us)}catch{}}function d5(e){const t=Wv(e);Ji=t;try{zv(t)}catch{}try{globalThis.sessionStorage?.removeItem(Us)}catch{}}function vne(){const e=Ji;Ji=void 0;try{const t=globalThis.localStorage?.getItem(Us),s=(t==null?void 0:Mk(t))?.credential??t;e!==void 0&&s===e.credential&&globalThis.localStorage?.removeItem(Us),globalThis.sessionStorage?.removeItem(Us)}catch{}}function yne(e){return Hv.add(e),()=>{Hv.delete(e)}}function kne(){vne();for(const e of Hv)try{e()}catch{}}const fc=3e4,Jf=5*6e4,f5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",bC=500,h5=40101;function eh(e=fc){try{return AbortSignal.timeout(e)}catch{return}}function bne(e,t){let n="",s=e;for(let o=0;o<t;o++)n=f5[s%32]+n,s=Math.floor(s/32);return n}function xne(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=>f5[n%32]).join("")}function th(){return`${bne(Date.now(),10)}${xne(16)}`}function _ne(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 ig(e){try{const t=await e.text();return t?t.length>bC?`${t.slice(0,bC)}...`:t:void 0}catch{return}}class wne{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=vc(this.origin,t),s=th(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();Qf({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:eh()})}catch(a){throw il({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new gr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:fc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return nc({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),nc({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new zu({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??s,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postZip(t,n,s){const o="POST",i=vc(this.origin,t),r=th(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();Qf({method:o,path:t,url:i,requestId:r,body:s});let c;try{c=await fetch(i,{method:o,headers:l,body:JSON.stringify(n),signal:eh(Jf)})}catch(h){throw il({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new gr({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:Jf,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const x=h?.code??c.status,k=h?.msg??c.statusText;throw nc({method:o,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:x,msg:k,envelopeRequestId:h?.request_id}),new zu({code:x,msg:k,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),m=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw il({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:m}),new gr({message:`Invalid ZIP response from ${o} ${t}`,cause:m,method:o,path:t,url:i,requestId:r,phase:"parse",timeoutMs:Jf,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await ig(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw il({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new gr({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:i,requestId:r,phase:"parse",timeoutMs:Jf,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return nc({method:o,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const s=vc(this.origin,t),o=th(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();Qf({method:"POST",path:t,url:s,requestId:o,body:_ne(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:eh()})}catch(u){throw il({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new gr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:fc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw il({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new gr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:fc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await ig(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(nc({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 zu({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=vc(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,x]of Object.entries(o))x!==void 0&&h.set(m,String(x));const p=h.toString();p&&(r=`${r}?${p}`)}const l=th(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();Qf({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:eh()})}catch(h){throw il({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new gr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:fc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw il({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new gr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:fc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await ig(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(nc({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 zu({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=u5();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===h5)&&kne()}}const Sne="kimi-code.bearer.",Cne=3e4;class Ane{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;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),sc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=u5(),n=t!==void 0?[`${Sne}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{sc("open")},s.onmessage=o=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(o.data));Ate(i),this.handleFrame(i)}catch(i){sc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{sc("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{sc("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,sc("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=nh(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(nh(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(nh(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Cne),s=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:s}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const s=n.payload?.heartbeat_ms;typeof s=="number"&&s>0&&(this.heartbeatMs=s),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=nh(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=ane(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)),Cte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function nh(e,t){return`${e}\0${t}`}function Mne(e,t){if(e===void 0)return t;let n;const s=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(s!==void 0)try{n=decodeURIComponent(s.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function xC(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function rg(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 _C(e){return e==="auto_compact"||e==="manual_compact"}class Ene{http;config;constructor(t){this.config=t,this.http=new wne(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?Lte(t.status):void 0,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Ti),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return Ti(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ti(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return Ti(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return a5(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ti(n)}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(Dv),hasMore:o.has_more}}async getSessionSnapshot(t){const n=Date.now();Ls("session:snapshot:start",{sessionId:t});try{const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),o={asOfSeq:s.as_of_seq,epoch:s.epoch,session:Ti(s.session),messages:s.messages.items.map(Dv),hasMoreMessages:s.messages.has_more,inFlightTurn:s.in_flight_turn===null?null:{turnId:s.in_flight_turn.turn_id,assistantText:s.in_flight_turn.assistant_text,thinkingText:s.in_flight_turn.thinking_text,runningTools:s.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:s.in_flight_turn.current_prompt_id},pendingApprovals:s.pending_approvals.map(r5),pendingQuestions:s.pending_questions.map(l5),subagents:(s.subagents??[]).map(Mh)};return Ls("session:snapshot:accepted",{sessionId:t,status:o.session.status,seq:o.asOfSeq,messageCount:o.messages.length,durationMs:Date.now()-n}),o}catch(s){throw Ls("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...xC(s)}),s}}async exportSession(t,n){const s=n===void 0?0:new TextEncoder().encode(n).byteLength,o=n===void 0||n.length===0?0:n.split(`
285
+ `).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:s,web_log_entries:o}),r=`${t}.zip`;return{blob:i.blob,fileName:Mne(i.contentDisposition,r)}}async submitPrompt(t,n){const s=Date.now();Ls("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Ote(n));return Ls("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-s}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw Ls("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-s,...xC(o)}),o}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return Ti(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return Ti(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ti)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Rte(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)}`,Hte(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(Mh)}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 Mh(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(rg)}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 rg(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return rg(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 listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${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(dC)])):void 0;return{items:o.items.map(dC),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 vc(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(ld)}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 ld(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 ld(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(zte)}async listProviders(){return(await this.http.get("/providers")).items.map(fC)}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 fC(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 lg(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return lg(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return lg(t)}async getConfig(){const t=await this.http.get("/config");return Pv(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 Pv(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 t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,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 vc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=gI(this.config.serverHttpUrl,this.config.clientId),s=one(),o=new Ane(n,this.config.clientId,{onWireEvent:i=>{const r=Ute(i),l=qte(i),a=Wte(i);a.type==="historyCompacted"&&!_C(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"&&!_C(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)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}}function lg(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 wC;function ft(){return wC??=new Ene(dI()),wC}const Tne=["src","controls","muted"],Nne=["src","alt"],ag=Ye({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=Q(t.fileId?"":t.url),s=Q(null),o=Q(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(o.value)try{const f=await ft().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Qe(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),yn(()=>{typeof IntersectionObserver=="function"&&s.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(s.value)):o.value=!0}),ms(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(b(),T("video",{key:0,ref_key:"mediaEl",ref:s,class:Pe(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Tne)):(b(),T("img",{key:1,ref_key:"mediaEl",ref:s,class:Pe(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Nne))}}),Ine=["aria-label"],$ne=120,Lne=60,Fne=Ye({__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*$ne}ms`,"--moon-frame-fast-delay":`${s*Lne}ms`}}return(s,o)=>(b(),T("span",{class:Pe(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(b(),T(Be,null,st(t,(i,r)=>w("span",{key:i,class:"ui-moon__frame",style:Gt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Ine))}}),p5=dt(Fne,[["__scopeId","data-v-a6b7ec07"]]),One={class:"chat"},Rne={key:0,class:"chat-loading"},Bne={class:"chat-loading-text"},Dne={key:1,class:"chat-empty"},Pne={key:1,class:"top-sentinel-text"},Hne={key:0,class:"u-turn"},Wne=["data-turn-id"],zne={key:0,class:"u-imgs"},Une=["aria-label","onClick"],qne={key:1,class:"skill-act"},jne={class:"skill-act-head"},Vne={key:0,class:"skill-act-args"},Kne={key:2,class:"skill-act"},Gne={class:"skill-act-head"},Yne={key:0,class:"skill-act-args"},Zne={key:3,class:"u-text"},Qne={key:0,class:"u-meta"},Xne=["aria-label","onClick"],Jne=["aria-label","onClick"],ese=["data-turn-id"],tse=["onClick"],nse={class:"cd-view"},sse={key:1,class:"cd-label"},ose=["data-turn-id"],ise={key:1,class:"msg"},rse={key:0,class:"a-msg-ft"},lse={key:0,class:"a-duration"},ase=["aria-label","onClick"],cse={key:4,class:"sending-placeholder"},use={key:5,class:"q-stack"},dse={class:"q-head"},fse={class:"q-title"},hse={class:"q-hint"},pse=["onDragover","onDrop"],mse={class:"u-bub q-bub"},gse=["title","onDragstart"],vse=["title","onClick"],yse={key:0,class:"u-text q-text"},kse={key:1,class:"q-text q-text-placeholder"},bse={key:0,class:"q-imgs"},xse={key:1,class:"q-tag q-tag-next"},_se={key:2,class:"q-tag q-tag-idx"},wse=["aria-label","onClick"],Sse=2500,Cse=Ye({__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}=Tt(),{confirm:o}=Wr();Sn(()=>{U!==null&&(clearTimeout(U),U=null),I!==null&&(clearTimeout(I),I=null),E!==null&&(clearTimeout(E),E=null)});const i=e,r=Q(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Y=>{Y[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))}yn(a),Sn(()=>{l?.disconnect(),l=null}),Qe(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{gt().then(a)});const c=D(()=>{if(!i.running||i.turns.length===0)return null;const Y=i.turns.at(-1);return Y.role==="assistant"?Y.id:null}),u=D(()=>i.sending||i.running),d=n,f=Q(null),h=Q(null);function p(Y){return(Y.attachments?.length??0)>0}function m(Y){d("editQueued",Y)}function x(Y,X){if(f.value=Y,!X.dataTransfer)return;X.dataTransfer.effectAllowed="move",X.dataTransfer.setData("text/plain",String(Y));const le=X.currentTarget?.closest(".q-turn");le&&X.dataTransfer.setDragImage(le,24,24)}function k(Y,X){if(f.value===null)return;X.preventDefault(),X.dataTransfer&&(X.dataTransfer.dropEffect="move");const le=X.currentTarget.getBoundingClientRect(),He=X.clientY<le.top+le.height/2?"before":"after";h.value={index:Y,position:He}}function g(Y,X){X.preventDefault();const le=f.value,He=h.value?.position??"before";if(f.value=null,h.value=null,le===null)return;let de=He==="before"?Y:Y+1;le<de&&(de-=1),le!==de&&d("reorderQueue",{from:le,to:de})}function v(){f.value=null,h.value=null}const y=D(()=>{for(let Y=i.turns.length-1;Y>=0;Y--)if(i.turns[Y].role==="user")return i.turns[Y].id;return null});function M(Y){return Y.role==="user"&&Y.id===y.value&&!i.running&&!i.sending&&!Y.skillActivation&&!Y.pluginCommand}function L(Y){const X=Y.compaction,le=X?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof X?.tokensBefore=="number"&&typeof X?.tokensAfter=="number"?le+s("conversation.compactedTokens",{before:h_(X.tokensBefore),after:h_(X.tokensAfter)}):le}const $=Q(null),_=Q(null);let E=null;async function N(Y){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&F(Y)}function F(Y){_.value===null&&(_.value=Y.id,d("editMessage",{text:Y.text,images:Y.images}),E=setTimeout(()=>{E=null,_.value=null},Sse))}Qe(()=>i.turns,Y=>{_.value!==null&&(Y.some(X=>X.id===_.value)||(_.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const S=Q(!1);let I=null;function R(){if(i.turns.length===0)return;const Y=[];for(const le of i.turns){if(le.role==="compaction"||le.role==="cron")continue;const He=le.role==="user"?"User":"Assistant",de=rW(le);de.trim()&&Y.push(`**${He}**
286
+
287
+ ${de}`)}const X=Y.join(`
288
+
289
+ ---
290
+
291
+ `);io(X).then(le=>{le&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}function B(Y){const X=[];for(let le=Y;le>=0;le--){const He=i.turns[le];if(!He||He.role!=="assistant")break;X.unshift(He)}return X}function P(Y){return B(Y).map(X=>iW(X)).filter(Boolean).join(`
292
+
293
+ `)}function z(){for(let Y=i.turns.length-1;Y>=0;Y-=1)if(i.turns[Y]?.role==="assistant")return P(Y);return""}function W(){const Y=z();Y.trim()&&io(Y).then(X=>{X&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:R,copyFinalSummary:W});function ee(Y){const X=i.turns[Y];if(!X||X.role!=="assistant")return!1;const le=i.turns[Y+1];return!le||le.role!=="assistant"}let U=null;function Z(Y){const X=i.turns[Y];if(!X)return;const le=P(Y);le.trim()&&io(le).then(He=>{He&&($.value=X.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,$.value=null},1400))}).catch(()=>{})}function ce(Y){const X=Y.text;X.trim()&&io(X).then(le=>{le&&($.value=Y.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,$.value=null},1400))}).catch(()=>{})}function fe(Y){return{kind:"image",url:Y.url,path:Y.alt,fileId:Y.fileId}}function oe(Y,X){return Y.id!==c.value?!1:X.sourceIndex===hm(Y).length-1}return(Y,X)=>(b(),T("div",One,[e.sessionLoading?(b(),T("div",Rne,[ie(Ho,{size:"sm"}),w("span",Bne,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(b(),T("div",Dne)):re("",!0),e.hasMoreMessages||e.loadingMore?(b(),T("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Pe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(b(),T("span",Pne,[ie(Ho,{size:"sm"}),Xe(" "+O(C(s)("conversation.loadingOlder")),1)])):(b(),T("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:X[0]||(X[0]=le=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):re("",!0),(b(!0),T(Be,null,st(e.turns,(le,He)=>(b(),T(Be,{key:le.id},[le.role==="user"?(b(),T("div",Hne,[w("div",{class:Pe(["u-bub turn-anchor",{undoing:_.value===le.id}]),"data-turn-id":le.id},[le.images&&le.images.length>0?(b(),T("div",zne,[(b(!0),T(Be,null,st(le.images,(de,G)=>(b(),T(Be,{key:G},[de.kind==="video"?(b(),ke(ag,{key:0,url:de.url,kind:"video","file-id":de.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(b(),T("button",{key:1,type:"button",class:"u-img-btn","aria-label":C(s)("filePreview.enlargeImage"),onClick:ae=>d("openMedia",fe(de))},[ie(ag,{url:de.url,kind:"image",alt:de.alt,"file-id":de.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,Une))],64))),128))])):re("",!0),le.skillActivation?(b(),T("div",qne,[w("div",jne,[X[9]||(X[9]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,O(C(s)("conversation.activatedSkill",{name:le.skillActivation.name})),1)]),le.skillActivation.args?(b(),T("div",Vne,O(le.skillActivation.args),1)):re("",!0)])):le.pluginCommand?(b(),T("div",Kne,[w("div",Gne,[X[10]||(X[10]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,"/"+O(le.pluginCommand.pluginId)+":"+O(le.pluginCommand.commandName),1)]),le.pluginCommand.args?(b(),T("div",Yne,O(le.pluginCommand.args),1)):re("",!0)])):(b(),T("div",Zne,O(le.text),1))],10,Wne),le.createdAt||M(le)?(b(),T("div",Qne,[M(le)?(b(),T("div",{key:0,class:Pe(["u-edit-wrap",{undoing:_.value===le.id}])},[w("button",{type:"button",class:"u-edit","aria-label":C(s)("conversation.undoTooltip"),onClick:de=>N(le)},[ie(je,{name:"undo",size:"sm"})],8,Xne)],2)):re("",!0),le.text.trim().length>0?(b(),T("button",{key:1,type:"button",class:"u-copy","aria-label":C(s)("filePreview.copy"),onClick:bt(de=>ce(le),["stop"])},[$.value!==le.id?(b(),ke(je,{key:0,name:"copy",size:"sm"})):(b(),ke(je,{key:1,name:"check",size:"sm"}))],8,Jne)):re("",!0),le.createdAt?(b(),ke(n5,{key:2,time:le.createdAt},null,8,["time"])):re("",!0)])):re("",!0)])):le.role==="compaction"?(b(),T("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":le.id,role:"separator"},[X[11]||(X[11]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1)),le.text?(b(),T("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:de=>d("openCompaction",{turnId:le.id})},[w("span",null,O(L(le)),1),w("span",nse,O(C(s)("conversation.viewSummary")),1)],8,tse)):(b(),T("span",sse,O(L(le)),1)),X[12]||(X[12]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,ese)):le.role==="cron"?(b(),ke(mte,{key:2,text:le.text,cron:le.cron,"turn-id":le.id,"created-at":le.createdAt},null,8,["text","cron","turn-id","created-at"])):(b(),T("div",{key:3,class:"a-msg turn-anchor","data-turn-id":le.id},[(b(!0),T(Be,null,st(C(oW)(le),(de,G)=>(b(),T(Be,{key:C(lW)(de,G)},[de.kind==="thinking"?(b(),ke(Gee,{key:0,text:de.thinking,mobile:"",streaming:oe(le,de),onOpen:ae=>d("openThinking",{turnId:le.id,blockIndex:de.sourceIndex})},null,8,["text","streaming","onOpen"])):de.kind==="text"&&de.text?(b(),T("div",ise,[ie(Lm,{text:de.text,streaming:oe(le,de),"open-file":ae=>d("openFile",ae)},null,8,["text","streaming","open-file"])])):de.kind==="tool-stack"?(b(),ke(pW,{key:2,tools:de.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:X[1]||(X[1]=ae=>d("openMedia",ae)),onOpenFile:X[2]||(X[2]=ae=>d("openFile",ae)),onOpenToolDiff:X[3]||(X[3]=ae=>d("openToolDiff",ae)),onOpenAgent:X[4]||(X[4]=ae=>d("openAgent",ae))},null,8,["tools","tool-diff-panel"])):de.kind==="tool"?(b(),ke(bA,{key:3,tool:de.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:X[5]||(X[5]=ae=>d("openMedia",ae)),onOpenFile:X[6]||(X[6]=ae=>d("openFile",ae)),onOpenToolDiff:X[7]||(X[7]=ae=>d("openToolDiff",ae)),onOpenAgent:X[8]||(X[8]=ae=>d("openAgent",ae))},null,8,["tool","tool-diff-panel"])):re("",!0)],64))),128)),le.id!==c.value&&ee(He)&&(P(He).trim().length>0||le.durationMs!==void 0)?(b(),T("div",rse,[ie(Yt,{text:`${le.durationMs} ms`},{default:Me(()=>[le.durationMs!==void 0?(b(),T("span",lse,O(C(tW)(le.durationMs)),1)):re("",!0)]),_:2},1032,["text"]),P(He).trim().length>0?(b(),T("button",{key:0,class:"a-cpbtn","aria-label":C(s)("filePreview.copy"),onClick:de=>Z(He)},[$.value!==le.id?(b(),ke(je,{key:0,name:"copy",size:"sm"})):(b(),ke(je,{key:1,name:"check",size:"sm"}))],8,ase)):re("",!0)])):re("",!0)],8,ose))],64))),128)),e.compaction?(b(),ke(Jee,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(b(),T("div",cse,[ie(p5,{fast:e.fastMoon},null,8,["fast"])])):re("",!0),e.queued.length>0?(b(),T("div",use,[w("div",dse,[w("span",fse,[ie(je,{name:"mail",size:"sm"}),Xe(" "+O(C(s)("composer.queueLabel"))+" · ",1),w("b",null,O(e.queued.length),1)]),w("span",hse,O(C(s)("composer.queueAutoDrain")),1)]),(b(!0),T(Be,null,st(e.queued,(le,He)=>(b(),T("div",{key:He,class:Pe(["u-turn q-turn",{"q-dragging":f.value===He,"drop-before":h.value?.index===He&&h.value.position==="before","drop-after":h.value?.index===He&&h.value.position==="after"}]),onDragover:de=>k(He,de),onDrop:de=>g(He,de)},[w("div",mse,[w("span",{class:"q-grip",title:C(s)("composer.queueDragTitle"),draggable:"true",onDragstart:de=>x(He,de),onDragend:v},[ie(je,{name:"grip",size:"sm"})],40,gse),w("button",{type:"button",class:"q-body",title:C(s)("composer.editQueued"),onClick:de=>m(He)},[le.text?(b(),T("span",yse,O(le.text),1)):(b(),T("span",kse,[ie(je,{name:"image",size:"sm"}),Xe(" "+O(C(s)("composer.queuedImageOnly",{n:le.attachments?.length??0})),1)]))],8,vse),p(le)?(b(),T("div",bse,[(b(!0),T(Be,null,st(le.attachments,(de,G)=>(b(),ke(ag,{key:G,url:de.url,kind:de.kind,"file-id":de.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):re("",!0),He===0?(b(),T("span",xse,O(C(s)("composer.queueNext")),1)):(b(),T("span",_se,"#"+O(He+1),1)),w("button",{type:"button",class:"q-rm","aria-label":C(s)("composer.remove"),onClick:bt(de=>d("unqueue",He),["stop"])},[ie(je,{name:"close",size:"sm"})],8,wse)])],42,pse))),128))])):re("",!0)]))}}),m5=dt(Cse,[["__scopeId","data-v-a8f7c9a5"]]),Ase={class:"ch-id"},Mse={key:0,class:"ch-ws"},Ese={key:1,class:"ch-sep"},Tse=["onKeydown"],Nse={class:"ch-ses"},Ise={key:0,class:"ch-pill ch-sync-pill"},$se={key:0,class:"ch-ahead"},Lse={key:1,class:"ch-behind"},Fse={key:1,class:"ch-pill ch-diff-pill"},Ose={key:0,class:"ch-add"},Rse={key:1,class:"ch-del"},Bse=Ye({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=Wr(),o=e,i=t,r=D(()=>o.ahead??0),l=D(()=>o.behind??0),a=D(()=>o.gitDiffStats?.totalAdditions??0),c=D(()=>o.gitDiffStats?.totalDeletions??0),u=D(()=>a.value>0||c.value>0),d={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function f(U){return U.trim().toLowerCase().replaceAll("_","-")}function h(U){const Z=f(U);return d[Z]?`pr-${Z}`:"pr-unknown"}function p(U){return n(d[f(U)]??"header.prStatusUnknown")}const m=Q(!1),x=Q(null),k=Q(null),g=Q({});function v(U){const Z=U.target;k.value?.el?.contains(Z)||x.value?.el?.contains(Z)||L()}function y(){L()}async function M(U){if(U.stopPropagation(),m.value){L();return}m.value=!0,document.addEventListener("mousedown",v),window.addEventListener("resize",y),await gt();const Z=x.value?.el,ce=k.value?.el;if(!Z||!ce)return;const fe=Z.getBoundingClientRect(),oe=4,Y=8,X=ce.offsetWidth,le=ce.offsetHeight;let He=fe.bottom+oe;He+le>window.innerHeight-Y&&(He=Math.max(Y,fe.top-le-oe));let de=fe.left;de+X>window.innerWidth-Y&&(de=Math.max(Y,fe.right-X)),g.value={top:`${Math.round(He)}px`,left:`${Math.round(de)}px`}}function L(){m.value=!1,document.removeEventListener("mousedown",v),window.removeEventListener("resize",y)}Sn(()=>{document.removeEventListener("mousedown",v),window.removeEventListener("resize",y)});function $(){i("copyAll"),L()}function _(){i("copyFinalSummary"),L()}const E=Q(!1);function N(){o.sessionId&&io(o.sessionId).then(U=>{U&&(E.value=!0,setTimeout(()=>{E.value=!1},1200))})}const F=Q(!1),S=Q(""),I=Q(null);async function R(){if(L(),!!o.sessionId){F.value=!0,S.value=o.sessionTitle??"",await gt();try{I.value?.focus(),I.value?.select()}catch{}}}function B(){const U=S.value.trim();U&&o.sessionId&&U!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,U),F.value=!1}function P(){F.value=!1}function z(){o.sessionId&&(L(),i("forkSession",o.sessionId))}function W(){o.sessionId&&(L(),i("exportSession",o.sessionId))}async function ee(){o.sessionId&&(L(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(U,Z)=>(b(),T("header",{class:Pe(["chat-header",{"macos-desktop":C($c)}])},[w("div",Ase,[e.workspaceName?(b(),T("span",Mse,O(e.workspaceName),1)):re("",!0),e.workspaceName&&e.sessionTitle?(b(),T("span",Ese,"/")):re("",!0),F.value?Ln((b(),T("input",{key:2,ref_key:"renameInputRef",ref:I,"onUpdate:modelValue":Z[0]||(Z[0]=ce=>S.value=ce),class:"ch-rename",type:"text",onKeydown:[Xi(bt(B,["stop"]),["enter"]),Xi(bt(P,["stop"]),["esc"])],onBlur:B,onClick:Z[1]||(Z[1]=bt(()=>{},["stop"]))},null,40,Tse)),[[wo,S.value]]):e.sessionTitle?(b(),ke(Yt,{key:3,text:e.sessionTitle},{default:Me(()=>[w("span",Nse,O(e.sessionTitle),1)]),_:1},8,["text"])):re("",!0)]),ie(Dn,{ref_key:"kebabRef",ref:x,class:Pe(["ch-act-more",{open:m.value}]),label:C(n)("header.options"),"aria-expanded":m.value,"aria-haspopup":"menu",onClick:Z[2]||(Z[2]=bt(ce=>M(ce),["stop"]))},{default:Me(()=>[ie(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),m.value?(b(),ke(gl,{key:0,ref_key:"menuRef",ref:k,class:"ch-menu",style:Gt(g.value),onClick:Z[3]||(Z[3]=bt(()=>{},["stop"]))},{default:Me(()=>[ie(gn,{onClick:$},{default:Me(()=>[ie(je,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ie(gn,{onClick:_},{default:Me(()=>[ie(je,{name:"file-text",size:"sm"}),Xe(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(b(),T(Be,{key:0},[ie(gn,{separator:""}),ie(gn,{onClick:N},{default:Me(()=>[ie(je,{name:E.value?"check":"copy",size:"sm"},null,8,["name"]),Xe(" "+O(E.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ie(gn,{onClick:R},{default:Me(()=>[ie(je,{name:"pencil",size:"sm"}),Xe(" "+O(C(n)("header.renameSession")),1)]),_:1}),ie(gn,{onClick:z},{default:Me(()=>[ie(je,{name:"git-fork",size:"sm"}),Xe(" "+O(C(n)("header.forkSession")),1)]),_:1}),ie(gn,{onClick:W},{default:Me(()=>[ie(je,{name:"download",size:"sm"}),Xe(" "+O(C(n)("header.exportSession")),1)]),_:1}),ie(gn,{danger:"",onClick:ee},{default:Me(()=>[ie(je,{name:"archive",size:"sm"}),Xe(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):re("",!0)]),_:1},8,["style"])):re("",!0),Z[6]||(Z[6]=w("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(b(),T("button",{key:1,type:"button",class:"ch-git",onClick:Z[4]||(Z[4]=ce=>i("openChanges"))},[w("span",{class:Pe(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),r.value>0||l.value>0?(b(),T("span",Ise,[r.value>0?(b(),T("span",$se,"↑"+O(r.value),1)):re("",!0),l.value>0?(b(),T("span",Lse,"↓"+O(l.value),1)):re("",!0)])):re("",!0),u.value?(b(),T("span",Fse,[a.value>0?(b(),T("span",Ose,"+"+O(a.value),1)):re("",!0),c.value>0?(b(),T("span",Rse,"-"+O(c.value),1)):re("",!0)])):re("",!0)])):re("",!0),e.pr?(b(),T("button",{key:2,type:"button",class:Pe(["ch-pill ch-pr",h(e.pr.state)]),onClick:Z[5]||(Z[5]=ce=>e.pr&&i("openPr",e.pr.url))},[ie(je,{name:"git-pull-request",size:"sm"}),w("span",null,"PR #"+O(e.pr.number)+" · "+O(p(e.pr.state)),1)],2)):re("",!0)],2))}}),Dse=dt(Bse,[["__scopeId","data-v-59cdb23e"]]),Pse=["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"],SC=[[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 Hse(e){if(e<=255)return Pse[e];let t=0,n=SC.length-1;for(;t<=n;){const s=t+n>>1,o=SC[s];if(e<o[0]){n=s-1;continue}if(e>o[1]){t=s+1;continue}return o[2]}return"L"}function Wse(e){const t=e.length;if(t===0)return null;const n=new Array(t);let s=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=Hse(d);(h==="R"||h==="AL"||h==="AN")&&(s=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!s)return null;let o=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){o=0;break}if(u==="R"||u==="AL"){o=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;const r=o&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function zse(e,t){const n=Wse(e);if(n===null)return null;const s=new Int8Array(t.length);for(let o=0;o<t.length;o++)s[o]=n[t[o]];return s}const Use=/[ \t\n\r\f]+/g,qse=/[\t\n\r\f]| {2,}|^ | $/;function jse(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Vse(e){if(!qse.test(e))return e;let t=e.replace(Use," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Kse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
294
+ `).replace(/[\r\f]/g,`
295
+ `):e}let cg=null,Gse;function Yse(){return cg===null&&(cg=new Intl.Segmenter(Gse,{granularity:"word"})),cg}const Zse=/\p{Script=Arabic}/u,Pl=/\p{M}/u,Ek=/\p{Nd}/u;function CC(e){return Zse.test(e)}function AC(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function tr(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){const o=(n-55296<<10)+(s-56320)+65536;if(AC(o))return!0;t++;continue}}if(AC(n))return!0}}return!1}function Qse(e){const t=Gd(e);return t!==null&&(Tk.has(t)||Sa.has(t))}const Xse=new Set([" "," ","⁠","\uFEFF"]),Jse=new Set(["-","‐","–","—"]);function eoe(e){const t=Gd(e);return t!==null&&Xse.has(t)}function toe(e){const t=Gd(e);return t!==null&&Jse.has(t)}function g5(e,t){return eoe(e)?!1:t?!(Qse(e)||toe(e)):!0}const Tk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Fm=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Nk=new Set(["'","’"]),Sa=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),noe=new Set([":",".","،","؛"]),soe=new Set(["၏"]),ooe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function ioe(e){if(Ik(e))return!0;let t=!1;for(const n of e){if(Sa.has(n)||Rm(n)){t=!0;continue}if(!(t&&Pl.test(n)))return!1}return t}function roe(e){for(const t of e)if(!Tk.has(t)&&!Sa.has(t))return!1;return e.length>0}function loe(e){if(Ik(e))return!0;for(const t of e)if(!Fm.has(t)&&!Nk.has(t)&&!Pl.test(t)&&!Rm(t))return!1;return e.length>0}function Ik(e){let t=!1;for(const n of e)if(!(n==="\\"||Pl.test(n))){if(Fm.has(n)||Sa.has(n)||Nk.has(n)){t=!0;continue}return!1}return t}function Om(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 Gd(e){if(e.length===0)return null;const t=Om(e,e.length);return e.slice(t)}function aoe(e){for(const t of e)if(!Pl.test(t))return t;return null}function coe(e){for(let t=e.length;t>0;){const n=Om(e,t),s=e.slice(n,t);if(!Pl.test(s))return s;t=n}return null}const uoe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function doe(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function Rm(e){const t=e.codePointAt(0);return t!==void 0&&doe(t,uoe)}function foe(e){const t=coe(e);return t!==null&&Rm(t)}function hoe(e){const t=aoe(e);return t!==null&&Ek.test(t)}function poe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Pl.test(s)){n--;continue}if(Fm.has(s)||Nk.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function moe(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function MC(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 EC(e,t){return e&&t!==null&&noe.has(t)}function goe(e){const t=Gd(e);return t!==null&&soe.has(t)}function voe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function Uv(e){let t=e.length;for(;t>0;){const n=Om(e,t),s=e.slice(n,t);if(ooe.has(s))return!0;if(!Sa.has(s))return!1;t=n}return!1}function yoe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
296
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const koe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Fi(e){return e.length===1?e[0]:e.join("")}function boe(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Fi(n)}function xoe(e,t,n,s){if(!koe.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=yoe(u,s),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&o.push({text:Fi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&o.push({text:Fi(r),isWordLike:a,kind:i,start:l}),o}function qv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const _oe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function woe(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:_oe.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Soe(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Coe(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let r=0;r<e.len;r++){if(s[r]!=="text"||!woe(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!qv(s[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(s[a]="text",t[a]="",a++,c)break}t[r]=Fi(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],s[i]=s[r],o[i]=o[r]),i++)}return t.length=i,n.length=i,s.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:s,starts:o}}function Aoe(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i]),!Soe(r))continue;const l=i+1;if(l>=e.len||qv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!qv(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Fi(a)),n.push(!0),s.push("text"),o.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}const Moe=new Set([":","-","/","×",",",".","+","–","—"]),Eoe=/[\p{P}\p{S}\p{Co}]/u,Toe=/\p{Emoji_Presentation}/u,Noe=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function Ioe(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function v5(e){const t=e.charCodeAt(0);return t<128?Ioe(t):!Noe.has(e)&&!Toe.test(e)&&Eoe.test(e)}function TC(e){let t=!1;for(const n of e)if(!Pl.test(n)){if(!v5(n))return!1;t=!0}return t}function $oe(e){for(let t=e.length;t>0;){const n=Om(e,t),s=e.slice(n,t);if(Pl.test(s)){t=n;continue}return v5(s)||Rm(s)}return!1}function Loe(e,t,n,s){const o=!t&&TC(e),i=!s&&TC(n),r=foe(e),l=(t||r)&&$oe(e);return!o&&!i&&!l||tr(e)||tr(n)?!1:(t||o||r)&&(s||i)}function y5(e){for(const t of e)if(Ek.test(t))return!0;return!1}function Mp(e){if(e.length===0)return!1;for(const t of e)if(!(Ek.test(t)||Moe.has(t)))return!1;return!0}function Foe(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Mp(r)&&y5(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Mp(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Fi(a)),n.push(!0),s.push("text"),o.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),s.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Ooe(e){const t=[],n=[],s=[],o=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&Loe(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(Fi(c)),n.push(d),s.push("text"),o.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),s.push(l),o.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Roe(e){const t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!y5(u)||!Mp(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),s.push("text"),o.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Boe(e){const t=[],n=[],s=[],o=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=Fi(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),s.push("glue"),o.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=Fi(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(Fi(r)),n.push(l),s.push(a),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Doe(e){const t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(s[i]!=="text"||s[i+1]!=="text"||!tr(t[i])||!tr(t[i+1]))continue;const r=poe(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],o[i+1]=o[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Poe(e,t,n){const s=Yse();let o=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],x=[];for(const L of s.segment(e))for(const $ of xoe(L.segment,L.isWordLike??!1,L.index,n)){let P=function(){u[B]!==null&&(r[B]=[MC(i,u,d,B)],u[B]=null),r[B].push($.text),l[B]=l[B]||$.isWordLike,f[B]=f[B]||N,h[B]=h[B]||F,p[B]=I,m[B]=R,x[B]=EC(h[B],S)};const _=$.kind==="text",E=moe($.text,$.isWordLike,$.kind),N=tr($.text),F=CC($.text),S=Gd($.text),I=Uv($.text),R=goe($.text),B=o-1;t.carryCJKAfterClosingQuote&&_&&o>0&&a[B]==="text"&&N&&f[B]&&p[B]||_&&o>0&&a[B]==="text"&&roe($.text)&&f[B]||_&&o>0&&a[B]==="text"&&m[B]?P():_&&o>0&&a[B]==="text"&&$.isWordLike&&F&&x[B]?(P(),l[B]=!0):E!==null&&o>0&&a[B]==="text"&&u[B]===E?d[B]=(d[B]??1)+1:_&&!$.isWordLike&&o>0&&a[B]==="text"&&!f[B]&&(ioe($.text)||$.text==="-"&&l[B])?P():(i[o]=$.text,r[o]=[$.text],l[o]=$.isWordLike,a[o]=$.kind,c[o]=$.start,u[o]=E,d[o]=E===null?0:1,f[o]=N,h[o]=F,p[o]=I,m[o]=R,x[o]=EC(F,S),o++)}for(let L=0;L<o;L++){if(u[L]!==null){i[L]=MC(i,u,d,L);continue}i[L]=Fi(r[L])}for(let L=1;L<o;L++)a[L]==="text"&&!l[L]&&Ik(i[L])&&a[L-1]==="text"&&!f[L-1]&&(i[L-1]+=i[L],l[L-1]=l[L-1]||l[L],i[L]="");const k=Array.from({length:o},()=>null);let g=-1;for(let L=o-1;L>=0;L--){const $=i[L];if($.length!==0){if(a[L]==="text"&&!l[L]&&g>=0&&a[g]==="text"&&(loe($)||$==="-"&&hoe(i[g]))){const _=k[g]??[];_.push($),k[g]=_,c[g]=c[L],i[L]="";continue}g=L}}for(let L=0;L<o;L++){const $=k[L];$!=null&&(i[L]=boe($,i[L]))}let v=0;for(let L=0;L<o;L++){const $=i[L];$.length!==0&&(v!==L&&(i[v]=$,l[v]=l[L],a[v]=a[L],c[v]=c[L]),v++)}i.length=v,l.length=v,a.length=v,c.length=v;const y=Boe({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),M=Doe(Ooe(Roe(Foe(Aoe(Coe(y))))));for(let L=0;L<M.len-1;L++){const $=voe(M.texts[L]);$!==null&&(M.kinds[L]!=="space"&&M.kinds[L]!=="preserved-space"||M.kinds[L+1]!=="text"||!CC(M.texts[L+1])||(M.texts[L]=$.space,M.isWordLike[L]=!1,M.kinds[L]=M.kinds[L]==="preserved-space"?"preserved-space":"space",M.texts[L+1]=$.marks+M.texts[L+1],M.starts[L+1]=M.starts[L]+$.space.length))}return M}function Hoe(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}function Woe(e,t,n){if(t.len<=1)return t;const s=[],o=[],i=[],r=[];let l=-1,a=!1;function c(f){s.push(t.texts[f]),o.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let k=f;k<h;k++)p=p||t.isWordLike[k];const m=t.starts[f],x=h<t.len?t.starts[h]:e.length;s.push(e.slice(m,x)),o.push(p),i.push("text"),r.push(m)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!g5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||tr(h);continue}d(f),s.push(h),o.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:s.length,texts:s,isWordLike:o,kinds:i,starts:r}}function zoe(e,t,n="normal",s="normal"){const o=jse(n),i=o.mode==="pre-wrap"?Kse(e):Vse(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=Poe(i,t,o),l=s==="keep-all"?Woe(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:Hoe(l,o),...l}}let ic=null;const NC=new Map;let rc=null;const Uoe=96,qoe=/\p{Emoji_Presentation}/u,joe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let ug=null;const IC=new Map;function $k(){if(ic!==null)return ic;if(typeof OffscreenCanvas<"u")return ic=new OffscreenCanvas(1,1).getContext("2d"),ic;if(typeof document<"u")return ic=document.createElement("canvas").getContext("2d"),ic;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Voe(e){let t=NC.get(e);return t||(t=new Map,NC.set(e,t)),t}function kl(e,t){let n=t.get(e);return n===void 0&&(n={width:$k().measureText(e).width,containsCJK:tr(e)},t.set(e,n)),n}function Bm(){if(rc!==null)return rc;if(typeof navigator>"u")return rc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},rc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),s=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return rc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:s,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},rc}function Koe(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function k5(){return ug===null&&(ug=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ug}function Goe(e){return qoe.test(e)||e.includes("️")}function Yoe(e){return joe.test(e)}function Zoe(e,t){let n=IC.get(e);if(n!==void 0)return n;const s=$k();s.font=e;const o=s.measureText("😀").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),o-r>.5&&(n=o-r)}return IC.set(e,n),n}function Qoe(e){let t=0;const n=k5();for(const s of n.segment(e))Goe(s.segment)&&t++;return t}function Xoe(e,t){return t.emojiCount===void 0&&(t.emojiCount=Qoe(e)),t.emojiCount}function ha(e,t,n){return n===0?t.width:t.width-Xoe(e,t)*n}function Joe(e,t,n,s,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const i=k5(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){const u=[];for(const d of r){const f=kl(d,n);u.push(ha(d,f,s))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(o==="pair-context"||r.length>Uoe){const u=[];let d=null,f=0;for(const h of r){const p=kl(h,n),m=ha(h,p,s);if(d===null)u.push(m);else{const x=d+h,k=kl(x,n);u.push(ha(x,k,s)-f)}d=h,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=kl(a,n),f=ha(a,d,s);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function eie(e,t){const n=$k();n.font=e;const s=Voe(e),o=Koe(e),i=t?Zoe(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function tie(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function b5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function x5(e,t,n=e.widths.length){for(;t<n;){const s=e.kinds[t];if(!tie(s))break;t++}return t}function nie(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function sie(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Lk(e,t){return t===0?0:e+t}function oie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function iie(e,t,n,s,o){const i=t==="tab"?o+oie(e,n):e.lineEndFitAdvances[n];return Lk(s,i)}function $C(e,t,n,s){const o=t==="tab"?0:e.lineEndFitAdvances[n];return Lk(s,o)}function LC(e,t,n,s,o){const i=t==="tab"?o:e.lineEndPaintAdvances[n];return Lk(s,i)}function rie(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function lie(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Ep(e,t,n){let s=t;for(;s<e.length&&e[s]<n;)s++;return s}function aie(e,t,n,s,o){if(e.letterSpacing===0)return 0;if(o>0)return e.spacingGraphemeCounts[s]>0?e.letterSpacing:0;for(let i=s-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===s-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function cie(e,t,n,s,o,i){return t+aie(e,n,s,o,i)}function uie(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(s.length===0)return 0;const a=Bm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,m=0,x=0,k=-1,g=0;function v(){k=-1,g=0}function y(N=m,F=x,S=d){u++,n?.(S,h,p,N,F),d=0,f=!1,v()}function M(N,F){f=!0,h=N,p=0,m=N+1,x=0,d=F}function L(N,F,S){f=!0,h=N,p=F,m=N,x=F+1,d=S}function $(N,F){if(!f){M(N,F);return}d+=F,m=N+1,x=0}function _(N,F){const S=i[N],I=r[N]??null;let R=I===null?-1:Ep(I,0,F+1),B=-1,P=0,z=F;for(;z<S.length;){const W=S[z];if(!f)L(N,z,W);else if(d+W>c){if(I!==null&&B>F){y(N,B,P),z=B,R=Ep(I,R,z+1),B=-1,P=0;continue}y(),L(N,z,W)}else d+=W,m=N,x=z+1;const ee=z+1;I!==null&&I[R]===ee&&(B=ee,P=d,R++),z++}f&&m===N&&x===S.length&&(m=N+1,x=0)}let E=0;for(;E<s.length&&!(!f&&(E=x5(e,E),E>=s.length));){const N=s[E],F=o[E],S=b5(F);if(!f){N>c&&i[E]!==null?_(E,0):M(E,N),S&&(k=E+1,g=d-N),E++;continue}if(d+N>c){if(S){$(E,N),y(E+1,0,d-N),E++;continue}if(k>=0){if(m>k||m===k&&x>0){y();continue}y(k,0,g);continue}if(N>c&&i[E]!==null){y(),_(E,0),E++;continue}y();continue}$(E,N),S&&(k=E+1,g=d-N),E++}return f&&y(),u}function die(e,t,n){if(e.simpleLineWalkFastPath)return uie(e,t,n);const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(s.length===0||a.length===0)return 0;const c=Bm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,m=0,x=0,k=0,g=0,v=-1,y=0,M=0,L=null;function $(){v=-1,y=0,M=0,L=null}function _(){return L==="soft-hyphen"&&v===k&&g===0?M:h}function E(P=k,z=g,W){f++,n!==void 0&&n(cie(e,W??_(),m,x,P,z),m,x,P,z),h=0,p=!1,$()}function N(P,z){p=!0,m=P,x=0,k=P+1,g=0,h=z}function F(P,z,W){p=!0,m=P,x=z,k=P,g=z+1,h=W}function S(P,z){if(!p){N(P,z);return}h+=z,k=P+1,g=0}function I(P,z,W,ee,U,Z){if(!z)return;const ce=$C(e,P,W,U),fe=LC(e,P,W,U,ee);v=W+1,y=h-Z+ce,M=h-Z+fe,L=P}function R(P,z){const W=i[P],ee=r[P]??null;let U=ee===null?-1:Ep(ee,0,z+1),Z=-1,ce=0,fe=z;for(;fe<W.length;){const oe=W[fe];if(!p)F(P,fe,oe);else{const X=rie(e,!0,oe),le=h+X;if(lie(e,le)>d){if(ee!==null&&Z>z){E(P,Z,ce),fe=Z,U=Ep(ee,U,fe+1),Z=-1,ce=0;continue}E(),F(P,fe,oe)}else h=le,k=P,g=fe+1}const Y=fe+1;ee!==null&&ee[U]===Y&&(Z=Y,ce=h,U++),fe++}p&&k===P&&g===W.length&&(k=P+1,g=0)}function B(P){f++,n?.(0,P.startSegmentIndex,0,P.consumedEndSegmentIndex,0),$()}for(let P=0;P<a.length;P++){const z=a[P];if(z.startSegmentIndex===z.endSegmentIndex){B(z);continue}p=!1,h=0,m=z.startSegmentIndex,x=0,k=z.startSegmentIndex,g=0,$();let W=z.startSegmentIndex;for(;W<z.endSegmentIndex&&!(!p&&(W=x5(e,W,z.endSegmentIndex),W>=z.endSegmentIndex));){const ee=o[W],U=b5(ee),Z=sie(e,p,W),ce=ee==="tab"?nie(h+Z,e.tabStopAdvance):s[W],fe=Z+ce,oe=iie(e,ee,W,Z,ce);if(ee==="soft-hyphen"){p&&(k=W+1,g=0,v=W+1,y=h+l,M=h+l,L=ee),W++;continue}if(!p){oe>d&&i[W]!==null?R(W,0):N(W,ce),I(ee,U,W,ce,Z,fe),W++;continue}if(h+oe>d){const X=h+$C(e,ee,W,Z),le=h+LC(e,ee,W,Z,ce);if(L==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&y<=d){E(v,0,M);continue}if(U&&X<=d){S(W,fe),E(W+1,0,le),W++;continue}if(v>=0&&y<=d){if(k>v||k===v&&g>0){E();continue}const He=v;E(He,0,M),W=He;continue}if(oe>d&&i[W]!==null){E(),R(W,0),W++;continue}E();continue}S(W,fe),I(ee,U,W,ce,Z,fe),W++}if(p){const ee=v===z.consumedEndSegmentIndex?M:h;E(z.consumedEndSegmentIndex,0,ee)}}return f}let dg=null;function Fk(){return dg===null&&(dg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),dg}function fie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function hie(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=Uv(d),l=Fm.has(d)}function u(d,f){s.push(d),i=i||f;const h=Uv(d);d.length===1&&Sa.has(d)?r=r||h:r=h,l=!1}for(const d of Fk().segment(e)){const f=d.segment,h=tr(f);if(s.length===0){c(f,d.index,h);continue}if(l||Tk.has(f)||Sa.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function pie(e,t,n){if(t.length<=1)return t;const s=[];let o=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;s.push({text:e.slice(u,d),start:u})}function l(a){if(!(o<0)){if(i)o+1===a?s.push(t[o]):r(o,a);else for(let c=o;c<a;c++)s.push(t[c]);o=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];o>=0&&!g5(t[a-1].text,n)&&l(a),o<0&&(o=a),i=i||tr(c.text)}return l(t.length),s}function FC(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const s=Fk();for(const o of s.segment(e))n++;return n}function mie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function gie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const s of Fk().segment(e))n++,mie(s.segment)&&t.push(n);return t.length===0?null:t}function vie(e,t,n){return t>1?e+(t-1)*n:e}function yie(e,t,n,s,o){const i=Bm(),{cache:r,emojiCorrection:l}=eie(t,Yoe(e.normalized)),a=ha("-",kl("-",r),l)+(o===0?0:o*2),u=ha(" ",kl(" ",r),l)*8,d=o!==0;if(e.len===0)return fie();const f=[],h=[],p=[],m=[];let x=e.chunks.length<=1&&!d;const k=n?[]:null,g=[],v=[],y=[],M=n?[]:null,L=Array.from({length:e.len});function $(F,S,I,R,B,P,z,W,ee){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(x=!1),f.push(S),h.push(I),p.push(R),m.push(B),k?.push(P),g.push(z),v.push(W),d&&y.push(ee),M!==null&&M.push(F)}function _(F,S,I,R,B){const P=kl(F,r),z=d?FC(F,S):0,W=vie(ha(F,P,l),z,o),ee=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:W,U=ee===0?0:ee+(z>0?o:0),Z=S==="space"||S==="zero-width-break"?0:W;if(B&&R&&F.length>1){let ce="sum-graphemes";o!==0?ce="segment-prefixes":Mp(F)?ce="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ce="segment-prefixes");const fe=Joe(F,P,r,l,ce),oe=fe===null||s==="keep-all"?null:gie(F);$(F,W,U,Z,S,I,fe,oe,z);return}$(F,W,U,Z,S,I,null,null,z)}for(let F=0;F<e.len;F++){L[F]=f.length;const S=e.texts[F],I=e.isWordLike[F],R=e.kinds[F],B=e.starts[F];if(R==="soft-hyphen"){$(S,0,a,a,R,B,null,null,0);continue}if(R==="hard-break"){$(S,0,0,0,R,B,null,null,0);continue}if(R==="tab"){$(S,0,0,0,R,B,null,null,d?FC(S,R):0);continue}const P=kl(S,r);if(R==="text"&&P.containsCJK){const z=hie(S,i),W=s==="keep-all"?pie(S,z,i.breakKeepAllAfterPunctuation):z;for(let ee=0;ee<W.length;ee++){const U=W[ee];_(U.text,"text",B+U.start,I,s==="keep-all"||!tr(U.text))}continue}_(S,R,B,I,!0)}const E=kie(e.chunks,L,f.length),N=k===null?null:zse(e.normalized,k);return M!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:x,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E,segments:M}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:x,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E}}function kie(e,t,n){const s=[];for(let o=0;o<e.length;o++){const i=e[o],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;s.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return s}function bie(e,t,n,s){const o=s?.wordBreak??"normal",i=s?.letterSpacing??0,r=zoe(e,Bm(),s?.whiteSpace,o);return yie(r,t,n,o,i)}function xie(e,t,n){return bie(e,t,!0,n)}function _ie(e){let t=0;return die(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const wie={key:0,class:"slash-menu",role:"listbox"},Sie=["aria-selected","onMouseenter","onMousedown"],Cie={class:"slash-name"},Aie={class:"slash-desc"},Mie=Ye({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q([]);return Qe(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(b(),T("div",wie,[(b(!0),T(Be,null,st(e.items,(a,c)=>(b(),T("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Pe(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:bt(u=>o("select",a),["prevent"])},[w("span",Cie,O(a.name),1),w("span",Aie,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Sie))),128))])):re("",!0)}}),Eie=dt(Mie,[["__scopeId","data-v-f60b70d9"]]),Tie={class:"mention-menu",role:"listbox"},Nie={key:0,class:"mention-state dim"},Iie={key:1,class:"mention-state dim"},$ie=["aria-selected","onMouseenter","onMousedown"],Lie=["innerHTML"],Fie={class:"mention-name"},Oie={class:"mention-path"},Rie=Ye({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=dc("folder","sm"),r=dc("code","sm"),l=dc("file-text","sm"),a=dc("image","sm"),c=dc("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 x=p.name||m.split("/").pop()||m,k=x.lastIndexOf("."),g=k>0?x.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(b(),T("div",Tie,[n.loading?(b(),T("div",Nie,O(C(o)("mention.searching")),1)):n.items.length===0?(b(),T("div",Iie,O(C(o)("mention.noMatch")),1)):(b(!0),T(Be,{key:2},st(n.items,(x,k)=>(b(),T("div",{key:x.path,class:Pe(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>s("hover",k),onMousedown:bt(g=>s("select",x),["prevent"])},[w("span",{class:"mention-icon",innerHTML:h(x),"aria-hidden":"true"},null,8,Lie),w("span",Fie,O(x.name),1),w("span",Oie,O(x.path),1)],42,$ie))),128))]))}}),Bie=dt(Rie,[["__scopeId","data-v-f4d6b958"]]),_5=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function Die(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Tp="skill:";function Pie(e){return e.startsWith(Tp)?e.slice(Tp.length):e}function w5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Tp}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[..._5,...t]}function Hie(e,t=_5){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 Dm(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 S5(e){return e?.supportEfforts??[]}function Wie(e){return e[Math.floor(e.length/2)]}function Pm(e){if(Dm(e)==="unsupported")return"off";const t=S5(e);return t.length>0?e?.defaultEffort??Wie(t):"on"}function Ok(e){const t=S5(e),n=Dm(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function jv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function zie(e){return e!=="off"}function Rk(e,t){return t==="off"?"off":t==="on"?Pm(e):t}function Np(e,t){return t??Pm(e)}function Uie(e){return e==="off"?{enabled:!1}:e==="on"?{enabled:!0}:{enabled:!0,effort:e}}function qie(e,t,n){return!n||e===void 0?t:Pm(e)}const Ip=100;function jie(e){const t=um(Lt.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>Ip?n.slice(-Ip):n,o={[e]:s};return Wd(Lt.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function Vie(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=Q(jie(o())),r=D(()=>i.value[o()??""]??[]);let l=-1,a="";function c(k){const g=o();if(l=-1,!g)return;const v=k.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const M=[...y,v],L=M.length>Ip?M.slice(-Ip):M;i.value={...i.value,[g]:L},Wd(Lt.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,gt(()=>{const g=n.value;if(!g)return;s();const v=k.length;g.setSelectionRange(v,v)})}function f(){const k=r.value;if(k.length!==0){if(l===-1)a=t.value,l=k.length-1;else if(l>0)l-=1;else return;d(k[l])}}function h(){if(l===-1)return;const k=r.value;l<k.length-1?(l+=1,d(k[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function x(){return r.value.length>0}return Qe(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:x}}function Kie(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Q(!1),c=Q([]),u=Q(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=Hie(h,w5(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} `,gt(()=>{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 Gie(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=Q(!1),r=Q([]),l=Q(0),a=Q(!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 x=h.slice(m,p);return x.startsWith("@")?{token:x.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,gt(()=>{const x=n.value;if(!x)return;const k=p.start+h.path.length;x.setSelectionRange(k,k),x.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Yie(e){const{sessionId:t}=e;function n(c){return rs(Vx(c))??""}function s(c,u){const d=Vx(c);u?gs(d,u):Vc(d)}const o=Q(n(t())),i=Q(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Qe(o,c=>{gt(r),s(t(),c)}),Qe(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),gt(r))});function l(c){o.value=c,gt(()=>{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 Zie(e){const{uploadImage:t,sessionId:n}=e,s=Q({}),o=D(()=>s.value[n()??""]??[]),i=Q(null),r=Q(null),l=Q(!1);let a=0;function c(){return`att_${++a}`}function u(F,S){s.value={...s.value,[F]:S}}function d(F){try{URL.revokeObjectURL(F.previewUrl)}catch{}}function f(F){return F.startsWith("image/")?"image":F.startsWith("video/")?"video":null}async function h(F){const S=t();if(!S)return;const I=n()??"",R=F.map(B=>({file:B,kind:f(B.type)})).filter(B=>B.kind!==null);if(R.length!==0)for(const{file:B,kind:P}of R){const z=c(),W=URL.createObjectURL(B),ee={localId:z,name:B.name,kind:P,previewUrl:W,uploading:!0};u(I,[...s.value[I]??[],ee]),S(B,B.name).then(U=>{const Z=s.value[I]??[];u(I,Z.map(ce=>ce.localId===z?{...ce,uploading:!1,fileId:U?.fileId,error:U===null}:ce))}).catch(()=>{const U=s.value[I]??[];u(I,U.map(Z=>Z.localId===z?{...Z,uploading:!1,error:!0}:Z))})}}function p(F){const S=n()??"",I=s.value[S]??[],R=I.find(B=>B.localId===F);i.value?.localId===F&&(i.value=null),R&&d(R),u(S,I.filter(B=>B.localId!==F))}function m(F){i.value=F}function x(){i.value=null}function k(){r.value?.click()}function g(F){const S=F.target,I=Array.from(S.files??[]);h(I),S.value=""}function v(F){if(!t())return;const S=F.clipboardData;if(!S)return;const I=[],R=new Set,B=(P,z)=>{const W=`${P.size}:${P.type}:${z}`;if(R.has(W))return;R.add(W);const ee=P.type.split("/")[1]??"png",U=z.includes(".")?z:`paste-${Date.now()}.${ee}`;I.push(P instanceof File?P:new File([P],U,{type:P.type}))};for(const P of Array.from(S.items))if(P.kind==="file"&&f(P.type)){const z=P.getAsFile();z&&B(z,z.name||`paste-${Date.now()}.${P.type.split("/")[1]??"png"}`)}for(const P of Array.from(S.files))f(P.type)&&B(P,P.name);I.length!==0&&(F.preventDefault(),h(I))}function y(F){!t()||!Array.from(F.dataTransfer?.items??[]).some(I=>I.kind==="file")||(F.preventDefault(),l.value=!0)}function M(){l.value=!1}function L(F){if(l.value=!1,!t())return;F.preventDefault();const S=Array.from(F.dataTransfer?.files??[]);h(S)}function $(){const F=n()??"";for(const S of s.value[F]??[])d(S);u(F,[])}function _(F,S,I){const R=s.value[F]??[];R.some(B=>B.localId===S)&&u(F,R.map(B=>B.localId===S?{...B,...I}:B))}function E(F){return fetch(F).then(S=>{if(!S.ok)throw new Error(`fetch failed: ${S.status}`);return S.blob()})}function N(F){const S=n()??"";for(const I of s.value[S]??[])d(I);u(S,[]);for(const I of F){const R=c(),B=/^data:/i.test(I.url),P=/^blob:/i.test(I.url),z=I.name??I.kind;if(I.fileId){const W={localId:R,name:z,kind:I.kind,previewUrl:I.url,uploading:!1,fileId:I.fileId};u(S,[...s.value[S]??[],W]),!B&&!P&&ft().getFileBlob(I.fileId).then(ee=>{const U=URL.createObjectURL(ee);if(!(s.value[S]??[]).some(ce=>ce.localId===R)){URL.revokeObjectURL(U);return}_(S,R,{previewUrl:U})}).catch(()=>{})}else{const W=t();if(!W)continue;const ee={localId:R,name:z,kind:I.kind,previewUrl:I.url,uploading:!0};u(S,[...s.value[S]??[],ee]),E(I.url).then(U=>{const Z=z.includes(".")?z:`${z}.${U.type.split("/")[1]??"bin"}`;return W(U,Z)}).then(U=>{if(U===null){const Z=s.value[S]??[];u(S,Z.filter(ce=>ce.localId!==R));return}_(S,R,{uploading:!1,fileId:U.fileId})}).catch(()=>{const U=s.value[S]??[];u(S,U.filter(Z=>Z.localId!==R))})}}}return Qe(n,()=>{i.value=null}),yn(()=>{document.addEventListener("paste",v)}),Sn(()=>{document.removeEventListener("paste",v);for(const F of Object.values(s.value))for(const S of F)d(S);i.value=null}),{attachments:o,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:x,openFilePicker:k,handleFileInputChange:g,handleDragOver:y,handleDragLeave:M,handleDrop:L,clearAfterSubmit:$,loadAttachments:N}}const Qie=["type","disabled"],Xie={class:"ui-button__content"},Jie=Ye({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(b(),T("button",{class:Pe(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(b(),ke(Ho,{key:0,size:"sm",class:"ui-button__spinner"})):re("",!0),w("span",Xie,[Fn(t.$slots,"default",{},void 0,!0)])],10,Qie))}}),Bt=dt(Jie,[["__scopeId","data-v-e58393a8"]]),ere={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},tre=["stroke-dasharray","stroke-dashoffset"],fg=7,nre=Ye({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*fg;return(s,o)=>(b(),T("svg",ere,[w("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:fg,fill:"none","stroke-width":"2.5"}),w("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:fg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,tre)]))}}),sre=dt(nre,[["__scopeId","data-v-a364f1f1"]]),ore={key:0,class:"att-strip"},ire=["onClick"],rre=["src"],lre=["src","alt"],are={key:2,class:"att-video-badge","aria-hidden":"true"},cre={class:"att-name"},ure={class:"att-err-icon"},dre=["onClick"],fre={class:"att-lightbox-card"},hre=["src"],pre=["src","alt"],mre={class:"att-lightbox-name"},gre={class:"composer-card"},vre={class:"cin-wrap"},yre={class:"input-row"},kre=["placeholder","disabled"],bre=["aria-label"],xre={class:"toolbar-left"},_re=["onKeydown"],wre=["onClick"],Sre={class:"pd-check"},Cre={class:"pd-info"},Are={class:"pd-desc"},Mre={class:"mode-label"},Ere={key:0,class:"mode-tag"},Tre={key:1,class:"mode-tag"},Nre={key:2,class:"mode-tag"},Ire={class:"mode-row-icon"},$re={class:"mode-row-info"},Lre={class:"mode-row-name"},Fre={class:"mode-row-desc"},Ore={class:"mode-row-icon"},Rre={class:"mode-row-info"},Bre={class:"mode-row-name"},Dre={class:"mode-row-desc"},Pre={class:"mode-row-icon"},Hre={class:"mode-row-info"},Wre={class:"mode-row-name"},zre={class:"mode-row-desc"},Ure={key:0,class:"mode-row-actions"},qre={class:"toolbar-right"},jre=["aria-label"],Vre={class:"ctx-num"},Kre=["onKeydown"],Gre={key:0,class:"think-suffix"},Yre=["aria-label"],Zre=["aria-label","disabled"],Qre={key:0,class:"md-section"},Xre=["onClick"],Jre={class:"md-check"},ele={class:"md-name"},tle={class:"md-provider"},nle={key:1,class:"md-divider"},sle={key:2,class:"md-section"},ole=["onClick"],ile={class:"md-check"},rle={class:"md-name"},lle={key:3,class:"md-divider"},ale={class:"md-name"},cle={key:0,class:"md-note"},ule=["aria-label"],dle=["disabled","onClick"],fle={class:"md-name"},OC=36,hle=Ye({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=D(()=>s.starting?r("composer.starting"):s.running?r("composer.placeholderRunning"):s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Tt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Yie({sessionId:()=>s.sessionId}),h=Q(!1);function p(){h.value=!h.value,gt(()=>{u(),g(),c.value?.focus()})}function m(){h.value&&(h.value=!1,gt(u))}function x(Ke){if(typeof getComputedStyle>"u")return OC;const nt=Number.parseFloat(getComputedStyle(Ke).minHeight);return Number.isFinite(nt)&&nt>0?nt:OC}const k=Q(!1);function g(){const Ke=c.value;k.value=!!Ke&&Ke.scrollHeight>x(Ke)}Qe(a,()=>{gt(g)}),Qe(()=>s.sessionId,()=>{h.value=!1});const v=Vie({text:a,textareaRef:c,autosize:u,sessionId:()=>s.sessionId}),{open:y,items:M,active:L,update:$,select:_}=Kie({text:a,textareaRef:c,autosize:u,skills:()=>s.skills,emitCommand:Ke=>i("command",Ke),historyPush:Ke=>v.push(Ke),clearDraft:f}),{open:E,items:N,active:F,loading:S,update:I,select:R}=Gie({text:a,textareaRef:c,autosize:u,searchFiles:()=>s.searchFiles});function B(){v.resetBrowsing(),$(),I()}const{attachments:P,previewAttachment:z,fileInputRef:W,isDragOver:ee,removeAttachment:U,openAttachmentPreview:Z,closeAttachmentPreview:ce,openFilePicker:fe,handleFileInputChange:oe,handleDragOver:Y,handleDragLeave:X,handleDrop:le,clearAfterSubmit:He,loadAttachments:de}=Zie({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});yn(()=>{a.value&&gt(()=>{u(),g()})}),Sn(()=>{document.removeEventListener("mousedown",en),ue()});function G(){c.value?.focus({preventScroll:!0})}function ae(Ke){de(Ke)}t({loadForEdit:d,loadAttachmentsForEdit:ae,focus:G});function me(){const Ke=a.value.trim();if(P.value.some(Ot=>Ot.uploading))return;const nt=P.value.filter(Ot=>!Ot.uploading&&!Ot.error&&Ot.fileId);if(!Ke&&nt.length===0)return;if(v.push(Ke),Ke){const Ot=Die(Ke),ve=Ot?w5(s.skills).some(xe=>xe.name===Ot.cmd||xe.name===`/${Tp}${Ot.cmd.slice(1)}`):!1;if(Ot&&ve){a.value="",f(),y.value=!1,m(),i("command",Ot.arg?`${Ot.cmd} ${Ot.arg}`:Ot.cmd);return}}const ot={text:Ke,attachments:nt.map(Ot=>({fileId:Ot.fileId,kind:Ot.kind}))};z.value=null,He(),a.value="",f(),y.value=!1,E.value=!1,m(),i("submit",ot)}function q(){if(!s.running||P.value.some(Ot=>Ot.uploading))return;const Ke=a.value.trim(),nt=P.value.filter(Ot=>!Ot.uploading&&!Ot.error&&Ot.fileId);if(!Ke&&nt.length===0&&s.queued.length===0)return;const ot={text:Ke,attachments:nt.map(Ot=>({fileId:Ot.fileId,kind:Ot.kind}))};He(),v.push(Ke),a.value="",f(),y.value=!1,E.value=!1,m(),i("steer",ot)}let ne=!1,ge=null;function ue(){ge!==null&&(clearTimeout(ge),ge=null)}function ye(){ue(),ne=!0}function j(){ue(),ge=setTimeout(()=>{ge=null,ne=!1},0)}function te(Ke){return ne||Ke.isComposing||Ke.keyCode===229}function pe(Ke){if(!te(Ke)){if(Ke.key==="Escape"){if(Fe.value){Ke.preventDefault(),it();return}if(he.value){Ke.preventDefault(),xt();return}}if(y.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),L.value=(L.value+1)%M.value.length;return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),L.value=(L.value-1+M.value.length)%M.value.length;return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const nt=M.value[L.value];nt&&_(nt);return}if(Ke.key==="Escape"){Ke.preventDefault(),y.value=!1;return}}if(E.value&&!S.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),F.value=(F.value+1)%Math.max(1,N.value.length);return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),F.value=(F.value-1+Math.max(1,N.value.length))%Math.max(1,N.value.length);return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const nt=N.value[F.value];nt&&R(nt);return}if(Ke.key==="Escape"){Ke.preventDefault(),E.value=!1;return}}if(Ke.key==="s"&&(Ke.ctrlKey||Ke.metaKey)&&!Ke.shiftKey&&!Ke.altKey){s.running&&(Ke.preventDefault(),q());return}if(!h.value&&!y.value&&!E.value&&!Ke.shiftKey&&!Ke.altKey&&!Ke.metaKey&&!Ke.ctrlKey){const nt=v.isBrowsing();if(Ke.key==="ArrowUp"&&v.hasHistory()&&(nt||v.caretAtTextStart())){Ke.preventDefault(),v.recallOlder();return}if(Ke.key==="ArrowDown"&&nt){Ke.preventDefault(),v.recallNewer();return}}if(Ke.key==="Enter"&&!Ke.shiftKey){if(h.value&&!(Ke.metaKey||Ke.ctrlKey))return;Ke.preventDefault(),me()}}}const Se=D(()=>r("composer.send")),Ie=D(()=>!!s.uploadImage),Fe=Q(!1),he=Q(!1),Ne=Q(null);function Je(){Fe.value=!Fe.value,Fe.value?(he.value=!1,jt(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function it(){Fe.value=!1,he.value||document.removeEventListener("click",wt,!0)}function At(){he.value=!he.value,he.value?(Fe.value=!1,jt(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function xt(){he.value=!1,Fe.value||document.removeEventListener("click",wt,!0)}function wt(Ke){Ne.value&&!Ne.value.contains(Ke.target)&&(it(),xt())}Sn(()=>{document.removeEventListener("click",wt,!0)});const Kt=Ke=>`${Math.round(Ke/1e3)}k`,vt=D(()=>{const Ke=s.status?.ctxMax??0;return Ke<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Ke*100)))}),cn=D(()=>{const Ke=(s.status?.ctxUsed??0).toLocaleString(),nt=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ke,max:nt,pct:vt.value})}),Kn=D(()=>vt.value>=80),Un=D(()=>s.models?.find(Ke=>Ke.id===s.status?.modelId)),Zt=D(()=>Dm(Un.value)),bn=D(()=>Ok(Un.value)),Pn=D(()=>Np(Un.value,s.thinking)),rt=D(()=>bn.value.includes(Pn.value)?Pn.value:""),Hn=D(()=>zie(Pn.value)),Os=D(()=>Zt.value==="unsupported"||bn.value.length<=1),xn=D(()=>{if(!Hn.value)return"";const Ke=(Un.value?.supportEfforts?.length??0)>0,nt=Pn.value;return Ke&&nt!=="on"?r("composer.thinkingSuffixEffort",{level:nt}):r("composer.thinkingSuffix")});function ls(Ke){Os.value||i("setThinking",Rk(Un.value,Ke))}function As(Ke){return Ke==="on"?r("status.thinkingOn"):Ke==="off"?r("status.thinkingOff"):jv(Ke)}const nn=D(()=>s.planMode===!0),as=D(()=>s.swarmMode===!0),hn=D(()=>s.goal?.status??s.activationBadges?.goal?.status??null),cs=D(()=>hn.value!==null&&hn.value!=="complete"),us=D(()=>cs.value||s.goalMode===!0),On=D(()=>hn.value==="active"),es=D(()=>hn.value==="paused"||hn.value==="blocked"),ds=Q(!1),Ht=Q(null),Ze=Q(null),Ue=Q({}),Ft=D(()=>nn.value||as.value||us.value);function jt(){ds.value=!1,document.removeEventListener("mousedown",en)}function en(Ke){const nt=Ke.target;Ht.value?.contains(nt)||Ze.value?.contains(nt)||jt()}function Qt(){if(ds.value){jt();return}it(),xt();const Ke=Ht.value?.getBoundingClientRect();Ke&&(Ue.value={left:`${Math.round(Ke.left)}px`,bottom:`${Math.round(window.innerHeight-Ke.top+8)}px`}),ds.value=!0,setTimeout(()=>document.addEventListener("mousedown",en),0)}const un=[{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"}],Wn=["status.planDesc","status.swarmDesc","status.goalDesc"],Nt=Q(null),fs=Q(""),ts=Q("");function Zs(Ke){const nt={};return Ke&&(nt["--composer-menu-desc-width"]=Ke),nt}const zn=D(()=>Zs(fs.value)),Gn=D(()=>Zs(ts.value)),Di=D(()=>({...Ue.value,...Gn.value}));let Ms=null;function _i(Ke){const nt=Number.parseFloat(Ke);return Number.isFinite(nt)?nt:0}function So(Ke){return`${Ke.fontStyle||"normal"} ${Ke.fontWeight||"400"} ${Ke.fontSize} ${Ke.fontFamily}`}function Pi(Ke){return Ke.letterSpacing==="normal"?0:_i(Ke.letterSpacing)}function ni(Ke,nt){if(!Ke)return 0;const ot=xie(Ke,So(nt),{letterSpacing:Pi(nt)});return _ie(ot)}function vs(){const Ke=Nt.value?.querySelector(".pd-desc");if(!Ke)return;const nt=getComputedStyle(Ke),ot=Math.max(0,...un.map(ve=>ni(r(ve.descKey),nt))),Ot=Math.max(0,...Wn.map(ve=>ni(r(ve),nt)));fs.value=ot>0?`${Math.ceil(ot)}px`:"",ts.value=Ot>0?`${Math.ceil(Ot)}px`:""}function Co(){typeof window>"u"||(Ms!==null&&window.cancelAnimationFrame(Ms),gt(()=>{Ms=window.requestAnimationFrame(()=>{Ms=null,vs()})}))}Qe(l,Co,{immediate:!0}),yn(()=>{Co(),document.fonts?.ready.then(Co)}),Sn(()=>{Ms!==null&&(window.cancelAnimationFrame(Ms),Ms=null)});function sr(Ke){i("setPermission",Ke),xt()}const wi=D(()=>un.find(Ke=>Ke.mode===s.status?.permission)),Yn=D(()=>wi.value?r(wi.value.labelKey):""),ys=D(()=>Un.value?.provider??""),Ao=D(()=>!ys.value||!s.models?.length?[]:s.models.filter(Ke=>Ke.provider===ys.value)),ct=D(()=>new Set(s.starredIds??[]));function be(Ke){return ct.value.has(Ke)}const $e=D(()=>s.models?.length?s.models.filter(Ke=>be(Ke.id)&&Ke.provider!==ys.value):[]);function sn(Ke){i("selectModel",Ke),it()}return(Ke,nt)=>(b(),T("div",{class:Pe(["composer",{"drag-over":C(ee),expanded:h.value}]),onDragover:nt[18]||(nt[18]=(...ot)=>C(Y)&&C(Y)(...ot)),onDragleave:nt[19]||(nt[19]=(...ot)=>C(X)&&C(X)(...ot)),onDrop:nt[20]||(nt[20]=(...ot)=>C(le)&&C(le)(...ot))},[C(P).length>0?(b(),T("div",ore,[(b(!0),T(Be,null,st(C(P),ot=>(b(),T("div",{key:ot.localId,class:Pe(["att-chip",{"att-error":ot.error}])},[ie(Yt,{text:C(r)("composer.previewAttachment",{name:ot.name})},{default:Me(()=>[w("button",{type:"button",class:"att-preview",onClick:Ot=>C(Z)(ot)},[ot.kind==="video"?(b(),T("video",{key:0,class:"att-thumb",src:ot.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,rre)):(b(),T("img",{key:1,class:"att-thumb",src:ot.previewUrl,alt:ot.name},null,8,lre)),ot.kind==="video"?(b(),T("span",are,[ie(je,{name:"play",size:"sm"})])):re("",!0)],8,ire)]),_:2},1032,["text"]),w("span",cre,O(ot.name),1),ot.uploading?(b(),ke(Ho,{key:0,size:"sm",label:C(r)("composer.uploading")},null,8,["label"])):ot.error?(b(),ke(Yt,{key:1,text:C(r)("composer.uploadFailed")},{default:Me(()=>[w("span",ure,[ie(je,{name:"info",size:"sm"})])]),_:1},8,["text"])):re("",!0),ie(Yt,{text:C(r)("composer.removeNamed",{name:ot.name})},{default:Me(()=>[w("button",{class:"att-rm",onClick:Ot=>C(U)(ot.localId)},[ie(je,{name:"close",size:"sm"})],8,dre)]),_:2},1032,["text"])],2))),128))])):re("",!0),C(z)?(b(),T("div",{key:1,class:"att-lightbox",onClick:nt[1]||(nt[1]=bt((...ot)=>C(ce)&&C(ce)(...ot),["self"]))},[w("div",fre,[ie(Yt,{text:C(r)("model.close")},{default:Me(()=>[w("button",{type:"button",class:"att-lightbox-close",onClick:nt[0]||(nt[0]=(...ot)=>C(ce)&&C(ce)(...ot))},"✕")]),_:1},8,["text"]),C(z).kind==="video"?(b(),T("video",{key:0,class:"att-lightbox-media",src:C(z).previewUrl,controls:"",playsinline:""},null,8,hre)):(b(),T("img",{key:1,class:"att-lightbox-media",src:C(z).previewUrl,alt:C(z).name},null,8,pre)),w("div",mre,O(C(z).name),1)])])):re("",!0),w("div",gre,[w("div",vre,[C(y)?(b(),ke(Eie,{key:0,items:C(M),"active-index":C(L),onSelect:C(_),onHover:nt[2]||(nt[2]=ot=>L.value=ot)},null,8,["items","active-index","onSelect"])):re("",!0),C(E)?(b(),ke(Bie,{key:1,items:C(N),"active-index":C(F),loading:C(S),onSelect:C(R),onHover:nt[3]||(nt[3]=ot=>F.value=ot)},null,8,["items","active-index","loading","onSelect"])):re("",!0),w("div",yre,[Ln(w("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":nt[4]||(nt[4]=ot=>ps(a)?a.value=ot:null),class:"ph",placeholder:o.value,disabled:e.starting,rows:"1",onKeydown:pe,onCompositionstart:ye,onCompositionend:j,onInput:B},null,40,kre),[[wo,C(a)]]),h.value||k.value?(b(),T("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(b(),ke(je,{key:0,name:"collapse",size:"sm"})):(b(),ke(je,{key:1,name:"expand",size:"sm"}))],8,bre)):re("",!0)])]),Ie.value?(b(),T("input",{key:0,ref_key:"fileInputRef",ref:W,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:nt[5]||(nt[5]=(...ot)=>C(oe)&&C(oe)(...ot))},null,544)):re("",!0),w("div",{ref_key:"toolbarRef",ref:Ne,class:"toolbar"},[w("div",{ref_key:"menuMeasureRef",ref:Nt,class:"menu-measure","aria-hidden":"true"},[...nt[21]||(nt[21]=[w("span",{class:"pd-desc"},null,-1)])],512),w("div",xre,[Ie.value?(b(),ke(Dn,{key:0,size:"md",label:C(r)("composer.attachImage"),onClick:C(fe)},{default:Me(()=>[ie(je,{name:"image"})]),_:1},8,["label","onClick"])):re("",!0),e.status?(b(),T("span",{key:1,class:Pe(["perm-pill",["perm-"+e.status.permission,{open:he.value}]]),role:"button",tabindex:"0",onClick:bt(At,["stop"]),onKeydown:[Xi(At,["enter"]),Xi(bt(At,["prevent"]),["space"])]},O(Yn.value),43,_re)):re("",!0),he.value&&e.status?(b(),T("div",{key:2,class:"perm-dropdown",style:Gt(zn.value),role:"menu",onClick:nt[6]||(nt[6]=bt(()=>{},["stop"]))},[(b(),T(Be,null,st(un,ot=>w("button",{key:ot.mode,class:Pe(["pd-row",{"is-current":ot.mode===e.status.permission}]),role:"menuitem",onClick:Ot=>sr(ot.mode)},[w("span",Sre,[ot.mode===e.status.permission?(b(),ke(je,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",Cre,[w("span",{class:"pd-name",style:Gt({color:ot.color})},O(C(r)(ot.labelKey)),5),w("span",Are,O(C(r)(ot.descKey)),1)])],10,wre)),64))],4)):re("",!0),e.status?(b(),T("div",{key:3,ref_key:"modesRef",ref:Ht,class:"modes"},[w("button",{type:"button",class:Pe(["mode-pill",{on:Ft.value,open:ds.value}]),onClick:bt(Qt,["stop"])},[w("span",Mre,O(C(r)("status.modesLabel")),1),nn.value?(b(),T("span",Ere,O(C(r)("status.planLabel")),1)):re("",!0),as.value?(b(),T("span",Tre,O(C(r)("status.swarmLabel")),1)):re("",!0),us.value?(b(),T("span",Nre,O(C(r)("status.goalLabel")),1)):re("",!0)],2),ds.value?(b(),T("div",{key:0,ref_key:"modesMenuRef",ref:Ze,class:"modes-menu",style:Gt(Di.value),role:"menu"},[w("button",{type:"button",class:Pe(["mode-row",{on:nn.value}]),role:"menuitem",onClick:nt[7]||(nt[7]=ot=>i("togglePlan"))},[w("span",Ire,[ie(je,{name:"file-edit",size:"sm"})]),w("span",$re,[w("span",Lre,O(C(r)("status.planLabel")),1),w("span",Fre,O(C(r)("status.planDesc")),1)]),w("span",{class:Pe(["mode-switch",{on:nn.value}])},[...nt[22]||(nt[22]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("button",{type:"button",class:Pe(["mode-row",{on:as.value}]),role:"menuitem",onClick:nt[8]||(nt[8]=ot=>i("toggleSwarm"))},[w("span",Ore,[ie(je,{name:"sparkles",size:"sm"})]),w("span",Rre,[w("span",Bre,O(C(r)("status.swarmLabel")),1),w("span",Dre,O(C(r)("status.swarmDesc")),1)]),w("span",{class:Pe(["mode-switch",{on:as.value}])},[...nt[23]||(nt[23]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("div",{class:Pe(["mode-row mode-row-goal",{on:cs.value||s.goalMode}])},[w("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:nt[9]||(nt[9]=ot=>cs.value?i("focusGoal"):i("toggleGoal"))},[w("span",Pre,[ie(je,{name:"target",size:"sm"})]),w("span",Hre,[w("span",Wre,O(C(r)("status.goalLabel")),1),w("span",zre,O(C(r)("status.goalDesc")),1)]),cs.value?re("",!0):(b(),T("span",{key:0,class:Pe(["mode-switch",{on:s.goalMode}])},[...nt[24]||(nt[24]=[w("span",{class:"mode-knob"},null,-1)])],2))]),cs.value?(b(),T("div",Ure,[On.value?(b(),ke(Bt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:nt[10]||(nt[10]=ot=>i("controlGoal","pause"))},{default:Me(()=>[ie(je,{name:"pause",size:"sm"}),w("span",null,O(C(r)("status.goalPause")),1)]),_:1})):re("",!0),es.value?(b(),ke(Bt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:nt[11]||(nt[11]=ot=>i("controlGoal","resume"))},{default:Me(()=>[ie(je,{name:"play",size:"sm"}),w("span",null,O(C(r)("status.goalResume")),1)]),_:1})):re("",!0),ie(Bt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:nt[12]||(nt[12]=ot=>i("controlGoal","cancel"))},{default:Me(()=>[ie(je,{name:"close",size:"sm"}),w("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):re("",!0)],2)],4)):re("",!0)],512)):re("",!0)]),w("div",qre,[Kn.value?(b(),T("button",{key:0,class:"compact-chip",onClick:nt[13]||(nt[13]=bt(ot=>i("compact"),["stop"]))},"/compact")):re("",!0),ie(Yt,{text:cn.value},{default:Me(()=>[e.status&&!e.hideContext?(b(),T("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":cn.value},[ie(sre,{pct:vt.value},null,8,["pct"]),w("span",Vre,O(Kt(e.status.ctxUsed))+"/"+O(Kt(e.status.ctxMax)),1)],8,jre)):re("",!0)]),_:1},8,["text"]),e.status?(b(),T("span",{key:1,class:Pe(["model-pill",{open:Fe.value}]),role:"button",tabindex:"0",onClick:bt(Je,["stop"]),onKeydown:[Xi(Je,["enter"]),Xi(bt(Je,["prevent"]),["space"])]},[w("b",null,O(e.status.model),1),xn.value?(b(),T("span",Gre,O(xn.value),1)):re("",!0),ie(je,{class:"cv",name:"chevron-down",size:"sm"})],42,Kre)):re("",!0),e.running?(b(),ke(Yt,{key:2,text:C(r)("composer.interruptTitle")},{default:Me(()=>[w("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:nt[14]||(nt[14]=ot=>i("interrupt"))},[ie(je,{name:"stop",size:"sm"})],8,Yre)]),_:1},8,["text"])):re("",!0),w("button",{class:Pe(["send",{"is-starting":e.starting}]),"aria-label":Se.value,disabled:e.starting,onClick:nt[15]||(nt[15]=ot=>me())},[e.starting?(b(),ke(Ho,{key:0,size:"sm"})):(b(),ke(je,{key:1,name:"send",size:"sm"}))],10,Zre)]),Fe.value&&e.status?(b(),T("div",{key:0,class:"model-dropdown",role:"menu",onClick:nt[17]||(nt[17]=bt(()=>{},["stop"]))},[$e.value.length>0?(b(),T("div",Qre,O(C(r)("status.starredModels")),1)):re("",!0),(b(!0),T(Be,null,st($e.value,ot=>(b(),T("button",{key:ot.id,class:Pe(["md-row",{"is-current":ot.id===e.status.modelId}]),role:"menuitem",onClick:Ot=>sn(ot.id)},[w("span",Jre,[ot.id===e.status.modelId?(b(),ke(je,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",ele,O(ot.displayName??ot.model),1),w("span",tle,O(ot.provider),1),ie(je,{class:"md-star",name:"star",size:"sm"})],10,Xre))),128)),$e.value.length>0?(b(),T("div",nle)):re("",!0),Ao.value.length>0?(b(),T("div",sle,O(ys.value),1)):re("",!0),(b(!0),T(Be,null,st(Ao.value,ot=>(b(),T("button",{key:ot.id,class:Pe(["md-row",{"is-current":ot.id===e.status.modelId}]),role:"menuitem",onClick:Ot=>sn(ot.id)},[w("span",ile,[ot.id===e.status.modelId?(b(),ke(je,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",rle,O(ot.displayName??ot.model),1),be(ot.id)?(b(),ke(je,{key:0,class:"md-star",name:"star",size:"sm"})):re("",!0)],10,ole))),128)),Ao.value.length>0?(b(),T("div",lle)):re("",!0),w("div",{class:Pe(["md-thinking",{"is-readonly":Os.value}])},[w("span",ale,O(C(r)("status.thinkingLabel")),1),Zt.value==="unsupported"?(b(),T("span",cle,O(C(r)("status.modeNotSupported")),1)):(b(),T("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(b(!0),T(Be,null,st(bn.value,ot=>(b(),T("button",{key:ot,type:"button",class:Pe(["effort-seg",{"is-active":ot===rt.value}]),disabled:Os.value,onClick:Ot=>ls(ot)},O(As(ot)),11,dle))),128))],8,ule))],2),nt[25]||(nt[25]=w("div",{class:"md-divider"},null,-1)),w("button",{class:"md-row md-row-more",role:"menuitem",onClick:nt[16]||(nt[16]=ot=>{it(),i("pickModel")})},[w("span",fle,O(C(r)("status.moreModels")),1)])])):re("",!0)],512)])],34))}}),C5=dt(hle,[["__scopeId","data-v-92fee576"]]),ple={key:0,class:"ui-card__head"},mle={class:"ui-card__body"},gle={key:1,class:"ui-card__foot"},vle=Ye({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(b(),T("div",{class:Pe(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(b(),T("div",ple,[Fn(t.$slots,"head",{},void 0,!0)])):re("",!0),w("div",mle,[Fn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(b(),T("div",gle,[Fn(t.$slots,"foot",{},void 0,!0)])):re("",!0)],2))}}),Bk=dt(vle,[["__scopeId","data-v-9c9f9a9a"]]),yle={class:"goal-kicker"},kle={key:0,class:"goal-progress","aria-hidden":"true"},ble={class:"goal-full"},xle={key:0,class:"goal-criterion"},_le=["inert","aria-hidden"],wle={class:"goal-meta"},Sle={key:0},Cle={class:"goal-actions"},Ale=Ye({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),{confirm:i}=Wr(),r=Q(!1);Qe(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=D(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return o("status.goalStatusActive");case"paused":return o("status.goalStatusPaused");case"blocked":return o("status.goalStatusBlocked");case"complete":return o("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:o("status.goalCancel"),message:o("status.goalCancelConfirm"),confirmLabel:o("status.goalCancelConfirmYes"),cancelLabel:o("status.goalCancelConfirmNo"),variant:"danger"})&&s("controlGoal","cancel")}return(d,f)=>(b(),ke(Bk,{class:Pe(["goal-strip",{expanded:r.value}])},{head:Me(()=>[w("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[ie(je,{class:"goal-icon",name:"target",size:"md"}),w("span",yle,O(C(o)("status.goalLabel")),1),w("span",{class:Pe(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),ie(Fo,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Me(()=>[Xe(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(b(),T("span",kle,[w("span",{class:"goal-progress-fill",style:Gt({width:`${l.value}%`})},null,4)])):re("",!0),ie(je,{class:Pe(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Me(()=>[w("div",ble,O(e.goal.objective),1),e.goal.completionCriterion?(b(),T("div",xle,[f[3]||(f[3]=w("span",null,"Done when",-1)),w("p",null,O(e.goal.completionCriterion),1)])):re("",!0)]),foot:Me(()=>[w("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[w("div",wle,[w("span",null,O(e.goal.turnsUsed)+" turns",1),w("span",null,O(e.goal.tokensUsed.toLocaleString())+" tokens",1),w("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(b(),T("span",Sle,O(l.value)+"% token budget",1)):re("",!0)]),w("div",Cle,[e.goal.status==="active"?(b(),ke(Bt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=bt(h=>s("controlGoal","pause"),["stop"]))},{default:Me(()=>[ie(je,{name:"pause",size:"md"}),w("span",null,O(C(o)("status.goalPause")),1)]),_:1})):re("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(b(),ke(Bt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=bt(h=>s("controlGoal","resume"),["stop"]))},{default:Me(()=>[ie(je,{name:"play",size:"md"}),w("span",null,O(C(o)("status.goalResume")),1)]),_:1})):re("",!0),ie(Bt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:bt(u,["stop"])},{default:Me(()=>[ie(je,{name:"close",size:"md"}),w("span",null,O(C(o)("status.goalCancel")),1)]),_:1})])],8,_le)]),_:1},8,["class"]))}}),Mle=dt(Ale,[["__scopeId","data-v-353c73e2"]]),Ele={class:"qh"},Tle={class:"qtitle"},Nle={key:0,class:"qstep"},Ile={key:1,class:"qmin-peek"},$le={class:"qbody"},Lle=["aria-label"],Fle=["aria-selected","aria-label","onClick"],Ole={class:"qstep-num"},Rle={key:1,class:"qheader-chip"},Ble={class:"qtext"},Dle={class:"qopts"},Ple=["onClick"],Hle={class:"qopt-key"},Wle={class:"qopt-glyph"},zle={key:0,class:"chk"},Ule={key:1,class:"rad"},qle={class:"qopt-text"},jle={class:"qopt-label"},Vle={key:0,class:"qopt-desc"},Kle={class:"qopt-glyph"},Gle={key:0,class:"chk"},Yle={key:1,class:"rad"},Zle={class:"qopt-label"},Qle=["placeholder"],Xle={class:"qfoot"},Jle=Ye({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Tt(),o=t,i=Q(0),r=Q(!1),l=D(()=>n.question.questions[i.value]),a=D(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(P){P>=0&&P<a.value&&(i.value=P)}function f(P){const z=p.value[P];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=Q({});function m(P){return P.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${P.label} ${P.description??""}`.toLowerCase())}function x(){const P={...p.value};let z=!1;for(const W of n.question.questions){if(P[W.id])continue;const ee=W.options.filter(m);ee.length!==0&&(P[W.id]=W.multiSelect?{kind:"multi",optionIds:ee.map(U=>U.id)}:{kind:"single",optionId:ee[0].id},z=!0)}z&&(p.value=P)}Qe(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),Qe(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),x()},{immediate:!0,deep:!0});function k(P,z){const W=p.value[P];if(W&&W.kind==="single"&&W.optionId===z){const ee={...p.value};delete ee[P],p.value=ee}else p.value={...p.value,[P]:{kind:"single",optionId:z}}}function g(P,z){const W=p.value[P],ee=W&&(W.kind==="multi"||W.kind==="multiWithOther")?W.kind==="multi"?[...W.optionIds]:[...W.optionIds]:[],U=ee.indexOf(z);U>=0?ee.splice(U,1):ee.push(z);const Z=p.value[P],ce=Z&&Z.kind==="multiWithOther"?Z.otherText:"";ce?p.value={...p.value,[P]:{kind:"multiWithOther",optionIds:ee,otherText:ce}}:p.value={...p.value,[P]:{kind:"multi",optionIds:ee}}}const v=Q({}),y=Q(null);function M(P){const z=n.question.questions.find(ee=>ee.id===P),W=v.value[P]??"";if(z.multiSelect){const ee=p.value[P],U=ee&&(ee.kind==="multi"||ee.kind==="multiWithOther")?ee.kind==="multi"?[...ee.optionIds]:[...ee.optionIds]:[];p.value={...p.value,[P]:{kind:"multiWithOther",optionIds:U,otherText:W}}}else p.value={...p.value,[P]:{kind:"other",text:W}}}function L(P){M(P),gt(()=>y.value?.focus())}function $(P,z){const W=p.value[P];return W?W.kind==="single"?W.optionId===z:W.kind==="multi"||W.kind==="multiWithOther"?W.optionIds.includes(z):!1:!1}function _(P){const z=p.value[P];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function E(){return n.question.questions.every(P=>f(P.id))}const N=D(()=>n.busyKind==="answer"),F=D(()=>n.busyKind==="dismiss"),S=D(()=>!!n.busyKind);function I(){if(S.value||!E())return;const P={answers:p.value,method:"click"};o("answer",n.question.questionId,P)}function R(){S.value||o("dismiss",n.question.questionId)}function B(P){const z=(document.activeElement?.tagName??"").toLowerCase(),W=z==="input"||z==="textarea";if(S.value)return;if(P.key==="Enter"){if(P.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():E()&&I();return}if(W)return;if(P.key==="Escape"){P.preventDefault(),R();return}if(r.value)return;const ee=parseInt(P.key,10);if(!isNaN(ee)&&ee>=1&&ee<=9){P.preventDefault();const U=l.value,Z=ee-1,ce=U.options[Z];ce&&(U.multiSelect?g(U.id,ce.id):k(U.id,ce.id))}}return yn(()=>document.addEventListener("keydown",B)),Sn(()=>document.removeEventListener("keydown",B)),(P,z)=>(b(),ke(Bk,{class:Pe(["qcard",{minimized:r.value}])},q4({head:Me(()=>[w("div",Ele,[z[5]||(z[5]=w("span",{class:"qh-ic"},"?",-1)),w("span",Tle,O(C(s)("question.title")),1),a.value>1&&!r.value?(b(),T("span",Nle,O(C(s)("question.step",{current:i.value+1,total:a.value})),1)):re("",!0),r.value?(b(),T("span",Ile,O(l.value.question),1)):re("",!0),ie(Dn,{class:"qmin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:z[0]||(z[0]=W=>r.value=!r.value)},{default:Me(()=>[r.value?(b(),ke(je,{key:0,name:"chevron-down",size:"md"})):(b(),ke(je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Me(()=>[w("div",$le,[a.value>1?(b(),T("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(s)("question.step",{current:i.value+1,total:a.value})},[(b(!0),T(Be,null,st(n.question.questions,(W,ee)=>(b(),T("button",{key:W.id,type:"button",class:Pe(["qstep-dot",{active:ee===i.value,answered:f(W.id)}]),"aria-selected":ee===i.value,"aria-label":C(s)("question.step",{current:ee+1,total:a.value}),onClick:U=>d(ee)},[w("span",Ole,O(ee+1),1)],10,Fle))),128))],8,Lle)):re("",!0),l.value.header?(b(),T("div",Rle,[ie(Fo,{variant:"neutral",size:"sm"},{default:Me(()=>[Xe(O(l.value.header),1)]),_:1})])):re("",!0),w("div",Ble,O(l.value.question),1),l.value.body?(b(),ke(Lm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):re("",!0),w("div",Dle,[(b(!0),T(Be,null,st(l.value.options,(W,ee)=>(b(),T("label",{key:W.id,class:Pe(["qopt",{selected:$(l.value.id,W.id)}]),onClick:bt(U=>l.value.multiSelect?g(l.value.id,W.id):k(l.value.id,W.id),["prevent"])},[w("span",Hle,O(ee+1),1),w("span",Wle,[l.value.multiSelect?(b(),T("span",zle,O($(l.value.id,W.id)?"■":"□"),1)):(b(),T("span",Ule,O($(l.value.id,W.id)?"●":"○"),1))]),w("span",qle,[w("span",jle,O(W.label),1),W.description?(b(),T("span",Vle,O(W.description),1)):re("",!0)])],10,Ple))),128)),l.value.allowOther?(b(),T("label",{key:0,class:Pe(["qopt",{selected:_(l.value.id)}]),onClick:z[4]||(z[4]=bt(W=>L(l.value.id),["prevent"]))},[z[6]||(z[6]=w("span",{class:"qopt-key"},null,-1)),w("span",Kle,[l.value.multiSelect?(b(),T("span",Gle,O(_(l.value.id)?"■":"□"),1)):(b(),T("span",Yle,O(_(l.value.id)?"●":"○"),1))]),w("span",Zle,O(l.value.otherLabel??C(s)("question.otherDefault")),1),Ln(w("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":z[1]||(z[1]=W=>v.value[l.value.id]=W),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:z[2]||(z[2]=W=>M(l.value.id)),onFocus:z[3]||(z[3]=W=>M(l.value.id))},null,40,Qle),[[wo,v.value[l.value.id]]])],2)):re("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Me(()=>[w("div",Xle,[i.value<a.value-1?(b(),ke(Bt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Me(()=>[Xe(O(C(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(b(),ke(Bt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!E(),loading:N.value,onClick:I},{default:Me(()=>[Xe(O(C(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(b(),ke(Bt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Me(()=>[Xe(O(C(s)("question.back")),1)]),_:1},8,["disabled"])):re("",!0),ie(Bt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:R},{default:Me(()=>[Xe(O(C(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),eae=dt(Jle,[["__scopeId","data-v-9525707a"]]),tae={class:"ah"},nae={class:"akind"},sae={class:"apath"},oae={class:"ah-path"},iae={key:1,class:"diff"},rae={class:"dg"},lae={class:"dc"},aae={key:2,class:"body-shell"},cae={class:"shell-cmd"},uae={key:0,class:"shell-cwd"},dae={key:1,class:"shell-danger"},fae={key:3,class:"body-file"},hae={class:"file-bar"},pae={class:"file-lang"},mae={class:"file-content"},gae={class:"file-ln"},vae={class:"file-text"},yae={key:4,class:"body-chip"},kae={class:"chip-label"},bae={class:"chip-value"},xae={key:0,class:"chip-detail"},_ae={key:5,class:"body-chip"},wae={key:0,class:"chip-label"},Sae={class:"chip-value"},Cae={key:6,class:"body-chip"},Aae={class:"chip-label"},Mae={class:"chip-value"},Eae={key:0,class:"chip-detail"},Tae={key:7,class:"body-chip"},Nae={class:"chip-label"},Iae={class:"chip-value"},$ae={key:0,class:"chip-detail"},Lae={key:8,class:"body-todo"},Fae={class:"todo-glyph"},Oae={key:9,class:"body-plan"},Rae={key:10,class:"body-generic"},Bae={class:"gen-text"},Dae={key:11,class:"feedback-wrap"},Pae=["placeholder"],Hae={class:"feedback-hint"},Wae={key:0,class:"plan-actions"},zae={key:1,class:"abtn"},Uae=Ye({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=D(()=>{const N=n.block;return N.kind!=="plan_review"?null:{plan:N.plan,path:N.path,options:N.options??[]}}),r=Q(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const N=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${N}`)}const c=Q(!1),u=Q(""),d=Q(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const N=u.value.trim();i.value?k("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:N||void 0}):k("feedback",{decision:"rejected",feedback:N||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(N){N.key==="Enter"&&!N.shiftKey?(N.preventDefault(),h()):N.key==="Escape"&&(N.preventDefault(),p())}const x=Q(null);Qe(()=>n.busy,N=>{N||(x.value=null)});function k(N,F){n.busy||(x.value=N,s("decide",F))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function y(){k("reject",{decision:"rejected"})}function M(){k("approvePlan",{decision:"approved"})}function L(N){k(`option:${N}`,{decision:"approved",selectedLabel:N})}function $(){n.busy||f()}function _(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(N){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){N.key==="1"?(N.preventDefault(),M()):N.key==="2"?(N.preventDefault(),$()):N.key==="3"&&(N.preventDefault(),_());return}N.key==="1"&&S.options[0]?(N.preventDefault(),L(S.options[0].label)):N.key==="2"&&S.options[1]?(N.preventDefault(),L(S.options[1].label)):N.key==="3"&&S.options[2]&&(N.preventDefault(),L(S.options[2].label));return}N.key==="1"?(N.preventDefault(),g()):N.key==="2"?(N.preventDefault(),v()):N.key==="3"?(N.preventDefault(),y()):N.key==="4"&&(N.preventDefault(),f())}return yn(()=>document.addEventListener("keydown",E)),Sn(()=>document.removeEventListener("keydown",E)),(N,F)=>(b(),ke(Bk,{class:Pe(["appr",{minimized:r.value}])},q4({head:Me(()=>[w("div",tae,[F[2]||(F[2]=w("span",{class:"ah-ic"},"!",-1)),w("span",nae,O(a()),1),w("span",sae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(b(),T(Be,{key:0},[Xe(O(e.block.path),1)],64)):e.block.kind==="shell"?(b(),T(Be,{key:1},[Xe(O(e.block.command),1)],64)):e.block.kind==="url"?(b(),T(Be,{key:2},[Xe(O(e.block.url),1)],64)):e.block.kind==="search"?(b(),T(Be,{key:3},[Xe(O(e.block.query),1)],64)):e.block.kind==="invocation"?(b(),T(Be,{key:4},[Xe(O(e.block.name),1)],64)):e.block.kind==="generic"?(b(),T(Be,{key:5},[Xe(O(e.block.summary),1)],64)):re("",!0)]),e.agentName&&!r.value?(b(),ke(Fo,{key:0,variant:"neutral",size:"sm"},{default:Me(()=>[Xe(O(C(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):re("",!0),r.value?re("",!0):(b(),ke(Fo,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Me(()=>[Xe(O(C(o)("approval.required")),1)]),_:1})),ie(Dn,{class:"amin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Me(()=>[r.value?(b(),ke(je,{key:0,name:"chevron-down",size:"md"})):(b(),ke(je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Me(()=>[e.block.kind==="plan_review"&&e.block.path?(b(),ke(Yt,{key:0,text:e.block.path},{default:Me(()=>[w("div",oae,O(e.block.path),1)]),_:1},8,["text"])):re("",!0),e.block.kind==="diff"?(b(),T("div",iae,[(b(!0),T(Be,null,st(e.block.diff,(S,I)=>(b(),T("div",{key:I,class:Pe(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[w("span",rae,O(S.gutter),1),w("span",lae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(b(),T("div",aae,[w("div",cae,[F[3]||(F[3]=w("span",{class:"shell-dollar"},"$",-1)),Xe(" "+O(e.block.command),1)]),e.block.cwd?(b(),T("div",uae,"cwd: "+O(e.block.cwd),1)):re("",!0),e.block.danger?(b(),T("div",dae,O(C(o)("approval.danger",{detail:e.block.danger})),1)):re("",!0)])):e.block.kind==="file"?(b(),T("div",fae,[w("div",hae,[w("span",pae,O(e.block.language??""),1)]),w("div",mae,[(b(!0),T(Be,null,st(e.block.content.split(`
297
+ `),(S,I)=>(b(),T("div",{key:I,class:"file-line"},[w("span",gae,O(I+1),1),w("span",vae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(b(),T("div",yae,[w("span",kae,O(e.block.op),1),w("span",bae,O(e.block.path),1),e.block.detail?(b(),T("span",xae,O(e.block.detail),1)):re("",!0)])):e.block.kind==="url"?(b(),T("div",_ae,[e.block.method?(b(),T("span",wae,O(e.block.method),1)):re("",!0),w("span",Sae,O(e.block.url),1)])):e.block.kind==="search"?(b(),T("div",Cae,[w("span",Aae,O(C(o)("approval.searchQueryLabel")),1),w("span",Mae,O(e.block.query),1),e.block.scope?(b(),T("span",Eae,O(C(o)("approval.searchScope",{scope:e.block.scope})),1)):re("",!0)])):e.block.kind==="invocation"?(b(),T("div",Tae,[w("span",Nae,O(e.block.kind2),1),w("span",Iae,O(e.block.name),1),e.block.description?(b(),T("span",$ae,O(e.block.description),1)):re("",!0)])):e.block.kind==="todo"?(b(),T("div",Lae,[(b(!0),T(Be,null,st(e.block.items,(S,I)=>(b(),T("div",{key:I,class:"todo-item"},[w("span",Fae,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),w("span",{class:Pe(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(b(),T("div",Oae,[ie(Lm,{text:e.block.plan},null,8,["text"])])):(b(),T("div",Rae,[w("span",Bae,O(e.block.summary),1)])),c.value?(b(),T("div",Dae,[Ln(w("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,Pae),[[wo,u.value]]),w("div",Hae,O(C(o)("approval.feedbackHint")),1)])):re("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Me(()=>[i.value?(b(),T("div",Wae,[i.value.options.length>0?(b(!0),T(Be,{key:0},st(i.value.options,(S,I)=>(b(),ke(Yt,{key:I,text:S.description},{default:Me(()=>[ie(Bt,{class:"kbtn",size:"sm",variant:"primary",loading:x.value===`option:${S.label}`,disabled:e.busy,onClick:R=>L(S.label)},{default:Me(()=>[Xe(O(S.label),1),ie(pr,{class:"k",keys:[String(I+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(b(),ke(Bt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:x.value==="approvePlan",disabled:e.busy,onClick:M},{default:Me(()=>[Xe(O(C(o)("approval.approvePlan")),1),ie(pr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),ie(Bt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:$},{default:Me(()=>[Xe(O(C(o)("approval.revise")),1),i.value.options.length===0?(b(),ke(pr,{key:0,class:"k",keys:["2"]})):re("",!0)]),_:1},8,["disabled"]),ie(Bt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:x.value==="rejectAndExit",disabled:e.busy,onClick:_},{default:Me(()=>[Xe(O(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(b(),ke(pr,{key:0,class:"k",keys:["3"]})):re("",!0)]),_:1},8,["loading","disabled"])])):(b(),T("div",zae,[ie(Bt,{class:"kbtn",size:"sm",variant:"primary",loading:x.value==="approve",disabled:e.busy,onClick:g},{default:Me(()=>[Xe(O(C(o)("approval.approve")),1),ie(pr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),ie(Bt,{class:"kbtn",size:"sm",variant:"secondary",loading:x.value==="approveSession",disabled:e.busy,onClick:v},{default:Me(()=>[Xe(O(C(o)("approval.approveSession")),1),ie(pr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),ie(Bt,{class:"kbtn",size:"sm",variant:"secondary",loading:x.value==="reject",disabled:e.busy,onClick:y},{default:Me(()=>[Xe(O(C(o)("approval.reject")),1),ie(pr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),ie(Bt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Me(()=>[Xe(O(C(o)("approval.feedback")),1),ie(pr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),qae=dt(Uae,[["__scopeId","data-v-12609161"]]),jae=Ye({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(b(),T("span",{class:Pe(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),A5=dt(jae,[["__scopeId","data-v-f595d935"]]),Vae={class:"taskspane"},Kae={class:"tp-head"},Gae={class:"tp-title"},Yae={class:"tp-count"},Zae={class:"tp-list"},Qae={key:0,class:"tp-empty"},Xae=["role","onClick"],Jae={class:"tp-name"},ece={class:"tp-time"},tce=["onClick"],nce={key:0,class:"tp-detail"},sce={key:0,class:"tp-codebox"},oce=["onClick"],ice={class:"tp-pre"},rce={class:"tp-cmd"},lce={key:1,class:"tp-codebox"},ace=["onClick"],cce={class:"tp-pre"},uce=Ye({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Tt(),o=Ps(new Set),i=Ps(new Set),r=Ps(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,x){await io(p)&&(x.add(m),setTimeout(()=>x.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(`
298
+ `)??"";m&&await d(m,p.id,r)}return(p,m)=>(b(),T("div",Vae,[w("div",Kae,[w("span",Gae,O(C(s)("tasks.tag")),1),w("span",Yae,O(e.tasks.length),1)]),w("div",Zae,[e.tasks.length===0?(b(),T("div",Qae,O(C(s)("tasks.emptyTasks")),1)):(b(!0),T(Be,{key:1},st(e.tasks,x=>(b(),T("div",{key:x.id,class:Pe(["tp-row",{done:x.state==="done",fail:x.state==="fail",expandable:c(x)}])},[w("div",{class:"tp-main",role:c(x)?"button":void 0,onClick:k=>a(x)},[ie(A5,{status:u(x.state)},null,8,["status"]),w("span",Jae,O(x.name),1),ie(Fo,{variant:"neutral",size:"sm"},{default:Me(()=>[Xe(O(x.kind),1)]),_:2},1024),w("span",ece,O(x.timing),1),x.state==="run"?(b(),T("button",{key:0,class:"tp-stop",onClick:bt(k=>n("cancel",x.id),["stop"])},O(C(s)("tasks.stop")),9,tce)):re("",!0),x.kind==="subagent"?(b(),ke(je,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(x)?(b(),ke(je,{key:2,class:Pe(["tp-chevron",{open:o.has(x.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):re("",!0)],8,Xae),o.has(x.id)&&l(x)?(b(),T("div",nce,[x.meta?(b(),T("div",sce,[w("button",{class:Pe(["tp-copy",{copied:i.has(x.id)}]),onClick:bt(k=>f(x),["stop"])},O(i.has(x.id)?"已复制":"复制"),11,oce),w("pre",ice,[w("code",null,[w("span",rce,O(x.meta),1)])])])):re("",!0),x.output&&x.output.length>0?(b(),T("div",lce,[w("button",{class:Pe(["tp-copy",{copied:r.has(x.id)}]),onClick:bt(k=>h(x),["stop"])},O(r.has(x.id)?"已复制":"复制"),11,ace),w("pre",cce,[w("code",null,[m[0]||(m[0]=Xe(`
299
+ `,-1)),(b(!0),T(Be,null,st(x.output,(k,g)=>(b(),T("span",{key:g,class:"tp-line"},O(k),1))),128)),m[1]||(m[1]=Xe(`
300
+ `,-1))])])])):re("",!0)])):re("",!0)],2))),128))])]))}}),RC=dt(uce,[["__scopeId","data-v-28fd5fc0"]]),dce={class:"todo-card"},fce={key:0,class:"tc-empty"},hce={class:"tc-name"},pce=Ye({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Tt();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(b(),T("div",dce,[t.todos.length===0?(b(),T("div",fce,[i[0]||(i[0]=w("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"},[w("path",{d:"M9 11l2 2 4-4"}),w("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),w("span",null,O(C(n)("tasks.emptyTodo")),1)])):re("",!0),(b(!0),T(Be,null,st(t.todos,(r,l)=>(b(),T("div",{key:l,class:Pe(["tc-row",`s-${r.status}`])},[ie(A5,{status:s(r.status)},null,8,["status"]),w("span",hce,O(r.title),1)],2))),128))]))}}),mce=dt(pce,[["__scopeId","data-v-01c65735"]]),gce={class:"dock-work-head"},vce={key:0,class:"dock-work-tab static"},yce={key:1,class:"dock-work-tab static"},kce={key:2,class:"dock-work-tab static"},bce={class:"dock-work-body"},xce={class:"dw-count"},_ce={class:"dw-count"},wce={class:"dw-count"},Sce=Ye({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=Tt(),r=Q(null),l=Q(null),a=Q(null);function c(h){return r.value?(r.value.loadForEdit(h),!0):!1}function u(h){r.value?.loadAttachmentsForEdit(h)}function d(){r.value?.focus()}function f(h){if(!s.dockPanel)return;const p=h.target;p&&(l.value?.contains(p)||a.value?.contains(p)||o("close-dock-panel"))}return Qe(()=>s.dockPanel,h=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),h&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),Sn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,loadAttachmentsForEdit:u,focus:d}),(h,p)=>(b(),T("div",{class:Pe(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:p[28]||(p[28]=bt(()=>{},["stop"]))},[ie(El,{name:"dock-panel"},{default:Me(()=>[e.dockPanel?(b(),T("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:p[3]||(p[3]=bt(()=>{},["stop"]))},[w("div",gce,[e.dockPanel==="bash"?(b(),T("span",vce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(b(),T("span",yce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(b(),T("span",kce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):re("",!0)]),w("div",bce,[e.dockPanel==="bash"?(b(),ke(RC,{key:0,tasks:e.bashTasks,onCancel:p[0]||(p[0]=m=>o("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(b(),ke(RC,{key:1,tasks:e.subagentTasks,onCancel:p[1]||(p[1]=m=>o("cancelTask",m)),onOpen:p[2]||(p[2]=m=>o("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(b(),ke(mce,{key:2,todos:e.todos??[]},null,8,["todos"])):re("",!0)])],512)):re("",!0)]),_:1}),e.goal?(b(),ke(Mle,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:p[4]||(p[4]=m=>o("controlGoal",m))},null,8,["goal","force-expanded"])):re("",!0),e.hasDockWork?(b(),T("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(b(),ke(uh,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:p[5]||(p[5]=m=>o("toggle-dock-panel","bash"))},{default:Me(()=>[ie(je,{name:"clock",size:"md"}),w("span",null,O(C(i)("tasks.dockBash")),1),w("span",xce,[p[29]||(p[29]=Xe("(",-1)),w("b",null,O(e.bashTasks.length),1),p[30]||(p[30]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),e.subagentTasks.length>0?(b(),ke(uh,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:p[6]||(p[6]=m=>o("toggle-dock-panel","subagent"))},{default:Me(()=>[ie(je,{name:"sparkles",size:"md"}),w("span",null,O(C(i)("tasks.dockSubagent")),1),w("span",_ce,[p[31]||(p[31]=Xe("(",-1)),w("b",null,O(e.subagentTasks.length),1),p[32]||(p[32]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),(e.todos?.length??0)>0?(b(),ke(uh,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:p[7]||(p[7]=m=>o("toggle-dock-panel","todos"))},{default:Me(()=>[ie(je,{name:"check-list",size:"md"}),w("span",null,O(C(i)("tasks.dockTodos")),1),w("span",wce,[p[33]||(p[33]=Xe("(",-1)),w("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),p[34]||(p[34]=Xe(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0)],512)):re("",!0),e.pendingQuestion?(b(),ke(eae,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:p[8]||(p[8]=(m,x)=>o("answer",m,x)),onDismiss:p[9]||(p[9]=m=>o("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(b(),ke(qae,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:p[10]||(p[10]=m=>o("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(b(),ke(C5,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:p[11]||(p[11]=m=>o("submit",m)),onSteer:p[12]||(p[12]=m=>o("steer",m)),onCommand:p[13]||(p[13]=m=>o("command",m)),onInterrupt:p[14]||(p[14]=m=>o("interrupt")),onSetPermission:p[15]||(p[15]=m=>o("setPermission",m)),onSetThinking:p[16]||(p[16]=m=>o("setThinking",m)),onTogglePlan:p[17]||(p[17]=m=>o("togglePlan")),onToggleSwarm:p[18]||(p[18]=m=>o("toggleSwarm")),onToggleGoal:p[19]||(p[19]=m=>o("toggleGoal")),onOpenBtw:p[20]||(p[20]=m=>o("openBtw")),onCreateGoal:p[21]||(p[21]=m=>o("createGoal",m)),onControlGoal:p[22]||(p[22]=m=>o("controlGoal",m)),onFocusGoal:p[23]||(p[23]=m=>o("focusGoal")),onFocusSwarm:p[24]||(p[24]=m=>o("focusSwarm")),onCompact:p[25]||(p[25]=m=>o("compact")),onPickModel:p[26]||(p[26]=m=>o("pickModel")),onSelectModel:p[27]||(p[27]=m=>o("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Cce=dt(Sce,[["__scopeId","data-v-67df0d16"]]),Ace=["aria-label","aria-hidden"],Mce={class:"toc-scroll"},Ece=["onClick"],Tce={class:"toc-label"},Nce=240,Ice=Ye({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=Q(null),r=Q(!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>=Nce}const c=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Qe(c,u=>{l?.disconnect(),l=null,u&&gt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ms(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(b(),T("nav",{key:0,ref_key:"navRef",ref:i,class:Pe(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(o)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[w("div",Mce,[(b(!0),T(Be,null,st(e.items,f=>(b(),T("button",{key:f.id,type:"button",class:Pe(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>s("select",f.id)},[d[0]||(d[0]=w("span",{class:"toc-bar"},null,-1)),w("span",Tce,O(f.title),1)],10,Ece))),128))])],10,Ace)):re("",!0)}}),$ce=dt(Ice,[["__scopeId","data-v-3f1c1f66"]]),Lce=5;function Fce(e,t,n,s=Lce){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 Oce={class:"chat-layout"},Rce={class:"empty-hint"},Bce={key:0,class:"empty-hint-text"},Dce={key:1,class:"ws-pick"},Pce={class:"ws-pick-name"},Hce={key:1,class:"ws-pick-menu"},Wce=["onClick"],zce={class:"ws-pick-item-name"},Uce={class:"ws-pick-item-path"},qce=["aria-label"],jce={key:0,class:"abort-toast",role:"status","aria-live":"polite"},Vce={class:"abort-toast-text"},hg=80,BC=1e3,Kce=420,Gce=3e3,Yce=Ye({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:s}=Tt(),o=e,i=n,r=Q(!1),l=Q(!1),a=D(()=>o.workspaces?.find(xe=>xe.id===o.activeWorkspaceId)?.name??o.workspaceName??""),c=D(()=>(o.workspaces?.length??0)>0),u=D(()=>Fce(o.workspaces??[],o.activeWorkspaceId,l.value)),d=D(()=>(o.workspaces?.length??0)-u.value.length);Qe(r,ve=>{ve||(l.value=!1)});function f(ve){r.value=!1,ve!==o.activeWorkspaceId&&i("selectWorkspace",ve)}Vc(Lt.contentAlign);const h=Q(null),p=Q(null),m=Q(null),x=Q(!1),k=Q(0);let g=null;function v(ve,xe){const De=m.value??p.value;return!De||De.loadForEdit(ve)===!1?!1:(De.loadAttachmentsForEdit(xe??[]),!0)}function y(){x.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,x.value=!1},2e3)}function M(){k.value++}const L=D(()=>o.tasks.filter(ve=>ve.kind!=="subagent")),$=D(()=>o.tasks.filter(ve=>ve.kind==="subagent"&&ve.runInBackground)),_=D(()=>L.value.filter(ve=>ve.state==="run").length),E=D(()=>$.value.filter(ve=>ve.state==="run").length);function N(ve){const xe=o.tasks,De=xe.find(Dt=>Dt.id===ve)??xe.find(Dt=>Dt.parentToolCallId===ve);if(De)return De.id;const Rt=xe.filter(Dt=>Dt.kind==="subagent"&&!Dt.parentToolCallId);if(Rt.length===1)return Rt[0].id}In("resolveAgentTaskId",N),In("pinScroll",as);const F=D(()=>(o.todos??[]).filter(ve=>ve.status==="done").length),S=D(()=>L.value.length>0||$.value.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),I=Q(null),R=D(()=>o.gitInfo?o.changes?.length??0:0);function B(ve){I.value=I.value===ve?null:ve}function P(){I.value=null}Qe(S,ve=>{ve||P()});function z(ve){if(ve.role==="compaction")return s("conversation.compactedPlain");if(ve.role==="user"){if(ve.skillActivation)return`/${ve.skillActivation.name}`;if(ve.pluginCommand)return`/${ve.pluginCommand.pluginId}:${ve.pluginCommand.commandName}`;const De=ve.text.trim().replaceAll(/\s+/g," ");return De.length>0?De:"user"}const xe=(ve.text||ve.thinking||"").trim().replaceAll(/\s+/g," ");return xe.length>0?xe:(ve.tools?.length??0)>0?`${ve.tools.length} tools`:"kimi"}const W=D(()=>o.turns.filter(ve=>ve.role==="user").map((ve,xe)=>({id:ve.id,role:ve.role,no:xe+1,title:z(ve)}))),ee=Q(null);function U(){const ve=de.value;if(!ve)return;const xe=ve.querySelectorAll(".turn-anchor[data-turn-id]");if(xe.length===0)return;const De=W.value;if(De.length===0)return;const Rt=new Set(De.map(Hs=>Hs.id));if(pe()<=hg){ee.value=De[De.length-1].id;return}const Dt=ve.getBoundingClientRect(),Cn=Dt.height/2;let qn=null;xe.forEach(Hs=>{const J=Hs.dataset.turnId;if(!J||!Rt.has(J))return;Hs.getBoundingClientRect().top-Dt.top<=Cn&&(qn=J)}),ee.value=qn??De[0].id}const Z=Q(!1);let ce=0;function fe(){ce||(ce=rt(()=>{ce=0,oe()}))}function oe(){const ve=de.value,xe=!o.mobile&&o.conversationToc&&ve?ve.closest(".con")?.querySelector(".conversation-toc"):null,De=xe?.querySelector(".toc-bar");let Rt=!1;if(ve&&xe&&De){const Dt=De.getBoundingClientRect(),Cn=xe.getBoundingClientRect(),qn=Dt.left+Dt.width/2;Rt=Array.from(ve.querySelectorAll(".table-node-wrapper")).some(Hs=>{const J=Hs.getBoundingClientRect();return J.left<=qn&&qn<=J.right&&J.top<Cn.bottom&&J.bottom>Cn.top})}Z.value!==Rt&&(Z.value=Rt)}const Y=D(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),X=D(()=>{const ve=Y.value;if(ve)return o.pendingQuestionActions?.[ve.questionId]}),le=D(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),He=D(()=>{const ve=le.value;return ve?!!o.pendingApprovalActions?.[ve.approvalId]:!1}),de=Q(null),G=Q(null),ae=Q(0),me=Q(0),q=D(()=>({"--panes-scrollbar-width":`${ae.value}px`}));function ne(ve){return ve instanceof HTMLElement?ve:ve&&"$el"in ve&&ve.$el instanceof HTMLElement?ve.$el:null}function ge(){const ve=de.value;ae.value=ve?Math.max(0,ve.offsetWidth-ve.clientWidth):0,me.value=G.value?.offsetHeight??0}function ue(ve){const xe=ne(ve);de.value=xe,xe&&Ao()}function ye(ve){const xe=ne(ve);G.value=xe??null,ve&&"loadForEdit"in ve&&typeof ve.loadForEdit=="function"&&"focus"in ve&&typeof ve.focus=="function"?m.value={loadForEdit:ve.loadForEdit.bind(ve),loadAttachmentsForEdit:"loadAttachmentsForEdit"in ve&&typeof ve.loadAttachmentsForEdit=="function"?ve.loadAttachmentsForEdit.bind(ve):()=>{},focus:ve.focus.bind(ve)}:m.value=null,ys()}const j=Q(!0),te=Q(!1);function pe(){const ve=de.value;return ve?ve.scrollHeight-ve.scrollTop-ve.clientHeight:0}let Se=0,Ie=0,Fe=0,he=0,Ne=0,Je=0;function it(){return Date.now()<Ie}function At(){fe();const ve=de.value;if(!ve)return;const xe=ve.scrollTop;if(nn()){Se=xe;return}if(performance.now()-Fe<100){Se=xe;return}const De=pe();if(it()){j.value=!0,te.value=!1,Se=xe;return}xe<Se-1&&De>1?(j.value=!1,te.value=!0):De<=hg&&xe>Se+1&&(j.value=!0,te.value=!1),Se=xe,U()}function xt(ve=!1){const xe=de.value;j.value=!0,te.value=!1,xe&&(!ve&&performance.now()<he||(ve&&typeof xe.scrollTo=="function"?(Fe=performance.now(),he=performance.now()+Kce,xe.scrollTo({top:xe.scrollHeight,behavior:"smooth"})):xe.scrollTop=xe.scrollHeight,Se=xe.scrollTop))}function wt(ve,xe){return(xe.closest("[inert]")?.closest(".tool-group")??xe).getBoundingClientRect().top-ve.getBoundingClientRect().top+ve.scrollTop}function Kt(ve,xe){const De=Array.from(ve.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(Cn=>({node:Cn,top:wt(ve,Cn)})),Rt=De.findIndex(Cn=>Cn.top>=xe),Dt=Rt<0?Math.max(0,De.length-1):Rt;return De.slice(Dt,Dt+2).flatMap(Cn=>{const qn=Cn.node.dataset.scrollAnchorId,Hs=qn??Cn.node.dataset.turnId;return Hs?[{kind:qn?"tool":"turn",id:Hs,top:Cn.top}]:[]})}const vt=new Map;function cn(ve,xe){for(const De of xe.anchors){const Rt=De.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Dt=ve.querySelector(`[${Rt}="${Zt(De.id)}"]`);if(Dt)return wt(ve,Dt)-De.top}return ve.scrollHeight-xe.oldHeight}function Kn(ve,xe,De=ve.scrollTop){return ve.scrollTop=De+cn(ve,xe),Se=ve.scrollTop,ve.scrollTop}async function Un(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||zn.value||!o.hasMoreMessages)return;const ve=o.sessionId,xe=de.value,De=xe?.scrollTop??0,Rt={anchors:xe?Kt(xe,De):[],oldHeight:xe?.scrollHeight??0};Gn(ve,!0),Ms();try{if(await gt(),await o.loadOlderMessages(ve),await gt(),o.sessionId!==ve){vt.set(ve,Rt);return}const Dt=de.value;if(!Dt)return;Kn(Dt,Rt),vt.delete(ve)}finally{Gn(ve,!1)}}function Zt(ve){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(ve):ve.replaceAll(/["\\]/g,"\\$&")}function bn(ve){const xe=de.value;if(!xe)return;const De=xe.querySelector(`.turn-anchor[data-turn-id="${Zt(ve)}"]`);De&&(_i(),j.value=!1,te.value=pe()>hg,De.scrollIntoView({behavior:"smooth",block:"center"}))}function Pn(){const ve=de.value;if(!ve)return"none";const xe=ve.firstElementChild,De=xe instanceof HTMLElement?xe.offsetHeight:0,Rt=G.value?.offsetHeight??0;return`${ve.scrollHeight}:${ve.clientHeight}:${De}:${Rt}`}function rt(ve){return typeof requestAnimationFrame=="function"?requestAnimationFrame(ve):setTimeout(ve,16)}function Hn(ve){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(ve):clearTimeout(ve)}let Os=0,xn=0,ls=null,As=0;function nn(){return performance.now()<Os}function as(ve,xe=260){const De=de.value;if(!De||(ls=ve,As=ve.getBoundingClientRect().top,Os=performance.now()+xe,xn))return;const Rt=()=>{if(xn=0,performance.now()>=Os||!ls){ls=null;return}const Dt=ls.getBoundingClientRect().top-As;Dt&&(De.scrollTop+=Dt),xn=rt(Rt)};xn=rt(Rt)}function hn(ve=36){if(!j.value&&!it())return;const xe=++Je;let De="",Rt=0,Dt=0;Ne&&(Hn(Ne),Ne=0);const Cn=()=>{if(Ne=0,xe!==Je||!j.value&&!it())return;xt(!1);const qn=Pn();Rt=qn===De?Rt+1:0,De=qn,Dt++,Rt<3&&Dt<ve&&(Ne=rt(Cn))};Ne=rt(Cn)}function cs(ve,xe){return ve!==void 0&&ve.length>0&&xe.length>=ve.length&&ve.firstId!==xe.firstId&&ve.lastId===xe.lastId&&ve.lastTextLen===xe.lastTextLen&&ve.lastThinkingLen===xe.lastThinkingLen&&ve.lastToolsLen===xe.lastToolsLen&&ve.approvalIds===xe.approvalIds}const us=D(()=>{const ve=(o.approvals??[]).map(Cn=>Cn.approvalId).join(","),xe=o.turns,De=xe.at(-1),Rt=De?.thinking?.length??0,Dt=De?.tools?.reduce((Cn,qn)=>Cn+qn.name.length+(qn.arg?.length??0)+(qn.output?.join("").length??0),0)??0;return{length:xe.length,firstId:xe[0]?.id??"",lastId:De?.id??"",lastTextLen:De?.text.length??0,lastThinkingLen:Rt,lastToolsLen:Dt,approvalIds:ve}});Qe(us,async(ve,xe)=>{if(zn.value&&cs(xe,ve)){U();return}await gt(),j.value||it()?xt(ve.length<xe.length):te.value=!0,U()}),Qe(G,()=>{ys()}),Qe(()=>o.mobile,async()=>{await gt(),ge()});const On=new Map;Qe(()=>o.fileReloadKey,async(ve,xe)=>{const De=de.value;xe&&De&&On.set(String(xe),{top:De.scrollTop,following:j.value}),_i(),await gt();const Rt=de.value,Dt=ve?On.get(String(ve)):void 0;if(Dt&&Rt){const Cn=vt.get(String(ve)),qn=Cn?Kn(Rt,Cn,Dt.top):Dt.top;Cn&&vt.delete(String(ve)),j.value=Dt.following,Rt.scrollTop=qn,Se=Rt.scrollTop,te.value=!Dt.following&&pe()>1,Dt.following&&hn()}else j.value=!0,Se=0,xt(!1),hn();U()}),Qe(()=>o.sessionLoading,async(ve,xe)=>{ve||!xe||(j.value=!0,await gt(),hn(),U())}),Qe(()=>o.running,async(ve,xe)=>{ve||!xe||!j.value&&!it()||(await gt(),hn(48),U())});function es(){j.value=!0,te.value=!1,Ie=Date.now()+BC,gt(()=>{xt(!0),hn(16)})}function ds(ve){es(),i("submit",ve)}function Ht(ve){j.value=!0,te.value=!1,Ie=Date.now()+BC,i("editMessage",ve)}function Ze(ve){const xe=o.queued?.[ve],De=xe?.text??"";v(De,xe?.attachments)&&i("editQueued",ve)}function Ue(ve){i("reorderQueue",ve)}function Ft(ve,xe){es(),i("answer",ve,xe)}function jt(ve,xe){!ve||!xe||i("approval",ve,xe)}let en=null,Qt=null,un=null,Wn=null,Nt=0,fs=0,ts=0;const Zs=Q(new Set),zn=D(()=>!!o.sessionId&&Zs.value.has(o.sessionId));function Gn(ve,xe){const De=new Set(Zs.value);xe?De.add(ve):De.delete(ve),Zs.value=De}function Di(){zn.value||ts||(ts=rt(()=>{ts=0,!zn.value&&(nn()||(j.value||it())&&xt(!1))}))}function Ms(){Je++,Ne&&(Hn(Ne),Ne=0),ts&&(Hn(ts),ts=0)}function _i(){const ve=de.value;if(Ie=0,Ms(),Os=0,ls=null,ve){const xe=ve.scrollTop;typeof ve.scrollTo=="function"?ve.scrollTo({top:xe,behavior:"auto"}):ve.scrollTop=xe}he=0,Fe=Number.NEGATIVE_INFINITY,ve&&(Se=ve.scrollTop)}function So(){const ve=de.value;!ve||ve.scrollHeight-ve.clientHeight<=1&&!o.hasMoreMessages||(j.value=!1,_i(),ve.scrollHeight-ve.clientHeight>1&&(te.value=!0))}function Pi(ve){const xe=de.value;if(!xe)return!1;for(const De of ve.composedPath()){if(De===xe)return!1;if(De instanceof HTMLElement&&De.scrollHeight>De.clientHeight+1&&De.scrollTop>1)return!0}return!1}function ni(ve){ve.defaultPrevented||ve.ctrlKey||ve.shiftKey||ve.deltaY>=0||Pi(ve)||So()}function vs(ve){const xe=de.value;if(!xe||ve.defaultPrevented||ve.button!==0||ve.pointerType==="touch")return;const De=xe.getBoundingClientRect(),Rt=xe.offsetWidth-xe.clientWidth,Dt=Rt>0?Rt:12;ve.target===xe&&ve.clientX>=De.right-Dt&&So()}let Co=null;function sr(ve){Co=ve.touches.length===1?ve.touches[0].clientY:null}function wi(ve){const xe=ve.touches.length===1?ve.touches[0].clientY:null;xe!==null&&Co!==null&&xe>Co+2&&!Pi(ve)&&So(),Co=xe}function Yn(){if(!Qt)return;const ve=de.value?.firstElementChild??null;ve!==un&&(un&&Qt.unobserve(un),un=ve,ve&&Qt.observe(ve))}function ys(){if(!Qt)return;const ve=G.value;ve!==Wn&&(Wn&&Qt.unobserve(Wn),Wn=ve,ve&&Qt.observe(ve))}function Ao(){const ve=de.value;ge(),en&&(en.disconnect(),ve&&en.observe(ve,{childList:!0,subtree:!0,characterData:!0})),Qt&&(Qt.disconnect(),un=null,Wn=null,ve&&Qt.observe(ve),Yn(),ys()),Nt=ve?.scrollHeight??0,fs=ve?.clientHeight??0,fe()}function ct(){Yn(),Di(),fe()}function be(){typeof document>"u"||document.visibilityState==="visible"&&j.value&&hn()}const $e=Q(!1);let sn=null;function Ke(){$e.value=!0,sn!==null&&clearTimeout(sn),sn=setTimeout(()=>{$e.value=!1},Gce)}function nt(){Ke(),i("interrupt")}function ot(ve){ve.key==="Escape"&&(o.running||o.sending)&&(ve.preventDefault(),nt())}yn(()=>{gt(()=>{typeof MutationObserver=="function"&&(en=new MutationObserver(ct)),typeof ResizeObserver=="function"&&(Qt=new ResizeObserver(()=>{fe(),ge();const ve=de.value;if(!ve)return;const{scrollHeight:xe,clientHeight:De}=ve,Rt=xe>Nt+1,Dt=De<fs-1;Nt=xe,fs=De,!nn()&&(Rt||Dt)&&Di()})),Ao(),hn(48),U(),typeof document<"u"&&(document.addEventListener("visibilitychange",be),document.addEventListener("keydown",ot))})}),Sn(()=>{en&&en.disconnect(),Qt&&Qt.disconnect(),ts&&Hn(ts),Ne&&Hn(Ne),xn&&Hn(xn),ce&&Hn(ce),sn!==null&&clearTimeout(sn),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",be),document.removeEventListener("keydown",ot))});function Ot(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:Ot}),(ve,xe)=>(b(),T("section",{class:Pe(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(b(),ke(Dse,{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":R.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:x.value,onOpenChanges:xe[0]||(xe[0]=De=>i("openChanges")),onCopyAll:xe[1]||(xe[1]=De=>h.value?.copyConversation()),onCopyFinalSummary:xe[2]||(xe[2]=De=>h.value?.copyFinalSummary()),onOpenPr:xe[3]||(xe[3]=De=>e.pr&&i("openPr",e.pr.url)),onRenameSession:xe[4]||(xe[4]=(De,Rt)=>i("renameSession",De,Rt)),onForkSession:xe[5]||(xe[5]=De=>i("forkSession",De)),onArchiveSession:xe[6]||(xe[6]=De=>i("archiveSession",De)),onExportSession:xe[7]||(xe[7]=De=>i("exportSession",De))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):re("",!0),e.conversationToc?(b(),ke($ce,{key:1,items:W.value,"active-turn-id":ee.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:Z.value,onSelect:bn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):re("",!0),w("div",Oce,[w("div",{ref:ue,class:Pe(["panes chat-scroll",{"is-following":j.value,"history-prepending":zn.value}]),onScrollPassive:At,onWheelPassive:ni,onPointerdownPassive:vs,onTouchstartPassive:sr,onTouchmovePassive:wi},[w("div",{class:Pe(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(b(),T(Be,{key:0},[xe[55]||(xe[55]=w("div",{class:"empty-spacer"},null,-1)),w("div",Rce,[w("span",{class:Pe(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(b(),ke(Ho,{key:0,size:"sm"})):re("",!0),w("span",null,O(e.starting?C(s)("conversation.starting"):C(s)("composer.emptyConversationTitle")),1)],2),e.starting?re("",!0):(b(),T("span",Bce,O(C(s)("composer.emptyConversation")),1)),c.value&&!e.starting?(b(),T("div",Dce,[ie(Yt,{text:C(s)("conversation.switchWorkspace")},{default:Me(()=>[w("button",{type:"button",class:"ws-pick-btn",onClick:xe[8]||(xe[8]=bt(De=>r.value=!r.value,["stop"]))},[ie(je,{name:"folder",size:"sm"}),w("span",Pce,O(a.value),1),ie(je,{class:Pe(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(b(),T("div",{key:0,class:"ws-pick-backdrop",onClick:xe[9]||(xe[9]=De=>r.value=!1)})):re("",!0),r.value?(b(),T("div",Hce,[(b(!0),T(Be,null,st(u.value,De=>(b(),T("button",{key:De.id,type:"button",class:Pe(["ws-pick-item",{on:De.id===e.activeWorkspaceId}]),onClick:bt(Rt=>f(De.id),["stop"])},[w("span",zce,O(De.name),1),w("span",Uce,O(De.shortPath),1)],10,Wce))),128)),d.value>0?(b(),T("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:xe[10]||(xe[10]=bt(De=>l.value=!l.value,["stop"]))},[w("span",null,O(C(s)("conversation.moreWorkspaces",{count:d.value})),1)])):re("",!0),xe[54]||(xe[54]=w("div",{class:"ws-pick-divider"},null,-1)),w("button",{type:"button",class:"ws-pick-action",onClick:xe[11]||(xe[11]=bt(De=>{r.value=!1,i("addWorkspace")},["stop"]))},[ie(je,{name:"plus",size:"sm"}),w("span",null,O(C(s)("conversation.addWorkspace")),1)])])):re("",!0)])):e.starting?re("",!0):(b(),T("button",{key:2,type:"button",class:"empty-add-workspace",onClick:xe[12]||(xe[12]=De=>i("addWorkspace"))},[ie(je,{name:"folder-plus",size:"sm"}),w("span",null,O(C(s)("conversation.addWorkspace")),1)]))]),ie(C5,{ref_key:"emptyComposerRef",ref:p,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:ds,onSteer:xe[13]||(xe[13]=De=>i("steer",De)),onCommand:xe[14]||(xe[14]=De=>i("command",De)),onInterrupt:nt,onUnqueue:xe[15]||(xe[15]=De=>i("unqueue",De)),onEditQueued:xe[16]||(xe[16]=De=>i("editQueued",De)),onSetPermission:xe[17]||(xe[17]=De=>i("setPermission",De)),onSetThinking:xe[18]||(xe[18]=De=>i("setThinking",De)),onTogglePlan:xe[19]||(xe[19]=De=>i("togglePlan")),onToggleSwarm:xe[20]||(xe[20]=De=>i("toggleSwarm")),onToggleGoal:xe[21]||(xe[21]=De=>i("toggleGoal")),onOpenBtw:xe[22]||(xe[22]=De=>i("command","/btw")),onCreateGoal:xe[23]||(xe[23]=De=>i("createGoal",De)),onControlGoal:xe[24]||(xe[24]=De=>i("controlGoal",De)),onFocusGoal:M,onCompact:xe[25]||(xe[25]=De=>i("compact")),onPickModel:xe[26]||(xe[26]=De=>i("pickModel")),onSelectModel:xe[27]||(xe[27]=De=>i("selectModel",De))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),xe[56]||(xe[56]=w("div",{class:"empty-spacer"},null,-1))],64)):(b(),ke(m5,{ref_key:"chatPaneRef",ref:h,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":j.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:xe[28]||(xe[28]=De=>i("openFile",De)),onOpenMedia:xe[29]||(xe[29]=De=>i("openMedia",De)),onCopyConversationCopied:y,onOpenThinking:xe[30]||(xe[30]=De=>i("openThinking",De)),onOpenCompaction:xe[31]||(xe[31]=De=>i("openCompaction",De)),onOpenAgent:xe[32]||(xe[32]=De=>i("openAgent",De)),onOpenToolDiff:xe[33]||(xe[33]=De=>i("openToolDiff",De)),onEditMessage:Ht,onLoadOlderMessages:Un,onUnqueue:xe[34]||(xe[34]=De=>i("unqueue",De)),onEditQueued:Ze,onReorderQueue:Ue},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?re("",!0):(b(),ke(Cce,{key:0,ref:ye,style:Gt(q.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":k.value,"dock-panel":I.value,"bash-tasks":L.value,"subagent-tasks":$.value,"bash-running":_.value,"subagent-running":E.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":Y.value,"question-busy-kind":X.value,"pending-approval":le.value,"approval-busy":He.value,mobile:e.mobile,onToggleDockPanel:xe[35]||(xe[35]=De=>B(De)),onCloseDockPanel:xe[36]||(xe[36]=De=>P()),onOpenAgent:xe[37]||(xe[37]=De=>i("openAgent",De)),onAnswer:Ft,onDismiss:xe[38]||(xe[38]=De=>i("dismiss",De)),onApproval:jt,onCancelTask:xe[39]||(xe[39]=De=>i("cancelTask",De)),onControlGoal:xe[40]||(xe[40]=De=>i("controlGoal",De)),onSubmit:ds,onSteer:xe[41]||(xe[41]=De=>i("steer",De)),onCommand:xe[42]||(xe[42]=De=>i("command",De)),onInterrupt:nt,onSetPermission:xe[43]||(xe[43]=De=>i("setPermission",De)),onSetThinking:xe[44]||(xe[44]=De=>i("setThinking",De)),onTogglePlan:xe[45]||(xe[45]=De=>i("togglePlan")),onToggleSwarm:xe[46]||(xe[46]=De=>i("toggleSwarm")),onToggleGoal:xe[47]||(xe[47]=De=>i("toggleGoal")),onOpenBtw:xe[48]||(xe[48]=De=>i("command","/btw")),onCreateGoal:xe[49]||(xe[49]=De=>i("createGoal",De)),onFocusGoal:M,onCompact:xe[50]||(xe[50]=De=>i("compact")),onPickModel:xe[51]||(xe[51]=De=>i("pickModel")),onSelectModel:xe[52]||(xe[52]=De=>i("selectModel",De))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),ie(El,{name:"pill"},{default:Me(()=>[te.value?(b(),T("button",{key:0,class:"newmsg-pill",style:Gt({bottom:`${me.value+12}px`}),"aria-label":C(s)("conversation.jumpToLatestAria"),onClick:xe[53]||(xe[53]=De=>xt(!0))},[ie(je,{class:"pill-chevron",name:"chevron-down",size:"md"}),Xe(" "+O(C(s)("conversation.newMessages")),1)],12,qce)):re("",!0)]),_:1}),ie(El,{name:"abort-toast"},{default:Me(()=>[$e.value?(b(),T("div",jce,[w("span",Vce,O(C(s)("conversation.manuallyAborted")),1)])):re("",!0)]),_:1})],2))}}),Zce=dt(Yce,[["__scopeId","data-v-bb386a4d"]]),Qce=["aria-selected","onClick"],Xce=Ye({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),T("div",{class:Pe(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(b(!0),T(Be,null,st(e.options,i=>(b(),T("button",{key:i.value,class:Pe(["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,Qce))),128))],2))}}),go=dt(Xce,[["__scopeId","data-v-d1aaccd7"]]),Jce={class:"ui-panel-header__title"},eue={key:0,class:"ui-panel-header__sub"},tue=Ye({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(b(),T("div",{class:Pe(["ui-panel-header",{wrap:e.wrap}])},[w("span",Jce,O(e.title),1),ie(Yt,{text:e.subtitle},{default:Me(()=>[e.subtitle?(b(),T("span",eue,O(e.subtitle),1)):re("",!0)]),_:1},8,["text"]),Fn(t.$slots,"default",{},void 0,!0),e.closable?(b(),ke(Dn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:Me(()=>[ie(je,{name:"close",size:"sm"})]),_:1},8,["label"])):re("",!0)],2))}}),Ca=dt(tue,[["__scopeId","data-v-c47879ad"]]),nue={key:0,class:"fp-empty fp-error"},sue={key:1,class:"fp-empty"},oue={key:2,class:"fp-loading"},iue={class:"fp-path"},rue={class:"fp-meta"},lue={key:0,class:"fp-lines"},aue={class:"fp-size"},cue={key:3,class:"fp-search"},uue=["placeholder"],due={key:0,class:"fp-search-count"},fue=["href","aria-label"],hue={key:1,class:"fp-code"},pue={class:"fp-line-table"},mue=["data-line"],gue={class:"fp-gutter"},vue=["innerHTML"],yue={key:1,class:"fp-body fp-code"},kue={class:"fp-line-table"},bue=["data-line"],xue={class:"fp-gutter"},_ue=["innerHTML"],wue={key:2,class:"fp-body"},Sue=["srcdoc","title"],Cue={key:1,class:"fp-code"},Aue={class:"fp-line-table"},Mue=["data-line"],Eue={class:"fp-gutter"},Tue=["innerHTML"],Nue={key:3,class:"fp-body fp-pdf-wrap"},Iue=["src","title"],$ue={key:1,class:"fp-binary-card"},Lue={class:"fp-binary-label"},Fue={key:4,class:"fp-body fp-table-wrap"},Oue={class:"fp-table"},Rue=["data-line"],Bue={key:5,class:"fp-body fp-image-wrap"},Due=["src","alt"],Pue={key:1,class:"fp-binary-card"},Hue={class:"fp-binary-icon"},Wue={class:"fp-binary-label"},zue={key:6,class:"fp-body fp-code"},Uue={class:"fp-line-table"},que=["data-line"],jue={class:"fp-gutter"},Vue=["innerHTML"],Kue={key:7,class:"fp-body fp-binary-wrap"},Gue={class:"fp-binary-card"},Yue={class:"fp-binary-icon"},Zue={class:"fp-binary-label"},Que=Ye({__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}=Tt();function s(de,G){const ae=G?G.split("/").filter(Boolean):[];for(const me of de.split("/"))me===""||me==="."||(me===".."?ae.pop():ae.push(me));return ae.join("/")}const o=Vt("resolveImage",async de=>de),i=D(()=>{const de=c.file?.path??"",G=de.lastIndexOf("/");return G>0?de.slice(0,G):""});function r(de){if(/^(https?:|data:|blob:)/i.test(de)||de.startsWith("/"))return de;const G=i.value;return G?s(de,G):de}async function l(de){const G=r(de);return o?o(G):G}In("resolveImage",l);function a(de){let G=de.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(G)||G.startsWith("/"))return de;for(const me of["#","?"]){const q=G.indexOf(me);q!==-1&&(G=G.slice(0,q))}const ae=i.value;return{...de,path:s(G,ae)}}const c=e,u=t;function d(de){c.openFile?.(a(de))}const f=Q(null),h=D(()=>{const de=c.file;if(!de)return"binary";const G=de.mime??"",ae=de.languageId??"",me=de.path.toLowerCase();return G==="text/markdown"||ae==="markdown"||ae==="md"||me.endsWith(".mdx")?"markdown":G==="application/json"||ae==="json"?"json":G==="text/html"||ae==="html"||me.endsWith(".html")||me.endsWith(".htm")?"html":G==="application/pdf"||me.endsWith(".pdf")?"pdf":G==="text/csv"||ae==="csv"||me.endsWith(".csv")?"csv":G.startsWith("image/")?"image":de.isBinary?"binary":G.startsWith("text/")||ae!==""?"text":"binary"});function p(de){const G=atob(de),ae=Uint8Array.from(G,me=>me.charCodeAt(0));return new TextDecoder().decode(ae)}const m=D(()=>{const de=c.file;if(!de)return"";if(de.encoding==="base64")try{return p(de.content)}catch{return de.content}return de.content}),x=D(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=D(()=>c.file?(h.value==="json"?x.value:m.value).split(`
301
+ `):[]),g=D(()=>c.file?h.value==="json"?x.value:m.value:""),v=Q(""),y=Q(0),M=D(()=>{const de=v.value.trim().toLowerCase();if(!de)return[];const G=[];return k.value.forEach((ae,me)=>{ae.toLowerCase().includes(de)&&G.push(me+1)}),G});Qe(v,()=>{y.value=0});function L(de,G=!1){de&&gt(()=>{const ae=f.value?.querySelector(".fp-body"),me=ae?.querySelector(`[data-line="${de}"]`);if(!ae||!me)return;G&&(ae.scrollTop=0);const q=ae.getBoundingClientRect(),ne=me.getBoundingClientRect(),ge=ne.top-q.top+ae.scrollTop;ae.scrollTop=ge-ae.clientHeight/2+ne.height/2})}Qe(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(de){const G=M.value;G.length!==0&&(y.value=(y.value+de+G.length)%G.length,L(G[y.value]))}function _(de){const G=M.value;return{target:c.line===de,hit:G.includes(de),active:G[y.value]===de}}function E(de){return de<1024?`${de} B`:de<1024*1024?`${(de/1024).toFixed(1)} KB`:`${(de/(1024*1024)).toFixed(1)} MB`}const N=Q(!1),F=Q(!1);function S(){c.file&&io(g.value).then(de=>{de&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function I(){c.file&&io(c.file.path).then(de=>{de&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const R=Q("preview"),B=Q("preview"),P=Q("fit");function z(de){R.value=de}function W(de){B.value=de}function ee(de){P.value=de}Qe(h,de=>{R.value=de==="html"?"preview":"source",B.value="preview",P.value="fit"});const U=D(()=>{const de=c.file;return!de||h.value!=="image"?null:de.sourceUrl?de.sourceUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:de.mime==="image/svg+xml"?`data:${de.mime};charset=utf-8,${encodeURIComponent(de.content)}`:null}),Z=D(()=>{const de=c.file;return!de||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:null}),ce=D(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function fe(de){const G=[];let ae="",me=!1;for(let q=0;q<de.length;q++){const ne=de[q];ne==='"'&&de[q+1]==='"'?(ae+='"',q++):ne==='"'?me=!me:ne===","&&!me?(G.push(ae),ae=""):ae+=ne}return G.push(ae),G}const oe=D(()=>k.value.slice(0,200).map(fe));function Y(de){return de.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function X(){const de=c.file;if(!de)return"";const G=de.languageId?.toLowerCase();return G||(de.path.split(".").pop()?.toLowerCase()??"")}function le(de){const G=X();let ae=Y(de);return h.value==="json"||G==="json"||G==="jsonc"?(ae=ae.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),ae=ae.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),ae=ae.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ae=ae.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ae):h.value==="html"||G==="html"||G==="xml"||G==="svg"?(ae=ae.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ae=ae.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ae):(ae=ae.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>'),ae=ae.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ae)}function He(de,G=55){return!de||de.length<=G?de:"…"+de.slice(de.length-G+1)}return(de,G)=>(b(),T("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(b(),T("div",nue,[w("span",null,O(e.error),1),e.closable?(b(),ke(Bt,{key:0,variant:"secondary",size:"sm",onClick:G[0]||(G[0]=ae=>u("close"))},{default:Me(()=>[Xe(O(C(n)("filePreview.close")),1)]),_:1})):re("",!0)])):!e.file&&!e.loading?(b(),T("div",sue,O(C(n)("filePreview.empty")),1)):e.loading?(b(),T("div",oue,[G[7]||(G[7]=w("span",{class:"spinner"},null,-1)),w("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(b(),T(Be,{key:3},[ie(Ca,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:G[6]||(G[6]=ae=>u("close"))},{default:Me(()=>[ie(Yt,{text:e.file.path},{default:Me(()=>[w("span",iue,O(He(e.file.path)),1)]),_:1},8,["text"]),w("span",rue,[e.file.lineCount?(b(),T("span",lue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):re("",!0),w("span",aue,O(E(e.file.size)),1)]),h.value==="html"?(b(),ke(go,{key:0,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):re("",!0),h.value==="markdown"?(b(),ke(go,{key:1,"model-value":B.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":W},null,8,["model-value","options"])):re("",!0),h.value==="image"?(b(),ke(go,{key:2,"model-value":P.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":ee},null,8,["model-value","options"])):re("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(b(),T("div",cue,[Ln(w("input",{"onUpdate:modelValue":G[1]||(G[1]=ae=>v.value=ae),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,uue),[[wo,v.value]]),v.value.trim()?(b(),T("span",due,O(M.value.length),1)):re("",!0),ie(Dn,{size:"sm",disabled:M.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:G[2]||(G[2]=ae=>$(-1))},{default:Me(()=>[ie(je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(Dn,{size:"sm",disabled:M.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:G[3]||(G[3]=ae=>$(1))},{default:Me(()=>[ie(je,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):re("",!0),ie(Dn,{size:"sm",class:Pe({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:I},{default:Me(()=>[F.value?(b(),ke(je,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),ke(je,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(b(),ke(Dn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:G[4]||(G[4]=ae=>u("openExternal"))},{default:Me(()=>[ie(je,{name:"external-link",size:"md"})]),_:1},8,["label"])):re("",!0),e.externalActions?(b(),ke(Dn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:G[5]||(G[5]=ae=>u("reveal"))},{default:Me(()=>[ie(je,{name:"folder",size:"md"})]),_:1},8,["label"])):re("",!0),e.downloadUrl?(b(),T("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ie(je,{name:"download",size:"md"})],8,fue)):re("",!0),!e.file.isBinary&&h.value!=="image"?(b(),ke(Dn,{key:7,size:"sm",class:Pe({copied:N.value}),label:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Me(()=>[N.value?(b(),ke(je,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),ke(je,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):re("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(b(),T("div",{key:0,class:Pe(["fp-body",{"fp-markdown":B.value==="preview"}])},[B.value==="preview"?(b(),ke(Lm,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(b(),T("div",hue,[w("div",pue,[(b(!0),T(Be,null,st(k.value,(ae,me)=>(b(),T("div",{key:me,class:Pe(["fp-line-row",_(me+1)]),"data-line":me+1},[w("span",gue,O(me+1),1),w("span",{class:"fp-line-text",innerHTML:le(ae)},null,8,vue)],10,mue))),128))])]))],2)):h.value==="json"?(b(),T("div",yue,[w("div",kue,[(b(!0),T(Be,null,st(k.value,(ae,me)=>(b(),T("div",{key:me,class:Pe(["fp-line-row",_(me+1)]),"data-line":me+1},[w("span",xue,O(me+1),1),w("span",{class:"fp-line-text",innerHTML:le(ae)},null,8,_ue)],10,bue))),128))])])):h.value==="html"?(b(),T("div",wue,[R.value==="preview"?(b(),T("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ce.value,title:e.file.path},null,8,Sue)):(b(),T("div",Cue,[w("div",Aue,[(b(!0),T(Be,null,st(k.value,(ae,me)=>(b(),T("div",{key:me,class:Pe(["fp-line-row",_(me+1)]),"data-line":me+1},[w("span",Eue,O(me+1),1),w("span",{class:"fp-line-text",innerHTML:le(ae)},null,8,Tue)],10,Mue))),128))])]))])):h.value==="pdf"?(b(),T("div",Nue,[Z.value?(b(),T("iframe",{key:0,class:"fp-pdf-frame",src:Z.value,title:e.file.path},null,8,Iue)):(b(),T("div",$ue,[w("span",Lue,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(b(),T("div",Fue,[w("table",Oue,[w("tbody",null,[(b(!0),T(Be,null,st(oe.value,(ae,me)=>(b(),T("tr",{key:me,class:Pe(_(me+1)),"data-line":me+1},[w("th",null,O(me+1),1),(b(!0),T(Be,null,st(ae,(q,ne)=>(b(),T("td",{key:ne},O(q),1))),128))],10,Rue))),128))])])])):h.value==="image"?(b(),T("div",Bue,[U.value?(b(),T("img",{key:0,src:U.value,alt:e.file.path,class:Pe(["fp-image",{actual:P.value==="actual"}])},null,10,Due)):(b(),T("div",Pue,[w("span",Hue,[ie(je,{name:"image-off",size:"lg"})]),w("span",Wue,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):h.value==="text"?(b(),T("div",zue,[w("div",Uue,[(b(!0),T(Be,null,st(k.value,(ae,me)=>(b(),T("div",{key:me,class:Pe(["fp-line-row",_(me+1)]),"data-line":me+1},[w("span",jue,O(me+1),1),w("span",{class:"fp-line-text",innerHTML:le(ae)},null,8,Vue)],10,que))),128))])])):(b(),T("div",Kue,[w("div",Gue,[w("span",Yue,[ie(je,{name:"file-off",size:"lg"})]),w("span",Zue,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):re("",!0)],512))}}),Xue=dt(Que,[["__scopeId","data-v-62bfaf2d"]]),Jue={class:"tp"},ede=Ye({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=Q(null);return Qe(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||gt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(b(),T("div",Jue,[ie(Ca,{title:C(o)("common.preview"),subtitle:e.subtitle??C(o)("thinking.panelTitle"),"close-label":C(o)("thinking.close"),onClose:l[0]||(l[0]=a=>s("close"))},null,8,["title","subtitle","close-label"]),w("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),DC=dt(ede,[["__scopeId","data-v-cf9c560b"]]),tde={class:"ap"},nde={key:0,class:"ap-type"},sde={key:1,class:"ap-reason"},ode={key:2,class:"ap-field"},ide={class:"ap-field-body"},rde={key:3,class:"ap-field"},lde={class:"ap-field-body ap-live"},ade={key:4,class:"ap-field"},cde={class:"ap-field-body ap-progress"},ude={key:0,class:"ap-call"},dde={key:1,class:"ap-output"},fde=["onClick"],hde={key:5,class:"ap-field"},pde={class:"ap-field-body"},mde=8,PC=5,HC=2,gde=Ye({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt(),i=D(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=D(()=>(n.member.text??"").trimEnd());function l(m){const x=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},x.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},x.push(k));return x}const a=D(()=>l(i.value)),c=Q(new Set);function u(m){return c.value.has(m)}function d(m){const x=new Set(c.value);x.has(m)?x.delete(m):x.add(m),c.value=x}function f(m){return m.output.length-PC-HC}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=Q(null);return Qe(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||gt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,x)=>(b(),T("div",tde,[ie(Ca,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:x[0]||(x[0]=k=>s("close"))},{default:Me(()=>[ie(Fo,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Me(()=>[Xe(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(b(),T("div",nde,O(e.member.subagentType),1)):re("",!0),e.member.suspendedReason?(b(),T("div",sde,O(e.member.suspendedReason),1)):re("",!0),e.member.prompt?(b(),T("div",ode,[x[1]||(x[1]=w("span",{class:"ap-field-label"},"Task",-1)),w("div",ide,O(e.member.prompt),1)])):re("",!0),r.value?(b(),T("div",rde,[x[2]||(x[2]=w("span",{class:"ap-field-label"},"Output",-1)),w("div",lde,O(r.value),1)])):re("",!0),a.value.length>0?(b(),T("div",ade,[x[4]||(x[4]=w("span",{class:"ap-field-label"},"Progress",-1)),w("div",cde,[(b(!0),T(Be,null,st(a.value,k=>(b(),T("div",{key:k.key,class:"ap-group"},[k.call?(b(),T("div",ude,[x[3]||(x[3]=w("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Xe(" "+O(k.call),1)])):re("",!0),k.output.length>0?(b(),T("div",dde,[k.output.length<=mde||u(k.key)?(b(!0),T(Be,{key:0},st(k.output,(g,v)=>(b(),T("div",{key:v,class:"ap-out-line"},O(g),1))),128)):(b(),T(Be,{key:1},[(b(!0),T(Be,null,st(k.output.slice(0,PC),(g,v)=>(b(),T("div",{key:v,class:"ap-out-line"},O(g),1))),128)),w("button",{type:"button",class:"ap-fold",onClick:g=>d(k.key)}," … ("+O(f(k))+" more) ",9,fde),(b(!0),T(Be,null,st(k.output.slice(-HC),(g,v)=>(b(),T("div",{key:"t"+v,class:"ap-out-line"},O(g),1))),128))],64))])):re("",!0)]))),128))])])):re("",!0),e.member.summary?(b(),T("div",hde,[x[5]||(x[5]=w("span",{class:"ap-field-label"},"Result",-1)),w("div",pde,O(e.member.summary),1)])):re("",!0)],512)]))}}),vde=dt(gde,[["__scopeId","data-v-715bd93e"]]),yde={class:"diff-lines"},kde={key:0,class:"hunk-text"},bde={class:"dl-gutter old"},xde={class:"dl-gutter new"},_de={class:"dl-sign"},wde={class:"dl-text"},Sde=Ye({__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)=>(b(),T("div",yde,[(b(!0),T(Be,null,st(e.lines,(r,l)=>(b(),T("div",{key:l,class:Pe(["dl",s(r)])},[r.type==="hunk"?(b(),T("span",kde,O(r.text),1)):(b(),T(Be,{key:1},[w("span",bde,O(t(r)),1),w("span",xde,O(n(r)),1),w("span",_de,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),w("span",wde,O(r.text),1)],64))],2))),128))]))}}),M5=dt(Sde,[["__scopeId","data-v-2f6bc1cc"]]),Cde={class:"tdp"},Ade={class:"tdp-body"},Mde={key:1,class:"tdp-output"},Ede={key:2,class:"tdp-empty"},Tde=Ye({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Tt();return(o,i)=>(b(),T("div",Cde,[ie(Ca,{title:e.target.title,subtitle:e.target.path,"close-label":C(s)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),w("div",Ade,[e.target.lines&&e.target.lines.length>0?(b(),ke(M5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(b(),T("div",Mde,[(b(!0),T(Be,null,st(e.target.output,(r,l)=>(b(),T("div",{key:l},O(r),1))),128))])):(b(),T("div",Ede,O(C(s)("diff.noDiff")),1))])]))}}),Nde=dt(Tde,[["__scopeId","data-v-76f2fbca"]]),Ide={class:"sc"},$de={key:0,class:"sc-empty"},Lde={key:2,class:"sc-loading","aria-hidden":"true"},Fde={class:"sc-composer"},Ode=["placeholder"],Rde=["disabled"],Bde=Ye({__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}=Tt(),i=D(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=D(()=>n.title?.trim()||o("sideChat.title")),l=D(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=Q(""),c=Q(null),u=Q(null);function d(){const k=a.value.trim();k&&(s("send",k),a.value="",gt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const h=D(()=>{const k=n.turns;if(k.length===0)return"0";const g=k.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((M,L)=>M+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${y}`});Qe(h,async()=>{!n.running&&!n.sending||(await gt(),f())});const p=D(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function x(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(b(),T("div",Ide,[ie(Ca,{title:r.value,subtitle:l.value,"close-label":C(o)("thinking.close"),onClose:g[0]||(g[0]=v=>s("close"))},null,8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(b(),T("div",$de,O(C(o)("sideChat.empty")),1)):(b(),ke(m5,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),p.value?(b(),T("div",Lde,[ie(p5)])):re("",!0)],512),w("div",Fde,[Ln(w("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:x,onKeydown:m},null,40,Ode),[[wo,a.value]]),ie(Yt,{text:C(o)("sideChat.send")},{default:Me(()=>[w("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(je,{name:"arrow-right",size:"sm"})],8,Rde)]),_:1},8,["text"])])]))}}),Dde=dt(Bde,[["__scopeId","data-v-9ee5df02"]]),Pde={class:"changes-pane"},Hde={class:"dv-path"},Wde={class:"diff-head"},zde={class:"back-label"},Ude={key:0,class:"empty-state"},qde={key:1,class:"dv-lines-wrap"},jde={key:2,class:"empty-state"},Vde={class:"dv-change-count"},Kde={class:"ch-head"},Gde={class:"br-label"},Yde={class:"br-name"},Zde={key:0,class:"sync-info"},Qde={key:0,class:"ahead"},Xde={key:0,class:"behind"},Jde={key:1,class:"empty-head"},efe={key:0,class:"ch-list"},tfe=["onClick"],nfe={class:"fpath"},sfe={key:1,class:"ch-list ch-tree"},ofe={class:"tree-list"},ife=["onClick"],rfe={class:"tree-name"},lfe=["onClick"],afe={class:"tree-name"},cfe={key:2,class:"empty-state"},ufe={key:3,class:"empty-state"},dfe=Ye({__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}=Tt(),s=e,o=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=D(()=>s.gitInfo!==null),u=D(()=>s.changes.length>0),d=D(()=>(s.selectedDiffPath??null)!==null),f=D(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=D(()=>s.fileDiff??[]),p=D(()=>s.fileDiffLoading===!0);function m(F){o("open",F)}function x(){o("back")}function k(){o("close")}const g=Q("list");function v(F){g.value=F}function y(F){const S={children:[]},I=[...F].sort((R,B)=>R.path.localeCompare(B.path));for(const R of I){const B=R.path.split("/");let P=S;for(let z=0;z<B.length;z++){const W=B[z],ee=z===B.length-1,U=B.slice(0,z+1).join("/");let Z=P.children.find(ce=>ce.name===W&&ce.kind===(ee?"file":"folder"));Z||(Z={name:W,path:U,kind:ee?"file":"folder",status:ee?R.status:void 0,children:[]},P.children.push(Z)),P=Z}}return S.children}const M=D(()=>y(s.changes)),L=Q(new Set);function $(F){return!L.value.has(F)}const _=D(()=>{const F=[];function S(I,R){for(const B of I)F.push({node:B,depth:R}),B.kind==="folder"&&$(B.path)&&S(B.children,R+1)}return S(M.value,0),F});function E(F){const S=new Set(L.value);S.has(F.path)?S.delete(F.path):S.add(F.path),L.value=S}function N(F){return`${16+F*16}px`}return(F,S)=>(b(),T("div",Pde,[f.value?(b(),T(Be,{key:0},[ie(Ca,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Me(()=>[ie(Yt,{text:e.selectedDiffPath??""},{default:Me(()=>[w("span",Hde,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),w("div",Wde,[e.hideBack?re("",!0):(b(),ke(Bt,{key:0,variant:"ghost",size:"sm",onClick:x},{default:Me(()=>[S[0]||(S[0]=w("span",{"aria-hidden":"true"},"←",-1)),w("span",zde,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(b(),T("div",Ude,O(C(n)("diff.loading")),1)):h.value.length>0?(b(),T("div",qde,[ie(M5,{lines:h.value},null,8,["lines"])])):(b(),T("div",jde,O(C(n)("diff.noDiff")),1))],64)):(b(),T(Be,{key:1},[ie(Ca,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Me(()=>[w("span",Vde,O(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(go,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),w("div",Kde,[c.value?(b(),T(Be,{key:0},[w("span",Gde,O(C(n)("diff.branch")),1),w("span",Yde,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(b(),T("span",Zde,[ie(Yt,{text:C(n)("diff.aheadTitle")},{default:Me(()=>[e.gitInfo.ahead>0?(b(),T("span",Qde,"↑"+O(e.gitInfo.ahead),1)):re("",!0)]),_:1},8,["text"]),ie(Yt,{text:C(n)("diff.behindTitle")},{default:Me(()=>[e.gitInfo.behind>0?(b(),T("span",Xde,"↓"+O(e.gitInfo.behind),1)):re("",!0)]),_:1},8,["text"])])):re("",!0)],64)):(b(),T("span",Jde,O(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(b(),T("div",efe,[(b(!0),T(Be,null,st(e.changes,I=>(b(),ke(Yt,{key:I.path,text:I.path},{default:Me(()=>[w("button",{type:"button",class:"ch-row",onClick:R=>m(I.path)},[w("span",{class:Pe(["badge",i(I.status)])},O(l(I.status)),3),w("span",nfe,O(a(I.path)),1)],8,tfe)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(b(),T("div",sfe,[w("ul",ofe,[(b(!0),T(Be,null,st(_.value,({node:I,depth:R})=>(b(),T("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(b(),T("button",{key:0,type:"button",class:"tree-row tree-folder",style:Gt({paddingLeft:N(R)}),onClick:B=>E(I)},[ie(je,{class:"tree-icon",name:"folder-solid",size:"sm"}),w("span",rfe,O(I.name),1)],12,ife)):(b(),ke(Yt,{key:1,text:I.path},{default:Me(()=>[w("button",{type:"button",class:"tree-row tree-file",style:Gt({paddingLeft:N(R)}),onClick:B=>m(I.path)},[w("span",{class:Pe(["badge",i(I.status)])},O(l(I.status)),3),w("span",afe,O(I.name),1)],12,lfe)]),_:2},1032,["text"]))]))),128))])])):c.value?(b(),T("div",cfe,O(C(n)("diff.clean")),1)):(b(),T("div",ufe,O(C(n)("diff.empty")),1))],64))]))}}),ffe=dt(dfe,[["__scopeId","data-v-7778610a"]]);function Dk(e,t){let n=null;yn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,gt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),ms(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const hfe=["type","value","placeholder","disabled","readonly"],pfe=Ye({__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=Q();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)=>(b(),T("input",{ref_key:"el",ref:o,class:Pe(["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,hfe))}}),Hc=dt(pfe,[["__scopeId","data-v-340f0da2"]]),mfe={class:"search-wrap"},gfe={key:0,class:"tab-strip"},vfe={key:1,class:"state-row"},yfe={key:2,class:"state-row unavail"},kfe={key:3,class:"model-list"},bfe=["aria-selected","onClick","onMouseenter"],xfe={class:"check"},_fe={class:"model-main"},wfe={class:"model-name"},Sfe={class:"model-id"},Cfe={key:0,class:"caps"},Afe={class:"model-provider"},Mfe={class:"model-ctx"},Efe={key:0,class:"empty"},Tfe={class:"footer-hint"},Nfe=Ye({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=D(()=>new Set(s.starredIds??[]));function r(v){return i.value.has(v)}const l=Q(""),a=Q(null),c=Q(null),u=Q("all");Dk(c,a);const d=D(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const M of s.models)v.has(M.provider)||(v.add(M.provider),y.push({id:M.provider,label:M.provider}));return y}),f=D(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(M=>{if(u.value!=="all"&&M.provider!==u.value)return!1;const L=(M.displayName??M.model).toLowerCase().includes(v),$=M.provider.toLowerCase().includes(v),_=M.id.toLowerCase().includes(v);return!v||L||$||_});return u.value!=="all"?y:y.sort((M,L)=>{const $=r(M.id)?1:0;return(r(L.id)?1:0)-$})}),h=D(()=>f.value),p=Q(0);Qe([l,u],()=>{p.value=0}),Qe(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Qe(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)}}yn(()=>{document.addEventListener("keydown",m)}),Sn(()=>{document.removeEventListener("keydown",m)});function x(v){o("select",v)}function k(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(b(),ke(Hr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=M=>o("close"))},{default:Me(()=>[w("div",{ref_key:"dialogRef",ref:c,class:"mp"},[w("div",mfe,[ie(Hc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=M=>l.value=M),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(b(),T("div",gfe,[(b(!0),T(Be,null,st(d.value,M=>(b(),ke(Bt,{key:M.id,variant:M.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(M.id)},{default:Me(()=>[Xe(O(M.label),1)]),_:2},1032,["variant","onClick"]))),128))])):re("",!0),e.loading?(b(),T("div",vfe,[ie(Ho,{size:"sm"}),w("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(b(),T("div",yfe,[ie(je,{name:"alert-triangle",size:"lg"}),w("span",null,O(C(n)("model.unavailable")),1)])):(b(),T("div",kfe,[(b(!0),T(Be,null,st(h.value,M=>(b(),T("div",{key:M.id,class:Pe(["model-row",{"is-current":M.id===e.current,"is-selected":k(M)===p.value}]),role:"option","aria-selected":M.id===e.current,onClick:L=>x(M.id),onMouseenter:L=>p.value=k(M)},[w("span",xfe,[M.id===e.current?(b(),ke(je,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",_fe,[w("span",wfe,O(M.displayName??M.model),1),w("span",Sfe,O(M.id),1),M.capabilities&&M.capabilities.length>0?(b(),T("span",Cfe,[(b(!0),T(Be,null,st(M.capabilities,L=>(b(),ke(Fo,{key:L,variant:"info",size:"sm"},{default:Me(()=>[Xe(O(L),1)]),_:2},1024))),128))])):re("",!0)]),w("span",Afe,O(M.provider),1),w("span",Mfe,O(C(n)("model.contextSuffix",{size:Math.round(M.maxContextSize/1e3)})),1),ie(Dn,{size:"sm",label:r(M.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt(L=>o("toggle-star",M.id),["stop"])},{default:Me(()=>[r(M.id)?(b(),ke(je,{key:0,name:"star",size:"md"})):(b(),ke(je,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,bfe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(b(),T("div",Efe,O(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):re("",!0)])),w("div",Tfe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Ife=dt(Nfe,[["__scopeId","data-v-e93073d7"]]),$fe={key:0,class:"ui-field__label"},Lfe={key:1,class:"ui-field__error"},Ffe={key:2,class:"ui-field__hint"},Ofe=Ye({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(b(),T("div",{class:Pe(["ui-field",{"has-error":!!e.error}])},[e.label?(b(),T("label",$fe,O(e.label),1)):re("",!0),Fn(t.$slots,"default",{},void 0,!0),e.error?(b(),T("span",Lfe,O(e.error),1)):e.hint?(b(),T("span",Ffe,O(e.hint),1)):re("",!0)],2))}}),sh=dt(Ofe,[["__scopeId","data-v-49bce958"]]),Rfe=["value","disabled"],Bfe=Ye({__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)=>(b(),T("select",{class:Pe(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[Fn(o.$slots,"default",{},void 0,!0)],42,Rfe))}}),Vv=dt(Bfe,[["__scopeId","data-v-92a040fd"]]),Dfe={class:"prov-list"},Pfe={key:0,class:"state-row"},Hfe={key:1,class:"state-row unavail"},Wfe={key:2,class:"empty"},zfe={class:"prov-info"},Ufe={class:"prov-type"},qfe={key:0,class:"prov-url"},jfe={class:"prov-meta"},Vfe={key:0},Kfe={class:"prov-actions"},Gfe={key:0,class:"add-section"},Yfe={key:0,class:"add-btns"},Zfe={key:1,class:"add-form"},Qfe=["value"],Xfe={key:0,class:"add-error"},Jfe={class:"form-btns"},ehe={class:"footer-hint"},the=Ye({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Tt(),{confirm:s}=Wr(),o=Q(null);Dk(o);const i=t;async function r(k){await s({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",k)}const l=Q(!1),a=Ps({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=Q(""),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(k){if(k.key==="Escape"){if(l.value){f();return}i("close")}}yn(()=>document.addEventListener("keydown",p)),Sn(()=>document.removeEventListener("keydown",p));function m(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function x(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,g)=>(b(),ke(Hr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:Me(()=>[w("div",{ref_key:"dialogRef",ref:o,class:"pm"},[w("div",Dfe,[e.loading?(b(),T("div",Pfe,[ie(Ho,{size:"sm"}),w("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(b(),T("div",Hfe,[ie(je,{name:"alert-triangle",size:"md"}),w("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(b(),T("div",Wfe,O(C(n)("providers.empty")),1)):(b(!0),T(Be,{key:3},st(e.providers,v=>(b(),T("div",{key:v.id,class:"prov-row"},[ie(Yt,{text:x(v.status)},{default:Me(()=>[w("span",{class:Pe(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Gt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),w("div",zfe,[w("span",Ufe,O(v.type),1),v.baseUrl?(b(),T("span",qfe,O(v.baseUrl),1)):re("",!0),w("span",jfe,[ie(Fo,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:Me(()=>[Xe(O(v.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(b(),T("span",Vfe," · "+O(C(n)("providers.modelCount",{count:v.models.length})),1)):re("",!0)])]),w("div",Kfe,[ie(Yt,{text:C(n)("providers.refreshTitle",{type:v.type})},{default:Me(()=>[ie(Bt,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:Me(()=>[Xe(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(Yt,{text:C(n)("providers.deleteTitle",{type:v.type})},{default:Me(()=>[ie(Bt,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:Me(()=>[Xe(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?re("",!0):(b(),T("div",Gfe,[l.value?(b(),T("div",Zfe,[ie(sh,{label:C(n)("providers.fieldType")},{default:Me(()=>[ie(Vv,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:Me(()=>[(b(),T(Be,null,st(u,v=>w("option",{key:v,value:v},O(v),9,Qfe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(sh,{label:C(n)("providers.fieldApiKey")},{default:Me(()=>[ie(Hc,{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"]),ie(sh,{label:C(n)("providers.fieldBaseUrl")},{default:Me(()=>[ie(Hc,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ie(sh,{label:C(n)("providers.fieldDefaultModel")},{default:Me(()=>[ie(Hc,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(b(),T("div",Xfe,O(c.value),1)):re("",!0),w("div",Jfe,[ie(Bt,{variant:"primary",size:"sm",onClick:h},{default:Me(()=>[Xe(O(C(n)("providers.add")),1)]),_:1}),ie(Bt,{variant:"secondary",size:"sm",onClick:f},{default:Me(()=>[Xe(O(C(n)("common.cancel")),1)]),_:1})])])):(b(),T("div",Yfe,[ie(Bt,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:Me(()=>[ie(je,{name:"user",size:"sm"}),Xe(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),ie(Bt,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:Me(()=>[ie(je,{name:"user",size:"sm"}),Xe(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Bt,{variant:"primary",size:"sm",onClick:d},{default:Me(()=>[ie(je,{name:"plus",size:"sm"}),Xe(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),w("div",ehe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),nhe=dt(the,[["__scopeId","data-v-fb6f1365"]]),she={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},ohe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},ihe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},pg=Ye({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(b(),T("svg",she,[...n[0]||(n[0]=[w("circle",{cx:"18",cy:"18",r:"15"},null,-1),w("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(b(),T("svg",ohe,[...n[1]||(n[1]=[w("circle",{cx:"14",cy:"14",r:"12"},null,-1),w("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),w("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(b(),T("svg",ihe,[...n[2]||(n[2]=[w("path",{d:"M14 3 L26 24 H2 Z"},null,-1),w("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),w("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),rhe={key:0,class:"center-body"},lhe={class:"center-text"},ahe={key:1,class:"nb"},che={class:"nb-lead"},uhe=["href"],dhe={class:"nb-or"},fhe={class:"nb-fallback"},hhe={class:"nb-fb-text"},phe=["href"],mhe={class:"nb-code-row"},ghe={class:"nb-code"},vhe={class:"nb-status"},yhe={class:"nb-status-text"},khe={class:"nb-countdown"},bhe={key:2,class:"center-body"},xhe={class:"center-text success-text"},_he={class:"center-hint"},whe={class:"center-body"},She={class:"center-text err-text"},Che={class:"center-hint"},Ahe={class:"actions"},Mhe={class:"center-body"},Ehe={class:"center-text warn-text"},The={class:"center-hint"},Nhe={class:"actions"},Ihe=Ye({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=Q(!0),o=t,i=e,r=Q("starting"),l=Q(null),a=Q(0),c=Q(!1);let u=null,d=null;yn(async()=>{await f()}),Sn(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}if(y.status==="authenticated"){m(),r.value="success",setTimeout(()=>{o("success"),o("close")},800);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 M=await i.onPollOAuthLogin();M?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):M?.status==="expired"||M?.status==="cancelled"?(m(),r.value="expired"):p(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function x(){await f()}async function k(){!l.value||!await io(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 M=Math.floor(y/60),L=y%60;return`${M}:${String(L).padStart(2,"0")}`}return(y,M)=>(b(),ke(Hr,{open:s.value,"onUpdate:open":M[0]||(M[0]=L=>s.value=L),title:C(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:Me(()=>[r.value==="starting"?(b(),T("div",rhe,[ie(Ho,{size:"md"}),w("span",lhe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(b(),T("div",ahe,[w("div",che,O(C(n)("login.lead")),1),w("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Xe(O(C(n)("login.authorizeInBrowser"))+" ",1),ie(je,{name:"external-link",size:"sm"})],8,uhe),w("div",dhe,O(C(n)("login.orDivider")),1),w("div",fhe,[w("div",hhe,[Xe(O(C(n)("login.fallbackPrefix")),1),w("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(l.value.verificationUri),9,phe),Xe(O(C(n)("login.fallbackSuffix")),1)]),w("div",mhe,[w("span",ghe,O(l.value.userCode),1),ie(Bt,{class:Pe(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:k},{default:Me(()=>[c.value?(b(),T(Be,{key:0},[ie(je,{name:"check",size:"sm"}),Xe(" "+O(C(n)("login.copied")),1)],64)):(b(),T(Be,{key:1},[ie(je,{name:"copy",size:"sm"}),Xe(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),w("div",vhe,[ie(Ho,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),w("span",yhe,O(C(n)("login.waitingAutoClose")),1),w("span",khe,O(v(a.value)),1)])])):r.value==="success"?(b(),T("div",bhe,[ie(pg,{kind:"success"}),w("span",xhe,O(C(n)("login.success")),1),w("span",_he,O(C(n)("login.successHint")),1)])):r.value==="expired"?(b(),T(Be,{key:3},[w("div",whe,[ie(pg,{kind:"expired"}),w("span",She,O(C(n)("login.expiredTitle")),1),w("span",Che,O(C(n)("login.expiredHint")),1)]),w("div",Ahe,[ie(Bt,{variant:"primary",onClick:x},{default:Me(()=>[Xe(O(C(n)("login.retry")),1)]),_:1}),ie(Bt,{variant:"secondary",onClick:g},{default:Me(()=>[Xe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(b(),T(Be,{key:4},[w("div",Mhe,[ie(pg,{kind:"error"}),w("span",Ehe,O(C(n)("login.errorTitle")),1),w("span",The,O(C(n)("login.errorHint")),1)]),w("div",Nhe,[ie(Bt,{variant:"primary",onClick:x},{default:Me(()=>[Xe(O(C(n)("login.retry")),1)]),_:1}),ie(Bt,{variant:"secondary",onClick:g},{default:Me(()=>[Xe(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):re("",!0)]),_:1},8,["open","title"]))}}),$he=dt(Ihe,[["__scopeId","data-v-43cf561c"]]);function Lhe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Fhe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Ohe(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:Lhe(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=Fhe(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,x=r[p.id]===!1?m:Math.max(p.sessionCount,m);let k=p.branch;!k&&i&&o===p.root&&(k=i),f.push({...p,sessionCount:x,branch:k})}return f}function Rhe(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const s=new Set(t.map(r=>r.id)),o=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||s.has(r.id)||r.role==="user"&&r.promptId!==void 0&&o.has(r.promptId))});return i.length>0?[...i,...t]:t}function WC(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]}function Bhe(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),s=new Set(e.map(r=>r.id)),o=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!s.has(r.id));return i.length===0?o:[...o,...i]}function Dhe(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 Phe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Hhe(e){return Phe.has(e.type)}function Whe(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function zhe(e,t,n=Whe){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}const E5=["blue","mono"],T5=["light","dark","system"],N5=14,Uhe=12,qhe=20;function jhe(){const e=rs(Lt.accent);return e&&E5.includes(e)?e:"blue"}function Vhe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Khe(){const e=rs(Lt.colorScheme);return e&&T5.includes(e)?e:"system"}function Ghe(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 Pk(e){return Number.isFinite(e)?Math.min(qhe,Math.max(Uhe,Math.round(e))):N5}function Yhe(){const e=rs(Lt.uiFontSize);return e===null?N5:Pk(Number(e))}function Zhe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Pk(e)}px`)}const Hk=Q(Khe()),Wk=Q(jhe()),zk=Q(Yhe());Qe(Hk,Ghe,{immediate:!0});Qe(Wk,Vhe,{immediate:!0});Qe(zk,Zhe,{immediate:!0});function Qhe(e){T5.includes(e)&&(Hk.value=e,gs(Lt.colorScheme,e))}function Xhe(e){E5.includes(e)&&(Wk.value=e,gs(Lt.accent,e))}function Jhe(e){const t=Pk(e);zk.value=t,gs(Lt.uiFontSize,String(t))}const epe=600,tpe=250,Hm=250,npe=1e3,spe=160,$p=Q(!1);let ua=[],pa=null,Lp=-Hm;function ope(){ua=[],Lp=-Hm,$p.value=!1,pa!==null&&(clearTimeout(pa),pa=null)}function ipe(){$p.value=!0,pa!==null&&clearTimeout(pa),pa=setTimeout(()=>{pa=null,ua=[],Lp=-Hm,$p.value=!1},npe)}function rpe(e){if(e<=0)return;const t=Date.now();ua.push({time:t,chars:e});const n=t-epe;if(ua=ua.filter(l=>l.time>=n),t-Lp<Hm)return;Lp=t;const s=ua[0]?.time??t,o=Math.max(t-s,tpe);ua.reduce((l,a)=>l+a.chars,0)/o*1e3>=spe&&ipe()}function I5(){return{colorScheme:Hk,accent:Wk,uiFontSize:zk,fastMoon:$p,setColorScheme:Qhe,setAccent:Xhe,setUiFontSize:Jhe,resetFastMoon:ope,recordMoonDelta:rpe}}function lpe(e,t,n){return e==="idle"&&!t&&!n}function Uk(e,t){const n=rs(e);return n===null?t:n==="1"}const qk=Q(Uk(Lt.notifyOnComplete,!0)),jk=Q(Uk(Lt.notifyOnQuestion,!1)),Vk=Q(Uk(Lt.notifyOnApproval,!1)),Kk=Q(typeof Notification<"u"?Notification.permission:"denied"),ape="/favicon.ico";async function Gk(e,t,n){if(!n){e.value=!1,gs(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}Kk.value=s,s==="granted"&&(e.value=!0,gs(t,"1"))}function cpe(e){return Gk(qk,Lt.notifyOnComplete,e)}function upe(e){return Gk(jk,Lt.notifyOnQuestion,e)}function dpe(e){return Gk(Vk,Lt.notifyOnApproval,e)}function Yk(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function fpe(e){return{title:An.global.t("settings.notifyTitle"),body:Yk(e,An.global.t("settings.notifyFallback"))}}function hpe(e,t){return{title:An.global.t("settings.notifyQuestionTitle"),body:Yk(t,e,An.global.t("settings.notifyQuestionFallback"))}}function ppe(e,t){return{title:An.global.t("settings.notifyApprovalTitle"),body:Yk(t,e,An.global.t("settings.notifyApprovalFallback"))}}function Zk(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{Kk.value=i,i==="granted"&&zC(t,n,s)});return}zC(t,n,s)}}function zC(e,t,n){if(!e.isUserWatching)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:ape});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function mpe(e,t){Zk(qk.value,t,fpe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function gpe(e){Zk(jk.value,e,hpe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function vpe(e){Zk(Vk.value,e,ppe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function ype(){return{notifyOnComplete:qk,notifyOnQuestion:jk,notifyOnApproval:Vk,notifyPermission:Kk,setNotifyOnComplete:cpe,setNotifyOnQuestion:upe,setNotifyOnApproval:dpe,maybeNotifyCompletion:mpe,maybeNotifyQuestion:gpe,maybeNotifyApproval:vpe}}function kpe(){return rs(Lt.soundOnComplete)==="1"}const su=Q(kpe());function bpe(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let mg=null;function $5(){const e=bpe();if(!e)return null;if(mg===null)try{mg=new e}catch{return null}return mg}function L5(){if(!su.value)return;const e=$5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{wr("sound: audio context resumed",{state:e.state})},t=>{wr("sound: audio context resume rejected",{error:String(t)})})}let UC=!1;function xpe(){if(UC||typeof window>"u")return;UC=!0;const e=()=>{L5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}xpe();function _pe(e){su.value=e,gs(Lt.soundOnComplete,e?"1":"0"),e&&L5()}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 Qk(){const e=$5();if(e===null){wr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){wr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{wr("sound: context resumed for next time",{state:e.state})},t=>{wr("sound: resume rejected",{error:String(t)})});return}try{qC(e,880,0,.16,.18),qC(e,1320,.1,.22,.16),wr("sound: chime scheduled",{state:e.state})}catch(t){wr("sound: failed to play",{error:String(t)})}}function wpe(){su.value&&Qk()}function Spe(){su.value&&Qk()}function Cpe(){su.value&&Qk()}function Ape(){return{soundOnComplete:su,setSoundOnComplete:_pe,maybePlayCompletionSound:wpe,maybePlayQuestionSound:Spe,maybePlayApprovalSound:Cpe}}const Mpe=1e3,Epe=4096,jC=32*1024;function Tpe(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await ft().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:WC(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=ft(),x=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:jC});y.outputPreview!==void 0&&x.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),x.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=x.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=ft();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",M=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!M)&&!(M&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await h.getTask(f,v.id,{withOutput:!0,outputBytes:y?Epe:jC});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{M&&o.add(v.id)}}));const x=e.tasksBySession[f]??[],k=new Map(x.map(v=>[v.id,v])),g=p.map(v=>{const y=k.get(v.id),M=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:M?.preview??y?.outputPreview,outputBytes:M?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:WC(g,x)}}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())},Mpe))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=Q(0);let d=null;return Qe(()=>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}),Qe(()=>{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 x;h&&f!==void 0?a(f):f!==void 0?x=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{x!==void 0&&clearTimeout(x)})},{deep:!0,immediate:!0}),{taskClock:D(()=>u.value),loadTasksForSession:i}}function Npe(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 Ipe(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
302
+ `)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Npe(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 Kv="/sessions/";function VC(e){const{pathname:t}=e;if(!t.startsWith(Kv))return;const n=t.slice(Kv.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function $pe(e){return e===void 0||e.length===0?"/":`${Kv}${encodeURIComponent(e)}`}const Lpe=50,Gv=5,Fpe=40402,Ope=40410,Rpe=40902,Bpe=2e3;function gg(e){return $r(e)&&e.code===Rpe}const Dpe=40904;function Ppe(e){return $r(e)&&e.code===Dpe}const oa=Ps({}),oh=Ps({}),vg=Ps({}),Vi=Ps(new Set),Wm=new Map,Aa=new Map,Fp=new Map;let Hpe=0;function Wpe(e){return{generation:Wm.get(e)??0,pending:(Aa.get(e)?.size??0)>0}}function Yv(e){const t=++Hpe;Wm.set(e,t);const n=Aa.get(e)??new Set;return n.add(t),Aa.set(e,n),t}function Zv(e,t){const n=Aa.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Aa.delete(e);const s=Fp.get(e);Fp.delete(e),s?.()}function zpe(e){Wm.delete(e),Aa.delete(e),Fp.delete(e)}function Upe(e,t){return!t.pending&&t.generation===(Wm.get(e)??0)}function qpe(e,t){if((Aa.get(e)?.size??0)===0){t();return}Fp.set(e,t)}function jpe(e,t){const{t:n}=An.global,{confirm:s}=Wr(),{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:x,updateSessionMessages:k,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:M,hasLoadedMessages:L,refreshSessionStatus:$,refreshSessionGoal:_,persistSessionProfile:E,mergedWorkspaces:N,workspacesView:F,status:S,workspaceIdForSession:I,savePermissionToStorage:R,savePlanModeToStorage:B,saveSwarmModeToStorage:P,saveGoalModeToStorage:z,draftModes:W,saveUnread:ee,saveActiveWorkspaceToStorage:U,saveHiddenWorkspacesToStorage:Z,goalErrorMessage:ce,resetFastMoon:fe,initialized:oe,connectIssue:Y,selectedDiffPath:X,fileDiffLines:le,fileDiffLoading:He}=t;let de=!1;async function G(J){if(e.messagesLoadingMoreBySession[J])return;const we=e.messagesBySession[J];if(!we||we.length===0)return;const Ae=we[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[J]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[J]:!1};try{const Re=await ft().listMessages(J,{beforeId:Ae,pageSize:Lpe}),Ge=[...Re.items].reverse();k(J,at=>[...Ge,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[J]:Re.hasMore}}catch(Re){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[J]:!0},l("loadOlderMessages",Re,{sessionId:J})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[J]:!1}}}function ae(J){o.loadTasksForSession(J),ne(J),$(J),_(J),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,J)||r.loadSkillsForSession(J)}async function me(J){const we=e.activeSessionId;if(we){X.value=J,le.value=[],He.value=!0;try{const Re=await ft().getFileDiff(we,J);if(X.value!==J)return;le.value=Ipe(Re.diff)}catch(Ae){X.value===J&&(le.value=[]),console.warn("[loadFileDiff] diff unavailable for",J,Ae)}finally{X.value===J&&(He.value=!1)}}}function q(){X.value=null,le.value=[],He.value=!1}async function ne(J){try{const Ae=await ft().getGitStatus(J);e.gitStatusBySession={...e.gitStatusBySession,[J]:Ae}}catch{}}async function ge(){try{const we=await ft().getAuth();return e.authReady=we.ready,e.defaultModel=we.defaultModel,e.managedProviderStatus=we.managedProvider?.status??null,Y.value=null,"proceed"}catch(J){return $r(J)&&(J.code===401||J.code===h5)?(Y.value=null,"server-auth-required"):(Y.value=(J instanceof Error?J.message:String(J)).slice(0,140),"retry")}}async function ue(){let J=!0;for(;;){const we=await ge();if(we!=="retry")return we;J&&(Y.value=null,J=!1),await new Promise(Ae=>{setTimeout(Ae,Bpe)})}}async function ye(){try{const J=ft();e.config=await J.getConfig()}catch{}}async function j(J){try{const Ae=await ft().setConfig(J);return e.config=Ae,e.defaultModel=Ae.defaultModel??null,!0}catch(we){return l("setConfig",we),!1}}const te=100,pe=30,Se=720*60*1e3;async function Ie(){const J=ft(),we=[];let Ae;for(;;){const Re=await J.listSessions({pageSize:te,beforeId:Ae,excludeEmpty:!0});if(we.push(...Re.items),!Re.hasMore||Re.items.length===0)break;Ae=Re.items[Re.items.length-1].id}return we}function Fe(J){const we=new Map(e.sessions.map(Ae=>[Ae.id,Ae.usage]));d(J.map(Ae=>{const Re=we.get(Ae.id);return Re!==void 0&&Rv(Ae.usage)&&!Rv(Re)?{...Ae,usage:Re}:Ae}))}async function he(J){const we=ft(),Ae=[],Re=Date.now(),Ge=Wt=>Re-new Date(Wt.updatedAt).getTime();let at,Mt=!1,Ut=!0;for(;;){let Wt;try{Wt=await we.listSessions({workspaceId:J,pageSize:Gv,beforeId:at,excludeEmpty:!0})}catch(lo){if(Ut)throw lo;break}if(Mt=Wt.hasMore,Wt.items.length===0)break;const hs=Wt.items[Wt.items.length-1],Si=Ge(hs)>=Se;if(!Ut&&Si){const lo=Wt.items.findIndex(Qs=>Ge(Qs)>=Se),ns=lo>=0?lo+1:Wt.items.length;Ae.push(...Wt.items.slice(0,ns)),Mt=Wt.hasMore||ns<Wt.items.length;break}if(Ae.push(...Wt.items),Ut=!1,!Wt.hasMore||Si)break;at=hs.id}return{workspaceId:J,page:{items:Ae,hasMore:Mt}}}async function Ne(){const J=e.workspaces;if(J.length===0){const Mt=await Ie().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Mt}const we=await Promise.all(J.map(Mt=>he(Mt.id).catch(()=>({workspaceId:Mt.id,page:{items:[],hasMore:!1}})))),Ae=[],Re={},Ge={},at={};for(const{workspaceId:Mt,page:Ut}of we)Ae.push(...Ut.items),Re[Mt]=Ut.hasMore,Ge[Mt]=Ut.items.length>0?Ut.items[Ut.items.length-1].id:void 0,at[Mt]=Math.max(Ut.items.length,Gv);return e.sessionsHasMoreByWorkspace=Re,e.sessionsCursorByWorkspace=Ge,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Ae.sort((Mt,Ut)=>new Date(Ut.updatedAt).getTime()-new Date(Mt.updatedAt).getTime()),Ae}async function Je(J){if(e.sessionsLoadingMoreByWorkspace[J]||e.sessionsHasMoreByWorkspace[J]===!1)return;const we=e.sessionsCursorByWorkspace[J];if(we!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[J]:!0};try{const Ae=await ft().listSessions({workspaceId:J,pageSize:pe,beforeId:we,excludeEmpty:!0}),Re=new Set(e.sessions.map(at=>at.id)),Ge=Ae.items.filter(at=>!Re.has(at.id));Ge.length>0&&d([...e.sessions,...Ge]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[J]:Ae.items.length>0?Ae.items[Ae.items.length-1].id:we},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[J]:Ae.hasMore}}catch(Ae){l("loadMoreSessions",Ae)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[J]:!1}}}}async function it(){if(e.sessionsFullyLoaded)return;const J=await Ie().catch(()=>null);if(J===null)return;Fe(J),e.sessionsFullyLoaded=!0;const we={};for(const Ae of e.workspaces)we[Ae.id]=!1;e.sessionsHasMoreByWorkspace=we}async function At(){const J=await ft().getMeta().catch(()=>null);J!==null&&(e.serverVersion=J.serverVersion,e.availableOpenInApps=J.openInApps,e.dangerousBypassAuth=J.dangerousBypassAuth,e.backend=J.backend)}async function xt(){const J=Date.now();let we="accepted";Ls("app:load:start"),e.loading=!0;const Ae=!oe.value;let Re=!0;try{if(Ae&&await ue()==="server-auth-required"){Re=!1,we="auth-required";return}const Ge=ft();await Promise.all([Ge.getHealth().catch(()=>null),At(),r.loadModels()]),Ae||await ge(),await ye(),await wt();const at=await Ne();Fe(at);const Mt=at[0],Ut=e.activeWorkspaceId;!(Ut!==null&&N.value.some(Si=>Si.id===Ut))&&Mt&&vt(I(Mt)),us();const hs=typeof window<"u"?VC(window.location):void 0;!e.activeSessionId&&hs!==void 0&&(e.sessions.some(lo=>lo.id===hs)||await as(hs))&&await On(hs,{urlMode:"replace"}),!e.activeSessionId&&at.length>0&&await On(at[0].id,{urlMode:"replace"})}catch(Ge){we="failed",l("load",Ge)}finally{e.loading=!1,Re&&(oe.value=!0),Ls("app:load:complete",{status:we,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-J})}}async function wt(){try{const J=ft(),[we,Ae]=await Promise.all([J.listWorkspaces().catch(()=>[]),J.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Kt(we),e.fsHome=Ae.home||null,e.recentRoots=Ae.recentRoots}catch{}}function Kt(J){const we=Lf();return Object.keys(we).length===0?J:J.map(Ae=>{const Re=we[Ae.root];return Re!==void 0?{...Ae,name:Re}:Ae})}function vt(J){e.activeWorkspaceId=J,U(J)}function cn(J){vt(J);const we=e.sessions.filter(Ae=>I(Ae)===J);if(we.length>0){const Ae=we[0];Ae&&Ae.id!==e.activeSessionId&&On(Ae.id)}else x(void 0),nn(void 0,"push")}function Kn(J){const we=Lf()[J.root],Ae=we!==void 0?{...J,name:we}:J;e.hiddenWorkspaceRoots.includes(Ae.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Ae.root),Z(e.hiddenWorkspaceRoots));const Re=e.workspaces.findIndex(at=>at.id===Ae.id||at.root===Ae.root);if(Re===-1){e.workspaces=[Ae,...e.workspaces];return}const Ge=[...e.workspaces];Ge[Re]=Ae,e.workspaces=Ge}function Un(J){if(J.type==="workspaceCreated"||J.type==="workspaceUpdated"){Kn(J.workspace);return}const we=e.workspaces.find(Re=>Re.id===J.workspaceId)?.root??J.root;if(we&&!e.hiddenWorkspaceRoots.includes(we)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,we],Z(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Re=>Re.id!==J.workspaceId&&Re.root!==we),e.activeWorkspaceId===J.workspaceId||e.activeWorkspaceId===we){const Re=F.value[0]?.id??null;if(e.activeWorkspaceId=Re,Re)U(Re);else try{Vc(Lt.activeWorkspace)}catch{}x(void 0),e.sessionLoading=!1,q(),nn(void 0,"replace")}}function Zt(){x(void 0),nn(void 0,"push")}function bn(J){vt(J),Zt(),q()}async function Pn(J){const we=N.value.find(hs=>hs.id===J);if(!we)return null;const Ae=ft();let Re,Ge=we.root;try{const hs=await Ae.addWorkspace({root:we.root});Re=hs.id,Ge=hs.root,Kn(hs)}catch{}const at=r.draftModel.value??void 0,Mt=await Ae.createSession({workspaceId:Re,cwd:Ge,model:at});r.draftModel.value=null;const Ut=at!==void 0&&(!Mt.model||Mt.model.length===0)?{...Mt,model:at}:Mt;h(Ut),vt(Mt.workspaceId??Re??J),await On(Mt.id);const Wt=Mt.id;return W.planMode&&(e.planModeBySession={...e.planModeBySession,[Wt]:!0},B()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Wt]:!0},P()),W.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Wt]:!0},z()),W.planMode=!1,W.swarmMode=!1,W.goalMode=!1,Wt}async function rt(J,we,Ae){if(!Vi.has(J)){Vi.add(J);try{const Re=await Pn(J);if(!Re)return;await es(Re,we,Ae)}catch(Re){l("startSessionAndSendPrompt",Re)}finally{Vi.delete(J)}}}async function Hn(J,we,Ae){if(!Vi.has(J)){Vi.add(J);try{const Re=await Pn(J);if(!Re)return;const Ge=e.planModeBySession[Re]??!1,at=e.swarmModeBySession[Re]??!1,Mt=e.sessions.find(Wt=>Wt.id===Re),Ut=(Mt?.model&&Mt.model.length>0?Mt.model:e.defaultModel)??void 0;await E({model:Ut,planMode:Ge,swarmMode:at,permissionMode:e.permission,thinking:e.thinking},Re),await r.activateSkill(we,Ae,Re)}catch(Re){l("startSessionAndActivateSkill",Re)}finally{Vi.delete(J)}}}async function Os(J,we){if(!Vi.has(J)){Vi.add(J);try{const Ae=await Pn(J);if(!Ae)return;await i.openSideChatOn(Ae,we)}catch(Ae){l("startSessionAndOpenSideChat",Ae)}finally{Vi.delete(J)}}}async function xn(J){const we=J.trim();if(!we)return!1;const Ae=ft();try{const Re=await Ae.addWorkspace({root:we});return Kn(Re),bn(Re.id),!0}catch{return!1}}async function ls(J){try{return await ft().browseFs(J)}catch{return{path:"",parent:null,entries:[]}}}async function As(){try{return await ft().getFsHome()}catch{return{home:"",recentRoots:[]}}}function nn(J,we){if(we==="none"||typeof window>"u"||!window.history)return;const Ae=$pe(J);if(window.location.pathname!==Ae)try{we==="push"?window.history.pushState(null,"",Ae):window.history.replaceState(null,"",Ae)}catch{}}async function as(J){try{const we=await ft().getSession(J);return e.sessions.some(Ae=>Ae.id===we.id)||p(we),!0}catch{return!1}}function hn(){const J=VC(window.location);if(J===void 0){x(void 0);return}if(J!==e.activeSessionId){if(e.sessions.some(we=>we.id===J)){On(J,{urlMode:"none"});return}(async()=>{if(await as(J)){await On(J,{urlMode:"none"});return}const we=e.sessions[0];we?await On(we.id,{urlMode:"replace"}):(x(void 0),nn(void 0,"replace"))})()}}let cs=!1;function us(){cs||typeof window>"u"||(cs=!0,window.addEventListener("popstate",hn))}async function On(J,we){const Ae=L(J),Re=!Ae&&u.has(J);u.delete(J);try{nn(J,we?.urlMode??"push"),e.sessionLoading=!Ae&&!Re,x(J),fe(),e.unreadBySession[J]&&(e.unreadBySession={...e.unreadBySession,[J]:!1},ee({[J]:!1})),q();const Ge=e.sessions.find(at=>at.id===J);if(Ge){const at=I(Ge);e.activeWorkspaceId!==at&&vt(at)}if(Ae){if(await M(J)==="not-found")return}else if(await y(J)==="not-found")return;ae(J)}catch(Ge){l("selectSession",Ge,{sessionId:J})}finally{e.activeSessionId===J&&(e.sessionLoading=!1)}}async function es(J,we,Ae){const Re=Yv(J);c.add(J),e.sendingBySession={...e.sendingBySession,[J]:!0};const Ge=g();try{const at=ft(),Mt=[];we&&Mt.push({type:"text",text:we});for(const Es of Ae??[])Es.kind==="video"?Mt.push({type:"video",source:{kind:"file",fileId:Es.fileId}}):Mt.push({type:"image",source:{kind:"file",fileId:Es.fileId}});if(Mt.length===0)return c.delete(J),e.sendingBySession={...e.sendingBySession,[J]:!1},!1;const Ut={id:Ge,sessionId:J,role:"user",content:Mt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(J,Es=>[...Es,Ut]);const Wt=e.sessions.find(Es=>Es.id===J),hs=(Wt?.model&&Wt.model.length>0?Wt.model:e.defaultModel)??void 0,Si=e.planModeBySession[J]??!1,lo=e.swarmModeBySession[J]??!1,ns=e.goalModeBySession[J]??!1;if(ns&&we)try{await at.updateSession(J,{goalObjective:we.trim()})}catch(Es){return l("createGoal",Es,{sessionId:J}),c.delete(J),e.sendingBySession={...e.sendingBySession,[J]:!1},k(J,Xs=>Xs.some(Ts=>Ts.id===Ge)?Xs.filter(Ts=>Ts.id!==Ge):Xs),!1}const Qs=await at.submitPrompt(J,{content:Mt,model:hs,thinking:e.thinking,permissionMode:e.permission,planMode:Si,swarmMode:lo});return ns&&(e.goalModeBySession={...e.goalModeBySession,[J]:!1},z()),e.promptIdBySession={...e.promptIdBySession,[J]:Qs.promptId},k(J,Es=>{const Xs=Es.findIndex(Ci=>Ci.id===Ge);if(Xs===-1)return Es;const Ts=[...Es];return Ts[Xs]={...Ts[Xs],promptId:Ts[Xs].promptId??Qs.promptId},Ts}),v()?.bindNextPromptId(J,Qs.promptId),!0}catch(at){return c.delete(J),e.sendingBySession={...e.sendingBySession,[J]:!1},k(J,Mt=>Mt.some(Ut=>Ut.id===Ge)?Mt.filter(Ut=>Ut.id!==Ge):Mt),l("sendPrompt",at,{sessionId:J}),!1}finally{Zv(J,Re)}}async function ds(J,we){const Ae=e.activeSessionId;if(Ae){if(a.value!=="idle"||c.has(Ae)){Ue(J,we);return}await es(Ae,J,we)}}async function Ht(J,we){const Ae=e.activeSessionId;if(!Ae)return;const Re=e.queuedBySession[Ae]??[],Ge=[],at=[];for(const ns of Re){const Qs=ns.text.trim();Qs&&Ge.push(Qs),ns.attachments?.length&&at.push(...ns.attachments)}const Mt=J.trim();if(Mt&&Ge.push(Mt),we?.length&&at.push(...we),Ge.length===0&&at.length===0)return;Re.length>0&&(e.queuedBySession={...e.queuedBySession,[Ae]:[]});const Ut=Ge.join(`
303
+
304
+ `);if(a.value==="idle"&&!c.has(Ae)){await es(Ae,Ut,at);return}const Wt=[];Ut&&Wt.push({type:"text",text:Ut});for(const ns of at)ns.kind==="video"?Wt.push({type:"video",source:{kind:"file",fileId:ns.fileId}}):Wt.push({type:"image",source:{kind:"file",fileId:ns.fileId}});const hs=g(),Si={id:hs,sessionId:Ae,role:"user",content:Wt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(Ae,ns=>[...ns,Si]);const lo=Yv(Ae);try{const ns=ft(),Qs=e.sessions.find(Ts=>Ts.id===Ae),Es=(Qs?.model&&Qs.model.length>0?Qs.model:e.defaultModel)??void 0,Xs=await ns.submitPrompt(Ae,{content:Wt,model:Es,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Ae]??!1,swarmMode:e.swarmModeBySession[Ae]??!1});if(k(Ae,Ts=>{const Ci=Ts.findIndex(Qd=>Qd.id===hs);if(Ci===-1)return Ts;const Hl=[...Ts];return Hl[Ci]={...Hl[Ci],promptId:Hl[Ci].promptId??Xs.promptId},Hl}),Xs.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ae]:Xs.promptId},v()?.bindNextPromptId(Ae,Xs.promptId);return}try{await ns.steerPrompts(Ae,[Xs.promptId])}catch{}}catch(ns){k(Ae,Qs=>Qs.filter(Es=>Es.id!==hs)),l("steer",ns,{sessionId:Ae})}finally{Zv(Ae,lo)}}async function Ze(J,we){try{const Re=await ft().uploadFile({file:J,name:we});return{fileId:Re.id,name:Re.name,mediaType:Re.mediaType}}catch(Ae){return l("uploadImage",Ae),null}}function Ue(J,we){const Ae=e.activeSessionId;if(!Ae)return;const Re=e.queuedBySession[Ae]??[];e.queuedBySession={...e.queuedBySession,[Ae]:[...Re,{text:J,attachments:we}]}}function Ft(J){const we=c.delete(J);if(e.sendingBySession={...e.sendingBySession,[J]:!1},e.promptIdBySession[J]!==void 0){const Re={...e.promptIdBySession};delete Re[J],e.promptIdBySession=Re}J===e.activeSessionId&&fe();const Ae=e.queuedBySession[J]??[];if(Ae.length>0){const[Re,...Ge]=Ae;e.queuedBySession={...e.queuedBySession,[J]:Ge},Re!==void 0&&es(J,Re.text,Re.attachments).then(at=>{if(!at){const Mt=e.queuedBySession[J]??[];e.queuedBySession={...e.queuedBySession,[J]:[Re,...Mt]}}})}return we}function jt(J,we){we.inFlightTurn===null&&(we.status!=="idle"&&we.status!=="aborted"||Ft(J))}async function en(){const J=e.activeSessionId;if(!J)return;const we=e.sessions.find(Ge=>Ge.id===J);let Ae=e.promptIdBySession[J];if(Ae===void 0){const Ge=we?.currentPromptId;Ge!==void 0&&Ge.length>0&&!Ge.startsWith("pr_")&&(Ae=Ge)}const Re=ft();if(Ae!==void 0)try{if((await Re.abortPrompt(J,Ae)).aborted)return;const at={...e.promptIdBySession};delete at[J],e.promptIdBySession=at}catch(Ge){if($r(Ge)&&Ge.code===Fpe){const at={...e.promptIdBySession};delete at[J],e.promptIdBySession=at}else{l("abortCurrentPrompt",Ge,{sessionId:J});return}}try{await Re.abortSession(J)}catch(Ge){l("abortCurrentPrompt",Ge,{sessionId:J})}}function Qt(J,we){const Ae=e.approvalsBySession[J]??[];e.approvalsBySession={...e.approvalsBySession,[J]:Ae.filter(Re=>Re.approvalId!==we)}}function un(J,we){const Ae=e.questionsBySession[J]??[];e.questionsBySession={...e.questionsBySession,[J]:Ae.filter(Re=>Re.questionId!==we)}}async function Wn(J,we){const Ae=e.activeSessionId;if(Ae&&!oh[J]){oh[J]=!0;try{const Re=ft(),Ge={decision:we.decision,scope:we.scope,feedback:we.feedback,selectedLabel:we.selectedLabel};await Re.respondApproval(Ae,J,Ge),Qt(Ae,J)}catch(Re){gg(Re)?Qt(Ae,J):l("respondApproval",Re,{sessionId:Ae})}finally{delete oh[J]}}}async function Nt(J,we){const Ae=e.activeSessionId;if(Ae&&!oa[J]){oa[J]="answer";try{await ft().respondQuestion(Ae,J,we),un(Ae,J)}catch(Re){gg(Re)?un(Ae,J):l("respondQuestion",Re,{sessionId:Ae})}finally{delete oa[J]}}}async function fs(J){const we=e.activeSessionId;if(we&&!oa[J]){oa[J]="dismiss";try{await ft().dismissQuestion(we,J),un(we,J)}catch(Ae){gg(Ae)?un(we,J):l("dismissQuestion",Ae,{sessionId:we})}finally{delete oa[J]}}}async function ts(J){const we=e.activeSessionId;if(we&&!vg[J]){vg[J]=!0;try{await ft().cancelTask(we,J);const Re=e.tasksBySession[we]??[];e.tasksBySession={...e.tasksBySession,[we]:Re.map(Ge=>Ge.id===J?{...Ge,status:"cancelled"}:Ge)}}catch(Ae){Ppe(Ae)||l("cancelTask",Ae,{sessionId:we})}finally{delete vg[J]}}}function Zs(J){const we=e.activeSessionId;we?(e.planModeBySession={...e.planModeBySession,[we]:J},B(),E({planMode:J})):W.planMode=J}function zn(){const J=e.activeSessionId,we=J?e.planModeBySession[J]??!1:W.planMode;Zs(!we)}function Gn(J){const we=e.activeSessionId;we?(e.swarmModeBySession={...e.swarmModeBySession,[we]:J},P(),E({swarmMode:J})):W.swarmMode=J}async function Di(){const J=e.activeSessionId,Ae=!(J?e.swarmModeBySession[J]??!1:W.swarmMode);Ae&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Gn(Ae)}function Ms(J){const we=e.activeSessionId;we?(e.goalModeBySession={...e.goalModeBySession,[we]:J},z()):W.goalMode=J}function _i(){const J=e.activeSessionId,we=J?e.goalModeBySession[J]??!1:W.goalMode;Ms(!we)}async function So(J){const we=J.trim();if(!we||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:we}),variant:"primary"}))return;let Ae=e.activeSessionId;if(!Ae){const Re=e.activeWorkspaceId,Ge=Re&&F.value.some(at=>at.id===Re)?Re:F.value[0]?.id??null;if(!Ge)return;try{Ae=await Pn(Ge)??void 0}catch(at){l("createGoal",at);return}if(!Ae)return}try{await ft().updateSession(Ae,{goalObjective:we})}catch(Re){l("createGoal",Re,{sessionId:Ae,message:ce(Re)});return}e.goalModeBySession[Ae]&&(e.goalModeBySession={...e.goalModeBySession,[Ae]:!1},z()),e.activeSessionId===Ae?await ds(we):await es(Ae,we)}function Pi(J){const we=e.activeSessionId;we&&Promise.resolve(ft().updateSession(we,{goalControl:J})).catch(Ae=>{l("controlGoal",Ae,{sessionId:we,message:ce(Ae)})})}function ni(J){e.permission=J,R(J),E({permissionMode:J})}function vs(J){const we=[...e.warnings];we.splice(J,1),e.warnings=we}async function Co(J,we){try{await ft().updateSession(J,{title:we}),f(J,Re=>({...Re,title:we}))}catch(Ae){l("renameSession",Ae,{sessionId:J})}}async function sr(J,we){const Ae=e.workspaces.find(Ge=>Ge.id===J)?.root,Re=()=>{e.workspaces=e.workspaces.map(Ge=>Ge.id===J?{...Ge,name:we}:Ge)};try{if(await ft().updateWorkspace(J,{name:we}),Ae!==void 0){const Ge=Lf();Ae in Ge&&(delete Ge[Ae],Kx(Ge))}Re()}catch(Ge){if(Ae!==void 0&&$r(Ge)&&Ge.code===Ope){Kx({...Lf(),[Ae]:we}),Re();return}l("renameWorkspace",Ge)}}async function wi(J){const we=e.workspaces.find(at=>at.id===J)?.root??N.value.find(at=>at.id===J)?.root??J,Ae=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,Re=e.activeWorkspaceId===J||e.activeWorkspaceId===we,Ge=!!(Ae&&(Ae.cwd===we||Ae.workspaceId===J||I(Ae)===J));we&&!e.hiddenWorkspaceRoots.includes(we)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,we],Z(e.hiddenWorkspaceRoots));try{await ft().deleteWorkspace(J)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==J&&at.root!==we),Re||Ge){const at=F.value[0]?.id??null;if(e.activeWorkspaceId=at,at)U(at);else try{Vc(Lt.activeWorkspace)}catch{}}(Re||Ge)&&(x(void 0),e.sessionLoading=!1,q(),nn(void 0,"replace"))}async function Yn(J){try{await ft().archiveSession(J),m(J),i.clearSideChatForSession(J);const{[J]:Ae,...Re}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Re,e.activeSessionId===J){const Ge=e.sessions[0];Ge?await On(Ge.id,{urlMode:"replace"}):(x(void 0),nn(void 0,"replace"))}}catch(we){l("archiveSession",we,{sessionId:J})}}async function ys(J){if(de)return;const we=J??e.activeSessionId;if(!we){const Re=n("commands.export.noSession");Ls("export:failed",{status:"no-session"}),l("exportSession",new Error(Re),{message:Re});return}de=!0;const Ae=Date.now();Ls("export:start",{sessionId:we});try{const Re=$te(),{blob:Ge,fileName:at}=await ft().exportSession(we,Re);if(typeof document>"u")throw new Error("Document is unavailable");const Mt=URL.createObjectURL(Ge);let Ut;try{Ut=document.createElement("a"),Ut.href=Mt,Ut.download=at,document.body.append(Ut),Ut.click()}finally{Ut?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Mt)}catch{}},0)}Ls("export:accepted",{sessionId:we,status:"accepted",zipBytes:Ge.size,durationMs:Date.now()-Ae})}catch(Re){const Ge=typeof Re=="object"&&Re!==null?Re:void 0;Ls("export:failed",{sessionId:we,status:"failed",durationMs:Date.now()-Ae,errorName:typeof Ge?.name=="string"?Ge.name:typeof Re,errorCode:typeof Ge?.code=="number"?Ge.code:void 0,requestId:typeof Ge?.requestId=="string"?Ge.requestId:void 0,phase:typeof Ge?.phase=="string"?Ge.phase:void 0,httpStatus:typeof Ge?.status=="number"?Ge.status:void 0}),l("exportSession",Re,{sessionId:we})}finally{de=!1}}async function Ao(J){try{const we=await ft().restoreSession(J);return h(we),!0}catch(we){return l("restoreSession",we,{sessionId:J}),!1}}function ct(J){return ft().listSessions({archivedOnly:!0,beforeId:J?.beforeId,pageSize:J?.pageSize??50})}async function be(){try{await ft().logout(),await ge(),await xt()}catch(J){l("logout",J)}}function $e(J){const we=e.activeSessionId;we&&ft().compactSession(we,J).catch(Ae=>{l("compact",Ae,{sessionId:we})})}async function sn(J){const we=J??e.activeSessionId;if(we)try{const Ae=await ft().forkSession(we);h(Ae),await On(Ae.id)}catch(Ae){l("fork",Ae,{sessionId:we})}}async function Ke(J=1){const we=e.activeSessionId;if(!we)return null;const Ae=(()=>{const Re=e.messagesBySession[we]??[];for(let Ge=Re.length-1;Ge>=0;Ge--){const at=Re[Ge];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Mt=>Mt.type==="text").map(Mt=>Mt.text).join(`
305
+ `)}return null})();try{return await ft().undoSession(we,J),await y(we),Ae}catch(Re){return l("undo",Re,{sessionId:we}),null}}function nt(J){const we=e.activeSessionId;if(!we)return;const Ae=e.queuedBySession[we]??[];if(J<0||J>=Ae.length)return;const Re=[...Ae];Re.splice(J,1),e.queuedBySession={...e.queuedBySession,[we]:Re}}function ot(J,we){const Ae=e.activeSessionId;if(!Ae)return;const Re=e.queuedBySession[Ae]??[];if(J===we||J<0||J>=Re.length||we<0||we>=Re.length)return;const Ge=[...Re],[at]=Ge.splice(J,1);at!==void 0&&(Ge.splice(we,0,at),e.queuedBySession={...e.queuedBySession,[Ae]:Ge})}async function Ot(J){const we=e.activeSessionId;if(!we)return[];try{return(await ft().listDirectory(we,{path:J,includeGitStatus:!0})).items}catch{return[]}}async function ve(J){const we=e.activeSessionId;if(!we)return null;try{const Re=await ft().readFile(we,{path:J});return{path:Re.path,content:Re.content,encoding:Re.encoding,mime:Re.mime,languageId:Re.languageId,isBinary:Re.isBinary,size:Re.size,lineCount:Re.lineCount}}catch{return null}}const xe=10485760;function De(J){const we=e.activeSessionId;return we?ft().getFileDownloadUrl(we,J):null}async function Rt(J,we){const Ae=e.activeSessionId;if(!Ae)return!1;try{return await ft().openFile(Ae,{path:J,line:we}),!0}catch(Re){return l("openFile",Re,{sessionId:Ae}),!1}}async function Dt(J){const we=e.activeSessionId;if(!we)return;const Ae=S.value.cwd||".";try{await ft().openInApp(we,J,Ae)}catch(Re){l("openInApp",Re,{sessionId:we})}}async function Cn(J){const we=e.activeSessionId;if(!we)return!1;try{return await ft().revealFile(we,{path:J}),!0}catch(Ae){return l("revealFile",Ae,{sessionId:we}),!1}}async function qn(J){if(/^(https?:|data:|blob:)/i.test(J))return J;const we=e.activeSessionId;if(!we)return J;let Ae=J;if(Ae.startsWith("/")){const Re=e.sessions.find(Ge=>Ge.id===we)?.cwd;if(Re&&(Ae===Re||Ae.startsWith(Re.endsWith("/")?Re:`${Re}/`))){if(Ae=Ae.slice(Re.length).replace(/^\//,""),!Ae)return J}else return J}try{const Ge=await ft().readFile(we,{path:Ae,length:xe});return!Ge.isBinary||Ge.encoding!=="base64"||Ge.truncated?J:`data:${Ge.mime};base64,${Ge.content}`}catch{return J}}async function Hs(J){const we=e.activeSessionId;if(!we)return[];try{return(await ft().searchFiles(we,{query:J,limit:20})).items.map(Ge=>({path:Ge.path,name:Ge.name}))}catch{return[]}}return{loadFileDiff:me,clearFileDiff:q,loadGitStatus:ne,checkAuth:ge,loadConfig:ye,updateConfig:j,listAllSessionsGlobal:Ie,load:xt,refreshServerMeta:At,loadWorkspaces:wt,loadMoreSessions:Je,loadAllSessions:it,selectWorkspace:vt,openWorkspace:cn,upsertWorkspacePreserveOrder:Kn,applyWorkspaceEvent:Un,clearActiveSession:Zt,openWorkspaceDraft:bn,startSessionAndSendPrompt:rt,startSessionAndActivateSkill:Hn,startSessionAndOpenSideChat:Os,addWorkspaceByPath:xn,browseFs:ls,getFsHome:As,writeSessionUrl:nn,fetchSessionIntoList:as,onSessionRoutePopState:hn,bindSessionRoute:us,selectSession:On,submitPromptInternal:es,finishPromptLocal:Ft,localTurnStartState:Wpe,isLocalTurnSnapshotCurrent:Upe,afterLocalTurnStartsSettle:qpe,handleSessionSnapshot:jt,sendPrompt:ds,steerPrompt:Ht,uploadImage:Ze,enqueue:Ue,unqueue:nt,reorderQueue:ot,abortCurrentPrompt:en,respondApproval:Wn,respondQuestion:Nt,dismissQuestion:fs,pendingQuestionActions:oa,pendingApprovalActions:oh,cancelTask:ts,setPlanMode:Zs,togglePlanMode:zn,setSwarmMode:Gn,toggleSwarmMode:Di,setGoalMode:Ms,toggleGoalMode:_i,createGoal:So,controlGoal:Pi,setPermission:ni,dismissWarning:vs,renameSession:Co,renameWorkspace:sr,deleteWorkspace:wi,archiveSession:Yn,exportSession:ys,restoreSession:Ao,loadArchivedSessions:ct,logout:be,compact:$e,forkSession:sn,undo:Ke,listDir:Ot,readFileContent:ve,getFileDownloadUrl:De,openWorkspaceFile:Rt,openInApp:Dt,revealWorkspaceFile:Cn,resolveImageUrl:qn,searchFiles:Hs,loadOlderMessages:G,refreshSessionSidecars:ae,isStartingFirstPrompt:()=>Vi.size>0}}const F5=Lt.starredModels;function Vpe(){try{const e=rs(F5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Kpe(e){try{gs(F5,JSON.stringify(e))}catch{}}function Gpe(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Q([]),d=Q(Vpe()),f=Q({}),h=Q({}),p=Q([]),m=Q(null);function x(U){if(!(U==null||U.length===0))return u.value.find(Z=>Z.id===U)??u.value.find(Z=>Z.model===U)}function k(){const U=e.activeSessionId?e.sessions.find(ce=>ce.id===e.activeSessionId):void 0,Z=U===void 0?m.value??e.defaultModel:U.model||e.defaultModel;return x(Z)?.id??Z??void 0}function g(U){return e.thinking=U,U!==void 0&&l(U),U}function v(U){ft().setConfig({thinking:Uie(U)}).catch(Z=>n("setConfig",Z))}async function y(U){try{const ce=await ft().listSkills(U);f.value={...f.value,[U]:ce}}catch{}}async function M(U){try{const ce=await ft().listSkillsForWorkspace(U);h.value={...h.value,[U]:ce}}catch{}}async function L(){try{const U=ft();if(u.value=await U.listModels(),e.thinking===void 0){const Z=x(k());Z!==void 0&&(e.thinking=Pm(Z))}}catch(U){n("loadModels",U)}}async function $(){try{const U=await ft().refreshOAuthProviderModels();for(const Z of U.failed)n("refreshOAuthProviderModels",new Error(Z.reason),{message:Z.provider})}catch{}}async function _(){try{const U=ft();p.value=await U.listProviders()}catch(U){n("loadProviders",U)}}async function E(U){const Z=e.activeSessionId,ce=x(U),fe=e.thinking,oe=Z?e.sessions.find(le=>le.id===Z)?.model:void 0,Y=k()!==(ce?.id??U),X=qie(ce,fe,Y);if(!Z)return m.value=U,g(X),X!==fe&&X!==void 0&&v(X),!0;a(Z,le=>({...le,model:U})),X!==fe&&g(X);try{await ft().updateSession(Z,{model:U,thinking:X!==fe?X:void 0})}catch(le){return a(Z,He=>({...He,model:oe??He.model})),X!==fe&&g(fe),n("setModel",le,{sessionId:Z}),!1}return X!==fe&&X!==void 0&&v(X),await s(Z),!0}function N(U){const Z=new Set(d.value);Z.has(U)?Z.delete(U):Z.add(U),d.value=Array.from(Z),Kpe(d.value)}async function F(U,Z,ce){const fe=ce??e.activeSessionId;if(!fe)return;const oe=i.value==="idle"&&!r.has(fe),Y=`msg_skill_opt_${Date.now().toString(36)}`,X=oe?Yv(fe):void 0;if(oe){r.add(fe),e.sendingBySession={...e.sendingBySession,[fe]:!0};const le={id:Y,sessionId:fe,role:"user",content:[{type:"text",text:`/${U}${Z?` ${Z}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:U,skillArgs:Z}}};c(fe,He=>[...He,le])}try{await ft().activateSkill(fe,U,Z)}catch(le){oe&&(r.delete(fe),e.sendingBySession={...e.sendingBySession,[fe]:!1},c(fe,He=>He.filter(de=>de.id!==Y))),n("activateSkill",le,{sessionId:fe})}finally{X!==void 0&&Zv(fe,X)}}async function S(U){try{await ft().addProvider(U),await Promise.all([_(),L()])}catch(Z){n("addProvider",Z)}}async function I(U){try{await ft().deleteProvider(U),await Promise.all([_(),L()])}catch(Z){n("deleteProvider",Z)}}async function R(U){try{const Z=await ft().refreshProvider(U);for(const ce of Z.failed)n("refreshProvider",new Error(ce.reason),{message:ce.provider});await Promise.all([_(),L()])}catch(Z){n("refreshProvider",Z)}}async function B(){try{const U=await ft().refreshAllProviders();for(const Z of U.failed)n("refreshAllProviders",new Error(Z.reason),{message:Z.provider});await Promise.all([_(),L()])}catch(U){n("refreshAllProviders",U)}}async function P(){try{return await ft().startOAuthLogin()}catch{return null}}async function z(){try{return await ft().pollOAuthLogin()}catch{return null}}async function W(){try{await ft().cancelOAuthLogin()}catch{}}function ee(U){const Z=g(U);o({thinking:Z}),Z!==void 0&&v(Z)}return{models:u,starredModelIds:d,providers:p,draftModel:m,skillsBySession:f,skillsByWorkspace:h,loadSkillsForSession:y,loadSkillsForWorkspace:M,loadModels:L,refreshOAuthProviderModels:$,loadProviders:_,setModel:E,toggleStarModel:N,activateSkill:F,addProvider:S,deleteProvider:I,refreshProvider:R,refreshAllProviders:B,startOAuthLogin:P,pollOAuthLogin:z,cancelOAuthLogin:W,setThinking:ee}}const O5="kimiWeb.compaction",Ype=/^read[_-]?media(?:file)?$/i,Zpe=/^data:([^;]+);base64,(.*)$/s,Qpe=/^<(image|video|audio)\s+path="([^"]+)">$/,Xpe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Jpe=/Mime type:\s*([^.\s]+)/i,eme=/Size:\s*(\d+)\s*bytes/i,tme=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,nme="<system>Image compressed to fit model limits:",sme=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function ome(e){return e.includes(nme)?e.replace(sme,""):e}function ime(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function rme(e){const t=Xpe.exec(e.trim());return t?{kind:t[1],path:ime(t[2])}:null}const lme=/^f_[A-Za-z0-9]{10,}$/;function ame(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return lme.test(s)?s:void 0}function cme(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 ume(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 dme(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 fme(e,t){if(!Ype.test(e))return;const n=ume(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=Qpe.exec(h);p&&(o=p[1],s=p[2]);const m=Jpe.exec(h);m?.[1]&&(i=m[1]);const x=eme.exec(h);x?.[1]&&(r=Number(x[1]));const k=tme.exec(h);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=dme(d);f&&(a=f)}if(a===null)return;const c=Zpe.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=cme(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function hme(e){if(e!=null){if(typeof e=="string")return e.split(`
306
+ `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
307
+ `));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
308
+ `)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
309
+ `)):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 pme(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 mme(e,t){const n=e.split(`
310
+ `),s=t.split(`
311
+ `),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 gme(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:mme(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 vme(e){const t=`<prompt>
312
+ `,n=`
313
+ </prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):yme(e)}function yme(e){const t=e.split(`
314
+ `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
315
+ `):e}function kme(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function bme(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
316
+ `);return vme(t)}function xme(e,t){const n=e.metadata?.origin??{},s=bme(e);return t==="cron_missed"?{text:s,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:s,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function _me(e,t,n){const{text:s,cron:o}=xme(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function wme(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 Sme(e){return e.metadata?.origin?.kind==="compaction_summary"}function Cme(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Ame(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 Mme(e){let t="",n="";const s=[],o=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?s.push(i.toolCallId):o.push(JSON.stringify(i));return s.sort(),o.sort(),{text:t,thinking:n,toolIds:s,rest:o}}function Eme(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function R5(e,t,n,s=!0,o={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!s)for(let m=0;m<p.tools.length;m++){const x=p.tools[m];if(x.status!=="running")continue;const k={...x,status:"ok"};p.tools[m]=k;const g=p.blocks.find(v=>v.kind==="tool"&&v.tool.id===k.id);g&&g.kind==="tool"&&(g.tool=k)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
317
+ `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
318
+ `):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const m of p)if(m.type==="text"){if(m.text){h.textParts.push(m.text);const x=h.blocks.at(-1);x&&x.kind==="text"?x.text+=`
319
+ `+m.text:h.blocks.push({kind:"text",text:m.text})}}else if(m.type==="thinking"){if(m.thinking){h.thinkingParts.push(m.thinking);const x=h.blocks.at(-1);x&&x.kind==="thinking"?x.thinking+=`
320
+ `+m.thinking:h.blocks.push({kind:"thinking",thinking:m.thinking})}}else if(m.type==="toolUse"){const x=l.get(m.toolCallId),k={id:m.toolCallId,name:m.toolName,arg:typeof m.input=="string"?m.input:JSON.stringify(m.input),status:"running",output:m.outputLines,planPath:m.toolName==="ExitPlanMode"?o[m.toolCallId]?.path:void 0};h.tools.push(k),h.blocks.push({kind:"tool",tool:k}),x&&(h.approval=gme(x),h.approvalId=x.approvalId)}else if(m.type==="toolResult"){const x=h.tools.findIndex(k=>k.id===m.toolCallId);if(x!==-1){const k=h.tools[x],g={...k,status:m.isError?"error":"ok",output:hme(m.output),media:m.isError?void 0:fme(k.name,m.output)};g.name==="ExitPlanMode"&&!g.planPath&&(g.planPath=Ame(g.output)),h.tools[x]=g;const v=h.blocks.find(y=>y.kind==="tool"&&y.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}}function d(h,p){for(const m of p){if(m.type!=="toolUse"||!m.outputLines?.length)continue;const x=h.tools.findIndex(y=>y.id===m.toolCallId);if(x===-1)continue;const k=h.tools[x];if(k.output!==void 0)continue;const g={...k,output:m.outputLines};h.tools[x]=g;const v=h.blocks.find(y=>y.kind==="tool"&&y.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,m=h.source;if(m.kind==="url")return{url:m.url,kind:p};if(m.kind==="base64")return{url:`data:${m.mediaType};base64,${m.data}`,kind:p};if(m.kind==="file"&&n)return{url:n(m.fileId),kind:p,fileId:m.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(Sme(h)){c();const g=h.metadata?.[O5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(v=>v.type==="text").map(v=>v.text).join(`
321
+ `),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(h.role==="user"){const g=kme(h);if(c(),g!==void 0){i.push(_me(h,r++,g));continue}if(!wme(h))continue;const v=h.metadata?.origin,y=v?.kind==="skill_activation"&&v?.trigger==="user-slash",M=v?.kind==="plugin_command"&&v?.trigger==="user-slash",L=[],$=[];for(const _ of h.content){if(_.type==="text")if(y)L.push(v.skillArgs??"");else if(M)L.push(v.commandArgs??"");else{const N=rme(_.text);if(N&&(N.kind==="video"||N.kind==="image")&&n){const S=ame(N.path);if(S){$.push({url:n(S),kind:N.kind,alt:S,fileId:S});continue}}const F=ome(_.text);if(F!==_.text&&F.trim().length===0)continue;L.push(F)}const E=f(_);E&&$.push({url:E.url,kind:E.kind,alt:_.type==="file"?_.name:void 0,fileId:E.fileId})}i.push({id:h.id,role:"user",no:r++,text:L.join(`
322
+ `),images:$.length>0?$:void 0,skillActivation:y?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:M?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;Cme(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const x=a;if(x===null)continue;const k=Mme(h.content);if(x.promptId!==void 0&&x.foldedSigs.some(g=>Eme(g,k))){d(x,h.content);continue}x.foldedSigs.push(k),u(x,h.content)}return c(!0),i}function Tme(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=Q({}),l=D(()=>{const E=e.activeSessionId;if(!E)return null;const N=r.value[E];return N?{parentId:E,agentId:N.agentId}:null}),a=D(()=>l.value?.parentId??null),c=D(()=>l.value!==null),u=D(()=>{const E=l.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),d=D(()=>{const E=l.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(N=>N.id===E.agentId&&N.status==="running"):!1}),f=D(()=>{const E=l.value;if(!E)return[];const N=e.sideChatMessagesByAgent[E.agentId]??[];return R5(N,[],F=>ft().getFileUrl(F),d.value)});function h(E,N){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:N(e.sideChatMessagesByAgent[E]??[])}}function p(E,N){h(E,F=>[...F,N])}function m(E){h(E,N=>{const F=[...N].reverse().findIndex(I=>I.role==="user");if(F===-1)return N;const S=N.length-1-F;return N.filter((I,R)=>R!==S)})}function x(E,N){h(E,F=>{const S=[...F];for(let I=S.length-1;I>=0;I-=1){const R=S[I];if(R.role==="user")return S[I]={...R,promptId:R.promptId??N},S}return F})}function k(E,N,F){F&&h(E,S=>{const I=S.at(-1);if(I?.role==="assistant"){const R=I.content[0],B=R?.type==="text"?R.text:"";return[...S.slice(0,-1),{...I,content:[{type:"text",text:`${B}${F}`}]}]}return[...S,{id:s(),sessionId:N,role:"assistant",content:[{type:"text",text:F}],createdAt:new Date().toISOString()}]})}function g(E,N,F){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!F)return;const I=(e.sideChatMessagesByAgent[E]??[]).at(-1);(I?.role==="assistant"&&I.content[0]?.type==="text"?I.content[0].text:"").trim().length>0||k(E,N,F)}async function v(E){const N=e.activeSessionId;N&&await y(N,E)}async function y(E,N){if(!r.value[E]){let F;try{({agentId:F}=await ft().startBtw(E))}catch(S){n("openSideChat",S,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[F]:e.sideChatMessagesByAgent[F]??[]},r.value={...r.value,[E]:{agentId:F}},o(),i()?.markSideChannelAgent(F)}N&&N.trim()&&await M(E,N.trim())}async function M(E,N){const F=r.value[E],S=N.trim();if(!F||!S)return;const I=E,R=F.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!0};const B={id:s(),sessionId:I,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(R,B);try{const P=e.sessions.find(ee=>ee.id===I),z=(P?.model&&P.model.length>0?P.model:e.defaultModel)??void 0,W=await ft().submitPrompt(I,{content:[{type:"text",text:S}],agentId:R,model:z,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[I]??!1,swarmMode:e.swarmModeBySession[I]??!1});x(R,W.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],W.userMessageId]}}catch(P){n("sendSideChatPrompt",P,{sessionId:I}),m(R),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[R]:!1}}}function L(){const E=e.activeSessionId;if(!E)return;const{[E]:N,...F}=r.value;r.value=F}async function $(E){const N=l.value;N&&await M(N.parentId,E)}function _(E){if(!r.value[E])return;const{[E]:N,...F}=r.value;r.value=F}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:k,finishSideChatAgent:g,openSideChat:v,openSideChatOn:y,closeSideChat:L,sendSideChatPrompt:$,clearSideChatForSession:_}}const Nme="kimiWeb.optimisticUserMessage",KC="Sub Agent";function Ime(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function $me(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Lme(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 yg(e){return e.role==="user"&&e.metadata?.[Nme]===!0}function Fme(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function Ome(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const Rme=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function GC(e){let t="",n=0;for(const s of e.content)s.type==="text"?Rme.test(s.text.trim())?n+=1:t+=s.text:(s.type==="image"||s.type==="video"||s.type==="file")&&(n+=1);return{text:t,media:n}}function Bme(e,t){const n=GC(e),s=GC(t);return n.text===s.text&&n.media===s.media}function Dme(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(yg(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(yg(o)&&Ome(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(yg(o)&&Bme(o,t))return s}return-1}function Pme(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 Hme(e,t,n){const s=$me(e);switch(Lme(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"},[O5]: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"&&!Fme(t.message)){const a=Dme(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]=Pme(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],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===KC&&a.description!==KC?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground},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;s.goalVersionBySession[o]=(s.goalVersionBySession[o]??0)+1,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?An.global.t("warnings.errorLabel"):An.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 Wme(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function zme(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"||Na(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:Wme(a.status)}]:[]})}}return[]}const Ume=["queued","working","suspended","completed","failed"];function B5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function qme(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function jme(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:B5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,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=qme();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 Vme(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of Ume)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}function Kme(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const s=t.get(n.parentToolCallId)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:B5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,s)}for(const[n,s]of t)t.set(n,s.toSorted((o,i)=>o.swarmIndex-i.swarmIndex||o.id.localeCompare(i.id)));return t}const br=I5(),Zi=ype(),Ld=Ape(),D5=Lt.permission,P5=Lt.activeWorkspace,H5=Lt.thinking,W5=Lt.planMode,z5=Lt.swarmMode,U5=Lt.goalMode,YC=40401,q5=Lt.onboarded,Gme=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Vc(Lt.codeFont);Vc(Lt.theme);function Yme(){try{const e=rs(D5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Zme(e){try{gs(D5,e)}catch{}}function Qme(){try{const e=rs(H5);if(e&&Gme.test(e))return e}catch{}}function Xme(e){try{gs(H5,e)}catch{}}function kg(e){const t=rs(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 Xk(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);gs(e,JSON.stringify(n))}catch{}}function j5(){Xk(W5,Ce.planModeBySession)}function V5(){Xk(z5,Ce.swarmModeBySession)}function K5(){Xk(U5,Ce.goalModeBySession)}function Jme(){try{return rs(P5)}catch{return null}}const G5=Lt.hiddenWorkspaces;function e1e(){try{const e=rs(G5);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function t1e(e){try{gs(G5,JSON.stringify(e))}catch{}}function n1e(e){try{gs(P5,e)}catch{}}function s1e(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Ce=Ps({...Ime(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:Yme(),thinking:Qme(),planModeBySession:kg(W5),swarmModeBySession:kg(z5),goalModeBySession:kg(U5),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:$y(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Jme(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:e1e(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),zm=Ps({planMode:!1,swarmMode:!1,goalMode:!1});function Y5(e){Ce.sessions=e}function Um(e,t){Ce.sessions=Ce.sessions.map(n=>n.id===e?t(n):n)}function o1e(e){Ce.sessions=[e,...Ce.sessions.filter(t=>t.id!==e.id)]}function i1e(e){Ce.sessions=[...Ce.sessions,e]}function r1e(e){Ce.sessions=Ce.sessions.filter(t=>t.id!==e)}function Z5(){const e=Ce.activeSessionId;e&&Ce.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!1},Ly({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Lt.unread&&(Ce.unreadBySession=$y(),Z5())});function Qv(){if(ki===null||!ki.health().stale)return;Ls("ws:stale-reconnect",{sessionId:Ce.activeSessionId,status:"stale"}),wr("ws: stale socket on focus, reconnecting",{activeSessionId:Ce.activeSessionId}),ki.reconnect();const e=Ce.activeSessionId;e&&Bp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(Z5(),Qv())});typeof window<"u"&&(window.addEventListener("focus",Qv),window.addEventListener("online",Qv));function Jk(e){Ce.activeSessionId=e}function l1e(e){Ce.messagesBySession=e}function a1e(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t}}function Q5(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t(Ce.messagesBySession[e]??[])}}function c1e(e){const{[e]:t,...n}=Ce.messagesBySession;Ce.messagesBySession=n}function X5(e){ki?.unsubscribe(e),L1e(e),Op.flush(),r1e(e),c1e(e),delete Ce.approvalsBySession[e],delete Ce.questionsBySession[e],delete Ce.tasksBySession[e],delete Ce.goalBySession[e],delete Ce.gitStatusBySession[e],delete Ce.lastSeqBySession[e],delete Ce.compactionBySession[e],delete Ce.messagesLoadingMoreBySession[e],delete Ce.messagesHasMoreBySession[e],delete Ce.messagesLoadMoreErrorBySession[e],delete Xv[e],Rp.delete(e),Eh.delete(e),u8.delete(e),e2.delete(e),zpe(e),delete Ce.queuedBySession[e],delete Ce.promptIdBySession[e],delete Ce.sendingBySession[e],delete Ce.planModeBySession[e],delete Ce.swarmModeBySession[e],delete Ce.goalModeBySession[e],j5(),V5(),K5()}const J5=Q(null),e8=Q([]),t8=Q(!1),n8=Q(!1),s8=Q(null);async function Yd(e){let t;try{t=await ft().getSessionStatus(e)}catch{return}Um(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ce.swarmModeBySession={...Ce.swarmModeBySession,[e]:t.swarmMode},Ce.planModeBySession={...Ce.planModeBySession,[e]:t.planMode}}async function u1e(e){const t=Ce.goalVersionBySession[e]??0;let n;try{n=await ft().getSessionGoal(e)}catch{return}if((Ce.goalVersionBySession[e]??0)!==t)return;const s={...Ce.goalBySession};n===null||n.status==="complete"?delete s[e]:s[e]=n,Ce.goalBySession=s}function o8(e,t){const n=t??Ce.activeSessionId;return n?Promise.resolve(ft().updateSession(n,e)).then(()=>Yd(n)).catch(()=>{}):Promise.resolve()}const i8=Lt.conversationToc;function d1e(){try{const e=rs(i8);return e===null?!0:e==="true"}catch{return!0}}function f1e(e){try{gs(i8,e?"true":"false")}catch{}}const r8=Q(d1e());function h1e(e){r8.value=e,f1e(e)}function p1e(e){try{return rs(e)??""}catch{return""}}const l8=Q(p1e(q5)==="1");function m1e(e){l8.value=e;try{gs(q5,e?"1":"0")}catch{}}let ki=null,ZC=0;function a8(){return ZC+=1,`msg_opt_${Date.now().toString(36)}_${ZC}`}const e2=new Set;function g1e(e,t,n){const s={sessions:Ce.sessions,activeSessionId:Ce.activeSessionId,messagesBySession:Ce.messagesBySession,approvalsBySession:Ce.approvalsBySession,planReviewByToolCallId:Ce.planReviewByToolCallId,questionsBySession:Ce.questionsBySession,tasksBySession:Ce.tasksBySession,goalBySession:Ce.goalBySession,goalVersionBySession:Ce.goalVersionBySession,lastSeqBySession:Ce.lastSeqBySession,compactionBySession:Ce.compactionBySession,config:Ce.config,warnings:Ce.warnings},o=Hme(s,e,{sessionId:t,seq:n});Y5(o.sessions),Jk(o.activeSessionId),l1e(o.messagesBySession),Ce.approvalsBySession=o.approvalsBySession,Ce.planReviewByToolCallId=o.planReviewByToolCallId,Ce.questionsBySession=o.questionsBySession,Ce.tasksBySession=o.tasksBySession,Ce.goalBySession=o.goalBySession,Ce.goalVersionBySession=o.goalVersionBySession,Ce.lastSeqBySession=o.lastSeqBySession,Ce.compactionBySession=o.compactionBySession,Ce.config=o.config??null,Ce.warnings=o.warnings,e.type==="configChanged"&&(Ce.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(Nn.loadModels(),Nn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Ce.swarmModeBySession={...Ce.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Ce.planModeBySession={...Ce.planModeBySession,[e.sessionId]:e.planMode}))}function v1e(e,t){const n=Ce.lastSeqBySession[t.sessionId]??0;g1e(e,t.sessionId,t.seq);const s=to.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:o}=s,i=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&to.appendSideChatAssistantText(o,i,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?to.finishSideChatAgent(o,i):e.type==="taskProgress"&&e.taskId===o?to.appendSideChatAssistantText(o,i,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&to.finishSideChatAgent(o,i,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;Ce.promptIdBySession[o]!==e.message.promptId&&(Ce.promptIdBySession={...Ce.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Ce.activeSessionId&&br.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&t.seq>n&&D0e(e.sessionId,e.status),e.type==="questionRequested"&&P0e(e.sessionId,e.question),e.type==="approvalRequested"&&H0e(e.sessionId,e.approval)}const Op=zhe(({appEvent:e,meta:t})=>v1e(e,t),({appEvent:e})=>Hhe(e));function c8(){if(ki!==null||typeof WebSocket>"u")return;Ls("ws:connection",{status:"connecting"}),Ce.connection="connecting",ki=ft().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){pt.applyWorkspaceEvent(t);return}Op({appEvent:t,meta:n})},onResync(t,n,s){Ls("ws:resync",{sessionId:t,status:"required",seq:n}),Op.flush(),Rp.add(t),Bp.request(t)},onError(t,n,s){Ls("ws:error",{status:"failed",errorCode:t,fatal:s}),t2({severity:"error",title:An.global.t("warnings.wsTitle"),message:n,details:[Zn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Ls("ws:connection",{status:t?"connected":"disconnected"}),Ce.connected=t,Ce.connection=t?"connected":"disconnected",t&&(C1e(),pt.refreshServerMeta())}})}const Xv={},Rp=new Set,Eh=new Set,u8=new Set;function y1e(e){return $r(e)&&e.code===YC?!0:typeof e=="object"&&e!==null&&e.code===YC}function Zn(e,t){if(!(t==null||t===""))return{label:An.global.t(`warnings.details.${e}`),value:d8(t)}}function d8(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 k1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function b1e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function x1e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function _1e(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 w1e(e,t,n){const s=c5(t),o=$r(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Zn("operation",e),Zn("sessionId",n??Ce.activeSessionId),Zn("connection",Ce.connection),Zn("timestamp",_1e(i??Date.now()))];return s?l.push(Zn("duration",QC(r)),Zn("request",`${t.method} ${t.path}`),Zn("endpoint",t.url),Zn("requestId",t.requestId),Zn("phase",t.phase),Zn("timeout",`${t.timeoutMs}ms`),Zn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Zn("contentType",t.contentType),Zn("responsePreview",t.bodyPreview),Zn("cause",t.cause)):o?l.push(Zn("duration",QC(r)),Zn("code",t.code),Zn("requestId",t.requestId),Zn("message",t.message),Zn("details",t.details)):l.push(Zn("errorName",k1e(t)),Zn("message",b1e(t)??d8(t)),Zn("stack",x1e(t))),l.filter(a=>a!==void 0)}function S1e(e,t,n={}){const s=c5(t),o=$r(t),i=n.title??(s?An.global.t("warnings.daemonNetworkTitle"):o?An.global.t("warnings.daemonApiTitle"):An.global.t("warnings.operationFailedTitle")),r=n.message??(s?An.global.t("warnings.daemonNetworkMessage"):o?t.message:An.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:w1e(e,t,n.sessionId)}}function t2(e){Ce.warnings=[...Ce.warnings,e]}function C1e(){const e=An.global.t("warnings.wsTitle"),t=Ce.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Ce.warnings.length&&(Ce.warnings=t)}function qm(e,t,n){t2(S1e(e,t,n))}const A1e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function M1e(e){if(!$r(e))return;const t=A1e[e.code];return t?An.global.t(t):void 0}async function E1e(e){if(X5(e),Ce.activeSessionId!==e)return;const t=Ce.sessions[0];t?await pt.selectSession(t.id,{urlMode:"replace"}):(Jk(void 0),Ce.sessionLoading=!1,pt.writeSessionUrl(void 0,"replace"))}const XC=new Set;async function T1e(e){if(!XC.has(e)){XC.add(e);try{const t=await ft().getSessionWarnings(e),n=An.global.t("warnings.noteLabel");for(const s of t)t2(`${n}: ${s.message}`)}catch{}}}async function n2(e){const t=pt.localTurnStartState(e);try{const s=await ft().getSessionSnapshot(e);if(!Ce.sessions.some(a=>a.id===e))return"ok";Op.flush();const o=Ce.lastSeqBySession[e]??0,i=Xv[e];if(!(Rp.has(e)||Dp.has(e))&&i!==void 0&&i===s.epoch&&o>s.asOfSeq)return Eh.delete(e)||(Eh.add(e),Bp.request(e)),"ok";if(!pt.isLocalTurnSnapshotCurrent(e,t))return pt.afterLocalTurnStartsSettle(e,()=>{Bp.request(e)}),"ok";const l=Rv(s.session.usage);Um(e,a=>({...s.session,model:s.session.model&&s.session.model.length>0?s.session.model:a.model,usage:l?a.usage:s.session.usage})),a1e(e,Rhe(Ce.messagesBySession[e]??[],s.messages)),Ce.tasksBySession={...Ce.tasksBySession,[e]:Bhe(s.subagents,Ce.tasksBySession[e]??[])},Ce.messagesHasMoreBySession={...Ce.messagesHasMoreBySession,[e]:s.hasMoreMessages},Ce.approvalsBySession={...Ce.approvalsBySession,[e]:s.pendingApprovals};for(const a of s.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(Ce.planReviewByToolCallId={...Ce.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}return Ce.questionsBySession={...Ce.questionsBySession,[e]:s.pendingQuestions},Ce.lastSeqBySession={...Ce.lastSeqBySession,[e]:s.asOfSeq},Xv[e]=s.epoch,Rp.delete(e),Eh.delete(e),pt.handleSessionSnapshot(e,{inFlightTurn:s.inFlightTurn,status:s.session.status}),c8(),ki&&(ki.seedSnapshot(e,s),ki.subscribe(e,{seq:s.asOfSeq,epoch:s.epoch}),$1e(e)),Dp.delete(e),l&&Yd(e),T1e(e),"ok"}catch(n){return y1e(n)?(await E1e(e),"not-found"):(qm("getSessionSnapshot",n,{title:An.global.t("warnings.sessionSnapshotTitle"),message:An.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Bp=Dhe(n2);function N1e(e){return Object.prototype.hasOwnProperty.call(Ce.messagesBySession,e)}const I1e=4,xr=[],Dp=new Set;function $1e(e){const t=xr.indexOf(e);for(t!==-1&&xr.splice(t,1),xr.unshift(e);xr.length>I1e;){let n=-1;for(let o=xr.length-1;o>=0;o--)if(xr[o]!==Ce.activeSessionId){n=o;break}if(n===-1)break;const[s]=xr.splice(n,1);if(s===void 0)break;ki?.unsubscribe(s),Dp.add(s)}}function L1e(e){const t=xr.indexOf(e);t!==-1&&xr.splice(t,1),Dp.delete(e)}async function F1e(e){return n2(e)}function jm(e){if(!e||e.status!=="running")return!1;const t=e.id,n=to.sideChatTargetBySession.value[t]?.agentId,o=(Ce.tasksBySession[t]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Ce.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function s2(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return An.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)}mo`:`${Math.round(r/365)}y`}catch{return e}}const O1e=3e4,Fd=Q(0);let bg=null;function R1e(){bg===null&&(bg=setInterval(()=>{Fd.value=(Fd.value+1)%Number.MAX_SAFE_INTEGER},O1e),bg.unref?.())}function B1e(e,t){const n=e.split(`
323
+ `),s=t.split(`
324
+ `),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 D1e(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:B1e(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 P1e(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 H1e(e){const t=Ce.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function W1e(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=An.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=An.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??H1e(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 z1e=D(()=>{const e=Ce.sessions.find(n=>n.id===Ce.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ce.workspaceName,branch:t}}),U1e=D(()=>(Fd.value,Ce.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:s2(e.updatedAt,e.status),status:e.status,busy:jm(e)})))),q1e=D(()=>Ce.activeSessionId??""),j1e=D(()=>{const e=Ce.activeSessionId;if(e)return Nn.skillsBySession.value[e]??[];const t=Km.value;return t?Nn.skillsByWorkspace.value[t]??[]:[]}),V1e=D(()=>{const e=Ce.activeSessionId;return e?Ce.sendingBySession[e]??!1:!1}),K1e=D(()=>pt.isStartingFirstPrompt()),to=Tme(Ce,{pushOperationFailure:qm,nextOptimisticMsgId:a8,connectEventsIfNeeded:c8,getEventConn:()=>ki}),Zd=D(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=to.sideChatTargetBySession.value[e]?.agentId;return(Ce.tasksBySession[e]??[]).filter(n=>n.id!==t)}),f8=Tpe(Ce,Zd),G1e=D(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=new Set(Ce.sideChatUserMessageIdsBySession[e]??[]),n=(Ce.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Ce.approvalsBySession[e]??[];return R5(n,s,o=>ft().getFileUrl(o),Vm.value!=="idle",Ce.planReviewByToolCallId)}),Y1e=D(()=>(f8.taskClock.value,Zd.value.map(W1e))),h8=D(()=>jme(Zd.value)),Z1e=D(()=>Kme(Zd.value)),hc=D(()=>{const e=Ce.activeSessionId;return e?Ce.goalBySession[e]??null:null}),Q1e=D(()=>{const e=Ce.activeSessionId;return e?zme(Ce.messagesBySession[e]??[]):[]}),X1e=D(()=>{const e=Ce.activeSessionId;return e?Ce.compactionBySession[e]??null:null}),J1e=D(()=>Ce.connection),e0e=D(()=>Ce.loading),t0e=D(()=>Ce.sessionLoading),n0e=D(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadingMoreBySession[e]??!1:!1}),s0e=D(()=>{const e=Ce.activeSessionId;return e?Ce.messagesHasMoreBySession[e]??!1:!1}),o0e=D(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadMoreErrorBySession[e]??!1:!1}),i0e=D(()=>Ce.serverVersion),r0e=D(()=>Ce.backend),l0e=D(()=>Ce.dangerousBypassAuth);function a0e(){Ce.dangerousBypassAuth=!1}const c0e=D(()=>Ce.permission),u0e=D(()=>Ce.thinking),p8=D(()=>{const e=Ce.activeSessionId;return e?Ce.planModeBySession[e]??!1:zm.planMode}),d0e=D(()=>{const e=Ce.activeSessionId;return e?Ce.swarmModeBySession[e]??!1:zm.swarmMode}),f0e=D(()=>{const e=Ce.activeSessionId;return e?Ce.goalModeBySession[e]??!1:zm.goalMode}),h0e=D(()=>{const e=Vme(h8.value);return{plan:p8.value,goal:hc.value&&hc.value.status!=="complete"?{status:hc.value.status,turnsUsed:hc.value.turnsUsed,elapsedMs:hc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),p0e=D(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=ft();return(Ce.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)}))}))}),m0e=D(()=>Ce.warnings),g0e=D(()=>{const e=Ce.activeSessionId;return e?(Ce.questionsBySession[e]??[]).map(P1e):[]}),v0e=D(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:D1e(t),agentName:t.agentName})):[]}),Vm=D(()=>{const e=Ce.activeSessionId;if(!e)return"idle";if((Ce.approvalsBySession[e]??[]).length>0)return"awaiting-approval";if((Ce.questionsBySession[e]??[]).length>0)return"awaiting-question";const s=Ce.sessions.find(o=>o.id===e);return jm(s)?"running":"idle"}),Nn=Gpe(Ce,{pushOperationFailure:qm,refreshSessionStatus:Yd,persistSessionProfile:o8,activity:Vm,inFlightPromptSessions:e2,saveThinkingToStorage:Xme,updateSession:Um,updateSessionMessages:Q5}),Pp=D(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),y0e=D(()=>{const e=Ce.activeSessionId;return e?Ce.gitStatusBySession[e]?.pullRequest??null:null}),k0e=D(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Ce.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),b0e=D(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),m8=D(()=>{const e=Ce.sessions.find(r=>r.id===Ce.activeSessionId),t=Pp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Nn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Ce.defaultModel)??"—",o=Nn.models.value.find(r=>r.id===s)??Nn.models.value.find(r=>r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Ce.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Pp.value!==null}}),x0e=D(()=>e8.value),_0e=D(()=>Ce.sessions.find(t=>t.id===Ce.activeSessionId)?.usage.totalCostUsd??0),w0e=D(()=>Ce.authReady),S0e=D(()=>Ce.defaultModel),C0e=D(()=>Ce.managedProviderStatus),A0e=D(()=>Ce.config),M0e=D(()=>{const e=Ce.activeSessionId;if(!e)return{};const t=Ce.gitStatusBySession[e];return t?{...t.entries}:{}});function Yc(e){return Ce.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const o2=D(()=>Ohe({workspaces:Ce.workspaces,sessions:Ce.sessions,hiddenWorkspaceRoots:Ce.hiddenWorkspaceRoots,activeRoot:Ce.sessions.find(e=>e.id===Ce.activeSessionId)?.cwd,activeBranch:Pp.value?.branch??null,sessionsHasMoreByWorkspace:Ce.sessionsHasMoreByWorkspace})),Hp=Q(lI()),Zc=Q(aI()==="manual"?"manual":"recent");Qe(()=>[o2.value.map(e=>e.id).join("\0"),Ce.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=_I(n,Hp.value);s!==null&&(Hp.value=s,cA(s))});const Ma=D(()=>{const e=o2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:s1e(t.root,Ce.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Zc.value==="recent"){const t=new Map;for(const n of Ce.sessions){if(n.parentSessionId)continue;const s=Yc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return CI(e,t)}return wI(e,Hp.value)}),Km=D(()=>{const e=Ce.activeWorkspaceId,t=Ma.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Qe(Km,e=>{e&&(Object.prototype.hasOwnProperty.call(Nn.skillsByWorkspace.value,e)||Nn.loadSkillsForWorkspace(e))},{immediate:!0});const E0e=D(()=>{const e=Km.value;return e?Ma.value.find(t=>t.id===e)??null:null}),T0e=D(()=>{Fd.value;const e=new Set(Ma.value.map(n=>n.id)),t=new Map(Ma.value.map(n=>[n.id,n.name]));return Ce.sessions.filter(n=>!n.parentSessionId&&e.has(Yc(n))).map(n=>{const s=Yc(n);return{id:n.id,title:n.title,time:s2(n.updatedAt,n.status),status:n.status,busy:jm(n),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),N0e=D(()=>{Fd.value;const e=new Map;for(const t of Ce.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Yc(t),s={id:t.id,title:t.title,time:s2(t.updatedAt,t.status),status:t.status,busy:jm(t),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Ma.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ce.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ce.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Ce.sessionsInitialCountByWorkspace[t.id]??Gv}))});function I0e(e){Hp.value=e,cA(e),Zc.value!=="manual"&&(Zc.value="manual",uA("manual"))}function $0e(e){Zc.value!==e&&(Zc.value=e,uA(e))}const g8=D(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),L0e=D(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),F0e=D(()=>{const e={};for(const[t,n]of Object.entries(Ce.unreadBySession))n&&(e[t]=!0);return e}),O0e=D(()=>{const e={},t=g8.value;for(const n of Ce.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=Yc(n);e[o]=(e[o]??0)+s}return e}),R0e=D(()=>Ce.recentRoots),B0e=D(()=>Ce.availableOpenInApps),pt=jpe(Ce,{taskPoller:f8,sideChat:to,modelProvider:Nn,pushOperationFailure:qm,activity:Vm,inFlightPromptSessions:e2,sessionsKnownEmpty:u8,setSessions:Y5,updateSession:Um,upsertSessionFront:o1e,appendSession:i1e,forgetSession:X5,setActiveSessionId:Jk,updateSessionMessages:Q5,nextOptimisticMsgId:a8,getEventConn:()=>ki,syncSessionFromSnapshot:n2,reopenSession:F1e,hasLoadedMessages:N1e,refreshSessionStatus:Yd,refreshSessionGoal:u1e,persistSessionProfile:o8,mergedWorkspaces:o2,workspacesView:Ma,status:m8,workspaceIdForSession:Yc,savePermissionToStorage:Zme,savePlanModeToStorage:j5,saveSwarmModeToStorage:V5,saveGoalModeToStorage:K5,draftModes:zm,saveUnread:Ly,saveActiveWorkspaceToStorage:n1e,saveHiddenWorkspacesToStorage:t1e,goalErrorMessage:M1e,resetFastMoon:br.resetFastMoon,initialized:n8,connectIssue:s8,selectedDiffPath:J5,fileDiffLines:e8,fileDiffLoading:t8});function i2(e){return e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function D0e(e,t){const n=Ce.promptIdBySession[e];pt.finishPromptLocal(e),e===Ce.activeSessionId?(pt.loadGitStatus(e),Yd(e)):t==="idle"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!0},Ly({[e]:!0}));const s=(Ce.approvalsBySession[e]??[]).length>0,o=(Ce.questionsBySession[e]??[]).length>0;lpe(t,s,o)&&Zi.maybeNotifyCompletion(e,{isUserWatching:i2(e),sessionTitle:Ce.sessions.find(i=>i.id===e)?.title??"",promptId:n,onClick:()=>{pt.selectSession(e)}}),t==="idle"&&Ld.maybePlayCompletionSound()}function P0e(e,t){const n=t.questions[0],s=n?.header?.trim()??"",o=n?.question?.trim()??"",i=s&&o?`${s}: ${o}`:o||s;Zi.maybeNotifyQuestion({isUserWatching:i2(e),sessionTitle:Ce.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{pt.selectSession(e)}}),Ld.maybePlayQuestionSound()}function H0e(e,t){Zi.maybeNotifyApproval({isUserWatching:i2(e),sessionTitle:Ce.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{pt.selectSession(e)}}),Ld.maybePlayApprovalSound()}function r2(){return R1e(),{workspace:z1e,sessions:U1e,activeSessionId:q1e,workspacesView:Ma,workspaceSortMode:Zc,visibleWorkspace:E0e,activeWorkspaceId:Km,sessionsForView:T0e,workspaceGroups:N0e,attentionBySession:g8,pendingBySession:L0e,attentionByWorkspace:O0e,unreadBySession:F0e,recentRoots:R0e,turns:G1e,tasks:Y1e,activeAppTasks:Zd,todos:Q1e,goal:hc,swarms:h8,swarmMembersByToolCallId:Z1e,activationBadges:h0e,compaction:X1e,status:m8,sessionCost:_0e,fileDiff:x0e,selectedDiffPath:J5,fileDiffLoading:t8,changes:k0e,gitInfo:Pp,gitDiffStats:b0e,activePullRequest:y0e,changesByPath:M0e,pendingApprovals:v0e,availableOpenInApps:B0e,connection:J1e,loading:e0e,sessionLoading:t0e,loadingMoreMessages:n0e,hasMoreMessages:s0e,loadMoreMessagesError:o0e,serverVersion:i0e,backend:r0e,dangerousBypassAuth:l0e,clearDangerousBypassAuth:a0e,initialized:n8,connectIssue:s8,permission:c0e,thinking:u0e,planMode:p8,swarmMode:d0e,goalMode:f0e,queued:p0e,warnings:m0e,questions:g0e,activity:Vm,isSending:V1e,isStartingFirstPrompt:K1e,fastMoon:br.fastMoon,models:Nn.models,starredModelIds:Nn.starredModelIds,providers:Nn.providers,uiFontSize:br.uiFontSize,setUiFontSize:br.setUiFontSize,conversationToc:r8,setConversationToc:h1e,colorScheme:br.colorScheme,setColorScheme:br.setColorScheme,accent:br.accent,setAccent:br.setAccent,notifyOnComplete:Zi.notifyOnComplete,notifyOnQuestion:Zi.notifyOnQuestion,notifyOnApproval:Zi.notifyOnApproval,notifyPermission:Zi.notifyPermission,setNotifyOnComplete:Zi.setNotifyOnComplete,setNotifyOnQuestion:Zi.setNotifyOnQuestion,setNotifyOnApproval:Zi.setNotifyOnApproval,soundOnComplete:Ld.soundOnComplete,setSoundOnComplete:Ld.setSoundOnComplete,onboarded:l8,setOnboarded:m1e,load:pt.load,selectSession:pt.selectSession,clearActiveSession:pt.clearActiveSession,loadOlderMessages:pt.loadOlderMessages,loadWorkspaces:pt.loadWorkspaces,loadMoreSessions:pt.loadMoreSessions,loadAllSessions:pt.loadAllSessions,selectWorkspace:pt.selectWorkspace,openWorkspace:pt.openWorkspace,openWorkspaceDraft:pt.openWorkspaceDraft,startSessionAndSendPrompt:pt.startSessionAndSendPrompt,startSessionAndActivateSkill:pt.startSessionAndActivateSkill,startSessionAndOpenSideChat:pt.startSessionAndOpenSideChat,addWorkspaceByPath:pt.addWorkspaceByPath,browseFs:pt.browseFs,getFsHome:pt.getFsHome,sendPrompt:pt.sendPrompt,steerPrompt:pt.steerPrompt,sideChatVisible:to.sideChatVisible,sideChatSessionId:to.sideChatSessionId,sideChatTurns:to.sideChatTurns,sideChatRunning:to.sideChatRunning,sideChatSending:to.sideChatSending,openSideChat:to.openSideChat,closeSideChat:to.closeSideChat,sendSideChatPrompt:to.sendSideChatPrompt,uploadImage:pt.uploadImage,abortCurrentPrompt:pt.abortCurrentPrompt,respondApproval:pt.respondApproval,respondQuestion:pt.respondQuestion,dismissQuestion:pt.dismissQuestion,pendingQuestionActions:pt.pendingQuestionActions,pendingApprovalActions:pt.pendingApprovalActions,cancelTask:pt.cancelTask,setPermission:pt.setPermission,setThinking:Nn.setThinking,setPlanMode:pt.setPlanMode,togglePlanMode:pt.togglePlanMode,setSwarmMode:pt.setSwarmMode,toggleSwarmMode:pt.toggleSwarmMode,setGoalMode:pt.setGoalMode,toggleGoalMode:pt.toggleGoalMode,createGoal:pt.createGoal,controlGoal:pt.controlGoal,enqueue:pt.enqueue,dismissWarning:pt.dismissWarning,renameSession:pt.renameSession,renameWorkspace:pt.renameWorkspace,deleteWorkspace:pt.deleteWorkspace,reorderWorkspaces:I0e,setWorkspaceSortMode:$0e,archiveSession:pt.archiveSession,exportSession:pt.exportSession,restoreSession:pt.restoreSession,loadArchivedSessions:pt.loadArchivedSessions,compact:pt.compact,forkSession:pt.forkSession,undo:pt.undo,unqueue:pt.unqueue,reorderQueue:pt.reorderQueue,searchFiles:pt.searchFiles,loadGitStatus:pt.loadGitStatus,loadFileDiff:pt.loadFileDiff,clearFileDiff:pt.clearFileDiff,listDir:pt.listDir,readFileContent:pt.readFileContent,getFileDownloadUrl:pt.getFileDownloadUrl,openWorkspaceFile:pt.openWorkspaceFile,openInApp:pt.openInApp,revealWorkspaceFile:pt.revealWorkspaceFile,resolveImageUrl:pt.resolveImageUrl,refreshOAuthProviderModels:Nn.refreshOAuthProviderModels,loadModels:Nn.loadModels,loadProviders:Nn.loadProviders,skills:j1e,activateSkill:Nn.activateSkill,setModel:Nn.setModel,toggleStarModel:Nn.toggleStarModel,addProvider:Nn.addProvider,deleteProvider:Nn.deleteProvider,refreshProvider:Nn.refreshProvider,refreshAllProviders:Nn.refreshAllProviders,authReady:w0e,defaultModel:S0e,managedProviderStatus:C0e,config:A0e,updateConfig:pt.updateConfig,checkAuth:pt.checkAuth,startOAuthLogin:Nn.startOAuthLogin,pollOAuthLogin:Nn.pollOAuthLogin,cancelOAuthLogin:Nn.cancelOAuthLogin,logout:pt.logout}}const v8=Ye({__name:"LanguageSwitcher",setup(e){const{locale:t}=Tt(),n=pA.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&mA(o)}return(o,i)=>(b(),ke(go,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),W0e=["aria-checked","aria-label","disabled"],z0e=Ye({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),T("button",{class:Pe(["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]=[w("span",{class:"ui-switch__thumb"},null,-1)])],10,W0e))}}),hr=dt(z0e,[["__scopeId","data-v-dbe22dc4"]]),U0e=["aria-label"],q0e=["aria-selected","onClick"],j0e={class:"body"},V0e={class:"panel"},K0e={class:"sec"},G0e={class:"sec-title"},Y0e={class:"row"},Z0e={class:"rlabel"},Q0e={class:"row"},X0e={class:"rlabel"},J0e={class:"row"},ege={class:"rlabel"},tge={class:"num-field"},nge=["value","aria-label"],sge={class:"row"},oge={class:"rlabel"},ige={class:"row"},rge={class:"rlabel"},lge={class:"hint"},age={class:"sec"},cge={class:"sec-title"},uge={class:"row"},dge={class:"rlabel"},fge={key:0,class:"hint"},hge={class:"row"},pge={class:"rlabel"},mge={key:0,class:"hint"},gge={class:"row"},vge={class:"rlabel"},yge={key:0,class:"hint"},kge={class:"row"},bge={class:"rlabel"},xge={class:"panel"},_ge={class:"sec"},wge={class:"sec-title"},Sge={class:"row"},Cge={class:"rlabel"},Age={key:0,class:"rvalue"},Mge={class:"actions"},Ege={class:"panel"},Tge={class:"sec"},Nge={class:"sec-head"},Ige={class:"sec-title"},$ge={key:0,class:"saving"},Lge={class:"row"},Fge={class:"rlabel"},Oge={class:"hint"},Rge={key:0,class:"select-wrap"},Bge={key:0,value:"",disabled:""},Dge=["label"],Pge=["value"],Hge={key:1,class:"rvalue mono"},Wge={class:"row"},zge={class:"rlabel"},Uge={class:"hint"},qge={class:"row"},jge={class:"rlabel"},Vge={class:"hint"},Kge={class:"row"},Gge={class:"rlabel"},Yge={class:"hint"},Zge={class:"row"},Qge={class:"rlabel"},Xge={class:"hint"},Jge={key:1,class:"empty-config"},eve={class:"panel"},tve={class:"sec"},nve={class:"sec-title"},sve={class:"row"},ove={class:"rlabel"},ive={class:"rvalue mono"},rve={class:"row"},lve={class:"rlabel"},ave={class:"rvalue mono"},cve={class:"row"},uve={class:"rlabel"},dve={class:"rvalue mono"},fve={key:0,class:"row"},hve={class:"rlabel"},pve={class:"hint"},mve={class:"hint"},gve={class:"row"},vve={class:"rlabel"},yve={key:0,class:"hint"},kve={class:"panel"},bve={class:"panel-head"},xve={class:"panel-title"},_ve={class:"panel-desc"},wve={class:"archive-toolbar"},Sve={class:"archive-search"},Cve=["placeholder"],Ave={value:"all"},Mve=["value"],Eve={key:0,class:"archive-empty"},Tve={key:0,class:"archive-list"},Nve={class:"archive-workspace"},Ive={class:"path"},$ve={class:"count"},Lve={class:"setting-card"},Fve={class:"archive-meta"},Ove={class:"archive-name"},Rve={class:"archive-time"},Bve={key:1,class:"archive-empty"},Dve=100,Pve=Ye({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=mI(),a=D(()=>s.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=Q(null);Dk(d);function f(oe){oe.key==="Escape"&&o("close")}yn(()=>document.addEventListener("keydown",f)),Sn(()=>document.removeEventListener("keydown",f));function h(){o5()}const p=D(()=>{const oe=new Map;for(const Y of s.models??[])oe.set(Y.id,{id:Y.id,label:Y.displayName??Y.model??Y.id,provider:Y.provider});for(const[Y,X]of Object.entries(s.config?.models??{})){if(oe.has(Y))continue;const le=k(X);oe.set(Y,{id:Y,label:g(Y,X,le),provider:le??Y})}return Array.from(oe.values())}),m=D(()=>{const oe=new Map;for(const Y of p.value){const X=oe.get(Y.provider)??[];X.push(Y),oe.set(Y.provider,X)}for(const Y of oe.values())Y.sort((X,le)=>X.label.localeCompare(le.label));return Array.from(oe.entries()).toSorted(([Y],[X])=>Y.localeCompare(X)).map(([Y,X])=>({provider:Y,options:X}))}),x=D(()=>{const oe=s.config?.defaultPermissionMode;return oe==="auto"||oe==="yolo"||oe==="manual"?oe:"manual"});function k(oe){if(!oe||typeof oe!="object")return;const Y=oe;return typeof Y.provider=="string"?Y.provider:void 0}function g(oe,Y,X){if(!Y||typeof Y!="object")return oe;const le=Y,He=typeof le.model=="string"?le.model:void 0,de=X??k(Y);return He&&de?`${oe} (${de}/${He})`:He?`${oe} (${He})`:oe}function v(oe){return oe===!0}function y(oe){!oe||oe===s.config?.defaultModel||o("updateConfig",{defaultModel:oe})}function M(oe){oe!==x.value&&o("updateConfig",{defaultPermissionMode:oe})}function L(oe){const Y=s.config?.[oe];o("updateConfig",{[oe]:!v(Y)})}function $(){const oe=s.config?.thinking;return!oe||typeof oe!="object"?!0:oe.enabled!==!1}function _(){o("updateConfig",{thinking:{enabled:!$()}})}function E(){const oe=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!oe})}function N(oe){i.value=oe}const F=r2(),S=Q([]),I=Q(!1),R=Q(!1),B=Q(""),P=Q("all"),z=Q("archived-desc");async function W(){if(!(I.value||R.value)){I.value=!0;try{const oe=[];let Y;for(;;){const X=await F.loadArchivedSessions({beforeId:Y,pageSize:Dve});if(oe.push(...X.items),!X.hasMore||X.items.length===0)break;const le=X.items.at(-1)?.id;if(le===void 0)break;Y=le}S.value=oe,R.value=!0}catch(oe){console.warn("loadAllArchived failed",oe)}finally{I.value=!1}}}Qe(i,oe=>{oe==="archived"&&!R.value&&W()});const ee=D(()=>{const oe=new Set;for(const Y of S.value)oe.add(Y.cwd);return Array.from(oe).sort((Y,X)=>Y.localeCompare(X))}),U=D(()=>{const oe=B.value.trim().toLowerCase();let Y=S.value.filter(X=>X.archived===!0);return P.value!=="all"&&(Y=Y.filter(X=>X.cwd===P.value)),oe&&(Y=Y.filter(X=>X.title.toLowerCase().includes(oe))),Y=Y.slice(),z.value==="archived-desc"?Y.sort((X,le)=>le.updatedAt.localeCompare(X.updatedAt)):z.value==="created-desc"?Y.sort((X,le)=>le.createdAt.localeCompare(X.createdAt)):Y.sort((X,le)=>X.title.localeCompare(le.title,"zh")),Y}),Z=D(()=>{const oe=new Map;for(const Y of U.value){const X=oe.get(Y.cwd)??[];X.push(Y),oe.set(Y.cwd,X)}return Array.from(oe.entries()).map(([Y,X])=>({cwd:Y,items:X}))});async function ce(oe){await F.restoreSession(oe)&&(S.value=S.value.filter(X=>X.id!==oe))}function fe(oe){const Y=new Date(oe);if(Number.isNaN(Y.getTime()))return oe;const X=le=>String(le).padStart(2,"0");return`${Y.getFullYear()}-${X(Y.getMonth()+1)}-${X(Y.getDate())} ${X(Y.getHours())}:${X(Y.getMinutes())}`}return(oe,Y)=>(b(),ke(Hr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:Y[19]||(Y[19]=X=>o("close"))},{default:Me(()=>[w("div",{ref_key:"dialogRef",ref:d,class:"sd"},[w("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(b(),T(Be,null,st(r,X=>w("button",{key:X.id,type:"button",class:Pe(["tab",{on:i.value===X.id}]),role:"tab","aria-selected":i.value===X.id,onClick:le=>N(X.id)},O(C(n)(X.labelKey)),11,q0e)),64))],8,U0e),w("div",j0e,[Ln(w("section",V0e,[w("section",K0e,[w("h3",G0e,O(C(n)("settings.appearance")),1),w("div",Y0e,[w("span",Z0e,O(C(n)("theme.colorSchemeLabel")),1),ie(go,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":Y[0]||(Y[0]=X=>o("setColorScheme",X))},null,8,["model-value","options"])]),w("div",Q0e,[w("span",X0e,O(C(n)("theme.accentLabel")),1),ie(go,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":Y[1]||(Y[1]=X=>o("setAccent",X))},null,8,["model-value","options"])]),w("div",J0e,[w("span",ege,O(C(n)("settings.uiFontSize")),1),w("label",tge,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:Y[2]||(Y[2]=X=>o("setUiFontSize",Number(X.target.value)))},null,40,nge),Y[20]||(Y[20]=w("span",{class:"num-unit"},"px",-1))])]),w("div",sge,[w("span",oge,O(C(n)("sidebar.language")),1),ie(v8)]),w("div",ige,[w("span",rge,[Xe(O(C(n)("settings.conversationToc"))+" ",1),w("span",lge,O(C(n)("settings.conversationTocHint")),1)]),ie(hr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":Y[3]||(Y[3]=X=>o("setConversationToc",X))},null,8,["model-value","label"])])]),w("section",age,[w("h3",cge,O(C(n)("settings.notifications")),1),w("div",uge,[w("span",dge,[Xe(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(b(),T("span",fge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(hr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Y[4]||(Y[4]=X=>o("setNotify",X))},null,8,["model-value","disabled","label"])]),w("div",hge,[w("span",pge,[Xe(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(b(),T("span",mge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(hr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Y[5]||(Y[5]=X=>o("setNotifyQuestion",X))},null,8,["model-value","disabled","label"])]),w("div",gge,[w("span",vge,[Xe(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(b(),T("span",yge,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(hr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":Y[6]||(Y[6]=X=>o("setNotifyApproval",X))},null,8,["model-value","disabled","label"])]),w("div",kge,[w("span",bge,O(C(n)("settings.soundOnComplete")),1),ie(hr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":Y[7]||(Y[7]=X=>o("setSound",X))},null,8,["model-value","label"])])])],512),[[pi,i.value==="general"]]),Ln(w("section",xge,[w("section",_ge,[w("h3",wge,O(C(n)("settings.account")),1),w("div",Sge,[w("span",Cge,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(Yt,{text:e.accountModel},{default:Me(()=>[e.authReady&&e.accountModel?(b(),T("span",Age,O(e.accountModel),1)):re("",!0)]),_:1},8,["text"])]),w("div",Mge,[ie(Bt,{variant:"secondary",size:"sm",onClick:Y[8]||(Y[8]=X=>{o("openOnboarding"),o("close")})},{default:Me(()=>[Xe(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(b(),ke(Bt,{key:0,variant:"danger-soft",size:"sm",onClick:Y[9]||(Y[9]=X=>o("logout"))},{default:Me(()=>[Xe(O(C(n)("sidebar.signOut")),1)]),_:1})):(b(),ke(Bt,{key:1,variant:"primary",size:"sm",onClick:Y[10]||(Y[10]=X=>o("login"))},{default:Me(()=>[Xe(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[pi,i.value==="account"]]),Ln(w("section",Ege,[w("section",Tge,[w("div",Nge,[w("h3",Ige,O(C(n)("settings.agentDefaults")),1),e.configSaving?(b(),T("span",$ge,O(C(n)("settings.saving")),1)):re("",!0)]),e.config?(b(),T(Be,{key:0},[w("div",Lge,[w("span",Fge,[Xe(O(C(n)("settings.defaultModel"))+" ",1),w("span",Oge,O(C(n)("settings.defaultModelHint")),1)]),m.value.length>0?(b(),T("div",Rge,[ie(Vv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":y},{default:Me(()=>[e.config.defaultModel?re("",!0):(b(),T("option",Bge,O(C(n)("settings.noDefaultModel")),1)),(b(!0),T(Be,null,st(m.value,X=>(b(),T("optgroup",{key:X.provider,label:X.provider},[(b(!0),T(Be,null,st(X.options,le=>(b(),T("option",{key:le.id,value:le.id},O(le.label),9,Pge))),128))],8,Dge))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(b(),T("span",Hge,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),w("div",Wge,[w("span",zge,[Xe(O(C(n)("settings.defaultPermission"))+" ",1),w("span",Uge,O(C(n)("settings.defaultPermissionHint")),1)]),ie(go,{"model-value":x.value,options:c.map(X=>({value:X,label:C(n)(u[X])})),"onUpdate:modelValue":Y[11]||(Y[11]=X=>M(X))},null,8,["model-value","options"])]),w("div",qge,[w("span",jge,[Xe(O(C(n)("settings.defaultThinking"))+" ",1),w("span",Vge,O(C(n)("settings.defaultThinkingHint")),1)]),ie(hr,{"model-value":$(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":Y[12]||(Y[12]=X=>_())},null,8,["model-value","disabled","label"])]),w("div",Kge,[w("span",Gge,[Xe(O(C(n)("settings.defaultPlanMode"))+" ",1),w("span",Yge,O(C(n)("settings.defaultPlanModeHint")),1)]),ie(hr,{"model-value":v(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Y[13]||(Y[13]=X=>L("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),w("div",Zge,[w("span",Qge,[Xe(O(C(n)("settings.mergeSkills"))+" ",1),w("span",Xge,O(C(n)("settings.mergeSkillsHint")),1)]),ie(hr,{"model-value":v(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":Y[14]||(Y[14]=X=>L("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(b(),T("div",Jge,O(C(n)("settings.configUnavailable")),1))])],512),[[pi,i.value==="agent"]]),Ln(w("section",eve,[w("section",tve,[w("h3",nve,O(C(n)("settings.advanced")),1),w("div",sve,[w("span",ove,O(C(n)("sidebar.daemon")),1),w("span",ive,O(C(l)),1)]),w("div",rve,[w("span",lve,O(C(n)("settings.backend")),1),w("span",ave,O(a.value),1)]),w("div",cve,[w("span",uve,O(C(n)("settings.serverVersion")),1),w("span",dve,O(e.serverVersion||"-"),1)]),e.config?(b(),T("div",fve,[w("span",hve,[Xe(O(C(n)("settings.telemetry"))+" ",1),w("span",pve,O(C(n)("settings.telemetryHint")),1),w("span",mve,O(C(n)("settings.telemetryRestartHint")),1)]),ie(hr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":Y[15]||(Y[15]=X=>E())},null,8,["model-value","disabled","label"])])):re("",!0),w("div",gve,[w("span",vve,[Xe(O(C(n)("settings.exportLog"))+" ",1),C(Bi)()?re("",!0):(b(),T("span",yve,O(C(n)("settings.logHint")),1))]),ie(Bt,{variant:"secondary",size:"sm",onClick:h},{default:Me(()=>[Xe(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[pi,i.value==="advanced"]]),Ln(w("section",kve,[w("div",bve,[Y[21]||(Y[21]=w("div",{class:"panel-kicker"},"Archived sessions",-1)),w("h4",xve,O(C(n)("settings.archivedTitle")),1),w("p",_ve,O(C(n)("settings.archivedDesc")),1)]),w("div",wve,[w("label",Sve,[Y[22]||(Y[22]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("circle",{cx:"11",cy:"11",r:"7"}),w("path",{d:"m21 21-4.3-4.3"})],-1)),Ln(w("input",{"onUpdate:modelValue":Y[16]||(Y[16]=X=>B.value=X),placeholder:C(n)("settings.archivedSearch")},null,8,Cve),[[wo,B.value]])]),ie(Vv,{"model-value":P.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Y[17]||(Y[17]=X=>P.value=X)},{default:Me(()=>[w("option",Ave,O(C(n)("settings.archivedAllWorkspaces")),1),(b(!0),T(Be,null,st(ee.value,X=>(b(),T("option",{key:X,value:X},O(X),9,Mve))),128))]),_:1},8,["model-value","aria-label"]),ie(go,{size:"sm","model-value":z.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":Y[18]||(Y[18]=X=>z.value=X)},null,8,["model-value","options"])]),I.value?(b(),T("div",Eve,O(C(n)("settings.archivedLoadingAll")),1)):(b(),T(Be,{key:1},[Z.value.length>0?(b(),T("div",Tve,[(b(!0),T(Be,null,st(Z.value,X=>(b(),T("section",{key:X.cwd,class:"archive-card"},[w("div",Nve,[Y[23]||(Y[23]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("path",{d:"M3 7h6l2 2h10v9H3z"}),w("path",{d:"M3 7V5h6l2 2"})],-1)),w("span",Ive,O(X.cwd),1),w("span",$ve,O(C(n)("settings.archivedSessionsCount",{count:X.items.length})),1)]),w("div",Lve,[(b(!0),T(Be,null,st(X.items,le=>(b(),T("div",{key:le.id,class:"archive-row"},[w("div",Fve,[w("div",Ove,O(le.title),1),w("div",Rve,O(C(n)("settings.archivedAt",{time:fe(le.updatedAt)})),1)]),ie(Bt,{variant:"secondary",size:"sm",onClick:He=>ce(le.id)},{default:Me(()=>[Xe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(b(),T("div",Bve,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[pi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Hve=dt(Pve,[["__scopeId","data-v-2377814f"]]),Wve=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,y8=/^[A-Za-z]:[\\/]/,zve=/^\/\/(?!\/)/;function xg(e){return Wve.test(e.trim())}function Uve(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function qve(e){return zve.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function jve(e){return y8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function Vve(e){return y8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function Jv(e,t){let n=qve(Uve(e.trim(),t));const s=jve(n),o=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=s?/[\\/]$/.test(n):n.endsWith("/");!o&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=s?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=Vve(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function Kve(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Gve(e,t,n){if(n===null)return null;const{target:s}=Jv(e,t);return s===n?n:null}const Yve={class:"aw"},Zve={key:0,class:"crumbbar"},Qve={class:"crumbs"},Xve={key:0,class:"crumb-sep"},Jve=["onClick"],eye=["placeholder"],tye={key:2,class:"folder-list"},nye={key:0,class:"fl-loading"},sye={key:0,class:"fl-loading"},oye={key:0,class:"fl-note"},iye=["onClick"],rye={class:"folder-name"},lye={key:0,class:"git-branch"},aye={key:1,class:"fl-empty fl-error"},cye={key:2,class:"fl-empty fl-error"},uye=["onClick"],dye={class:"folder-name search-rel"},fye={key:0,class:"git-branch"},hye={key:0,class:"fl-empty"},pye={key:1,class:"fl-loading"},mye=["onClick"],gye={class:"folder-name"},vye={key:0,class:"git-branch"},yye={key:0,class:"fl-empty"},kye={key:3,class:"degraded-hint"},bye={key:4,class:"add-error",role:"alert"},xye={class:"actions"},_ye={class:"footer-hint"},wye=600,Sye=6,JC=150,Cye=Ye({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q(!0),r=Q(!1),l=Q(!1),a=Q(""),c=Q(null),u=Q([]),d=Q(""),f=Q(!1),h=Q([]),p=D(()=>d.value.trim().length>0);let m=0,x=null;const k=D(()=>xg(d.value)),g=Q("idle"),v=Q(""),y=Q("/"),M=Q([]),L=Q(""),$=Q(null),_=Q(null),E=D(()=>g.value!=="valid"?null:Gve(d.value,L.value,_.value));let N=0,F=null;function S(Y,X){const le=Y.toLowerCase(),He=X.toLowerCase();let de=0;for(let G=0;G<He.length&&de<le.length;G++)He[G]===le[de]&&de++;return de===le.length}async function I(Y){const X=a.value,le=Y.trim();if(!X||le===""){h.value=[],f.value=!1;return}const He=++m;f.value=!0;const de=[],G=[{path:X,depth:0}];let ae=0;for(;G.length>0&&ae<wye&&de.length<JC;){if(He!==m)return;const me=G.shift();ae++;let q;try{q=await s.browseFs(me.path)}catch{continue}if(He!==m)return;for(const ne of q.entries){if(!ne.isDir)continue;const ge=ne.path.startsWith(X)?ne.path.slice(X.length).replace(/^\/+/,""):ne.path;if(S(le,ge||ne.name)&&(de.push({path:ne.path,name:ne.name,rel:ge||ne.name,isGitRepo:ne.isGitRepo,branch:ne.branch}),de.length>=JC))break;me.depth+1<Sye&&G.push({path:ne.path,depth:me.depth+1})}He===m&&(h.value=[...de])}He===m&&(f.value=!1)}Qe(d,Y=>{x&&clearTimeout(x),F&&clearTimeout(F),N++,g.value="idle",M.value=[],_.value=null;const X=Y.trim();if(X===""){m++,h.value=[],f.value=!1;return}if(xg(X)){if(m++,h.value=[],f.value=!1,l.value)return;g.value="checking",F=setTimeout(()=>void R(X),150);return}x=setTimeout(()=>void I(Y),220)});async function R(Y){const X=++N;g.value="checking",_.value=null;const le=Jv(Y,L.value),{target:He}=le;try{const G=await s.browseFs(He);if(X!==N)return;if(G.path){g.value="valid",M.value=[],_.value=He,a.value=G.path,c.value=G.parent,u.value=G.entries,l.value=!1;return}}catch{}if(X!==N)return;const de=le.base.toLowerCase();v.value=le.parent,y.value=le.separator;try{const G=await s.browseFs(le.parent);if(X!==N)return;if(G.path){M.value=G.entries.filter(ae=>ae.isDir&&ae.name.toLowerCase().startsWith(de)),g.value="not-found";return}}catch{}X===N&&(M.value=[],g.value="bad-parent")}function B(Y){d.value=Kve(v.value,Y,y.value),$.value?.focus()}const P=D(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),z=D(()=>l.value?n("workspace.degradedHint"):k.value&&g.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function W(Y){if(Y.key==="Escape"){d.value?d.value="":o("close");return}if(Y.key!=="Enter")return;const X=d.value.trim();if(xg(X)){if(Y.preventDefault(),l.value){const{target:le}=Jv(X,L.value);le&&o("add",le);return}g.value==="valid"?oe():g.value==="not-found"&&M.value[0]&&B(M.value[0].name)}}const ee=D(()=>{const Y=a.value;if(!Y)return[];const X=Y.split("/").filter(Boolean),le=[{label:"/",path:"/"}];let He="";for(const de of X)He+=`/${de}`,le.push({label:de,path:He});return le}),U=D(()=>!(a.value.length===0||k.value&&E.value===null));async function Z(Y){r.value=!0;try{const X=await s.browseFs(Y);if(!X.path){l.value=!0;return}a.value=X.path,c.value=X.parent,u.value=X.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function ce(Y){Y.isDir&&Z(Y.path)}function fe(){c.value&&Z(c.value)}function oe(){U.value&&o("add",E.value??a.value)}return yn(async()=>{r.value=!0;try{const Y=await s.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(Y.home&&(L.value=Y.home),s.defaultPath&&(await Z(s.defaultPath),!l.value))return;L.value?await Z(L.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),Sn(()=>{x&&clearTimeout(x),F&&clearTimeout(F)}),(Y,X)=>(b(),ke(Hr,{open:i.value,"onUpdate:open":X[2]||(X[2]=le=>i.value=le),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:X[3]||(X[3]=le=>o("close"))},{default:Me(()=>[w("div",Yve,[l.value?re("",!0):(b(),T("div",Zve,[ie(Dn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:fe},{default:Me(()=>[ie(je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),w("div",Qve,[(b(!0),T(Be,null,st(ee.value,(le,He)=>(b(),T(Be,{key:le.path},[He>1?(b(),T("span",Xve,"/")):re("",!0),w("button",{class:Pe(["crumb",{last:He===ee.value.length-1}]),onClick:de=>Z(le.path)},O(le.label),11,Jve)],64))),128))])])),!r.value||l.value?(b(),T("div",{key:1,class:Pe(["filterbar",{"has-error":g.value==="not-found"||g.value==="bad-parent"}])},[ie(je,{class:"filter-icon",name:"search",size:"md"}),Ln(w("input",{ref_key:"filterEl",ref:$,"onUpdate:modelValue":X[0]||(X[0]=le=>d.value=le),class:"filter-input",type:"text",placeholder:P.value,autocomplete:"off",spellcheck:"false",onKeydown:bt(W,["stop"])},null,40,eye),[[wo,d.value]]),f.value||g.value==="checking"?(b(),ke(Ho,{key:0,size:"sm"})):re("",!0)],2)):re("",!0),l.value?(b(),T("div",kye,O(C(n)("workspace.degradedHint")),1)):(b(),T("div",tye,[r.value?(b(),T("div",nye,O(C(n)("workspace.browsing")),1)):k.value&&g.value!=="valid"?(b(),T(Be,{key:1},[g.value==="checking"?(b(),T("div",sye,O(C(n)("workspace.checkingPath")),1)):g.value==="not-found"?(b(),T(Be,{key:1},[M.value.length>0?(b(),T("div",oye,O(C(n)("workspace.pathPickHint")),1)):re("",!0),(b(!0),T(Be,null,st(M.value,le=>(b(),T("button",{key:le.path,class:"folder-row",onClick:He=>B(le.name)},[ie(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",rye,O(le.name),1),le.isGitRepo?(b(),ke(Fo,{key:0,variant:"info",size:"sm"},{default:Me(()=>[Xe(O(C(n)("workspace.gitTag")),1),le.branch?(b(),T("span",lye,O(le.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,iye))),128)),M.value.length===0?(b(),T("div",aye,O(C(n)("workspace.noPathMatch",{parent:v.value})),1)):re("",!0)],64)):g.value==="bad-parent"?(b(),T("div",cye,O(C(n)("workspace.badParent",{parent:v.value})),1)):re("",!0)],64)):p.value&&!k.value?(b(),T(Be,{key:2},[(b(!0),T(Be,null,st(h.value,le=>(b(),T("button",{key:le.path,class:"folder-row",onClick:He=>Z(le.path)},[ie(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",dye,O(le.rel),1),le.isGitRepo?(b(),ke(Fo,{key:0,variant:"info",size:"sm"},{default:Me(()=>[Xe(O(C(n)("workspace.gitTag")),1),le.branch?(b(),T("span",fye,O(le.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,uye))),128)),!f.value&&h.value.length===0?(b(),T("div",hye,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(b(),T("div",pye,O(C(n)("workspace.searching")),1)):re("",!0)],64)):(b(),T(Be,{key:3},[(b(!0),T(Be,null,st(u.value,le=>(b(),T("button",{key:le.path,class:"folder-row",onClick:He=>ce(le)},[ie(je,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",gye,O(le.name),1),le.isGitRepo?(b(),ke(Fo,{key:0,variant:"info",size:"sm"},{default:Me(()=>[Xe(O(C(n)("workspace.gitTag")),1),le.branch?(b(),T("span",vye,O(le.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,mye))),128)),u.value.length===0?(b(),T("div",yye,O(C(n)("workspace.noSubfolders")),1)):re("",!0)],64))])),e.error?(b(),T("div",bye,O(e.error),1)):re("",!0),w("div",xye,[ie(Yt,{text:a.value},{default:Me(()=>[l.value?re("",!0):(b(),ke(Bt,{key:0,variant:"primary",disabled:!U.value,onClick:oe},{default:Me(()=>[Xe(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Bt,{variant:"secondary",onClick:X[1]||(X[1]=le=>o("close"))},{default:Me(()=>[Xe(O(C(n)("workspace.cancel")),1)]),_:1})]),w("div",_ye,O(z.value),1)])]),_:1},8,["open","title"]))}}),Aye=dt(Cye,[["__scopeId","data-v-b24b02ce"]]),Mye={key:0,class:"confirm-dialog__message"},Eye=Ye({__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=Q(null);function s(){const c=n.value?.$el;return c instanceof HTMLElement?c:null}const o=e,i=t,{t:r}=Tt();function l(){i("update:open",!1),i("cancel")}function a(c){if(c.key!=="Enter"||!o.open||o.loading)return;const u=c.target;u instanceof HTMLButtonElement||u instanceof HTMLAnchorElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement||u instanceof HTMLInputElement||(c.preventDefault(),i("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",a),ms(()=>{typeof window<"u"&&window.removeEventListener("keydown",a)}),(c,u)=>(b(),ke(Hr,{open:e.open,title:e.title,height:"auto","initial-focus":s,"onUpdate:open":u[1]||(u[1]=d=>i("update:open",d)),onClose:l},{foot:Me(()=>[ie(Bt,{variant:"secondary",disabled:e.loading,onClick:l},{default:Me(()=>[Xe(O(e.cancelLabel??C(r)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Bt,{ref_key:"confirmButtonRef",ref:n,variant:e.variant,loading:e.loading,onClick:u[0]||(u[0]=d=>i("confirm"))},{default:Me(()=>[Xe(O(e.confirmLabel??C(r)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Me(()=>[e.message?(b(),T("p",Mye,O(e.message),1)):re("",!0)]),_:1},8,["open","title"]))}}),Tye=dt(Eye,[["__scopeId","data-v-76e206e7"]]),Nye=Ye({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=Wr();return(s,o)=>(b(),ke(Tye,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,onConfirm:o[0]||(o[0]=i=>C(n)(!0)),onCancel:o[1]||(o[1]=i=>C(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),Iye={class:"rows"},$ye={class:"row"},Lye={class:"row"},Fye={class:"row"},Oye={class:"row"},Rye={class:"row"},Bye={class:"row"},Dye={class:"ctx-text"},Pye={key:0,class:"bar"},Hye={class:"row"},Wye=Ye({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t,i=Q(!0),r=D(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),l=D(()=>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=D(()=>{const p=s.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=D(()=>s.planMode?n("status.planOn"):n("status.planOff")),d=D(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=D(()=>typeof s.costUsd=="number"&&s.costUsd>0),h=D(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(b(),ke(Hr,{open:i.value,"onUpdate:open":m[0]||(m[0]=x=>i.value=x),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=x=>o("close"))},{default:Me(()=>[w("dl",Iye,[w("div",$ye,[w("dt",null,O(C(n)("status.statusModel")),1),w("dd",null,O(e.status.model),1)]),w("div",Lye,[w("dt",null,O(C(n)("status.statusThinking")),1),w("dd",null,O(e.thinking),1)]),w("div",Fye,[w("dt",null,O(C(n)("status.statusPermission")),1),w("dd",{style:Gt({color:c.value})},O(a(e.status.permission)),5)]),w("div",Oye,[w("dt",null,O(C(n)("status.statusPlanMode")),1),w("dd",{class:Pe({"plan-on":e.planMode})},O(u.value),3)]),w("div",Rye,[w("dt",null,O(C(n)("status.statusSwarmMode")),1),w("dd",{class:Pe({"swarm-on":e.swarmMode})},O(d.value),3)]),w("div",Bye,[w("dt",null,O(C(n)("status.statusContext")),1),w("dd",null,[w("span",Dye,O(l.value),1),e.status.ctxMax>0?(b(),T("span",Pye,[w("i",{style:Gt({width:r.value+"%"})},null,4)])):re("",!0)])]),w("div",Hye,[w("dt",null,O(C(n)("status.statusCost")),1),w("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),zye=dt(Wye,[["__scopeId","data-v-59dd31f3"]]),Uye={class:"ui-toast__icon","aria-hidden":"true"},qye={class:"ui-toast__body"},jye={class:"ui-toast__title"},Vye={key:0,class:"ui-toast__msg"},Kye=Ye({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(b(),T("div",{class:Pe(["ui-toast",`ui-toast--${e.variant}`])},[w("span",Uye,[Fn(t.$slots,"icon",{},()=>[e.variant==="success"?(b(),ke(je,{key:0,name:"check"})):e.variant==="danger"?(b(),ke(je,{key:1,name:"close"})):e.variant==="warning"?(b(),ke(je,{key:2,name:"alert-triangle"})):(b(),ke(je,{key:3,name:"info"}))],!0)]),w("div",qye,[w("div",jye,O(e.title),1),e.message?(b(),T("div",Vye,O(e.message),1)):re("",!0),Fn(t.$slots,"default",{},void 0,!0)]),ie(Dn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:Me(()=>[ie(je,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Gye=dt(Kye,[["__scopeId","data-v-adc6f346"]]),Yye={key:0,class:"actions"},Zye=["onClick"],Qye=["onClick"],Xye={key:1,class:"details"},Jye=Ye({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Tt();function i(_){return typeof _=="object"&&_!==null}function r(_){return i(_)?_.title:_}function l(_){return i(_)?_.message??"":""}function a(_){return i(_)?_.details:void 0}function c(_){return i(_)?_.severity==="error":_.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(_)}function u(_){return i(_)?`notice:${_.severity}:${_.title}:${_.message??""}:${JSON.stringify(_.details??[])}`:`text:${_}`}function d(_){if(!i(_))return _;const E=[_.title];_.message&&E.push(_.message);const N=_.details??[];if(N.length>0){E.push("",`${o("warnings.diagnostics")}:`);for(const F of N)E.push(`${F.label}: ${F.value}`)}return E.join(`
325
+ `)}let f=1;const h=Q([]),p=new Map,m=new Map;function x(_){const E=c(_)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function k(_,E){const N=p.get(_)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>$(_),E),N.deadline=Date.now()+E,p.set(_,N)}function g(_){const E=p.get(_);E&&E.handle!==null&&clearTimeout(E.handle),p.delete(_)}function v(_){const E=p.get(_);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function y(_){if(h.value.find(F=>F.id===_)?.detailsOpen)return;const N=p.get(_);!N||N.handle!==null||k(_,N.remaining)}function M(_){_.detailsOpen=!_.detailsOpen,_.detailsOpen?v(_.id):y(_.id)}async function L(_){if(!await io(d(_.warning)))return;_.copied=!0;const N=m.get(_.id);N&&clearTimeout(N),m.set(_.id,setTimeout(()=>{_.copied=!1,m.delete(_.id)},1400))}function $(_){g(_);const E=m.get(_);E&&clearTimeout(E),m.delete(_);const N=h.value.findIndex(F=>F.id===_);N!==-1&&(h.value=h.value.filter(F=>F.id!==_),s("dismiss",N))}return Qe(()=>n.warnings,_=>{const E=[...h.value];h.value=_.map(N=>{const F=u(N),S=E.findIndex(B=>B.key===F),I=S===-1?void 0:E.splice(S,1)[0];if(I)return I.warning=N,I;const R={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return k(R.id,x(N)),R});for(const N of E){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),Sn(()=>{p.forEach(_=>{_.handle!==null&&clearTimeout(_.handle)}),p.clear(),m.forEach(_=>clearTimeout(_)),m.clear()}),(_,E)=>(b(),ke(z9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Me(()=>[(b(!0),T(Be,null,st(h.value,N=>(b(),ke(Gye,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:F=>$(N.id),onPointerenter:F=>v(N.id),onPointerleave:F=>y(N.id)},{default:Me(()=>[a(N.warning)?.length?(b(),T("div",Yye,[w("button",{class:"link",type:"button",onClick:F=>M(N)},O(N.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,Zye),w("button",{class:"link",type:"button",onClick:F=>L(N)},O(N.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,Qye)])):re("",!0),N.detailsOpen&&a(N.warning)?.length?(b(),T("dl",Xye,[(b(!0),T(Be,null,st(a(N.warning),F=>(b(),T("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[w("dt",null,O(F.label),1),w("dd",null,O(F.value),1)]))),128))])):re("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),eke=dt(Jye,[["__scopeId","data-v-92efeff8"]]),tke={class:"topbar"},nke={class:"wsq"},ske=["aria-label"],oke={class:"tb-path"},ike={class:"ws"},rke={class:"se"},lke={class:"tb-sub"},ake=Ye({__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}=Tt(),s=e,o=t,i=D(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=D(()=>s.workspace?.name??n("workspace.noWorkspace")),l=D(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(b(),T("div",tke,[w("span",nke,O(i.value),1),w("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[w("span",oke,[w("span",ike,O(r.value),1),e.sessionTitle?(b(),T(Be,{key:0},[c[2]||(c[2]=w("span",{class:"sl"},"/",-1)),w("span",rke,O(e.sessionTitle),1)],64)):re("",!0),c[3]||(c[3]=w("span",{class:"cv"},"⌄",-1))]),w("span",lke,[w("span",{class:Pe(["rd",{on:e.running}])},null,2),w("span",null,O(l.value),1),e.branch?(b(),T(Be,{key:0},[Xe(" · "+O(e.branch),1)],64)):re("",!0),e.sessionCount>0?(b(),T(Be,{key:1},[Xe(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):re("",!0)])],8,ske),ie(Dn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:Me(()=>[ie(je,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),cke=dt(ake,[["__scopeId","data-v-59a11935"]]),uke={key:0,class:"sheet-root"},dke=["aria-label"],fke=["aria-label"],hke={key:0,class:"sheet-head"},pke={class:"sheet-title"},mke={class:"sheet-body"},gke=Ye({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Qe(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Sn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(b(),ke(El,{name:"sheet"},{default:Me(()=>[e.modelValue?(b(),T("div",uke,[w("div",{class:"sheet-scrim",onClick:i}),w("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[w("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,fke),e.title?(b(),T("div",hke,[w("span",pke,O(e.title),1)])):re("",!0),w("div",mke,[Fn(l.$slots,"default",{},void 0,!0)])],8,dke)])):re("",!0)]),_:3}))}}),k8=dt(gke,[["__scopeId","data-v-4441dd70"]]),vke={class:"mlist"},yke={key:0,class:"mempty"},kke=["onClick"],bke={class:"mgh-main"},xke={class:"mgh-name"},_ke={class:"mgh-path"},wke={key:2,class:"att"},Ske={key:0,class:"mempty small"},Cke=["onClick"],Ake={class:"m"},Mke={class:"s"},Eke={key:0,class:"att"},Tke=["disabled","onClick"],Nke=["onClick"],Ike=Ye({__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}=Tt(),{confirm:s}=Wr(),o=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=Q(new Set);function f(S){return d.value.has(S)}function h(S){const I=new Set(d.value);I.has(S)?I.delete(S):I.add(S),d.value=I,y.value=null,_.value=null}const p=Q(new Set);function m(S){return p.value.has(S)}function x(S){const I=new Set(p.value);I.has(S)?I.delete(S):I.add(S),p.value=I}function k(S){if(m(S.workspace.id))return S.sessions;const I=S.sessions.slice(0,S.initialCount);if(o.activeId&&!I.some(R=>R.id===o.activeId)){const R=S.sessions.find(B=>B.id===o.activeId);if(R)return[...I,R]}return I}function g(S){if(!p.value.has(S)){const I=new Set(p.value);I.add(S),p.value=I}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=Q(null);function M(S){y.value=y.value===S?null:S,_.value=null}function L(S){y.value=null;const R=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();R&&i("rename",S.id,R)}async function $(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const _=Q(null);function E(S){_.value=_.value===S?null:S,y.value=null}function N(S){io(S.root),_.value=null}async function F(S){_.value=null,await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,I)=>(b(),ke(k8,{"model-value":e.modelValue,"onUpdate:modelValue":I[2]||(I[2]=R=>i("update:modelValue",R))},{default:Me(()=>[w("button",{type:"button",class:"newrow",onClick:c},[ie(je,{name:"message",size:"sm"}),Xe(" "+O(C(n)("sidebar.newChat")),1)]),w("button",{type:"button",class:"newrow secondary",onClick:u},[ie(je,{name:"folder",size:"sm"}),Xe(" "+O(C(n)("sidebar.newWorkspace")),1)]),w("div",vke,[e.groups.length===0?(b(),T("div",yke,O(C(n)("workspace.noWorkspace")),1)):re("",!0),(b(!0),T(Be,null,st(e.groups,R=>(b(),T("div",{key:R.workspace.id,class:"mgroup"},[w("div",{class:Pe(["mgh",{on:R.workspace.id===e.activeWorkspaceId}]),onClick:B=>h(R.workspace.id)},[f(R.workspace.id)?(b(),ke(je,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(b(),ke(je,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),w("div",bke,[w("span",xke,O(R.workspace.name),1),ie(Yt,{text:R.workspace.root},{default:Me(()=>[w("span",_ke,O(R.workspace.branch||R.workspace.shortPath),1)]),_:2},1032,["text"])]),f(R.workspace.id)&&v(R.workspace.id)>0?(b(),T("span",wke,O(v(R.workspace.id)),1)):re("",!0),ie(Dn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(B=>E(R.workspace.id),["stop"])},{default:Me(()=>[ie(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(Dn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(B=>a(R.workspace.id),["stop"])},{default:Me(()=>[ie(je,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),_.value===R.workspace.id?(b(),ke(gl,{key:3,class:"kmenu wsmenu",onClick:I[0]||(I[0]=bt(()=>{},["stop"]))},{default:Me(()=>[ie(gn,{size:"lg",onClick:B=>N(R.workspace)},{default:Me(()=>[Xe(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie(gn,{size:"lg",danger:"",onClick:B=>F(R.workspace)},{default:Me(()=>[Xe(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,kke),Ln(w("div",null,[R.sessions.length===0?(b(),T("div",Ske,O(C(n)("sidebar.noSessions")),1)):re("",!0),(b(!0),T(Be,null,st(k(R),B=>(b(),T("div",{key:B.id,class:Pe(["srow",{cur:B.id===e.activeId}]),onClick:P=>l(B.id)},[w("div",Ake,[w("div",{class:Pe(["t",{run:B.busy,aborted:B.status==="aborted"}])},O(B.title),3),w("div",Mke,O(B.time),1)]),(e.attentionBySession[B.id]??0)>0?(b(),T("span",Eke,O(e.attentionBySession[B.id]),1)):re("",!0),ie(Dn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(P=>M(B.id),["stop"])},{default:Me(()=>[ie(je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===B.id?(b(),ke(gl,{key:1,class:"kmenu",onClick:I[1]||(I[1]=bt(()=>{},["stop"]))},{default:Me(()=>[ie(gn,{size:"lg",onClick:P=>L(B)},{default:Me(()=>[Xe(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie(gn,{size:"lg",danger:"",onClick:P=>$(B.id)},{default:Me(()=>[Xe(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Cke))),128)),R.hasMore||R.loadingMore?(b(),T("button",{key:1,type:"button",class:"mshow-more",disabled:R.loadingMore,onClick:bt(B=>g(R.workspace.id),["stop"])},O(R.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,R.workspace.sessionCount-R.sessions.length)})),9,Tke)):re("",!0),R.sessions.length>R.initialCount?(b(),T("button",{key:2,type:"button",class:"mshow-more",onClick:bt(B=>x(R.workspace.id),["stop"])},O(m(R.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:R.sessions.length-R.initialCount})),9,Nke)):re("",!0)],512),[[pi,!f(R.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),$ke=dt(Ike,[["__scopeId","data-v-7ca5a6a0"]]),Lke={class:"group-title"},Fke={class:"srow-main"},Oke={class:"srow-label"},Rke={class:"srow-sub"},Bke={class:"srow read-only"},Dke={class:"srow-main"},Pke={class:"srow-label"},Hke={key:0,class:"srow-sub"},Wke={class:"srow-main"},zke={class:"srow-label"},Uke={class:"srow-sub"},qke=["aria-checked"],jke={class:"srow-main"},Vke={class:"srow-label"},Kke={class:"srow-sub"},Gke=["aria-checked"],Yke={class:"srow-main"},Zke={class:"srow-label"},Qke={class:"srow read-only"},Xke={class:"srow-main"},Jke={class:"srow-label"},e2e={class:"srow-sub"},t2e=["aria-label"],n2e={class:"group-title"},s2e={class:"srow-main"},o2e={class:"srow-label"},i2e={class:"srow-sub"},r2e={class:"srow read-only pref"},l2e={class:"srow-main"},a2e={class:"srow-label"},c2e={class:"srow read-only pref"},u2e={class:"srow-main"},d2e={class:"srow-label"},f2e={class:"srow read-only pref"},h2e={class:"srow-main"},p2e={class:"srow-label"},m2e={class:"num-field"},g2e=["value","aria-label"],v2e={class:"srow-main"},y2e={class:"srow-label"},k2e={class:"srow-sub"},b2e=["aria-checked"],x2e={class:"srow-main"},_2e={class:"srow-label"},w2e={class:"srow-main"},S2e={class:"srow-label"},C2e={key:2,class:"srow read-only"},A2e={class:"srow-main"},M2e={class:"srow-label"},E2e={class:"srow-val dim"},T2e={class:"arch-subhead"},N2e={class:"arch-count"},I2e={class:"arch-tools"},$2e={key:0,class:"arch-empty"},L2e={class:"arch-meta"},F2e={class:"arch-name"},O2e={class:"arch-time"},R2e={key:2,class:"arch-empty"},B2e=100,D2e=Ye({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Tt(),s=e,o=t;function i(ce){o("setColorScheme",ce)}const r=["manual","auto","yolo"],l=D(()=>s.models?.find(ce=>ce.id===s.status?.modelId)),a=D(()=>Dm(l.value)),c=D(()=>Ok(l.value)),u=D(()=>Np(l.value,s.thinking)),d=D(()=>c.value.includes(u.value)?u.value:""),f=D(()=>c.value.map(ce=>({value:ce,label:jv(ce)}))),h=D(()=>s.planMode===!0),p=D(()=>s.swarmMode===!0),m=D(()=>{const ce=s.status.permission;return ce==="yolo"?"var(--color-danger)":ce==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),x=D(()=>{const ce=s.status.permission,fe=n(ce==="yolo"?"mobile.permYoloSub":ce==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${ce} · ${fe}`}),k=ce=>`${Math.round(ce/1e3)}k`,g=D(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),v=D(()=>s.status.ctxMax>0?`${k(s.status.ctxUsed)}/${k(s.status.ctxMax)}`:n("status.statusNone"));function y(ce){o("setThinking",Rk(l.value,ce))}function M(){const ce=r.indexOf(s.status.permission),fe=r[(ce+1)%r.length];o("setPermission",fe)}function L(){o("pickModel"),o("update:modelValue",!1)}function $(){o("login"),o("update:modelValue",!1)}function _(){o("logout"),o("update:modelValue",!1)}const E=r2(),N=Q("main"),F=Q([]),S=Q(!1),I=Q(!1),R=Q(""),B=Q("archived-desc");async function P(){if(!S.value){S.value=!0,I.value=!1;try{const ce=[];let fe;for(;;){const oe=await E.loadArchivedSessions({beforeId:fe,pageSize:B2e});if(ce.push(...oe.items),!oe.hasMore||oe.items.length===0)break;const Y=oe.items.at(-1)?.id;if(Y===void 0)break;fe=Y}F.value=ce,I.value=!0}catch(ce){console.warn("loadAllArchived failed",ce)}finally{S.value=!1}}}function z(){N.value="archived",R.value="",P()}function W(){N.value="main"}const ee=D(()=>{const ce=R.value.trim().toLowerCase();let fe=F.value.filter(oe=>oe.archived===!0);return ce&&(fe=fe.filter(oe=>oe.title.toLowerCase().includes(ce))),fe=fe.slice(),B.value==="archived-desc"?fe.sort((oe,Y)=>Y.updatedAt.localeCompare(oe.updatedAt)):B.value==="created-desc"?fe.sort((oe,Y)=>Y.createdAt.localeCompare(oe.createdAt)):fe.sort((oe,Y)=>oe.title.localeCompare(Y.title,"zh")),fe});async function U(ce){await E.restoreSession(ce)&&(F.value=F.value.filter(oe=>oe.id!==ce))}function Z(ce){const fe=new Date(ce);if(Number.isNaN(fe.getTime()))return ce;const oe=Y=>String(Y).padStart(2,"0");return`${fe.getFullYear()}-${oe(fe.getMonth()+1)}-${oe(fe.getDate())} ${oe(fe.getHours())}:${oe(fe.getMinutes())}`}return Qe(()=>s.modelValue,ce=>{ce||(N.value="main")}),(ce,fe)=>(b(),ke(k8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":fe[6]||(fe[6]=oe=>o("update:modelValue",oe))},{default:Me(()=>[N.value==="main"?(b(),T(Be,{key:0},[w("div",Lke,O(C(n)("mobile.groupSession")),1),w("button",{type:"button",class:"srow",onClick:L},[w("span",Fke,[w("span",Oke,O(C(n)("status.statusModel")),1),w("span",Rke,O(e.status.model),1)]),fe[7]||(fe[7]=w("span",{class:"chev"},"›",-1))]),w("div",Bke,[w("span",Dke,[w("span",Pke,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(b(),T("span",Hke,O(C(n)("status.modeNotSupported")),1)):re("",!0)]),c.value.length>1?(b(),ke(go,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(b(),T("span",{key:1,class:Pe(["srow-val",{dim:u.value==="off"}])},O(u.value==="off"?C(n)("status.planOff"):C(jv)(u.value)),3))]),w("button",{type:"button",class:"srow",onClick:fe[0]||(fe[0]=oe=>o("togglePlan"))},[w("span",Wke,[w("span",zke,O(C(n)("status.statusPlanMode")),1),w("span",Uke,O(C(n)("mobile.planModeSub")),1)]),w("span",{class:Pe(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,qke)]),w("button",{type:"button",class:"srow",onClick:fe[1]||(fe[1]=oe=>o("toggleSwarm"))},[w("span",jke,[w("span",Vke,O(C(n)("status.statusSwarmMode")),1),w("span",Kke,O(C(n)("mobile.swarmModeSub")),1)]),w("span",{class:Pe(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,Gke)]),w("button",{type:"button",class:"srow",onClick:M},[w("span",Yke,[w("span",Zke,O(C(n)("status.statusPermission")),1),w("span",{class:"srow-sub",style:Gt({color:m.value})},O(x.value),5)]),fe[8]||(fe[8]=w("span",{class:"chev"},"›",-1))]),w("div",Qke,[w("span",Xke,[w("span",Jke,O(C(n)("status.statusContext")),1),w("span",e2e,O(v.value),1)]),w("span",{class:"ctx-meter","aria-label":v.value},[w("i",{style:Gt({width:g.value+"%"})},null,4)],8,t2e)]),w("div",n2e,O(C(n)("mobile.groupApp")),1),w("button",{type:"button",class:"srow",onClick:z},[w("span",s2e,[w("span",o2e,O(C(n)("mobile.archivedSessions")),1),w("span",i2e,O(C(n)("mobile.archivedSessionsSub")),1)]),fe[9]||(fe[9]=w("span",{class:"chev"},"›",-1))]),w("div",r2e,[w("span",l2e,[w("span",a2e,O(C(n)("theme.colorSchemeLabel")),1)]),ie(go,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),w("div",c2e,[w("span",u2e,[w("span",d2e,O(C(n)("sidebar.language")),1)]),ie(v8)]),w("div",f2e,[w("span",h2e,[w("span",p2e,O(C(n)("settings.uiFontSize")),1)]),w("label",m2e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:fe[2]||(fe[2]=oe=>o("setUiFontSize",Number(oe.target.value)))},null,40,g2e),fe[10]||(fe[10]=w("span",{class:"num-unit"},"px",-1))])]),w("button",{type:"button",class:"srow",onClick:fe[3]||(fe[3]=oe=>o("setConversationToc",!e.conversationToc))},[w("span",v2e,[w("span",y2e,O(C(n)("settings.conversationToc")),1),w("span",k2e,O(C(n)("settings.conversationTocHint")),1)]),w("span",{class:Pe(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,b2e)]),e.authReady?(b(),T("button",{key:0,type:"button",class:"srow acct out",onClick:_},[w("span",x2e,[w("span",_2e,O(C(n)("sidebar.signOut")),1)])])):(b(),T("button",{key:1,type:"button",class:"srow acct in",onClick:$},[w("span",w2e,[w("span",S2e,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(b(),T("div",C2e,[w("span",A2e,[w("span",M2e,O(C(n)("settings.serverVersion")),1)]),w("span",E2e,O(e.serverVersion),1)])):re("",!0)],64)):(b(),T(Be,{key:1},[w("div",T2e,[w("button",{type:"button",class:"arch-back",onClick:W},[fe[11]||(fe[11]=w("span",{class:"chev back"},"‹",-1)),Xe(" "+O(C(n)("mobile.archivedBack")),1)]),w("span",N2e,O(C(n)("mobile.sessionCount",{n:ee.value.length})),1)]),w("div",I2e,[ie(Hc,{class:"arch-search-input","model-value":R.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":fe[4]||(fe[4]=oe=>R.value=oe)},null,8,["model-value","placeholder"]),ie(go,{size:"sm","model-value":B.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":fe[5]||(fe[5]=oe=>B.value=oe)},null,8,["model-value","options"])]),S.value?(b(),T("div",$2e,O(C(n)("settings.archivedLoadingAll")),1)):ee.value.length>0?(b(!0),T(Be,{key:1},st(ee.value,oe=>(b(),T("div",{key:oe.id,class:"arch-row"},[w("div",L2e,[w("div",F2e,O(oe.title),1),w("div",O2e,O(C(n)("settings.archivedAt",{time:Z(oe.updatedAt)})),1)]),ie(Bt,{variant:"secondary",size:"sm",onClick:Y=>U(oe.id)},{default:Me(()=>[Xe(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(b(),T("div",R2e,O(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),P2e=dt(D2e,[["__scopeId","data-v-943e6216"]]),H2e={class:"ob-brand"},W2e={class:"ob-brand-text"},z2e={class:"ob-title"},U2e={class:"ob-sub"},q2e={class:"ob-sec"},j2e={class:"ob-label"},V2e={class:"ob-sec"},K2e={class:"ob-label"},G2e={class:"ob-sec"},Y2e={class:"ob-label"},Z2e=Ye({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Tt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=I5();function c(d){o.value!==d&&mA(d)}function u(){n("complete")}return(d,f)=>(b(),ke(Hr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Me(()=>[w("div",H2e,[f[4]||(f[4]=w("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[w("defs",null,[w("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[w("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),w("g",{class:"ob-eyes",fill:"#000"},[w("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),w("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),w("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),w("div",W2e,[w("div",z2e,O(C(s)("onboarding.title")),1),w("div",U2e,O(C(s)("onboarding.subtitle")),1)])])]),default:Me(()=>[w("section",q2e,[w("div",j2e,O(C(s)("onboarding.languageLabel")),1),ie(go,{"model-value":C(o),options:C(pA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),w("section",V2e,[w("div",K2e,O(C(s)("theme.colorSchemeLabel")),1),ie(go,{"model-value":C(i),options:[{value:"light",label:C(s)("theme.light")},{value:"dark",label:C(s)("theme.dark")},{value:"system",label:C(s)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),w("section",G2e,[w("div",Y2e,O(C(s)("theme.accentLabel")),1),ie(go,{"model-value":C(r),options:[{value:"blue",label:C(s)("theme.accentBlue")},{value:"mono",label:C(s)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),ie(Bt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Me(()=>[Xe(O(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),Q2e=dt(Z2e,[["__scopeId","data-v-fbdd3eab"]]),X2e=["aria-label"],J2e={class:"gload-box"},ebe={class:"gload-text"},tbe={key:0,class:"gload-issue"},nbe={class:"gload-issue-detail"},sbe=Ye({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Tt();return(n,s)=>(b(),T("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[w("div",J2e,[s[0]||(s[0]=by('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><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-0b6dec6a></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-0b6dec6a></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-0b6dec6a></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-0b6dec6a></path></svg>',1)),ie(Ho,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),w("div",ebe,O(C(t)("app.connecting")),1),e.issue?(b(),T("div",tbe,[w("div",null,O(C(t)("app.connectRetrying")),1),w("div",nbe,O(e.issue),1)])):re("",!0)])],8,X2e))}}),obe=dt(sbe,[["__scopeId","data-v-0b6dec6a"]]),ibe={class:"kap-root"},rbe={class:"kap-head"},lbe={class:"kap-count"},abe={class:"kap-head-actions"},cbe={class:"kap-filters"},ube=["value"],dbe={class:"kap-check"},fbe={class:"kap-check"},hbe={class:"kap-view-toggle",role:"group"},pbe={key:0,class:"kap-empty"},mbe=["onClick"],gbe={class:"kap-ts"},vbe={class:"kap-label"},ybe={key:0,class:"kap-detail"},kbe={class:"kap-detail-actions"},bbe=["onClick"],xbe={key:1,class:"kap-agg"},_be={class:"mono"},wbe={class:"mono"},Sbe={class:"num"},Cbe={class:"num"},Abe={key:0},Mbe={class:"mono"},Ebe={class:"num"},Tbe={class:"num"},Nbe={key:0},Ibe=Ye({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=Q("all"),o=Q(""),i=Q(""),r=Q(!1),l=Q("timeline"),a=D(()=>(Ck.value,[..._te()])),c=D(()=>{const E=new Set;for(const N of a.value)N.sessionId&&E.add(N.sessionId);return[...E].sort()});function u(E){return E.kind==="rest:error"||E.code!==void 0&&E.code!==0||E.eventType==="error"||E.eventType==="parse-error"}const d=D(()=>{const E=o.value.trim().toLowerCase();return a.value.filter(N=>!(s.value!=="all"&&N.source!==s.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||E&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes(E)))}),f=D(()=>{const E=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",S=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,I=E.get(S)??{key:S,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};I.count++,N.seq!==void 0&&(I.lastSeq=N.seq),E.set(S,I)}return[...E.values()].sort((N,F)=>F.count-N.count)}),h=D(()=>{const E=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,S=E.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(N)&&S.errors++,N.durationMs!==void 0&&(S.totalMs+=N.durationMs,S.timed++),E.set(F,S)}return[...E.entries()].map(([N,F])=>({key:N,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((N,F)=>F.count-N.count)}),p=Q(null),m=Q(!0),x=Q(null),k=Q(null);Qe(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await gt();const E=x.value;E&&(E.scrollTop=E.scrollHeight)});function g(E){p.value=p.value===E?null:E}function v(E){const N=new Date(E),F=(S,I=2)=>String(S).padStart(I,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function y(E){return JSON.stringify(E,null,2)}async function M(E){await io(y(E))&&(k.value=E.id,setTimeout(()=>{k.value===E.id&&(k.value=null)},1500))}function L(){o5(d.value)}function $(E){return u(E)||E.source==="client"?"b-err":E.source==="rest"?"b-rest":E.kind==="ws:lifecycle"?"b-life":E.kind==="ws:out"?"b-out":"b-in"}function _(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,N)=>(b(),T("section",ibe,[w("header",rbe,[N[11]||(N[11]=w("strong",null,"KAP debug",-1)),w("span",lbe,O(d.value.length)+"/"+O(a.value.length),1),w("div",abe,[w("button",{type:"button",class:Pe({on:C(Wu)}),onClick:N[0]||(N[0]=F=>Wu.value=!C(Wu))},O(C(Wu)?"resume":"pause"),3),w("button",{type:"button",onClick:N[1]||(N[1]=F=>C(wte)())},"clear"),w("button",{type:"button",onClick:N[2]||(N[2]=F=>L())},"export jsonl"),ie(Yt,{text:"Close window"},{default:Me(()=>[w("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),w("div",cbe,[Ln(w("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>s.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[w("option",{value:"all"},"rest + ws + app",-1),w("option",{value:"rest"},"rest",-1),w("option",{value:"ws"},"ws",-1),w("option",{value:"client"},"app errors",-1)])],512),[[Hg,s.value]]),Ln(w("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=w("option",{value:""},"all sessions",-1)),(b(!0),T(Be,null,st(c.value,F=>(b(),T("option",{key:F,value:F},O(F),9,ube))),128))],512),[[Hg,i.value]]),Ln(w("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>o.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[wo,o.value]]),w("label",dbe,[Ln(w("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[Kh,r.value]]),N[14]||(N[14]=Xe(" errors",-1))]),w("label",fbe,[Ln(w("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[Kh,m.value]]),N[15]||(N[15]=Xe(" follow",-1))]),w("div",hbe,[w("button",{type:"button",class:Pe({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),w("button",{type:"button",class:Pe({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(b(),T("div",{key:0,ref_key:"listRef",ref:x,class:"kap-list"},[d.value.length===0?(b(),T("div",pbe," No trace entries yet. REST calls and WS frames will appear here. ")):re("",!0),(b(!0),T(Be,null,st(d.value,F=>(b(),T("div",{key:F.id,class:"kap-row-wrap"},[w("button",{type:"button",class:Pe(["kap-row",{expanded:p.value===F.id}]),onClick:S=>g(F.id)},[w("span",gbe,O(v(F.ts)),1),w("span",{class:Pe(["kap-badge",$(F)])},O(_(F)),3),w("span",vbe,O(F.label),1)],10,mbe),p.value===F.id?(b(),T("div",ybe,[w("div",kbe,[w("button",{type:"button",onClick:S=>M(F)},O(k.value===F.id?"copied ✓":"copy json"),9,bbe)]),w("pre",null,O(y(F)),1)])):re("",!0)]))),128))],512)):(b(),T("div",xbe,[N[20]||(N[20]=w("h4",null,"WS frames by session / type",-1)),w("table",null,[N[17]||(N[17]=w("thead",null,[w("tr",null,[w("th",null,"dir"),w("th",null,"type"),w("th",null,"session"),w("th",null,"count"),w("th",null,"last seq")])],-1)),w("tbody",null,[(b(!0),T(Be,null,st(f.value,F=>(b(),T("tr",{key:F.key},[w("td",null,O(F.dir),1),w("td",_be,O(F.eventType),1),w("td",wbe,O(F.sessionId),1),w("td",Sbe,O(F.count),1),w("td",Cbe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(b(),T("tr",Abe,[...N[16]||(N[16]=[w("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):re("",!0)])]),N[21]||(N[21]=w("h4",null,"REST by endpoint",-1)),w("table",null,[N[19]||(N[19]=w("thead",null,[w("tr",null,[w("th",null,"endpoint"),w("th",null,"count"),w("th",null,"errors"),w("th",null,"avg ms")])],-1)),w("tbody",null,[(b(!0),T(Be,null,st(h.value,F=>(b(),T("tr",{key:F.key},[w("td",Mbe,O(F.key),1),w("td",Ebe,O(F.count),1),w("td",{class:Pe(["num",{err:F.errors>0}])},O(F.errors),3),w("td",Tbe,O(F.avgMs),1)]))),128)),h.value.length===0?(b(),T("tr",Nbe,[...N[18]||(N[18]=[w("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):re("",!0)])])]))]))}}),$be=dt(Ibe,[["__scopeId","data-v-3cda6fe3"]]),Lbe=Ye({__name:"DebugPanel",setup(e){const t=Q(!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=Gh($be,{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 yn(()=>{c()}),ms(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(b(),ke(Yt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Me(()=>[w("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),Fbe=dt(Lbe,[["__scopeId","data-v-21346738"]]);function Obe({client:e,authLogoRef:t}){const n=D(()=>e.authReady.value),s=D(()=>e.initialized.value&&!n.value),o="/login",i=Q(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)}Qe(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 Sn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function Rbe({running:e,showAuthGate:t}){const{t:n}=Tt(),s=["◐","◓","◑","◒"],o=Q(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}Qe(e,c=>{c?r():l()},{immediate:!0});const a=D(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});oT(()=>{typeof document<"u"&&(document.title=a.value)}),Sn(()=>{l()})}const b8=Q(typeof window>"u"?0:window.innerWidth);let ih=0,Wp=!1;function ey(){b8.value=window.innerWidth}function Bbe(){Wp||typeof window>"u"||(window.addEventListener("resize",ey),Wp=!0,ey())}function Dbe(){!Wp||typeof window>"u"||(window.removeEventListener("resize",ey),Wp=!1)}function x8(e,t,n){return Math.max(t,e-n)}function ty(e,t,n){return Math.min(n,Math.max(t,e))}function _8(){return yn(()=>{ih+=1,Bbe()}),ms(()=>{ih=Math.max(0,ih-1),ih===0&&Dbe()}),{viewportWidth:b8}}const Pbe="kimi-web.file-preview-width",pc=320;function Hbe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=_8(),i=D(()=>Math.max(0,o.value-t.value)),r=D(()=>x8(i.value,pc,pc));function l(me){return ty(Math.round(me),pc,r.value)}function a(){return l(i.value/2)}const c=D(()=>a()),u=Q(c.value),d=D(()=>ty(u.value,pc,r.value)),f=Q(null),h=D(()=>{const me=f.value;if(!me)return null;const ne=e.turns.value.find(ge=>ge.id===me.turnId)?.blocks?.[me.blockIndex];return ne?.kind==="thinking"?ne.thinking:null}),p=D(()=>h.value!==null);function m(me){const q=f.value;if(q&&q.turnId===me.turnId&&q.blockIndex===me.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=me}function x(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=Q(null),g=D(()=>{const me=k.value;if(!me)return null;const q=e.turns.value.find(ne=>ne.id===me.turnId);return q?.role==="compaction"&&q.text?q.text:null}),v=D(()=>g.value!==null);function y(me){if(k.value?.turnId===me.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=me}function M(){k.value=null,n.value==="compaction"&&(n.value=null)}const L=Q(null);function $(me){const q=e.activeAppTasks.value,ne=q.find(ue=>ue.id===me)??q.find(ue=>ue.parentToolCallId===me);if(ne)return ne.id;const ge=q.filter(ue=>ue.kind==="subagent"&&!ue.parentToolCallId);if(ge.length===1)return ge[0].id}const _=D(()=>{const me=L.value;if(!me)return null;const q=e.activeAppTasks.value.find(ne=>ne.id===me.subagentId);return q?pme(q):null}),E=D(()=>_.value!==null);function N(me){const q=$(me);if(q){if(L.value?.subagentId===q){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:q},n.value="agent"}}function F(){L.value=null,n.value==="agent"&&(n.value=null)}const S=Q(null),I=D(()=>{const me=S.value;if(!me)return null;const q=XP(e.turns.value,me);return q?{id:me,title:Ia(q.name),path:QP(q.arg),lines:q.status==="error"?null:yA(q),output:q.output}:null}),R=D(()=>I.value!==null);function B(me){if(n.value==="toolDiff"&&S.value===me){P();return}n.value="toolDiff",S.value=me}function P(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const z=Q("list"),W=Q(null);function ee(){if(n.value==="diff"){U();return}n.value="diff",z.value="list",W.value=null,e.loadGitStatus(e.activeSessionId.value)}function U(){n.value==="diff"&&(n.value=null),z.value="list",W.value=null,e.clearFileDiff()}async function Z(me){z.value="detail",W.value=me,await e.loadFileDiff(me)}async function ce(me){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,me):await e.openSideChat(me),n.value="btw"}function fe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function oe(){n.value==="btw"&&(n.value=null)}const Y=D(()=>e.sideChatVisible.value),X=D(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||R.value)&&(n.value!=="btw"||Y.value)),le=Q(!1),He=Q({});function de(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return k.value?{kind:"compaction",...k.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function G(me){if(me)switch(me.kind){case"thinking":f.value={turnId:me.turnId,blockIndex:me.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:me.turnId},n.value="compaction";break;case"agent":L.value={subagentId:me.subagentId},n.value="agent";break;case"toolDiff":S.value=me.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ae(){return n.value==="thinking"&&p.value?(x(),!0):n.value==="compaction"&&v.value?(M(),!0):n.value==="agent"&&E.value?(F(),!0):n.value==="toolDiff"&&R.value?(P(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(U(),!0):n.value==="btw"?(fe(),!0):!1}return Qe(e.activeSessionId,(me,q)=>{if(q){const ne=de();ne?He.value[q]=ne:delete He.value[q]}s(),x(),M(),F(),P(),U(),oe(),me&&G(He.value[me])}),{PREVIEW_WIDTH_KEY:Pbe,PREVIEW_MIN:pc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:x,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:M,agentPanelMember:_,agentPanelVisible:E,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:I,toolDiffVisible:R,openToolDiff:B,closeToolDiff:P,detailDiffMode:z,detailDiffPath:W,openDiffDetail:ee,closeDiffDetail:U,selectDiffFile:Z,btwVisible:Y,openSideChatTab:ce,closeSideChat:fe,hideSideChatPanel:oe,sidePanelVisible:X,panelDragging:le,closeOpenSidePanel:ae}}const Wbe=Lt.sidebarWidth,e4=Lt.sidebarCollapsed,t4=270,_g=170,zbe=480,Ube=320;function qbe(e={}){const{viewportWidth:t}=_8(),n=Q(t4),s=Q(!1),o=Q(!1),i=D(()=>{const u=Ube+(C4(e.previewOpen)?pc:0);return Math.min(zbe,x8(t.value,_g,u))}),r=D(()=>ty(n.value,_g,i.value));function l(){try{s.value=rs(e4)==="true"}catch{s.value=!1}}function a(){try{gs(e4,String(s.value))}catch{}}function c(){s.value=!s.value,a()}return{SIDEBAR_WIDTH_KEY:Wbe,SIDEBAR_DEFAULT:t4,SIDEBAR_MIN:_g,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:s,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function jbe({client:e,detailTarget:t}){const{t:n}=Tt(),s=Q(null),o=Q(null),i=Q(!1),r=Q(null),l=Q(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=D(()=>{const $=l.value;return $?e.getFileDownloadUrl($):null}),f=D(()=>s.value!==null);function h($){return $.length>1?$.replace(/\/+$/,""):$}function p($){const _=[];for(const E of $.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){_.pop();continue}_.push(E)}return _.join("/")}function m($){const _=$.trim();if(!_)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(_))return{error:n("filePreview.errors.unsupportedPath")};if(_.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const E=h(e.status.value.cwd);if(_.startsWith("/")){if(!E||_!==E&&!_.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=_===E?"":_.slice(E.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(_.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=p(_);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function x($){const _=s.value;if(t.value==="file"&&_&&_.path===$.path&&_.line===$.line){y();return}const E=++a;u(),t.value="file",o.value=null,r.value=null,i.value=!0,s.value=$,l.value=null;const N=m($.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if(E!==a)return;F?o.value={...F,path:F.path||N.path}:o.value={path:N.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(F){if(E!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{E===a&&(i.value=!1)}}function k($){return/^data:([^;,]+)/i.exec($)?.[1]}function g($){if($.kind!=="image")return;const _=++a;u(),t.value="file",s.value=null,l.value=null,r.value=null;const E={path:$.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:$.mimeType??k($.url)??"image/*",isBinary:!0,size:$.bytes??0};$.fileId?(i.value=!0,o.value=E,ft().getFileBlob($.fileId).then(N=>{if(_===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(N),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{_===a&&(o.value&&(o.value={...o.value,sourceUrl:$.url}),i.value=!1)})):(i.value=!1,o.value={...E,sourceUrl:$.url})}function v(){a+=1,s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,u()}function y(){v(),t.value==="file"&&(t.value=null)}Qe(t,($,_)=>{_==="file"&&$!=="file"&&v()});function M(){const $=o.value?.path??s.value?.path;$&&e.openWorkspaceFile($,s.value?.line)}function L(){const $=o.value?.path??s.value?.path;$&&e.revealWorkspaceFile($)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:x,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:M,revealPreviewFile:L}}const Vbe=640,Kbe=`(max-width: ${Vbe}px)`;function Gbe(){const e=Q(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Kbe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Sn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Sn(()=>t.removeListener(n))),e}const Ybe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Zbe={class:"server-auth-card"},Qbe={class:"server-auth-body"},Xbe={class:"server-auth-foot"},Jbe=Ye({__name:"ServerAuthDialog",setup(e){const t=Q(""),n=Q(null),s=Q(!1);yn(()=>{gt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,d5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(b(),T("div",Ybe,[w("div",Zbe,[l[1]||(l[1]=w("div",{class:"server-auth-head"},[w("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),w("p",{class:"server-auth-hint"},[Xe(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),w("code",null,"KIMI_CODE_PASSWORD"),Xe("). ")])],-1)),w("div",Qbe,[ie(Hc,{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"])]),w("div",Xbe,[ie(Bt,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:Me(()=>[Xe(O(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),exe=dt(Jbe,[["__scopeId","data-v-6f624612"]]),txe=["aria-label"],nxe=Ye({__name:"InternalBuildBanner",setup(e){const{t}=Tt(),n=mB;return(s,o)=>C(n)?(b(),T("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[o[0]||(o[0]=w("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"},[w("path",{d:"M8 2 14 13H2L8 2Z"}),w("path",{d:"M8 6v3.5"}),w("path",{d:"M8 11.5h.01"})],-1)),w("span",null,O(C(t)("app.internalBuildBanner")),1)],8,txe)):re("",!0)}}),sxe=dt(nxe,[["__scopeId","data-v-166b3735"]]),oxe={class:"app-shell"},ixe={key:1,class:"auth-page"},rxe={class:"auth-page-inner"},lxe={class:"auth-page-copy"},axe=["aria-label","aria-hidden"],cxe=Ye({__name:"App",setup(e){mne();const t=Q(!1);let n=null;const s=r2(),o=D(()=>!s.dangerousBypassAuth.value&&t.value);In("resolveImage",s.resolveImageUrl),In("resolveSwarmMembers",ct=>s.swarmMembersByToolCallId.value.get(ct)??[]);const{t:i}=Tt(),r=Bi(),l=Gbe(),a=Q(!1),c=Q(!1),u=D(()=>{const ct=s.activeSessionId.value;return s.sessions.value.find(be=>be.id===ct)?.title??""}),d=D(()=>s.visibleWorkspace.value?.sessionCount??0),f=D(()=>s.activity.value!=="idle"),h=Q(null),{showAuthGate:p,blinkAuthLogo:m}=Obe({client:s,authLogoRef:h});Rbe({running:f,showAuthGate:p});function x(ct){const be=s.models.value.find(nt=>nt.id===s.status.value.modelId),$e=Ok(be),sn=$e.indexOf(Np(be,ct)),Ke=$e[(sn+1)%$e.length]??$e[0]??"off";return Rk(be,Ke)}const k=D(()=>{const ct=s.models.value.find(be=>be.id===s.status.value.modelId);return Np(ct,s.thinking.value)}),g=Q(!s.onboarded.value);function v(){s.setOnboarded(!0),g.value=!1}function y(){g.value=!0}yn(()=>{n=yne(()=>{t.value=!0,s.clearDangerousBypassAuth()}),s.load(),He(),document.addEventListener("keydown",M,!0)}),Sn(()=>{document.removeEventListener("keydown",M,!0),n!==null&&(n(),n=null)});function M(ct){ct.key==="Escape"&&(On.value||Hn()&&(ct.stopPropagation(),ct.preventDefault()))}const L=Q(null),$=Q(!1);Qe(s.activeSessionId,()=>{$.value=!0,gt(()=>{$.value=!1})});const{previewTarget:_,previewFile:E,previewLoading:N,previewError:F,previewDownloadUrl:S,previewExternalActions:I,openFilePreview:R,openMediaPreview:B,closeFilePreview:P,openPreviewInEditor:z,revealPreviewFile:W}=jbe({client:s,detailTarget:L}),ee=D(()=>L.value!==null),{SIDEBAR_WIDTH_KEY:U,SIDEBAR_DEFAULT:Z,SIDEBAR_MIN:ce,sidebarMax:fe,sessionColWidth:oe,sidebarCollapsed:Y,sidebarDragging:X,sideWidth:le,loadSidebarCollapsed:He,toggleSidebarCollapse:de}=qbe({previewOpen:ee}),{PREVIEW_WIDTH_KEY:G,PREVIEW_MIN:ae,previewDefaultWidth:me,previewMax:q,previewWidth:ne,previewPanelWidth:ge,thinkingPanelText:ue,thinkingVisible:ye,openThinkingPanel:j,closeThinkingPanel:te,compactionPanelText:pe,compactionPanelVisible:Se,openCompactionPanel:Ie,closeCompactionPanel:Fe,agentPanelMember:he,openAgentPanel:Ne,closeAgentPanel:Je,toolDiffTarget:it,openToolDiff:At,closeToolDiff:xt,detailDiffMode:wt,detailDiffPath:Kt,openDiffDetail:vt,closeDiffDetail:cn,selectDiffFile:Kn,btwVisible:Un,openSideChatTab:Zt,closeSideChat:bn,sidePanelVisible:Pn,panelDragging:rt,closeOpenSidePanel:Hn}=Hbe({client:s,sideWidth:le,detailTarget:L,closeFilePreview:P}),Os=Q(null),xn=Q(!1),ls=Q(!1),As=Q(!1),nn=Q(!1),as=Q(!1),hn=Q(!1),cs=Q(null),us=Q(null),On=D(()=>uc.value>0||xn.value||ls.value||As.value||nn.value||as.value||hn.value||g.value||a.value||c.value),es=Q(!1),ds=Q(!1),Ht=Q(!1),Ze=Q(!1),Ue=Q(!1);async function Ft(){es.value=!0,ds.value=!1,xn.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{ds.value=!0}finally{es.value=!1}}async function jt(){Ht.value=!0,Ze.value=!1,ls.value=!0;try{await s.loadProviders()}catch{Ze.value=!0}finally{Ht.value=!1}}function en(){As.value=!0}async function Qt(ct){xn.value=!1,await un(ct)}async function un(ct){await s.setModel(ct)&&ct!==s.defaultModel.value&&s.updateConfig({defaultModel:ct})}async function Wn(ct){await s.addProvider(ct)}async function Nt(ct){await s.deleteProvider(ct)}async function fs(ct){await s.refreshProvider(ct)}async function ts(ct){Ue.value=!0;try{await s.updateConfig(ct)&&await s.checkAuth()}finally{Ue.value=!1}}async function Zs(){return s.startOAuthLogin()}async function zn(){return s.pollOAuthLogin()}async function Gn(){return s.cancelOAuthLogin()}async function Di(){As.value=!1,await s.checkAuth(),await s.load()}async function Ms(ct){await s.undo(1),await gt(),Os.value?.loadComposerForEdit(ct.text,ct.images)}function _i(ct){if(ct==="/compact"||ct.startsWith("/compact ")){s.compact(ct.slice(8).trim()||void 0);return}if(ct==="/swarm"||ct.startsWith("/swarm ")){const be=ct.slice(6).trim();be==="on"?s.setSwarmMode(!0):be==="off"?s.setSwarmMode(!1):be?(s.setSwarmMode(!0),s.sendPrompt(be)):s.toggleSwarmMode();return}if(ct==="/goal"||ct.startsWith("/goal ")){const be=ct.slice(5).trim();be==="pause"||be==="resume"||be==="cancel"?s.controlGoal(be):be?s.createGoal(be):s.toggleGoalMode();return}if(ct==="/btw"||ct.startsWith("/btw ")){const be=ct.slice(4).trim();!be&&s.sideChatVisible.value?bn():Zt(be||void 0);return}switch(ct){case"/new":case"/clear":Yn();break;case"/fork":s.forkSession();break;case"/export":s.exportSession();break;case"/undo":s.undo();break;case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(x(s.thinking.value));break;case"/status":as.value=!0;break;case"/login":en();break;default:{const be=ct.indexOf(" "),$e=Pie((be===-1?ct:ct.slice(0,be)).slice(1)),sn=be===-1?void 0:ct.slice(be+1).trim()||void 0;if(!$e)break;!s.activeSessionId.value&&s.activeWorkspaceId.value?s.startSessionAndActivateSkill(s.activeWorkspaceId.value,$e,sn):s.activateSkill($e,sn);break}}}function So(ct){s.unqueue(ct)}function Pi(ct){s.unqueue(ct)}function ni(ct){s.reorderQueue(ct.from,ct.to)}async function vs(ct){const be=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&be){await s.startSessionAndSendPrompt(be,ct.text,ct.attachments);return}if(!s.activeSessionId.value&&!be){cs.value=ct,nn.value=!0;return}s.sendPrompt(ct.text,ct.attachments)}async function Co(ct){if(us.value=null,!await s.addWorkspaceByPath(ct)){us.value=i("workspace.addFailed");return}nn.value=!1;const $e=cs.value;cs.value=null;const sn=s.activeWorkspaceId.value;$e&&sn&&await s.startSessionAndSendPrompt(sn,$e.text,$e.attachments)}function sr(){cs.value=null,us.value=null,nn.value=!1}function wi(){gt(()=>{Os.value?.focusComposer()})}function Yn(){const ct=s.activeWorkspaceId.value;ct?s.openWorkspaceDraft(ct):s.clearActiveSession(),wi()}function ys(ct){s.openWorkspaceDraft(ct),wi()}function Ao(ct){ct&&window.open(ct,"_blank","noopener")}return(ct,be)=>(b(),T("div",oxe,[o.value?(b(),ke(exe,{key:0})):re("",!0),C(p)?(b(),T("section",ixe,[w("div",rxe,[(b(),T("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:be[0]||(be[0]=bt(()=>{},["prevent"])),onClick:be[1]||(be[1]=(...$e)=>C(m)&&C(m)(...$e))},[...be[98]||(be[98]=[by('<defs data-v-fc40f999><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-fc40f999><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-fc40f999></rect><g class="ch-eyes" fill="#000" data-v-fc40f999><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-fc40f999></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-fc40f999></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-fc40f999></rect>',2)])],544)),w("div",lxe,[w("h1",null,O(C(i)("app.authPageTitle")),1),w("p",null,O(C(i)("app.authPageMessage")),1)]),ie(Bt,{class:"auth-page-btn",variant:"primary",onClick:en},{default:Me(()=>[ie(je,{name:"log-in",size:"md"}),w("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(b(),T("div",{key:2,class:Pe(["app",{mobile:C(l),"sidebar-collapsed":C(Y)&&!C(l),"macos-desktop":C($c)}]),style:Gt({"--preview-w":C(ge)+"px"})},[C(l)?(b(),ke(cke,{key:1,workspace:C(s).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:C(s).status.value.branch,"session-count":d.value,onOpenSwitcher:be[19]||(be[19]=$e=>a.value=!0),onOpenSettings:be[20]||(be[20]=$e=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(b(),T(Be,{key:0},[ie(DB,{collapsed:C(Y),dragging:C(X),"col-width":C(le),"active-workspace":C(s).visibleWorkspace.value,"active-workspace-id":C(s).activeWorkspaceId.value,sessions:C(s).sessionsForView.value,groups:C(s).workspaceGroups.value,"active-id":C(s).activeSessionId.value,"attention-by-session":C(s).attentionBySession.value,"pending-by-session":C(s).pendingBySession.value,"unread-by-session":C(s).unreadBySession.value,"workspace-sort-mode":C(s).workspaceSortMode.value,backend:C(s).backend.value,onSelect:be[2]||(be[2]=$e=>C(s).selectSession($e)),onCreate:Yn,onCreateInWorkspace:be[3]||(be[3]=$e=>ys($e)),onSelectWorkspace:be[4]||(be[4]=$e=>C(s).openWorkspace($e)),onAddWorkspace:be[5]||(be[5]=$e=>nn.value=!0),onRename:be[6]||(be[6]=($e,sn)=>C(s).renameSession($e,sn)),onArchive:be[7]||(be[7]=$e=>C(s).archiveSession($e)),onFork:be[8]||(be[8]=$e=>C(s).forkSession($e)),onExport:be[9]||(be[9]=$e=>C(s).exportSession($e)),onRenameWorkspace:be[10]||(be[10]=($e,sn)=>C(s).renameWorkspace($e,sn)),onDeleteWorkspace:be[11]||(be[11]=$e=>C(s).deleteWorkspace($e)),onReorderWorkspaces:be[12]||(be[12]=$e=>C(s).reorderWorkspaces($e)),onSetWorkspaceSortMode:be[13]||(be[13]=$e=>C(s).setWorkspaceSortMode($e)),onLoadMoreSessions:be[14]||(be[14]=$e=>void C(s).loadMoreSessions($e)),onLoadAllSessions:be[15]||(be[15]=$e=>void C(s).loadAllSessions()),onOpenSettings:be[16]||(be[16]=$e=>hn.value=!0),onCollapse:C(de)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),Ln(ie(i_,{class:"side-handle","storage-key":C(U),"default-width":C(Z),min:C(ce),max:C(fe),"onUpdate:width":be[17]||(be[17]=$e=>oe.value=$e),"onUpdate:dragging":be[18]||(be[18]=$e=>X.value=$e)},null,8,["storage-key","default-width","min","max"]),[[pi,!C(Y)]])],64)),ie(Zce,{ref_key:"conversationPaneRef",ref:Os,mobile:C(l),turns:C(s).turns.value,"session-id":C(s).activeSessionId.value,approvals:C(s).pendingApprovals.value,changes:C(s).changes.value,"git-info":C(s).gitInfo.value,tasks:C(s).tasks.value,todos:C(s).todos.value,goal:C(s).goal.value,"activation-badges":C(s).activationBadges.value,status:C(s).status.value,thinking:C(s).thinking.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"goal-mode":C(s).goalMode.value,models:C(s).models.value,"starred-ids":C(s).starredModelIds.value,skills:C(s).skills.value,questions:C(s).questions.value,"pending-question-actions":C(s).pendingQuestionActions,"pending-approval-actions":C(s).pendingApprovalActions,running:f.value,queued:C(s).queued.value,"search-files":C(s).searchFiles,"upload-image":C(s).uploadImage,sending:C(s).isSending.value,starting:C(s).isStartingFirstPrompt.value,"fast-moon":C(s).fastMoon.value,"file-reload-key":C(s).activeSessionId.value,"session-loading":C(s).sessionLoading.value,compaction:C(s).compaction.value,"has-more-messages":C(s).hasMoreMessages.value,"loading-more":C(s).loadingMoreMessages.value,"loading-more-error":C(s).loadMoreMessagesError.value,"load-older-messages":C(s).loadOlderMessages,"workspace-name":C(s).visibleWorkspace.value?.name,"workspace-root":C(s).visibleWorkspace.value?.root??C(s).status.value.cwd,"git-diff-stats":C(s).gitDiffStats.value,workspaces:C(s).workspacesView.value,"active-workspace-id":C(s).activeWorkspaceId.value,"session-title":u.value,pr:C(s).activePullRequest.value,"conversation-toc":C(s).conversationToc.value,onOpenChanges:be[21]||(be[21]=$e=>C(vt)()),onSelectWorkspace:be[22]||(be[22]=$e=>ys($e)),onAddWorkspace:be[23]||(be[23]=$e=>nn.value=!0),onOpenPr:Ao,onSubmit:be[24]||(be[24]=$e=>vs($e)),onSteer:be[25]||(be[25]=$e=>C(s).steerPrompt($e.text,$e.attachments)),onApproval:be[26]||(be[26]=($e,sn)=>C(s).respondApproval($e,sn)),onCancelTask:be[27]||(be[27]=$e=>C(s).cancelTask($e)),onAnswer:be[28]||(be[28]=($e,sn)=>C(s).respondQuestion($e,sn)),onDismiss:be[29]||(be[29]=$e=>C(s).dismissQuestion($e)),onCommand:_i,onInterrupt:be[30]||(be[30]=$e=>C(s).abortCurrentPrompt()),onUnqueue:So,onEditQueued:Pi,onReorderQueue:ni,onSetPermission:be[31]||(be[31]=$e=>C(s).setPermission($e)),onSetThinking:be[32]||(be[32]=$e=>C(s).setThinking($e)),onTogglePlan:be[33]||(be[33]=$e=>C(s).togglePlanMode()),onToggleSwarm:be[34]||(be[34]=$e=>C(s).toggleSwarmMode()),onToggleGoal:be[35]||(be[35]=$e=>C(s).toggleGoalMode()),onCreateGoal:be[36]||(be[36]=$e=>C(s).createGoal($e)),onControlGoal:be[37]||(be[37]=$e=>C(s).controlGoal($e)),onRefreshGitStatus:be[38]||(be[38]=$e=>C(s).activeSessionId.value&&C(s).loadGitStatus(C(s).activeSessionId.value)),onRenameSession:be[39]||(be[39]=($e,sn)=>C(s).renameSession($e,sn)),onForkSession:be[40]||(be[40]=$e=>C(s).forkSession($e)),onArchiveSession:be[41]||(be[41]=$e=>C(s).archiveSession($e)),onExportSession:be[42]||(be[42]=$e=>C(s).exportSession($e)),onCompact:be[43]||(be[43]=$e=>C(s).compact()),onPickModel:be[44]||(be[44]=$e=>Ft()),onSelectModel:be[45]||(be[45]=$e=>un($e)),onOpenFile:be[46]||(be[46]=$e=>C(R)($e)),onOpenMedia:be[47]||(be[47]=$e=>C(B)($e)),onOpenThinking:be[48]||(be[48]=$e=>C(j)($e)),onOpenCompaction:be[49]||(be[49]=$e=>C(Ie)($e)),onOpenAgent:be[50]||(be[50]=$e=>C(Ne)($e)),onOpenToolDiff:be[51]||(be[51]=$e=>C(At)($e)),onEditMessage:Ms},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","queued","search-files","upload-image","sending","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!C(l)&&(C($c)||C(Y))?(b(),ke(Dn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(Y)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(de)},{default:Me(()=>[ie(je,{name:C(Y)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):re("",!0),C(Pn)&&!C(l)?(b(),ke(i_,{key:3,class:"preview-handle","storage-key":C(G),"default-width":C(me),min:C(ae),max:C(q),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":be[52]||(be[52]=$e=>ne.value=$e),"onUpdate:dragging":be[53]||(be[53]=$e=>rt.value=$e)},null,8,["storage-key","default-width","min","max","aria-label"])):re("",!0),!C(l)||C(Pn)?(b(),T("aside",{key:4,class:Pe(["global-preview",{open:C(Pn),mobile:C(l),"no-anim":C(rt)||$.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Pn)},[L.value==="thinking"&&C(ye)?(b(),ke(DC,{key:0,text:C(ue)??"",onClose:C(te)},null,8,["text","onClose"])):L.value==="compaction"&&C(Se)?(b(),ke(DC,{key:1,text:C(pe)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(Fe)},null,8,["text","subtitle","onClose"])):L.value==="agent"&&C(he)?(b(),ke(vde,{key:2,member:C(he),onClose:C(Je)},null,8,["member","onClose"])):L.value==="btw"&&C(Un)?(b(),ke(Dde,{key:3,turns:C(s).sideChatTurns.value,running:C(s).sideChatRunning.value,sending:C(s).sideChatSending.value,onSend:be[54]||(be[54]=$e=>C(s).sendSideChatPrompt($e)),onClose:C(bn)},null,8,["turns","running","sending","onClose"])):L.value==="diff"?(b(),ke(ffe,{key:4,mode:C(wt),changes:C(s).changes.value,"git-info":C(s).gitInfo.value,"file-diff":C(s).fileDiff.value,"selected-diff-path":C(s).selectedDiffPath.value,"file-diff-loading":C(s).fileDiffLoading.value,closable:"",onOpen:C(Kn),onBack:be[55]||(be[55]=$e=>{wt.value="list",Kt.value=null,C(s).clearFileDiff()}),onClose:C(cn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):L.value==="toolDiff"&&C(it)?(b(),ke(Nde,{key:5,target:C(it),onClose:C(xt)},null,8,["target","onClose"])):L.value==="file"?(b(),ke(Xue,{key:6,file:C(E),loading:C(N),error:C(F),line:C(_)?.line,"download-url":C(S),closable:"","external-actions":C(I),"open-file":C(R),onClose:C(P),onOpenExternal:C(z),onReveal:C(W)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):re("",!0)],10,axe)):re("",!0),ie(sxe,{class:"internal-build-fab"}),xn.value?(b(),ke(Ife,{key:5,models:C(s).models.value,current:C(s).status.value.modelId,"starred-ids":C(s).starredModelIds.value,loading:es.value,unavailable:ds.value,onSelect:be[56]||(be[56]=$e=>Qt($e)),onToggleStar:be[57]||(be[57]=$e=>C(s).toggleStarModel($e)),onClose:be[58]||(be[58]=$e=>xn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):re("",!0),hn.value?(b(),ke(Hve,{key:6,"color-scheme":C(s).colorScheme.value,accent:C(s).accent.value,"ui-font-size":C(s).uiFontSize.value,"auth-ready":C(s).authReady.value,"account-model":C(s).defaultModel.value,notify:C(s).notifyOnComplete.value,"notify-question":C(s).notifyOnQuestion.value,"notify-approval":C(s).notifyOnApproval.value,"notify-permission":C(s).notifyPermission.value,sound:C(s).soundOnComplete.value,"conversation-toc":C(s).conversationToc.value,config:C(s).config.value,models:C(s).models.value,"config-saving":Ue.value,"server-version":C(s).serverVersion.value,backend:C(s).backend.value,onSetColorScheme:be[59]||(be[59]=$e=>C(s).setColorScheme($e)),onSetAccent:be[60]||(be[60]=$e=>C(s).setAccent($e)),onSetUiFontSize:be[61]||(be[61]=$e=>C(s).setUiFontSize($e)),onSetNotify:be[62]||(be[62]=$e=>C(s).setNotifyOnComplete($e)),onSetNotifyQuestion:be[63]||(be[63]=$e=>C(s).setNotifyOnQuestion($e)),onSetNotifyApproval:be[64]||(be[64]=$e=>C(s).setNotifyOnApproval($e)),onSetSound:be[65]||(be[65]=$e=>C(s).setSoundOnComplete($e)),onSetConversationToc:be[66]||(be[66]=$e=>C(s).setConversationToc($e)),onUpdateConfig:be[67]||(be[67]=$e=>ts($e)),onLogin:be[68]||(be[68]=()=>{hn.value=!1,en()}),onLogout:C(s).logout,onOpenOnboarding:be[69]||(be[69]=()=>{hn.value=!1,y()}),onOpenProviders:be[70]||(be[70]=()=>{hn.value=!1,jt()}),onClose:be[71]||(be[71]=$e=>hn.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):re("",!0),ls.value?(b(),ke(nhe,{key:7,providers:C(s).providers.value,loading:Ht.value,unavailable:Ze.value,onAdd:be[72]||(be[72]=$e=>Wn($e)),onRefresh:be[73]||(be[73]=$e=>fs($e)),onDelete:be[74]||(be[74]=$e=>Nt($e)),onOpenLogin:be[75]||(be[75]=()=>{ls.value=!1,en()}),onClose:be[76]||(be[76]=$e=>ls.value=!1)},null,8,["providers","loading","unavailable"])):re("",!0),as.value?(b(),ke(zye,{key:8,status:C(s).status.value,thinking:k.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"cost-usd":C(s).sessionCost.value,onClose:be[77]||(be[77]=$e=>as.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):re("",!0),nn.value?(b(),ke(Aye,{key:9,"browse-fs":C(s).browseFs,"get-fs-home":C(s).getFsHome,"default-path":C(s).visibleWorkspace.value?.root??C(s).status.value.cwd,error:us.value,onAdd:be[78]||(be[78]=$e=>Co($e)),onClose:sr},null,8,["browse-fs","get-fs-home","default-path","error"])):re("",!0),ie(El,{name:"gload-fade"},{default:Me(()=>[C(s).initialized.value?re("",!0):(b(),ke(obe,{key:0,issue:C(s).connectIssue.value},null,8,["issue"]))]),_:1}),C(s).initialized.value&&g.value&&!C(p)?(b(),ke(Q2e,{key:10,onComplete:v,onSkip:v})):re("",!0),ie(eke,{warnings:C(s).warnings.value,onDismiss:C(s).dismissWarning},null,8,["warnings","onDismiss"]),C(r)?(b(),ke(Fbe,{key:11})):re("",!0),ie(Nye),C(l)?(b(),ke($ke,{key:12,modelValue:a.value,"onUpdate:modelValue":be[79]||(be[79]=$e=>a.value=$e),groups:C(s).workspaceGroups.value,"active-workspace-id":C(s).activeWorkspaceId.value,"active-id":C(s).activeSessionId.value,"attention-by-session":C(s).attentionBySession.value,"attention-by-workspace":C(s).attentionByWorkspace.value,onSelect:be[80]||(be[80]=$e=>C(s).selectSession($e)),onCreate:Yn,onCreateInWorkspace:be[81]||(be[81]=$e=>ys($e)),onAddWorkspace:be[82]||(be[82]=$e=>nn.value=!0),onRename:be[83]||(be[83]=($e,sn)=>C(s).renameSession($e,sn)),onArchive:be[84]||(be[84]=$e=>C(s).archiveSession($e)),onDeleteWorkspace:be[85]||(be[85]=$e=>C(s).deleteWorkspace($e)),onLoadMore:be[86]||(be[86]=$e=>void C(s).loadMoreSessions($e))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):re("",!0),C(l)?(b(),ke(P2e,{key:13,modelValue:c.value,"onUpdate:modelValue":be[87]||(be[87]=$e=>c.value=$e),status:C(s).status.value,thinking:C(s).thinking.value,models:C(s).models.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"color-scheme":C(s).colorScheme.value,"ui-font-size":C(s).uiFontSize.value,"auth-ready":C(s).authReady.value,"conversation-toc":C(s).conversationToc.value,"server-version":C(s).serverVersion.value,onPickModel:be[88]||(be[88]=$e=>Ft()),onSetThinking:be[89]||(be[89]=$e=>C(s).setThinking($e)),onTogglePlan:be[90]||(be[90]=$e=>C(s).togglePlanMode()),onToggleSwarm:be[91]||(be[91]=$e=>C(s).toggleSwarmMode()),onSetPermission:be[92]||(be[92]=$e=>C(s).setPermission($e)),onSetColorScheme:be[93]||(be[93]=$e=>C(s).setColorScheme($e)),onSetUiFontSize:be[94]||(be[94]=$e=>C(s).setUiFontSize($e)),onSetConversationToc:be[95]||(be[95]=$e=>C(s).setConversationToc($e)),onLogin:be[96]||(be[96]=()=>{c.value=!1,en()}),onLogout:C(s).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):re("",!0)],6)),As.value?(b(),ke($he,{key:3,"on-start-o-auth-login":Zs,"on-poll-o-auth-login":zn,"on-cancel-o-auth-login":Gn,onSuccess:Di,onClose:be[97]||(be[97]=$e=>As.value=!1)})):re("",!0)]))}}),uxe=dt(cxe,[["__scopeId","data-v-fc40f999"]]);Tte();Gh(uxe).use(An).mount("#app");export{xE as $,q4 as A,dT as B,xs as C,c_e as D,a4 as E,Be as F,by as G,Xe as H,ie as I,qE as J,Fxe as K,Ii as L,Ye as M,B9 as N,Dxe as O,Pxe as P,zxe as Q,Nh as R,Nc as S,sm as T,Hxe as U,_y as V,Bxe as W,d_e as X,Wxe as Y,o_e as Z,fxe as _,B4 as a,Vs as a$,Ys as a0,oy as a1,bxe as a2,uy as a3,l9 as a4,vn as a5,Xc as a6,Axe as a7,p_e as a8,Nxe as a9,z4 as aA,_T as aB,ET as aC,yn as aD,MT as aE,AT as aF,iy as aG,CT as aH,Sn as aI,fy as aJ,YE as aK,b as aL,F9 as aM,Sxe as aN,In as aO,A4 as aP,wxe as aQ,Oh as aR,Ps as aS,$h as aT,Q as aU,Xxe as aV,J9 as aW,st as aX,Fn as aY,NT as aZ,Oxe as a_,Lxe as aa,$xe as ab,Ixe as ac,e_e as ad,m_e as ae,Vt as af,h9 as ag,tm as ah,bl as ai,Rr as aj,ps as ak,Jxe as al,Go as am,Ml as an,mt as ao,jxe as ap,Vxe as aq,_n as ar,gt as as,y9 as at,Pe as au,dxe as av,Gt as aw,xT as ax,ST as ay,ms as az,_xe as b,oX as b$,l_e as b0,fd as b1,Wh as b2,i_e as b3,Al as b4,HE as b5,pxe as b6,Ta as b7,nT as b8,r_e as b9,wo as bA,pi as bB,p9 as bC,n_e as bD,Qe as bE,oT as bF,Mxe as bG,iT as bH,Gxe as bI,Me as bJ,Uxe as bK,Ln as bL,Xi as bM,t_e as bN,bt as bO,Cxe as bP,kn as bQ,mo as bR,C_e as bS,KX as bT,NM as bU,M_e as bV,_Q as bW,hk as bX,A_e as bY,pv as bZ,L_e as b_,hxe as ba,O as bb,rh as bc,Rxe as bd,on as be,vxe as bf,gxe as bg,C4 as bh,Qxe as bi,mxe as bj,C as bk,Pd as bl,h_e as bm,u_e as bn,P9 as bo,Exe as bp,Yxe as bq,sT as br,f_e as bs,qxe as bt,Txe as bu,R4 as bv,Kh as bw,G9 as bx,T3 as by,Hg as bz,s_e as c,sX as c0,uk as c1,nX as c2,__e as c3,mQ as c4,x_e as c5,yp as c6,y_e as c7,tX as c8,SM as c9,$_e as ca,k_e as cb,O_e as cc,bv as cd,xc as ce,yv as cf,R_e as cg,F_e as ch,S_e as ci,jo as cj,b_e as ck,w_e as cl,SQ as cm,I_e as cn,kv as co,vv as cp,N_e as cq,v_e as cr,T_e as cs,E_e as ct,je as cu,g_e as cv,dt as cw,Zxe as d,xl as e,yxe as f,El as g,z9 as h,kxe as i,xxe as j,bi as k,Rd as l,Fs as m,Kp as n,Br as o,a_e as p,D as q,Gh as r,ke as s,re as t,T as u,w as v,XT as w,Kxe as x,QT as y,e7 as z};