@moonshot-ai/kimi-code 0.23.5 → 0.23.6

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 (71) hide show
  1. package/dist/main.mjs +756 -556
  2. package/dist-web/assets/{CodeBlockNode-KR0ZBibg.js → CodeBlockNode-B5sM5iYb.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-Bl31Ov6p.js → CodeBlockShell.vue_vue_type_style_index_0_lang-DJ0XaWcQ.js} +1 -1
  4. package/dist-web/assets/DesignSystemView-CrA0fNau.js +13 -0
  5. package/dist-web/assets/DesignSystemView-prdQJClv.css +1 -0
  6. package/dist-web/assets/{Tooltip-CXVZw3LD.js → Tooltip-BzkYFuS-.js} +1 -1
  7. package/dist-web/assets/{arc-D-rA9VJS.js → arc-hZy2ybJx.js} +1 -1
  8. package/dist-web/assets/{architectureDiagram-3BPJPVTR-DCwhZ0-3.js → architectureDiagram-3BPJPVTR-Dme2VOsk.js} +1 -1
  9. package/dist-web/assets/{blockDiagram-GPEHLZMM-7zi2-mzu.js → blockDiagram-GPEHLZMM-DPYxkkxc.js} +1 -1
  10. package/dist-web/assets/{c4Diagram-AAUBKEIU-BUhBYlbI.js → c4Diagram-AAUBKEIU-BaBOqczU.js} +1 -1
  11. package/dist-web/assets/channel--SU3IV4L.js +1 -0
  12. package/dist-web/assets/{chunk-2J33WTMH-DXfD8jVe.js → chunk-2J33WTMH-D12pYaz9.js} +1 -1
  13. package/dist-web/assets/{chunk-4BX2VUAB-RnAXB6Jd.js → chunk-4BX2VUAB-BXPJT0AD.js} +1 -1
  14. package/dist-web/assets/{chunk-55IACEB6-CzyvmHuE.js → chunk-55IACEB6-BTJjSIMx.js} +1 -1
  15. package/dist-web/assets/{chunk-727SXJPM-BwBvbidm.js → chunk-727SXJPM-BorazSkv.js} +1 -1
  16. package/dist-web/assets/{chunk-AQP2D5EJ-DHeLjRn1.js → chunk-AQP2D5EJ-3eB1WiGE.js} +1 -1
  17. package/dist-web/assets/{chunk-FMBD7UC4-Bm646OfX.js → chunk-FMBD7UC4-BN6eq3TW.js} +1 -1
  18. package/dist-web/assets/{chunk-ND2GUHAM-D3VSc8VX.js → chunk-ND2GUHAM-CzHkIi39.js} +1 -1
  19. package/dist-web/assets/{chunk-QZHKN3VN-BvZn7Sbo.js → chunk-QZHKN3VN-CAAkvUsl.js} +1 -1
  20. package/dist-web/assets/classDiagram-4FO5ZUOK-Cev__UDN.js +1 -0
  21. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Cev__UDN.js +1 -0
  22. package/dist-web/assets/{cose-bilkent-S5V4N54A-DdsbNmIL.js → cose-bilkent-S5V4N54A-CO12pcZF.js} +1 -1
  23. package/dist-web/assets/{dagre-BM42HDAG--3VOObN-.js → dagre-BM42HDAG-BHHr0pRl.js} +1 -1
  24. package/dist-web/assets/{diagram-2AECGRRQ-DeWvFgbz.js → diagram-2AECGRRQ-OR0kYM7N.js} +1 -1
  25. package/dist-web/assets/{diagram-5GNKFQAL-DthtQYgS.js → diagram-5GNKFQAL-BuWjKSqL.js} +1 -1
  26. package/dist-web/assets/{diagram-KO2AKTUF-Bt4BtRLc.js → diagram-KO2AKTUF-VPe8ZEiS.js} +1 -1
  27. package/dist-web/assets/{diagram-LMA3HP47-7N499o4j.js → diagram-LMA3HP47-BvTXlHih.js} +1 -1
  28. package/dist-web/assets/{diagram-OG6HWLK6-Br3CxOQX.js → diagram-OG6HWLK6-goJtZNF9.js} +1 -1
  29. package/dist-web/assets/{erDiagram-TEJ5UH35-BrhRvGW3.js → erDiagram-TEJ5UH35-DRnuyJ1R.js} +1 -1
  30. package/dist-web/assets/{flowDiagram-I6XJVG4X-D-u112mz.js → flowDiagram-I6XJVG4X-CWAtDH7Q.js} +1 -1
  31. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DpXOgY93.js → ganttDiagram-6RSMTGT7-DpNy6QeS.js} +1 -1
  32. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-BzV-RpYW.js → gitGraphDiagram-PVQCEYII-D7ekpdjQ.js} +1 -1
  33. package/dist-web/assets/{index-DrI3jjno.js → index-BPhahMpb.js} +1 -1
  34. package/dist-web/assets/index-DZAkQfN3.js +322 -0
  35. package/dist-web/assets/{index-DEjpFBq9.js → index-De7eXGys.js} +2 -2
  36. package/dist-web/assets/{index-5DXn785n.css → index-u0HjHtha.css} +1 -1
  37. package/dist-web/assets/{index10-UVo4gjYR.js → index10-B4kCqL2q.js} +1 -1
  38. package/dist-web/assets/{index11-m1oYWviR.js → index11-CdYjVQZ3.js} +1 -1
  39. package/dist-web/assets/{index5-B45mMYRO.js → index5-CuGXaX2S.js} +1 -1
  40. package/dist-web/assets/{index6-DvvrfRua.js → index6-Bu6r1Fdb.js} +1 -1
  41. package/dist-web/assets/{index7-BUH5Peml.js → index7-BBWbs1u4.js} +1 -1
  42. package/dist-web/assets/{index8-1BPQUZEF.js → index8-B1e6fpQC.js} +2 -2
  43. package/dist-web/assets/{infoDiagram-5YYISTIA-Cu7fADeQ.js → infoDiagram-5YYISTIA-DWJMi_CT.js} +1 -1
  44. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-CVvnTORb.js → ishikawaDiagram-YF4QCWOH-DKnaDM-v.js} +1 -1
  45. package/dist-web/assets/{journeyDiagram-JHISSGLW-C-69S6wV.js → journeyDiagram-JHISSGLW-CuTF_v7K.js} +1 -1
  46. package/dist-web/assets/{kanban-definition-UN3LZRKU-pwEooP5T.js → kanban-definition-UN3LZRKU-7ZkgOrqm.js} +1 -1
  47. package/dist-web/assets/{linear-BQ3ylJG8.js → linear-BZuIfHuU.js} +1 -1
  48. package/dist-web/assets/{mermaid.core-DcE0EhAy.js → mermaid.core-BU-yVv7K.js} +4 -4
  49. package/dist-web/assets/{mindmap-definition-RKZ34NQL-DKQ2AZ3h.js → mindmap-definition-RKZ34NQL-DME_lWCk.js} +1 -1
  50. package/dist-web/assets/{pieDiagram-4H26LBE5-CHb1kYTj.js → pieDiagram-4H26LBE5-Co1VItYc.js} +1 -1
  51. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DzFGGLJt.js → quadrantDiagram-W4KKPZXB-DpswDnET.js} +1 -1
  52. package/dist-web/assets/{requirementDiagram-4Y6WPE33-Bk-5_Exk.js → requirementDiagram-4Y6WPE33-BeRdWb9K.js} +1 -1
  53. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-CSxfPrmb.js → sankeyDiagram-5OEKKPKP-_DYbW6pt.js} +1 -1
  54. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-DHFbmk49.js → sequenceDiagram-3UESZ5HK-DHiijecn.js} +1 -1
  55. package/dist-web/assets/{stateDiagram-AJRCARHV-DR8SEStc.js → stateDiagram-AJRCARHV-DCZ1rX02.js} +1 -1
  56. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Cw0BsNEk.js +1 -0
  57. package/dist-web/assets/{timeline-definition-PNZ67QCA-O5r5mf9f.js → timeline-definition-PNZ67QCA-CUBRS-qH.js} +1 -1
  58. package/dist-web/assets/{vennDiagram-CIIHVFJN-BRtD6E2o.js → vennDiagram-CIIHVFJN-C98FTG2Y.js} +1 -1
  59. package/dist-web/assets/{vue.runtime.esm-bundler-ClW1ucng.js → vue.runtime.esm-bundler-DPzO-Tma.js} +1 -1
  60. package/dist-web/assets/{wardley-L42UT6IY-BqzYPkrr.js → wardley-L42UT6IY-Bmyzb8p9.js} +1 -1
  61. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-BXjVelBc.js → wardleyDiagram-YWT4CUSO-CxFNYY1a.js} +1 -1
  62. package/dist-web/assets/{xychartDiagram-2RQKCTM6-Cc97QEmc.js → xychartDiagram-2RQKCTM6-ySyVEQA-.js} +1 -1
  63. package/dist-web/index.html +2 -2
  64. package/package.json +5 -5
  65. package/dist-web/assets/DesignSystemView-B0VQ8shl.css +0 -1
  66. package/dist-web/assets/DesignSystemView-DU67euCs.js +0 -13
  67. package/dist-web/assets/channel-B7bRl8z3.js +0 -1
  68. package/dist-web/assets/classDiagram-4FO5ZUOK-CxRebqWF.js +0 -1
  69. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CxRebqWF.js +0 -1
  70. package/dist-web/assets/index-6oRZtoED.js +0 -322
  71. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Cp9aas86.js +0 -1
@@ -0,0 +1,322 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-CrA0fNau.js","assets/DesignSystemView-prdQJClv.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-B5sM5iYb.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-DJ0XaWcQ.js","assets/index8-B1e6fpQC.js","assets/index11-CdYjVQZ3.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 wp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const tn={},hc=[],pi=()=>{},jC=()=>!1,_d=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Sp=e=>e.startsWith("onUpdate:"),Cn=Object.assign,Hv=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},V8=Object.prototype.hasOwnProperty,pn=(e,t)=>V8.call(e,t),wt=Array.isArray,pc=e=>Pc(e)==="[object Map]",ya=e=>Pc(e)==="[object Set]",hb=e=>Pc(e)==="[object Date]",K8=e=>Pc(e)==="[object RegExp]",Bt=e=>typeof e=="function",Tn=e=>typeof e=="string",Go=e=>typeof e=="symbol",mn=e=>e!==null&&typeof e=="object",Wv=e=>(mn(e)||Bt(e))&&Bt(e.then)&&Bt(e.catch),qC=Object.prototype.toString,Pc=e=>qC.call(e),G8=e=>Pc(e).slice(8,-1),Cp=e=>Pc(e)==="[object Object]",Ap=e=>Tn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,oa=wp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Mp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Y8=/-\w/g,ws=Mp(e=>e.replace(Y8,t=>t.slice(1).toUpperCase())),Z8=/\B([A-Z])/g,xo=Mp(e=>e.replace(Z8,"-$1").toLowerCase()),Ep=Mp(e=>e.charAt(0).toUpperCase()+e.slice(1)),jf=Mp(e=>e?`on${Ep(e)}`:""),Ds=(e,t)=>!Object.is(e,t),mc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},VC=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Tp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},fh=e=>{const t=Tn(e)?Number(e):NaN;return isNaN(t)?e:t};let pb;const Np=()=>pb||(pb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Q8="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",X8=wp(Q8);function Jt(e){if(wt(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Tn(s)?nE(s):Jt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Tn(e)||mn(e))return e}const J8=/;(?![^(]*\))/g,eE=/:([^]+)/,tE=/\/\*[^]*?\*\//g;function nE(e){const t={};return e.replace(tE,"").split(J8).forEach(n=>{if(n){const s=n.split(eE);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Pe(e){let t="";if(Tn(e))t=e;else if(wt(e))for(let n=0;n<e.length;n++){const s=Pe(e[n]);s&&(t+=s+" ")}else if(mn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Mbe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Tn(t)&&(e.class=Pe(t)),n&&(e.style=Jt(n)),e}const sE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",oE=wp(sE);function KC(e){return!!e||e===""}function iE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Cr(e[s],t[s]);return n}function Cr(e,t){if(e===t)return!0;let n=hb(e),s=hb(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Go(e),s=Go(t),n||s)return e===t;if(n=wt(e),s=wt(t),n||s)return n&&s?iE(e,t):!1;if(n=mn(e),s=mn(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||!Cr(e[r],t[r]))return!1}}return String(e)===String(t)}function Ip(e,t){return e.findIndex(n=>Cr(n,t))}const GC=e=>!!(e&&e.__v_isRef===!0),O=e=>Tn(e)?e:e==null?"":wt(e)||mn(e)&&(e.toString===qC||!Bt(e.toString))?GC(e)?O(e.value):JSON.stringify(e,YC,2):String(e),YC=(e,t)=>GC(t)?YC(e,t.value):pc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[S1(s,i)+" =>"]=o,n),{})}:ya(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>S1(n))}:Go(t)?S1(t):mn(t)&&!wt(t)&&!Cp(t)?String(t):t,S1=(e,t="")=>{var n;return Go(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function rE(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 ZC{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 lE(e){return new ZC(e)}function zv(){return _s}function Uv(e,t=!1){_s&&_s.cleanups.push(e)}let Dn;const C1=new WeakSet;class hh{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,C1.has(this)&&(C1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||XC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,mb(this),JC(this);const t=Dn,n=Mi;Dn=this,Mi=!0;try{return this.fn()}finally{e4(this),Dn=t,Mi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Vv(t);this.deps=this.depsTail=void 0,mb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?C1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){rg(this)&&this.run()}get dirty(){return rg(this)}}let QC=0,Tu,Nu;function XC(e,t=!1){if(e.flags|=8,t){e.next=Nu,Nu=e;return}e.next=Tu,Tu=e}function jv(){QC++}function qv(){if(--QC>0)return;if(Nu){let t=Nu;for(Nu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Tu;){let t=Tu;for(Tu=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function JC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function e4(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Vv(s),aE(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function rg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(t4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function t4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Yu)||(e.globalVersion=Yu,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!rg(e))))return;e.flags|=2;const t=e.dep,n=Dn,s=Mi;Dn=e,Mi=!0;try{JC(e);const o=e.fn(e._value);(t.version===0||Ds(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Dn=n,Mi=s,e4(e),e.flags&=-3}}function Vv(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)Vv(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function aE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Ebe(e,t){e.effect instanceof hh&&(e=e.effect.fn);const n=new hh(e);t&&Cn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function Tbe(e){e.effect.stop()}let Mi=!0;const n4=[];function Ar(){n4.push(Mi),Mi=!1}function Mr(){const e=n4.pop();Mi=e===void 0?!0:e}function mb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Dn;Dn=void 0;try{t()}finally{Dn=n}}}let Yu=0;class cE{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 $p{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(!Dn||!Mi||Dn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Dn)n=this.activeLink=new cE(Dn,this),Dn.deps?(n.prevDep=Dn.depsTail,Dn.depsTail.nextDep=n,Dn.depsTail=n):Dn.deps=Dn.depsTail=n,s4(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=Dn.depsTail,n.nextDep=void 0,Dn.depsTail.nextDep=n,Dn.depsTail=n,Dn.deps===n&&(Dn.deps=s)}return n}trigger(t){this.version++,Yu++,this.notify(t)}notify(t){jv();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{qv()}}}function s4(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)s4(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ph=new WeakMap,ia=Symbol(""),lg=Symbol(""),Zu=Symbol("");function Gs(e,t,n){if(Mi&&Dn){let s=ph.get(e);s||ph.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new $p),o.map=s,o.key=n),o.track()}}function gr(e,t,n,s,o,i){const r=ph.get(e);if(!r){Yu++;return}const l=a=>{a&&a.trigger()};if(jv(),t==="clear")r.forEach(l);else{const a=wt(e),c=a&&Ap(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===Zu||!Go(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Zu)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ia)),pc(e)&&l(r.get(lg)));break;case"delete":a||(l(r.get(ia)),pc(e)&&l(r.get(lg)));break;case"set":pc(e)&&l(r.get(ia));break}}qv()}function uE(e,t){const n=ph.get(e);return n&&n.get(t)}function Wa(e){const t=ln(e);return t===e?t:(Gs(t,"iterate",Zu),zo(e)?t:t.map(Ti))}function Lp(e){return Gs(e=ln(e),"iterate",Zu),e}function Ui(e,t){return Er(e)?Tc(cl(e)?Ti(t):t):Ti(t)}const dE={__proto__:null,[Symbol.iterator](){return A1(this,Symbol.iterator,e=>Ui(this,e))},concat(...e){return Wa(this).concat(...e.map(t=>wt(t)?Wa(t):t))},entries(){return A1(this,"entries",e=>(e[1]=Ui(this,e[1]),e))},every(e,t){return or(this,"every",e,t,void 0,arguments)},filter(e,t){return or(this,"filter",e,t,n=>n.map(s=>Ui(this,s)),arguments)},find(e,t){return or(this,"find",e,t,n=>Ui(this,n),arguments)},findIndex(e,t){return or(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return or(this,"findLast",e,t,n=>Ui(this,n),arguments)},findLastIndex(e,t){return or(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return or(this,"forEach",e,t,void 0,arguments)},includes(...e){return M1(this,"includes",e)},indexOf(...e){return M1(this,"indexOf",e)},join(e){return Wa(this).join(e)},lastIndexOf(...e){return M1(this,"lastIndexOf",e)},map(e,t){return or(this,"map",e,t,void 0,arguments)},pop(){return du(this,"pop")},push(...e){return du(this,"push",e)},reduce(e,...t){return gb(this,"reduce",e,t)},reduceRight(e,...t){return gb(this,"reduceRight",e,t)},shift(){return du(this,"shift")},some(e,t){return or(this,"some",e,t,void 0,arguments)},splice(...e){return du(this,"splice",e)},toReversed(){return Wa(this).toReversed()},toSorted(e){return Wa(this).toSorted(e)},toSpliced(...e){return Wa(this).toSpliced(...e)},unshift(...e){return du(this,"unshift",e)},values(){return A1(this,"values",e=>Ui(this,e))}};function A1(e,t,n){const s=Lp(e),o=s[t]();return s!==e&&!zo(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const fE=Array.prototype;function or(e,t,n,s,o,i){const r=Lp(e),l=r!==e&&!zo(e),a=r[t];if(a!==fE[t]){const d=a.apply(e,i);return l?Ti(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Ui(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 gb(e,t,n,s){const o=Lp(e),i=o!==e&&!zo(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Ui(e,c)),n.call(this,c,Ui(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?Ui(e,a):a}function M1(e,t,n){const s=ln(e);Gs(s,"iterate",Zu);const o=s[t](...n);return(o===-1||o===!1)&&Rp(n[0])?(n[0]=ln(n[0]),s[t](...n)):o}function du(e,t,n=[]){Ar(),jv();const s=ln(e)[t].apply(e,n);return qv(),Mr(),s}const hE=wp("__proto__,__v_isRef,__isVue"),o4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Go));function pE(e){Go(e)||(e=String(e));const t=ln(this);return Gs(t,"has",e),t.hasOwnProperty(e)}class i4{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?d4:u4:i?c4:a4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=wt(t);if(!o){let a;if(r&&(a=dE[n]))return a;if(n==="hasOwnProperty")return pE}const l=Reflect.get(t,n,is(t)?t:s);if((Go(n)?o4.has(n):hE(n))||(o||Gs(t,"get",n),i))return l;if(is(l)){const a=r&&Ap(n)?l:l.value;return o&&mn(a)?mh(a):a}return mn(l)?o?mh(l):Ns(l):l}}class r4 extends i4{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=wt(t)&&Ap(n);if(!this._isShallow){const c=Er(i);if(!zo(s)&&!Er(s)&&(i=ln(i),s=ln(s)),!r&&is(i)&&!is(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:pn(t,n),a=Reflect.set(t,n,s,is(t)?t:o);return t===ln(o)&&(l?Ds(s,i)&&gr(t,"set",n,s):gr(t,"add",n,s)),a}deleteProperty(t,n){const s=pn(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&gr(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Go(n)||!o4.has(n))&&Gs(t,"has",n),s}ownKeys(t){return Gs(t,"iterate",wt(t)?"length":ia),Reflect.ownKeys(t)}}class l4 extends i4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const mE=new r4,gE=new l4,vE=new r4(!0),yE=new l4(!0),ag=e=>e,af=e=>Reflect.getPrototypeOf(e);function kE(e,t,n){return function(...s){const o=this.__v_raw,i=ln(o),r=pc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?ag:t?Tc:Ti;return!t&&Gs(i,"iterate",a?lg:ia),Cn(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 cf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function bE(e,t){const n={get(o){const i=this.__v_raw,r=ln(i),l=ln(o);e||(Ds(o,l)&&Gs(r,"get",o),Gs(r,"get",l));const{has:a}=af(r),c=t?ag:e?Tc:Ti;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&&Gs(ln(o),"iterate",ia),o.size},has(o){const i=this.__v_raw,r=ln(i),l=ln(o);return e||(Ds(o,l)&&Gs(r,"has",o),Gs(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=ln(l),c=t?ag:e?Tc:Ti;return!e&&Gs(a,"iterate",ia),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return Cn(n,e?{add:cf("add"),set:cf("set"),delete:cf("delete"),clear:cf("clear")}:{add(o){const i=ln(this),r=af(i),l=ln(o),a=!t&&!zo(o)&&!Er(o)?l:o;return r.has.call(i,a)||Ds(o,a)&&r.has.call(i,o)||Ds(l,a)&&r.has.call(i,l)||(i.add(a),gr(i,"add",a,a)),this},set(o,i){!t&&!zo(i)&&!Er(i)&&(i=ln(i));const r=ln(this),{has:l,get:a}=af(r);let c=l.call(r,o);c||(o=ln(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Ds(i,u)&&gr(r,"set",o,i):gr(r,"add",o,i),this},delete(o){const i=ln(this),{has:r,get:l}=af(i);let a=r.call(i,o);a||(o=ln(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&gr(i,"delete",o,void 0),c},clear(){const o=ln(this),i=o.size!==0,r=o.clear();return i&&gr(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=kE(o,e,t)}),n}function Fp(e,t){const n=bE(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(pn(n,o)&&o in s?n:s,o,i)}const xE={get:Fp(!1,!1)},_E={get:Fp(!1,!0)},wE={get:Fp(!0,!1)},SE={get:Fp(!0,!0)},a4=new WeakMap,c4=new WeakMap,u4=new WeakMap,d4=new WeakMap;function CE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ns(e){return Er(e)?e:Op(e,!1,mE,xE,a4)}function AE(e){return Op(e,!1,vE,_E,c4)}function mh(e){return Op(e,!0,gE,wE,u4)}function Nbe(e){return Op(e,!0,yE,SE,d4)}function Op(e,t,n,s,o){if(!mn(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=CE(G8(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function cl(e){return Er(e)?cl(e.__v_raw):!!(e&&e.__v_isReactive)}function Er(e){return!!(e&&e.__v_isReadonly)}function zo(e){return!!(e&&e.__v_isShallow)}function Rp(e){return e?!!e.__v_raw:!1}function ln(e){const t=e&&e.__v_raw;return t?ln(t):e}function yt(e){return!pn(e,"__v_skip")&&Object.isExtensible(e)&&VC(e,"__v_skip",!0),e}const Ti=e=>mn(e)?Ns(e):e,Tc=e=>mn(e)?mh(e):e;function is(e){return e?e.__v_isRef===!0:!1}function Q(e){return f4(e,!1)}function ka(e){return f4(e,!0)}function f4(e,t){return is(e)?e:new ME(e,t)}class ME{constructor(t,n){this.dep=new $p,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ln(t),this._value=n?t:Ti(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||zo(t)||Er(t);t=s?t:ln(t),Ds(t,n)&&(this._rawValue=t,this._value=s?t:Ti(t),this.dep.trigger())}}function Ibe(e){e.dep&&e.dep.trigger()}function C(e){return is(e)?e.value:e}function h4(e){return Bt(e)?e():C(e)}const EE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return is(o)&&!is(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function p4(e){return cl(e)?e:new Proxy(e,EE)}class TE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new $p,{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 NE(e){return new TE(e)}function $be(e){const t=wt(e)?new Array(e.length):{};for(const n in e)t[n]=m4(e,n);return t}class IE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Go(n)?n:String(n),this._raw=ln(t);let o=!0,i=t;if(!wt(t)||Go(this._key)||!Ap(this._key))do o=!Rp(i)||zo(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&&is(this._raw[this._key])){const n=this._object[this._key];if(is(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return uE(this._raw,this._key)}}class $E{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 Lbe(e,t,n){return is(e)?e:Bt(e)?new $E(e):mn(e)&&arguments.length>1?m4(e,t,n):Q(e)}function m4(e,t,n){return new IE(e,t,n)}class LE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new $p(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Yu-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Dn!==this)return XC(this,!0),!0}get value(){const t=this.dep.track();return t4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function FE(e,t,n=!1){let s,o;return Bt(e)?s=e:(s=e.get,o=e.set),new LE(s,o,n)}const Fbe={GET:"get",HAS:"has",ITERATE:"iterate"},Obe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},uf={},gh=new WeakMap;let Jr;function Rbe(){return Jr}function OE(e,t=!1,n=Jr){if(n){let s=gh.get(n);s||gh.set(n,s=[]),s.push(e)}}function RE(e,t,n=tn){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:zo(y)||o===!1||o===0?vr(y,1):vr(y);let u,d,f,p,h=!1,m=!1;if(is(e)?(d=()=>e.value,h=zo(e)):cl(e)?(d=()=>c(e),h=!0):wt(e)?(m=!0,h=e.some(y=>cl(y)||zo(y)),d=()=>e.map(y=>{if(is(y))return y.value;if(cl(y))return c(y);if(Bt(y))return a?a(y,2):y()})):Bt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Ar();try{f()}finally{Mr()}}const y=Jr;Jr=u;try{return a?a(e,3,[p]):e(p)}finally{Jr=y}}:d=pi,t&&o){const y=d,A=o===!0?1/0:o;d=()=>vr(y(),A)}const _=zv(),k=()=>{u.stop(),_&&_.active&&Hv(_.effects,u)};if(i&&t){const y=t;t=(...A)=>{y(...A),k()}}let g=m?new Array(e.length).fill(uf):uf;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const A=u.run();if(o||h||(m?A.some((L,$)=>Ds(L,g[$])):Ds(A,g))){f&&f();const L=Jr;Jr=u;try{const $=[A,g===uf?void 0:m&&g[0]===uf?[]:g,p];g=A,a?a(t,3,$):t(...$)}finally{Jr=L}}}else u.run()};return l&&l(v),u=new hh(d),u.scheduler=r?()=>r(v,!1):v,p=y=>OE(y,!1,u),f=u.onStop=()=>{const y=gh.get(u);if(y){if(a)a(y,4);else for(const A of y)A();gh.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 vr(e,t=1/0,n){if(t<=0||!mn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,is(e))vr(e.value,t,n);else if(wt(e))for(let s=0;s<e.length;s++)vr(e[s],t,n);else if(ya(e)||pc(e))e.forEach(s=>{vr(s,t,n)});else if(Cp(e)){for(const s in e)vr(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&vr(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 g4=[];function BE(e){g4.push(e)}function DE(){g4.pop()}function Bbe(e,t){}const Dbe={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"},PE={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 wd(e,t,n,s){try{return s?e(...s):e()}catch(o){Hc(o,t,n)}}function vi(e,t,n,s){if(Bt(e)){const o=wd(e,t,n,s);return o&&Wv(o)&&o.catch(i=>{Hc(i,t,n)}),o}if(wt(e)){const o=[];for(let i=0;i<e.length;i++)o.push(vi(e[i],t,n,s));return o}}function Hc(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||tn;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){Ar(),wd(i,null,10,[e,a,c]),Mr();return}}HE(e,n,o,s,r)}function HE(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const oo=[];let Hi=-1;const gc=[];let el=null,Qa=0;const v4=Promise.resolve();let vh=null;function vt(e){const t=vh||v4;return e?t.then(this?e.bind(this):e):t}function WE(e){let t=Hi+1,n=oo.length;for(;t<n;){const s=t+n>>>1,o=oo[s],i=Qu(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function Kv(e){if(!(e.flags&1)){const t=Qu(e),n=oo[oo.length-1];!n||!(e.flags&2)&&t>=Qu(n)?oo.push(e):oo.splice(WE(t),0,e),e.flags|=1,y4()}}function y4(){vh||(vh=v4.then(k4))}function yh(e){wt(e)?gc.push(...e):el&&e.id===-1?el.splice(Qa+1,0,e):e.flags&1||(gc.push(e),e.flags|=1),y4()}function vb(e,t,n=Hi+1){for(;n<oo.length;n++){const s=oo[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;oo.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function kh(e){if(gc.length){const t=[...new Set(gc)].sort((n,s)=>Qu(n)-Qu(s));if(gc.length=0,el){el.push(...t);return}for(el=t,Qa=0;Qa<el.length;Qa++){const n=el[Qa];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}el=null,Qa=0}}const Qu=e=>e.id==null?e.flags&2?-1:1/0:e.id;function k4(e){try{for(Hi=0;Hi<oo.length;Hi++){const t=oo[Hi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),wd(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Hi<oo.length;Hi++){const t=oo[Hi];t&&(t.flags&=-2)}Hi=-1,oo.length=0,kh(),vh=null,(oo.length||gc.length)&&k4()}}let Xa,df=[];function b4(e,t){var n,s;Xa=e,Xa?(Xa.enabled=!0,df.forEach(({event:o,args:i})=>Xa.emit(o,...i)),df=[]):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=>{b4(i,t)}),setTimeout(()=>{Xa||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,df=[])},3e3)):df=[]}let Ws=null,Bp=null;function Xu(e){const t=Ws;return Ws=e,Bp=e&&e.type.__scopeId||null,t}function Pbe(e){Bp=e}function Hbe(){Bp=null}const Wbe=e=>Ee;function Ee(e,t=Ws,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Sh(-1);const i=Xu(t);let r;try{r=e(...o)}finally{Xu(i),s._d&&Sh(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Fn(e,t){if(Ws===null)return e;const n=Md(Ws),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=tn]=t[o];i&&(Bt(i)&&(i={mounted:i,updated:i}),i.deep&&vr(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Wi(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&&(Ar(),vi(a,n,8,[e.el,l,e,t]),Mr())}}function In(e,t){if(Hs){let n=Hs.provides;const s=Hs.parent&&Hs.parent.provides;s===n&&(n=Hs.provides=Object.create(s)),n[e]=t}}function Yt(e,t,n=!1){const s=zs();if(s||ra){let o=ra?ra._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Bt(t)?t.call(s&&s.proxy):t}}function zbe(){return!!(zs()||ra)}const zE=Symbol.for("v-scx"),UE=()=>Yt(zE);function jE(e,t){return Sd(e,null,t)}function Ube(e,t){return Sd(e,null,{flush:"post"})}function qE(e,t){return Sd(e,null,{flush:"sync"})}function Ge(e,t,n){return Sd(e,t,n)}function Sd(e,t,n=tn){const{immediate:s,deep:o,flush:i,once:r}=n,l=Cn({},n),a=t&&s||!t&&i!=="post";let c;if(fa){if(i==="sync"){const p=UE();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=pi,p.resume=pi,p.pause=pi,p}}const u=Hs;l.call=(p,h,m)=>vi(p,u,h,m);let d=!1;i==="post"?l.scheduler=p=>{fs(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():Kv(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=RE(e,t,l);return fa&&(c?c.push(f):a&&f()),f}function VE(e,t,n){const s=this.proxy,o=Tn(e)?e.includes(".")?x4(s,e):()=>s[e]:e.bind(s,s);let i;Bt(t)?i=t:(i=t.handler,n=t);const r=Wc(this),l=Sd(o,i.bind(s),n);return r(),l}function x4(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 Zr=new WeakMap,_4=Symbol("_vte"),w4=e=>e.__isTeleport,Zl=e=>e&&(e.disabled||e.disabled===""),KE=e=>e&&(e.defer||e.defer===""),yb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,kb=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,cg=(e,t)=>{const n=e&&e.to;return Tn(n)?t?t(n):null:n},GE={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:h,createText:m,createComment:_,parentNode:k}}=c,g=Zl(t.props);let{dynamicChildren:v}=t;const y=($,x,E)=>{$.shapeFlag&16&&u($.children,x,E,o,i,r,l,a)},A=($=t)=>{const x=Zl($.props),E=$.target=cg($.props,h),T=ug(E,$,m,p);E&&(r!=="svg"&&yb(E)?r="svg":r!=="mathml"&&kb(E)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(E),x||(y($,E,T),_u($,!1)))},L=$=>{const x=()=>{if(Zr.get($)===x){if(Zr.delete($),Zl($.props)){const E=k($.el)||n;y($,E,$.anchor),_u($,!0)}A($)}};Zr.set($,x),fs(x,i)};if(e==null){const $=t.el=m(""),x=t.anchor=m("");if(p($,n,s),p(x,n,s),KE(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,x),_u(t,!0)),A()}else{t.el=e.el;const $=t.anchor=e.anchor,x=Zr.get(e);if(x){x.flags|=8,Zr.delete(e),L(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,T=t.targetAnchor=e.targetAnchor,F=Zl(e.props),S=F?n:E,I=F?$:T;if(r==="svg"||yb(E)?r="svg":(r==="mathml"||kb(E))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,o,i,r,l),oy(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):ff(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const B=t.target=cg(t.props,h);B&&ff(t,B,null,c,0)}else F&&ff(t,E,T,c,1);_u(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,p=i||!Zl(f),h=Zr.get(e);if(h&&(h.flags|=8,Zr.delete(e)),d&&(o(c),o(u)),i&&o(a),!h&&r&16)for(let m=0;m<l.length;m++){const _=l[m];s(_,t,n,p,!!_.dynamicChildren)}},move:ff,hydrate:YE};function ff(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),!Zr.has(e)&&(!d||Zl(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function YE(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,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,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function p(_,k){k.anchor=d(r(_),k,l(_),n,s,o,i)}const h=t.target=cg(t.props,a),m=Zl(t.props);if(h){const _=h._lpa||h.firstChild;t.shapeFlag&16&&(m?(p(e,t),f(h,_),t.targetAnchor||ug(h,t,u,c,l(e)===h?e:null)):(t.anchor=r(e),f(h,_),t.targetAnchor||ug(h,t,u,c),d(_&&r(_),t,h,n,s,o,i))),_u(t,m)}else m&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const Dp=GE;function _u(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 ug(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[_4]=r,e&&(s(i,e,o),s(r,e,o)),r}const ai=Symbol("_leaveCb"),fu=Symbol("_enterCb");function S4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return gn(()=>{e.isMounted=!0}),rs(()=>{e.isUnmounting=!0}),e}const si=[Function,Array],C4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:si,onEnter:si,onAfterEnter:si,onEnterCancelled:si,onBeforeLeave:si,onLeave:si,onAfterLeave:si,onLeaveCancelled:si,onBeforeAppear:si,onAppear:si,onAfterAppear:si,onAppearCancelled:si},A4=e=>{const t=e.subTree;return t.component?A4(t.component):t},ZE={name:"BaseTransition",props:C4,setup(e,{slots:t}){const n=zs(),s=S4();return()=>{const o=t.default&&Gv(t.default(),!0),i=o&&o.length?M4(o):n.subTree?re():void 0;if(!i)return;const r=ln(e),{mode:l}=r;if(s.isLeaving)return E1(i);const a=bb(i);if(!a)return E1(i);let c=Ju(a,r,s,n,d=>c=d);a.type!==ps&&pl(a,c);let u=n.subTree&&bb(n.subTree);if(u&&u.type!==ps&&!Si(u,a)&&A4(n).type!==ps){let d=Ju(u,r,s,n);if(pl(u,d),l==="out-in"&&a.type!==ps)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},E1(i);l==="in-out"&&a.type!==ps?d.delayLeave=(f,p,h)=>{const m=E4(s,u);m[String(u.key)]=u,f[ai]=()=>{p(),f[ai]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function M4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ps){t=n;break}}return t}const QE=ZE;function E4(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 Ju(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:_,onAppear:k,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),A=E4(n,e),L=(E,T)=>{E&&vi(E,s,9,T)},$=(E,T)=>{const F=T[1];L(E,T),wt(E)?E.every(S=>S.length<=1)&&F():E.length<=1&&F()},x={mode:r,persisted:l,beforeEnter(E){let T=a;if(!n.isMounted)if(i)T=_||a;else return;E[ai]&&E[ai](!0);const F=A[y];F&&Si(e,F)&&F.el[ai]&&F.el[ai](),L(T,[E])},enter(E){if(A[y]===e)return;let T=c,F=u,S=d;if(!n.isMounted)if(i)T=k||c,F=g||u,S=v||d;else return;let I=!1;E[fu]=R=>{I||(I=!0,R?L(S,[E]):L(F,[E]),x.delayedLeave&&x.delayedLeave(),E[fu]=void 0)};const B=E[fu].bind(null,!1);T?$(T,[E,B]):B()},leave(E,T){const F=String(e.key);if(E[fu]&&E[fu](!0),n.isUnmounting)return T();L(f,[E]);let S=!1;E[ai]=B=>{S||(S=!0,T(),B?L(m,[E]):L(h,[E]),E[ai]=void 0,A[F]===e&&delete A[F])};const I=E[ai].bind(null,!1);A[F]=e,p?$(p,[E,I]):I()},clone(E){const T=Ju(E,t,n,s,o);return o&&o(T),T}};return x}function E1(e){if(Cd(e))return e=Tr(e),e.children=null,e}function bb(e){if(!Cd(e))return w4(e.type)&&e.children?M4(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Bt(n.default))return n.default()}}function pl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,pl(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 Gv(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(Gv(r.children,t,l))):(t||r.type!==ps)&&s.push(l!=null?Tr(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Ve(e,t){return Bt(e)?Cn({name:e.name},t,{setup:e}):e}function jbe(){const e=zs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Yv(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function qbe(e){const t=zs(),n=ka(null);if(t){const o=t.refs===tn?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function xb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const bh=new WeakMap;function vc(e,t,n,s,o=!1){if(wt(e)){e.forEach((m,_)=>vc(m,t&&(wt(t)?t[_]:t),n,s,o));return}if(_r(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&vc(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Md(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===tn?l.refs={}:l.refs,d=l.setupState,f=ln(d),p=d===tn?jC:m=>xb(u,m)?!1:pn(f,m),h=(m,_)=>!(_&&xb(u,_));if(c!=null&&c!==a){if(_b(t),Tn(c))u[c]=null,p(c)&&(d[c]=null);else if(is(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Bt(a))wd(a,l,12,[r,u]);else{const m=Tn(a),_=is(a);if(m||_){const k=()=>{if(e.f){const g=m?p(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(o)wt(g)&&Hv(g,i);else if(wt(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],p(a)&&(d[a]=u[a]);else{const v=[i];h(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,p(a)&&(d[a]=r)):_&&(h(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),fs(g,n)}else _b(e),k()}}}function _b(e){const t=bh.get(e);t&&(t.flags|=8,bh.delete(e))}let wb=!1;const za=()=>{wb||(console.error("Hydration completed but contains mismatches."),wb=!0)},XE=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",JE=e=>e.namespaceURI.includes("MathML"),hf=e=>{if(e.nodeType===1){if(XE(e))return"svg";if(JE(e))return"mathml"}},rc=e=>e.nodeType===8;function eT(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),kh(),y._vnode=v;return}d(y.firstChild,v,null,null,null),kh(),y._vnode=v},d=(v,y,A,L,$,x=!1)=>{x=x||!!y.dynamicChildren;const E=rc(v)&&v.data==="[",T=()=>m(v,y,A,L,$,E),{type:F,ref:S,shapeFlag:I,patchFlag:B}=y;let R=v.nodeType;y.el=v,B===-2&&(x=!1,y.dynamicChildren=null);let P=null;switch(F){case ul:R!==3?y.children===""?(a(y.el=o(""),r(v),v),P=v):P=T():(v.data!==y.children&&(za(),v.data=y.children),P=i(v));break;case ps:g(v)?(P=i(v),k(y.el=v.content.firstChild,v,A)):R!==8||E?P=T():P=i(v);break;case kc:if(E&&(v=i(v),R=v.nodeType),R===1||R===3){P=v;const W=!y.children.length;for(let U=0;U<y.staticCount;U++)W&&(y.children+=P.nodeType===1?P.outerHTML:P.data),U===y.staticCount-1&&(y.anchor=P),P=i(P);return E?i(P):P}else T();break;case Be:E?P=h(v,y,A,L,$,x):P=T();break;default:if(I&1)(R!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?P=T():P=f(v,y,A,L,$,x);else if(I&6){y.slotScopeIds=$;const W=r(v);if(E?P=_(v):rc(v)&&v.data==="teleport start"?P=_(v,v.data,"teleport end"):P=i(v),t(y,W,null,A,L,hf(W),x),_r(y)&&!y.type.__asyncResolved){let U;E?(U=ie(Be),U.anchor=P?P.previousSibling:W.lastChild):U=v.nodeType===3?Ye(""):ie("div"),U.el=v,y.component.subTree=U}}else I&64?R!==8?P=T():P=y.type.hydrate(v,y,A,L,$,x,e,p):I&128&&(P=y.type.hydrate(v,y,A,L,hf(r(v)),$,x,e,d))}return S!=null&&vc(S,null,L,y),P},f=(v,y,A,L,$,x)=>{x=x||!!y.dynamicChildren;const{type:E,props:T,patchFlag:F,shapeFlag:S,dirs:I,transition:B}=y,R=E==="input"||E==="option";if(R||F!==-1){I&&Wi(y,null,A,"created");let P=!1;if(g(v)){P=K4(null,B)&&A&&A.vnode.props&&A.vnode.props.appear;const U=v.content.firstChild;if(P){const Z=U.getAttribute("class");Z&&(U.$cls=Z),B.beforeEnter(U)}k(U,v,A),y.el=v=U}if(S&16&&!(T&&(T.innerHTML||T.textContent))){let U=p(v.firstChild,y,v,A,L,$,x);for(U&&!pf(v,1)&&za();U;){const Z=U;U=U.nextSibling,l(Z)}}else if(S&8){let U=y.children;U[0]===`
15
+ `&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:Z}=v;Z!==U&&Z!==U.replace(/\r\n|\r/g,`
16
+ `)&&(pf(v,0)||za(),v.textContent=y.children)}if(T){if(R||!x||F&48){const U=v.tagName.includes("-");for(const Z in T)(R&&(Z.endsWith("value")||Z==="indeterminate")||_d(Z)&&!oa(Z)||Z[0]==="."||U&&!oa(Z))&&s(v,Z,null,T[Z],void 0,A)}else if(T.onClick)s(v,"onClick",null,T.onClick,void 0,A);else if(F&4&&cl(T.style))for(const U in T.style)T.style[U]}let W;(W=T&&T.onVnodeBeforeMount)&&yo(W,A,y),I&&Wi(y,null,A,"beforeMount"),((W=T&&T.onVnodeMounted)||I||P)&&Q4(()=>{W&&yo(W,A,y),P&&B.enter(v),I&&Wi(y,null,A,"mounted")},L)}return v.nextSibling},p=(v,y,A,L,$,x,E)=>{E=E||!!y.dynamicChildren;const T=y.children,F=T.length;let S=!1;for(let I=0;I<F;I++){const B=E?T[I]:T[I]=bo(T[I]),R=B.type===ul;v?(R&&!E&&I+1<F&&bo(T[I+1]).type===ul&&(a(o(v.data.slice(B.children.length)),A,i(v)),v.data=B.children),v=d(v,B,L,$,x,E)):R&&!B.children?a(B.el=o(""),A):(S||(S=!0,pf(A,1)||za()),n(null,B,A,null,L,$,hf(A),x))}return v},h=(v,y,A,L,$,x)=>{const{slotScopeIds:E}=y;E&&($=$?$.concat(E):E);const T=r(v),F=p(i(v),y,T,A,L,$,x);return F&&rc(F)&&F.data==="]"?i(y.anchor=F):(za(),a(y.anchor=c("]"),T,F),F)},m=(v,y,A,L,$,x)=>{if(pf(v.parentElement,1)||za(),y.el=null,x){const F=_(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const E=i(v),T=r(v);return l(v),n(null,y,T,E,A,L,hf(T),$),A&&(A.vnode.el=y.el,Wp(A,y.el)),E},_=(v,y="[",A="]")=>{let L=0;for(;v;)if(v=i(v),v&&rc(v)&&(v.data===y&&L++,v.data===A)){if(L===0)return i(v);L--}return v},k=(v,y,A)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let $=A;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const Sb="data-allow-mismatch",tT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function pf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Sb);)e=e.parentElement;const n=e&&e.getAttribute(Sb);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(tT[t])}}const nT=Np().requestIdleCallback||(e=>setTimeout(e,1)),sT=Np().cancelIdleCallback||(e=>clearTimeout(e)),Vbe=(e=1e4)=>t=>{const n=nT(t,{timeout:e});return()=>sT(n)};function oT(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 Kbe=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(oT(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Gbe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Ybe=(e=[])=>(t,n)=>{Tn(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 iT(e,t){if(rc(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(rc(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const _r=e=>!!e.type.__asyncLoader;function Ci(e){Bt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,p()),p=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((_,k)=>{a(m,()=>_(f()),()=>k(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Ve({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,m,_){let k=!1;(m.bu||(m.bu=[])).push(()=>k=!0);const g=()=>{k||_()},v=i?()=>{const y=i(g,A=>iT(h,A));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():p().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const h=Hs;if(Yv(h),u)return()=>mf(u,h);const m=v=>{c=null,Hc(v,h,13,!s)};if(l&&h.suspense||fa)return p().then(v=>()=>mf(v,h)).catch(v=>(m(v),()=>s?ie(s,{error:v}):null));const _=Q(!1),k=Q(),g=Q(!!o);return o&&setTimeout(()=>{g.value=!1},o),r!=null&&setTimeout(()=>{if(!_.value&&!k.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),k.value=v}},r),p().then(()=>{_.value=!0,h.parent&&Cd(h.parent.vnode)&&h.parent.update()}).catch(v=>{m(v),k.value=v}),()=>{if(_.value&&u)return mf(u,h);if(k.value&&s)return ie(s,{error:k.value});if(n&&!g.value)return mf(n,h)}}})}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 Cd=e=>e.type.__isKeepAlive,rT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=zs(),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,A,L)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,A,g.slotScopeIds,L),fs(()=>{$.isDeactivated=!1,$.a&&mc($.a);const x=g.props&&g.props.onVnodeMounted;x&&yo(x,$.parent,g)},l)},s.deactivate=g=>{const v=g.component;_h(v.m),_h(v.a),c(g,f,null,1,l),fs(()=>{v.da&&mc(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&yo(y,v.parent,g),v.isDeactivated=!0},l)};function p(g){T1(g),u(g,n,l,!0)}function h(g){o.forEach((v,y)=>{const A=kg(_r(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(y)})}function m(g){const v=o.get(g);v&&(!r||!Si(v,r))?p(v):r&&T1(r),o.delete(g),i.delete(g)}Ge(()=>[e.include,e.exclude],([g,v])=>{g&&h(y=>wu(g,y)),v&&h(y=>!wu(v,y))},{flush:"post",deep:!0});let _=null;const k=()=>{_!=null&&(wh(n.subTree.type)?fs(()=>{o.set(_,gf(n.subTree))},n.subTree.suspense):o.set(_,gf(n.subTree)))};return gn(k),Zv(k),rs(()=>{o.forEach(g=>{const{subTree:v,suspense:y}=n,A=gf(v);if(g.type===A.type&&g.key===A.key){T1(A);const L=A.component.da;L&&fs(L,y);return}p(g)})}),()=>{if(_=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=gf(v);if(y.type===ps)return r=null,y;const A=y.type,L=kg(_r(y)?y.type.__asyncResolved||{}:A),{include:$,exclude:x,max:E}=e;if($&&(!L||!wu($,L))||x&&L&&wu(x,L))return y.shapeFlag&=-257,r=y,v;const T=y.key==null?A:y.key,F=o.get(T);return y.el&&(y=Tr(y),v.shapeFlag&128&&(v.ssContent=y)),_=T,F?(y.el=F.el,y.component=F.component,y.transition&&pl(y,y.transition),y.shapeFlag|=512,i.delete(T),i.add(T)):(i.add(T),E&&i.size>parseInt(E,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,wh(v.type)?v:y}}},Zbe=rT;function wu(e,t){return wt(e)?e.some(n=>wu(n,t)):Tn(e)?e.split(",").includes(t):K8(e)?(e.lastIndex=0,e.test(t)):!1}function lT(e,t){T4(e,"a",t)}function aT(e,t){T4(e,"da",t)}function T4(e,t,n=Hs){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Pp(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Cd(o.parent.vnode)&&cT(s,t,n,o),o=o.parent}}function cT(e,t,n,s){const o=Pp(t,e,s,!0);xn(()=>{Hv(s[t],o)},n)}function T1(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function gf(e){return e.shapeFlag&128?e.ssContent:e}function Pp(e,t,n=Hs,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Ar();const l=Wc(n),a=vi(t,n,e,r);return l(),Mr(),a});return s?o.unshift(i):o.push(i),i}}const Ir=e=>(t,n=Hs)=>{(!fa||e==="sp")&&Pp(e,(...s)=>t(...s),n)},uT=Ir("bm"),gn=Ir("m"),N4=Ir("bu"),Zv=Ir("u"),rs=Ir("bum"),xn=Ir("um"),dT=Ir("sp"),fT=Ir("rtg"),hT=Ir("rtc");function pT(e,t=Hs){Pp("ec",e,t)}const Qv="components",mT="directives";function gT(e,t){return Xv(Qv,e,!0,t)||e}const I4=Symbol.for("v-ndc");function Ps(e){return Tn(e)?Xv(Qv,e,!1)||e:e||I4}function Qbe(e){return Xv(mT,e)}function Xv(e,t,n=!0,s=!1){const o=Ws||Hs;if(o){const i=o.type;if(e===Qv){const l=kg(i,!1);if(l&&(l===t||l===ws(t)||l===Ep(ws(t))))return i}const r=Cb(o[e]||i[e],t)||Cb(o.appContext[e],t);return!r&&s?i:r}}function Cb(e,t){return e&&(e[t]||e[ws(t)]||e[Ep(ws(t))])}function st(e,t,n,s){let o;const i=n&&n[s],r=wt(e);if(r||Tn(e)){const l=r&&cl(e);let a=!1,c=!1;l&&(a=!zo(e),c=Er(e),e=Lp(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?Tc(Ti(e[u])):Ti(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(mn(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 Jv(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(wt(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 On(e,t,n={},s,o){if(Ws.ce||Ws.parent&&_r(Ws.parent)&&Ws.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),xe(Be,null,[ie("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),b();const r=i&&ey(i(n)),l=n.key||r&&r.key,a=xe(Be,{key:(l&&!Go(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 ey(e){return e.some(t=>ml(t)?!(t.type===ps||t.type===Be&&!ey(t.children)):!0)?e:null}function Xbe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:jf(s)]=e[s];return n}const dg=e=>e?n3(e)?Md(e):dg(e.parent):null,Iu=Cn(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=>dg(e.parent),$root:e=>dg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ty(e),$forceUpdate:e=>e.f||(e.f=()=>{Kv(e.update)}),$nextTick:e=>e.n||(e.n=vt.bind(e.proxy)),$watch:e=>VE.bind(e)}),N1=(e,t)=>e!==tn&&!e.__isScriptSetup&&pn(e,t),fg={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(N1(s,t))return r[t]=1,s[t];if(o!==tn&&pn(o,t))return r[t]=2,o[t];if(pn(i,t))return r[t]=3,i[t];if(n!==tn&&pn(n,t))return r[t]=4,n[t];hg&&(r[t]=0)}}const c=Iu[t];let u,d;if(c)return t==="$attrs"&&Gs(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==tn&&pn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,pn(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return N1(o,t)?(o[t]=n,!0):s!==tn&&pn(s,t)?(s[t]=n,!0):pn(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!==tn&&l[0]!=="$"&&pn(e,l)||N1(t,l)||pn(i,l)||pn(s,l)||pn(Iu,l)||pn(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:pn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},vT=Cn({},fg,{get(e,t){if(t!==Symbol.unscopables)return fg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!X8(t)}});function Jbe(){return null}function exe(){return null}function txe(e){}function nxe(e){}function sxe(){return null}function oxe(){}function ixe(e,t){return null}function rxe(){return $4().slots}function Ad(){return $4().attrs}function $4(e){const t=zs();return t.setupContext||(t.setupContext=i3(t))}function ed(e){return wt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function lxe(e,t){const n=ed(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?wt(o)||Bt(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function axe(e,t){return!e||!t?e||t:wt(e)&&wt(t)?e.concat(t):Cn({},ed(e),ed(t))}function cxe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function uxe(e){const t=zs(),n=fa;let s=e();nd(),n&&bc(!1);const o=()=>{Wc(t),n&&bc(!0)},i=()=>{zs()!==t&&t.scope.off(),nd(),n&&bc(!1)};return Wv(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let hg=!0;function yT(e){const t=ty(e),n=e.proxy,s=e.ctx;hg=!1,t.beforeCreate&&Ab(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:m,deactivated:_,beforeDestroy:k,beforeUnmount:g,destroyed:v,unmounted:y,render:A,renderTracked:L,renderTriggered:$,errorCaptured:x,serverPrefetch:E,expose:T,inheritAttrs:F,components:S,directives:I,filters:B}=t;if(c&&kT(c,s,null),r)for(const W in r){const U=r[W];Bt(U)&&(s[W]=U.bind(n))}if(o){const W=o.call(n,n);mn(W)&&(e.data=Ns(W))}if(hg=!0,i)for(const W in i){const U=i[W],Z=Bt(U)?U.bind(n,n):Bt(U.get)?U.get.bind(n,n):pi,z=!Bt(U)&&Bt(U.set)?U.set.bind(n):pi,ee=D({get:Z,set:z});Object.defineProperty(s,W,{enumerable:!0,configurable:!0,get:()=>ee.value,set:de=>ee.value=de})}if(l)for(const W in l)L4(l[W],s,n,W);if(a){const W=Bt(a)?a.call(n):a;Reflect.ownKeys(W).forEach(U=>{In(U,W[U])})}u&&Ab(u,e,"c");function P(W,U){wt(U)?U.forEach(Z=>W(Z.bind(n))):U&&W(U.bind(n))}if(P(uT,d),P(gn,f),P(N4,p),P(Zv,h),P(lT,m),P(aT,_),P(pT,x),P(hT,L),P(fT,$),P(rs,g),P(xn,y),P(dT,E),wt(T))if(T.length){const W=e.exposed||(e.exposed={});T.forEach(U=>{Object.defineProperty(W,U,{get:()=>n[U],set:Z=>n[U]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===pi&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),I&&(e.directives=I),E&&Yv(e)}function kT(e,t,n=pi){wt(e)&&(e=pg(e));for(const s in e){const o=e[s];let i;mn(o)?"default"in o?i=Yt(o.from||s,o.default,!0):i=Yt(o.from||s):i=Yt(o),is(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Ab(e,t,n){vi(wt(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function L4(e,t,n,s){let o=s.includes(".")?x4(n,s):()=>n[s];if(Tn(e)){const i=t[e];Bt(i)&&Ge(o,i)}else if(Bt(e))Ge(o,e.bind(n));else if(mn(e))if(wt(e))e.forEach(i=>L4(i,t,n,s));else{const i=Bt(e.handler)?e.handler.bind(n):t[e.handler];Bt(i)&&Ge(o,i,e)}}function ty(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=>xh(a,c,r,!0)),xh(a,t,r)),mn(t)&&i.set(t,a),a}function xh(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&xh(e,i,n,!0),o&&o.forEach(r=>xh(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=bT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const bT={data:Mb,props:Eb,emits:Eb,methods:Su,computed:Su,beforeCreate:eo,created:eo,beforeMount:eo,mounted:eo,beforeUpdate:eo,updated:eo,beforeDestroy:eo,beforeUnmount:eo,destroyed:eo,unmounted:eo,activated:eo,deactivated:eo,errorCaptured:eo,serverPrefetch:eo,components:Su,directives:Su,watch:_T,provide:Mb,inject:xT};function Mb(e,t){return t?e?function(){return Cn(Bt(e)?e.call(this,this):e,Bt(t)?t.call(this,this):t)}:t:e}function xT(e,t){return Su(pg(e),pg(t))}function pg(e){if(wt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function eo(e,t){return e?[...new Set([].concat(e,t))]:t}function Su(e,t){return e?Cn(Object.create(null),e,t):t}function Eb(e,t){return e?wt(e)&&wt(t)?[...new Set([...e,...t])]:Cn(Object.create(null),ed(e),ed(t??{})):t}function _T(e,t){if(!e)return t;if(!t)return e;const n=Cn(Object.create(null),e);for(const s in t)n[s]=eo(e[s],t[s]);return n}function F4(){return{app:null,config:{isNativeTag:jC,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 wT=0;function ST(e,t){return function(s,o=null){Bt(s)||(s=Cn({},s)),o!=null&&!mn(o)&&(o=null);const i=F4(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:wT++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:e9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Bt(u.install)?(r.add(u),u.install(c,...d)):Bt(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const p=c._ceVNode||ie(s,o);return p.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(p,u):e(p,u,f),a=!0,c._container=u,u.__vue_app__=c,Md(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(vi(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=ra;ra=c;try{return u()}finally{ra=d}}};return c}}let ra=null;function dxe(e,t,n=tn){const s=zs(),o=ws(t),i=xo(t),r=O4(e,o),l=NE((a,c)=>{let u,d=tn,f;return qE(()=>{const p=e[o];Ds(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const h=n.set?n.set(p):p;if(!Ds(h,u)&&!(d!==tn&&Ds(p,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=p,c()),s.emit(`update:${t}`,h),Ds(p,h)&&Ds(p,d)&&!Ds(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||tn:l,done:!1}:{done:!0}}}},l}const O4=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ws(t)}Modifiers`]||e[`${xo(t)}Modifiers`];function CT(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||tn;let o=n;const i=t.startsWith("update:"),r=i&&O4(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>Tn(u)?u.trim():u)),r.number&&(o=n.map(Tp)));let l,a=s[l=jf(t)]||s[l=jf(ws(t))];!a&&i&&(a=s[l=jf(xo(t))]),a&&vi(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,vi(c,e,6,o)}}const AT=new WeakMap;function R4(e,t,n=!1){const s=n?AT:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!Bt(e)){const a=c=>{const u=R4(c,t,!0);u&&(l=!0,Cn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(mn(e)&&s.set(e,null),null):(wt(i)?i.forEach(a=>r[a]=null):Cn(r,i),mn(e)&&s.set(e,r),r)}function Hp(e,t){return!e||!_d(t)?!1:(t=t.slice(2).replace(/Once$/,""),pn(e,t[0].toLowerCase()+t.slice(1))||pn(e,xo(t))||pn(e,t))}function qf(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:p,ctx:h,inheritAttrs:m}=e,_=Xu(e);let k,g;try{if(n.shapeFlag&4){const y=o||s,A=y;k=bo(c.call(A,y,u,d,p,f,h)),g=l}else{const y=t;k=bo(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:ET(l)}}catch(y){$u.length=0,Hc(y,e,1),k=ie(ps)}let v=k;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:A}=v;y.length&&A&7&&(i&&y.some(Sp)&&(g=TT(g,i)),v=Tr(v,g,!1,!0))}return n.dirs&&(v=Tr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&pl(v,n.transition),k=v,Xu(_),k}function MT(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(ml(o)){if(o.type!==ps||o.children==="v-if"){if(n)return;n=o}}else return}return n}const ET=e=>{let t;for(const n in e)(n==="class"||n==="style"||_d(n))&&((t||(t={}))[n]=e[n]);return t},TT=(e,t)=>{const n={};for(const s in e)(!Sp(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function NT(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?Tb(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(B4(r,s,f)&&!Hp(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?Tb(s,r,c):!0:!!r;return!1}function Tb(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(B4(t,e,i)&&!Hp(n,i))return!0}return!1}function B4(e,t,n){const s=e[n],o=t[n];return n==="style"&&mn(s)&&mn(o)?!Cr(s,o):s!==o}function Wp({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 D4={},P4=()=>Object.create(D4),H4=e=>Object.getPrototypeOf(e)===D4;function IT(e,t,n,s=!1){const o={},i=P4();e.propsDefaults=Object.create(null),W4(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:AE(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function $T(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=ln(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(Hp(e.emitsOptions,f))continue;const p=t[f];if(a)if(pn(i,f))p!==i[f]&&(i[f]=p,c=!0);else{const h=ws(f);o[h]=mg(a,l,h,p,e,!1)}else p!==i[f]&&(i[f]=p,c=!0)}}}else{W4(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!pn(t,d)&&((u=xo(d))===d||!pn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=mg(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!pn(t,d))&&(delete i[d],c=!0)}c&&gr(e.attrs,"set","")}function W4(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(oa(a))continue;const c=t[a];let u;o&&pn(o,u=ws(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:Hp(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=ln(n),c=l||tn;for(let u=0;u<i.length;u++){const d=i[u];n[d]=mg(o,a,d,c[d],e,!pn(c,d))}}return r}function mg(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=pn(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Bt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Wc(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===xo(n))&&(s=!0))}return s}const LT=new WeakMap;function z4(e,t,n=!1){const s=n?LT:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!Bt(e)){const u=d=>{a=!0;const[f,p]=z4(d,t,!0);Cn(r,f),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return mn(e)&&s.set(e,hc),hc;if(wt(i))for(let u=0;u<i.length;u++){const d=ws(i[u]);Nb(d)&&(r[d]=tn)}else if(i)for(const u in i){const d=ws(u);if(Nb(d)){const f=i[u],p=r[d]=wt(f)||Bt(f)?{type:f}:Cn({},f),h=p.type;let m=!1,_=!0;if(wt(h))for(let k=0;k<h.length;++k){const g=h[k],v=Bt(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(_=!1)}else m=Bt(h)&&h.name==="Boolean";p[0]=m,p[1]=_,(m||pn(p,"default"))&&l.push(d)}}const c=[r,l];return mn(e)&&s.set(e,c),c}function Nb(e){return e[0]!=="$"&&!oa(e)}const ny=e=>e==="_"||e==="_ctx"||e==="$stable",sy=e=>wt(e)?e.map(bo):[bo(e)],FT=(e,t,n)=>{if(t._n)return t;const s=Ee((...o)=>sy(t(...o)),n);return s._c=!1,s},U4=(e,t,n)=>{const s=e._ctx;for(const o in e){if(ny(o))continue;const i=e[o];if(Bt(i))t[o]=FT(o,i,s);else if(i!=null){const r=sy(i);t[o]=()=>r}}},j4=(e,t)=>{const n=sy(t);e.slots.default=()=>n},q4=(e,t,n)=>{for(const s in t)(n||!ny(s))&&(e[s]=t[s])},OT=(e,t,n)=>{const s=e.slots=P4();if(e.vnode.shapeFlag&32){const o=t._;o?(q4(s,t,n),n&&VC(s,"_",o,!0)):U4(t,s)}else t&&j4(e,t)},RT=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=tn;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:q4(o,t,n):(i=!t.$stable,U4(t,o)),r=t}else t&&(j4(e,t),r={default:1});if(i)for(const l in o)!ny(l)&&r[l]==null&&delete o[l]},fs=Q4;function BT(e){return V4(e)}function DT(e){return V4(e,eT)}function V4(e,t){const n=Np();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:p=pi,insertStaticContent:h}=e,m=(j,ne,ve,ae=null,ye=null,q=null,se=void 0,me=null,Te=!!ne.dynamicChildren)=>{if(j===ne)return;j&&!Si(j,ne)&&(ae=ce(j),de(j,ye,q,!0),j=null),ne.patchFlag===-2&&(Te=!1,ne.dynamicChildren=null);const{type:Me,ref:$e,shapeFlag:pe}=ne;switch(Me){case ul:_(j,ne,ve,ae);break;case ps:k(j,ne,ve,ae);break;case kc:j==null&&g(ne,ve,ae,se);break;case Be:S(j,ne,ve,ae,ye,q,se,me,Te);break;default:pe&1?A(j,ne,ve,ae,ye,q,se,me,Te):pe&6?I(j,ne,ve,ae,ye,q,se,me,Te):(pe&64||pe&128)&&Me.process(j,ne,ve,ae,ye,q,se,me,Te,G)}$e!=null&&ye?vc($e,j&&j.ref,q,ne||j,!ne):$e==null&&j&&j.ref!=null&&vc(j.ref,null,q,j,!0)},_=(j,ne,ve,ae)=>{if(j==null)s(ne.el=l(ne.children),ve,ae);else{const ye=ne.el=j.el;ne.children!==j.children&&c(ye,ne.children)}},k=(j,ne,ve,ae)=>{j==null?s(ne.el=a(ne.children||""),ve,ae):ne.el=j.el},g=(j,ne,ve,ae)=>{[j.el,j.anchor]=h(j.children,ne,ve,ae,j.el,j.anchor)},v=({el:j,anchor:ne},ve,ae)=>{let ye;for(;j&&j!==ne;)ye=f(j),s(j,ve,ae),j=ye;s(ne,ve,ae)},y=({el:j,anchor:ne})=>{let ve;for(;j&&j!==ne;)ve=f(j),o(j),j=ve;o(ne)},A=(j,ne,ve,ae,ye,q,se,me,Te)=>{if(ne.type==="svg"?se="svg":ne.type==="math"&&(se="mathml"),j==null)L(ne,ve,ae,ye,q,se,me,Te);else{const Me=j.el&&j.el._isVueCE?j.el:null;try{Me&&Me._beginPatch(),E(j,ne,ye,q,se,me,Te)}finally{Me&&Me._endPatch()}}},L=(j,ne,ve,ae,ye,q,se,me)=>{let Te,Me;const{props:$e,shapeFlag:pe,transition:Ie,dirs:Qe}=j;if(Te=j.el=r(j.type,q,$e&&$e.is,$e),pe&8?u(Te,j.children):pe&16&&x(j.children,Te,null,ae,ye,I1(j,q),se,me),Qe&&Wi(j,null,ae,"created"),$(Te,j,j.scopeId,se,ae),$e){for(const _t in $e)_t!=="value"&&!oa(_t)&&i(Te,_t,null,$e[_t],q,ae);"value"in $e&&i(Te,"value",null,$e.value,q),(Me=$e.onVnodeBeforeMount)&&yo(Me,ae,j)}Qe&&Wi(j,null,ae,"beforeMount");const lt=K4(ye,Ie);lt&&Ie.beforeEnter(Te),s(Te,ne,ve),((Me=$e&&$e.onVnodeMounted)||lt||Qe)&&fs(()=>{try{Me&&yo(Me,ae,j),lt&&Ie.enter(Te),Qe&&Wi(j,null,ae,"mounted")}finally{}},ye)},$=(j,ne,ve,ae,ye)=>{if(ve&&p(j,ve),ae)for(let q=0;q<ae.length;q++)p(j,ae[q]);if(ye){let q=ye.subTree;if(ne===q||wh(q.type)&&(q.ssContent===ne||q.ssFallback===ne)){const se=ye.vnode;$(j,se,se.scopeId,se.slotScopeIds,ye.parent)}}},x=(j,ne,ve,ae,ye,q,se,me,Te=0)=>{for(let Me=Te;Me<j.length;Me++){const $e=j[Me]=me?pr(j[Me]):bo(j[Me]);m(null,$e,ne,ve,ae,ye,q,se,me)}},E=(j,ne,ve,ae,ye,q,se)=>{const me=ne.el=j.el;let{patchFlag:Te,dynamicChildren:Me,dirs:$e}=ne;Te|=j.patchFlag&16;const pe=j.props||tn,Ie=ne.props||tn;let Qe;if(ve&&zl(ve,!1),(Qe=Ie.onVnodeBeforeUpdate)&&yo(Qe,ve,ne,j),$e&&Wi(ne,j,ve,"beforeUpdate"),ve&&zl(ve,!0),(pe.innerHTML&&Ie.innerHTML==null||pe.textContent&&Ie.textContent==null)&&u(me,""),Me?T(j.dynamicChildren,Me,me,ve,ae,I1(ne,ye),q):se||U(j,ne,me,null,ve,ae,I1(ne,ye),q,!1),Te>0){if(Te&16)F(me,pe,Ie,ve,ye);else if(Te&2&&pe.class!==Ie.class&&i(me,"class",null,Ie.class,ye),Te&4&&i(me,"style",pe.style,Ie.style,ye),Te&8){const lt=ne.dynamicProps;for(let _t=0;_t<lt.length;_t++){const St=lt[_t],Tt=pe[St],Ct=Ie[St];(Ct!==Tt||St==="value")&&i(me,St,Tt,Ct,ye,ve)}}Te&1&&j.children!==ne.children&&u(me,ne.children)}else!se&&Me==null&&F(me,pe,Ie,ve,ye);((Qe=Ie.onVnodeUpdated)||$e)&&fs(()=>{Qe&&yo(Qe,ve,ne,j),$e&&Wi(ne,j,ve,"updated")},ae)},T=(j,ne,ve,ae,ye,q,se)=>{for(let me=0;me<ne.length;me++){const Te=j[me],Me=ne[me],$e=Te.el&&(Te.type===Be||!Si(Te,Me)||Te.shapeFlag&198)?d(Te.el):ve;m(Te,Me,$e,null,ae,ye,q,se,!0)}},F=(j,ne,ve,ae,ye)=>{if(ne!==ve){if(ne!==tn)for(const q in ne)!oa(q)&&!(q in ve)&&i(j,q,ne[q],null,ye,ae);for(const q in ve){if(oa(q))continue;const se=ve[q],me=ne[q];se!==me&&q!=="value"&&i(j,q,me,se,ye,ae)}"value"in ve&&i(j,"value",ne.value,ve.value,ye)}},S=(j,ne,ve,ae,ye,q,se,me,Te)=>{const Me=ne.el=j?j.el:l(""),$e=ne.anchor=j?j.anchor:l("");let{patchFlag:pe,dynamicChildren:Ie,slotScopeIds:Qe}=ne;Qe&&(me=me?me.concat(Qe):Qe),j==null?(s(Me,ve,ae),s($e,ve,ae),x(ne.children||[],ve,$e,ye,q,se,me,Te)):pe>0&&pe&64&&Ie&&j.dynamicChildren&&j.dynamicChildren.length===Ie.length?(T(j.dynamicChildren,Ie,ve,ye,q,se,me),(ne.key!=null||ye&&ne===ye.subTree)&&oy(j,ne,!0)):U(j,ne,ve,$e,ye,q,se,me,Te)},I=(j,ne,ve,ae,ye,q,se,me,Te)=>{ne.slotScopeIds=me,j==null?ne.shapeFlag&512?ye.ctx.activate(ne,ve,ae,se,Te):B(ne,ve,ae,ye,q,se,Te):R(j,ne,Te)},B=(j,ne,ve,ae,ye,q,se)=>{const me=j.component=t3(j,ae,ye);if(Cd(j)&&(me.ctx.renderer=G),s3(me,!1,se),me.asyncDep){if(ye&&ye.registerDep(me,P,se),!j.el){const Te=me.subTree=ie(ps);k(null,Te,ne,ve),j.placeholder=Te.el}}else P(me,j,ne,ve,ye,q,se)},R=(j,ne,ve)=>{const ae=ne.component=j.component;if(NT(j,ne,ve))if(ae.asyncDep&&!ae.asyncResolved){W(ae,ne,ve);return}else ae.next=ne,ae.update();else ne.el=j.el,ae.vnode=ne},P=(j,ne,ve,ae,ye,q,se)=>{const me=()=>{if(j.isMounted){let{next:pe,bu:Ie,u:Qe,parent:lt,vnode:_t}=j;{const nn=G4(j);if(nn){pe&&(pe.el=_t.el,W(j,pe,se)),nn.asyncDep.then(()=>{fs(()=>{j.isUnmounted||Me()},ye)});return}}let St=pe,Tt;zl(j,!1),pe?(pe.el=_t.el,W(j,pe,se)):pe=_t,Ie&&mc(Ie),(Tt=pe.props&&pe.props.onVnodeBeforeUpdate)&&yo(Tt,lt,pe,_t),zl(j,!0);const Ct=qf(j),gt=j.subTree;j.subTree=Ct,m(gt,Ct,d(gt.el),ce(gt),j,ye,q),pe.el=Ct.el,St===null&&Wp(j,Ct.el),Qe&&fs(Qe,ye),(Tt=pe.props&&pe.props.onVnodeUpdated)&&fs(()=>yo(Tt,lt,pe,_t),ye)}else{let pe;const{el:Ie,props:Qe}=ne,{bm:lt,m:_t,parent:St,root:Tt,type:Ct}=j,gt=_r(ne);if(zl(j,!1),lt&&mc(lt),!gt&&(pe=Qe&&Qe.onVnodeBeforeMount)&&yo(pe,St,ne),zl(j,!0),Ie&&he){const nn=()=>{j.subTree=qf(j),he(Ie,j.subTree,j,ye,null)};gt&&Ct.__asyncHydrate?Ct.__asyncHydrate(Ie,j,nn):nn()}else{Tt.ce&&Tt.ce._hasShadowRoot()&&Tt.ce._injectChildStyle(Ct,j.parent?j.parent.type:void 0);const nn=j.subTree=qf(j);m(null,nn,ve,ae,j,ye,q),ne.el=nn.el}if(_t&&fs(_t,ye),!gt&&(pe=Qe&&Qe.onVnodeMounted)){const nn=ne;fs(()=>yo(pe,St,nn),ye)}(ne.shapeFlag&256||St&&_r(St.vnode)&&St.vnode.shapeFlag&256)&&j.a&&fs(j.a,ye),j.isMounted=!0,ne=ve=ae=null}};j.scope.on();const Te=j.effect=new hh(me);j.scope.off();const Me=j.update=Te.run.bind(Te),$e=j.job=Te.runIfDirty.bind(Te);$e.i=j,$e.id=j.uid,Te.scheduler=()=>Kv($e),zl(j,!0),Me()},W=(j,ne,ve)=>{ne.component=j;const ae=j.vnode.props;j.vnode=ne,j.next=null,$T(j,ne.props,ae,ve),RT(j,ne.children,ve),Ar(),vb(j),Mr()},U=(j,ne,ve,ae,ye,q,se,me,Te=!1)=>{const Me=j&&j.children,$e=j?j.shapeFlag:0,pe=ne.children,{patchFlag:Ie,shapeFlag:Qe}=ne;if(Ie>0){if(Ie&128){z(Me,pe,ve,ae,ye,q,se,me,Te);return}else if(Ie&256){Z(Me,pe,ve,ae,ye,q,se,me,Te);return}}Qe&8?($e&16&&fe(Me,ye,q),pe!==Me&&u(ve,pe)):$e&16?Qe&16?z(Me,pe,ve,ae,ye,q,se,me,Te):fe(Me,ye,q,!0):($e&8&&u(ve,""),Qe&16&&x(pe,ve,ae,ye,q,se,me,Te))},Z=(j,ne,ve,ae,ye,q,se,me,Te)=>{j=j||hc,ne=ne||hc;const Me=j.length,$e=ne.length,pe=Math.min(Me,$e);let Ie;for(Ie=0;Ie<pe;Ie++){const Qe=ne[Ie]=Te?pr(ne[Ie]):bo(ne[Ie]);m(j[Ie],Qe,ve,null,ye,q,se,me,Te)}Me>$e?fe(j,ye,q,!0,!1,pe):x(ne,ve,ae,ye,q,se,me,Te,pe)},z=(j,ne,ve,ae,ye,q,se,me,Te)=>{let Me=0;const $e=ne.length;let pe=j.length-1,Ie=$e-1;for(;Me<=pe&&Me<=Ie;){const Qe=j[Me],lt=ne[Me]=Te?pr(ne[Me]):bo(ne[Me]);if(Si(Qe,lt))m(Qe,lt,ve,null,ye,q,se,me,Te);else break;Me++}for(;Me<=pe&&Me<=Ie;){const Qe=j[pe],lt=ne[Ie]=Te?pr(ne[Ie]):bo(ne[Ie]);if(Si(Qe,lt))m(Qe,lt,ve,null,ye,q,se,me,Te);else break;pe--,Ie--}if(Me>pe){if(Me<=Ie){const Qe=Ie+1,lt=Qe<$e?ne[Qe].el:ae;for(;Me<=Ie;)m(null,ne[Me]=Te?pr(ne[Me]):bo(ne[Me]),ve,lt,ye,q,se,me,Te),Me++}}else if(Me>Ie)for(;Me<=pe;)de(j[Me],ye,q,!0),Me++;else{const Qe=Me,lt=Me,_t=new Map;for(Me=lt;Me<=Ie;Me++){const Zt=ne[Me]=Te?pr(ne[Me]):bo(ne[Me]);Zt.key!=null&&_t.set(Zt.key,Me)}let St,Tt=0;const Ct=Ie-lt+1;let gt=!1,nn=0;const rn=new Array(Ct);for(Me=0;Me<Ct;Me++)rn[Me]=0;for(Me=Qe;Me<=pe;Me++){const Zt=j[Me];if(Tt>=Ct){de(Zt,ye,q,!0);continue}let fn;if(Zt.key!=null)fn=_t.get(Zt.key);else for(St=lt;St<=Ie;St++)if(rn[St-lt]===0&&Si(Zt,ne[St])){fn=St;break}fn===void 0?de(Zt,ye,q,!0):(rn[fn-lt]=Me+1,fn>=nn?nn=fn:gt=!0,m(Zt,ne[fn],ve,null,ye,q,se,me,Te),Tt++)}const Qn=gt?PT(rn):hc;for(St=Qn.length-1,Me=Ct-1;Me>=0;Me--){const Zt=lt+Me,fn=ne[Zt],hn=ne[Zt+1],it=Zt+1<$e?hn.el||Y4(hn):ae;rn[Me]===0?m(null,fn,ve,it,ye,q,se,me,Te):gt&&(St<0||Me!==Qn[St]?ee(fn,ve,it,2):St--)}}},ee=(j,ne,ve,ae,ye=null)=>{const{el:q,type:se,transition:me,children:Te,shapeFlag:Me}=j;if(Me&6){ee(j.component.subTree,ne,ve,ae);return}if(Me&128){j.suspense.move(ne,ve,ae);return}if(Me&64){se.move(j,ne,ve,G);return}if(se===Be){s(q,ne,ve);for(let pe=0;pe<Te.length;pe++)ee(Te[pe],ne,ve,ae);s(j.anchor,ne,ve);return}if(se===kc){v(j,ne,ve);return}if(ae!==2&&Me&1&&me)if(ae===0)me.persisted&&!q[ai]?s(q,ne,ve):(me.beforeEnter(q),s(q,ne,ve),fs(()=>me.enter(q),ye));else{const{leave:pe,delayLeave:Ie,afterLeave:Qe}=me,lt=()=>{j.ctx.isUnmounted?o(q):s(q,ne,ve)},_t=()=>{const St=q._isLeaving||!!q[ai];q._isLeaving&&q[ai](!0),me.persisted&&!St?lt():pe(q,()=>{lt(),Qe&&Qe()})};Ie?Ie(q,lt,_t):_t()}else s(q,ne,ve)},de=(j,ne,ve,ae=!1,ye=!1)=>{const{type:q,props:se,ref:me,children:Te,dynamicChildren:Me,shapeFlag:$e,patchFlag:pe,dirs:Ie,cacheIndex:Qe,memo:lt}=j;if(pe===-2&&(ye=!1),me!=null&&(Ar(),vc(me,null,ve,j,!0),Mr()),Qe!=null&&(ne.renderCache[Qe]=void 0),$e&256){ne.ctx.deactivate(j);return}const _t=$e&1&&Ie,St=!_r(j);let Tt;if(St&&(Tt=se&&se.onVnodeBeforeUnmount)&&yo(Tt,ne,j),$e&6)X(j.component,ve,ae);else{if($e&128){j.suspense.unmount(ve,ae);return}_t&&Wi(j,null,ne,"beforeUnmount"),$e&64?j.type.remove(j,ne,ve,G,ae):Me&&!Me.hasOnce&&(q!==Be||pe>0&&pe&64)?fe(Me,ne,ve,!1,!0):(q===Be&&pe&384||!ye&&$e&16)&&fe(Te,ne,ve),ae&&J(j)}const Ct=lt!=null&&Qe==null;(St&&(Tt=se&&se.onVnodeUnmounted)||_t||Ct)&&fs(()=>{Tt&&yo(Tt,ne,j),_t&&Wi(j,null,ne,"unmounted"),Ct&&(j.el=null)},ve)},J=j=>{const{type:ne,el:ve,anchor:ae,transition:ye}=j;if(ne===Be){Y(ve,ae);return}if(ne===kc){y(j);return}const q=()=>{o(ve),ye&&!ye.persisted&&ye.afterLeave&&ye.afterLeave()};if(j.shapeFlag&1&&ye&&!ye.persisted){const{leave:se,delayLeave:me}=ye,Te=()=>se(ve,q);me?me(j.el,q,Te):Te()}else q()},Y=(j,ne)=>{let ve;for(;j!==ne;)ve=f(j),o(j),j=ve;o(ne)},X=(j,ne,ve)=>{const{bum:ae,scope:ye,job:q,subTree:se,um:me,m:Te,a:Me}=j;_h(Te),_h(Me),ae&&mc(ae),ye.stop(),q&&(q.flags|=8,de(se,j,ne,ve)),me&&fs(me,ne),fs(()=>{j.isUnmounted=!0},ne)},fe=(j,ne,ve,ae=!1,ye=!1,q=0)=>{for(let se=q;se<j.length;se++)de(j[se],ne,ve,ae,ye)},ce=j=>{if(j.shapeFlag&6)return ce(j.component.subTree);if(j.shapeFlag&128)return j.suspense.next();const ne=f(j.anchor||j.el),ve=ne&&ne[_4];return ve?f(ve):ne};let We=!1;const ge=(j,ne,ve)=>{let ae;j==null?ne._vnode&&(de(ne._vnode,null,null,!0),ae=ne._vnode.component):m(ne._vnode||null,j,ne,null,null,null,ve),ne._vnode=j,We||(We=!0,vb(ae),kh(),We=!1)},G={p:m,um:de,m:ee,r:J,mt:B,mc:x,pc:U,pbc:T,n:ce,o:e};let le,he;return t&&([le,he]=t(G)),{render:ge,hydrate:le,createApp:ST(ge,le)}}function I1({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 zl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function K4(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oy(e,t,n=!1){const s=e.children,o=t.children;if(wt(s)&&wt(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]=pr(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&oy(r,l)),l.type===ul&&(l.patchFlag===-1&&(l=o[i]=pr(l)),l.el=r.el),l.type===ps&&!l.el&&(l.el=r.el)}}function PT(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 G4(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:G4(t)}function _h(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Y4(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Y4(t.subTree):null}const wh=e=>e.__isSuspense;let gg=0;const HT={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)WT(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}zT(e,t,n,s,o,r,l,a,c)}},hydrate:UT,normalize:jT},fxe=HT;function td(e,t){const n=e.props&&e.props[t];Bt(n)&&n()}function WT(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=Z4(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?(td(e,"onPending"),td(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),yc(f,e.ssFallback)):f.resolve(!1,!0)}function zT(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,p=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:_,isHydrating:k}=d;if(m)d.pendingBranch=f,Si(m,f)?(a(m,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():_&&(k||(a(h,p,n,s,o,null,i,r,l),yc(d,p)))):(d.pendingId=gg++,k?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(h,p,n,s,o,null,i,r,l),yc(d,p))):h&&Si(h,f)?(a(h,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(h&&Si(h,f))a(h,f,n,s,o,d,i,r,l),yc(d,f);else if(td(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=gg++,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(p)},g):g===0&&d.fallback(p)}}function Z4(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:m,remove:_}}=c;let k;const g=qT(e);g&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const v=e.props?fh(e.props.timeout):void 0,y=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:gg++,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:x,activeBranch:E,pendingBranch:T,pendingId:F,effects:S,parentComponent:I,container:B,isInFallback:R}=A;let P=!1;if(A.isHydrating)A.isHydrating=!1;else if(!L){P=E&&T.transition&&T.transition.mode==="out-in";let Z=!1;P&&(E.transition.afterLeave=()=>{F===A.pendingId&&(f(T,B,i===y&&!Z?h(E):i,0),yh(S),R&&x.ssFallback&&(x.ssFallback.el=null))}),E&&!A.isFallbackMountPending&&(m(E.el)===B&&(i=h(E),Z=!0),p(E,I,A,!0),!P&&R&&x.ssFallback&&fs(()=>x.ssFallback.el=null,A)),P||f(T,B,i,0)}A.isFallbackMountPending=!1,yc(A,T),A.pendingBranch=null,A.isInFallback=!1;let W=A.parent,U=!1;for(;W;){if(W.pendingBranch){W.effects.push(...S),U=!0;break}W=W.parent}!U&&!P&&yh(S),A.effects=[],g&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),td(x,"onResolve")},fallback(L){if(!A.pendingBranch)return;const{vnode:$,activeBranch:x,parentComponent:E,container:T,namespace:F}=A;td($,"onFallback");const S=h(x),I=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,L,T,S,E,null,F,l,a),yc(A,L))},B=L.transition&&L.transition.mode==="out-in";B&&(A.isFallbackMountPending=!0,x.transition.afterLeave=I),A.isInFallback=!0,p(x,E,null,!0),B||I()},move(L,$,x){A.activeBranch&&f(A.activeBranch,L,$,x),A.container=L},next(){return A.activeBranch&&h(A.activeBranch)},registerDep(L,$,x){const E=!!A.pendingBranch;E&&A.deps++;const T=L.vnode.el;L.asyncDep.catch(F=>{Hc(F,L,0)}).then(F=>{if(L.isUnmounted||A.isUnmounted||A.pendingId!==L.suspenseId)return;nd(),L.asyncResolved=!0;const{vnode:S}=L;vg(L,F,!1),T&&(S.el=T);const I=!T&&L.subTree.el;$(L,S,m(T||L.subTree.el),T?null:h(L.subTree),A,r,x),I&&(S.placeholder=null,_(I)),Wp(L,S.el),E&&--A.deps===0&&A.resolve()})},unmount(L,$){A.isUnmounted=!0,A.activeBranch&&p(A.activeBranch,n,L,$),A.pendingBranch&&p(A.pendingBranch,n,L,$)}};return A}function UT(e,t,n,s,o,i,r,l,a){const c=t.suspense=Z4(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 jT(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Ib(s?n.default:n),e.ssFallback=s?Ib(n.fallback):ie(ps)}function Ib(e){let t;if(Bt(e)){const n=da&&e._c;n&&(e._d=!1,b()),e=e(),n&&(e._d=!0,t=Ys,X4())}return wt(e)&&(e=MT(e)),e=bo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function Q4(e,t){t&&t.pendingBranch?wt(e)?t.effects.push(...e):t.effects.push(e):yh(e)}function yc(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,Wp(s,o))}function qT(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Be=Symbol.for("v-fgt"),ul=Symbol.for("v-txt"),ps=Symbol.for("v-cmt"),kc=Symbol.for("v-stc"),$u=[];let Ys=null;function b(e=!1){$u.push(Ys=e?null:[])}function X4(){$u.pop(),Ys=$u[$u.length-1]||null}let da=1;function Sh(e,t=!1){da+=e,e<0&&Ys&&t&&(Ys.hasOnce=!0)}function J4(e){return e.dynamicChildren=da>0?Ys||hc:null,X4(),da>0&&Ys&&Ys.push(e),e}function N(e,t,n,s,o,i){return J4(w(e,t,n,s,o,i,!0))}function xe(e,t,n,s,o){return J4(ie(e,t,n,s,o,!0))}function ml(e){return e?e.__v_isVNode===!0:!1}function Si(e,t){return e.type===t.type&&e.key===t.key}function hxe(e){}const e3=({key:e})=>e??null,Vf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Tn(e)||is(e)||Bt(e)?{i:Ws,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&&e3(t),ref:t&&Vf(t),scopeId:Bp,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:Ws};return l?(ry(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Tn(n)?8:16),da>0&&!r&&Ys&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Ys.push(a),a}const ie=VT;function VT(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===I4)&&(e=ps),ml(e)){const l=Tr(e,t,!0);return n&&ry(l,n),da>0&&!i&&Ys&&(l.shapeFlag&6?Ys[Ys.indexOf(e)]=l:Ys.push(l)),l.patchFlag=-2,l}if(XT(e)&&(e=e.__vccOpts),t){t=KT(t);let{class:l,style:a}=t;l&&!Tn(l)&&(t.class=Pe(l)),mn(a)&&(Rp(a)&&!wt(a)&&(a=Cn({},a)),t.style=Jt(a))}const r=Tn(e)?1:wh(e)?128:w4(e)?64:mn(e)?4:Bt(e)?2:0;return w(e,t,n,s,o,r,i,!0)}function KT(e){return e?Rp(e)||H4(e)?Cn({},e):e:null}function Tr(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?Sn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&e3(c),ref:t&&t.ref?n&&i?wt(i)?i.concat(Vf(t)):[i,Vf(t)]:Vf(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&&Tr(e.ssContent),ssFallback:e.ssFallback&&Tr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&pl(u,a.clone(u)),u}function Ye(e=" ",t=0){return ie(ul,null,e,t)}function iy(e,t){const n=ie(kc,null,e);return n.staticCount=t,n}function re(e="",t=!1){return t?(b(),xe(ps,null,e)):ie(ps,null,e)}function bo(e){return e==null||typeof e=="boolean"?ie(ps):wt(e)?ie(Be,null,e.slice()):ml(e)?pr(e):ie(ul,null,String(e))}function pr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Tr(e)}function ry(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(wt(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),ry(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!H4(t)?t._ctx=Ws:o===3&&Ws&&(Ws.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Bt(t)?(t={default:t,_ctx:Ws},n=32):(t=String(t),s&64?(n=16,t=[Ye(t)]):n=8);e.children=t,e.shapeFlag|=n}function Sn(...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=Jt([t.style,s.style]);else if(_d(o)){const i=t[o],r=s[o];r&&i!==r&&!(wt(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Sp(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function yo(e,t,n,s=null){vi(e,t,7,[n,s])}const GT=F4();let YT=0;function t3(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||GT,i={uid:YT++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ZC(!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:z4(s,o),emitsOptions:R4(s,o),emit:null,emitted:null,propsDefaults:tn,inheritAttrs:s.inheritAttrs,ctx:tn,data:tn,props:tn,attrs:tn,slots:tn,refs:tn,setupState:tn,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=CT.bind(null,i),e.ce&&e.ce(i),i}let Hs=null;const zs=()=>Hs||Ws;let Ch,bc;{const e=Np(),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)}};Ch=t("__VUE_INSTANCE_SETTERS__",n=>Hs=n),bc=t("__VUE_SSR_SETTERS__",n=>fa=n)}const Wc=e=>{const t=Hs;return Ch(e),e.scope.on(),()=>{e.scope.off(),Ch(t)}},nd=()=>{Hs&&Hs.scope.off(),Ch(null)};function n3(e){return e.vnode.shapeFlag&4}let fa=!1;function s3(e,t=!1,n=!1){t&&bc(t);const{props:s,children:o}=e.vnode,i=n3(e);IT(e,s,i,t),OT(e,o,n||t);const r=i?ZT(e,t):void 0;return t&&bc(!1),r}function ZT(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,fg);const{setup:s}=n;if(s){Ar();const o=e.setupContext=s.length>1?i3(e):null,i=Wc(e),r=wd(s,e,0,[e.props,o]),l=Wv(r);if(Mr(),i(),(l||e.sp)&&!_r(e)&&Yv(e),l){if(r.then(nd,nd),t)return r.then(a=>{vg(e,a,t)}).catch(a=>{Hc(a,e,0)});e.asyncDep=r}else vg(e,r,t)}else o3(e,t)}function vg(e,t,n){Bt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:mn(t)&&(e.setupState=p4(t)),o3(e,n)}let Ah,yg;function pxe(e){Ah=e,yg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,vT))}}const mxe=()=>!Ah;function o3(e,t,n){const s=e.type;if(!e.render){if(!t&&Ah&&!s.render){const o=s.template||ty(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=Cn(Cn({isCustomElement:i,delimiters:l},r),a);s.render=Ah(o,c)}}e.render=s.render||pi,yg&&yg(e)}{const o=Wc(e);Ar();try{yT(e)}finally{Mr(),o()}}}const QT={get(e,t){return Gs(e,"get",""),e[t]}};function i3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,QT),slots:e.slots,emit:e.emit,expose:t}}function Md(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(p4(yt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Iu)return Iu[n](e)},has(t,n){return n in t||n in Iu}})):e.proxy}function kg(e,t=!0){return Bt(e)?e.displayName||e.name:e.name||t&&e.__name}function XT(e){return Bt(e)&&"__vccOpts"in e}const D=(e,t)=>FE(e,t,fa);function bn(e,t,n){try{Sh(-1);const s=arguments.length;return s===2?mn(t)&&!wt(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{Sh(1)}}function gxe(){}function vxe(e,t,n,s){const o=n[s];if(o&&JT(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function JT(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Ds(n[s],t[s]))return!1;return da>0&&Ys&&Ys.push(e),!0}const e9="3.5.35",yxe=pi,kxe=PE,bxe=Xa,xxe=b4,t9={createComponentInstance:t3,setupComponent:s3,renderComponentRoot:qf,setCurrentRenderingInstance:Xu,isVNode:ml,normalizeVNode:bo,getComponentPublicInstance:Md,ensureValidVNode:ey,pushWarningContext:BE,popWarningContext:DE},_xe=t9,wxe=null,Sxe=null,Cxe=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 $b=typeof window<"u"&&window.trustedTypes;if($b)try{bg=$b.createPolicy("vue",{createHTML:e=>e})}catch{}const r3=bg?e=>bg.createHTML(e):e=>e,n9="http://www.w3.org/2000/svg",s9="http://www.w3.org/1998/Math/MathML",cr=typeof document<"u"?document:null,Lb=cr&&cr.createElement("template"),o9={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"?cr.createElementNS(n9,e):t==="mathml"?cr.createElementNS(s9,e):n?cr.createElement(e,{is:n}):cr.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>cr.createTextNode(e),createComment:e=>cr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>cr.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{Lb.innerHTML=r3(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Lb.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]}},zr="transition",hu="animation",Nc=Symbol("_vtc"),l3={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},a3=Cn({},C4,l3),i9=e=>(e.displayName="Transition",e.props=a3,e),gl=i9((e,{slots:t})=>bn(QE,c3(e),t)),Ul=(e,t=[])=>{wt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Fb=e=>e?wt(e)?e.some(t=>t.length>1):e.length>1:!1;function c3(e){const t={};for(const S in e)S in l3||(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:p=`${n}-leave-to`}=e,h=r9(o),m=h&&h[0],_=h&&h[1],{onBeforeEnter:k,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:A,onBeforeAppear:L=k,onAppear:$=g,onAppearCancelled:x=v}=t,E=(S,I,B,R)=>{S._enterCancelled=R,Qr(S,I?u:l),Qr(S,I?c:r),B&&B()},T=(S,I)=>{S._isLeaving=!1,Qr(S,d),Qr(S,p),Qr(S,f),I&&I()},F=S=>(I,B)=>{const R=S?$:g,P=()=>E(I,S,B);Ul(R,[I,P]),Ob(()=>{Qr(I,S?a:i),Pi(I,S?u:l),Fb(R)||Rb(I,s,m,P)})};return Cn(t,{onBeforeEnter(S){Ul(k,[S]),Pi(S,i),Pi(S,r)},onBeforeAppear(S){Ul(L,[S]),Pi(S,a),Pi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,I){S._isLeaving=!0;const B=()=>T(S,I);Pi(S,d),S._enterCancelled?(Pi(S,f),xg(S)):(xg(S),Pi(S,f)),Ob(()=>{S._isLeaving&&(Qr(S,d),Pi(S,p),Fb(y)||Rb(S,s,_,B))}),Ul(y,[S,B])},onEnterCancelled(S){E(S,!1,void 0,!0),Ul(v,[S])},onAppearCancelled(S){E(S,!0,void 0,!0),Ul(x,[S])},onLeaveCancelled(S){T(S),Ul(A,[S])}})}function r9(e){if(e==null)return null;if(mn(e))return[$1(e.enter),$1(e.leave)];{const t=$1(e);return[t,t]}}function $1(e){return fh(e)}function Pi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Nc]||(e[Nc]=new Set)).add(t)}function Qr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Nc];n&&(n.delete(t),n.size||(e[Nc]=void 0))}function Ob(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let l9=0;function Rb(e,t,n,s){const o=e._endId=++l9,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=u3(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function u3(e,t){const n=window.getComputedStyle(e),s=h=>(n[h]||"").split(", "),o=s(`${zr}Delay`),i=s(`${zr}Duration`),r=Bb(o,i),l=s(`${hu}Delay`),a=s(`${hu}Duration`),c=Bb(l,a);let u=null,d=0,f=0;t===zr?r>0&&(u=zr,d=r,f=i.length):t===hu?c>0&&(u=hu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?zr:hu:null,f=u?u===zr?i.length:a.length:0);const p=u===zr&&/\b(?:transform|all)(?:,|$)/.test(s(`${zr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Bb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Db(n)+Db(e[s])))}function Db(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function xg(e){return(e?e.ownerDocument:document).body.offsetHeight}function a9(e,t,n){const s=e[Nc];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Mh=Symbol("_vod"),d3=Symbol("_vsh"),di={name:"show",beforeMount(e,{value:t},{transition:n}){e[Mh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):pu(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),pu(e,!0),s.enter(e)):s.leave(e,()=>{pu(e,!1)}):pu(e,t))},beforeUnmount(e,{value:t}){pu(e,t)}};function pu(e,t){e.style.display=t?e[Mh]:"none",e[d3]=!t}function c9(){di.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const f3=Symbol("");function Axe(e){const t=zs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Eh(i,o))},s=()=>{const o=e(t.proxy);t.ce?Eh(t.ce,o):_g(t.subTree,o),n(o)};N4(()=>{yh(s)}),gn(()=>{Ge(s,pi,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),xn(()=>o.disconnect())})}function _g(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{_g(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Eh(e.el,t);else if(e.type===Be)e.children.forEach(n=>_g(n,t));else if(e.type===kc){let{el:n,anchor:s}=e;for(;n&&(Eh(n,t),n!==s);)n=n.nextSibling}}function Eh(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=rE(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[f3]=s}}const u9=/(?:^|;)\s*display\s*:/;function d9(e,t,n){const s=e.style,o=Tn(n);let i=!1;if(n&&!o){if(t)if(Tn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Cu(s,l,"")}else for(const r in t)n[r]==null&&Cu(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?h9(e,r,!Tn(t)&&t?t[r]:void 0,l)||Cu(s,r,l):Cu(s,r,"")}}else if(o){if(t!==n){const r=s[f3];r&&(n+=";"+r),s.cssText=n,i=u9.test(n)}}else t&&e.removeAttribute("style");Mh in e&&(e[Mh]=i?s.display:"",e[d3]&&(s.display="none"))}const Pb=/\s*!important$/;function Cu(e,t,n){if(wt(n))n.forEach(s=>Cu(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=f9(e,t);Pb.test(n)?e.setProperty(xo(s),n.replace(Pb,""),"important"):e[s]=n}}const Hb=["Webkit","Moz","ms"],L1={};function f9(e,t){const n=L1[t];if(n)return n;let s=ws(t);if(s!=="filter"&&s in e)return L1[t]=s;s=Ep(s);for(let o=0;o<Hb.length;o++){const i=Hb[o]+s;if(i in e)return L1[t]=i}return t}function h9(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Tn(s)&&n===s}const Wb="http://www.w3.org/1999/xlink";function zb(e,t,n,s,o,i=oE(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Wb,t.slice(6,t.length)):e.setAttributeNS(Wb,t,n):n==null||i&&!KC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Go(n)?String(n):n)}function Ub(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?r3(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=KC(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 yr(e,t,n,s){e.addEventListener(t,n,s)}function p9(e,t,n,s){e.removeEventListener(t,n,s)}const jb=Symbol("_vei");function m9(e,t,n,s,o=null){const i=e[jb]||(e[jb]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=g9(t);if(s){const c=i[t]=k9(s,o);yr(e,l,c,a)}else r&&(p9(e,l,r,a),i[t]=void 0)}}const qb=/(?:Once|Passive|Capture)$/;function g9(e){let t;if(qb.test(e)){t={};let s;for(;s=e.match(qb);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):xo(e.slice(2)),t]}let F1=0;const v9=Promise.resolve(),y9=()=>F1||(v9.then(()=>F1=0),F1=Date.now());function k9(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(wt(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&&vi(c,t,5,l)}}else vi(o,t,5,[s])};return n.value=e,n.attached=y9(),n}const Vb=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,b9=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?a9(e,s,r):t==="style"?d9(e,n,s):_d(t)?Sp(t)||m9(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):x9(e,t,s,r))?(Ub(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&zb(e,t,s,r,i,t!=="value")):e._isVueCE&&(_9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Tn(s)))?Ub(e,ws(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),zb(e,t,s,r))};function x9(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Vb(t)&&Bt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Vb(t)&&Tn(n)?!1:t in e}function _9(e,t){const n=e._def.props;if(!n)return!1;const s=ws(t);return Array.isArray(n)?n.some(o=>ws(o)===s):Object.keys(n).some(o=>ws(o)===s)}const Kb={};function w9(e,t,n){let s=Ve(e,t);Cp(s)&&(s=Cn({},s,t));class o extends ly{constructor(r){super(s,r,n)}}return o.def=s,o}const Mxe=((e,t)=>w9(e,t,H9)),S9=typeof HTMLElement<"u"?HTMLElement:class{};class ly extends S9{constructor(t,n={},s=Ih){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!==Ih?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Cn({},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 ly){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,vt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!wt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=fh(this._props[a])),(l||(l=Object.create(null)))[ws(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)pn(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=wt(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(ws))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):Kb;const o=ws(t);n&&this._numberProps&&this._numberProps[o]&&(s=fh(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===Kb?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(xo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(xo(t),n+""):n||this.removeAttribute(xo(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),P9(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ie(this._def,Cn(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,Cp(r[0])?Cn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),xo(i)!==i&&o(xo(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 C9(e){const t=zs(),n=t&&t.ce;return n||null}function Exe(){const e=C9();return e&&e.shadowRoot}function Txe(e="$style"){{const t=zs();if(!t)return tn;const n=t.type.__cssModules;if(!n)return tn;const s=n[e];return s||tn}}const h3=new WeakMap,p3=new WeakMap,Th=Symbol("_moveCb"),Gb=Symbol("_enterCb"),A9=e=>(delete e.props.mode,e),M9=A9({name:"TransitionGroup",props:Cn({},a3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=zs(),s=S4();let o,i;return Zv(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!$9(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(T9),o.forEach(N9);const l=o.filter(I9);xg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Pi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Th]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Th]=null,Qr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=ln(e),l=c3(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),pl(u,Ju(u,l,s,n)),h3.set(u,m3(u.el)))}i=t.default?Gv(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&pl(u,Ju(u,l,s,n))}return ie(a,null,i)}}}),E9=M9;function T9(e){const t=e.el;t[Th]&&t[Th](),t[Gb]&&t[Gb]()}function N9(e){p3.set(e,m3(e.el))}function I9(e){const t=h3.get(e),n=p3.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 m3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function $9(e,t,n){const s=e.cloneNode(),o=e[Nc];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}=u3(s);return i.removeChild(s),r}const vl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return wt(t)?n=>mc(t,n):t};function L9(e){e.target.composing=!0}function Yb(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mi=Symbol("_assign");function Zb(e,t,n){return t&&(e=e.trim()),n&&(e=Tp(e)),e}const po={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[mi]=vl(o);const i=s||o.props&&o.props.type==="number";yr(e,t?"change":"input",r=>{r.target.composing||e[mi](Zb(e.value,n,i))}),(n||i)&&yr(e,"change",()=>{e.value=Zb(e.value,n,i)}),t||(yr(e,"compositionstart",L9),yr(e,"compositionend",Yb),yr(e,"change",Yb))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[mi]=vl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Tp(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)}},Nh={deep:!0,created(e,t,n){e[mi]=vl(n),yr(e,"change",()=>{const s=e._modelValue,o=Ic(e),i=e.checked,r=e[mi];if(wt(s)){const l=Ip(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(ya(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(v3(e,i))})},mounted:Qb,beforeUpdate(e,t,n){e[mi]=vl(n),Qb(e,t,n)}};function Qb(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(wt(t))o=Ip(t,s.props.value)>-1;else if(ya(t))o=t.has(s.props.value);else{if(t===n)return;o=Cr(t,v3(e,!0))}e.checked!==o&&(e.checked=o)}const g3={created(e,{value:t},n){e.checked=Cr(t,n.props.value),e[mi]=vl(n),yr(e,"change",()=>{e[mi](Ic(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[mi]=vl(s),t!==n&&(e.checked=Cr(t,s.props.value))}},wg={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=ya(t);yr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Tp(Ic(r)):Ic(r));e[mi](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,vt(()=>{e._assigning=!1})}),e[mi]=vl(s)},mounted(e,{value:t}){Xb(e,t)},beforeUpdate(e,t,n){e[mi]=vl(n)},updated(e,{value:t}){e._assigning||Xb(e,t)}};function Xb(e,t){const n=e.multiple,s=wt(t);if(!(n&&!s&&!ya(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=Ic(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Ip(t,l)>-1}else r.selected=t.has(l);else if(Cr(Ic(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ic(e){return"_value"in e?e._value:e.value}function v3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const F9={created(e,t,n){vf(e,t,n,null,"created")},mounted(e,t,n){vf(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){vf(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){vf(e,t,n,s,"updated")}};function y3(e,t){switch(e){case"SELECT":return wg;case"TEXTAREA":return po;default:switch(t){case"checkbox":return Nh;case"radio":return g3;default:return po}}}function vf(e,t,n,s,o){const r=y3(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function O9(){po.getSSRProps=({value:e})=>({value:e}),g3.getSSRProps=({value:e},t)=>{if(t.props&&Cr(t.props.value,e))return{checked:!0}},Nh.getSSRProps=({value:e},t)=>{if(wt(e)){if(t.props&&Ip(e,t.props.value)>-1)return{checked:!0}}else if(ya(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},F9.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=y3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const R9=["ctrl","shift","alt","meta"],B9={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)=>R9.some(n=>e[`${n}Key`]&&!t.includes(n))},xt=(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=B9[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},D9={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ji=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=xo(o.key);if(t.some(r=>r===i||D9[r]===i))return e(o)}))},k3=Cn({patchProp:b9},o9);let Lu,Jb=!1;function b3(){return Lu||(Lu=BT(k3))}function x3(){return Lu=Jb?Lu:DT(k3),Jb=!0,Lu}const P9=((...e)=>{b3().render(...e)}),Nxe=((...e)=>{x3().hydrate(...e)}),Ih=((...e)=>{const t=b3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=w3(s);if(!o)return;const i=t._component;!Bt(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,_3(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),H9=((...e)=>{const t=x3().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=w3(s);if(o)return n(o,!0,_3(o))},t});function _3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function w3(e){return Tn(e)?document.querySelector(e):e}let ex=!1;const Ixe=()=>{ex||(ex=!0,O9(),c9())};/*!
21
+ * shared v11.4.5
22
+ * (c) 2026 kazuya kawaguchi
23
+ * Released under the MIT License.
24
+ */function W9(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const $h=typeof window<"u",_l=(e,t=!1)=>t?Symbol.for(e):Symbol(e),z9=(e,t,n)=>U9({l:e,k:t,s:n}),U9=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),gs=e=>typeof e=="number"&&isFinite(e),S3=e=>cy(e)==="[object Date]",$c=e=>cy(e)==="[object RegExp]",zp=e=>on(e)&&Object.keys(e).length===0,vs=Object.assign,j9=Object.create,En=(e=null)=>j9(e);let tx;const ea=()=>tx||(tx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:En());function nx(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 q9(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 V9=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,K9=/^(?:href|src|action|formaction)$/i;function ay(e){return V9.test(e)}function G9(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+=ay(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function sx(e,t){if(K9.test(e)&&ay(t))return"about:blank";const n=e.toLowerCase()==="style"?G9(t):t;return q9(n)}function Y9(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${sx(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${sx(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)=>ay(o)?`${s}about:blank`:n),e}const Z9=Object.prototype.hasOwnProperty;function hi(e,t){return Z9.call(e,t)}const ts=Array.isArray,Vn=e=>typeof e=="function",kt=e=>typeof e=="string",un=e=>typeof e=="boolean",dn=e=>e!==null&&typeof e=="object",Q9=e=>dn(e)&&Vn(e.then)&&Vn(e.catch),C3=Object.prototype.toString,cy=e=>C3.call(e),on=e=>cy(e)==="[object Object]",X9=e=>e==null?"":ts(e)||on(e)&&e.toString===C3?JSON.stringify(e,null,2):String(e);function uy(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const yf=e=>!dn(e)||ts(e);function Kf(e,t){if(yf(e)||yf(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__"&&(dn(s[i])&&!dn(o[i])&&(o[i]=Array.isArray(s[i])?[]:En()),yf(o[i])||yf(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 J9(e,t,n){return{line:e,column:t,offset:n}}function Sg(e,t,n){return{start:e,end:t}}const kn={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},e7=17;function Up(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 t7(e){throw e}const Ri=" ",n7="\r",qs=`
29
+ `,s7="\u2028",o7="\u2029";function i7(e){const t=e;let n=0,s=1,o=1,i=0;const r=$=>t[$]===n7&&t[$+1]===qs,l=$=>t[$]===qs,a=$=>t[$]===o7,c=$=>t[$]===s7,u=$=>r($)||l($)||a($)||c($),d=()=>n,f=()=>s,p=()=>o,h=()=>i,m=$=>r($)||a($)||c($)?qs:t[$],_=()=>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 A($=0){i=$}function L(){const $=n+i;for(;$!==n;)g();i=0}return{index:d,line:f,column:p,peekOffset:h,charAt:m,currentChar:_,currentPeek:k,next:g,peek:v,reset:y,resetPeek:A,skipToPeek:L}}const ir=void 0,r7=".",ox="'",l7="tokenizer";function a7(e,t={}){const n=t.location!==!1,s=i7(e),o=()=>s.index(),i=()=>J9(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(q,se,me,...Te){const Me=c();if(se.column+=me,se.offset+=me,u){const $e=n?Sg(Me.startLoc,se):null,pe=Up(q,$e,{domain:l7,args:Te});u(pe)}}function f(q,se,me){q.endLoc=i(),q.currentType=se;const Te={type:se};return n&&(Te.loc=Sg(q.startLoc,q.endLoc)),me!=null&&(Te.value=me),Te}const p=q=>f(q,13);function h(q,se){return q.currentChar()===se?(q.next(),se):(d(kn.EXPECTED_TOKEN,i(),0,se),"")}function m(q){let se="";for(;q.currentPeek()===Ri||q.currentPeek()===qs;)se+=q.currentPeek(),q.peek();return se}function _(q){const se=m(q);return q.skipToPeek(),se}function k(q){if(q===ir)return!1;const se=q.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se===95}function g(q){if(q===ir)return!1;const se=q.charCodeAt(0);return se>=48&&se<=57}function v(q,se){const{currentType:me}=se;if(me!==2)return!1;m(q);const Te=k(q.currentPeek());return q.resetPeek(),Te}function y(q,se){const{currentType:me}=se;if(me!==2)return!1;m(q);const Te=q.currentPeek()==="-"?q.peek():q.currentPeek(),Me=g(Te);return q.resetPeek(),Me}function A(q,se){const{currentType:me}=se;if(me!==2)return!1;m(q);const Te=q.currentPeek()===ox;return q.resetPeek(),Te}function L(q,se){const{currentType:me}=se;if(me!==7)return!1;m(q);const Te=q.currentPeek()===".";return q.resetPeek(),Te}function $(q,se){const{currentType:me}=se;if(me!==8)return!1;m(q);const Te=k(q.currentPeek());return q.resetPeek(),Te}function x(q,se){const{currentType:me}=se;if(!(me===7||me===11))return!1;m(q);const Te=q.currentPeek()===":";return q.resetPeek(),Te}function E(q,se){const{currentType:me}=se;if(me!==9)return!1;const Te=()=>{const $e=q.currentPeek();return $e==="{"?k(q.peek()):$e==="@"||$e==="|"||$e===":"||$e==="."||$e===Ri||!$e?!1:$e===qs?(q.peek(),Te()):F(q,!1)},Me=Te();return q.resetPeek(),Me}function T(q){m(q);const se=q.currentPeek()==="|";return q.resetPeek(),se}function F(q,se=!0){const me=(Me=!1,$e="")=>{const pe=q.currentPeek();return pe==="{"||pe==="@"||!pe?Me:pe==="|"?!($e===Ri||$e===qs):pe===Ri?(q.peek(),me(!0,Ri)):pe===qs?(q.peek(),me(!0,qs)):!0},Te=me();return se&&q.resetPeek(),Te}function S(q,se){const me=q.currentChar();return me===ir?ir:se(me)?(q.next(),me):null}function I(q){const se=q.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36}function B(q){return S(q,I)}function R(q){const se=q.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36||se===45}function P(q){return S(q,R)}function W(q){const se=q.charCodeAt(0);return se>=48&&se<=57}function U(q){return S(q,W)}function Z(q){const se=q.charCodeAt(0);return se>=48&&se<=57||se>=65&&se<=70||se>=97&&se<=102}function z(q){return S(q,Z)}function ee(q){let se="",me="";for(;se=U(q);)me+=se;return me}function de(q){let se="";for(;;){const me=q.currentChar();if(me==="\\"){const Te=q.peek();Te==="{"||Te==="}"||Te==="@"||Te==="|"||Te==="\\"?(se+=me+Te,q.next(),q.next()):(q.resetPeek(),se+=me,q.next())}else{if(me==="{"||me==="}"||me==="@"||me==="|"||!me)break;if(me===Ri||me===qs)if(F(q))se+=me,q.next();else{if(T(q))break;se+=me,q.next()}else se+=me,q.next()}}return se}function J(q){_(q);let se="",me="";for(;se=P(q);)me+=se;const Te=q.currentChar();if(Te&&Te!=="}"&&Te!==ir&&Te!==Ri&&Te!==qs&&Te!==" "){const Me=G(q);return d(kn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me+Me),me+Me}return q.currentChar()===ir&&d(kn.UNTERMINATED_CLOSING_BRACE,i(),0),me}function Y(q){_(q);let se="";return q.currentChar()==="-"?(q.next(),se+=`-${ee(q)}`):se+=ee(q),q.currentChar()===ir&&d(kn.UNTERMINATED_CLOSING_BRACE,i(),0),se}function X(q){return q!==ox&&q!==qs}function fe(q){_(q),h(q,"'");let se="",me="";for(;se=S(q,X);)se==="\\"?me+=ce(q):me+=se;const Te=q.currentChar();return Te===qs||Te===ir?(d(kn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Te===qs&&(q.next(),h(q,"'")),me):(h(q,"'"),me)}function ce(q){const se=q.currentChar();switch(se){case"\\":case"'":return q.next(),`\\${se}`;case"u":return We(q,se,4);case"U":return We(q,se,6);default:return d(kn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,se),""}}function We(q,se,me){h(q,se);let Te="";for(let Me=0;Me<me;Me++){const $e=z(q);if(!$e){d(kn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${se}${Te}${q.currentChar()}`);break}Te+=$e}return`\\${se}${Te}`}function ge(q){return q!=="{"&&q!=="}"&&q!==Ri&&q!==qs}function G(q){_(q);let se="",me="";for(;se=S(q,ge);)me+=se;return me}function le(q){let se="",me="";for(;se=B(q);)me+=se;return me}function he(q){const se=me=>{const Te=q.currentChar();return Te==="{"||Te==="@"||Te==="|"||Te==="("||Te===")"||!Te||Te===Ri?me:(me+=Te,q.next(),se(me))};return se("")}function j(q){_(q);const se=h(q,"|");return _(q),se}function ne(q,se){let me=null;switch(q.currentChar()){case"{":return se.braceNest>=1&&d(kn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),q.next(),me=f(se,2,"{"),_(q),se.braceNest++,me;case"}":return se.braceNest>0&&se.currentType===2&&d(kn.EMPTY_PLACEHOLDER,i(),0),q.next(),me=f(se,3,"}"),se.braceNest--,se.braceNest>0&&_(q),se.inLinked&&se.braceNest===0&&(se.inLinked=!1),me;case"@":return se.braceNest>0&&d(kn.UNTERMINATED_CLOSING_BRACE,i(),0),me=ve(q,se)||p(se),se.braceNest=0,me;default:{let Me=!0,$e=!0,pe=!0;if(T(q))return se.braceNest>0&&d(kn.UNTERMINATED_CLOSING_BRACE,i(),0),me=f(se,1,j(q)),se.braceNest=0,se.inLinked=!1,me;if(se.braceNest>0&&(se.currentType===4||se.currentType===5||se.currentType===6))return d(kn.UNTERMINATED_CLOSING_BRACE,i(),0),se.braceNest=0,ae(q,se);if(Me=v(q,se))return me=f(se,4,J(q)),_(q),me;if($e=y(q,se))return me=f(se,5,Y(q)),_(q),me;if(pe=A(q,se))return me=f(se,6,fe(q)),_(q),me;if(!Me&&!$e&&!pe)return me=f(se,12,G(q)),d(kn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me.value),_(q),me;break}}return me}function ve(q,se){const{currentType:me}=se;let Te=null;const Me=q.currentChar();switch((me===7||me===8||me===11||me===9)&&(Me===qs||Me===Ri)&&d(kn.INVALID_LINKED_FORMAT,i(),0),Me){case"@":return q.next(),Te=f(se,7,"@"),se.inLinked=!0,Te;case".":return _(q),q.next(),f(se,8,".");case":":return _(q),q.next(),f(se,9,":");default:return T(q)?(Te=f(se,1,j(q)),se.braceNest=0,se.inLinked=!1,Te):L(q,se)||x(q,se)?(_(q),ve(q,se)):$(q,se)?(_(q),f(se,11,le(q))):E(q,se)?(_(q),Me==="{"?ne(q,se)||Te:f(se,10,he(q))):(me===7&&d(kn.INVALID_LINKED_FORMAT,i(),0),se.braceNest=0,se.inLinked=!1,ae(q,se))}}function ae(q,se){let me={type:13};if(se.braceNest>0)return ne(q,se)||p(se);if(se.inLinked)return ve(q,se)||p(se);switch(q.currentChar()){case"{":return ne(q,se)||p(se);case"}":return d(kn.UNBALANCED_CLOSING_BRACE,i(),0),q.next(),f(se,3,"}");case"@":return ve(q,se)||p(se);default:{if(T(q))return me=f(se,1,j(q)),se.braceNest=0,se.inLinked=!1,me;if(F(q))return f(se,0,de(q));break}}return me}function ye(){const{currentType:q,offset:se,startLoc:me,endLoc:Te}=a;return a.lastType=q,a.lastOffset=se,a.lastStartLoc=me,a.lastEndLoc=Te,a.offset=o(),a.startLoc=i(),s.currentChar()===ir?f(a,13):ae(s,a)}return{nextToken:ye,currentOffset:o,currentPosition:i,context:c}}const c7="parser",u7=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,d7=/\\([\\@{}|])/g;function f7(e,t){return t}function h7(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 p7(e={}){const t=e.location!==!1,{onError:n}=e;function s(k,g,v,y,...A){const L=k.currentPosition();if(L.offset+=y,L.column+=y,n){const $=t?Sg(v,L):null,x=Up(g,$,{domain:c7,args:A});n(x)}}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(d7,f7),i(y,k.currentOffset(),k.currentPosition()),y}function l(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(5,y,A);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:A}=v,L=o(4,y,A);return L.key=g,k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function c(k,g){const v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(9,y,A);return L.value=g.replace(u7,h7),k.nextToken(),i(L,k.currentOffset(),k.currentPosition()),L}function u(k){const g=k.nextToken(),v=k.context(),{lastOffset:y,lastStartLoc:A}=v,L=o(8,y,A);return g.type!==11?(s(k,kn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),L.value="",i(L,y,A),{nextConsumeToken:g,node:L}):(g.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Bi(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 A=u(k);v.modifier=A.node,y=A.nextConsumeToken||k.nextToken()}switch(y.type!==9&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(y)),y=k.nextToken(),y.type===2&&(y=k.nextToken()),y.type){case 10:y.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(y)),v.key=d(k,y.value||"");break;case 4:y.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(y)),v.key=a(k,y.value||"");break;case 5:y.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(y)),v.key=l(k,y.value||"");break;case 6:y.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(y)),v.key=c(k,y.value||"");break;default:{s(k,kn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const A=k.context(),L=o(7,A.offset,A.startLoc);return L.value="",i(L,A.offset,A.startLoc),v.key=L,i(v,A.offset,A.startLoc),{nextConsumeToken:y,node:v}}}return i(v,k.currentOffset(),k.currentPosition()),{node:v}}function p(k){const g=k.context(),v=g.currentType===1?k.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,A=o(2,v,y);A.items=[];let L=null;do{const E=L||k.nextToken();switch(L=null,E.type){case 0:E.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(E)),A.items.push(r(k,E.value||""));break;case 5:E.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(E)),A.items.push(l(k,E.value||""));break;case 4:E.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(E)),A.items.push(a(k,E.value||""));break;case 6:E.value==null&&s(k,kn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Bi(E)),A.items.push(c(k,E.value||""));break;case 7:{const T=f(k);A.items.push(T.node),L=T.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const $=g.currentType===1?g.lastOffset:k.currentOffset(),x=g.currentType===1?g.lastEndLoc:k.currentPosition();return i(A,$,x),A}function h(k,g,v,y){const A=k.context();let L=y.items.length===0;const $=o(1,g,v);$.cases=[],$.cases.push(y);do{const x=p(k);L||(L=x.items.length===0),$.cases.push(x)}while(A.currentType!==13);return L&&s(k,kn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i($,k.currentOffset(),k.currentPosition()),$}function m(k){const g=k.context(),{offset:v,startLoc:y}=g,A=p(k);return g.currentType===13?A:h(k,v,y,A)}function _(k){const g=a7(k,vs({},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,kn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,k[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:_}}function Bi(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 m7(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function ix(e,t){for(let n=0;n<e.length;n++)dy(e[n],t)}function dy(e,t){switch(e.type){case 1:ix(e.cases,t),t.helper("plural");break;case 2:ix(e.items,t);break;case 6:{dy(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 g7(e,t={}){const n=m7(e);n.helper("normalize"),e.body&&dy(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function v7(e){const t=e.body;return t.type===2?rx(t):t.cases.forEach(n=>rx(n)),e}function rx(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=uy(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 Ja(e){switch(e.t=e.type,e.type){case 0:{const t=e;Ja(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++)Ja(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++)Ja(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;Ja(t.key),t.k=t.key,delete t.key,t.modifier&&(Ja(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 y7(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,_){r.code+=m}function c(m,_=!0){const k=_?s:"";a(o?k+" ".repeat(m):k)}function u(m=!0){const _=++r.indentLevel;m&&c(_)}function d(m=!0){const _=--r.indentLevel;m&&c(_)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function k7(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Lc(e,t.key),t.modifier?(e.push(", "),Lc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function b7(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&&(Lc(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function x7(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&&(Lc(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function _7(e,t){t.body?Lc(e,t.body):e.push("null")}function Lc(e,t){const{helper:n}=e;switch(t.type){case 0:_7(e,t);break;case 1:x7(e,t);break;case 2:b7(e,t);break;case 6:k7(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 w7=(e,t={})=>{const n=kt(t.mode)?t.mode:"normal",s=kt(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=y7(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${uy(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Lc(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 S7(e,t={}){const n=vs({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=p7(n).parse(e);return s?(i&&v7(l),o&&Ja(l),{ast:l,code:""}):(g7(l,n),w7(l,n))}/*!
31
+ * core-base v11.4.5
32
+ * (c) 2026 kazuya kawaguchi
33
+ * Released under the MIT License.
34
+ */function C7(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ea().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ea().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Vi(e){return dn(e)&&fy(e)===0&&(hi(e,"b")||hi(e,"body"))}const A3=["b","body"];function A7(e){return wl(e,A3)}const M3=["c","cases"];function M7(e){return wl(e,M3,[])}const E3=["s","static"];function E7(e){return wl(e,E3)}const T3=["i","items"];function T7(e){return wl(e,T3,[])}const N3=["t","type"];function fy(e){return wl(e,N3)}const I3=["v","value"];function kf(e,t){const n=wl(e,I3);if(n!=null)return n;throw sd(t)}const $3=["m","modifier"];function N7(e){return wl(e,$3)}const L3=["k","key"];function I7(e){const t=wl(e,L3);if(t)return t;throw sd(6)}function wl(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(hi(e,o)&&e[o]!=null)return e[o]}return n}const F3=[...A3,...M3,...E3,...T3,...L3,...$3,...I3,...N3];function sd(e){return new Error(`unhandled node type: ${e}`)}function O1(e){return n=>$7(n,e)}function $7(e,t){const n=A7(t);if(n==null)throw sd(0);if(fy(n)===1){const i=M7(n);return e.plural(i.reduce((r,l)=>[...r,lx(e,l)],[]))}else return lx(e,n)}function lx(e,t){const n=E7(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=T7(t).reduce((o,i)=>[...o,Cg(e,i)],[]);return e.normalize(s)}}function Cg(e,t){const n=fy(t);switch(n){case 3:return kf(t,n);case 9:return kf(t,n);case 4:{const s=t;if(hi(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(hi(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw sd(n)}case 5:{const s=t;if(hi(s,"i")&&gs(s.i))return e.interpolate(e.list(s.i));if(hi(s,"index")&&gs(s.index))return e.interpolate(e.list(s.index));throw sd(n)}case 6:{const s=t,o=N7(s),i=I7(s);return e.linked(Cg(e,i),o?Cg(e,o):void 0,e.type)}case 7:return kf(t,n);case 8:return kf(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const L7=e=>e;let bf=En();function F7(e,t={}){let n=!1;const s=t.onError||t7;return t.onError=o=>{n=!0,s(o)},{...S7(e,t),detectError:n}}function O7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&kt(e)){un(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||L7)(e),o=bf[s];if(o)return o;const{ast:i,detectError:r}=F7(e,{...t,location:!1,jit:!0}),l=O1(i);return r?l:bf[s]=l}else{const n=e.cacheKey;if(n){const s=bf[n];return s||(bf[n]=O1(e))}else return O1(e)}}let od=null;function R7(e){od=e}function B7(e,t,n){od&&od.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const D7=P7("function:translate");function P7(e){return t=>od&&od.emit(e,t)}const kr={INVALID_ARGUMENT:e7,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},H7=24;function br(e){return Up(e,null,void 0)}function hy(e,t){return t.locale!=null?ax(t.locale):ax(e.locale)}let R1;function ax(e){if(kt(e))return e;if(Vn(e)){if(e.resolvedOnce&&R1!=null)return R1;if(e.constructor.name==="Function"){const t=e();if(Q9(t))throw br(kr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return R1=t}else throw br(kr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw br(kr.NOT_SUPPORT_LOCALE_TYPE)}function W7(e,t,n){return[...new Set([n,...ts(t)?t:dn(t)?Object.keys(t):kt(t)?[t]:[n]])]}function Ag(e,t,n){const s=kt(n)?n:id,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;ts(r);)r=cx(i,r,t);const l=ts(t)||!on(t)?t:t.default?t.default:null;r=kt(l)?[l]:l,ts(r)&&cx(i,r,!1),o.__localeChainCache.set(s,i)}return i}function cx(e,t,n){let s=!0;for(let o=0;o<t.length&&un(s);o++){const i=t[o];kt(i)&&(s=z7(e,t[o],n))}return s}function z7(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=U7(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function U7(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),(ts(n)||on(n))&&n[o]&&(s=n[o])}return s}const Sl=[];Sl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Sl[1]={w:[1],".":[2],"[":[4],o:[7]};Sl[2]={w:[2],i:[3,0],0:[3,0]};Sl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Sl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Sl[5]={"'":[4,0],o:8,l:[5,0]};Sl[6]={'"':[4,0],o:8,l:[6,0]};const j7=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function q7(e){return j7.test(e)}function V7(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 K7(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 G7(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:q7(t)?V7(t):"*"+t}function Y7(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=G7(r),r===!1))return!1;f[1]()}};function p(){const h=e[n+1];if(s===5&&h==="'"||s===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&p())){if(a=K7(i),d=Sl[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 ux=new Map;function Z7(e,t){return dn(e)?e[t]:null}function Q7(e,t){if(!dn(e))return null;let n=ux.get(t);if(n||(n=Y7(t),n&&ux.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(F3.includes(r)&&Vi(o)||!dn(o)||!hi(o,r))return null;const l=o[r];if(l===void 0||Vn(o))return null;o=l,i++}return o}const X7="11.4.5",jp=-1,id="en-US",Lh="",dx=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function J7(){return{upper:(e,t)=>t==="text"&&kt(e)?e.toUpperCase():t==="vnode"&&dn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&kt(e)?e.toLowerCase():t==="vnode"&&dn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&kt(e)?dx(e):t==="vnode"&&dn(e)&&"__v_isVNode"in e?dx(e.children):e}}let O3;function eN(e){O3=e}let R3;function tN(e){R3=e}let B3;function nN(e){B3=e}let D3=null;const sN=e=>{D3=e},oN=()=>D3;let P3=null;const fx=e=>{P3=e},iN=()=>P3;let hx=0;function rN(e={}){const t=Vn(e.onWarn)?e.onWarn:W9,n=kt(e.version)?e.version:X7,s=kt(e.locale)||Vn(e.locale)?e.locale:id,o=Vn(s)?id:s,i=ts(e.fallbackLocale)||on(e.fallbackLocale)||kt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=on(e.messages)?e.messages:B1(o),l=on(e.datetimeFormats)?e.datetimeFormats:B1(o),a=on(e.numberFormats)?e.numberFormats:B1(o),c=vs(En(),e.modifiers,J7()),u=e.pluralRules||En(),d=Vn(e.missing)?e.missing:null,f=un(e.missingWarn)||$c(e.missingWarn)?e.missingWarn:!0,p=un(e.fallbackWarn)||$c(e.fallbackWarn)?e.fallbackWarn:!0,h=!!e.fallbackFormat,m=!!e.unresolving,_=Vn(e.postTranslation)?e.postTranslation:null,k=on(e.processor)?e.processor:null,g=un(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Vn(e.messageCompiler)?e.messageCompiler:O3,A=Vn(e.messageResolver)?e.messageResolver:R3||Z7,L=Vn(e.localeFallbacker)?e.localeFallbacker:B3||W7,$=dn(e.fallbackContext)?e.fallbackContext:void 0,x=e,E=dn(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,T=dn(x.__numberFormatters)?x.__numberFormatters:new Map,F=dn(x.__meta)?x.__meta:{};hx++;const S={version:n,cid:hx,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:m,postTranslation:_,processor:k,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:A,localeFallbacker:L,fallbackContext:$,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=E,S.__numberFormatters=T,__INTLIFY_PROD_DEVTOOLS__&&B7(S,n,F),S}const B1=e=>({[e]:En()});function py(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return kt(l)?l:t}else return t}function mu(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function lN(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function aN(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(lN(e,t[s]))return!0;return!1}function px(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!kt(t[0])&&!S3(t[0])&&!gs(t[0]))return Lh;const[a,c,u,d]=Mg(...t),f=un(u.missingWarn)?u.missingWarn:e.missingWarn;un(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=hy(e,u),m=r(e,o,h);if(!kt(a)||a===""){const L=new Intl.DateTimeFormat(h.replace(/!/g,""),d);return p?L.formatToParts(c):L.format(c)}let _={},k,g=null;const v="datetime format";for(let L=0;L<m.length&&(k=m[L],_=n[k]||{},g=_[a],!on(g));L++)py(e,a,k,f,v);if(!on(g)||!kt(k))return s?jp:a;let y=`${k}__${a}`;zp(d)||(y=`${y}__${JSON.stringify(d)}`);let A=l.get(y);return A||(A=new Intl.DateTimeFormat(k,vs({},g,d)),l.set(y,A)),p?A.formatToParts(c):A.format(c)}const H3=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Mg(...e){const[t,n,s,o]=e,i=En();let r=En(),l;if(kt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw br(kr.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 br(kr.INVALID_ISO_DATE_ARGUMENT)}}else if(S3(t)){if(isNaN(t.getTime()))throw br(kr.INVALID_DATE_ARGUMENT);l=t}else if(gs(t))l=t;else throw br(kr.INVALID_ARGUMENT);return kt(n)?i.key=n:on(n)&&Object.keys(n).forEach(a=>{H3.includes(a)?r[a]=n[a]:i[a]=n[a]}),kt(s)?i.locale=s:on(s)&&(r=s),on(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 gx(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!gs(t[0]))return Lh;const[a,c,u,d]=Eg(...t),f=un(u.missingWarn)?u.missingWarn:e.missingWarn;un(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=hy(e,u),m=r(e,o,h);if(!kt(a)||a===""){const L=new Intl.NumberFormat(h.replace(/!/g,""),d);return p?L.formatToParts(c):L.format(c)}let _={},k,g=null;const v="number format";for(let L=0;L<m.length&&(k=m[L],_=n[k]||{},g=_[a],!on(g));L++)py(e,a,k,f,v);if(!on(g)||!kt(k))return s?jp:a;let y=`${k}__${a}`;zp(d)||(y=`${y}__${JSON.stringify(d)}`);let A=l.get(y);return A||(A=new Intl.NumberFormat(k,vs({},g,d)),l.set(y,A)),p?A.formatToParts(c):A.format(c)}const W3=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Eg(...e){const[t,n,s,o]=e,i=En();let r=En();if(!gs(t))throw br(kr.INVALID_ARGUMENT);const l=t;return kt(n)?i.key=n:on(n)&&Object.keys(n).forEach(a=>{W3.includes(a)?r[a]=n[a]:i[a]=n[a]}),kt(s)?i.locale=s:on(s)&&(r=s),on(o)&&(r=o),[i.key||"",l,i,r]}function vx(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const cN=e=>e,uN=e=>"",dN="text",fN=e=>e.length===0?"":uy(e),hN=X9;function D1(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function pN(e){const t=gs(e.pluralIndex)?e.pluralIndex:-1;return gs(e.named?.count)?e.named.count:gs(e.named?.n)?e.named.n:t}function mN(e={}){const t=e.locale,n=pN(e),s=kt(t)&&Vn(e.pluralRules?.[t])?e.pluralRules[t]:D1,o=s===D1?void 0:D1,i=k=>k[s(n,k.length,o)],r=e.list||[],l=k=>r[k],a=e.named||En();gs(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):dn(e.messages)?e.messages[k]:!1;return v||(e.parent?e.parent.message(k):uN)}const d=k=>e.modifiers?e.modifiers[k]:cN,f=Vn(e.processor?.normalize)?e.processor.normalize:fN,p=Vn(e.processor?.interpolate)?e.processor.interpolate:hN,h=kt(e.processor?.type)?e.processor.type:dN,_={list:l,named:c,plural:i,linked:(k,...g)=>{const[v,y]=g;let A="text",L="";g.length===1?dn(v)?(L=v.modifier||L,A=v.type||A):kt(v)&&(L=v||L):g.length===2&&(kt(v)&&(L=v||L),kt(y)&&(A=y||A));const $=u(k,!0)(_),x=$===""||$===void 0?k:$,E=A==="vnode"&&ts(x)&&L?x[0]:x;return L?d(L)(E,A):E},message:u,type:h,interpolate:p,normalize:f,values:vs(En(),r,a)};return _}const yx=()=>"",ci=e=>Vn(e);function kx(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Tg(...t),u=un(c.missingWarn)?c.missingWarn:e.missingWarn,d=un(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=un(c.escapeParameter)?c.escapeParameter:e.escapeParameter,p=!!c.resolvedMessage,h=kt(c.default)||un(c.default)?un(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||h!=null&&(kt(h)||Vn(h)),_=hy(e,c);f&&gN(c);let[k,g,v]=p?[a,_,l[_]||En()]:z3(e,a,_,r,d,u),y=k,A=a;if(!p&&!(kt(y)||Vi(y)||ci(y))&&m&&(y=h,A=y),!p&&(!(kt(y)||Vi(y)||ci(y))||!kt(g)))return o?jp:a;let L=!1;const $=()=>{L=!0},x=ci(y)?y:U3(e,a,g,y,A,$);if(L)return y;const E=kN(e,g,v,c),T=mN(E),F=vN(e,x,T);let S=s?s(F,a):F;if(f&&kt(S)&&(S=Y9(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:kt(a)?a:ci(y)?y.key:"",locale:g||(ci(y)?y.locale:""),format:kt(y)?y:ci(y)?y.source:"",message:S};I.meta=vs({},e.__meta,oN()||{}),D7(I)}return S}function gN(e){ts(e.list)?e.list=e.list.map(t=>kt(t)?nx(t):t):dn(e.named)&&Object.keys(e.named).forEach(t=>{kt(e.named[t])&&(e.named[t]=nx(e.named[t]))})}function z3(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=En(),f,p=null;const h="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||En(),(p=a(d,t))===null&&(p=d[t]),!(kt(p)||Vi(p)||ci(p)));m++)if(!aN(f,u)){const _=py(e,t,f,i,h);_!==t&&(p=_)}return[p,f,d]}function U3(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(ci(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,yN(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function vN(e,t,n){return t(n)}function Tg(...e){const[t,n,s]=e,o=En();if(!kt(t)&&!gs(t)&&!ci(t)&&!Vi(t))throw br(kr.INVALID_ARGUMENT);const i=gs(t)?String(t):(ci(t),t);return gs(n)?o.plural=n:kt(n)?o.default=n:on(n)&&!zp(n)?o.named=n:ts(n)&&(o.list=n),gs(s)?o.plural=s:kt(s)?o.default=s:on(s)&&vs(o,s),[i,o]}function yN(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>z9(t,n,r)}}function kN(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:(p,h)=>{let m=r(n,p);if(m==null&&(u||h)){const[_,,k]=z3(u||e,p,t,l,a,c);m=_??r(k,p)}if(kt(m)||Vi(m)){let _=!1;const g=U3(e,p,t,m,p,()=>{_=!0});return _?yx:g}else return ci(m)?m:yx}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),gs(s.plural)&&(f.pluralIndex=s.plural),f}C7();/*!
35
+ * vue-i18n v11.4.5
36
+ * (c) 2026 kazuya kawaguchi
37
+ * Released under the MIT License.
38
+ */const bN="11.4.5";function xN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ea().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ea().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ea().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ea().__INTLIFY_PROD_DEVTOOLS__=!1)}const lo={UNEXPECTED_RETURN_TYPE:H7,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 _o(e,...t){return Up(e,null,void 0)}const Ng=_l("__translateVNode"),Ig=_l("__datetimeParts"),$g=_l("__numberParts"),j3=_l("__setPluralRules"),q3=_l("__injectWithOption"),lc=_l("__dispose");function rd(e){if(!dn(e)||Vi(e))return e;for(const t in e)if(hi(e,t))if(!t.includes("."))dn(e[t])&&rd(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]]=En()),!dn(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Vi(o)?F3.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Vi(o)){const r=o[n[s]];dn(r)&&rd(r)}}return e}function my(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=on(n)?n:ts(s)?En():{[e]:En()};if(ts(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||En(),Kf(c,r[a])):Kf(c,r)}else kt(l)&&Kf(JSON.parse(l),r)}),o==null&&i)for(const l in r)hi(r,l)&&rd(r[l]);return r}function V3(e){return e.type}function K3(e,t,n){let s=dn(t.messages)?t.messages:En();"__i18nGlobal"in n&&(s=my(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(dn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(dn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function bx(e){return ie(ul,null,e,0)}function ld(){return zs()}const xx="__INTLIFY_META__",_x=()=>[],_N=()=>!1;let wx=0;function Sx(e){return((t,n,s,o)=>e(n,s,ld()||void 0,o))}const wN=()=>{const e=ld();let t=null;return e&&(t=V3(e)[xx])?{[xx]:t}:null};function Fh(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=$h?Q:ka;let r=un(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:kt(e.locale)?e.locale:id),a=i(t&&r?t.fallbackLocale.value:kt(e.fallbackLocale)||ts(e.fallbackLocale)||on(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(my(l.value,e)),u=i(on(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(on(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:un(e.missingWarn)||$c(e.missingWarn)?e.missingWarn:!0,p=t?t.fallbackWarn:un(e.fallbackWarn)||$c(e.fallbackWarn)?e.fallbackWarn:!0,h=t?t.fallbackRoot:un(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,_=Vn(e.missing)?e.missing:null,k=Vn(e.missing)?Sx(e.missing):null,g=Vn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:un(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const A=t?t.modifiers:on(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,$;$=(()=>{s&&fx(null);const pe={version:bN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:L,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};pe.datetimeFormats=u.value,pe.numberFormats=d.value,pe.__datetimeFormatters=on($)?$.__datetimeFormatters:void 0,pe.__numberFormatters=on($)?$.__numberFormatters:void 0;const Ie=rN(pe);return s&&fx(Ie),Ie})(),mu($,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const T=D({get:()=>l.value,set:pe=>{$.locale=pe,l.value=pe}}),F=D({get:()=>a.value,set:pe=>{$.fallbackLocale=pe,a.value=pe,mu($,l.value,pe)}}),S=D(()=>c.value),I=D(()=>u.value),B=D(()=>d.value);function R(){return Vn(g)?g:null}function P(pe){g=pe,$.postTranslation=pe}function W(){return _}function U(pe){pe!==null&&(k=Sx(pe)),_=pe,$.missing=k}const Z=(pe,Ie,Qe,lt,_t,St)=>{E();let Tt;try{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=t?iN():void 0),Tt=pe($)}finally{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=void 0)}if(Qe!=="translate exists"&&gs(Tt)&&Tt===jp||Qe==="translate exists"&&!Tt){const[Ct,gt]=Ie();return t&&h?lt(t):_t(Ct)}else{if(St(Tt))return Tt;throw _o(lo.UNEXPECTED_RETURN_TYPE)}};function z(...pe){return Z(Ie=>Reflect.apply(kx,null,[Ie,...pe]),()=>Tg(...pe),"translate",Ie=>Reflect.apply(Ie.t,Ie,[...pe]),Ie=>Ie,Ie=>kt(Ie))}function ee(...pe){const[Ie,Qe,lt]=pe;if(lt&&!dn(lt))throw _o(lo.INVALID_ARGUMENT);return z(Ie,Qe,vs({resolvedMessage:!0},lt||{}))}function de(...pe){return Z(Ie=>Reflect.apply(px,null,[Ie,...pe]),()=>Mg(...pe),"datetime format",Ie=>Reflect.apply(Ie.d,Ie,[...pe]),()=>Lh,Ie=>kt(Ie)||ts(Ie))}function J(...pe){return Z(Ie=>Reflect.apply(gx,null,[Ie,...pe]),()=>Eg(...pe),"number format",Ie=>Reflect.apply(Ie.n,Ie,[...pe]),()=>Lh,Ie=>kt(Ie)||ts(Ie))}function Y(pe){return pe.map(Ie=>kt(Ie)||gs(Ie)||un(Ie)?bx(String(Ie)):Ie)}const fe={normalize:Y,interpolate:pe=>pe,type:"vnode"};function ce(...pe){return Z(Ie=>{let Qe;const lt=Ie;try{lt.processor=fe,Qe=Reflect.apply(kx,null,[lt,...pe])}finally{lt.processor=null}return Qe},()=>Tg(...pe),"translate",Ie=>Ie[Ng](...pe),Ie=>[bx(Ie)],Ie=>ts(Ie))}function We(...pe){return Z(Ie=>Reflect.apply(gx,null,[Ie,...pe]),()=>Eg(...pe),"number format",Ie=>Ie[$g](...pe),_x,Ie=>kt(Ie)||ts(Ie))}function ge(...pe){return Z(Ie=>Reflect.apply(px,null,[Ie,...pe]),()=>Mg(...pe),"datetime format",Ie=>Ie[Ig](...pe),_x,Ie=>kt(Ie)||ts(Ie))}function G(pe){L=pe,$.pluralRules=L}function le(pe,Ie){return Z(()=>{if(!pe)return!1;const Qe=kt(Ie)?Ie:l.value,lt=kt(Ie)?[Qe]:Ag($,a.value,Qe);for(let _t=0;_t<lt.length;_t++){const St=ne(lt[_t]);let Tt=$.messageResolver(St,pe);if(Tt===null&&(Tt=St[pe]),Vi(Tt)||ci(Tt)||kt(Tt))return!0}return!1},()=>[pe],"translate exists",Qe=>Reflect.apply(Qe.te,Qe,[pe,Ie]),_N,Qe=>un(Qe))}function he(pe){let Ie=null;const Qe=Ag($,a.value,l.value);for(let lt=0;lt<Qe.length;lt++){const _t=c.value[Qe[lt]]||{},St=$.messageResolver(_t,pe);if(St!=null){Ie=St;break}}return Ie}function j(pe){const Ie=he(pe);return Ie??(t?t.tm(pe)||{}:{})}function ne(pe){return c.value[pe]||{}}function ve(pe,Ie){if(o){const Qe={[pe]:Ie};for(const lt in Qe)hi(Qe,lt)&&rd(Qe[lt]);Ie=Qe[pe]}c.value[pe]=Ie,$.messages=c.value}function ae(pe,Ie){c.value[pe]=c.value[pe]||{};const Qe={[pe]:Ie};if(o)for(const lt in Qe)hi(Qe,lt)&&rd(Qe[lt]);Ie=Qe[pe],Kf(Ie,c.value[pe]),$.messages=c.value}function ye(pe){return u.value[pe]||{}}function q(pe,Ie){u.value[pe]=Ie,$.datetimeFormats=u.value,mx($,pe,Ie)}function se(pe,Ie){u.value[pe]=vs(u.value[pe]||{},Ie),$.datetimeFormats=u.value,mx($,pe,Ie)}function me(pe){return d.value[pe]||{}}function Te(pe,Ie){d.value[pe]=Ie,$.numberFormats=d.value,vx($,pe,Ie)}function Me(pe,Ie){d.value[pe]=vs(d.value[pe]||{},Ie),$.numberFormats=d.value,vx($,pe,Ie)}wx++,t&&$h&&(Ge(t.locale,pe=>{r&&(l.value=pe,$.locale=pe,mu($,l.value,a.value))}),Ge(t.fallbackLocale,pe=>{r&&(a.value=pe,$.fallbackLocale=pe,mu($,l.value,a.value))}));const $e={id:wx,locale:T,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(pe){r=pe,pe&&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 A},get pluralRules(){return L||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(pe){f=pe,$.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(pe){p=pe,$.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(pe){h=pe},get fallbackFormat(){return m},set fallbackFormat(pe){m=pe,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(pe){v=pe,$.warnHtmlMessage=pe},get escapeParameter(){return y},set escapeParameter(pe){y=pe,$.escapeParameter=pe},t:z,getLocaleMessage:ne,setLocaleMessage:ve,mergeLocaleMessage:ae,getPostTranslationHandler:R,setPostTranslationHandler:P,getMissingHandler:W,setMissingHandler:U,[j3]:G};return $e.datetimeFormats=I,$e.numberFormats=B,$e.rt=ee,$e.te=le,$e.tm=j,$e.d=de,$e.n=J,$e.getDateTimeFormat=ye,$e.setDateTimeFormat=q,$e.mergeDateTimeFormat=se,$e.getNumberFormat=me,$e.setNumberFormat=Te,$e.mergeNumberFormat=Me,$e[q3]=n,$e[Ng]=ce,$e[Ig]=ge,$e[$g]=We,$e}function SN(e){const t=kt(e.locale)?e.locale:id,n=kt(e.fallbackLocale)||ts(e.fallbackLocale)||on(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Vn(e.missing)?e.missing:void 0,o=un(e.silentTranslationWarn)||$c(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=un(e.silentFallbackWarn)||$c(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=un(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=on(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Vn(e.postTranslation)?e.postTranslation:void 0,d=kt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,p=un(e.sync)?e.sync:!0;let h=e.messages;if(on(e.sharedMessages)){const A=e.sharedMessages;h=Object.keys(A).reduce(($,x)=>{const E=$[x]||($[x]={});return vs(E,A[x]),$},h||{})}const{__i18n:m,__root:_,__injectWithOption:k}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:h,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:p,__i18n:m,__root:_,__injectWithOption:k}}function Lg(e={}){const t=Fh(SN(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 un(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=un(o)?!o:o},get silentFallbackWarn(){return un(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=un(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 CN(e,t,n){return{beforeCreate(){const s=ld();if(!s)throw _o(lo.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=Cx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Lg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Cx(e,o);else{this.$i18n=Lg({__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&&K3(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=ld();if(!s)throw _o(lo.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 Cx(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[j3](t.pluralizationRules||e.pluralizationRules);const n=my(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 gy={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function AN({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},En())}function G3(){return Be}const MN=Ve({name:"i18n-t",props:vs({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>gs(e)||!isNaN(e)}},gy),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||Lt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=En();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=kt(e.plural)?+e.plural:e.plural);const u=AN(t,a);return o[Ng](e.keypath,u,c)},r=vs(En(),s),l=kt(e.tag)||dn(e.tag)?e.tag:G3();return dn(l)?bn(l,r,{default:i}):bn(l,r,i())}}}),Ax=MN;function EN(e){return ts(e)&&!kt(e[0])}function Y3(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=En();e.locale&&(c.locale=e.locale),kt(e.format)?c.key=e.format:dn(e.format)&&(kt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((p,h)=>n.includes(h)?vs(En(),p,{[h]:e.format[h]}):p,En()));const d=s(e.value,c,u);let f=[c.key];return ts(d)?f=d.map((p,h)=>{const m=o[p.type],_=m?m({[p.type]:p.value,index:h,parts:d}):[p.value];return EN(_)&&(_[0].key=`${p.type}-${h}`),_}):kt(d)&&(f=[d]),f},l=vs(En(),i),a=kt(e.tag)||dn(e.tag)?e.tag:G3();return dn(a)?bn(a,l,{default:r}):bn(a,l,r())}}const TN=Ve({name:"i18n-n",props:vs({value:{type:Number,required:!0},format:{type:[String,Object]}},gy),setup(e,t){const n=e.i18n||Lt({useScope:e.scope,__useComponent:!0});return Y3(e,t,W3,(...s)=>n[$g](...s))}}),Mx=TN;function NN(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 IN(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw _o(lo.UNEXPECTED_ERROR);const c=NN(e,l.$),u=Ex(a);return[Reflect.apply(c.t,c,[...Tx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);$h&&(r.__i18nWatcher=Ge(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{$h&&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=Ex(l);r.textContent=Reflect.apply(a.t,a,[...Tx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Ex(e){if(kt(e))return{path:e};if(on(e)){if(!("path"in e))throw _o(lo.REQUIRED_VALUE,"path");return e}else throw _o(lo.INVALID_VALUE)}function Tx(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return kt(n)&&(r.locale=n),gs(o)&&(r.plural=o),gs(i)&&(r.plural=i),[t,l,r]}function $N(e,t,...n){const s=on(n[0])?n[0]:{};(un(s.globalInstall)?s.globalInstall:!0)&&([Ax.name,"I18nT"].forEach(i=>e.component(i,Ax)),[Mx.name,"I18nN"].forEach(i=>e.component(i,Mx)),[$x.name,"I18nD"].forEach(i=>e.component(i,$x))),e.directive("t",IN(t))}const LN=_l("global-vue-i18n");function FN(e={}){const t=__VUE_I18N_LEGACY_API__&&un(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=un(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=ON(e,t),r=_l("");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),on(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let p=null;!t&&n&&(p=zN(d,u.global)),__VUE_I18N_FULL_INSTALL__&&$N(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(CN(i,i.__composer,u));const h=d.unmount;d.unmount=()=>{p&&p(),u.dispose(),h()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Lt(e={}){const t=ld();if(t==null)throw _o(lo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw _o(lo.NOT_INSTALLED);const n=RN(t),s=DN(n),o=V3(t),i=BN(e,o);if(i==="global")return K3(s,e,o),s;if(i==="parent"){let a=Nx(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw _o(lo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=vs({},e),u=Nx(n,t);c.__root=u||s;const d=Fh(c);return a.__composerExtend&&(d[lc]=a.__composerExtend(d)),zv()&&Uv(()=>{const p=d[lc];p&&(p(),delete d[lc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=vs({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=Fh(a),r.__composerExtend&&(l[lc]=r.__composerExtend(l)),HN(r,t,l),r.__setInstance(t,l)}return l}function ON(e,t){const n=lE(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Lg(e)):n.run(()=>Fh(e));if(s==null)throw _o(lo.UNEXPECTED_ERROR);return[n,s]}function RN(e){const t=Yt(e.isCE?LN:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw _o(e.isCE?lo.NOT_INSTALLED_WITH_PROVIDE:lo.UNEXPECTED_ERROR);return t}function BN(e,t){return zp(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function DN(e){return e.mode==="composition"?e.global:e.global.__composer}function Nx(e,t,n=!1){let s=null;const o=t.root;let i=PN(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[q3]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function PN(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function HN(e,t,n){gn(()=>{},t),xn(()=>{const s=n;e.__deleteInstance(t);const o=s[lc];o&&(o(),delete s[lc])},t)}const WN=["locale","fallbackLocale","availableLocales"],Ix=["t","rt","d","n","tm","te"];function zN(e,t){const n=Object.create(null);return WN.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw _o(lo.UNEXPECTED_ERROR);const r=is(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,Ix.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw _o(lo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Ix.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const UN=Ve({name:"i18n-d",props:vs({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},gy),setup(e,t){const n=e.i18n||Lt({useScope:e.scope,__useComponent:!0});return Y3(e,t,H3,(...s)=>n[Ig](...s))}}),$x=UN;xN();eN(O7);tN(Q7);nN(Ag);if(__INTLIFY_PROD_DEVTOOLS__){const e=ea();e.__INTLIFY__=!0,R7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const jN="modulepreload",qN=function(e){return"/"+e},Lx={},io=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=qN(c),c in Lx)return;Lx[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":jN,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(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)})},Ht={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 Fx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function ss(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ls(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Fc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function qp(e){const t=ss(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Ed(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function vy(){const e=ss(Ht.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 yy(e){const n={...vy()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];ls(Ht.unread,JSON.stringify(n))}function VN(){const e=qp(Ht.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function P1(e){Ed(Ht.collapsedWorkspaces,Array.from(e))}function KN(){const e=qp(Ht.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function Z3(e){Ed(Ht.workspaceOrder,Array.from(e))}function xf(){const e=qp(Ht.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 Ox(e){Ed(Ht.workspaceNameOverrides,e)}function GN(){return ss(Ht.workspaceSort)}function Q3(e){ls(Ht.workspaceSort,e)}const Rx=Ht.clientId,YN="kimi-code-web",ZN="web";function QN(){return{serverHttpUrl:JN(),clientId:sI(),clientName:YN,clientVersion:oI(),clientUiMode:ZN}}function XN(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function JN(e){const t=XN(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function eI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function tI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return eI(e)}function Fu(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function nI(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 sI(){const e=ss(Rx);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ls(Rx,t),t}function oI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function Zs(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 iI(e)}function iI(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 rI(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 lI(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 aI(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 uI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Bx(e){return e.replace(/[&<>"']/g,t=>uI[t]??t)}function dI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fI(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 Dx(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return Dx(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 Dx(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function H1(e,t){const n=Bx(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(dI(Bx(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const ec=Q(0),hI=["type","disabled","aria-label"],pI=Ve({__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(),N("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},[On(s.$slots,"default",{},void 0,!0)],10,hI))}}),dt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Pn=dt(pI,[["__scopeId","data-v-c9e67023"]]),mI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function gI(e,t){return b(),N("svg",mI,[...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 vI=yt({name:"kimi-add-conversation",render:gI}),yI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kI(e,t){return b(),N("svg",yI,[...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 bI=yt({name:"kimi-folder",render:kI}),xI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_I=["clip-path"],wI=["id"];function SI(e,t){return b(),N("svg",xI,[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,_I),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,wI)])])}const CI=yt({name:"kimi-folder-open",render:SI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),AI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function MI(e,t){return b(),N("svg",AI,[...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 EI=yt({name:"kimi-more",render:MI}),TI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function NI(e,t){return b(),N("svg",TI,[...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 II=yt({name:"kimi-search",render:NI}),$I={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function LI(e,t){return b(),N("svg",$I,[...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 FI=yt({name:"kimi-setting",render:LI}),OI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RI(e,t){return b(),N("svg",OI,[...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 BI=yt({name:"tabler-layout-sidebar-left-collapse",render:RI}),DI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PI(e,t){return b(),N("svg",DI,[...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 HI=yt({name:"tabler-layout-sidebar-left-expand",render:PI}),WI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zI(e,t){return b(),N("svg",WI,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const UI=yt({name:"ri-add-line",render:zI}),jI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qI(e,t){return b(),N("svg",jI,[...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 VI=yt({name:"ri-alert-line",render:qI}),KI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GI(e,t){return b(),N("svg",KI,[...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 YI=yt({name:"ri-arrow-down-line",render:GI}),ZI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QI(e,t){return b(),N("svg",ZI,[...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 XI=yt({name:"ri-arrow-down-s-line",render:QI}),JI={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e$(e,t){return b(),N("svg",JI,[...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 t$=yt({name:"ri-arrow-go-back-line",render:e$}),n$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s$(e,t){return b(),N("svg",n$,[...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 o$=yt({name:"ri-arrow-right-line",render:s$}),i$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function r$(e,t){return b(),N("svg",i$,[...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 l$=yt({name:"ri-arrow-right-s-line",render:r$}),a$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c$(e,t){return b(),N("svg",a$,[...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 Px=yt({name:"ri-arrow-up-line",render:c$}),u$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function d$(e,t){return b(),N("svg",u$,[...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 f$=yt({name:"ri-braces-line",render:d$}),h$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function p$(e,t){return b(),N("svg",h$,[...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 m$=yt({name:"ri-calendar-close-line",render:p$}),g$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v$(e,t){return b(),N("svg",g$,[...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 y$=yt({name:"ri-calendar-schedule-line",render:v$}),k$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b$(e,t){return b(),N("svg",k$,[...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 x$=yt({name:"ri-calendar-todo-line",render:b$}),_$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w$(e,t){return b(),N("svg",_$,[...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 S$=yt({name:"ri-check-line",render:w$}),C$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A$(e,t){return b(),N("svg",C$,[...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 M$=yt({name:"ri-close-line",render:A$}),E$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T$(e,t){return b(),N("svg",E$,[...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 N$=yt({name:"ri-code-line",render:T$}),I$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $$(e,t){return b(),N("svg",I$,[...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 L$=yt({name:"ri-collapse-diagonal-line",render:$$}),F$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O$(e,t){return b(),N("svg",F$,[...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 R$=yt({name:"ri-download-line",render:O$}),B$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D$(e,t){return b(),N("svg",B$,[...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 P$=yt({name:"ri-draggable",render:D$}),H$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W$(e,t){return b(),N("svg",H$,[...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 z$=yt({name:"ri-equalizer-line",render:W$}),U$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function j$(e,t){return b(),N("svg",U$,[...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 q$=yt({name:"ri-expand-diagonal-line",render:j$}),V$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function K$(e,t){return b(),N("svg",V$,[...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 G$=yt({name:"ri-external-link-line",render:K$}),Y$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z$(e,t){return b(),N("svg",Y$,[...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 Q$=yt({name:"ri-file-add-line",render:Z$}),X$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J$(e,t){return b(),N("svg",X$,[...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 eL=yt({name:"ri-file-copy-line",render:J$}),tL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nL(e,t){return b(),N("svg",tL,[...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 sL=yt({name:"ri-file-edit-line",render:nL}),oL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iL(e,t){return b(),N("svg",oL,[...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 Hx=yt({name:"ri-file-line",render:iL}),rL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lL(e,t){return b(),N("svg",rL,[...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 aL=yt({name:"ri-file-text-line",render:lL}),cL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uL(e,t){return b(),N("svg",cL,[...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 dL=yt({name:"ri-flashlight-line",render:uL}),fL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hL(e,t){return b(),N("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.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const pL=yt({name:"ri-folder-add-line",render:hL}),mL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gL(e,t){return b(),N("svg",mL,[...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 vL=yt({name:"ri-folder-fill",render:gL}),yL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kL(e,t){return b(),N("svg",yL,[...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 bL=yt({name:"ri-git-pull-request-line",render:kL}),xL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _L(e,t){return b(),N("svg",xL,[...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 wL=yt({name:"ri-global-line",render:_L}),SL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CL(e,t){return b(),N("svg",SL,[...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 Wx=yt({name:"ri-image-line",render:CL}),AL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ML(e,t){return b(),N("svg",AL,[...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 EL=yt({name:"ri-information-line",render:ML}),TL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NL(e,t){return b(),N("svg",TL,[...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 IL=yt({name:"ri-links-line",render:NL}),$L={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LL(e,t){return b(),N("svg",$L,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const FL=yt({name:"ri-list-check",render:LL}),OL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RL(e,t){return b(),N("svg",OL,[...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 BL=yt({name:"ri-list-unordered",render:RL}),DL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PL(e,t){return b(),N("svg",DL,[...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 HL=yt({name:"ri-login-box-line",render:PL}),WL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zL(e,t){return b(),N("svg",WL,[...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 UL=yt({name:"ri-mail-line",render:zL}),jL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qL(e,t){return b(),N("svg",jL,[...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 VL=yt({name:"ri-message-line",render:qL}),KL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GL(e,t){return b(),N("svg",KL,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const YL=yt({name:"ri-pause-fill",render:GL}),ZL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QL(e,t){return b(),N("svg",ZL,[...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 XL=yt({name:"ri-pencil-line",render:QL}),JL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eF(e,t){return b(),N("svg",JL,[...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 tF=yt({name:"ri-play-fill",render:eF}),nF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sF(e,t){return b(),N("svg",nF,[...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 oF=yt({name:"ri-question-line",render:sF}),iF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rF(e,t){return b(),N("svg",iF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const lF=yt({name:"ri-sort-desc",render:rF}),aF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cF(e,t){return b(),N("svg",aF,[...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 uF=yt({name:"ri-sparkling-line",render:cF}),dF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fF(e,t){return b(),N("svg",dF,[...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 hF=yt({name:"ri-star-fill",render:fF}),pF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mF(e,t){return b(),N("svg",pF,[...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 gF=yt({name:"ri-star-line",render:mF}),vF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yF(e,t){return b(),N("svg",vF,[...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 kF=yt({name:"ri-stop-fill",render:yF}),bF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xF(e,t){return b(),N("svg",bF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const _F=yt({name:"ri-subtract-line",render:xF}),wF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SF(e,t){return b(),N("svg",wF,[...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 CF=yt({name:"ri-target-line",render:SF}),AF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MF(e,t){return b(),N("svg",AF,[...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 EF=yt({name:"ri-terminal-box-line",render:MF}),TF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NF(e,t){return b(),N("svg",TF,[...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 IF=yt({name:"ri-time-line",render:NF}),$F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LF(e,t){return b(),N("svg",$F,[...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 FF=yt({name:"ri-tools-line",render:LF}),OF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RF(e,t){return b(),N("svg",OF,[...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 BF=yt({name:"ri-user-line",render:RF}),DF=`<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
+ `,PF=`<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
+ `,HF=`<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
+ `,WF=`<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
+ `,zF=`<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
+ `,UF=`<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
+ `,jF='<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>',qF='<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>',VF='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',KF='<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>',GF='<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>',YF='<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>',ZF='<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>',QF='<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>',XF='<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>',zx='<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>',JF='<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>',eO='<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>',tO='<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>',nO='<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>',sO='<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>',oO='<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>',iO='<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>',rO='<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>',lO='<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>',aO='<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>',cO='<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>',uO='<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>',dO='<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>',fO='<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>',hO='<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>',pO='<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>',Ux='<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>',mO='<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>',gO='<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>',vO='<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>',yO='<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>',kO='<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>',bO='<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>',jx='<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>',xO='<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>',_O='<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>',wO='<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>',SO='<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>',CO='<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>',AO='<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>',MO='<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>',EO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',TO='<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>',NO='<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>',IO='<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>',$O='<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>',LO='<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>',FO='<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>',OO='<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>',RO='<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>',BO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',DO='<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>',PO='<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>',HO='<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>',WO='<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>',zO='<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>',X3={sm:14,md:16,lg:20};function bt(e,t){return{component:e,svg:t}}const J3={plus:bt(UI,VF),"chat-new":bt(vI,DF),"calendar-close":bt(m$,eO),"calendar-schedule":bt(y$,tO),"calendar-todo":bt(x$,nO),close:bt(M$,oO),check:bt(S$,sO),search:bt(II,zF),copy:bt(eL,hO),link:bt(IL,_O),"external-link":bt(G$,dO),download:bt(R$,lO),undo:bt(t$,ZF),send:bt(Px,zx),image:bt(Wx,jx),settings:bt(FI,UF),sliders:bt(z$,cO),"log-in":bt(HL,CO),"chevron-down":bt(XI,YF),"chevron-right":bt(l$,XF),"arrow-up":bt(Px,zx),"arrow-down":bt(YI,GF),"arrow-right":bt(o$,QF),minus:bt(_F,BO),"panel-collapse":bt(BI,jF),"panel-expand":bt(HI,qF),expand:bt(q$,uO),collapse:bt(L$,rO),list:bt(BL,SO),sort:bt(lF,$O),grip:bt(P$,aO),folder:bt(CI,HF),"folder-closed":bt(bI,PF),"folder-plus":bt(pL,vO),"folder-solid":bt(vL,yO),file:bt(Hx,Ux),"file-text":bt(aL,mO),"file-edit":bt(sL,pO),"file-plus":bt(Q$,fO),"file-off":bt(Hx,Ux),"image-off":bt(Wx,jx),code:bt(N$,iO),terminal:bt(EF,PO),pencil:bt(XL,TO),tool:bt(FF,WO),glob:bt(f$,JF),globe:bt(wL,bO),"check-list":bt(FL,wO),bolt:bt(dL,gO),"git-pull-request":bt(bL,kO),message:bt(VL,MO),mail:bt(UL,AO),user:bt(BF,zO),info:bt(EL,xO),"help-circle":bt(oF,IO),"alert-triangle":bt(VI,KF),clock:bt(IF,HO),sparkles:bt(uF,LO),target:bt(CF,DO),pause:bt(YL,EO),play:bt(tF,NO),stop:bt(kF,RO),star:bt(hF,FO),"star-outline":bt(gF,OO),"dots-horizontal":bt(EI,WF)};function UO(e){return J3[e]}function jO(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function tc(e,t="md"){const n=J3[e];return n?jO(n.svg,X3[t]):""}const $xe=[["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-pull-request","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"]]],Ke=Ve({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=D(()=>UO(t.name)),s=D(()=>X3[t.size]);return(o,i)=>n.value?(b(),xe(Ps(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)}}),qO={key:0,class:"ui-dialog__head"},VO={class:"ui-dialog__titles"},KO={key:0,class:"ui-dialog__title"},GO={key:1,class:"ui-dialog__desc"},YO={class:"ui-dialog__body"},ZO={key:1,class:"ui-dialog__foot"},QO='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',XO=Ve({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},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(QO)):[]}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(),p=f[0],h=f[f.length-1];if(!p||!h){d.preventDefault(),o.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===p?(d.preventDefault(),h.focus()):!d.shiftKey&&m===h&&(d.preventDefault(),p.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Ge(()=>n.open,async d=>{if(d){ec.value+=1,i=document.activeElement,await vt();const f=a(),p=l();(f??p[0]??o.value)?.focus()}else ec.value=Math.max(0,ec.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),rs(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(ec.value=Math.max(0,ec.value-1))}),(d,f)=>(b(),xe(Dp,{to:"body"},[e.open?(b(),N("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(),N("div",qO,[On(d.$slots,"head",{},()=>[w("div",VO,[e.title?(b(),N("div",KO,O(e.title),1)):re("",!0),e.description?(b(),N("div",GO,O(e.description),1)):re("",!0)])],!0),ie(Pn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[ie(Ke,{name:"close",size:"md"})]),_:1})])):re("",!0),w("div",YO,[On(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(b(),N("div",ZO,[On(d.$slots,"foot",{},void 0,!0)])):re("",!0)],2)],32)):re("",!0)]))}}),$r=dt(XO,[["__scopeId","data-v-3dce23a4"]]),JO={class:"sd-head"},eR=["placeholder","aria-label"],tR=["aria-selected","onClick","onMousemove"],nR={class:"sd-meta"},sR=["innerHTML"],oR={class:"sd-time"},iR=["innerHTML"],rR=["innerHTML"],lR={key:1,class:"sd-empty"},aR={class:"sd-hint"},cR=200,uR=Ve({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Lt(),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??"",A=v.lastPrompt??"",L=v.workspaceName??"",$=k.length>0&&y.toLowerCase().includes(k),x=k.length>0&&A.toLowerCase().includes(k),E=k.length>0&&L.toLowerCase().includes(k);if(!(k.length>0&&!$&&!x&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:A?fI(A,r.value):""}),g.length>=cR))break}return g}),u=Q(0);Ge(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 vt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function p(k){u.value=d(u.value+k),f()}function h(k){o("select",k),o("close")}function m(){const k=c.value[u.value];k&&h(k.session.id)}function _(k){k.key==="ArrowDown"?(k.preventDefault(),p(1)):k.key==="ArrowUp"?(k.preventDefault(),p(-1)):k.key==="Enter"&&(k.preventDefault(),m())}return gn(()=>{l.value?.focus()}),(k,g)=>(b(),xe($r,{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:Ee(()=>[w("div",JO,[ie(Ke,{class:"sd-search-icon",name:"search",size:"md"}),Fn(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:_},null,40,eR),[[po,r.value]])])]),foot:Ee(()=>[w("span",aR,O(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[w("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(b(!0),N(Be,{key:0},st(c.value,(v,y)=>(b(),N("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:A=>h(v.session.id),onMousemove:A=>u.value=y},[w("span",nR,[ie(Ke,{class:"sd-folder",name:"folder-closed",size:"sm"}),w("span",{class:"sd-ws",innerHTML:C(H1)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,sR),w("span",oR,O(v.session.time),1)]),w("span",{class:"sd-title",innerHTML:C(H1)(v.session.title,v.inTitle?r.value:"")},null,8,iR),v.snippetText?(b(),N("span",{key:0,class:"sd-snippet",innerHTML:C(H1)(v.snippetText,r.value)},null,8,rR)):re("",!0)],42,tR))),128)):(b(),N("div",lR,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),dR=dt(uR,[["__scopeId","data-v-a678f802"]]),fR=["aria-label"],hR=Ve({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(b(),N("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,fR))}}),To=dt(hR,[["__scopeId","data-v-e5c5b17d"]]),pR={key:0,class:"ui-badge__dot","aria-hidden":"true"},mR=Ve({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(b(),N("span",{class:Pe(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(b(),N("span",pR)):re("",!0),On(t.$slots,"default",{},void 0,!0)],2))}}),wo=dt(mR,[["__scopeId","data-v-5bc5cd6d"]]),ad=Q(null);function eA(e){const t=ad.value;t&&(ad.value=null,t.resolve(e))}function gR(e){return ad.value&&eA(!1),new Promise(t=>{ad.value={...e,resolve:t}})}function Cl(){return{current:ad,confirm:gR,settle:eA}}const vR=Ve({__name:"Menu",setup(e,{expose:t}){const n=Q();return t({el:n}),(s,o)=>(b(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[On(s.$slots,"default",{},void 0,!0)],512))}}),la=dt(vR,[["__scopeId","data-v-60e6cd8d"]]),yR={key:0,class:"ui-menu-sep",role:"separator"},kR=["disabled"],bR=Ve({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(b(),N("div",yR)):(b(),N("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))},[On(t.$slots,"default",{},void 0,!0)],10,kR))}}),$n=dt(bR,[["__scopeId","data-v-f940771a"]]),Ur=6,jr=8,xR=150,_R=Ve({__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 _=a.getBoundingClientRect(),k=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let A=t.placement;A==="top"&&_.top-Ur-g<jr?A="bottom":A==="bottom"&&_.bottom+Ur+g>y-jr?A="top":A==="left"&&_.left-Ur-k<jr?A="right":A==="right"&&_.right+Ur+k>v-jr&&(A="left");let L=0,$=0;A==="top"?(L=_.top-Ur-g,$=_.left+_.width/2-k/2):A==="bottom"?(L=_.bottom+Ur,$=_.left+_.width/2-k/2):A==="left"?(L=_.top+_.height/2-g/2,$=_.left-Ur-k):(L=_.top+_.height/2-g/2,$=_.right+Ur),$=Math.min(Math.max($,jr),v-jr-k),L=Math.min(Math.max(L,jr),y-jr-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,vt(()=>{u(),i.value=!0})},xR))}function f(){window.clearTimeout(l),o.value=!1,i.value=!1}function p(){o.value&&f()}function h(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 gn(()=>{const m=n.value??null;h(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const _=m.firstElementChild??null;_!==a&&(f(),h(_??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p)}),rs(()=>{window.clearTimeout(l),c?.disconnect(),h(null),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}),(m,_)=>(b(),N(Be,null,[w("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[On(m.$slots,"default",{},void 0,!0)],512),(b(),xe(Dp,{to:"body"},[Fn(w("div",{ref_key:"bubble",ref:s,class:Pe(["ui-tip__bubble",{positioned:i.value}]),style:Jt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[di,o.value]])]))],64))}}),Xt=dt(_R,[["__scopeId","data-v-4c261eb6"]]),wR={class:"row"},SR={class:"lead","aria-hidden":"true"},CR={key:1,class:"unread-dot"},AR={class:"left"},MR=["onKeydown"],ER={class:"act"},TR={class:"ts"},NR={class:"menu-time"},IR=Ve({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=Lt(),{confirm:o}=Cl(),i=e,r=n;function l(S){const I=new Date(S);if(Number.isNaN(I.getTime()))return S;const B=R=>String(R).padStart(2,"0");return`${I.getFullYear()}-${B(I.getMonth()+1)}-${B(I.getDate())} ${B(I.getHours())}:${B(I.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 p(S){const I=S.target;d.value?.el?.contains(I)||u.value?.el?.contains(I)||_()}function h(){const S=u.value?.el;if(!S)return;const I=d.value?.el,B=S.getBoundingClientRect(),R=4,P=8,W=I?.offsetHeight??0,U=I?.offsetWidth??0;let Z=B.bottom+R;Z+W>window.innerHeight-P&&(Z=Math.max(P,B.top-W-R));let z=B.right-U;z<P&&(z=P),f.value={top:`${Math.round(Z)}px`,left:`${Math.round(z)}px`}}async function m(S){if(S.stopPropagation(),c.value){_();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",p),0),window.addEventListener("resize",_),await vt(),h()}function _(){c.value=!1,document.removeEventListener("mousedown",p),window.removeEventListener("resize",_)}xn(()=>{document.removeEventListener("mousedown",p),window.removeEventListener("resize",_)});const k=Q(!1),g=Q(""),v=Q(null);async function y(){_(),k.value=!0,g.value=i.session.title,await vt();try{v.value?.focus(),v.value?.select()}catch{}}function A(){const S=g.value.trim();S&&r("rename",i.session.id,S),k.value=!1}function L(){k.value=!1}const $=Q(!1),x=Q(!1);async function E(){const S=await Zs(i.session.id);$.value=S,x.value=!S,setTimeout(()=>{$.value=!1,x.value=!1,_()},1500)}function T(){_(),r("fork",i.session.id)}async function F(){_(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:_}),(S,I)=>(b(),N("div",{class:Pe(["se",{on:e.active}]),onClick:I[4]||(I[4]=B=>r("select",e.session.id))},[w("div",wR,[w("span",SR,[e.session.busy?(b(),xe(To,{key:0,size:"sm"})):e.unread?(b(),N("span",CR)):re("",!0)]),w("div",AR,[k.value?Fn((b(),N("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":I[0]||(I[0]=B=>g.value=B),class:"rename-input",onClick:I[1]||(I[1]=xt(()=>{},["stop"])),onKeydown:[ji(xt(A,["stop"]),["enter"]),ji(xt(L,["stop"]),["esc"])],onBlur:A},null,40,MR)),[[po,g.value]]):(b(),N("span",{key:1,class:"t",onDblclick:xt(y,["stop"])},O(e.session.title),33))]),ie(Xt,{text:C(s)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!k.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(b(),xe(wo,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ye(O(C(s)("workspace.awaitingAnswer")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(Xt,{text:C(s)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!k.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(b(),xe(wo,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Ye(O(C(s)("workspace.awaitingPermission")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),ie(Xt,{text:C(s)("workspace.abortedTitle")},{default:Ee(()=>[!k.value&&e.session.status==="aborted"?(b(),xe(wo,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Ye(O(C(s)("workspace.aborted")),1)]),_:1})):re("",!0)]),_:1},8,["text"]),w("span",ER,[w("span",TR,O(e.session.time),1),k.value?re("",!0):(b(),xe(Pn,{key:0,ref_key:"kebabRef",ref:u,class:Pe(["kebab",{open:c.value}]),size:"sm",label:C(s)("sidebar.options"),onClick:I[2]||(I[2]=xt(B=>m(B),["stop"]))},{default:Ee(()=>[ie(Ke,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(b(),xe(Dp,{to:"body"},[c.value?(b(),xe(la,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Jt(f.value),onClick:I[3]||(I[3]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie($n,{danger:x.value,onClick:E},{default:Ee(()=>[Ye(O(x.value?C(s)("sidebar.copyFailed"):$.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ie($n,{separator:""}),ie($n,{onClick:y},{default:Ee(()=>[Ye(O(C(s)("sidebar.rename")),1)]),_:1}),ie($n,{onClick:T},{default:Ee(()=>[Ye(O(C(s)("sidebar.fork")),1)]),_:1}),ie($n,{danger:"",onClick:F},{default:Ee(()=>[Ye(O(C(s)("sidebar.archive")),1)]),_:1}),ie($n,{separator:""}),w("div",NR,O(a.value),1)]),_:1},8,["style"])):re("",!0)]))],2))}}),$R=dt(IR,[["__scopeId","data-v-e3ea544d"]]),LR={class:"gh-top"},FR={class:"gh-name"},OR=["inert"],RR=["disabled"],BR={class:"show-more-label"},DR={class:"show-more-label"},PR={key:2,class:"group-empty"},HR=Ve({__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","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Lt(),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(p=>p.id===s.activeId)){const p=s.group.sessions.find(h=>h.id===s.activeId);if(p)return[...f,p]}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,p)=>(b(),N("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:p[7]||(p[7]=xt(h=>o("groupClick",e.group.workspace.id,h),["stop"])),onContextmenu:p[8]||(p[8]=h=>o("groupContextmenu",e.group.workspace,h)),onDragstart:d,onDragend:p[9]||(p[9]=h=>o("wsDragend"))},[w("div",LR,[e.isCollapsed(e.group.workspace.id)?(b(),xe(Ke,{key:0,class:"gh-folder",name:"folder-closed"})):(b(),xe(Ke,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(b(),xe(Xt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[w("span",FR,O(e.group.workspace.name),1)]),_:1},8,["text"])):Fn((b(),N("input",{key:3,ref:u,"onUpdate:modelValue":p[0]||(p[0]=h=>i.value=h),class:"gh-rename",type:"text",onKeydown:[p[1]||(p[1]=ji(h=>o("confirmRename"),["enter"])),p[2]||(p[2]=ji(h=>o("cancelRename"),["esc"]))],onBlur:p[3]||(p[3]=h=>o("cancelRename")),onClick:p[4]||(p[4]=xt(()=>{},["stop"]))},null,544)),[[po,i.value]]),e.renamingId!==e.group.workspace.id?(b(),N("div",{key:4,class:Pe(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ie(Pn,{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:p[5]||(p[5]=xt(h=>o("toggleWsMenu",e.group.workspace,h),["stop"]))},{default:Ee(()=>[ie(Ke,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ie(Pn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:p[6]||(p[6]=xt(h=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[ie(Ke,{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),N(Be,null,st(r.value,h=>(b(),xe($R,{key:h.id,session:h,active:h.id===e.activeId,"approval-count":e.pendingBySession[h.id]?.approvals??0,"question-count":e.pendingBySession[h.id]?.questions??0,unread:e.unreadBySession[h.id]??!1,onSelect:p[10]||(p[10]=m=>o("selectSession",m)),onRename:p[11]||(p[11]=(m,_)=>o("renameSession",m,_)),onArchive:p[12]||(p[12]=m=>o("archiveSession",m)),onFork:p[13]||(p[13]=m=>o("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(b(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:p[14]||(p[14]=xt(h=>o("loadMore",e.group.workspace.id),["stop"]))},[p[16]||(p[16]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",BR,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,RR)):re("",!0),l.value?(b(),N("button",{key:1,class:"show-more",onClick:p[15]||(p[15]=xt(h=>o("toggleExpand",e.group.workspace.id),["stop"]))},[p[17]||(p[17]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",DR,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(),N("div",PR,O(C(n)("sidebar.noSessions")),1)):re("",!0)],10,OR)],2))}}),WR=dt(HR,[["__scopeId","data-v-cbca6d9c"]]),zR="kimi_desktop",UR="platform",qx="kimi-desktop",Vx="kimi-desktop-platform";function jR(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(zR)?(sessionStorage.setItem(qx,"1"),e=!0):e=e||sessionStorage.getItem(qx)==="1";const s=n.get(UR);s?(sessionStorage.setItem(Vx,s),t=s):t=sessionStorage.getItem(Vx)}catch{}return{isDesktop:e,platform:t}}const Fg=jR(),qR=Fg.isDesktop,xc=Fg.isDesktop&&Fg.platform==="darwin",VR={class:"ui-kbd"},KR=Ve({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(b(),N("span",VR,[(b(!0),N(Be,null,st(e.keys,s=>(b(),N("kbd",{key:s,class:"ui-kbd__key"},O(s),1))),128))]))}}),lr=dt(KR,[["__scopeId","data-v-32292ed8"]]),GR={class:"ch"},YR={class:"ch-brand"},ZR={class:"ch-name"},QR={key:0,class:"ch-endpoint"},XR={class:"btn-wrap"},JR={class:"search-input"},eB={key:0,class:"empty"},tB={class:"side-section-label"},nB={class:"side-section-title"},sB={class:"side-section-actions"},oB=["onDragover","onDrop"],iB={class:"side-footer"},rB={class:"section-menu-check"},lB={class:"section-menu-check"},aB=1e3,cB=Ve({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Lt(),{confirm:s}=Cl(),o=!1,i="",r=e,l=t,a=Q(!1),c=f()?["⌘","K"]:["Ctrl","K"];function u(){l("loadAllSessions"),a.value=!0}function d(Ze){(Ze.metaKey||Ze.ctrlKey)&&Ze.key.toLowerCase()==="k"&&(Ze.preventDefault(),u())}gn(()=>window.addEventListener("keydown",d)),rs(()=>window.removeEventListener("keydown",d));function f(){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 p=Q(!1);function h(Ze){p.value=Ze.target.scrollTop>0}const m=Q(new Set(VN()));function _(Ze){return m.value.has(Ze)}function k(Ze){const Xe=new Set(m.value);Xe.has(Ze)?Xe.delete(Ze):Xe.add(Ze),m.value=Xe,P1(Xe)}function g(){const Ze=new Set(r.groups.map(Xe=>Xe.workspace.id));m.value=Ze,P1(Ze)}function v(){const Ze=new Set;m.value=Ze,P1(Ze)}const y=D(()=>r.groups.length>0&&r.groups.every(Ze=>m.value.has(Ze.workspace.id))),A=Q(new Set);function L(Ze){return A.value.has(Ze)}function $(Ze){const Xe=new Set(A.value);Xe.has(Ze)?Xe.delete(Ze):Xe.add(Ze),A.value=Xe}function x(Ze){if(!A.value.has(Ze)){const Xe=new Set(A.value);Xe.add(Ze),A.value=Xe}l("loadMoreSessions",Ze)}const E=Q(null),T=Q(null);function F(Ze){E.value=Ze}function S(){E.value=null,T.value=null}function I(Ze){const Xe=Ze.currentTarget.getBoundingClientRect();return Ze.clientY<Xe.top+Xe.height/2?"before":"after"}function B(Ze,Xe){E.value===null||E.value===Xe||(Ze.preventDefault(),Ze.dataTransfer&&(Ze.dataTransfer.dropEffect="move"),T.value={id:Xe,position:I(Ze)})}function R(Ze){const Xe=E.value,Dt=T.value?.id===Ze?T.value.position:"before";if(T.value=null,E.value=null,!Xe||Xe===Ze)return;const Pt=aI(r.groups.map(an=>an.workspace.id),Xe,Ze,Dt);l("reorderWorkspaces",Pt)}function P(Ze,Xe){Xe.target.closest(".gh-more, .gh-add")||k(Ze)}function W(Ze){l("select",Ze)}const U=Q(null),Z=Q(""),z=Q(null);function ee(){return z}function de(Ze,Xe){U.value=Ze,Z.value=Xe,vt().then(()=>z.value?.focus())}function J(){const Ze=U.value,Xe=Z.value.trim();Ze&&Xe&&l("renameWorkspace",Ze,Xe),U.value=null}function Y(){U.value=null}function X(Ze){Z.value=Ze}const fe=Q(!1),ce=Q(null),We=Q({}),ge=Q(null);function G(Ze){ge.value?.el&&!ge.value.el.contains(Ze.target)&&he()}function le(Ze,Xe){Xe.preventDefault(),Xe.stopPropagation(),ce.value=Ze,We.value={top:`${Xe.clientY}px`,left:`${Xe.clientX}px`},fe.value=!0,document.addEventListener("mousedown",G,!0)}function he(){fe.value=!1,document.removeEventListener("mousedown",G,!0),ce.value=null}function j(){ce.value&&Zs(ce.value.root),he()}function ne(){ce.value&&de(ce.value.id,ce.value.name),he()}async function ve(){const Ze=ce.value;Ze&&(he(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ze.name}),variant:"danger"})&&l("deleteWorkspace",Ze.id))}const ae=Q(null),ye=Q(null),q=Q({}),se=Q(null);function me(Ze){const Xe=Ze.target;Xe.closest(".gh-more")||Xe.closest(".ws-menu")||Me()}async function Te(Ze,Xe){if(ae.value===Ze.id){Me();return}const Dt=Xe.currentTarget;ye.value=Ze,ae.value=Ze.id,document.addEventListener("mousedown",me),window.addEventListener("resize",Me),await vt();const Pt=se.value?.el,an=Dt.getBoundingClientRect(),wn=4,Xn=8,Ss=Pt?.offsetHeight??0,as=Pt?.offsetWidth??0;let vn=an.bottom+wn;vn+Ss>window.innerHeight-Xn&&(vn=Math.max(Xn,an.top-Ss-wn));let Ft=an.right-as;Ft<Xn&&(Ft=Xn),q.value={top:`${Math.round(vn)}px`,left:`${Math.round(Ft)}px`}}function Me(){ae.value=null,ye.value=null,document.removeEventListener("mousedown",me),window.removeEventListener("resize",Me)}function $e(Ze){Zs(Ze.root),Me()}function pe(Ze){de(Ze.id,Ze.name),Me()}async function Ie(Ze){Me(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ze.name}),variant:"danger"})&&l("deleteWorkspace",Ze.id)}const Qe=Q(!1),lt=Q({}),_t=Q(null);function St(Ze){const Xe=Ze.target;Xe.closest(".side-section-kebab")||Xe.closest(".section-menu")||Ct()}async function Tt(Ze){if(Qe.value){Ct();return}const Xe=Ze.currentTarget;Qe.value=!0,document.addEventListener("mousedown",St),window.addEventListener("resize",Ct),await vt();const Dt=_t.value?.el,Pt=Xe.getBoundingClientRect(),an=4,wn=8,Xn=Dt?.offsetHeight??0,Ss=Dt?.offsetWidth??0;let as=Pt.bottom+an;as+Xn>window.innerHeight-wn&&(as=Math.max(wn,Pt.top-Xn-an));let vn=Pt.right-Ss;vn<wn&&(vn=wn),lt.value={top:`${Math.round(as)}px`,left:`${Math.round(vn)}px`}}function Ct(){Qe.value=!1,document.removeEventListener("mousedown",St),window.removeEventListener("resize",Ct)}function gt(Ze){l("setWorkspaceSortMode",Ze),Ct()}rs(()=>{document.removeEventListener("mousedown",G,!0),document.removeEventListener("mousedown",me),document.removeEventListener("mousedown",St),window.removeEventListener("resize",Me),window.removeEventListener("resize",Ct)});const nn=Q(null);let rn;function Qn(){const Ze=nn.value;Ze&&(Ze.classList.remove("blink-now"),Ze.getBoundingClientRect(),Ze.classList.add("blink-now"),clearTimeout(rn),rn=setTimeout(()=>Ze.classList.remove("blink-now"),300))}const Zt=Ci(()=>io(()=>import("./DesignSystemView-CrA0fNau.js"),__vite__mapDeps([0,1]))),fn=Q(!1);let hn,it=!1;function zn(Ze){it=!1,clearTimeout(hn),Ze.currentTarget.setPointerCapture?.(Ze.pointerId),hn=setTimeout(()=>{it=!0,fn.value=!0},aB)}function Hn(Ze){clearTimeout(hn);const Xe=Ze.currentTarget;Xe.hasPointerCapture?.(Ze.pointerId)&&Xe.releasePointerCapture(Ze.pointerId)}function Wn(){if(it){it=!1;return}Qn()}return rs(()=>{clearTimeout(hn)}),(Ze,Xe)=>(b(),N("aside",{class:Pe(["side",{"macos-desktop":C(xc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Jt({width:e.collapsed?"0px":e.colWidth+"px"})},[w("div",{class:"col",style:Jt({width:e.colWidth+"px"})},[w("div",GR,[w("div",YR,[C(xc)?re("",!0):(b(),N(Be,{key:0},[(b(),N("svg",{ref_key:"logoRef",ref:nn,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:Wn,onPointerdown:zn,onPointerup:Hn,onPointercancel:Hn},[...Xe[20]||(Xe[20]=[iy('<defs data-v-c1a5226d><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-c1a5226d><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-c1a5226d></rect><g class="ch-eyes" fill="#000" data-v-c1a5226d><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-c1a5226d></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-c1a5226d></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-c1a5226d></rect>',2)])],34)),w("span",ZR,[Xe[21]||(Xe[21]=Ye("Kimi Code",-1)),C(o)?(b(),N("span",QR," · "+O(C(i)),1)):re("",!0)])],64))]),C(xc)?re("",!0):(b(),xe(Pn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Xe[0]||(Xe[0]=xt(Dt=>l("collapse"),["stop"]))},{default:Ee(()=>[ie(Ke,{name:"panel-collapse"})]),_:1},8,["label"]))]),w("div",XR,[w("button",{class:"btn-new-chat",type:"button",onClick:Xe[1]||(Xe[1]=xt(Dt=>l("create"),["stop"]))},[ie(Ke,{name:"chat-new"}),w("span",null,O(C(n)("sidebar.newChat")),1)]),re("",!0)]),w("div",{class:Pe(["search-wrap",{"search-wrap--scrolled":p.value}])},[w("button",{class:"search",type:"button",onClick:u},[ie(Ke,{class:"search-icon",name:"search"}),w("span",JR,O(C(n)("sidebar.search")),1),ie(lr,{keys:C(c)},null,8,["keys"])])],2),w("div",{class:"sessions",onScroll:h},[e.groups.length===0?(b(),N("div",eB,O(C(n)("workspace.noWorkspace")),1)):(b(),N(Be,{key:1},[w("div",tB,[w("span",nB,O(C(n)("sidebar.workspaces")),1),w("div",sB,[ie(Pn,{class:"side-section-toggle",size:"sm",label:y.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Xe[3]||(Xe[3]=xt(Dt=>y.value?v():g(),["stop"]))},{default:Ee(()=>[y.value?(b(),xe(Ke,{key:0,name:"expand"})):(b(),xe(Ke,{key:1,name:"collapse"}))]),_:1},8,["label"]),ie(Pn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Qe.value,onClick:Xe[4]||(Xe[4]=xt(Dt=>Tt(Dt),["stop"]))},{default:Ee(()=>[ie(Ke,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(b(!0),N(Be,null,st(e.groups,Dt=>(b(),N("div",{key:Dt.workspace.id,class:Pe(["ws-drop-target",{"drop-before":T.value?.id===Dt.workspace.id&&T.value.position==="before","drop-after":T.value?.id===Dt.workspace.id&&T.value.position==="after"}]),onDragover:Pt=>B(Pt,Dt.workspace.id),onDrop:Pt=>R(Dt.workspace.id)},[ie(WR,{group:Dt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":U.value,"rename-value":Z.value,"rename-input-ref":ee(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ae.value,dragging:E.value===Dt.workspace.id,"is-collapsed":_,"is-expanded":L,onGroupClick:P,onGroupContextmenu:le,onToggleWsMenu:Te,onCreateInWorkspace:Xe[5]||(Xe[5]=Pt=>l("createInWorkspace",Pt)),onSelectSession:W,onRenameSession:Xe[6]||(Xe[6]=(Pt,an)=>l("rename",Pt,an)),onArchiveSession:Xe[7]||(Xe[7]=Pt=>l("archive",Pt)),onForkSession:Xe[8]||(Xe[8]=Pt=>l("fork",Pt)),onLoadMore:x,onToggleExpand:$,onConfirmRename:J,onCancelRename:Y,onUpdateRenameValue:X,onWsDragstart:F,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,oB))),128))],64))],32),w("div",iB,[w("button",{class:"btn-settings",type:"button",onClick:Xe[9]||(Xe[9]=xt(Dt=>l("openSettings"),["stop"]))},[ie(Ke,{name:"settings"}),w("span",null,O(C(n)("settings.title")),1)])])],4),fe.value?(b(),xe(la,{key:0,ref_key:"ghMenuRef",ref:ge,class:"gh-menu",style:Jt(We.value),onClick:Xe[10]||(Xe[10]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie($n,{onClick:j},{default:Ee(()=>[Ye(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie($n,{onClick:ne},{default:Ee(()=>[Ye(O(C(n)("sidebar.rename")),1)]),_:1}),ie($n,{danger:"",onClick:ve},{default:Ee(()=>[Ye(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),ae.value!==null&&ye.value?(b(),xe(la,{key:1,ref_key:"wsMenuRef",ref:se,class:"ws-menu",style:Jt(q.value),onClick:Xe[14]||(Xe[14]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie($n,{onClick:Xe[11]||(Xe[11]=Dt=>$e(ye.value))},{default:Ee(()=>[Ye(O(C(n)("sidebar.copyPath")),1)]),_:1}),ie($n,{separator:""}),ie($n,{onClick:Xe[12]||(Xe[12]=Dt=>pe(ye.value))},{default:Ee(()=>[Ye(O(C(n)("sidebar.rename")),1)]),_:1}),ie($n,{separator:""}),ie($n,{danger:"",onClick:Xe[13]||(Xe[13]=Dt=>Ie(ye.value))},{default:Ee(()=>[Ye(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):re("",!0),Qe.value?(b(),xe(la,{key:2,ref_key:"sectionMenuRef",ref:_t,class:"section-menu",style:Jt(lt.value),onClick:Xe[17]||(Xe[17]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie($n,{onClick:Xe[15]||(Xe[15]=Dt=>gt("manual"))},{default:Ee(()=>[w("span",rB,[e.workspaceSortMode==="manual"?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):re("",!0)]),Ye(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),ie($n,{onClick:Xe[16]||(Xe[16]=Dt=>gt("recent"))},{default:Ee(()=>[w("span",lB,[e.workspaceSortMode==="recent"?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):re("",!0)]),Ye(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):re("",!0),a.value?(b(),xe(dR,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:W,onClose:Xe[18]||(Xe[18]=Dt=>a.value=!1)},null,8,["sessions","active-id"])):re("",!0),(b(),xe(Dp,{to:"body"},[fn.value?(b(),xe(C(Zt),{key:0,onClose:Xe[19]||(Xe[19]=Dt=>fn.value=!1)})):re("",!0)]))],6))}}),uB=dt(cB,[["__scopeId","data-v-c1a5226d"]]);function dB(e){try{const t=ss(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function fB(e,t){try{ls(e,String(t))}catch{}}function hB(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(k){return Number.isFinite(k)?Math.min(h4(o),Math.max(s,Math.round(k))):n}const l=Q(r(dB(t)??n)),a=Q(!1);function c(k){const g=r(k);l.value=g,fB(t,g)}let u=0,d=0,f=null,p=-1;function h(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(p)}catch{}f.removeEventListener("pointermove",h),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,p=-1}}function _(k){k.preventDefault(),a.value=!0,u=k.clientX,d=r(l.value),f=k.currentTarget,p=k.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(p)}catch{}f.addEventListener("pointermove",h),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return rs(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const pB=["aria-label"],mB=Ve({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Lt(),{width:i,dragging:r,onPointerDown:l}=hB({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ge(i,a=>s("update:width",a)),Ge(r,a=>s("update:dragging",a)),(a,c)=>(b(),N("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,pB))}}),Kx=dt(mB,[["__scopeId","data-v-ad762f1c"]]),gB=["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"],Gx=[[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 vB(e){if(e<=255)return gB[e];let t=0,n=Gx.length-1;for(;t<=n;){const s=t+n>>1,o=Gx[s];if(e<o[0]){n=s-1;continue}if(e>o[1]){t=s+1;continue}return o[2]}return"L"}function yB(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 h=e.charCodeAt(c+1);h>=56320&&h<=57343&&(d=(u-55296<<10)+(h-56320)+65536,f=2)}const p=vB(d);(p==="R"||p==="AL"||p==="AN")&&(s=!0);for(let h=0;h<f;h++)n[c+h]=p;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,p=d!=="L"?"R":"L";if(p===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=p;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 kB(e,t){const n=yB(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 bB=/[ \t\n\r\f]+/g,xB=/[\t\n\r\f]| {2,}|^ | $/;function _B(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function wB(e){if(!xB.test(e))return e;let t=e.replace(bB," ");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 SB(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
68
+ `).replace(/[\r\f]/g,`
69
+ `):e}let W1=null,CB;function AB(){return W1===null&&(W1=new Intl.Segmenter(CB,{granularity:"word"})),W1}const MB=/\p{Script=Arabic}/u,Al=/\p{M}/u,ky=/\p{Nd}/u;function Yx(e){return MB.test(e)}function Zx(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 Ki(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(Zx(o))return!0;t++;continue}}if(Zx(n))return!0}}return!1}function EB(e){const t=Td(e);return t!==null&&(by.has(t)||ha.has(t))}const TB=new Set([" "," ","⁠","\uFEFF"]),NB=new Set(["-","‐","–","—"]);function IB(e){const t=Td(e);return t!==null&&TB.has(t)}function $B(e){const t=Td(e);return t!==null&&NB.has(t)}function tA(e,t){return IB(e)?!1:t?!(EB(e)||$B(e)):!0}const by=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Vp=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),xy=new Set(["'","’"]),ha=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),LB=new Set([":",".","،","؛"]),FB=new Set(["၏"]),OB=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function RB(e){if(_y(e))return!0;let t=!1;for(const n of e){if(ha.has(n)||Gp(n)){t=!0;continue}if(!(t&&Al.test(n)))return!1}return t}function BB(e){for(const t of e)if(!by.has(t)&&!ha.has(t))return!1;return e.length>0}function DB(e){if(_y(e))return!0;for(const t of e)if(!Vp.has(t)&&!xy.has(t)&&!Al.test(t)&&!Gp(t))return!1;return e.length>0}function _y(e){let t=!1;for(const n of e)if(!(n==="\\"||Al.test(n))){if(Vp.has(n)||ha.has(n)||xy.has(n)){t=!0;continue}return!1}return t}function Kp(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 Td(e){if(e.length===0)return null;const t=Kp(e,e.length);return e.slice(t)}function PB(e){for(const t of e)if(!Al.test(t))return t;return null}function HB(e){for(let t=e.length;t>0;){const n=Kp(e,t),s=e.slice(n,t);if(!Al.test(s))return s;t=n}return null}const WB=[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 zB(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function Gp(e){const t=e.codePointAt(0);return t!==void 0&&zB(t,WB)}function UB(e){const t=HB(e);return t!==null&&Gp(t)}function jB(e){const t=PB(e);return t!==null&&ky.test(t)}function qB(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Al.test(s)){n--;continue}if(Vp.has(s)||xy.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function VB(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function Qx(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 Xx(e,t){return e&&t!==null&&LB.has(t)}function KB(e){const t=Td(e);return t!==null&&FB.has(t)}function GB(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 Og(e){let t=e.length;for(;t>0;){const n=Kp(e,t),s=e.slice(n,t);if(OB.has(s))return!0;if(!ha.has(s))return!1;t=n}return!1}function YB(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
70
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const ZB=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ei(e){return e.length===1?e[0]:e.join("")}function QB(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Ei(n)}function XB(e,t,n,s){if(!ZB.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=YB(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:Ei(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:Ei(r),isWordLike:a,kind:i,start:l}),o}function Rg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const JB=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function eD(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:JB.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function tD(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function nD(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"||!eD(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!Rg(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]=Ei(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 sD(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]),!tD(r))continue;const l=i+1;if(l>=e.len||Rg(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!Rg(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Ei(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 oD=new Set([":","-","/","×",",",".","+","–","—"]),iD=/[\p{P}\p{S}\p{Co}]/u,rD=/\p{Emoji_Presentation}/u,lD=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function aD(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function nA(e){const t=e.charCodeAt(0);return t<128?aD(t):!lD.has(e)&&!rD.test(e)&&iD.test(e)}function Jx(e){let t=!1;for(const n of e)if(!Al.test(n)){if(!nA(n))return!1;t=!0}return t}function cD(e){for(let t=e.length;t>0;){const n=Kp(e,t),s=e.slice(n,t);if(Al.test(s)){t=n;continue}return nA(s)||Gp(s)}return!1}function uD(e,t,n,s){const o=!t&&Jx(e),i=!s&&Jx(n),r=UB(e),l=(t||r)&&cD(e);return!o&&!i&&!l||Ki(e)||Ki(n)?!1:(t||o||r)&&(s||i)}function sA(e){for(const t of e)if(ky.test(t))return!0;return!1}function Oh(e){if(e.length===0)return!1;for(const t of e)if(!(ky.test(t)||oD.has(t)))return!1;return!0}function dD(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"&&Oh(r)&&sA(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Oh(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Ei(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 fD(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"&&uD(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(Ei(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 hD(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||!sA(u)||!Oh(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 pD(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=Ei(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=Ei(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(Ei(r)),n.push(l),s.push(a),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function mD(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"||!Ki(t[i])||!Ki(t[i+1]))continue;const r=qB(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 gD(e,t,n){const s=AB();let o=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],p=[],h=[],m=[],_=[];for(const L of s.segment(e))for(const $ of XB(L.segment,L.isWordLike??!1,L.index,n)){let P=function(){u[R]!==null&&(r[R]=[Qx(i,u,d,R)],u[R]=null),r[R].push($.text),l[R]=l[R]||$.isWordLike,f[R]=f[R]||T,p[R]=p[R]||F,h[R]=I,m[R]=B,_[R]=Xx(p[R],S)};const x=$.kind==="text",E=VB($.text,$.isWordLike,$.kind),T=Ki($.text),F=Yx($.text),S=Td($.text),I=Og($.text),B=KB($.text),R=o-1;t.carryCJKAfterClosingQuote&&x&&o>0&&a[R]==="text"&&T&&f[R]&&h[R]||x&&o>0&&a[R]==="text"&&BB($.text)&&f[R]||x&&o>0&&a[R]==="text"&&m[R]?P():x&&o>0&&a[R]==="text"&&$.isWordLike&&F&&_[R]?(P(),l[R]=!0):E!==null&&o>0&&a[R]==="text"&&u[R]===E?d[R]=(d[R]??1)+1:x&&!$.isWordLike&&o>0&&a[R]==="text"&&!f[R]&&(RB($.text)||$.text==="-"&&l[R])?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]=T,p[o]=F,h[o]=I,m[o]=B,_[o]=Xx(F,S),o++)}for(let L=0;L<o;L++){if(u[L]!==null){i[L]=Qx(i,u,d,L);continue}i[L]=Ei(r[L])}for(let L=1;L<o;L++)a[L]==="text"&&!l[L]&&_y(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"&&(DB($)||$==="-"&&jB(i[g]))){const x=k[g]??[];x.push($),k[g]=x,c[g]=c[L],i[L]="";continue}g=L}}for(let L=0;L<o;L++){const $=k[L];$!=null&&(i[L]=QB($,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=pD({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),A=mD(fD(hD(dD(sD(nD(y))))));for(let L=0;L<A.len-1;L++){const $=GB(A.texts[L]);$!==null&&(A.kinds[L]!=="space"&&A.kinds[L]!=="preserved-space"||A.kinds[L+1]!=="text"||!Yx(A.texts[L+1])||(A.texts[L]=$.space,A.isWordLike[L]=!1,A.kinds[L]=A.kinds[L]==="preserved-space"?"preserved-space":"space",A.texts[L+1]=$.marks+A.texts[L+1],A.starts[L+1]=A.starts[L]+$.space.length))}return A}function vD(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 yD(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,p){let h=!1;for(let k=f;k<p;k++)h=h||t.isWordLike[k];const m=t.starts[f],_=p<t.len?t.starts[p]:e.length;s.push(e.slice(m,_)),o.push(h),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 p=l;p<f;p++)c(p);l=-1,a=!1}}for(let f=0;f<t.len;f++){const p=t.texts[f],h=t.kinds[f];if(h==="text"){l>=0&&!tA(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||Ki(p);continue}d(f),s.push(p),o.push(t.isWordLike[f]),i.push(h),r.push(t.starts[f])}return d(t.len),{len:s.length,texts:s,isWordLike:o,kinds:i,starts:r}}function kD(e,t,n="normal",s="normal"){const o=_B(n),i=o.mode==="pre-wrap"?SB(e):wB(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=gD(i,t,o),l=s==="keep-all"?yD(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:vD(l,o),...l}}let Ua=null;const e_=new Map;let ja=null;const bD=96,xD=/\p{Emoji_Presentation}/u,_D=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let z1=null;const t_=new Map;function wy(){if(Ua!==null)return Ua;if(typeof OffscreenCanvas<"u")return Ua=new OffscreenCanvas(1,1).getContext("2d"),Ua;if(typeof document<"u")return Ua=document.createElement("canvas").getContext("2d"),Ua;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function wD(e){let t=e_.get(e);return t||(t=new Map,e_.set(e,t)),t}function il(e,t){let n=t.get(e);return n===void 0&&(n={width:wy().measureText(e).width,containsCJK:Ki(e)},t.set(e,n)),n}function Yp(){if(ja!==null)return ja;if(typeof navigator>"u")return ja={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ja;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 ja={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:s,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},ja}function SD(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function oA(){return z1===null&&(z1=new Intl.Segmenter(void 0,{granularity:"grapheme"})),z1}function CD(e){return xD.test(e)||e.includes("️")}function AD(e){return _D.test(e)}function MD(e,t){let n=t_.get(e);if(n!==void 0)return n;const s=wy();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 t_.set(e,n),n}function ED(e){let t=0;const n=oA();for(const s of n.segment(e))CD(s.segment)&&t++;return t}function TD(e,t){return t.emojiCount===void 0&&(t.emojiCount=ED(e)),t.emojiCount}function ta(e,t,n){return n===0?t.width:t.width-TD(e,t)*n}function ND(e,t,n,s,o){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===o)return t.breakableFitAdvances;t.breakableFitMode=o;const i=oA(),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=il(d,n);u.push(ta(d,f,s))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(o==="pair-context"||r.length>bD){const u=[];let d=null,f=0;for(const p of r){const h=il(p,n),m=ta(p,h,s);if(d===null)u.push(m);else{const _=d+p,k=il(_,n);u.push(ta(_,k,s)-f)}d=p,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=il(a,n),f=ta(a,d,s);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function ID(e,t){const n=wy();n.font=e;const s=wD(e),o=SD(e),i=t?MD(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function $D(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function iA(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function rA(e,t,n=e.widths.length){for(;t<n;){const s=e.kinds[t];if(!$D(s))break;t++}return t}function LD(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function FD(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Sy(e,t){return t===0?0:e+t}function OD(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function RD(e,t,n,s,o){const i=t==="tab"?o+OD(e,n):e.lineEndFitAdvances[n];return Sy(s,i)}function n_(e,t,n,s){const o=t==="tab"?0:e.lineEndFitAdvances[n];return Sy(s,o)}function s_(e,t,n,s,o){const i=t==="tab"?o:e.lineEndPaintAdvances[n];return Sy(s,i)}function BD(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function DD(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Rh(e,t,n){let s=t;for(;s<e.length&&e[s]<n;)s++;return s}function PD(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 HD(e,t,n,s,o,i){return t+PD(e,n,s,o,i)}function WD(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(s.length===0)return 0;const a=Yp().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,p=0,h=0,m=0,_=0,k=-1,g=0;function v(){k=-1,g=0}function y(T=m,F=_,S=d){u++,n?.(S,p,h,T,F),d=0,f=!1,v()}function A(T,F){f=!0,p=T,h=0,m=T+1,_=0,d=F}function L(T,F,S){f=!0,p=T,h=F,m=T,_=F+1,d=S}function $(T,F){if(!f){A(T,F);return}d+=F,m=T+1,_=0}function x(T,F){const S=i[T],I=r[T]??null;let B=I===null?-1:Rh(I,0,F+1),R=-1,P=0,W=F;for(;W<S.length;){const U=S[W];if(!f)L(T,W,U);else if(d+U>c){if(I!==null&&R>F){y(T,R,P),W=R,B=Rh(I,B,W+1),R=-1,P=0;continue}y(),L(T,W,U)}else d+=U,m=T,_=W+1;const Z=W+1;I!==null&&I[B]===Z&&(R=Z,P=d,B++),W++}f&&m===T&&_===S.length&&(m=T+1,_=0)}let E=0;for(;E<s.length&&!(!f&&(E=rA(e,E),E>=s.length));){const T=s[E],F=o[E],S=iA(F);if(!f){T>c&&i[E]!==null?x(E,0):A(E,T),S&&(k=E+1,g=d-T),E++;continue}if(d+T>c){if(S){$(E,T),y(E+1,0,d-T),E++;continue}if(k>=0){if(m>k||m===k&&_>0){y();continue}y(k,0,g);continue}if(T>c&&i[E]!==null){y(),x(E,0),E++;continue}y();continue}$(E,T),S&&(k=E+1,g=d-T),E++}return f&&y(),u}function zD(e,t,n){if(e.simpleLineWalkFastPath)return WD(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=Yp(),u=c.lineFitEpsilon,d=t+u;let f=0,p=0,h=!1,m=0,_=0,k=0,g=0,v=-1,y=0,A=0,L=null;function $(){v=-1,y=0,A=0,L=null}function x(){return L==="soft-hyphen"&&v===k&&g===0?A:p}function E(P=k,W=g,U){f++,n!==void 0&&n(HD(e,U??x(),m,_,P,W),m,_,P,W),p=0,h=!1,$()}function T(P,W){h=!0,m=P,_=0,k=P+1,g=0,p=W}function F(P,W,U){h=!0,m=P,_=W,k=P,g=W+1,p=U}function S(P,W){if(!h){T(P,W);return}p+=W,k=P+1,g=0}function I(P,W,U,Z,z,ee){if(!W)return;const de=n_(e,P,U,z),J=s_(e,P,U,z,Z);v=U+1,y=p-ee+de,A=p-ee+J,L=P}function B(P,W){const U=i[P],Z=r[P]??null;let z=Z===null?-1:Rh(Z,0,W+1),ee=-1,de=0,J=W;for(;J<U.length;){const Y=U[J];if(!h)F(P,J,Y);else{const fe=BD(e,!0,Y),ce=p+fe;if(DD(e,ce)>d){if(Z!==null&&ee>W){E(P,ee,de),J=ee,z=Rh(Z,z,J+1),ee=-1,de=0;continue}E(),F(P,J,Y)}else p=ce,k=P,g=J+1}const X=J+1;Z!==null&&Z[z]===X&&(ee=X,de=p,z++),J++}h&&k===P&&g===U.length&&(k=P+1,g=0)}function R(P){f++,n?.(0,P.startSegmentIndex,0,P.consumedEndSegmentIndex,0),$()}for(let P=0;P<a.length;P++){const W=a[P];if(W.startSegmentIndex===W.endSegmentIndex){R(W);continue}h=!1,p=0,m=W.startSegmentIndex,_=0,k=W.startSegmentIndex,g=0,$();let U=W.startSegmentIndex;for(;U<W.endSegmentIndex&&!(!h&&(U=rA(e,U,W.endSegmentIndex),U>=W.endSegmentIndex));){const Z=o[U],z=iA(Z),ee=FD(e,h,U),de=Z==="tab"?LD(p+ee,e.tabStopAdvance):s[U],J=ee+de,Y=RD(e,Z,U,ee,de);if(Z==="soft-hyphen"){h&&(k=U+1,g=0,v=U+1,y=p+l,A=p+l,L=Z),U++;continue}if(!h){Y>d&&i[U]!==null?B(U,0):T(U,de),I(Z,z,U,de,ee,J),U++;continue}if(p+Y>d){const fe=p+n_(e,Z,U,ee),ce=p+s_(e,Z,U,ee,de);if(L==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&y<=d){E(v,0,A);continue}if(z&&fe<=d){S(U,J),E(U+1,0,ce),U++;continue}if(v>=0&&y<=d){if(k>v||k===v&&g>0){E();continue}const We=v;E(We,0,A),U=We;continue}if(Y>d&&i[U]!==null){E(),B(U,0),U++;continue}E();continue}S(U,J),I(Z,z,U,de,ee,J),U++}if(h){const Z=v===W.consumedEndSegmentIndex?A:p;E(W.consumedEndSegmentIndex,0,Z)}}return f}let U1=null;function Cy(){return U1===null&&(U1=new Intl.Segmenter(void 0,{granularity:"grapheme"})),U1}function UD(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function jD(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,p){s=[d],o=f,i=p,r=Og(d),l=Vp.has(d)}function u(d,f){s.push(d),i=i||f;const p=Og(d);d.length===1&&ha.has(d)?r=r||p:r=p,l=!1}for(const d of Cy().segment(e)){const f=d.segment,p=Ki(f);if(s.length===0){c(f,d.index,p);continue}if(l||by.has(f)||ha.has(f)||t.carryCJKAfterClosingQuote&&p&&r){u(f,p);continue}if(!i&&!p){u(f,p);continue}a(),c(f,d.index,p)}return a(),n}function qD(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&&!tA(t[a-1].text,n)&&l(a),o<0&&(o=a),i=i||Ki(c.text)}return l(t.length),s}function o_(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=Cy();for(const o of s.segment(e))n++;return n}function VD(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function KD(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const s of Cy().segment(e))n++,VD(s.segment)&&t.push(n);return t.length===0?null:t}function GD(e,t,n){return t>1?e+(t-1)*n:e}function YD(e,t,n,s,o){const i=Yp(),{cache:r,emojiCorrection:l}=ID(t,AD(e.normalized)),a=ta("-",il("-",r),l)+(o===0?0:o*2),u=ta(" ",il(" ",r),l)*8,d=o!==0;if(e.len===0)return UD();const f=[],p=[],h=[],m=[];let _=e.chunks.length<=1&&!d;const k=n?[]:null,g=[],v=[],y=[],A=n?[]:null,L=Array.from({length:e.len});function $(F,S,I,B,R,P,W,U,Z){R!=="text"&&R!=="space"&&R!=="zero-width-break"&&(_=!1),f.push(S),p.push(I),h.push(B),m.push(R),k?.push(P),g.push(W),v.push(U),d&&y.push(Z),A!==null&&A.push(F)}function x(F,S,I,B,R){const P=il(F,r),W=d?o_(F,S):0,U=GD(ta(F,P,l),W,o),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,z=Z===0?0:Z+(W>0?o:0),ee=S==="space"||S==="zero-width-break"?0:U;if(R&&B&&F.length>1){let de="sum-graphemes";o!==0?de="segment-prefixes":Oh(F)?de="pair-context":i.preferPrefixWidthsForBreakableRuns&&(de="segment-prefixes");const J=ND(F,P,r,l,de),Y=J===null||s==="keep-all"?null:KD(F);$(F,U,z,ee,S,I,J,Y,W);return}$(F,U,z,ee,S,I,null,null,W)}for(let F=0;F<e.len;F++){L[F]=f.length;const S=e.texts[F],I=e.isWordLike[F],B=e.kinds[F],R=e.starts[F];if(B==="soft-hyphen"){$(S,0,a,a,B,R,null,null,0);continue}if(B==="hard-break"){$(S,0,0,0,B,R,null,null,0);continue}if(B==="tab"){$(S,0,0,0,B,R,null,null,d?o_(S,B):0);continue}const P=il(S,r);if(B==="text"&&P.containsCJK){const W=jD(S,i),U=s==="keep-all"?qD(S,W,i.breakKeepAllAfterPunctuation):W;for(let Z=0;Z<U.length;Z++){const z=U[Z];x(z.text,"text",R+z.start,I,s==="keep-all"||!Ki(z.text))}continue}x(S,B,R,I,!0)}const E=ZD(e.chunks,L,f.length),T=k===null?null:kB(e.normalized,k);return A!==null?{widths:f,lineEndFitAdvances:p,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:_,segLevels:T,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E,segments:A}:{widths:f,lineEndFitAdvances:p,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:_,segLevels:T,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:o,spacingGraphemeCounts:y,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:E}}function ZD(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 QD(e,t,n,s){const o=s?.wordBreak??"normal",i=s?.letterSpacing??0,r=kD(e,Yp(),s?.whiteSpace,o);return YD(r,t,n,o,i)}function lA(e,t,n){return QD(e,t,!0,n)}function aA(e){let t=0;return zD(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const XD={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},JD={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"},eP={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",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load {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"},tP={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"},nP={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"}},sP={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",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"},oP={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:" · thinking: {level}"},iP={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"},rP={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"},lP={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"},aP={justNow:"just now"},cP={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"},uP={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},dP={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"},fP={panelTitle:"Thinking",close:"Close"},hP={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"},pP={},mP={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"}},gP={searching:"Searching…",noMatch:"No matches"},vP={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."}},yP={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},kP={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)"}},bP={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},xP={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"},_P={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},wP={preview:"预览",confirm:"确认",cancel:"取消"},SP={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},CP={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:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},AP={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:"此会话在完成前被中断"},MP={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:"收起"}},EP={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:"取消",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:"进行中"},TP={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}"},NP={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 后重试"},IP={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 关闭"},$P={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},LP={justNow:"刚刚"},FP={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:"拒绝并退出"},OP={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},RP={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:"展开"},BP={panelTitle:"思考过程",close:"关闭"},DP={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},PP={},HP={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:"无法读取这个文件"}},WP={searching:"搜索中…",noMatch:"无匹配"},zP={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:"目标描述太长了,请精简后重试。"}},UP={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},jP={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} 个)"}},qP={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},VP={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},KP={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},GP={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"},YP={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},ZP={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",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…"},QP={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:"服务端版本",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:"正在加载全部归档会话…"},XP={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"},JP={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:"归档"},eH={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"},tH={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},nH={en:{common:XD,app:JD,sidebar:eP,workspace:tP,conversation:nP,status:sP,composer:oP,login:iP,providers:rP,model:lP,sessions:aP,approval:cP,question:uP,tasks:dP,thinking:fP,diff:hP,fileTree:pP,filePreview:mP,mention:gP,warnings:vP,commands:yP,tools:kP,layout:bP,mobile:xP,theme:_P,onboarding:GP,settings:ZP,header:XP,sideChat:eH},zh:{common:wP,app:SP,sidebar:CP,workspace:AP,conversation:MP,status:EP,composer:TP,login:NP,providers:IP,model:$P,sessions:LP,approval:FP,question:OP,tasks:RP,thinking:BP,diff:DP,fileTree:PP,filePreview:HP,mention:WP,warnings:zP,commands:UP,tools:jP,layout:qP,mobile:VP,theme:KP,onboarding:YP,settings:QP,header:JP,sideChat:tH}},cA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function sH(){const e=ss(Ht.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Mn=FN({legacy:!1,locale:sH(),fallbackLocale:"en",messages:nH});function uA(e){Mn.global.locale.value=e,ls(Ht.locale,e)}const Ks=Mn.global.t,oH={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"},iH={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 ba(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return iH[t]??t}function xa(e){const t=oH[ba(e)];return t?Ks(t):e}const rH={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 Zp(e){const t=ba(e);let n=rH[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),tc(n,"sm")}const dA=80;function lH(e,t=dA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function aH(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function cH(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 en(e){return typeof e=="string"&&e.length>0?e:void 0}function Xr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function uH(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 j1(e){return en(e.path)??en(e.file_path)??en(e.filePath)??en(e.filename)}const dH={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function fH(e){const t=en(e);if(!t)return;const n=dH[t];return n?Ks(n):t}function hH(e){const t=Xr(e.value),n=en(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return Ks("tools.goal.turns",{value:t});case"tokens":return Ks("tools.goal.tokens",{value:t});case"milliseconds":return Ks("tools.goal.milliseconds",{value:t});case"seconds":return Ks("tools.goal.seconds",{value:t});case"minutes":return Ks("tools.goal.minutes",{value:t});case"hours":return Ks("tools.goal.hours",{value:t});default:return Ks("tools.goal.budget",{value:t,unit:n})}}const pH=64;function cd(e,t,n=!1){const s=(o,i=dA)=>n?o.trim():lH(o,i);try{const o=cH(t);if(!n&&aH(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(ba(e)){case"read":{const r=j1(o);if(!r)return i();const l=Xr(o.offset)??Xr(o.line_start)??Xr(o.start_line),a=Xr(o.limit)??Xr(o.length),c=Xr(o.line_end)??Xr(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=j1(o);return r?s(`${r} ${Ks("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=j1(o);return r?s(r):i()}case"bash":{const r=en(o.command)??en(o.cmd)??en(o.script);return r?s(r,pH):i()}case"grep":case"search":{const r=en(o.pattern)??en(o.query)??en(o.regex),l=en(o.path)??en(o.glob)??en(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=en(o.pattern)??en(o.glob)??en(o.query),l=en(o.path)??en(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):en(o.path)?s(en(o.path)):i()}case"ls":{const r=en(o.path)??en(o.dir)??en(o.directory)??en(o.cwd);return r?s(r):i()}case"web_fetch":{const r=en(o.url)??en(o.uri);return r?s(uH(r)):i()}case"todo":case"task":{const r=en(o.description)??en(o.title)??en(o.prompt)??en(o.name)??en(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(Ks("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=en(o.objective),l=en(o.completionCriterion);return r&&l?s(Ks("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?s(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=hH(o);return r?s(r):i()}case"updategoal":{if(n)return i();const r=fH(o.status);return r?s(Ks("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function mH(e){try{switch(ba(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Ks("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 Ks("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Ks("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const gH=Ve({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const s=D(()=>n(t.status));return(o,i)=>(b(),N("span",{class:Pe(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),ud=dt(gH,[["__scopeId","data-v-e36198e5"]]),vH=["innerHTML"],yH={class:"bh-text"},kH={class:"a"},bH={key:0,class:"p"},xH={class:"rt"},_H=["aria-label"],wH={key:0,class:"tm"},SH=["inert"],CH={class:"bb-pad"},AH=Ve({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,s=Yt("pinScroll",()=>{}),o=Q(null);function i(){n("toggle");const r=o.value;r&&vt(()=>s(r))}return(r,l)=>(b(),N("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(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,vH)):re("",!0),w("span",yH,[w("span",kH,O(e.name),1),ie(Xt,{text:e.arg},{default:Ee(()=>[e.arg?(b(),N("span",bH,O(e.arg),1)):re("",!0)]),_:1},8,["text"])]),w("span",xH,[w("span",{class:Pe(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):e.status==="error"?(b(),xe(Ke,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(b(),xe(ud,{key:2,status:"suspended"})):(b(),xe(ud,{key:3,status:"running"}))],10,_H),On(r.$slots,"trailing"),e.time?(b(),N("span",wH,O(e.time),1)):re("",!0)]),e.expandable?(b(),xe(Ke,{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",CH,[On(r.$slots,"default")])],10,SH)],2))}}),Qp=dt(AH,[["__scopeId","data-v-fef8aad2"]]),MH={key:0,class:"at-type"},EH={key:1,class:"at-task"},TH={key:2,class:"bb-code"},NH=Ve({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Lt(),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(()=>xa(s.tool.name)),f=D(()=>Zp(s.tool.name)),p=D(()=>r.value.description||r.value.subagentType||""),h=Yt("resolveAgentTaskId"),m=D(()=>h?h(s.tool.id)!==void 0:!0);function _(){a.value&&(c.value=!c.value)}return Ge(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(k,g)=>(b(),xe(Qp,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":p.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:_},{trailing:Ee(()=>[m.value?(b(),N("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=xt(v=>o("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):re("",!0)]),default:Ee(()=>[r.value.subagentType?(b(),N("div",MH,O(r.value.subagentType),1)):re("",!0),r.value.prompt?(b(),N("div",EH,O(r.value.prompt),1)):re("",!0),l.value?(b(),N("div",TH,[(b(!0),N(Be,null,st(e.tool.output??[],(v,y)=>(b(),N("div",{key:y},O(v),1))),128))])):re("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),IH=dt(NH,[["__scopeId","data-v-14ef8750"]]);function $H(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 _f={recognized:!1,answers:{},note:""};function LH(e){const t=e?.[0];if(!t)return _f;let n;try{n=JSON.parse(t)}catch{return _f}if(!n||typeof n!="object"||Array.isArray(n))return _f;const s=n.answers;if(!s||typeof s!="object"||Array.isArray(s))return _f;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 FH(e,t,n){return e[t]??e[`q_${n}`]}const OH=/^opt_\d+_(\d+)$/;function RH(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=OH.exec(l);c?o.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:o,otherText:i.join(", "),indeterminate:!1}}const BH={key:0,class:"chip"},DH={key:0,class:"au-dismissed"},PH={key:1,class:"au-list"},HH={class:"au-q"},WH={key:0,class:"au-hdr"},zH={class:"au-qtext"},UH={class:"au-opts"},jH={class:"au-glyph"},qH={class:"au-label"},VH={key:0,class:"au-desc"},KH={key:0,class:"au-opt sel"},GH={class:"au-glyph"},YH={class:"au-label"},ZH={key:1,class:"au-opt sel"},QH={class:"au-label"},XH={key:2,class:"au-raw"},JH=80,eW=Ve({__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}=Lt();function s($,x=JH){const E=$.trim();return E.length>x?E.slice(0,x-1)+"…":E}const o=D(()=>$H(t.tool.arg)),i=D(()=>LH(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(($,x)=>RH(FH(i.value.answers,$.question,x),$.options))),c=D(()=>Object.keys(i.value.answers).length);function u($,x){return a.value[$]?.selected.has(x)??!1}function d($){return a.value[$]?.otherText??""}function f($){return a.value[$]?.indeterminate??!1}function p($,x){return $?x?"■":"□":x?"●":"○"}const h=D(()=>{if(!r.value)return s(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const $=o.value[0]?.question??"",x=s($);return o.value.length<=1?x:`${x} ${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}):""),_=D(()=>!!t.tool.output&&t.tool.output.length>0),k=D(()=>r.value&&(o.value.length>0||l.value)||_.value),g=Q(t.tool.defaultExpanded===!0&&k.value),v=D(()=>t.tool.status),y=D(()=>xa(t.tool.name)),A=D(()=>Zp(t.tool.name));function L(){k.value&&(g.value=!g.value)}return Ge(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&k.value&&(g.value=!0)}),($,x)=>(b(),xe(Qp,{status:v.value,icon:A.value,name:y.value,arg:g.value?"":h.value,time:e.tool.timing,open:g.value,expandable:k.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:L},{trailing:Ee(()=>[m.value?(b(),N("span",BH,O(m.value),1)):re("",!0)]),default:Ee(()=>[l.value?(b(),N("div",DH,O(i.value.note),1)):r.value?(b(),N("div",PH,[(b(!0),N(Be,null,st(o.value,(E,T)=>(b(),N("div",{key:T,class:"au-block"},[w("div",HH,[E.header?(b(),N("span",WH,O(E.header),1)):re("",!0),w("span",zH,O(E.question),1)]),w("div",UH,[(b(!0),N(Be,null,st(E.options,(F,S)=>(b(),N("div",{key:S,class:Pe(["au-opt",{sel:u(T,S)}])},[w("span",jH,O(p(E.multiSelect,u(T,S))),1),w("span",qH,O(F.label),1),F.description?(b(),N("span",VH,O(F.description),1)):re("",!0)],2))),128)),d(T)?(b(),N("div",KH,[w("span",GH,O(p(E.multiSelect,!0)),1),w("span",YH,O(d(T)),1)])):re("",!0),f(T)?(b(),N("div",ZH,[x[0]||(x[0]=w("span",{class:"au-glyph"},"●",-1)),w("span",QH,O(C(n)("tools.ask.answered")),1)])):re("",!0)])]))),128))])):(b(),N("div",XH,[(b(!0),N(Be,null,st(e.tool.output??[],(E,T)=>(b(),N("div",{key:T},O(E),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),tW=dt(eW,[["__scopeId","data-v-a9a0f259"]]),nW=1e6,i_=5e3;function r_(e){if(e==="")return[];const t=e.split(`
71
+ `);return t.at(-1)===""&&t.pop(),t}function sW(e,t){const n=r_(e),s=r_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>i_||i>i_||(o+1)*(i+1)>nW)return null;const r=Array.from({length:o+1},()=>Array.from({length:i+1},()=>0));for(let p=1;p<=o;p++)for(let h=1;h<=i;h++)r[p][h]=n[p-1]===s[h-1]?r[p-1][h-1]+1:Math.max(r[p-1][h],r[p][h-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 p of l)p.type==="context"?(u.push({type:"context",text:p.text,oldNo:d,newNo:f}),d++,f++):p.type==="add"?(u.push({type:"add",text:p.text,newNo:f}),f++):(u.push({type:"del",text:p.text,oldNo:d}),d++);return u}function oW(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 fA(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 hA(e){const t=ba(e.name);if(t!=="edit"&&t!=="write")return null;const n=fA(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:sW(s,o)}return null}function iW(e){const t=fA(e);return t&&typeof t.path=="string"?t.path:void 0}function rW(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const lW={key:0,class:"bb-empty"},l_=50,aW=Ve({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=D(()=>t.lines??[]),s=D(()=>n.value.length>l_),o={"--tool-output-visible-lines":String(l_)};return(i,r)=>(b(),N("div",{class:Pe(["bb-code tool-output-block",{scroll:s.value}]),style:o},[n.value.length===0&&e.emptyText?(b(),N("div",lW,O(e.emptyText),1)):re("",!0),(b(!0),N(Be,null,st(n.value,(l,a)=>(b(),N("div",{key:a},O(l),1))),128))],2))}}),pA=dt(aW,[["__scopeId","data-v-262bbea0"]]),cW={key:0,class:"chip"},uW={key:0,class:"bb-summary"},dW=Ve({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>n.tool.status),i=D(()=>xa(n.tool.name)),r=D(()=>Zp(n.tool.name)),l=D(()=>cd(n.tool.name,n.tool.arg)),a=D(()=>cd(n.tool.name,n.tool.arg,!0)),c=D(()=>hA(n.tool)),u=D(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:_,removed:k}=oW(m);if(_||k)return`+${_} −${k}`}return""}),d=D(()=>!!n.tool.output&&n.tool.output.length>0),f=Q(!1),p=D(()=>d.value&&!n.toolDiffPanel);function h(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,_)=>(b(),xe(Qp,{status:o.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:p.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:h},{trailing:Ee(()=>[u.value?(b(),N("span",cW,O(u.value),1)):re("",!0)]),default:Ee(()=>[a.value?(b(),N("div",uW,O(a.value),1)):re("",!0),ie(pA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),fW=dt(dW,[["__scopeId","data-v-74e1da99"]]),hW={key:0,class:"chip"},pW={key:0,class:"bb-summary"},mW=Ve({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=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(()=>xa(t.tool.name)),a=D(()=>Zp(t.tool.name)),c=D(()=>cd(t.tool.name,t.tool.arg)),u=D(()=>cd(t.tool.name,t.tool.arg,!0)),d=D(()=>mH({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){o.value&&(i.value=!i.value)}return Ge(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(p,h)=>(b(),xe(Qp,{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:Ee(()=>[d.value?(b(),N("span",hW,O(d.value),1)):re("",!0)]),default:Ee(()=>[u.value?(b(),N("div",pW,O(u.value),1)):re("",!0),ie(pA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),gW=dt(mW,[["__scopeId","data-v-aa4edcb0"]]),vW={class:"media-title"},yW=["src","alt"],kW=["src"],bW=["src"],xW=Ve({__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(),N("div",{key:0,class:Pe(["media-tool",{mob:e.mobile}])},[ie(Xt,{text:o.value.path||l.value},{default:Ee(()=>[w("div",vW,O(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(b(),xe(Xt,{key:0,text:o.value.path||l.value},{default:Ee(()=>[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,yW)])]),_:1},8,["text"])):o.value.kind==="video"?(b(),N("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,kW)):(b(),N("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,bW))],2)):re("",!0)}}),_W=dt(xW,[["__scopeId","data-v-bec13b73"]]),wW=/<summary>([\s\S]*?)<\/summary>/,SW=/<resume_hint>([\s\S]*?)<\/resume_hint>/,q1=/<subagent\b([^>]*)>|<\/subagent>/g,CW="</subagent>",a_=/(completed|failed|aborted):\s*(\d+)/g,c_=/([a-z_]+)="([^"]*)"/g;function AW(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function MW(e){const t={};c_.lastIndex=0;let n;for(;(n=c_.exec(e))!==null;)t[n[1]]=AW(n[2]);return t}function EW(e){const t={completed:0,failed:0,aborted:0};a_.lastIndex=0;let n;for(;(n=a_.exec(e))!==null;){const s=n[1];t[s]=Number(n[2])}return t}function TW(e,t){const n=MW(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function NW(e){const t=[],n=[];q1.lastIndex=0;let s;for(;(s=q1.exec(e))!==null;)if(s[0]===CW){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(TW(o.attrs,e.slice(o.bodyStart,s.index)))}else n.length===0?n.push({attrs:s[1]??"",bodyStart:q1.lastIndex}):n.push(null);return t}function IW(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
72
+ `):e;if(!t.includes("<agent_swarm_result>"))return null;const n=wW.exec(t)?.[1]?.trim()??"",{completed:s,failed:o,aborted:i}=EW(n),r=SW.exec(t)?.[1]?.trim(),l=NW(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 u_(e){return e?e.split(`
73
+ `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function $W(e){return e.suspendedReason||u_(e.text)||u_(e.outputLines?.join(`
74
+ `))||e.summary||""}function LW(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
75
+ `):e.summary??""}function FW(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function d_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
76
+ `)[0]??"",phase:FW(e.outcome),body:e.body}}function OW(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function RW(e,t){const n=e.map(o=>({id:o.id,name:o.name,activity:$W(o),phase:o.phase,body:LW(o)}));if(!t)return n;const s=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(i=>OW(i,o))).map((o,i)=>d_(o,i));return n.length>0?[...n,...s]:t.subagents.map((o,i)=>d_(o,i))}const BW=["aria-expanded"],DW={class:"title"},PW={key:0,class:"meta"},HW={key:1,class:"sum-txt"},WW={class:"rt"},zW={class:"status"},UW={key:0,class:"chip"},jW={key:1,class:"tm"},qW={class:"body"},VW={class:"overview"},KW={class:"overview-line"},GW={class:"big"},YW={key:0,class:"lbl"},ZW={key:1,class:"lbl"},QW={key:2,class:"lbl"},XW={key:0,class:"seg","aria-hidden":"true"},JW={key:1,class:"legend"},ez=["aria-expanded","onClick"],tz={class:"mname"},nz={class:"mact"},sz={class:"mphase"},oz={key:1,class:"fallback-output"},iz={key:2,class:"waiting"},rz=Ve({__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}=Lt(),n=e;function s(T){if(!T)return{};try{const F=JSON.parse(T),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=Yt("resolveSwarmMembers"),i=D(()=>s(n.tool.arg)),r=D(()=>xa(n.tool.name)),l=D(()=>i.value.description??""),a=D(()=>o?.(n.tool.id)??[]),c=D(()=>IW(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(()=>RW(a.value,c.value)),p=D(()=>{const T={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)T[F.phase]++;return T}),h=D(()=>f.value.length||i.value.itemCount||0),m=D(()=>p.value.completed+p.value.failed),_=D(()=>p.value.working+p.value.suspended+p.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:T,cls:F})=>({phase:T,count:p.value[T],cls:F})).filter(T=>T.count>0)),v=Q(!1);function y(){v.value=!v.value}const A=D(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
77
+ `).trim()),L=Q(new Set);function $(T){const F=new Set(L.value);F.has(T)?F.delete(T):F.add(T),L.value=F}function x(T){return L.value.has(T)}function E(T){return t(`tools.swarm.phase${T[0].toUpperCase()}${T.slice(1)}`)}return(T,F)=>(b(),N("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(Ke,{class:"ic",name:"git-pull-request",size:"sm"}),w("span",DW,O(r.value),1),l.value?(b(),N("span",PW,"·")):re("",!0),l.value?(b(),N("span",HW,O(l.value),1)):re("",!0),w("span",WW,[w("span",zW,[d.value==="ok"?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):d.value==="error"?(b(),xe(Ke,{key:1,name:"close",size:"sm"})):(b(),xe(ud,{key:2,status:"running"}))]),m.value>0||h.value>0?(b(),N("span",UW,O(m.value)+" / "+O(h.value),1)):re("",!0),e.tool.timing?(b(),N("span",jW,O(e.tool.timing),1)):re("",!0)]),ie(Ke,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,BW),Fn(w("div",qW,[w("div",VW,[w("div",KW,[w("span",GW,O(C(t)("tools.swarm.progress",{done:m.value,total:h.value})),1),d.value==="running"&&h.value>0?(b(),N("span",YW,O(C(t)("tools.swarm.runningSub",{count:_.value})),1)):c.value?(b(),N("span",ZW,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(b(),N("span",QW,O(C(t)("tools.swarm.waiting")),1))]),h.value>0&&g.value.length>0?(b(),N("div",XW,[(b(!0),N(Be,null,st(g.value,S=>(b(),N("span",{key:S.phase,class:Pe(S.cls),style:Jt({flex:S.count})},null,6))),128))])):re("",!0),g.value.length>1?(b(),N("div",JW,[(b(!0),N(Be,null,st(g.value,S=>(b(),N("span",{key:S.phase},[w("i",{class:Pe(["lg-dot",S.cls])},null,2),Ye(O(E(S.phase))+" "+O(S.count),1)]))),128))])):re("",!0)]),f.value.length>0?(b(!0),N(Be,{key:0},st(f.value,S=>(b(),N("div",{key:S.id,class:Pe(["member",[`phase-${S.phase}`,{open:x(S.id)}]])},[w("button",{class:"member-head",type:"button","aria-expanded":x(S.id),onClick:I=>$(S.id)},[ie(ud,{class:"row-dot",status:S.phase},null,8,["status"]),ie(Xt,{text:S.name},{default:Ee(()=>[w("span",tz,O(S.name),1)]),_:2},1032,["text"]),S.activity?(b(),xe(Xt,{key:0,text:S.activity},{default:Ee(()=>[w("span",nz,O(S.activity),1)]),_:2},1032,["text"])):re("",!0),w("span",sz,O(E(S.phase)),1),ie(Ke,{class:"mcar",name:x(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,ez),Fn(w("div",{class:"member-body"},O(S.body),513),[[di,x(S.id)]])],2))),128)):A.value?(b(),N("div",oz,O(A.value),1)):(b(),N("div",iz,O(C(t)("tools.swarm.waiting")),1))],512),[[di,v.value]])],2))}}),lz=dt(rz,[["__scopeId","data-v-3b95ba79"]]);function az(e){if(e.media&&e.status==="ok")return _W;const t=ba(e.name);return t==="edit"||t==="write"||t==="multi_edit"?fW:t==="task"?IH:t==="agentswarm"?lz:t==="askuserquestion"?tW:gW}const mA=Ve({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=D(()=>az(n.tool));return(i,r)=>(b(),xe(Ps(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 f_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function cz(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 Xp(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 uz(e){return!(e.tool.status==="ok"&&e.tool.media)}function dz(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function fz(e){const t=Xp(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(uz(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 hz(e){return Xp(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
78
+
79
+ `)}function pz(e){const t=[];for(const n of Xp(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
80
+ > ${n.thinking.split(`
81
+ `).join(`
82
+ > `)}`);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(`
83
+ `);t.push(`\`\`\`
84
+ [${n.tool.name}]
85
+ ${s}
86
+ \`\`\``)}return t.join(`
87
+
88
+ `)}function gA(e){return e.tool.id||`tool-${e.sourceIndex}`}function mz(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?gA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const gz=["aria-expanded"],vz={class:"tg-title"},yz={class:"tg-meta"},kz=["inert"],bz={class:"tool-group-body-inner"},xz=Ve({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=Q(!0),i=D(()=>n.tools.length),r=D(()=>n.tools.some(p=>p.tool.status==="running")?"running":n.tools.some(p=>p.tool.status==="error")?"error":"done"),{t:l}=Lt(),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=Yt("pinScroll",()=>{}),d=Q(null);function f(){c();const p=d.value;p&&vt(()=>u(p))}return(p,h)=>(b(),N("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(ud,{status:r.value},null,8,["status"]),ie(Ke,{class:"tg-ic",name:"list",size:"sm"}),w("span",vz,O(C(l)("tools.group.title",i.value)),1),w("span",yz,"· "+O(a.value),1),ie(Ke,{class:"tg-car",name:"chevron-right",size:"sm"})],8,gz),w("div",{class:Pe(["tool-group-body",{open:o.value}]),inert:!o.value},[w("div",bz,[(b(!0),N(Be,null,st(e.tools,(m,_)=>(b(),xe(mA,{key:C(gA)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(dz)(_,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:h[0]||(h[0]=k=>s("openMedia",k)),onOpenFile:h[1]||(h[1]=k=>s("openFile",k)),onOpenToolDiff:h[2]||(h[2]=k=>s("openToolDiff",k)),onOpenAgent:h[3]||(h[3]=k=>s("openAgent",k))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,kz)],2))}}),_z=dt(xz,[["__scopeId","data-v-37eb334f"]]);var wz=Object.create,Ay=Object.defineProperty,Sz=Object.getOwnPropertyDescriptor,vA=Object.getOwnPropertyNames,Cz=Object.getPrototypeOf,Az=Object.prototype.hasOwnProperty,yA=(e,t)=>function(){return t||(0,e[vA(e)[0]])((t={exports:{}}).exports,t),t.exports},kA=e=>{let t={};for(var n in e)Ay(t,n,{get:e[n],enumerable:!0});return t},Mz=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=vA(t),i=0,r=o.length,l;i<r;i++)l=o[i],!Az.call(e,l)&&l!==n&&Ay(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=Sz(t,l))||s.enumerable});return e},bA=(e,t,n)=>(n=e!=null?wz(Cz(e)):{},Mz(Ay(n,"default",{value:e,enumerable:!0}),e));function Ez(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 Tz(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Nz(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 Iz(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
89
+ `:`<hr class="footnotes-sep">
90
+ `)+`<section class="footnotes">
91
+ <ol class="footnotes-list">
92
+ `}function $z(){return`</ol>
93
+ </section>
94
+ `}function Lz(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 Fz(){return`</li>
95
+ `}function Oz(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 Rz(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Nz,e.renderer.rules.footnote_block_open=Iz,e.renderer.rules.footnote_block_close=$z,e.renderer.rules.footnote_open=Lz,e.renderer.rules.footnote_close=Fz,e.renderer.rules.footnote_anchor=Oz,e.renderer.rules.footnote_caption=Tz,e.renderer.rules.footnote_anchor_name=Ez;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 p;for(p=d+2;p<f;p++){if(l.src.charCodeAt(p)===32)return!1;if(l.src.charCodeAt(p)===93)break}if(p===d+2||p+1>=f||l.src.charCodeAt(++p)!==58)return!1;if(u)return!0;p++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const h=l.src.slice(d+2,p-2);l.env.footnotes.refs[`:${h}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:h},m.level=l.level++,l.tokens.push(m);const _=l.bMarks[a],k=l.tShift[a],g=l.sCount[a],v=l.parentType,y=p,A=l.sCount[a]+p-(l.bMarks[a]+l.tShift[a]);let L=A;for(;p<f;){const x=l.src.charCodeAt(p);if(n(x))x===9?L+=4-L%4:L++;else break;p++}l.tShift[a]=p-y,l.sCount[a]=L-A,l.bMarks[a]=y,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=v,l.blkIndent-=4,l.tShift[a]=k,l.sCount[a]=g,l.bMarks[a]=_;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 p=l.env.footnotes.list.length,h=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,h);const m=l.push("footnote_ref","",0);m.meta={id:p},l.env.footnotes.list[p]={content:l.src.slice(d,f),tokens:h}}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 p;l.env.footnotes.refs[`:${f}`]<0?(p=l.env.footnotes.list.length,l.env.footnotes.list[p]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=p):p=l.env.footnotes.refs[`:${f}`];const h=l.env.footnotes.list[p].count;l.env.footnotes.list[p].count++;const m=l.push("footnote_ref","",0);m.meta={id:p,subId:h,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(h){return h.type==="footnote_reference_open"?(d=!0,c=[],u=h.meta.label,!1):h.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(h),!d)}),!l.env.footnotes.list))return;const p=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let h=0,m=p.length;h<m;h++){const _=new l.Token("footnote_open","",1);if(_.meta={id:h,label:p[h].label},l.tokens.push(_),p[h].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=p[h].tokens,y.content=p[h].content,a.push(y);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else p[h].label&&(a=f[`:${p[h].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=p[h].count>0?p[h].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:h,subId:v,label:p[h].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 Bz(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 Dz(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 Pz=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Hz(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(Pz,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function Wz(e){e.inline.ruler.after("emphasis","sub",Hz)}const zz=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Uz(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(zz,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function jz(e){e.inline.ruler.after("emphasis","sup",Uz)}var qz=yA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,_){_=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},_),m.core.ruler.after("inline","github-task-lists",function(k){for(var g=k.tokens,v=0,y=2;y<g.length;y++)o(g,y)&&(i(g[y],v,_,k.Token),v+=1,n(g[y-2],"class",_.liClass),n(g[s(g,y-2)],"class",_.ulClass))})};function n(m,_,k){var g=m.attrIndex(_),v=[_,k];g<0?m.attrPush(v):m.attrs[g]=v}function s(m,_){for(var k=m[_].level-1,g=_-1;g>=0;g--)if(m[g].level===k)return g;return-1}function o(m,_){return d(m[_])&&f(m[_-1])&&p(m[_-2])&&h(m[_])}function i(m,_,k,g){var v=k.idPrefix+_;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,k,g)),k.divWrap&&(m.children.unshift(c(k,g)),m.children.push(u(g)))}function r(m,_,k,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",_]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),k.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,_){var k=new _("label_open","label",1);return k.attrs=[["for",m]],k}function a(m){return new m("label_close","label",-1)}function c(m,_){var k=new _("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 p(m){return m.type==="list_item_open"}function h(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),Vz=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))),Kz=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),V1;const Gz=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]]),Yz=(V1=String.fromCodePoint)!==null&&V1!==void 0?V1: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 Zz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Gz.get(e))!==null&&t!==void 0?t:e}var Ts;(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"})(Ts||(Ts={}));const Qz=32;var rl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(rl||(rl={}));function Bg(e){return e>=Ts.ZERO&&e<=Ts.NINE}function Xz(e){return e>=Ts.UPPER_A&&e<=Ts.UPPER_F||e>=Ts.LOWER_A&&e<=Ts.LOWER_F}function Jz(e){return e>=Ts.UPPER_A&&e<=Ts.UPPER_Z||e>=Ts.LOWER_A&&e<=Ts.LOWER_Z||Bg(e)}function eU(e){return e===Ts.EQUALS||Jz(e)}var Es;(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"})(Es||(Es={}));var sl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(sl||(sl={}));var tU=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Es.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=sl.Strict}startEntity(e){this.decodeMode=e,this.state=Es.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Es.EntityStart:return e.charCodeAt(t)===Ts.NUM?(this.state=Es.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Es.NamedEntity,this.stateNamedEntity(e,t));case Es.NumericStart:return this.stateNumericStart(e,t);case Es.NumericDecimal:return this.stateNumericDecimal(e,t);case Es.NumericHex:return this.stateNumericHex(e,t);case Es.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Qz)===Ts.LOWER_X?(this.state=Es.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Es.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(Bg(s)||Xz(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(Bg(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===Ts.SEMI)this.consumed+=1;else if(this.decodeMode===sl.Strict)return 0;return this.emitCodePoint(Zz(this.result),this.consumed),this.errors&&(e!==Ts.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&rl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=nU(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===sl.Attribute&&(o===0||eU(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&rl.VALUE_LENGTH)>>14,o!==0){if(i===Ts.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==sl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&rl.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]&~rl.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Es.NamedEntity:return this.result!==0&&(this.decodeMode!==sl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Es.NumericDecimal:return this.emitNumericEntity(0,2);case Es.NumericHex:return this.emitNumericEntity(0,3);case Es.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Es.EntityStart:return 0}}};function xA(e){let t="";const n=new tU(e,s=>t+=Yz(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 nU(e,t,n,s){const o=(t&rl.BRANCH_LENGTH)>>7,i=t&rl.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 sU=xA(Vz);xA(Kz);function My(e,t=sl.Legacy){return sU(e,t)}var oU=bA(qz());const h_={};function iU(e){let t=h_[e];if(t)return t;t=h_[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 Jp(e,t){typeof t!="string"&&(t=Jp.defaultChars);const n=iU(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})}Jp.defaultChars=";/?:@&=+$,#";Jp.componentChars="";var Dg=Jp;const p_={};function rU(e){let t=p_[e];if(t)return t;t=p_[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 em(e,t,n){typeof t!="string"&&(n=t,t=em.defaultChars),typeof n>"u"&&(n=!0);const s=rU(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}em.defaultChars=";/?:@&=+$,-_.!~*'()#";em.componentChars="-_.!~*'()";var _A=em;function Ey(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 Bh(){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 lU=/^([a-z0-9.+-]+:)/i,aU=/:[0-9]*$/,cU=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,uU=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
96
+ `," "]),dU=["'"].concat(uU),m_=["%","/","?",";","#"].concat(dU),g_=["/","?","#"],fU=255,v_=/^[+a-z0-9A-Z_-]{0,63}$/,hU=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y_={javascript:!0,"javascript:":!0},k_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function pU(e,t){if(e&&e instanceof Bh)return e;const n=new Bh;return n.parse(e,t),n}Bh.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=cU.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=lU.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&&y_[r])&&(i=i.substr(2),this.slashes=!0)),!y_[r]&&(o||r&&!k_[r])){let c=-1;for(let h=0;h<g_.length;h++)s=i.indexOf(g_[h]),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 h=0;h<m_.length;h++)s=i.indexOf(m_[h]),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 p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const h=this.hostname.split(/\./);for(let m=0,_=h.length;m<_;m++){const k=h[m];if(k&&!k.match(v_)){let g="";for(let v=0,y=k.length;v<y;v++)k.charCodeAt(v)>127?g+="x":g+=k[v];if(!g.match(v_)){const v=h.slice(0,m),y=h.slice(m+1),A=k.match(hU);A&&(v.push(A[1]),y.unshift(A[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>fU&&(this.hostname=""),p&&(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),k_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Bh.prototype.parseHost=function(e){let t=aU.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 Ty=pU,wA=kA({decode:()=>Dg,encode:()=>_A,format:()=>Ey,parse:()=>Ty}),SA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,CA=/[\0-\x1F\x7F-\x9F]/,mU=/[\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]/,AA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,gU=/[\$\+<->\^`\|~\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]/,MA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,vU=kA({Any:()=>SA,Cc:()=>CA,Cf:()=>mU,P:()=>AA,S:()=>gU,Z:()=>MA}),yU=Object.defineProperty,EA=e=>{let t={};for(var n in e)yU(t,n,{get:e[n],enumerable:!0});return t},ms=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}`}},kU=EA({arrayReplaceAt:()=>AU,assign:()=>SU,countLines:()=>es,escapeHtml:()=>OU,escapeRE:()=>BU,fromCodePoint:()=>fd,has:()=>wU,isMdAsciiPunct:()=>Hh,isPunctChar:()=>Ph,isPunctCode:()=>Pg,isSpace:()=>CU,isString:()=>xU,isValidEntityCode:()=>nm,isWhiteSpace:()=>dd,lib:()=>DU,mdurl:()=>wA,normalizeReference:()=>tm,ucmicro:()=>Dh,unescapeAll:()=>hd,unescapeMd:()=>NU});const Dh=vU;function bU(e){return Object.prototype.toString.call(e)}function xU(e){return bU(e)==="[object String]"}const _U=Object.prototype.hasOwnProperty;function wU(e,t){return _U.call(e,t)}function SU(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 CU(e){return e===9||e===32}function dd(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 Ph(e){return Dh.P.test(e)||Dh.S.test(e)}const b_=new Map;function Pg(e){if(Hh(e))return!0;const t=b_.get(e);if(t!==void 0)return t;const n=Ph(String.fromCharCode(e));return b_.set(e,n),n}function Hh(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 tm(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function AU(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function nm(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 fd(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 TA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,MU=new RegExp(`${TA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),EU=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function TU(e,t){if(t.charCodeAt(0)===35&&EU.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return nm(s)?fd(s):e}const n=My(e);return n!==e?n:e}function NU(e){return e.includes("\\")?e.replace(TA,"$1"):e}function hd(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(MU,(t,n,s)=>n||TU(t,s))}const IU=/[&<>"]/,$U=/[&<>"]/g,LU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function FU(e){return LU[e]}function OU(e){return IU.test(e)?e.replace($U,FU):e}const RU=/[.?*+^$[\]\\(){}|-]/g;function BU(e){return e.replace(RU,"\\$&")}const DU={mdurl:wA,ucmicro:Dh};function es(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
97
+ `,n+1))!==-1;)t++;return t}const PU=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,HU=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,WU=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Ny=["references","footnotes","abbreviations","abbr","abbrs"],Iy=Symbol.for("markdown-it-ts.global-state"),$y=Object.prototype.hasOwnProperty;function x_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Ai(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function dl(e){if(Array.isArray(e))return e.map(t=>dl(t));if(Ai(e)){const t={};for(const n of Object.keys(e))t[n]=dl(e[n]);return t}return e}function Wh(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Ai(e)?Object.keys(e):[]}function Hg(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(!Hg(e[n],t[n]))return!1;return!0}if(Ai(e)||Ai(t)){if(!Ai(e)||!Ai(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(!$y.call(t,o)||!Hg(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function NA(e,t){if(Array.isArray(e))return e[Number(t)];if(Ai(e))return e[t]}function zU(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=dl(t[n]);return e}if(Ai(e)&&Ai(t)){for(const n of Object.keys(e))$y.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=dl(t[n]);return e}return dl(t)}function UU(e,t,n){const s=n.ownedKeys??[],o=e[t];if(Ai(o)||Array.isArray(o)){const i=new Set(Wh(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=dl(NA(n.value,r)):delete o[r];!n.existed&&Wh(o).length===0&&delete e[t];return}n.existed?e[t]=dl(n.value):delete e[t]}function Ly(e){const t=e[Iy];return x_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&x_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function jU(e,t){Object.defineProperty(e,Iy,{value:t,enumerable:!1,configurable:!0,writable:!0})}function ko(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:PU.test(e)?"footnote-definition":HU.test(e)?"abbreviation-definition":WU.test(e)?"reference-definition":null}function Nd(e){return Ly(e)?.reason??null}function _c(e,t,n){if(Nd(e)&&Nr(e),!t)return n();Fy(e,t);try{const s=n();return Oy(e),s}catch(s){throw Nr(e),s}}function Fy(e,t){try{Nr(e);const n={};for(const s of Ny)n[s]=$y.call(e,s)?{existed:!0,value:dl(e[s])}:{existed:!1};jU(e,{reason:t,snapshot:n})}catch{}}function Oy(e){const t=Ly(e);if(t)for(const n of Ny){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!Ai(o)&&!Array.isArray(o))continue;const i=new Set(Wh(s.existed?s.value:void 0));s.ownedKeys=Wh(o).filter(r=>i.has(r)?!Hg(o[r],NA(s.value,r)):!0)}}function Nr(e){const t=Ly(e);if(t){for(const n of Ny){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){UU(e,n,s);continue}s.existed?e[n]=zU(e[n],s.value):delete e[n]}delete e[Iy]}}const Wg=Symbol.for("markdown-it-ts.diagnostics");function sm(e,t){if(e)try{const n=e[Wg];if(n&&typeof n=="object")return n;if(!t)return;const s={};return e[Wg]=s,s}catch{return}}function ur(e){return sm(e,!1)}function qU(e){if(e)try{const t=e[Wg];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function to(e){qU(e)}function hs(e,t){const n=sm(e,!0);n&&(n.strategy=t)}function K1(e,t){const n=sm(e,!0);n&&(n.chunk=t)}function IA(e,t){const n=sm(e,!0);n&&(n.unbounded=t)}function VU(e){const t={};e=e||{},t.src_Any=SA.source,t.src_Cc=CA.source,t.src_Z=MA.source,t.src_P=AA.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 zg(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function om(e){return Object.prototype.toString.call(e)}function KU(e){return om(e)==="[object String]"}function GU(e){return om(e)==="[object Object]"}function YU(e){return om(e)==="[object RegExp]"}function __(e){return om(e)==="[object Function]"}function ZU(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const $A={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function QU(e){return Object.keys(e||{}).reduce(function(t,n){return t||$A.hasOwnProperty(n)},!1)}const XU={"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}}},JU="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]",ej="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function tj(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function w_(){return function(e,t){t.normalize(e)}}function zh(e){const t=e.re=VU(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(JU),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,GU(a)){YU(a.validate)?c.validate=tj(a.validate):__(a.validate)?c.validate=a.validate:i(l,a),__(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=w_();return}if(KU(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:w_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(ZU).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 LA(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 Yo(e,t){if(!(this instanceof Yo))return new Yo(e,t);t||QU(e)&&(t=e,e={}),this.__opts__=zg({},$A,t),this.__schemas__=zg({},XU,e),this.__compiled__={},this.__tlds__=ej,this.__tlds_replaced__=!1,this.re={},zh(this)}Yo.prototype.add=function(t,n){return this.__schemas__[t]=n,zh(this),this};Yo.prototype.set=function(t){return this.__opts__=zg(this.__opts__,t),this};Yo.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)};Yo.prototype.pretest=function(t){return this.re.pretest.test(t)};Yo.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};Yo.prototype.match=function(t){const n=[],s=[],o=[],i=[];let r,l,a;function c(f,p){return f?p?f.index!==p.index?f.index<p.index?f:p:f.lastIndex>=p.lastIndex?f:p:f:p}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]]],p=c(c(f[0],f[1]),f[2]);if(!p)break;if(p===f[0]?u[0]++:p===f[1]?u[1]++:u[2]++,p.index<d)continue;const h=new LA(t,p.schema,p.index,p.lastIndex);this.__compiled__[h.schema].normalize(h,this),n.push(h),d=p.lastIndex}return n.length?n:null};Yo.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 LA(t,n[2],n.index+n[1].length,n.index+n[0].length+s);return this.__compiled__[o.schema].normalize(o,this),o};Yo.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(),zh(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,zh(this),this)};Yo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Yo.prototype.onCompile=function(){};var FA=Yo,nj=yA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,_=Math.floor,k=String.fromCharCode;function g(R){throw new RangeError(h[R])}function v(R,P){const W=[];let U=R.length;for(;U--;)W[U]=P(R[U]);return W}function y(R,P){const W=R.split("@");let U="";W.length>1&&(U=W[0]+"@",R=W[1]),R=R.replace(p,".");const Z=v(R.split("."),P).join(".");return U+Z}function A(R){const P=[];let W=0;const U=R.length;for(;W<U;){const Z=R.charCodeAt(W++);if(Z>=55296&&Z<=56319&&W<U){const z=R.charCodeAt(W++);(z&64512)==56320?P.push(((Z&1023)<<10)+(z&1023)+65536):(P.push(Z),W--)}else P.push(Z)}return P}const L=R=>String.fromCodePoint(...R),$=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},x=function(R,P){return R+22+75*(R<26)-((P!=0)<<5)},E=function(R,P,W){let U=0;for(R=W?_(R/700):R>>1,R+=_(R/P);R>m*26>>1;U+=36)R=_(R/m);return _(U+(m+1)*R/(R+38))},T=function(R){const P=[],W=R.length;let U=0,Z=128,z=72,ee=R.lastIndexOf("-");ee<0&&(ee=0);for(let de=0;de<ee;++de)R.charCodeAt(de)>=128&&g("not-basic"),P.push(R.charCodeAt(de));for(let de=ee>0?ee+1:0;de<W;){const J=U;for(let X=1,fe=36;;fe+=36){de>=W&&g("invalid-input");const ce=$(R.charCodeAt(de++));ce>=36&&g("invalid-input"),ce>_((2147483647-U)/X)&&g("overflow"),U+=ce*X;const We=fe<=z?1:fe>=z+26?26:fe-z;if(ce<We)break;const ge=36-We;X>_(2147483647/ge)&&g("overflow"),X*=ge}const Y=P.length+1;z=E(U-J,Y,J==0),_(U/Y)>2147483647-Z&&g("overflow"),Z+=_(U/Y),U%=Y,P.splice(U++,0,Z)}return String.fromCodePoint(...P)},F=function(R){const P=[];R=A(R);const W=R.length;let U=128,Z=0,z=72;for(const J of R)J<128&&P.push(k(J));const ee=P.length;let de=ee;for(ee&&P.push("-");de<W;){let J=2147483647;for(const X of R)X>=U&&X<J&&(J=X);const Y=de+1;J-U>_((2147483647-Z)/Y)&&g("overflow"),Z+=(J-U)*Y,U=J;for(const X of R)if(X<U&&++Z>2147483647&&g("overflow"),X===U){let fe=Z;for(let ce=36;;ce+=36){const We=ce<=z?1:ce>=z+26?26:ce-z;if(fe<We)break;const ge=fe-We,G=36-We;P.push(k(x(We+ge%G,0))),fe=_(ge/G)}P.push(k(x(fe,0))),z=E(Z,Y,de===ee),Z=0,++de}++Z,++U}return P.join("")},B={version:"2.3.1",ucs2:{decode:A,encode:L},decode:T,encode:F,toASCII:function(R){return y(R,function(P){return f.test(P)?"xn--"+F(P):P})},toUnicode:function(R){return y(R,function(P){return d.test(P)?T(P.slice(4).toLowerCase()):P})}};t.exports=B})}),OA=bA(nj());function Ry(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=hd(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=hd(e.slice(t,o)),i.pos=o,i.ok=!0),i}var RA=Ry;const Gf=-2;function sj(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 Gf}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return Gf;if(r===91){o++,i++;continue}i++}return-1}function By(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=sj(l,t,a,n);if(f!==Gf)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 p=-1;return o&&(p=e.pos),e.pos=c,p}var Uh=By;function Dy(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+=hd(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+=hd(e.slice(t,i)),r}var BA=Dy;function im(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 Py(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function oj(e,t,n){const s=im(e,t),o=[t,n];s<0?Py(e,o):e.attrs[s]=o}function ij(e,t){const n=im(e,t);return n>=0?e.attrs[n][1]:null}function rj(e,t,n){const s=im(e,t);s<0?Py(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var lj=EA({attrGet:()=>ij,attrIndex:()=>im,attrJoin:()=>rj,attrPush:()=>Py,attrSet:()=>oj,parseLinkDestination:()=>Ry,parseLinkLabel:()=>By,parseLinkTitle:()=>Dy});function aj(e){return e.includes("\r")||e.includes("\0")}function DA(e){return typeof e=="string"?e:e.toString()}function cj(e){if(e.inlineMode){const t=new ms("inline","",0);t.content=DA(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 uj=/^([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])?)*)$/,dj=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function fj(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(dj.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(uj.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 hj=fj;function pj(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(`
98
+ `)&&(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 mj=pj;function S_(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 p=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+p,i[c]=p,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 gj(e){const t=e.tokens_meta,n=e.tokens_meta.length;S_(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&S_(t[s].delimiters)}var vj=gj;function yj(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 C_(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 kj(e){const t=e.tokens_meta,n=e.tokens_meta.length;C_(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&C_(e,t[s].delimiters)}const A_={tokenize:yj,postProcess:kj};function PA(e){return My(e)}function Hy(e){return e>=48&&e<=57}function bj(e){const t=e|32;return Hy(e)||t>=97&&t<=102}function HA(e){const t=e|32;return t>=97&&t<=122}function xj(e){return HA(e)||Hy(e)}function _j(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?bj(l):Hy(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function wj(e,t,n){let s=t+1;if(s>=n||!HA(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&xj(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 PA(o)!==o?o:null}function Sj(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=_j(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=nm(i)?fd(i):fd(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=wj(e.src,n,s);if(o){const i=PA(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 Cj=Sj;const WA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Ug=new Array(128),zA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Ug[e]=`\\${t}`,zA[e]=WA[e]?t:Ug[e]}function M_(e,t,n){e.pending&&e.pushPending();const s=new ms("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 Aj(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):(M_(e,zA[i],Ug[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 M_(e,i<256&&WA[i]?r:l,l),e.pos=n+1,!0}var Mj=Aj;function Ej(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 Tj=Ej;const UA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,jA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Nj=new RegExp(`^(?:${UA}|${jA}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Ij=new RegExp(`^(?:${UA}|${jA})`);function qA(e){return e===32||e===9||e===10||e===12||e===13}function $j(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||qA(t)}function Lj(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(!qA(n))return!1}return!1}function Fj(e){const t=e|32;return t>=97&&t<=122}function Oj(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&&!Fj(i))return!1;const r=o.slice(s).match(Nj);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,$j(l)&&e.linkLevel++,Lj(l)&&e.linkLevel--}return e.pos+=l.length,!0}var Rj=Oj;function Bj(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 p=e.pos+2,h=Uh(e,e.pos+1,!1);if(h<0)return!1;if(i=h+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=RA(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=BA(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=Uh(e,i),i>=0?o=e.src.slice(c,i++):i=h+1):i=h+1,o||(o=e.src.slice(p,h)),r=e.env.references[tm(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(p,h);const m=[];e.md.inline.parse(s,e.md,e.env,m);const _=e.push("image","img",0);_.attrs=[["src",u],["alt",""]],_.children=m,_.content=s,a&&_.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var Dj=Bj;function Pj(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,p=Uh(e,e.pos,!0);if(p<0)return!1;let h=p+1;if(h<d&&e.src.charCodeAt(h)===40){for(c=!1,h++;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(h>=d)return!1;if(o=RA(e.src,h,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?h=o.pos:r="",a=h;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(o=BA(e.src,h,e.posMax),h<d&&a!==h&&o.ok)for(l=o.str,h=o.pos;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);}(h>=d||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h<d&&e.src.charCodeAt(h)===91?(a=h+1,h=Uh(e,h),h>=0?s=e.src.slice(a,h++):h=p+1):h=p+1,s||(s=e.src.slice(f,p)),i=e.env.references[tm(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=p;const m=e.push("link_open","a",1),_=[["href",r]];m.attrs=_,l&&_.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=d,!0}var Hj=Pj;function VA(e){const t=e|32;return t>=97&&t<=122}function Wj(e){return e>=48&&e<=57}function zj(e){return VA(e)||Wj(e)||e===43||e===45||e===46}function Uj(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&zj(e.charCodeAt(t));)t--;return t++,t>=e.length||!VA(e.charCodeAt(t))?null:e.slice(t)}function jj(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 qj(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=Uj(e.pending);if(!o)return!1;const i=jj(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 Vj(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 Kj=Vj;function Gj(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 E_(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 Yj(e){const t=e.delimiters;E_(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&E_(e,n[s].delimiters)}const T_={tokenize:Gj,postProcess:Yj};function N_(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 Zj(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||N_(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!N_(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var Qj=Zj;function Wy(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Xj(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 Jj(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 KA(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:Wy(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function wc(e,t,n,s,o,i){const r=KA(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Jj(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=Wy()}function eq(e){const t=KA(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=Xj(o.samples)}return t.completedAt=Wy(),t}var I_=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}},GA=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 ms("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 ms(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 ms(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=dd(l),u=dd(a),d=Pg(l),f=Pg(a),p=!u&&(!f||c||d),h=!c&&(!d||u||f);return{can_open:p&&(t||!h||d),can_close:h&&(t||!p||f),length:r}}};GA.prototype.Token=ms;const tq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function YA(e){return!tq.test(e)}var nq=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new I_,this.ruler2=new I_,this.ruler.push("text",Qj),this.ruler.push("linkify",qj),this.ruler.push("newline",Kj),this.ruler.push("escape",Mj),this.ruler.push("backticks",mj),this.ruler.push("strikethrough",T_.tokenize),this.ruler.push("emphasis",A_.tokenize),this.ruler.push("link",Hj),this.ruler.push("image",Dj),this.ruler.push("autolink",hj),this.ruler.push("html_inline",Rj),this.ruler.push("entity",Cj),this.ruler2.push("balance_pairs",vj),this.ruler2.push("strikethrough",T_.postProcess),this.ruler2.push("emphasis",A_.postProcess),this.ruler2.push("fragments_join",Tj),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(wc(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(wc(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()&&YA(e)){const a=new ms("text","",0);a.content=e,s.push(a);return}const o=new GA(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();wc(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 sq(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&&YA(i.content)){const r=new ms("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const oq=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,iq=/[0-9a-z]/i;function rq(e){return/^<a[>\s]/i.test(e)}function lq(e){return/^<\/a\s*>/i.test(e)}function aq(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(!oq.test(s)||!iq.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 cq(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"&&(rq(l.content)&&i>0&&i--,lq(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(p=>aq(e.md.linkify,p));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 p=0;p<c.length;p++){const h=c[p],m=e.md.normalizeLink(h.url);if(!e.md.validateLink(m))continue;let _=h.text;h.schema?h.schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText(`mailto:${_}`).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText(`http://${_}`).replace(/^http:\/\//,"");const k=h.index;if(k>f){const A=new ms("text","",0);A.content=a.slice(f,k),A.level=d,u.push(A)}const g=new ms("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new ms("text","",0);v.content=_,v.level=d,u.push(v);const y=new ms("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=h.lastIndex}if(f!==0){if(f<a.length){const p=new ms("text","",0);p.content=a.slice(f),p.level=d,u.push(p)}o.splice(r,1,...u)}}}}const uq=/\r\n?|\n/g,dq=/\0/g;function fq(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(uq,`
99
+ `)),s&&(o=o.replace(dq,"�")),e.src=o}const ZA=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,hq=/\((?:c|tm|r)\)/i,pq=/\((c|tm|r)\)/gi,mq={c:"©",r:"®",tm:"™"};function gq(e,t){return mq[t.toLowerCase()]}function vq(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(pq,gq)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function yq(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&ZA.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 kq(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(""):"");hq.test(s)&&vq(n.children||[]),ZA.test(s)&&yq(n.children||[])}}var bq=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 xq=/['"]/,$_=/['"]/g,L_="’";function wf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function _q(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;){$_.lastIndex=c;const d=$_.exec(a);if(!d)break;let f=!0,p=!0;c=d.index+1;const h=d[0]==="'";let m=32;if(d.index-1>=0)m=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let _=32;if(c<u)_=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){_=e[n].content.charCodeAt(0);break}const k=Hh(m)||Ph(String.fromCharCode(m)),g=Hh(_)||Ph(String.fromCharCode(_)),v=dd(m),y=dd(_);if(y?f=!1:g&&(v||k||(f=!1)),v?p=!1:k&&(y||g||(p=!1)),_===34&&d[0]==='"'&&m>=48&&m<=57&&(p=f=!1),f&&p&&(f=k,p=g),!f&&!p){h&&(r.content=wf(r.content,d.index,L_));continue}if(p)for(n=s.length-1;n>=0;n--){let A=s[n];if(s[n].level<l)break;if(A.single===h&&s[n].level===l){A=s[n];let L,$;h?(L=o[2]||"‘",$=o[3]||"’"):(L=o[0]||"“",$=o[1]||"”"),r.content=wf(r.content,d.index,$),e[A.token].content=wf(e[A.token].content,A.pos,L),c+=$.length-1,A.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:h,level:l}):p&&h&&(r.content=wf(r.content,d.index,L_))}}}function wq(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("");!xq.test(s)||!n.children||_q(n.children,e)}}function Sq(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 Cq=/^(?:vbscript|javascript|file|data):/,Aq=/^data:image\/(?:gif|png|jpeg|webp);/,QA=["http:","https:","mailto:"];function XA(e){const t=e.trim().toLowerCase();return Cq.test(t)?Aq.test(t):!0}function JA(e){const t=Ty(e,!0);if(t.hostname&&(!t.protocol||QA.includes(t.protocol)))try{t.hostname=OA.default.toASCII(t.hostname)}catch{}return _A(Ey(t))}function e6(e){const t=Ty(e,!0);if(t.hostname&&(!t.protocol||QA.includes(t.protocol)))try{t.hostname=OA.default.toUnicode(t.hostname)}catch{}return Dg(Ey(t),`${Dg.defaultChars}%`)}function Mq(e){switch(e){case 9:case 32:return!0}return!1}function Eq(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 p=[],h=[],m=[],_=[],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 B=F;for(p.push(i[y]),i[y]=u;u<d;){const R=o.charCodeAt(u);if(Mq(R))R===9?B+=4-(B+c[y]+(I?1:0))%4:B++;else break;u++}v=u>=d,h.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=B-F,_.push(l[y]),l[y]=u-i[y];continue}if(v)break;let T=!1;for(let F=0,S=k.length;F<S;F++)if(k[F](e,y,n,!0)){T=!0;break}if(T){e.lineMax=y,e.blkIndent!==0&&(p.push(i[y]),h.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}p.push(i[y]),h.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]=-1}const A=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 x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=f,e.parentType=g,$[1]=e.line;for(let E=0;E<_.length;E++)i[E+t]=p[E],l[E+t]=_[E],a[E+t]=m[E],c[E+t]=h[E];return e.blkIndent=A,!0}function Tq(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)}
100
+ `,i.map=[t,e.line],!0}function Nq(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 p=e.push("fence","code",0);return p.info=u,p.content=e.getLines(t+1,d,a,!0),p.markup=c,p.map=[t,e.line],!0}const F_=["","h1","h2","h3","h4","h5","h6"],O_=["","#","##","###","####","#####","######"];function R_(e){switch(e){case 9:case 32:return!0}return!1}function Iq(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&&!R_(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&R_(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const p=e.push("heading_open",F_[d],1);p.markup=O_[d],p.map=[t,e.line];const h=e.push("inline","",0);h.content=o.slice(a,c).trim(),h.map=[t,e.line],h.children=[];const m=e.push("heading_close",F_[d],-1);return m.markup=O_[d],!0}function $q(e){switch(e){case 9:case 32:return!0}return!1}function Lq(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&&!$q(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(`${Ij.source}\\s*$`),/^$/,!1]];function Fq(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 B_(e){switch(e){case 9:case 32:return!0}return!1}const Ou={Pipe:1,ParagraphTerminator:2};function Oq(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 t6=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|=Ou.Pipe|Ou.ParagraphTerminator),!a)if(B_(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,Oq(f)&&(c|=Ou.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 ms(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new ms(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 p=s?this.eMarks[u]+1:this.eMarks[u];let h=0;const m=this.src,_=this.bsCount,k=this.tShift;for(;f<p&&h<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?h+=4-(h+_[u])%4:h++;else if(f-d<k[u])h++;else break;f++}return h>n?new Array(h-n+1).join(" ")+m.slice(f,p):m.slice(f,p)}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 p=r[d];let h=p,m;for(d+1<t||s?m=l[d]+1:m=l[d];h<m&&f<n;){const _=i.charCodeAt(h);if(B_(_))_===9?f+=4-(f+a[d])%4:f++;else if(h-p<c[d])f++;else break;h++}f>n?o[u]=new Array(f-n+1).join(" ")+i.slice(h,m):o[u]=i.slice(h,m)}return o.join("")}};t6.prototype.Token=ms;function Rq(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function n6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function s6(e,t,n,s,o){if(e.lineFlags&&(e.lineFlags[t]&Ou.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:Rq(n,s,o)}const D_=["","h1","h2"];function Bq(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=n6(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,p,h=t+1;for(;h<n;h++){const y=i[h]+r[h],A=l[h];if(y>=A)break;if(a[h]-c>3)continue;if(a[h]>=c&&(p=o.charCodeAt(y),p===45||p===61)){let $=y+1,x=$;for(;$<A&&o.charCodeAt($)===p;)$++;for(x=$;$<A;){const E=o.charCodeAt($);if(E!==9&&E!==32)break;$++}if($>=A){f=p===61?1:2;break}if(x-y>1)continue}if(a[h]<0||u&&!s6(e,h,o,y,A))continue;let L=!1;for(let $=0,x=s.length;$<x;$++)if(s[$](e,h,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(h===t+1){const y=i[t]+r[t];let A=l[t];for(;A>y;){const L=o.charCodeAt(A-1);if(L!==9&&L!==32)break;A--}m=o.slice(y,A)}else m=e.getLines(t,h,c,!1).trim();e.line=h+1;const _=p===61?"=":"-",k=e.push("heading_open",D_[f],1);k.markup=_,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",D_[f],-1);return v.markup=_,e.parentType=d,!0}function o6(e){switch(e){case 9:case 32:return!0}return!1}function P_(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&&!o6(i.charCodeAt(l))?-1:l}function H_(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),!o6(c))?-1:a}function Dq(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 Pq=["0","1","2","3","4","5","6","7","8","9"];function Hq(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 Wq(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 p=e.src,h=e.bMarks,m=e.tShift,_=e.eMarks,k=e.sCount,g=e.bsCount,v=h[l]+m[l];if(v>=_[l])return!1;const y=p.charCodeAt(v);if(y>=48&&y<=57){if(f=H_(e,l),f<0||(u=!0,r=v,d=Dq(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=P_(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=_[l])return!1;if(s)return!0;const A=p.charCodeAt(f-1),L=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const $=[l,0];e.tokens[e.tokens.length-1].map=$,e.tokens[e.tokens.length-1].markup=L;let x=!1;const E=e.tokens.length-1,T=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,o=_[l];const S=k[l]+f-(h[l]+m[l]);let I=S;for(;i<o;){const Y=p.charCodeAt(i);if(Y===9)I+=4-(I+g[l])%4;else if(Y===32)I++;else break;i++}const B=i;let R;B>=o?R=1:R=I-S,R>4&&(R=1);const P=S+R,W=e.push("list_item_open","li",1);W.markup=L;const U=[l,0];W.map=U,u&&(W.info=f-r-1===1?Pq[p.charCodeAt(r)-48]:p.slice(r,f-1));const Z=e.tight,z=e.tShift[l],ee=e.sCount[l],de=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=P,e.tight=!0,e.tShift[l]=B-h[l],e.sCount[l]=I,B>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||x)&&(a=!1),x=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=de,e.tShift[l]=z,e.sCount[l]=ee,e.tight=Z,e.push("list_item_close","li",-1).markup=L,l=e.line,U[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let J=!1;for(let Y=0,X=T.length;Y<X;Y++)if(T[Y](e,l,n,!0)){J=!0;break}if(J)break;if(u){if(f=H_(e,l),f<0)break;r=h[l]+m[l]}else if(f=P_(e,l),f<0)break;if(A!==p.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&&Hq(e,E),!0}function W_(e){return e===9||e===32}function zq(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=n6(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 A=i.charCodeAt(v);if(A===42||A===45||A===43){if(v+1>=y||W_(i.charCodeAt(v+1)))break}else if(A>=48&&A<=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||W_(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const _=r[f]+l[f],k=a[f];if(d&&!s6(e,f,i,_,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 p=e.getLines(t,f,u,!1).trim();e.line=f;const h=e.push("paragraph_open","p",1);h.map=[t,e.line];const m=e.push("inline","",0);return m.content=p,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function Sf(e){switch(e){case 9:case 32:return!0}return!1}function Uq(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 A=!1;if(e.sCount[v]-e.blkIndent>3&&(A=!0),e.sCount[v]<0&&(A=!0),!A){const x=e.parentType;e.parentType="reference";let E=!1;for(let T=0,F=l.length;T<F;T++)if(l[T](e,v,y,!0)){E=!0;break}if(e.parentType=x,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(!Sf(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 p=o,h=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(!Sf(v))break}let _=e.md.helpers.parseLinkTitle(c,o,i);for(;_.can_continue;){const v=a(r);if(v===null)break;c+=v,o=i,i=c.length,r++,_=e.md.helpers.parseLinkTitle(c,o,i,_)}let k;for(o<i&&m!==o&&_.ok?(k=_.str,o=_.pos):(k="",o=p,r=h);o<i&&Sf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&k)for(k="",o=p,r=h;o<i&&Sf(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const g=tm(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 G1(e){switch(e){case 9:case 32:return!0}return!1}const jq=65536;function Y1(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function qq(e,t){if(e.lineFlags)return(e.lineFlags[t]&Ou.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 z_(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 Vq(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&&!G1(l)||r===45&&G1(l)||!qq(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!G1(y))return!1;i++}let a=Y1(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const A=c[y].trim();if(!A){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=Y1(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=z_(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 p=e.md.block.ruler.getRulesForState(e,"blockquote"),h=e.push("table_open","table",1),m=[t,0];h.map=m;const _=e.push("thead_open","thead",1);_.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 A=e.push("th_open","th",1);u[y]&&(A.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,$=p.length;L<$;L++)if(p[L](e,o,n,!0)){y=!0;break}if(y||(a=Y1(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=z_(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>jq))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=g=[t+2,0]}const A=e.push("tr_open","tr",1);A.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 x=e.push("inline","",0);x.content=c[L]?c[L].trim():"",x.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 Kq=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 wc(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 Cf=[["table",Vq,["paragraph","reference"]],["code",Tq],["fence",Nq,["paragraph","reference","blockquote","list"]],["blockquote",Eq,["paragraph","reference","blockquote","list"]],["hr",Lq,["paragraph","reference","blockquote","list"]],["list",Wq,["paragraph","reference","blockquote"]],["reference",Uq],["html_block",Fq,["paragraph","reference","blockquote"]],["heading",Iq,["paragraph","reference","blockquote"]],["lheading",Bq],["paragraph",zq]];var Gq=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Kq;for(let e=0;e<Cf.length;e++)this.ruler.push(Cf[e][0],Cf[e][1],{alt:(Cf[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 p=e.line;let h=!1;for(let m=0;m<o;m++)if(h=s[m](e,u,n,!1),h){if(p>=e.line)throw new Error("block rule didn't increment state.line");break}if(!h)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 p=e.line;let h=!1;for(let m=0;m<o;m++){const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();h=f[m].fn(e,u,n,!1);const k=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(wc(e.env,"block",f[m].name,k-_,h,!1),h){if(p>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!h)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 t6(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}},i6=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}};i6.prototype.Token=ms;const U_=[["normalize",fq],["block",cj],["inline",sq],["linkify",cq],["replacements",kq],["smartquotes",wq],["text_join",Sq]],Yq={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Zq={parseLinkLabel:By,parseLinkDestination:Ry,parseLinkTitle:Dy};function Qq(){return{...Yq}}function Xq(){return{...Zq}}var Jq=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Gq,this.inline=new nq,this.ruler=new bq;for(let e=0;e<U_.length;e++){const[t,n]=U_[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:Qq(),helpers:Xq(),normalizeLink:JA,normalizeLinkText:e6,validateLink:XA,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new FA),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 i6(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();wc(e.env,"core",t[n].name,o-s,!0,!1)}eq(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&aj(e))return this.parse(DA(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 eV=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function jh(e){return!eV.test(e)}function Au(e,t){const n=e.indexOf(`
101
+ `,t);return n===-1?e.length:n}function Yf(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 Z1(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function tV(e){if(e.length>3)return jh(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 nV=["","h1","h2","h3","h4","h5","h6"],sV=["","#","##","###","####","#####","######"],q_=0,Q1=1,X1=2;function Wo(e,t,n,s){const o=new ms(e,t,n);return o.level=s,o.block=!0,o}function r6(e,t,n){const s=Wo("inline","",0,n);s.map=[t,t+1],s.content=e;const o=new ms("text","",0);return o.content=e,s.children=[o],s}function oV(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(!jh(u))return!1;const d=nV[i],f=sV[i],p=Wo("heading_open",d,1,0);p.map=[o,o+1],p.markup=f,e.push(p),e.push(r6(u,o,1));const h=Wo("heading_close",d,-1,0);return h.markup=f,e.push(h),!0}function iV(e,t,n){const s=Wo("paragraph_open","p",1,0);s.map=[n,n+1],e.push(s),e.push(r6(t,n,1)),e.push(Wo("paragraph_close","p",-1,0))}function rV(e,t,n){const s=e.charCodeAt(n-1);return s===32||s===9?e.slice(t,n).trim():e.slice(t,n)}function J1(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function lV(e,t){const n=Wo("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function aV(e,t,n){const s=Wo("list_item_open","li",1,1);s.map=[n,n+1],s.markup="-",e.push(s);const o=Wo("paragraph_open","p",1,2);o.map=[n,n+1],o.hidden=!0,e.push(o);const i=Wo("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new ms("text","",0);r.content=t,i.children=[r],e.push(i);const l=Wo("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Wo("list_item_close","li",-1,1);return a.markup="-",e.push(a),s}function cV(e){const t=Wo("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function uV(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=Au(e,l);if(j_(e,l,c)&&Yf(e,l+3,c)){const u=Wo("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 dV(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?q_:X1,s="",o=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Au(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(!Yf(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!oV(t,e,r,a,l))return null;const p=a<e.length?a+1:a;r=J1(e,p),l+=1+r-p;continue}if(c===45){if(!Z1(e,r,a))return null;const p=l;let h=r,m=l,_=null,k=null;for(;h<e.length;){const y=Au(e,h);if(!Z1(e,h,y))break;const A=h+2,L=y===A+1?e[A]:e.slice(A,y);if(!tV(L))return null;_===null&&(_=lV(t,p)),k=aV(t,L,m),h=y<e.length?y+1:y,m++}if(_===null||k===null)return null;let g=h,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=Au(e,g);if(!Yf(e,g,y)){if(Z1(e,g,y))return null;break}g=y<e.length?y+1:y,v++}_.map[1]=v,k.map[1]=v,cV(t),r=g,l=v;continue}if(c===96){const p=uV(e,r,a,l);if(!p)return null;t.push(p.token),r=J1(e,p.nextPos),l=p.nextLine+r-p.nextPos;continue}const u=rV(e,r,a);let d;if(n===X1?d=jh(u):n===Q1&&u===s?d=o:(d=jh(u),n===q_?(i&&(n=u===s?Q1:X1),s=u,o=d,i=!0):n===Q1&&(s=u,o=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!Yf(e,f,Au(e,f)))return null;iV(t,u,l),r=J1(e,f),l+=1+r-f}return t}const fV=/[&<>"]/,V_=/[&<>"]/g,hV=/&/g,pV=/[<>"]/g,mV={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function e0(e){return mV[e]||e}function Ln(e){if(e.length===0)return"";if(e.length<32)return fV.test(e)?e.replace(V_,e0):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(hV,"&amp;"):t?e.replace(V_,e0):e.replace(pV,e0)}const gV=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),vV=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function l6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(gV,(t,n,s)=>{if(n)return n;if(vV.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return nm(i)?fd(i):"�"}const o=My(t);return o!==t?o:t})}const yV=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,kV=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,bV=/"/g;function ac(e,t){const n=e.indexOf(`
102
+ `,t);return n===-1?e.length:n}function qh(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 Af(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function xV(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!qh(e,t,ac(e,t))}function K_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function _V(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 kV.test(e)?yV.test(e)?null:e.replace(bV,"&quot;"):e}function wV(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}>
103
+ `}function G_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function SV(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
104
+ `;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>
105
+ `}function CV(e,t,n){const s=t+2;if(n===s+1)return SV(e,s);const o=zy(e.slice(t+2,n));return o===null?null:`<li>${o}</li>
106
+ `}function AV(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 MV(e,t,n,s){if(!K_(e,t,n))return null;const o=AV(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=ac(e,l);if(K_(e,l,a)&&qh(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-${Ln(o)}">`:"<pre><code>",s.lang=o,s.open=u),{html:`${u}${Ln(c)}</code></pre>
107
+ `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function Y_(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=ac(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!qh(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=wV(e,t,u);if(m===null)return null;s?o.push(m):n+=m,t=Af(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=ac(e,m);if(!G_(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const _=e.slice(t,m);let k;if(_===r)k=l;else{let v=t;for(k=`<ul>
108
+ `;v<m;){const y=ac(e,v),A=CV(e,v,y);if(A===null)return null;k+=A,v=y<e.length?y+1:y}k+=`</ul>
109
+ `,r=_,l=k}let g=Af(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=ac(e,g);if(!qh(e,g,v)){if(G_(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=MV(e,t,u,i);if(!m)return null;s?o.push(m.html):n+=m.html,t=Af(e,m.nextPos);continue}const f=_V(e,t,u);let p;if(f===a)p=c;else{const m=zy(f);if(m===null)return null;p=`<p>${m}</p>
110
+ `,a=f,c=p}const h=u<e.length?u+1:u;if(h<e.length&&e.charCodeAt(h)!==10&&xV(e,h))return null;s?o.push(p):n+=p,t=Af(e,h)}return s?o.join(""):n}const EV={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Vh(e,t,n={},s){to(n);const o={...EV,...s||{}},i=ko(t);if(o.fallbackOnGlobalState!==!1&&i)return K1(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),_c(n,i,()=>e.core.parse(t,n,e).tokens);let r=Zf(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=$V(r,o.maxChunks)),Qf(t,r))return K1(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),_c(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return K1(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),_c(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&&NV(f,l),IV(a,f),l+=u.lineCount}return a})}function Zf(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 p=e.indexOf(`
111
+ `,f),h=p;p===-1?(p=e.length,h=e.length):h=p+1;const m=LV(e,f,p);if(t.fenceAware){let g=f;for(;g<p;){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<p&&e[y]===v;)y++;const A=y-g;A>=3&&(u?u.marker===v&&A>=u.length&&(u=null):u={marker:v,length:A})}}const _=h-f;o+=_,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=_);const k=m;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(k)d(h);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(h)}f=h}return n&&d(e.length),s}function Qf(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!TV(e,t[o].end))return!0;return!1}function TV(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 NV(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 IV(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function $V(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 LV(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 a6=4e6,c6=8e4,FV=1e4,OV=200,RV=1e4,BV=200;function u6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function DV(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 qr(e){return e.length===0?0:es(e)+(e.charCodeAt(e.length-1)===10?0:1)}function PV(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 HV(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
112
+ `,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 WV(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 PV(e,n+1,e.length-1)?!HV(e,t):!1}function zV(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??RV:e.options.fullChunkSizeChars??FV),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??BV:e.options.fullChunkSizeLines??OV);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 Id=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=qr(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=Zf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(Qf(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,qr(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!WV(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,qr(this.pending)),null;const n=Zf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,qr(this.pending)),null;const s=Qf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:qr(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=Zf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=Qf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:qr(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:qr(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+qr(this.pending);return zV(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Nd(e)&&Nr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=ko(t);n&&(Fy(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&&DV(r,a),this.options.retainTokens!==!1&&u6(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&&Oy(t),n}catch(s){throw this.markedGlobalStateReason&&(Nr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){IA(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 UV(e,t,n={},s={}){to(n);const o=new Id(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function jV(e,t,n={},s={}){to(n);const o=new Id(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function qV(e,t,n,s={},o={}){to(s);const i=new Id(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 VV(e,t,n,s={},o={}){to(s);const i=new Id(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 d6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??a6,o=e.options.autoUnboundedThresholdLines??c6;return t>=s||n>=o}function f6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??a6))return"yes";const s=e.options.autoUnboundedThresholdLines??c6;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function Ru(e,t,n={},s={}){to(n);const o=ko(t);if(Nd(n)&&Nr(n),s.fallbackOnGlobalState!==!1&&o)return IA(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:es(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),_c(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Id(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){u6(i,l)}});if(o&&Fy(n,o),r.feed(t),r.flushForce(n),o&&(Oy(n),s.fallbackOnGlobalState===!1)){const l=ur(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const Sc=(e,t,n)=>e<t?t:e>n?n:e;function h6(e){return e.experimental?{...e,...e.experimental}:e}const Z_=[{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"}],Q_=[{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 p6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function KV(e,t=Math.max(0,e/40|0),n={}){const s=h6(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<Z_.length;l++){const a=Z_[l];if(e<=a.max){if(a.strategy!=="adaptive")return p6(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Sc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Sc(Math.ceil(t/i),150,700),maxChunks:Sc(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 X_(e,t=Math.max(0,e/40|0),n={}){const s=h6(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<Q_.length;l++){const a=Q_[l];if(e<=a.max){if(a.strategy!=="adaptive")return p6(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Sc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Sc(Math.ceil(t/i),150,700),maxChunks:Sc(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 GV={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"]}}},YV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},ZV={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 rm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Xf(e,t){if(rm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const J_=e=>rm(e)?e:Promise.resolve(e);function Bu(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 Ln(e)}}function yl(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Bu(t[0])}="${Ln(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Bu(o[0])}="${Ln(o[1])}"`}return n}function m6(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 Du(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
113
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Ln(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
114
+ `;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${yl(r)}>${t}</code></pre>
115
+ `}return`<pre><code${yl(e.attrs)}>${t}</code></pre>
116
+ `}function Kh(e){return!e.attrs||e.attrs.length===0?`<code>${Ln(e.content)}</code>`:`<code${yl(e.attrs)}>${Ln(e.content)}</code>`}function jg(e){const t=Ln(e.content);return e.attrs?`<pre${yl(e.attrs)}><code>${t}</code></pre>
117
+ `:`<pre><code>${t}</code></pre>
118
+ `}function QV(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="${Ln(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Ln(n[0][1])}">`}return null}function ew(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Bu(t[0][0])}="${Ln(t[0][1])}">`:t.length===2?`<a ${Bu(t[0][0])}="${Ln(t[0][1])}" ${Bu(t[1][0])}="${Ln(t[1][1])}">`:`<a${yl(t)}>`}function XV(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 tw(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 Gh(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+yl(n);return s===0&&t&&(i+=" /"),`${i}>`}const JV={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Mf=Object.prototype.hasOwnProperty,Nn={code_inline(e,t){return Kh(e[t])},code_block(e,t){return jg(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?l6(i.info).trim():"",{langName:l,langAttrs:a}=m6(r),c=n.highlight,u=Ln(i.content);if(!c)return Du(i,u,r,l,n);const d=c(i.content,l,a);return rm(d)?d.then(f=>Du(i,f||u,r,l,n)):Du(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]],Gh(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
119
+ `:`<br>
120
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
121
+ `:`<br>
122
+ `:`
123
+ `},text(e,t){return Ln(e[t].content)},text_special(e,t){return Ln(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function nw(e,t,n){const s=e.info?l6(e.info).trim():"",{langName:o,langAttrs:i}=m6(s),r=t.highlight,l=Ln(e.content);if(!r)return Du(e,l,s,o,t);const a=r(e.content,o,i);if(rm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Du(e,a||l,s,o,t)}function Ef(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===Nn.text)return l.content.length===0?"":Ln(l.content);break;case"text_special":if(o.text_special===Nn.text_special)return l.content.length===0?"":Ln(l.content);break;case"softbreak":if(o.softbreak===Nn.softbreak)return r;break;case"hardbreak":if(o.hardbreak===Nn.hardbreak)return i;break;case"html_inline":if(o.html_inline===Nn.html_inline)return l.content;break;case"code_inline":if(o.code_inline===Nn.code_inline)return Kh(l);break}const a=o[l.type];if(!a)return Gh(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Xf(c,l.type)}var eK=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Nn}}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,p="",h="",m=!1,_="";for(let k=0;k<e.length;k++){const g=e[k],v=g.type,y=k>0&&e[k-1].hidden?`
124
+ `:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&k+3<e.length){const $=e[k+1],x=e[k+2],E=e[k+3];if($.type==="paragraph_open"&&$.hidden&&x.type==="inline"&&E.type==="paragraph_close"&&E.hidden){_+=`${y}<li>${this.renderInlineTokens(x.children||[],s,o)}`,k+=3;continue}}if(k+2<e.length){const $=e[k+1],x=e[k+2];if($.type==="inline"&&x.nesting===-1&&x.tag===g.tag&&!x.hidden){const E=QV(g,y);if(E!==null){_+=`${E+this.renderInlineTokens($.children||[],s,o)}</${g.tag}>
125
+ `,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,p=s.xhtmlOut?`<br />
126
+ `:`<br>
127
+ `,h=s.breaks?p:`
128
+ `,m=!0);const x=$[0];switch(x.type){case"text":if(l===Nn.text){_+=Ln(x.content);continue}break;case"text_special":if(a===Nn.text_special){_+=Ln(x.content);continue}break;case"softbreak":if(c===Nn.softbreak){_+=h;continue}break;case"hardbreak":if(u===Nn.hardbreak){_+=p;continue}break;case"html_inline":if(d===Nn.html_inline){_+=x.content;continue}break;case"code_inline":if(f===Nn.code_inline){_+=Kh(x);continue}break}}_+=this.renderInlineTokens($,s,o);continue}const A=i[v];if(!A){const $=g.attrs;if(!g.hidden){if(!$||$.length===0)switch(v){case"hr":_+=r?`<hr />
129
+ `:`<hr>
130
+ `;continue;case"heading_open":_+=`<${g.tag}>`;continue;case"heading_close":_+=`</${g.tag}>
131
+ `;continue;case"paragraph_open":_+=`${y}<p>`;continue;case"paragraph_close":_+=`</p>
132
+ `;continue;case"list_item_open":{const x=e[k+1];_+=y+(x&&(x.type==="inline"||x.hidden||x.nesting===-1&&x.tag==="li")?"<li>":`<li>
133
+ `);continue}case"list_item_close":_+=`</li>
134
+ `;continue;case"bullet_list_open":_+=`${y}<ul>
135
+ `;continue;case"bullet_list_close":_+=`</ul>
136
+ `;continue;case"blockquote_open":_+=y+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"<blockquote>":`<blockquote>
137
+ `);continue;case"blockquote_close":_+=`</blockquote>
138
+ `;continue;case"ordered_list_open":_+=`${y}<ol>
139
+ `;continue;case"ordered_list_close":_+=`</ol>
140
+ `;continue;case"table_open":_+=`${y}<table>
141
+ `;continue;case"table_close":_+=`</table>
142
+ `;continue;case"thead_open":_+=`${y}<thead>
143
+ `;continue;case"thead_close":_+=`</thead>
144
+ `;continue;case"tbody_open":_+=`${y}<tbody>
145
+ `;continue;case"tbody_close":_+=`</tbody>
146
+ `;continue;case"tr_open":_+=`${y}<tr>
147
+ `;continue;case"tr_close":_+=`</tr>
148
+ `;continue;case"td_open":_+=`${y}<td>`;continue;case"td_close":_+=`</td>
149
+ `;continue;case"th_open":_+=`${y}<th>`;continue;case"th_close":_+=`</th>
150
+ `;continue}else if($.length===1){const x=$[0];if(v==="ordered_list_open"&&x[0]==="start"){_+=`${y}<ol start="${Ln(x[1])}">
151
+ `;continue}if(v==="td_open"&&x[0]==="style"){_+=`${y}<td style="${Ln(x[1])}">`;continue}if(v==="th_open"&&x[0]==="style"){_+=`${y}<th style="${Ln(x[1])}">`;continue}}}_+=this.renderToken(e,k,s);continue}if(v==="code_block"&&A===Nn.code_block){_+=jg(g);continue}if(v==="fence"&&A===Nn.fence){_+=nw(g,s);continue}if(v==="html_block"&&A===Nn.html_block){_+=g.content;continue}const L=A(e,k,s,o,this);typeof L=="string"?_+=L:_+=Xf(L,g.type)}return _}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await J_(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 yl(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?`
152
+ `:"",u=a?`>
153
+ `:">";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+yl(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(Mf.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),Mf.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(Mf.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(Mf.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...JV,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===Nn.code_block)return jg(t);if(i==="html_block"&&o.html_block===Nn.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):Gh(t,r.xhtmlOut===!0);if(i==="fence"&&a===Nn.fence)return nw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Xf(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,f=s.em_open,p=s.em_close,h=s.strong_open,m=s.strong_close,_=t.xhtmlOut===!0,k=_?`<br />
154
+ `:`<br>
155
+ `,g=t.breaks?k:`
156
+ `;if(e.length===1)return Ef(e,t,n,this,s,k,g);let v="";for(let y=0;y<e.length;y++){const A=e[y];if(A.type==="link_open"&&!u&&!d&&y+2<e.length){const x=e[y+1];if(e[y+2].type==="link_close"&&XV(x)){const E=`${ew(A)+Ef([x],t,n,this,s,k,g)}</a>`;if(r===Nn.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=E+g,y+=3;continue}v+=E,y+=2;continue}}if(A.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${ew(A)}</a>`,y+=1;continue}if(A.type==="em_open"&&!f&&!p&&y+2<e.length){const x=e[y+1];if(e[y+2].type==="em_close"&&tw(x)){v+=`<em>${Ef([x],t,n,this,s,k,g)}</em>`,y+=2;continue}}if(A.type==="strong_open"&&!h&&!m&&y+2<e.length){const x=e[y+1];if(e[y+2].type==="strong_close"&&tw(x)){v+=`<strong>${Ef([x],t,n,this,s,k,g)}</strong>`,y+=2;continue}}switch(A.type){case"text":if(o===Nn.text){const x=A.content.length===0?"":Ln(A.content);if(a===Nn.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=x+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=x;continue}break;case"text_special":if(i===Nn.text_special){A.content.length!==0&&(v+=Ln(A.content));continue}break;case"softbreak":if(r===Nn.softbreak){v+=g;continue}break;case"hardbreak":if(l===Nn.hardbreak){v+=k;continue}break;case"html_inline":if(a===Nn.html_inline){for(v+=A.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===Nn.code_inline){v+=Kh(A);continue}break}const L=s[A.type];if(!L){v+=A.block?this.renderToken(e,y,t):Gh(A,_);continue}const $=L(e,y,t,n,this);typeof $=="string"?v+=$:v+=Xf($,A.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 J_(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+=`
157
+ `;break}}return s}},tK=eK;const nK=[],t0=4096;function sK(e){const t=e.length;let n=0;for(;n<=t;){let s=e.indexOf(`
158
+ `,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 oK(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 iK(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(!g6(e[n],t[n]))return!1;return!0}function g6(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||!oK(e.attrs,t.attrs)||!iK(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function sw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var rK=class{core;cache=null;stats=sw();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=sw(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(to(s??o?.env),!o||s&&s!==o.env){const I=s??{},B=!!n.__explicitStreamChunkFallbackSetting,R=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,P=!!n.options?.streamChunkedFallback,W=!B&&R,U=P||W,Z=n.options?.streamChunkAdaptive!==!1,z=n.options?.streamChunkTargetChunks??8,ee=n.options?.streamChunkSizeChars,de=n.options?.streamChunkSizeLines,J=n.options?.streamChunkMaxChunks,Y=!!n.__explicitStreamChunkConfig,X=n.options?.autoTuneChunks!==!1,fe=n.options?.streamChunkFenceAware??!0,ce=n.options?.streamLargeCachePolicy??"retain",We=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,ge=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let G,le=!1;if(ce==="skip"&&(le=e.length>=We,!le&&ge!==void 0&&(G=es(e),le=G>=ge)),le){const j=this.parseFullDocument(e,I,n,G,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",hs(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!ur(I)?.unbounded}),j.tokens}else if(U){const j=(me,Te,Me)=>me<Te?Te:me>Me?Me:me;G===void 0&&(G=es(e));const ne=X&&!Y?X_(e.length,G,n.options):null,ve=ne?.maxChunkChars??(Z?j(Math.ceil(e.length/z),8e3,64e3):ee??1e4),ae=ne?.maxChunkLines??(Z?j(Math.ceil(G/z),150,700):de??200),ye=ne?.maxChunks??(Z?j(Math.ceil(e.length/64e3),z,32):J),q=e.length>0&&e.charCodeAt(e.length-1)===10,se=W&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ne?.strategy!=="plain";if((P||se)&&(e.length>=ve*2||G>=ae*2)&&q){const me=Vh(n,e,I,{maxChunkChars:ve,maxChunkLines:ae,fenceAware:ne?.fenceAware??fe,maxChunks:ye});return this.cache={src:e,tokens:me,env:I,lineCount:G,lastSegment:void 0,globalStateReason:ko(e)},this.updateCacheLineCount(this.cache,G),this.recordChunkedParseResult(I,P?"explicit-initial-large-doc":"default-initial-large-doc"),me}}const he=this.parseFullDocument(e,I,n,G);return G=he.lineCount,this.cache={src:e,tokens:he.tokens,env:I,lineCount:G,lastSegment:void 0,globalStateReason:ko(e)},this.updateCacheLineCount(this.cache,G),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",hs(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!ur(I)?.unbounded}),he.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",hs(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=ko(o.src),o.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(o,i):ko(e),a=r||l;if(a){const I=s??o.env;Nr(I);const B=ko(e),R=this.parseFullDocument(e,I,n),P=R.tokens,W=R.lineCount;return this.cache={src:e,tokens:P,env:I,lineCount:W,lastSegment:void 0,globalStateReason:B},this.updateCacheLineCount(this.cache,W),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",hs(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!ur(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,B=this.parseFullDocument(e,I,n),R=B.tokens,P=B.lineCount;return this.cache={src:e,tokens:R,env:I,lineCount:P,lastSegment:void 0,globalStateReason:ko(e)},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",hs(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!ur(I)?.unbounded}),R}const u=this.getAppendedSegment(o.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(o)){const I=o.lineCount??es(o.src);let B=3;u.length>5e3?B=8:u.length>1e3?B=6:u.length>200&&(B=4),B=Math.min(B,I);let R=null;const P=n.options?.streamContextParseStrategy??"chars",W=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let Z;const z=()=>(Z===void 0&&(Z=es(u)),Z),ee=this.canDirectlyParseAppend(o),de=ee&&this.shouldUseUnboundedAppend(e,o,u);let J=!1;if(!ee)switch(P){case"lines":J=z()>=U;break;case"constructs":if(u.length>=W){J=!0;break}if(sK(u)){J=!0;break}J=z()>=U;break;case"chars":default:J=u.length>=W}if(B>0&&J){const fe=this.getTailLines(o.src,B)+u;try{const ce=this.core.parse(fe,o.env,n).tokens,We=ce.findIndex(ge=>ge.map&&typeof ge.map[1]=="number"&&ge.map[1]>B);if(We!==-1){const ge=ce.slice(We),G=I-B;G!==0&&this.shiftTokenLines(ge,G),R={tokens:ge}}}catch{R=null}}else R=null;if(!R){const fe=I;if(de)R={tokens:Ru(n,u,o.env,{mode:"stream"})},fe>0&&this.shiftTokenLines(R.tokens,fe);else{const ce=this.core.parse(u,o.env,n);fe>0&&this.shiftTokenLines(ce.tokens,fe),R=ce}}let Y=0;if(o.tokens.length>0&&R.tokens.length>0){const fe=o.tokens[o.tokens.length-1],ce=R.tokens[0];try{fe.type==="inline"&&ce.type==="inline"&&(ce.children&&ce.children.length>0&&(fe.children||(fe.children=[]),this.appendTokens(fe.children,ce.children)),fe.content=(fe.content||"")+(ce.content||""),Y=1)}catch{Y=0}}const X=o.tokens.length;if(R.tokens.length>Y){const fe=o.tokens,ce=R.tokens,We=Math.min(fe.length,ce.length-Y);let ge=0;for(let G=We;G>0;G--){let le=!0;for(let he=0;he<G;he++){const j=fe[fe.length-G+he],ne=ce[Y+he];if(!g6(j,ne)){le=!1;break}}if(le){ge=G;break}}ge>0&&(Y+=ge),ce.length>Y&&this.appendTokens(o.tokens,ce,Y)}if(o.src=e,o.globalStateReason=null,o.lineCount=I+(Z??z()),o.tokens.length>X){const fe=this.getLastSegment(o.tokens,e,X,o.tokens.length,e.length-u.length,I);fe?o.lastSegment=fe:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,de&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",hs(o.env,{area:"stream",path:de?"stream-unbounded-append":"stream-append",reason:de?"large-delta":"safe-append",unbounded:de}),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",hs(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const p=!!n.__explicitStreamChunkFallbackSetting,h=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,_=!p&&!u&&h,k=m||_,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,x=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let T=u&&o.lineCount!==void 0?o.lineCount+es(u):void 0;if(k){T===void 0&&(T=es(e));const I=(z,ee,de)=>z<ee?ee:z>de?de:z,B=x&&!$?X_(e.length,T,n.options):null,R=B?.maxChunkChars??(g?I(Math.ceil(e.length/v),8e3,64e3):y??1e4),P=B?.maxChunkLines??(g?I(Math.ceil(T/v),150,700):A??200),W=B?.maxChunks??(g?I(Math.ceil(e.length/64e3),v,32):L),U=e.length>0&&e.charCodeAt(e.length-1)===10,Z=_&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&B?.strategy!=="plain";if((m||Z)&&(e.length>=R*2||T>=P*2)&&U){const z=Vh(n,e,d,{maxChunkChars:R,maxChunkLines:P,fenceAware:B?.fenceAware??E,maxChunks:W});return this.cache={src:e,tokens:z,env:d,lineCount:T,lastSegment:void 0,globalStateReason:ko(e)},this.updateCacheLineCount(this.cache,T),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),z}}const F=this.parseFullDocument(e,d,n,T),S=F.tokens;return T=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:T,lastSegment:void 0,globalStateReason:ko(e)},this.updateCacheLineCount(this.cache,T),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",hs(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!ur(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=ur(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",hs(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!ur(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",hs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=ko(e);Nd(t)&&Nr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?f6(n,e.length,s):"no";if(r==="yes"){const a=Ru(n,e,t);return hs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?es(e):0)}}let l=s;if(r==="need-lines"&&(l=es(e),d6(n,e.length,l))){const a=Ru(n,e,t);return hs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?es(e):0),{tokens:_c(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:es(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
159
+ `))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(`
160
+ `);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+es(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(`
161
+ `,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??nK}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??es(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(-t0))+t,s=ko(n);return e.globalStateCarry=n.length>t0?n.slice(n.length-t0):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(`
162
+ `,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(`
163
+ `,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??es(t.src);f>0&&this.shiftTokenLines(d,f);const p=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),h=this.getListParagraphMode(u,0,u.length,0);(p==="loose"||h==="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+es(i);t.lineCount=m;const _=this.getDocLineCount(e,m);return r.map&&(r.map[1]=_),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),p=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!f||!p||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const h=p.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(h.length===0)return null;const m=o.lineEnd-2;m!==0&&this.shiftTokenLines(h,m);const _=p.tbodyCloseIndex>=0?p.tbodyCloseIndex:p.tableCloseIndex,k=t.lineCount??es(t.src);t.tokens.splice(_,0,...h),t.src=e,t.env=n,t.globalStateReason=null;const g=k+es(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),p.tbodyOpenIndex>=0){const y=t.tokens[p.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(`
164
+ `);if(t<0)return null;const n=e.indexOf(`
165
+ `,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=es(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 ow={default:YV,zero:ZV,commonmark:GV};function lK(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function aK(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 iw(e){return e.experimental?{...e,...e.experimental}:e}function ri(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 rw(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(ri(t,o)||ri(e,o))return!0}return!1}function lw(e,t,n){return ri(t,n)||ri(e,n)}function aw(e,t){const n=ur(e)?.chunk;if(n?.fallback){hs(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}hs(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function cK(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=ow[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=iw(n),typeof n.quotes=="string"){const x=n.quotes;x.length>=4?n.quotes=[x[0],x[1],x[2],x[3]]:n.quotes=["“","”","‘","’"]}let r=rw(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=rw(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=lw(i?.options,o,"fullChunkedFallback"),c=lw(i?.options,o,"streamChunkedFallback"),u=!1,d=null,f=null;const p=new Jq;let h=null;const m=()=>(h||(h=new tK(n)),h);let _=null;const k=()=>(_||(_=new rK(p)),_);let g=null;const v=()=>(g||(g=new FA),g),y=x=>!u&&!!d&&!aK(x,d),A=(x,E)=>s==="default"&&!u&&h===null&&f!==null&&x.parse===f&&y(x)&&!x.stream.enabled&&E<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.xhtmlOut===!1&&x.options.breaks===!1&&x.options.langPrefix==="language-"&&x.options.linkify===!1&&x.options.typographer===!1&&x.options.highlight===null,L=(x,E)=>s==="default"&&!u&&y(x)&&!x.stream.enabled&&!x.options.fullChunkedFallback&&E<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.linkify===!1&&x.options.typographer===!1,$={core:p,block:p.block,inline:p.inline,get linkify(){const x=v();return Object.defineProperty(this,"linkify",{value:x,writable:!0,configurable:!0}),x},get renderer(){const x=m();return Object.defineProperty(this,"renderer",{value:x,writable:!0,configurable:!0}),x},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(x){const E=iw(x);return this.options={...this.options,...E},(ri(x,"fullChunkSizeChars")||ri(x,"fullChunkSizeLines")||ri(x,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ri(x,"streamChunkSizeChars")||ri(x,"streamChunkSizeLines")||ri(x,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ri(x,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ri(x,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),h&&h.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,_&&(_.reset(),_.resetStats())),this},configure(x){const E=typeof x=="string"?ow[x]:x;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const T=E.components;T.core?.rules&&this.core.ruler.enableOnly(T.core.rules),T.block?.rules&&this.block.ruler.enableOnly(T.block.rules),T.inline?.rules&&this.inline.ruler.enableOnly(T.inline.rules),T.inline2?.rules&&this.inline.ruler2.enableOnly(T.inline2.rules)}return this},enable(x,E){const T=Array.isArray(x)?x:[x],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 B=I.enable(T,!0);for(let R=0;R<B.length;R++)S.add(B[R])}if(!E){const I=T.filter(B=>!S.has(B));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(x,E){const T=Array.isArray(x)?x:[x],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 B=I.disable(T,!0);for(let R=0;R<B.length;R++)S.add(B[R])}if(!E){const I=T.filter(B=>!S.has(B));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(x,...E){const T=typeof x=="function"?x:x&&typeof x.default=="function"?x.default:void 0;if(!T)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...E],S=x;return u=!0,T.apply(S,F),this},render(x,E){if(A(this,x.length)){E!==void 0&&to(E);const S=Y_(x);if(S!==null)return E!==void 0&&hs(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const T=E??{},F=this.parse(x,T);return m().render(F,this.options,T)},async renderAsync(x,E){if(A(this,x.length)){E!==void 0&&to(E);const S=Y_(x);if(S!==null)return E!==void 0&&hs(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const T=E??{},F=this.parse(x,T);return m().renderAsync(F,this.options,T)},renderIterable(x,E={}){const T=this.parseIterable(x,E);return m().render(T,this.options,E)},async renderAsyncIterable(x,E={}){const T=await this.parseAsyncIterable(x,E);return m().renderAsync(T,this.options,E)},renderInline(x,E={}){const T=this.parseInline(x,E);return m().render(T,this.options,E)},validateLink:XA,normalizeLink:JA,normalizeLinkText:e6,utils:kU,helpers:{...lj},parse(x,E){if(typeof x!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&to(E),L(this,x.length)){const I=dV(x);if(I!==null)return E!==void 0&&hs(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const T=E??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const I=f6(this,x.length);if(I==="yes"){const B=Ru(this,x,T);return hs(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),B}I==="need-lines"&&(F=es(x))}if(!this.stream.enabled){const I=x.length,B=this.options.autoTuneChunks!==!1,R=r,P=!a&&y(this),W=!!this.options.fullChunkedFallback,U=P&&I>=2e5;let Z;(W||U||F!==void 0)&&(Z=F??es(x));const z=(W||U)&&B&&!R?KV(I,Z,this.options):null;if(W||U){const ee=Z??0;if(W?I>=(this.options.fullChunkThresholdChars??2e4)||ee>=(this.options.fullChunkThresholdLines??400):U){if(z&&z.strategy!=="plain"){const de=Vh(this,x,T,{maxChunkChars:z.maxChunkChars,maxChunkLines:z.maxChunkLines,fenceAware:z.fenceAware,maxChunks:z.maxChunks});return E&&aw(E,W?"explicit-full-chunk":"default-large-string"),de}if(W){const de=(le,he,j)=>le<he?he:le>j?j:le,J=this.options.fullChunkAdaptive!==!1,Y=this.options.fullChunkTargetChunks??8,X=de(Math.ceil(I/Y),8e3,64e3),fe=de(Math.ceil(ee/Y),150,700),ce=J?X:this.options.fullChunkSizeChars??1e4,We=J?fe:this.options.fullChunkSizeLines??200,ge=J?de(Math.ceil(I/64e3),Y,32):this.options.fullChunkMaxChunks,G=Vh(this,x,T,{maxChunkChars:ce,maxChunkLines:We,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:ge});return E&&aw(E,"explicit-full-chunk"),G}}}if(F!==void 0&&y(this)&&d6(this,I,Z??F)){const ee=Ru(this,x,T);return hs(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),ee}}const S=ko(x);return hs(E,{area:"parse",path:"plain",reason:"default-plain"}),_c(T,S,()=>p.parse(x,T,this).tokens)},parseIterable(x,E={}){return to(E),UV(this,x,E)},parseAsyncIterable(x,E={}){return to(E),jV(this,x,E)},parseIterableToSink(x,E,T={}){return to(T),qV(this,x,E,T)},parseAsyncIterableToSink(x,E,T={}){return to(T),VV(this,x,E,T)},parseInline(x,E={}){if(typeof x!="string")throw new TypeError("Input data should be a String");to(E),Nd(E)&&Nr(E);const T=p.createState(x,E,this);return T.inlineMode=!0,p.process(T),T.tokens}};if($.stream={enabled:!!n.stream,parse(x,E){return $.stream.enabled?k().parse(x,E,$):$.parse(x,E??{})},reset(){k().reset()},peek(){return _?_.peek():[]},stats(){return _?_.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){_&&_.resetStats()}},i?.components){const x=i.components;x.core?.rules&&$.core.ruler.enableOnly(x.core.rules),x.block?.rules&&$.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&$.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&$.inline.ruler2.enableOnly(x.inline2.rules)}return d=lK($),f=$.parse,$}var uK=cK;const v6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],dK=["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"],y6=["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"],fK=["svg","g","path"],hK=["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"],pK=["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"],mK=["action","data","href","src","srcset","poster","xlink:href","formaction"],gK=["script"],vK=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],_a=new Set(v6),yK=new Set(y6),pd=new Set([...v6,...dK,...y6,...fK]),k6=new Set([...pd,...hK]),kK=new Set(pK),bK=new Set(mK),$d=new Set(gK),b6=new Set(vK);function x6(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 xK={amp:"&",bsol:"\\",colon:":",newline:`
166
+ `,sol:"/",tab:" "};function _6(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 xK[String(o??"").toLowerCase()]??t})}const Tf=new Set(["http","https","mailto","tel"]),_K=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),jl=new Set(["http","https"]);function w6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function wK(e,t,n){if(!Pu(t,n)||!e.startsWith("file:///"))return!1;const s=e.charAt(8);return s!=="/"&&s!=="\\"}function Pu(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function SK(e,t){return t==="href"||t==="xlink:href"?Pu(e,t)?Tf:jl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?jl:(Pu(e,t),Tf)}function aa(e,t={}){const n=x6(_6(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=w6(n);return i?i==="file"?!wK(n,s,o):Pu(s,o)?_K.has(i):!SK(s,o).has(i):!1}function CK(e){const t=_6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=w6(x6(t).toLowerCase());return n==="http"||n==="https"}function AK(e,t={}){const n=String(e??"").trim();return n?aa(n,t)?"":n:""}function cw(e){return AK(e,{tagName:"img",attrName:"src"})}function MK(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,p,h,m,_){return f[p].nesting===1&&f[p].attrJoin("class",t),_.renderToken(f,p,h,m,_)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(f,p,h,m){let _,k=!1,g=f.bMarks[p]+f.tShift[p],v=f.eMarks[p];if(l!==f.src.charCodeAt(g))return!1;for(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);const y=Math.floor((_-g)/a);if(y<i)return!1;_-=(_-g)%a;const A=f.src.slice(g,_),L=f.src.slice(_,v);if(!c(L,A))return!1;if(m)return!0;let $=p;for(;$++,!($>=h||(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(_=g+1;_<=v&&r[(_-g)%a]===f.src[_];_++);if(!(Math.floor((_-g)/a)<y)&&(_-=(_-g)%a,_=f.skipSpaces(_),!(_<v))){k=!0;break}}const x=f.parentType,E=f.lineMax;f.parentType="container",f.lineMax=$;const T=f.push("container_"+t+"_open","div",1);T.markup=A,T.block=!0,T.info=L,T.map=[p,$],f.md.block.tokenize(f,p+1,$);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,_),F.block=!0,f.parentType=x,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 EK(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let _=0;_<a.length;_++){const k=a[_];if(k==="\\"){_++;continue}if(!u&&k==="'"){c=!c;continue}if(!c&&k==='"'){u=!u;continue}if(!c&&!u&&k===":"){d=_;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),p=a.slice(d+1).trim();if(!f)return null;let h=f;if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{h=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(h))return null;let m;if(!p)m="";else if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{m=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=p}else/^-?\d+(?:\.\d+)?$/.test(p)?m=Number(p):p==="true"||p==="false"?m=p==="true":p==="null"?m=null:m=p;l[h]=m}return l}function TK(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(MK,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
167
+ `}})}),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,p;const h=d.indexOf("{"),m=h>=0?d.slice(h).trimStart():void 0;if(h===-1)f=d||void 0;else{if(f=d.slice(0,h).trim()||void 0,m?.startsWith("{")){let A=0,L=-1;for(let $=0;$<m.length;$++)if(m[$]==="{"?A++:m[$]==="}"&&A--,A===0){L=$+1;break}L>0&&(p=m.slice(0,L))}p||(f=d||void 0)}if(o)return!0;const _=!!i.env.__markstreamFinal;let k=n+1,g=!1;for(;k<=s;){const A=i.bMarks[k]+i.tShift[k],L=i.eMarks[k];if(i.src.slice(A,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&&!_},f&&v.attrSet("data-args",f),p)try{const A=JSON.parse(p);for(const[L,$]of Object.entries(A)){const x=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,x?JSON.stringify($):String($))}}catch{const A=EK(p);if(A)for(const[L,$]of Object.entries(A)){const x=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,x?JSON.stringify($):String($))}else v.attrSet("data-attrs",p)}const y=[];for(let A=n+1;A<k;A++){const L=i.bMarks[A]+i.tShift[A],$=i.eMarks[A];y.push(i.src.slice(L,$))}if(y.some(A=>A.trim().length>0)){let A=y.join(`
168
+ `);A.endsWith(`
169
+ `)||(A+=`
170
+ `),A.endsWith(`
171
+
172
+ `)||(A+=`
173
+ `);const L=i.tokens[i.tokens.length-1];L&&(L.raw=A);const $=[];i.md.block.parse(A,i.md,i.env,$),i.tokens.push(...$)}return g&&i.push("vmr_container_close","div",-1),i.line=g?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Uo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yn(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 lm(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 NK=/^[a-z][a-z0-9_-]*$/;function uw(e){return NK.test(String(e??"").trim().toLowerCase())}function yi(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return uw(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)?"":uw(o)?o:""}function zc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=yi(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function IK(...e){const t=new Set,n=[];for(const s of e)for(const o of zc(s))t.has(o)||(t.add(o),n.push(o));return n}function $K(e){const t=zc(e);return{key:t.join(","),tags:t}}function S6(e){return yi(e)}function LK(e,t){const n=String(e??""),s=yi(t);if(!s)return!1;const o=Uo(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 C6(e,t){const n=yi(t);return!!n&&!pd.has(n)&&!LK(e,n)}function FK(e,t){const n=String(e??""),s=yi(t);if(!s)return n;const o=Uo(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 A6=_a,OK=pd,M6=new Set(yK);M6.delete("details");const RK=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,BK=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,qg=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,DK=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Yh(e){return(e.match(qg)?.[1]??"").toLowerCase()}function Uy(e){return/^\s*<\s*\//.test(e)}function jy(e,t){return A6.has(t)||/\/\s*>\s*$/.test(e)}function PK(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=Yh(i);if(r===t){if(Uy(i)){if(n===0)return s;n--;continue}jy(i,r)||n++}}return-1}function HK(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=Yh(o);if(i===t){if(Uy(o)){n>0&&n--;continue}jy(o,i)||n++}}return n}function dw(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Uo(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 WK(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Uo(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 Zh(e){const t=e;return String(t.raw??t.content??t.markup??"")}function zK(e){const t=e;return t.meta||(t.meta={}),t.meta}function n0(e,t,n){const s=zK(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function UK(e,t){if(!t.size)return;const n=Array.from(t,p=>new RegExp(String.raw`<\s*${Uo(p)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=p=>p?n.some(h=>h.test(p)):!1,r=p=>{if(!(!p||!s.length))for(const h of s)h.raw+=p,h.inner+=p},l=()=>{!s.length||!o||(r(`
174
+ `),o=!1)},a=p=>{r(p)},c=p=>{for(let m=0;m<s.length;m++)s[m].raw+=p,m<s.length-1&&(s[m].inner+=p);const h=s.pop();n0(h.token,h.raw,h.inner)},u=p=>{const h=s[s.length-1]?.tag;if(!h)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Uo(h)}\s*>`,"i");return p.match(m)?.[0]??null},d=p=>!!u(p),f=(p,h,m)=>{const _=m??(p.type==="html_inline"?Yh(h):"");if(!(_&&t.has(_))){r(h);return}const k=Uy(h),g=!k&&jy(h,_);if(k){if(!s.length||s[s.length-1].tag!==_){r(h);return}c(h);return}if(r(h),g){n0(p,h,"");return}s.push({tag:_,token:p,raw:h,inner:""})};for(const p of e){if(p.type==="inline"&&Array.isArray(p.children)){const h=String(p.content??"");if(d(h)?o=!1:l(),!s.length&&!i(h)){o=!1;continue}let m=0,_=!0;for(const k of p.children){const g=Zh(k),v=k.type==="html_inline"?Yh(g):"",y=v&&t.has(v);let A=g;if(_&&h&&g&&(s.length||y)){const L=h.indexOf(g,m);if(L!==-1)a(h.slice(m,L)),A=h.slice(L,L+g.length),m=L+g.length;else{if(s.length&&!y)continue;_=!1}}f(k,A,v)}_&&h&&m<h.length&&s.length&&a(h.slice(m)),o=s.length>0;continue}if(s.length&&typeof p.content=="string"){const h=Zh(p),m=p.type==="html_block"?u(h):null;if(m){c(`${o?`
175
+ `:""}${m}`),o=s.length>0;continue}if(!p.content)continue;l(),r(p.content),o=!0}}for(const p of s)n0(p.token,p.raw,p.inner)}function jK(e){return/^\s*<\s*[!?]/.test(e)}function qK(e){const t=new Set(OK);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 fw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function VK(e,t){let n=null;for(const i of e.matchAll(RK)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();fw(l,t)&&Yn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(BK)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();fw(l,t)&&Yn(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 KK(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function GK(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(KK(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),p=f.match(qg);if(!p){i("<",c),u=d+1;continue}const h=Yn(f);if(h===-1){i("<",c),u=d+1;continue}const m=f.slice(0,h+1),_=(p[1]??"").toLowerCase();t.has(_)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=VK(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+=Zh(a),o=s.buffer;const c=Yn(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=Zh(a),u=(c.match(qg)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Yn(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 YK=["a","span","strong","em","b","i","u"];function ZK(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const p=yi(f);p&&n.add(p)}const s=f=>{const p=f,h=new Set(n),m=Array.isArray(p.env?.__markstreamCustomHtmlTags)?p.env.__markstreamCustomHtmlTags:[];for(const v of m){const y=yi(String(v??""));y&&h.add(y)}const _=qK(Array.from(h)),k=new Set(YK);for(const v of h)k.add(v);return{autoCloseInlineTagSet:k,commonHtmlTags:_,customTagSet:h,shouldMergeHtmlBlockTag:v=>h.has(v)||!_.has(v)||M6.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 p=f.children[0];return p?.type!=="html_block"?"":String(f.content??p.content??"")},i=(f,p)=>{f.type="html_block",f.content=p,f.raw=p,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,p)=>{const h=r(f);if(!/\S/.test(h))return[];if(l(h))return[{type:"code_block",content:a(h),raw:h}];const m=h.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const _={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return p==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},_,{type:"paragraph_close",tag:"p",nesting:-1}]:p==="text"?[{type:"text",content:m,raw:m}]:[_]},u=(f,p,h)=>f[p-1]?.type==="paragraph_open"&&f[p+1]?.type==="paragraph_close"?"inline":h,d=(f,p)=>{const h=r(p);return!/\S/.test(h)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${h}`,f.children.push({type:"text",content:h,raw:h}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const p=f.tokens??[],{commonHtmlTags:h,customTagSet:m}=s(f);for(const _ of p){const k=_;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=GK(v,h);if(k.children=y.children,y.pendingBuffer){const A=g.lastIndexOf(y.pendingBuffer);if(A!==-1){const L=g.slice(0,A);k.content=L,typeof k.raw=="string"&&(k.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}UK(p,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const p=f.tokens??[],{autoCloseInlineTagSet:h,customTagSet:m,shouldMergeHtmlBlockTag:_}=s(f),k=[];for(let g=0;g<p.length;g++){const v=p[g];if(k.length>0){const[A,L]=k[k.length-1];if(g!==L){if(v.type==="paragraph_open"||v.type==="paragraph_close"){p.splice(g,1),g--;continue}const $=String(v.content??v.raw??"");if($){const x=p[L],E=`${String(x.content||"")}
176
+ ${$}`,T=Yn(E),F=T===-1?null:dw(E,A,T+1);if(F){const S=E.slice(0,F.end),I=E.slice(F.end);x.content=S,x.loading=!1,p.splice(g,1),k.pop();const B=d(x,I)?[]:c(I,u(p,g,"paragraph"));B.length&&p.splice(g,0,...B),g--;continue}x.content=E,x.loading!==!1&&(x.loading=!0)}p.splice(g,1),g--;continue}}const y=o(v);if(y){if(jK(y))continue;const A=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!A||!_(A))continue;if(i(v,y),!L)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(y)&&WK(y,A)>0&&k.push([A,g]);else if(k.length>0&&A&&k[k.length-1][0]===A){const[,$]=k[k.length-1],x=p[$];x.content=`${String(x.content||"")}
177
+ ${y}`,x.loading=!1,k.pop(),p.splice(g,1),g--}continue}else if(k.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){p.splice(g,1),g--;continue}const A=v.content||"",L=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(A);if(A){const[,$]=k[k.length-1],x=p[$];x.content=`${x.content||""}
178
+ ${A}`,x.loading!==!1&&(x.loading=!L)}L&&k.pop(),p.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=$=>{let x=g.get($);return x||(x=new RegExp(`<\\s*${$}\\b`,"i"),g.set($,x)),x},A=$=>{let x=v.get($);return x||(x=new RegExp(`<\\s*\\/\\s*${$}\\s*>`,"i"),v.set($,x)),x},L=[];for(let $=0;$<p.length;$++){const x=p[$],E=String(x.content??"");if(L.length>0){const F=L[L.length-1],S=p[F.index],I=x.type==="html_block"?A(F.tag).exec(E):null;if(I){const P=I.index+I[0].length,W=E.slice(0,P),U=E.slice(P);S.content=`${String(S.content??"")}
179
+ ${W}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),L.pop();const Z=d(S,U)?[]:c(U,u(p,$,"paragraph"));Z.length?p.splice($,1,...Z):(p.splice($,1),$--);continue}if(x.type!=="inline")continue;const B=Array.isArray(x.children)?x.children:[],R=PK(B,F.tag);if(R!==-1){const P=B.slice(0,R+1),W=B.slice(R+1),U=P.map(Z=>String(Z?.content??Z?.raw??"")).join("");if(S.content=`${String(S.content??"")}
180
+ ${U}`,Array.isArray(S.children)&&S.children.push(...P),W.length){const Z=W.map(z=>String(z.content??z.raw??"")).join("");if(Z.trim()){const z=Z.replace(/^\s+/,"");if(d(S,Z))p.splice($,1),$--;else if(z.startsWith("<"))p.splice($,1,{type:"html_block",content:z});else{const ee=c(Z,u(p,$,"paragraph"));p.splice($,1,...ee)}}else p.splice($,1),$--}else p.splice($,1),$--;L.pop();continue}S.content=`${String(S.content??"")}
181
+ ${E}`,Array.isArray(S.children)&&S.children.push(...B),p.splice($,1),$--;continue}if(x.type!=="inline")continue;const T=Array.isArray(x.children)?x.children:[];for(const F of m)if((T.length?HK(T,F):y(F).test(E)&&!A(F).test(E)?1:0)>0){L.push({tag:F,index:$});break}}}{let g=0;for(let v=0;v<p.length;v++){const y=p[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(p.splice(v,1),v--))}}for(let g=0;g<p.length;g++){const v=p[g];if(v.type==="html_block"){const x=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(x.startsWith("!")||x.startsWith("?")){v.loading=!1;continue}if(m.has(x)){const R=String(v.content??""),P=Yn(R),W=P===-1?null:dw(R,x,P+1);v.loading=W?!1:v.loading!==void 0?v.loading:!0;const U=W?.start??-1,Z=W?W.end-W.start:0;if(U!==-1){const z=R.slice(0,U+Z);let ee="";P!==-1&&P<U&&(ee=R.slice(P+1,U)),v.children=[{type:x,content:ee,raw:z,attrs:[],tag:x,loading:!1}],v.content=z,v.raw=z;const de=c(R.slice(U+Z)||"","text");de.length&&p.splice(g+1,0,...de)}else v.children=[{type:x,content:"",raw:R,attrs:[],tag:x,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(x))continue;v.type="inline";const E=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let T;for(;(T=E.exec(v.content||""))!==null;)T[1],T[2]||T[3]||T[4];const F=String(v.content??""),S=new RegExp(`<\\/\\s*${x}\\s*>`,"i").exec(F),I=S?S.index:-1,B=S?S[0].length:0;if(I!==-1){const R=F.slice(0,I+B),P=(F.slice(I+B)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:R,tag:x,loading:!1}],v.content=R,v.raw=R,P&&p.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:x,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const x=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=v.children[1],T=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&T===x)continue;h.has(x)?(v.children[0].loading=!0,v.children[0].tag=x,v.children.push({type:"html_inline",tag:x,loading:!0,content:`</${x}>`})):v.children=[{type:"html_block",loading:!0,tag:x,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 x=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(h.has(x))continue;v.children=[{type:"html_block",loading:!1,tag:x,content:v.children.map(E=>E.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),A=v,L=A.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(A.children.length=0);continue}const $=String(L.content??y).match(DK)?.[1]?.toLowerCase()??"";if($){if(/\/\s*>\s*$/.test(y)||A6.has($)){A.children=[{type:"html_inline",content:y}];continue}A.children.length=0}}})}function QK(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 XK(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&&!QK(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 E6=/\.([a-z0-9]{1,15})$/i,JK=/[_()[\]{}<>]/u,eG=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,tG=/[?#@]/u,nG=/[\\/]/u,sG=/^[\p{L}\p{N}./\\-]+$/u,oG=/^[A-Za-z0-9-]{1,63}$/u,iG=/^xn--[a-z0-9-]{2,59}$/i,rG=/^(?:[A-Z]{1,6}|\d{1,8})$/u,lG=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,aG=/文件名\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,cG=/文件名\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,uG=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,dG=new Set(["ai","md","py","rs","sh","zip"]),T6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),fG=new Set([...T6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),hG=new Set(["com","dev","io","page","site"]),pG=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),mG=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 md(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function s0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return md(n)?n:void 0}function hw(e,t){if(!md(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 pw(e){const t=Ld(e);return md(t)?t:void 0}function gG(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function mw(e,t){if(!md(t))return;const n=String(e??"").trim().split(/\s+/u).map(gG).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>Qh(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>Qh(o,{marketTicker:!0}))&&(s.marketTicker=!0),md(s)?s:void 0}function Ml(e,t=!1){let n;return{options(s){return t||s==null?hw(e,n):hw(e,s0(pw(s),mw(s,n)))},remember(s){const o=pw(s);n=t?s0(n,o):s0(o,mw(s,n))},reset(){n=void 0}}}function gw(e){return oG.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function vG(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return gw(n)||iG.test(n)?t.every(gw):!1}function N6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function yG(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function kG(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function I6(e,t,n){const s=yG(t);return N6(e)&&kG(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function Ld(e){const t=String(e??"");return{explicitFilename:aG.test(t),filename:cG.test(t),marketTicker:uG.test(t)}}function bG(e){return vG(e.split(/[\\/]/)[0]??"")}function xG(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function _G(e){if(JK.test(e)||!sG.test(e))return!0;if(nG.test(e))return!bG(e);const t=e.replace(E6,"");return N6(t)?!0:t.split(".").filter(Boolean).some(xG)}function wG(e,t,n){if(!(n?fG:T6).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?lG:rG).test(s)}function Qh(e,t={}){if(!e||eG.test(e)||tG.test(e))return!1;const n=e.match(E6);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return wG(e,s,t.marketTicker===!0)?!0:mG.has(s)?!dG.has(s)||t.filename?!0:_G(e):!!(t.explicitFilename&&hG.has(s)||t.filename&&pG.has(s))}const vw=["!"];function vo(e){return{type:"text",content:e,raw:e}}function ql(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 Vl(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 Vr(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 SG(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(vo(t))}}function yw(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 CG(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function AG(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 MG(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 EG(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=TG(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function TG(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=Ld(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=MG(e,s,i),l=CG(o);if(o.markup==="linkify"&&r&&!I6(r,l,t)&&Qh(r,n)){e.splice(s,i-s+1,vo(r));continue}const a=yw(l,vw);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=yw(u.content,vw);if(d===-1)continue;const f=u.content[d],p=u.content.slice(0,d);let h=u.content.slice(d);for(let k=c+1;k<i;k++){const g=e[k];g?.type==="text"&&typeof g.content=="string"&&(h+=g.content)}u.content=p,u.raw=p;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let _=l;if(a!==-1)_=l.slice(0,a);else if(h){const k=encodeURI(h);if(k&&l.endsWith(k))_=l.slice(0,l.length-k.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(_=l.slice(0,v))}}_!==l&&AG(o,_),h&&e.splice(i+1,0,vo(h));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(vo(r));const c=i[1],u=l[1].length;ql(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(Vr(c,d,!e[s+4]?.content?.startsWith(")"))),Vl(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(vo(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(vo(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let p=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(p+=e[s+4]?.content||"",e[s+4].content=""),ql(a,f),a.push(Vr(c,p,!e[s+4]?.content?.startsWith(")"))),Vl(a,f),e[s+4]?.type==="text"){const h=e[s+4].content?.replace(/^\)/,"");h&&a.push(vo(h)),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(Vr(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(vo(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(Vr(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(vo(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(h=>h[0]==="href")?.[1]||"",a=r.find(h=>h[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const h=d[1].length;ql(f,h)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let h=s+1;h<e.length;h++){const m=d?d[1].length:e[s-3].markup.length,_=e[h];if(m===1&&_.type==="em_close")break;if(m===2&&_.type==="strong_close")break;if(m===3&&(_.type==="em_close"||_.type==="strong_close"))break;c+=1}}const p={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(p),d){const h=d[1].length;Vl(f,h)}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(vo(l)),ql(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(Vr(a,c,u)),Vl(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(vo(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(vo(r)),ql(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(Vr(l,a,c)),Vl(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(vo(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(vo(r)),ql(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(p=>p[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(Vr(a,c,d)),Vl(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=[];ql(a,2),a.push(Vr(r,l,!1)),Vl(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;SG(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function NG(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=IG(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function IG(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 $G(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=LG(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function LG(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 p=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const k=e[_];p==="__"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=p,d.raw=p,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 p=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const k=e[_];p==="_"&&(m?.content?.endsWith("_")||k?.content?.startsWith("_")||k?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=p,d.raw=p,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:""}],p=c.slice(0,-1);p&&f.unshift({type:"text",content:p,raw:p}),l.splice(i,d,...f)}return l=FG(l),l}function FG(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),p=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),p&&t.push({...c,type:"text",content:p,raw:p}),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=OG(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 OG(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 RG(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=zG(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 kw(){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 bw(){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 xw(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 $6(e,t){if(!e.startsWith("|")||e.includes(`
182
+ `)||!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 o0(e){return $6(e)!==null}function L6(e){return/^:?-+:?$/.test(e.trim())}function BG(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(L6)}function DG(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function PG(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(L6)&&DG(n)}function HG(e){return e==="|"||e==="|:"}function WG(e){const t=$6(e);return t!==null&&t.every(n=>!n.includes(":"))}function zG(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(`
183
+ `)[0]??"",[a="",c="",...u]=r.split(`
184
+ `),d=!t&&!r.includes(`
185
+ `)&&/\r?\n$/.test(n)&&o0(r);if(!t&&(r.includes(`
186
+ `)&&u.length===0&&o0(a)&&PG(c)||d)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>xw(h)),p=[...kw(),...f,...bw()];s.splice(o-1,3,...p)}else if(r.includes(`
187
+ `)&&u.length===0&&o0(a)&&BG(c)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>xw(h)),p=[...kw(),...f,...bw()];s.splice(o-1,3,...p)}else r.includes(`
188
+ `)&&u.length===0&&WG(a)&&HG(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function UG(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 jG=UG;const qG=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Xh=qG.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),VG=/\\[a-z]+/i,F6="(?:\\\\|\\u0008)",KG=new RegExp(String.raw`${F6}(?:${Xh})\s*\{[^}]+\}`,"i"),GG=new RegExp(String.raw`(?:${F6})?(?:${Xh})\s*\{`,"i"),YG=/\\(?:text|frac|left|right|times)/,ZG=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,QG=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,XG=/[A-Z]+\s*\([^)]+\)/i,JG=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,eY=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,tY=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,nY={"\b":"\\b","\v":"\\v","\f":"\\f"};function sY(e){let t="";for(const n of e)t+=nY[n]??n;return t}function cc(e){if(!e)return!1;const t=sY(e),n=t.trim();if(tY.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=VG.test(t),o=KG.test(t),i=GG.test(t),r=YG.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=ZG.test(t)&&!QG.test(t),c=XG.test(t),u=JG.test(n),d=eY.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||f||p}const O6="__markstreamMathPluginApplied",Vg=80,R6=2e4,_w=R6+4096;function B6(e){return!!e[O6]}function oY(e){e[O6]=!0}const D6=["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"],iY=["cdot","mathbf{","partial","mu_{"],P6=D6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),H6="[ \r\b\f\v]",rY=new RegExp(`([^\\\\])(${iY.map(e=>e).join("|")})+`,"g"),lY=/span\{([^}]+)\}/,aY=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,cY=/(^|[^\\])\\\r?\n/g,uY=/(^|[^\\])\\$/g,dY=new RegExp(`(${H6})|(${P6})\\b`,"g"),ww=new Map,Sw=new Map;function fY(e){if(!e)return dY;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=ww.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${H6})|(${o})\\b`,"g");return ww.set(n,i),i}function hY(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=Sw.get(s);if(o)return o;const i=e?[Xh,P6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Xh].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Sw.set(s,r),r}const Cw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Aw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Mw(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 Kr(e,t){const n=t?.commands??D6,s=t?.escapeExclamation??!0,o=t?.commands==null,i=fY(o?void 0:n);let r=e.replace(i,(c,u,d,f,p)=>{if(u!==void 0&&Cw[u]!==void 0)return`\\${Cw[u]}`;if(d&&n.includes(d)){const h=p&&typeof f=="number"?p[f-1]:void 0;return h==="\\"||h&&/\w/.test(h)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=hY(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(lY,"span\\{$1\\}").replace(aY,"\\operatorname{span}\\{$1\\}"),l=l.replace(cY,`$1\\\\
189
+ `),l=l.replace(uY,"$1\\\\"),l=l.replace(rY,"$1\\$2"),l}function Ew(e){const t=e.trim();return!(!cc(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 W6(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 Jh(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function pY(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 Fd(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Kg(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(Fd(e,s)){n=s+1;continue}return s}return-1}function i0(e,t){let n=t;for(;n<e.length;){const s=Kg(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 Mu(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(!Fd(e,o))return o;s=o+Math.max(1,t.length)}return-1}function Tw(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=Jh(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Fd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function qy(e,t,n){const s=vd(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!vd(s.slice(0,o)).trim()||Fd(s,o))return-1;const i=W6(s);if(Jh(i,o))return-1;const r=Tw(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Tw(s,n,0,o,i))return-1;return o}function gd(e){return e===" "||e===" "}function vd(e){let t=e.length;for(;t>0&&gd(e[t-1]);)t--;return e.slice(0,t)}function Nw(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
190
+ `&&t++;return t}function Iw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function mY(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(!gd(o))return!1}return n>=3}function gY(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 vY(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(gY)}function yY(e){let t=0;if(!Iw(e[t]))return!1;for(;Iw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:gd(e[t+1])}function z6(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&&gd(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&gd(t[1])||yY(t)||mY(t)||vY(t))}function $w(e,t){return e?t?`${e}
191
+ ${t}`:e:t}function Gg(e){const t=String(e??"").trim();return t?cc(t):!1}function Lw(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function U6(e){if(e.length<=_w)return{source:e,lineOffset:0};let t=e.length-_w;const n=e.indexOf(`
192
+ `,t);return n===-1?{source:"",lineOffset:Nw(e)}:(t=n+1,{source:e.slice(t),lineOffset:Nw(e.slice(0,t))})}function j6(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=U6(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-Vg-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=vd(s[r]);if(l&&!z6(l)){for(const[a,c]of i)if(qy(l,a,c)!==-1)return!0}}return!1}function kY(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=U6(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-Vg-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=vd(o[l]);for(const[c,u]of r){const d=qy(a,c,u);if(d===-1)continue;let f="",p=!1;for(let h=l+1;h<o.length;h++){if(h-l>Vg){p=!0;break}const m=o[h],_=Mu(m,u);if(_!==-1){const k=$w(f,m.slice(0,_));if(!Gg(k)){p=!0;break}const g=m.slice(_+u.length),v=g.trim()?`suffix:${Lw(g)}`:"nosuffix";return["closed",c,s+l,d,s+h,_,Lw(k),v].join(":")}if(z6(m)){p=!0;break}if(f=$w(f,m),f.length>R6){p=!0;break}}if(!p&&Gg(f))return["pending",c,s+l,d].join(":")}}return null}function r0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function bY(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 l0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function xY(e,t){oY(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]===`
193
+ `||g[y]==="\r"&&g[y+1]===`
194
+ `))return v;const A=g.slice(v,y),L=a.push("text","",0);return L.content=A,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,y=a.src[g];if(v>=3&&(!y||/\s/.test(y))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(a.pending??""),h=Math.max(0,a.pos-p.length);let m=h,_=h;const k=h;for(const[g,v]of f){const y=a.src,A=W6(y),L=pY(y,u);let $=!1;g==="$$"&&m!==k&&(m=k);let x=-1,E=-1,T=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 R=a.push("text_special","",0);R.content=S==="\\)"?")":"(",R.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let R=0;for(;R<S.length;){const P=Kg(S,R);if(P===-1){const fe=S.slice(R);if(fe){const ce=a.push("text","",0);ce.content=fe,a.pos=a.pos+fe.length,m=a.pos}break}if(P>0&&S[P-1]==="$"||P+1<S.length&&S[P+1]==="$"){const fe=S.slice(R,P+1);if(fe){const ce=a.push("text","",0);ce.content=fe,a.pos=a.pos+fe.length,m=a.pos}R=P+1;continue}const W=S.slice(R,P);if(W){const fe=a.push("text","",0);fe.content=W,a.pos=a.pos+W.length,m=a.pos}const U=i0(S,P+1);if(U===-1){const fe=S.slice(P),ce=a.push("text","",0);ce.content=fe,a.pos=a.pos+fe.length,m=a.pos;break}const Z=S.slice(P+1,U),z=Z.includes("`"),ee=!Z||!Z.trim(),de=S[U+1],J=r0(Z,de),Y=l0(Z);if(!z&&!ee&&!J&&!Y){const fe=a.push("math_inline","math",0);fe.content=Kr(Z,t),fe.markup="$",fe.raw=`$${Z}$`,fe.loading=!1,a.pos=a.pos+(U-P+1),m=a.pos,R=U+1;continue}const X=a.push("text","",0);X.content="$",a.pos=a.pos+1,m=a.pos,R=P+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const W=S.slice(0,I),U=a.push("text","",0);U.content=W,a.pos=a.pos+W.length,m=a.pos}const R=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(R){const[,W,U]=R,Z=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),z=Z?Z[1]:U,ee=Z&&Z[2]?Z[2]:null,de=a.push("image","img",0);de.attrs=[["src",z],["alt",W]],ee&&de.attrs.push(["title",ee]),de.content=W,de.children=[{type:"text",content:W,tag:""}],a.pos=a.pos+R[0].length,m=a.pos;const J=S.slice(I+R[0].length);J&&F(J);return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,m=a.pos;return}const B=a.push("text","",0);B.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(Fd(y,S)){m=S+Math.max(1,g.length);continue}const I=Jh(A,S);if(I){m=I[1];continue}const B=Jh(L,S);if(B){m=B[1];continue}if(S===x&&m===E){if(T++,T>2){m=S+Math.max(1,g.length);continue}}else T=0,x=S,E=m;if(g==="("&&S>0){let J=S-1;for(;J>=0&&y[J]===" ";)J--;if(J>=0&&y[J]==="]"){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 R=g==="$"?i0(y,S+g.length):jG(y,S+g.length,g,v);if(R===-1){const J=y.slice(S+g.length);if(J.includes(g)){m=y.indexOf(g,S+g.length);continue}if(R===-1){const Y=g==="$"&&bY(J);if(u&&!c&&!Y&&cc(J)&&!J.includes("`")){if(m=S+g.length,$=!0,!l){a.pending="";const X=_?y.slice(_,m):y.slice(0,m),fe=Aw(X)%2===1;if(_)F(y.slice(_,m));else{let ce=y.slice(0,m);ce.endsWith(g)&&(ce=ce.slice(0,ce.length-g.length)),F(ce)}if(fe){const ce=Mw(X)?.marker??"**",We=a.push("strong_open","",0);We.markup=ce;const ge=a.push("math_inline","math",0);ge.content=Kr(J,t),ge.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ge.raw=`${g}${J}${v}`,ge.loading=!0,We.content=J,a.push("strong_close","",0)}else{const ce=a.push("math_inline","math",0);ce.content=Kr(J,t),ce.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ce.raw=`${g}${J}${v}`,ce.loading=!0}a.pos=y.length}m=y.length,_=m}break}}const P=y.slice(S+g.length,R),W=P.includes("`"),U=!P||!P.trim(),Z=g==="$",z=y[R+v.length],ee=Z&&r0(P,z),de=Z&&l0(P);if(c?W||U||ee||de:W||U||ee||de||!Z&&!cc(P)){m=R+v.length;const J=y.slice(a.pos,m);a.pending||(F(J),_=m);continue}if($=!0,!l){const J=y.slice(a.pos-(a.pending??"").length,S);let Y=y.slice(0,m)?y.slice(_,S):J;const X=Aw(Y)%2===1;S!==a.pos&&X&&(Y=a.pending+y.slice(a.pos,S));const fe=X?Mw(Y):null,ce=fe?.marker??"**";if(a.pending!==Y)if(a.pending="",X)if(fe){const We=Y.slice(fe.index+ce.length);F(Y.slice(0,fe.index));const ge=a.push("strong_open","",0);ge.markup=ce;const G=a.push("text","",0);G.content=We,a.push("strong_close","",0)}else F(Y);else F(Y);if(X){const We=a.push("strong_open","",0);We.markup=ce;const ge=a.push("math_inline","math",0);ge.content=Kr(P,t),ge.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ge.raw=`${g}${P}${v}`,ge.loading=!1;const G=y.slice(R+v.length).startsWith(ce);return G&&a.push("strong_close","",0),a.pos=d(y,R+v.length),m=a.pos,_=m,G||a.push("strong_close","",0),!0}else{const We=a.push("math_inline","math",0);We.content=Kr(P,t),We.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",We.raw=`${g}${P}${v}`,We.loading=!1}}return m=d(y,R+v.length),_=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=Kg(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 B=i0(y,I+1);if(B===-1)break;const R=y.slice(I+1,B),P=R.includes("`"),W=!R||!R.trim(),U=y[B+1],Z=r0(R,U),z=l0(R);if(!P&&!W&&!Z&&!z){const ee=y.slice(m,I);ee&&F(ee);const de=a.push("math_inline","math",0);de.content=Kr(R,t),de.markup="$",de.raw=`$${R}$`,de.loading=!1,m=B+1,S=B+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,p=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],h=u.bMarks[l]+u.tShift[l];let m=u.src.slice(h,u.eMarks[l]).trim(),_=!1,k="",g="",v=!1,y="",A=!1;for(const[ee,de]of p)if(m.startsWith(ee))if(ee.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){_=!0,k=ee,g=de;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){_=!0,k=ee,g=de;break}continue}else{const J=u.tokens[u.tokens.length-1];if(J&&J.type==="list_item_open"&&J.mark==="-"&&m.slice(ee.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const Y=m.indexOf("]");if(m.slice(Y).trim()!=="]")continue;const X=m.slice(ee.length,Y);if(ee==="["?Ew(X):cc(X)){_=!0,k=ee,g=de;break}continue}}else{_=!0,k=ee,g=de;break}else if((ee==="$$"||ee==="\\[")&&m.endsWith(ee)&&l+1<a){const J=qy(m,ee,de);if(J===-1)continue;y=vd(m.slice(0,J)),A=!0;const Y=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(Y,u.eMarks[l+1]).trim(),v=!0,_=!0,k=ee,g=de;break}if(!_)return!1;if(c&&!A)return!0;const L=m.indexOf(k),$=L+k.length,x=!f&&k==="["?m.indexOf("\\]",$):-1,E=x>=0?"\\]":g,T=x>=0?x:Mu(m,g,$);if(!v&&T>k.length){const ee=m.slice(L+k.length,T),de=u.push("math_block","math",0);de.content=Kr(ee),de.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",de.map=[l,l+1],de.raw=`${k}${ee}${E}`,de.block=!0,de.loading=!1,u.line=l+1;const J=m.slice(T+E.length);return J.trim()&&n(u,J,l),!0}let F=l,S="",I=!1,B="",R=l;const P=v?m:m===k?"":m.slice(k.length),W=!f&&k==="\\["?"]":"",U=Mu(P,g);if(U!==-1){const ee=U;S=P.slice(0,ee),B=P.slice(ee+g.length),R=v?l+1:l,I=!0,F=R}else for(P&&!v&&(S=P),F=l+1;F<a;F++){const ee=u.bMarks[F]+u.tShift[F],de=u.eMarks[F],J=u.src.slice(ee,de),Y=J.trim();if(!f&&k==="["&&Y==="\\]"){g="\\]",I=!0;break}if(W&&J.trim()===W){g=W,I=!0;break}if(Y===g){I=!0;break}else if(!f&&k==="["&&J.includes("\\]")){I=!0;const X=J.indexOf("\\]");g="\\]";const fe=J.slice(0,X);fe&&(S+=(S?`
195
+ `:"")+fe),B=J.slice(X+g.length),R=F;break}else if(Mu(J,g)!==-1){I=!0;const X=Mu(J,g),fe=J.slice(0,X);fe&&(S+=(S?`
196
+ `:"")+fe),B=J.slice(X+g.length),R=F;break}S+=(S?`
197
+ `:"")+J}if((!d||f)&&!I)return!1;const Z=/^\s*!\[/.test(S);if(!(A?!Z&&Gg(S):k==="$$"?!Z:k==="["?Ew(S):cc(S)))return!1;if(c)return!0;y&&n(u,y,l);const z=u.push("math_block","math",0);return z.content=Kr(S),z.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",z.raw=`${k}${S}${S.startsWith(`
198
+ `)?`
199
+ `:""}${g}`,z.map=[l,F+1],z.block=!0,z.loading=!I,u.line=F+1,B.trim()&&n(u,B,R),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,c)};e.inline.ruler.before("escape","math",s),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function _Y(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 wY(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 uK({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return o||i.set({validateLink:r=>!aa(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&xY(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&TK(i),e.enableFixIndentedCodeBlock!==!1&&XK(i),EG(i),$G(i),NG(i),RG(i),_Y(i),ZK(i,{customHtmlTags:e.customHtmlTags}),i}function ca(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=>ca(n))),t}function SY(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function CY(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 AY(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Nf(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...Zn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const Fw=/\r?\n[ \t]*`+\s*$/,q6=["diff ","index ","--- ","+++ ","@@ "],MY=/\r?\n/;function EY(e){const t=String(e??"");return t?q6.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function Ow(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function TY(e,t){const n=[],s=[],o=[],i=[],r=e.split(MY),l=/\r?\n$/.test(e),a=r.some(p=>p.startsWith("diff ")||p.startsWith("--- ")||p.startsWith("+++ ")||p.startsWith("@@ ")),c=p=>{const h=p;if(!q6.some(m=>h.startsWith(m)))if(h.startsWith("-")){const m=h.slice(1);o.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(h.startsWith("+")){const m=h.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{Ow(n,s,o,i);const m=a&&h.startsWith(" ")?h.slice(1):h;n.push(m),s.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let p=0;p<u;p++){const h=r[p]??"";!t&&!l&&p===u-1&&EY(h)||c(h)}(t||o.length>0||i.length>0)&&Ow(n,s,o,i);const d=n.join(`
200
+ `),f=s.join(`
201
+ `);return{original:t&&l&&d?`${d}
202
+ `:d,updated:t&&l&&f?`${f}
203
+ `:f}}function Vy(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(Fw.test(a)&&(a=a.replace(Fw,"")),r){const{original:c,updated:u}=TY(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 NY(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function IY(){return{type:"hardbreak",raw:`\\
204
+ `}}function $Y(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(...Zn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let a0=null;const c0=new WeakMap;function Rw(){return a0||(a0={customTagSet:null,allowedTagSet:um()}),a0}function V6(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function K6(e){return/^<\s*\//.test(e)}function G6(e,t){return/\/\s*>\s*$/.test(t)||_a.has(e)}function LY(e){if(!e||e.length===0)return Rw();const t=c0.get(e);if(t)return t;const n=e.map(yi).filter(Boolean);if(!n.length){const o=Rw();return c0.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:um({customHtmlTags:e})};return c0.set(e,s),s}function Y6(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function FY(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function ep(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 OY(e,t,n){const s=e.slice();return ep(s,"href")||s.push(["href",t]),n!=null&&!ep(s,"title")&&s.push(["title",n]),s}function Yg(e){return e.map(Y6).join("")}function Jf(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:Jf(s.children)});continue}t.push(s)}return t}function RY(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=V6(r),a=K6(r),c=G6(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function u0(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?RY(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:Yg(s),innerTokens:o,nextIndex:i}}function BY(e,t,n,s,o,i,r){const l=String(e.content??""),a=V6(l),{customTagSet:c,allowedTagSet:u}=LY(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!u0(t,n,a).closed){const A=Y6(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=K6(l),f=G6(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=u0(t,n,a),L=lm(l),$=A.innerTokens,x=String(ep(L,"href")??""),E=ep(L,"title"),T=E==null?null:String(E),F=OY(L,x,T),S=Jf($.length?s($,o,i,r):[]),I=$.length?Yg($):x||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:x,title:T,text:I,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const p=u0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Jf(p.innerTokens.length?s(p.innerTokens,o,i,r):[]),raw:p.html},p.nextIndex];const h=Jf(p.innerTokens.length?s(p.innerTokens,o,i,r):[]);let m=p.html||l,_=!p.closed,k=!1;if(!p.closed){const A=`</${a}>`;m.toLowerCase().includes(A.toLowerCase())||(m+=A),k=!0,_=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const A=y[1],L=y[2]||y[3]||y[4]||"";g.push([A,L])}if(c?.has(a)){const A=FY(e);return[{type:a,tag:a,attrs:g,content:A?A.inner:p.innerTokens.length?Yg(p.innerTokens):"",children:p.innerTokens.length?s(p.innerTokens,o,i,r):[],raw:A?.raw??m,loading:e.loading||_,autoClosed:k},p.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:h,raw:m,loading:_,autoClosed:k},p.nextIndex]}function Z6(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=>Z6(t)).join(""):String(e.content??"")}function DY(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>Z6(t)).join("")}function Bw(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=DY(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 PY(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function HY(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(...Zn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function WY(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 tp(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 zY(e,t,n){const s=e.slice();return tp(s,"href")||s.push(["href",t]),n!=null&&!tp(s,"title")&&s.push(["title",n]),s}function If(e,t,n){const s=e[t],o=WY(s.attrs),i=String(tp(o,"href")??""),r=tp(o,"title"),l=r==null?null:String(r),a=zY(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 p=u[u.length-1];if(n?.__insideStrong&&p?.type==="text"&&String(p.content??"").endsWith("**")&&!u.some(_=>_.type==="strong_open")){const _=String(p.content??""),k=String(p.raw??_),g=ca(p);g.content=_.slice(0,-2),g.raw=k.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const h=Zn(f,void 0,void 0,n),m=h.map(_=>{const k=_;return"content"in _?String(k.content??""):String(k.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:h,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function Dw(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 UY(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Pw(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(...Zn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const jY=/\\([\\()[\]`$|*_\-!])/g;function qY(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(jY,"$1")===t))return n}function gu(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(...Zn(l,qY(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function VY(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(...Zn(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 KY(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(...Zn(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 GY(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const YY=/[^~]*~{2,}[^~]+/,ZY=/\*\*/,QY=/[[_*^~]/,XY=/\\([\\()[\]`$|*_\-!])/g,Ky=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),JY=/\s/u,eZ=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,tZ=/\p{P}/u,nZ=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,sZ=/:\/\//;function oZ(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 Q6(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&&Ky.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function kl(e){return!!e&&JY.test(e)}function bl(e){return!!e&&(eZ.test(e)||tZ.test(e))}function iZ(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||kl(s)?!1:!(bl(s)&&n&&!kl(n)&&!bl(n))}function rZ(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||kl(n)?!1:!(bl(n)&&s&&!kl(s)&&!bl(s))}function lZ(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?Q6(e,s):t.indexOf("*",s);if(i===-1)break;if(rZ(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function aZ(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||kl(s)?!1:!(bl(s)&&n&&!kl(n)&&!bl(n))}function cZ(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||kl(n)?!1:!(bl(n)&&s&&!kl(s)&&!bl(s))}function uZ(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(cZ(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function dZ(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&&Ky.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function fZ(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&Ky.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function hZ(e,t,n){const s=fZ(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 pZ=/[\p{L}\p{N}]/u,mZ=/^[\p{L}\p{N}]+$/u;function Zg(e){return e?pZ.test(e):!1}function X6(e){return e?mZ.test(e):!1}function Hu(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:Zg(s)&&Zg(o)}}function gZ(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=Hu(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(!X6(e.slice(s.end,o.start)))return o.end}return-1}function vZ(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function yZ(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=Hu(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function kZ(e){return e?nZ.test(e)||sZ.test(e):!1}function bZ(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Zn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=Ld(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 p(){return e===f&&(e=e.slice()),e}function h(){c=null}function m(G,le){const he=e.length===1?t:String(le.content??""),j=[],ne=gZ(G);if(ne!==-1){A(G.slice(0,ne),G.slice(0,ne));const ae=G.slice(ne);return ae&&(T({type:"text",content:ae,raw:ae}),u--),u++,!0}if(YY.test(G)){const ae=G.indexOf("~~");ae!==-1&&j.push({type:"strikethrough",index:ae})}if(ZY.test(G)){const ae=G.indexOf("**");ae!==-1&&j.push({type:"strong",index:ae})}if(/[^*]*\*[^*]+/.test(G)){const ae=he?Q6(he,0):G.indexOf("*");if(he&&ae===-1)return!1;ae!==-1&&j.push({type:"emphasis",index:ae})}j.sort((ae,ye)=>ae.index!==ye.index?ae.index-ye.index:ae.type===ye.type?0:ae.type==="strong"?-1:ye.type==="strong"?1:0);const ve=j[0];if(!ve)return!1;if(ve.type==="strikethrough"){const ae=ve.index,ye=ae>-1?G.slice(0,ae):"";if(ye&&A(ye,ye),ae===-1)return u++,!0;const q=G.indexOf("~~",ae+2),se=q===-1?G.slice(ae+2):G.slice(ae+2,q),me=q===-1?"":G.slice(q+2),{node:Te}=Pw([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:se,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return h(),y(Te),me&&(T({type:"text",content:me,raw:me}),u--),u++,!0}if(ve.type==="strong"){const ae=ve.index,ye=ae>-1?G.slice(0,ae):"";if(ye&&A(ye,ye),ae===-1)return u++,!0;if(t&&ae===0){let $e=!1,pe=0;for(;pe<G.length&&G[pe]==="*";)pe++;if(t.startsWith("\\*")&&($e=!0),$e){let Ie=0,Qe=0;for(;Qe<t.length&&Ie<pe;)if(t[Qe]==="\\"&&Qe+1<t.length&&t[Qe+1]==="*")Ie+=1,Qe+=2;else{if(t[Qe]==="*")break;Qe++}if(Ie>=2)return A(G,G),u++,!0}}if(t&&(G.match(/\*/g)||[]).length>oZ(t))return A(G.slice(ye.length),G.slice(ye.length)),u++,!0;const q=Hu(G,ae);if(q.len>=3){const $e=yZ(G,ae+q.len);if($e!==-1){const pe=G.slice(ae+q.len,$e);if(vZ(pe)){const{node:Ie}=gu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe,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);h(),y(Ie);const Qe=G.slice($e+3);return Qe&&(T({type:"text",content:Qe,raw:Qe}),u--),u++,!0}}}if(!aZ(G,ae)){const $e=G.slice(ae,ae+q.len);A($e,$e);const pe=G.slice(ae+q.len);return pe&&(T({type:"text",content:pe,raw:pe}),u--),u++,!0}const se=uZ(G,ae+2);let me="",Te="";if(se.index!==-1){me=G.slice(ae+2,se.index),Te=G.slice(se.index+2);const $e=se.index,pe=Hu(G,$e);if(q.intraword&&pe.intraword&&!X6(me)||!me&&q.len>=4&&q.intraword)return A(G.slice(ye.length),G.slice(ye.length)),u++,!0}else{if(d||se.sawInvalidClose||q.intraword)return A(G.slice(ye.length),G.slice(ye.length)),u++,!0;me=G.slice(ae+2),Te=""}if(!me&&/^\*+$/.test(Te))return A(G,G),u++,!0;const{node:Me}=gu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:me,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return h(),y(Me),Te&&(T({type:"text",content:Te,raw:Te}),u--),u++,!0}if(ve.type==="emphasis"){let ae=ve.index;ae===-1&&(ae=0);const ye=G.slice(0,ae);if(ye&&A(ye,ye),!iZ(G,ae)){A(G[ae],G[ae]);const $e=G.slice(ae+1);return $e&&(T({type:"text",content:$e,raw:$e}),u--),u++,!0}const q=Hu(G,ae),se=lZ(he,G,ae+1),me=se.index,Te=e[u+1];if(s?.final&&Te?.type==="em_open"&&me!==-1&&G.slice(ae+1,me).trim()!==G.slice(ae+1,me)||me===-1&&(se.sawInvalidClose||s?.final||q.intraword||!Zg(G[ae+1])))return A(G.slice(ae),G.slice(ae)),u++,!0;const{node:Me}=Nf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:me>-1?G.slice(ae+1,me):G.slice(ae+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(h(),y(Me),me!==-1&&me<G.length-1){const $e=G.slice(me+1);$e&&(T({type:"text",content:$e,raw:$e}),u--)}return u++,!0}return!1}function _(G,le){if(!G.includes("`"))return!1;const j=(Te=>{for(let Me=0;Me<Te.length;Me++){if(Te[Me]!=="`")continue;let $e=0;for(let pe=Me-1;pe>=0&&Te[pe]==="\\";pe--)$e++;if($e%2===0)return Me}return-1})(G);if(j===-1)return!1;let ne=1;for(let Te=j+1;Te<G.length&&G[Te]==="`";Te++)ne++;const ve="`".repeat(ne),ae=j+ne,ye=G.indexOf(ve,ae);if(ye===-1){if(ne===1){const Me=G.slice(0,j),$e=G.slice(j+1);return Me&&(m(Me,le)?u--:A(Me,Me)),g({type:"inline_code",code:$e,raw:String($e)}),u++,!0}let Te=G;for(let Me=u+1;Me<e.length;Me++)Te+=String((e[Me].content??"")+(e[Me].markup??""));return u=e.length-1,A(Te,Te),u++,!0}h();const q=G.slice(0,j),se=G.slice(j+ne,ye),me=G.slice(ye+ne);return q&&(m(q,le)?u--:A(q,q)),g({type:"inline_code",code:se,raw:String(se??"")}),me&&(T({type:"text",content:me,raw:me}),u--),u++,!0}function k(G){const le=l?.__markdownIt;if(!le||e.length<=1||!e.some(ve=>ve?.type==="math_inline")||!QY.test(G))return null;const he=le.parseInline(G,{__markstreamFinal:!!s?.final});if(!Array.isArray(he)||he.length===0)return null;const j=(he.find(ve=>ve?.type==="inline")?.children??[]).filter(ve=>!(ve?.type==="text"&&String(ve.content??"")===""));if(!j.length||!j.some(ve=>ve?.type!=="text")||j.length===1&&j[0]?.type==="text"&&String(j[0].content??"")===G)return null;const ne=Zn(j,G,n,s);return ne.length?ne:null}function g(G){h(),a.push(G)}function v(G){h();const le=ca(G);a.push(le)}function y(G){g(G)}function A(G,le){c?(c.content+=G,c.raw+=le??G):(c={type:"text",content:String(G??""),raw:String(le??G??"")},a.push(c))}function L(G,le){if(!G)return;const he=Zn([{...le,type:"text",content:G,raw:G}],G,n,s);if(he.length===1&&he[0]?.type==="text"){const j=he[0];A(String(j.content??""),String(j.raw??j.content??""));return}for(const j of he)y(j)}function $(G,le){return String(G.markup??"").startsWith(le)}function x(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,le){let he=G;const j=String(le.content??"");return he.endsWith("\\")&&!$(le,"\\\\")&&!j.endsWith("\\\\")&&(he=he.slice(0,-1)),he.endsWith("(")&&!$(le,"\\(")&&!j.endsWith("\\(")&&(he=he.slice(0,-1)),/\*+$/.test(he)&&!$(le,"\\*")&&!j.endsWith("\\*")&&(he=he.replace(/\*+$/,"")),he}for(;u<e.length;){const G=e[u];T(G)}function T(G){switch(G.type){case"text":S(G);break;case"softbreak":c?(c.content+=`
205
+ `,c.raw+=`
206
+ `):(c={type:"text",content:`
207
+ `,raw:`
208
+ `},a.push(c)),u++;break;case"code_inline":y(PY(G)),u++;break;case"html_inline":{const[le,he]=BY(G,e,u,Zn,t,n,s);y(le),u=he;break}case"link_open":I(G);break;case"image":J(G)||(h(),y(Bw(G)),u++);break;case"strong_open":{h();const{node:le,nextIndex:he}=gu(e,u,G.content,s);y(le),u=he;break}case"em_open":{h();const{node:le,nextIndex:he}=Nf(e,u,s);y(le),u=he;break}case"s_open":{h();const{node:le,nextIndex:he}=Pw(e,u,s);y(le),u=he;break}case"mark_open":{h();const{node:le,nextIndex:he}=$Y(e,u,s);y(le),u=he;break}case"ins_open":{h();const{node:le,nextIndex:he}=HY(e,u,s);y(le),u=he;break}case"sub_open":{h();const{node:le,nextIndex:he}=VY(e,u,s);y(le),u=he;break}case"sup_open":{h();const{node:le,nextIndex:he}=KY(e,u,s);y(le),u=he;break}case"sub":h(),y({type:"subscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`~${String(G.content??"")}~`}),u++;break;case"sup":h(),y({type:"superscript",children:[{type:"text",content:String(G.content??""),raw:String(G.content??"")}],raw:`^${String(G.content??"")}^`}),u++;break;case"emoji":{h();const le=e[u-1];le?.type==="text"&&/\|:-+/.test(String(le.content??""))?A("",""):y(AY(G)),u++;break}case"checkbox":h(),y(SY(G)),u++;break;case"checkbox_input":h(),y(CY(G)),u++;break;case"footnote_ref":h(),y(NY(G)),u++;break;case"footnote_anchor":{h();const le=G.meta??{};g({type:"footnote_anchor",id:String(le.label??G.content??""),raw:String(G.content??"")}),u++;break}case"hardbreak":h(),y(IY()),u++;break;case"fence":h(),y(Vy(e[u])),u++;break;case"math_inline":h(),!G.content&&G.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(Dw({...G,content:e[u+1].content})),u+=2):y(Dw(G)),u++;break;case"reference":R(G);break;case"text_special":A(String(G.content??""),String(G.content??"")),u++;break;default:{const le=G;if(G.type==="link"&&le.href!=null&&s?.validateLink&&!s.validateLink(String(le.href))){h();const he=String(le.text??"");A(he,he),u++}else Y(G)||W(G)||Z(G)||P(G)||v(G),u++;break}}}function F(G,le,he,j){const ne=GY({...le,content:G});if(c){c.content+=E(ne.content,le),c.raw+=ne.raw;return}const ve=he?.tag==="br"&&e[u-2]?.content==="[";j||(ne.content=E(ne.content,le)),c=ne,c.center=ve,a.push(c)}function S(G){const le=String(G.content??""),he=e.length===1&&le.includes("\\")&&typeof t=="string"?String(t):"";let j=he?dZ(he):le.replace(XY,"$1");if(G.content==="<"||j==="1"&&e[u-1]?.tag==="br"){u++;return}const ne=j.indexOf("$");ne!==-1&&ne===j.lastIndexOf("$")&&j.endsWith("$")&&(j=j.slice(0,-1)),j.endsWith("undefined")&&!t?.endsWith("undefined")&&(j=j.slice(0,-9));let ve=a.length,ae="";for(let me=a.length-1;me>=0;me--){const Te=a[me];if(Te.type!=="text")break;ve=me,ae=String(Te.content??"")+ae}ve<a.length&&(j.startsWith(ae)?(c=null,a.length=ve):c=a[a.length-1]);const ye=e[u+1];if((j==="`"||j==="|"||j==="$")&&!$(G,`\\${j}`)||/^\*+$/.test(j)&&!$(G,"\\*")){u++;return}if(!ye&&/[^\]]\s*\(\s*$/.test(j)&&(j=j.replace(/\(\s*$/,"")),!j){u++;return}if(de(j)||X(j))return;if(!(j.includes("*")||j.includes("_")||j.includes("~")||j.includes("`")||j.includes("[")||j.includes("!")||j.includes("$")||j.includes("|")||j.includes("("))){F(j,G,e[u-1],ye),u++;return}if(ge(j))return;const q=e[u-1];if(j==="["&&!ye?.markup?.includes("*")&&!$(G,"\\[")||j==="]"&&!q?.markup?.includes("*")&&!$(G,"\\]")){u++;return}if(_(le,G)||We(j)||(e[u+1]?.type!=="link_open"||x(j))&&ce(j,G))return;const se=k(le);if(se){h();for(const me of se)y(me);u++;return}m(j,G)||(F(j,G,q,ye),u++)}function I(G){if(B(G))return;if(fe()){const{node:ye,nextIndex:q}=If(e,u,s),se=String(ye.text||ye.href||"");A(se,se),u=q;return}h();const{node:le,nextIndex:he}=If(e,u,s);u=he;const j=le.text||le.href||"";if(G.markup==="linkify"&&!I6(j,le.href,t)&&Qh(j,l?.__linkifyDemotionContext)){A(j,j);return}const ne=le.children.length===1&&le.children[0]?.type==="text";if(le.loading&&t&&le.text===le.href&&ne){const ye=bZ(t,le.href);ye&&(le.text=ye,le.children=[{type:"text",content:ye,raw:ye}],le.raw=`[${ye}](${le.href}${le.title?` "${le.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(le.href)){A(le.text,le.text);return}const ve=G.attrs?.find(([ye])=>ye==="href")?.[1],ae=String(ve??"");if(t&&ae){const ye=t.indexOf("](");if(ye!==-1){const q=t.indexOf(")",ye+2);q===-1?le.loading=!0:le.loading&&t.slice(ye+2,q).includes(ae)&&(le.loading=!1)}}P(le)||g(le)}function B(G){if(G.markup!=="linkify")return!1;const{node:le,nextIndex:he}=If(e,u,s);return U(le,he)?(u=he,!0):!1}function R(G){h(),y(UY(G)),u++}function P(G){if(G.type!=="link")return!1;const le=a[a.length-1];if(!le||le.type!=="text")return!1;const he=String(le.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!he)return!1;const j=G,ne=String(j.href??""),ve=String(j.text??""),ae=String(he[2]??""),ye=ne.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ne||!(ve===ne||ve===ye||kZ(ve)))return!1;const q=String(he[1]??"");return q?(le.content=q,le.raw=q):a.pop(),g({...G,text:ae,children:[{type:"text",content:ae,raw:ae}],raw:`[${ae}](${ne}${j.title?` "${j.title}"`:""})`}),!0}function W(G){if(G.type!=="link")return!1;const le=G,he=String(le.href??"");return he?U({href:he,title:le.title==null||le.title===""?null:String(le.title),loading:!!le.loading},u+1):!1}function U(G,le){const he=a[a.length-1];if(he?.type!=="image"||he.src||!he.loading||!String(he.raw??"").endsWith("]("))return!1;const j=e[le],ne=String(j?.content??"");if(j?.type!=="text"||!ne.startsWith(")"))return!1;a.pop(),c=null;const ve=String(he.alt??"");g({type:"image",src:G.href,alt:ve,title:G.title,raw:`![${ve}](${G.href}${G.title?` "${G.title}"`:""})`,loading:!!G.loading});const ae=ne.slice(1),ye=ca(j);return ye.content=ae,ye.raw=ae,p()[le]=ye,!0}function Z(G){if(G.type!=="link")return!1;const le=a[a.length-1],he=e[u-1];if(!le||le.type!=="text"||he?.type!=="text")return!1;const j=String(le.content??""),ne=String(he.content??"");if(!j.endsWith("!")||!ne.endsWith("!")||$(he,"\\!"))return!1;const ve=j.slice(0,-1);ve?(le.content=ve,le.raw=ve,c=le):(a.pop(),c=null);const ae=G,ye=String(ae.text??ae.children?.map(me=>String(me?.content??me?.raw??"")).join("")??""),q=String(ae.href??""),se=ae.title==null||ae.title===""?null:String(ae.title);return g({type:"image",src:q,alt:ye,title:se,raw:`![${ye}](${q}${se?` "${se}"`:""})`,loading:!!ae.loading}),!0}function z(G,le="",he=null){const j=String(G.alt??G.raw??"");return{type:"link",href:le,title:he,text:j,children:[G],raw:`[${j}](${le}${he?` "${he}"`:""})`,loading:!0}}function ee(G){const le=G.startsWith("![")?G:`![${G}`,he=le.slice(2),j=he.indexOf("](");return{type:"image",src:"",alt:j===-1?he.replace(/\]$/,""):he.slice(0,j),title:null,raw:le,loading:!0}}function de(G){const le=G.indexOf("[![");if(le===-1||typeof t=="string"&&e.length===1&&hZ(t,le,"["))return!1;const he=G.slice(0,le);return he&&A(he,he),g(z(ee(G.slice(le+1)))),u++,!0}function J(G){if(s?.final)return!1;const le=e[u-1];if(le?.type!=="text"||!String(le.content??"").endsWith("[")||$(le,"\\["))return!1;const he=a[a.length-1];if(he?.type==="text"&&he.content.endsWith("[")){const j=he.content.slice(0,-1);j?(he.content=j,he.raw=j,c=he):(a.pop(),c=null)}return g(z(Bw(G))),u++,!0}function Y(G){if(G.type!=="link")return!1;const le=G,he=String(le.raw??""),j=String(le.text??"");if(!he.startsWith("[![")&&!j.startsWith("!["))return!1;const ne=le.title==null||le.title===""?null:String(le.title);return g(z({type:"image",src:String(le.href??""),alt:j.replace(/^!\[/,"").replace(/\]$/,""),title:ne,raw:he.startsWith("[![")?he.slice(1):he,loading:!0})),!0}function X(G){if(!G.startsWith("]("))return!1;const le=e[u-2];if(le?.type==="text"&&String(le.content??"").endsWith("[")&&$(le,"\\["))return!1;const he=a[a.length-1];if(he?.type!=="image"&&he?.type!=="link")return!1;const j=he,ne=he?.type==="link"&&Array.isArray(j.children)&&j.children.length===1&&j.children[0]?.type==="image"?a.pop():null,ve=ne?ne.children[0]:a.pop();if(!ve||ve.type!=="image")return!1;const ae=e[u+1];let ye=String(ne?.href??""),q=ne?.title==null?null:String(ne.title),se=!0;if(ae?.type==="link_open"){const{node:Te,nextIndex:Me}=If(e,u+1,s);ye=Te.href,q=Te.title,se=!0,u=Me}else{if(ye=G.slice(2),ye.includes('"')){const Te=ye.split('"');ye=String(Te[0]??"").trim(),q=Te[1]==null?null:String(Te[1]).trim()}u++}const me=z(ve,ye,q);return me.loading=se,g(me),!0}function fe(){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 ce(G,le){const he=G.indexOf("[");if(he===-1)return!1;let j=G.slice(0,he);const ne=G.indexOf("](",he);if(ne!==-1){const ve=e[u+2];let ae=G.slice(he+1,ne);if(ae.includes("[")){const $e=ae.indexOf("[");j+=G.slice(0,he+$e+1);const pe=he+$e+1;ae=G.slice(pe+1,ne)}const ye=e[u+1];if(G.endsWith("](")&&ye?.type==="link_open"&&ve){const $e=e[u+4];let pe=4,Ie=!0;if($e?.type==="text"){const lt=String($e.content??"");if(lt.startsWith(")")){Ie=!1;const _t=lt.slice(1);if(_t){const St=ca($e);St.content=_t,St.raw=_t,p()[u+4]=St}else pe++}else lt==="."&&pe++}L(j,le);const Qe=String(ve.content??"");return s?.validateLink&&!s.validateLink(Qe)?A(ae,ae):g({type:"link",href:Qe,title:null,text:ae,children:[{type:"text",content:ae,raw:ae}],loading:Ie}),u+=pe,!0}const q=G.indexOf(")",ne),se=q!==-1?G.slice(ne+2,q):"",me=q===-1;let Te=j.match(/\*+$/);if(Te&&(j=j.replace(/\*+$/,"")),L(j,le),Te||(Te=ae.match(/^\*+/)),!d&&Te){const $e=Te[0].length;ae=ae.replace(/^\*+/,"").replace(/\*+$/,"");const pe=[];if($e===1?pe.push({type:"em_open",tag:"em",nesting:1}):$e===2?pe.push({type:"strong_open",tag:"strong",nesting:1}):$e===3&&(pe.push({type:"strong_open",tag:"strong",nesting:1}),pe.push({type:"em_open",tag:"em",nesting:1})),pe.push({type:"link",href:se,title:null,text:ae,children:[{type:"text",content:ae,raw:ae}],loading:me}),$e===1){pe.push({type:"em_close",tag:"em",nesting:-1});const{node:Ie}=Nf(pe,0,s);y(Ie)}else if($e===2){pe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=gu(pe,0,void 0,s);y(Ie)}else if($e===3){pe.push({type:"em_close",tag:"em",nesting:-1}),pe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=gu(pe,0,void 0,s);y(Ie)}else{const{node:Ie}=Nf(pe,0,s);y(Ie)}}else s?.validateLink&&!s.validateLink(se)?A(ae,ae):g({type:"link",href:se,title:null,text:ae,children:[{type:"text",content:ae,raw:ae}],loading:me});const Me=q!==-1?G.slice(q+1):"";return Me&&(T({type:"text",content:Me,raw:Me}),u--),u++,!0}return!1}function We(G){const le=G.indexOf("![");if(le===-1)return!1;const he=G.slice(0,le);return he&&!c?c={type:"text",content:he,raw:he}:he&&c&&(c.content+=he),c&&(a.push(c),c=null),g(ee(G.slice(le))),u++,!0}function ge(G){if(!(G?.startsWith("[")&&n?.type==="list_item_open"))return!1;const le=G.slice(1).match(/[^\s\]]/);if(le===null)return u++,!0;if(le&&/x/i.test(le[0])){const he=le[0]==="x"||le[0]==="X";return g({type:"checkbox_input",checked:he,raw:he?"[x]":"[ ]"}),u++,!0}return!1}return a}function xZ(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 _Z(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 wZ(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Uc(e,t,n){const s=e[t],o=[],i=Ml(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=wZ(c)?ca(c):c,d=e[a-1];u!==c&&(_Z(u),xZ(u));const f=String(u.content??"");l.push({type:"paragraph",children:Zn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=jc(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]=Uc(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=Yy(e,a,i.options(),Gy);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(`
209
+ `)},r+1]}function SZ(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Ml(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:Zn(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]=Uc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=jc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=am(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}
210
+ ${r.map(c=>c.raw).join(`
211
+ `)}
212
+ :::`},a+1]}const CZ=new Set(["warning","info","note","tip","danger","caution"]);function AZ(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 CZ.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function MZ(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=AZ(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=Ml(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 p=-1;for(let m=f.length-1;m>=0;m--){const _=f[m];if(_.type==="text"&&/:+/.test(_.content)){p=m;break}}const h={type:"paragraph",children:Zn((p!==-1?f.slice(0,p):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Uc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=jc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=am(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}
213
+ ${l.map(d=>d.raw).join(`
214
+ `)}
215
+ :::`},c+1]}const EZ=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function TZ(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=EZ.exec(String(s.info??""));return o?SZ(e,t,o,n):null}const Gy={parseContainer:(e,t,n)=>MZ(e,t,n),matchAdmonition:TZ};function jc(e,t,n){const s=[],o=Ml(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:Zn(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]=Uc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=jc(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=Yy(e,i,o.options(),Gy);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(`
216
+ `)},i+1]}function NZ(e){if(e.info?.startsWith("diff"))return Vy(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 IZ(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=Ml(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=Zn(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:Zn(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(`
217
+ `)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
218
+ `)},o+1]}function $Z(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=Ml(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:Zn(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(`
219
+ `)}`},l+1]}function LZ(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:Zn(a.children||[],c,void 0,n),raw:c}}function FZ(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=Yn(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=Yn(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 J6(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=Yn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=_a.has(n),l=lm(o),a=(s===-1?-1:FZ(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
220
+ </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function OZ(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 RZ(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 eM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function tM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return eM(n)?n:void 0}function BZ(e,t,n){const s=tM(Ld(t),n);if(!eM(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 DZ(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",p=e[c+1],h=String(p.content??""),m=RZ(e[c].attrs),_=a.length,k=!f&&!r,g=k?o?.cells[_]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Zn(p.children||[],h,void 0,BZ(n,g,k?u:void 0)),raw:h,align:m}),k&&(u=tM(u,Ld(h))),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(`
221
+ `)},s+1]}function PZ(){return{type:"thematic_break",raw:"---"}}let d0=null;const f0=new WeakMap;function Hw(){return d0||(d0={allowedTagSet:um(),customTagSet:null}),d0}function HZ(e){if(!e||e.length===0)return Hw();const t=f0.get(e);if(t)return t;const n=e.map(yi).filter(Boolean);if(!n.length){const o=Hw();return f0.set(e,o),o}const s={allowedTagSet:um({customHtmlTags:e}),customTagSet:new Set(n)};return f0.set(e,s),s}function WZ(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[p,h]of o)if(p==="class"){const m=h.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(p.startsWith("data-")){const m=p.slice(5);try{r[m]=JSON.parse(h)}catch{r[m]=h}}}const l=[],a=Ml(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const p=e[c+1];if(p){const h={type:"paragraph",children:Zn(p.children||[],void 0,void 0,a.options()),raw:String(p.content??"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[p,h]=Uc(e,c,a.options());l.push(p),a.remember(p.raw),c=h}else if(e[c].type==="blockquote_open"){const[p,h]=jc(e,c,a.options());l.push(p),a.remember(p.raw),c=h}else{const p=am(e,c,a.options());p?(l.push(p[0]),a.remember(p[0].raw),c=p[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+=`
222
+ `,l.length>0&&(f+=s.raw??l.map(p=>p.raw).join(`
223
+ `),f+=`
224
+ `),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 zZ(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function UZ(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function jZ(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Uo(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Uo(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=Yn(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=Yn(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 qZ(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=Yn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const h=c+1;return{raw:e.slice(r,h),end:h}}let u=1,d=c+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(m)},p=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),end:e.length};if(p(h)){const m=e.indexOf(">",h);if(m===-1)return null;if(u--,u===0){const _=m+1;return{raw:e.slice(r,_),end:_}}d=m+1;continue}if(f(h)){const m=Yn(e.slice(h));if(m===-1)return null;u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),end:e.length}}function Qg(e){return Number.isFinite(e)&&e>0?e:0}function VZ(e,t){const n=Qg(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
225
+ `&&(s++,s===n))return o+1;return e.length}function am(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[LZ(e,t,n),t+3];case"code_block":return[NZ(s),t+1];case"fence":return[Vy(s),t+1];case"math_block":return[OZ(s),t+1];case"html_block":{const o=J6(s),i=o.tag?HZ(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)?VZ(l,Number(s.map?.[0]??0)):0,u=qZ(l,r,Math.max(Qg(a),Qg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=Yn(d),p=f!==-1?d.slice(0,f+1):d,h=f!==-1&&/\/\s*>\s*$/.test(p),m=f===-1?null:jZ(d,r,f+1),_=m?.start??-1;let k="";f!==-1&&(_!==-1&&f<_?k=d.slice(f+1,_):k=d.slice(f+1)),_===-1&&(k=UZ(k,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(p))!==null;){const L=y[1];if(!L||L.toLowerCase()===r)continue;const $=y[2]||y[3]||y[4]||"";g.push([L,$])}const A=!n?.final&&!h&&m==null;return[{type:r,tag:r,content:zZ(k),raw:String(u?.raw??o.raw??d),loading:A,attrs:g.length?g:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=DZ(e,t,n);return[o,i]}case"dl_open":{const[o,i]=IZ(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=$Z(e,t,n);return[o,i]}case"hr":return[PZ(),t+1]}return null}function Yy(e,t,n,s){const o=am(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 WZ(e,t,n)}return null}function KZ(){return{type:"hardbreak",raw:`\\
226
+ `}}function GZ(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:Zn(s.children||[],o,void 0,n),raw:o}}const Ww=new WeakMap,cm=new WeakMap,YZ=["$$","\\["];function Oc(){return typeof performance<"u"?performance.now():Date.now()}function Zy(e,t,n){e&&(e[t]=(e[t]??0)+n)}function nM(e){return e.__timing}function h0(e,t,n){return t&&Zy(t,"parseMarkdownToStructureTotalMs",Oc()-n),e}function zw(e,t,n){if(!n)return Zw(e,t);const s=Oc(),o=Zw(e,t);return Zy(n,"processTokensMs",Oc()-s),o}function ZZ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=zc(t);return n.length?new Set(n):null}function QZ(e,t){const n=e;let s=Ww.get(n);s||(s=new Map,Ww.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 XZ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function $f(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]=Ql(o.value,n))}}function Ql(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(Ql(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Ql(l,t),Ql(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Ql(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),$f(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),$f(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),$f(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!XZ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),$f(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Ql(i[r],t);return o}function sM(e,t=!0){if(!t)return ca(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=>sM(a,t)):t&&r&&typeof r=="object"&&(l=Ql(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function Uw(e,t=!0){return e.map(n=>sM(n,t))}function oM(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 JZ(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 eQ(e){cm.delete(e)}function tQ(e,t,n){cm.set(e,{source:t,key:n,pendingCandidate:n===null&&j6(t)})}function nQ(e){return e.endsWith("$")||e.endsWith("\\")}function sQ(e){const t=Math.max(e.lastIndexOf(`
227
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return YZ.some(s=>n.endsWith(s))}function oQ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||sQ(e)&&/[\r\n]/.test(t)):!1}function iQ(e,t){if(!B6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=cm.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&&!oQ(o.source,l)&&!nQ(t)){o.source=t;return}}const i=kY(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),tQ(e,t,i)}function rQ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function lQ(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 p0(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&&lQ(e,t)}function jw(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function aQ(e){for(let t=0;t+5<e.length;t++)if(jw(e,t)&&jw(e,t+3)&&p0(e[t],e[t+3])&&p0(e[t+1],e[t+4])&&p0(e[t+2],e[t+5]))return!0;return!1}function cQ(e,t,n){return B6(e)&&j6(t)&&aQ(n)}function uQ(e){const t=cm.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function qw(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!oM(e,s)||(iQ(e,t),uQ(e)))return e.parse(t,n);const o=e.stream.parse(t,QZ(e,n));if(cQ(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!rQ(s))return o;const i=nM(s);if(!i)return Uw(o,!0);const r=Oc(),l=Uw(o,!0);return Zy(i,"tokenCloneMs",Oc()-r),l}function um(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return pd;const n=new Set(pd);for(const s of zc(t))s&&n.add(s);return n}function dQ(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 Vw(e){return{type:"paragraph",children:e,raw:e.map(dQ).join("")}}function Kw(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=ZZ(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(p=>p?.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(Vw(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(Vw(c)),a}function fQ(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 Wu(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function hQ(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*${Uo(t)}\s*>\s*$`,"i").test(n)}function Qy(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Uo(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=Yn(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=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${Uo(s)}(?=\s|>|/)`,"i").test(m)},p=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${Uo(s)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(p(h)){const m=Yn(e.slice(h));if(m===-1)return null;u--;const _=h+m+1;if(u===0)return{raw:e.slice(r,_),start:r,end:_,closed:!0};d=_;continue}if(f(h)){const m=Yn(e.slice(h));if(m===-1)return null;const _=e.slice(h,h+m+1);/\/\s*>$/.test(_)||u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function pQ(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]===`
228
+ `){n++;continue}return-1}return s===t.length?n:-1}function mQ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
229
+ </${t}>`}function Gw(e){return e.replace(/\r\n/g,`
230
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function gQ(e,t,n){return n?e.includes(n,t)?!0:Gw(e.slice(Math.max(0,t))).includes(Gw(n)):!1}function vQ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
231
+ `&&n++,n):e[n]===`
232
+ `?n+1:t}function Yw(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 yQ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Xy(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Uo(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function iM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const kQ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),bQ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function xQ(e){return/\n\s*\n/.test(e)||bQ.test(e)}function _Q(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>kQ.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(!xQ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function wQ(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"||b6.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=Yn(l);if(a===-1)return o;const c=Xy(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=zu(u,t,iM(n,s));return _Q(u,d)?{...o,children:d}:o})}function zu(e,t,n){return e.trim()?lM(e,t,{...n,__disableStreamParse:!0}):[]}function SQ(e,t,n){const s=zu(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function CQ(e,t,n){const s=J6({content:e}),o=Yn(e),i=Xy(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=SQ(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function AQ(e,t,n){const s=Yn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=Qy(o,"summary",0);if(!i)return zu(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...zu(r,t,n),CQ(i.raw,t,n),...zu(l,t,n)]}function rM(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=Wu(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!Yw(c)){r.push(c);continue}const f=String(c.raw??Wu(c)??""),p=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(p===-1){r.push(c);continue}let h=1,m=-1;for(let Z=a+1;Z<e.length;Z++){const z=e[Z];if(Yw(z)){h++;continue}if(yQ(z)&&(h--,h===0)){m=Z;break}}const _=Qy(t,"details",p),k=m===-1&&_?.closed===!0,g=k?(()=>{const Z=Xy(f,"details");return Z!==-1?f.slice(0,Z):f})():f,[v]=rM(k?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,s,o,p+f.length),y=AQ(g,n,iM(s,o)),A=m===-1?"</details>":String(e[m].raw??Wu(e[m])??"</details>"),L=k||m!==-1&&_?.closed===!0,$=A.replace(/[\t\r\n ]+$/,""),x=L?(()=>{const Z=(_?.raw??"").lastIndexOf($);return Z===-1?t.length:p+Z})():t.length,E=Yn(f),T=k&&E!==-1?p+E+1:p+f.length,F=t.slice(T,x===-1?t.length:x),S=n.parse(F,{__markstreamFinal:o}),I=n.renderer.render(S,n.options,{__markstreamFinal:o}),B=x+$.length,R=L?Math.max(x+A.length,vQ(t,B)):t.length,P=L?t.slice(x,R):A,W=L?t.slice(p,R):t.slice(p),U=k&&E!==-1?f.slice(0,E+1):f;if(r.push({...c,tag:"details",attrs:lm(f.slice(0,E+1)),raw:W,content:`${U}${I}${P}`,children:[...y,...v],loading:!o&&!L}),l=L?R:t.length,m===-1&&!k)break;m!==-1&&(a=m)}return[r,l]}function MQ(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=Wu(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=Qy(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),p=mQ(u.raw,c,u.closed),h=!t&&!u.closed,m=d!==p||f!==u.raw||!!r.loading!==h,_=Yn(u.raw),k=_===-1?"":u.raw.slice(0,_+1),g=k?lm(k):[];if(r.content=p,r.raw=u.raw,r.loading=h,r.attrs=g.length?g:void 0,!m)continue;let v=pQ(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<s.length;){if(u.closed&&hQ(s[y],c)){s.splice(y,1);continue}const A=Wu(s[y]);if(!A)break;const L=u.raw.indexOf(A,v);if(L===-1){if(gQ(n,u.end,A))break;s.splice(y,1);continue}v=L+A.length,s.splice(y,1)}}return s}function EQ(e){const t=l=>l===" "||l===" "||l===`
233
+ `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const _=m.charCodeAt(0);return _>=65&&_<=90||_>=97&&_<=122},u=m=>{const _=m.charCodeAt(0);return _>=48&&_<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",p=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",h=p;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(!p(l[a]))return!1;for(a++;a<l.length&&h(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const _=l[a];if(t(_)||_==="<"||_===">"||_==='"'||_==="'"||_==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let A=v;for(;A<g.length&&g[A]===y;)A++;const L=A-v;return L<3?null:{markerChar:y,markerLen:L,rest:g.slice(A)}},h=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=p(g);if(v)return v;const y=h(g);return y==null?null:p(y)};let _=0;const k=l.split(/\r?\n/);for(const g of k){const v=_,y=_+g.length;if(a<v)break;const A=m(g);if(A){const L=A.markerChar,$=A.markerLen;c?L===u&&$>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=$)}if(a<=y)break;_=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
234
+ `||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]===`
235
+ `||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function TQ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=h=>h===" "||h===" ",o=h=>{const m=h.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||h==="_"||h==="-"||h===":"},i=h=>{if(!h)return!1;if(h[0]===" ")return!0;let m=0;for(let _=0;_<h.length;_++){const k=h[_];if(k===" "){if(m++,m>=4)return!0;continue}if(k===" ")return!0;break}return!1},r=h=>{let m=!1,_=!1;for(let k=0;k<h.length;k++){const g=h[k];if(g==="\\"){k++;continue}if(!_&&g==="'"){m=!m;continue}if(!m&&g==='"'){_=!_;continue}if(!m&&!_&&g===">")return k}return-1},l=h=>{let m=0;for(;m<h.length&&s(h[m]);)m++;const _=h[m];if(_!=="`"&&_!=="~")return null;let k=m;for(;k<h.length&&h[k]===_;)k++;const g=k-m;return g<3?null:{markerChar:_,markerLen:g,rest:h.slice(k)}},a=(h,m)=>{if(i(h))return-1;const _=h.replace(/^[ \t]+/,"");if(!_||_.startsWith(">")||_.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(_))return-1;let k=!1,g=0;for(;g<h.length;){const v=h[g];if(v!=="<"){s(v)||(k=!0),g++;continue}const y=r(h.slice(g));if(y===-1){k=!0,g++;continue}const A=h.slice(g,g+y+1);let L=1;for(;L<A.length&&s(A[L]);)L++;if(L>=A.length){k=!0,g++;continue}const $=A[L];if($==="!"||$==="?"){k=!0,g+=y+1;continue}if($==="/"){k=!0,g+=y+1;continue}const x=L;for(;L<A.length&&o(A[L]);)L++;if(L===x){k=!0,g++;continue}const E=A.slice(x,L).toLowerCase(),T=A[L];if(T&&T!==" "&&T!==" "&&T!==">"&&T!=="/"){k=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),S=/\/\s*>$/.test(A),I=F.test(h.slice(g+y+1)),B=F.test(e.slice(m+g+y+1)),R=/[\r\n]/.test(e.slice(m+g+y+1));if(k&&n.has(E)&&!S&&!I&&(B||R))return g;k=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",p=0;for(;p<e.length;){const h=e.indexOf(`
236
+ `,p),m=h!==-1,_=m&&h>p&&e[h-1]==="\r",k=m?_?h-1:h:e.length,g=e.slice(p,k),v=m?_?`\r
237
+ `:`
238
+ `:"",y=l(g);let A=g;if(!c&&!y){const L=a(g,p);if(L!==-1){const $=v||`
239
+ `;A=`${g.slice(0,L).replace(/[ \t]+$/,"")}${$}${$}${g.slice(L).replace(/^[ \t]+/,"")}`}}f+=A,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)),p=m?h+1:e.length}return f}function NQ(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,p=!1;for(let h=0;h<d.length;h++){const m=d[h];if(m==="\\"){h++;continue}if(!p&&m==="'"){f=!f;continue}if(!f&&m==='"'){p=!p;continue}if(!f&&!p&&m===">")return h}return-1},l=(d,f,p)=>{const h=p.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let _=m+1;for(;_<d.length&&s(d[_]);)_++;if(_>=d.length||d[_]!=="/"){m=d.indexOf("<",m+1);continue}for(_++;_<d.length&&s(d[_]);)_++;if(_+h.length>d.length){m=d.indexOf("<",m+1);continue}let k=!0;for(let v=0;v<h.length;v++){const y=d[_+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==h[v]){k=!1;break}}if(!k){m=d.indexOf("<",m+1);continue}let g=_+h.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 p=f;for(;f<d.length&&o(d[f]);)f++;if(f===p)return d;const h=d.slice(p,f).toLowerCase();if(!n.has(h))return d;const m=r(d.slice(f));if(m===-1)return d;const _=f+m;if(l(d,_+1,h))return d;const k=i(d.slice(_+1));return k?`${d.slice(0,_+1)}
240
+ ${k}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
241
+ `,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",p=f?d-1:d,h=e.slice(u,p);c+=a(h),c+=f?`\r
242
+ `:`
243
+ `,u=d+1}return c}function IQ(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 p=0,h=!1,m=0;for(;p<f.length;){for(;p<f.length&&s(f[p]);)p++;if(p>=f.length||f[p]!==">")break;for(h=!0,p++;p<f.length&&s(f[p]);)p++;m=p}return h?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let p=0;for(;p<f.length&&s(f[p]);)p++;const h=f[p];if(h!=="`"&&h!=="~")return null;let m=p;for(;m<f.length&&f[m]===h;)m++;const _=m-p;return _<3?null:{markerChar:h,markerLen:_,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
244
+ `,d),p=f!==-1,h=p&&f>d&&e[f-1]==="\r",m=p?h?f-1:f:e.length,_=e.slice(d,m),k=p?h?`\r
245
+ `:`
246
+ `:"",g=o(_),v=g?.prefix??"",y=g?.content??_,A=i(y);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let L=y;if(!l&&L.includes("</"))for(const $ of r)L=L.replace($,(x,E,T,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return x;const S=F.slice(0,T).replace(/^[\t ]+/,"");if(S.length>0){const I=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",B=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!B||I!==B)return x}return`${E}
247
+
248
+ `});if(v){const $=v+L.split(`
249
+ `).join(`
250
+ ${v}`);u+=$}else u+=L;u+=k,d=p?f+1:e.length}return u}function $Q(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 B=0;B<S.length;B++){const R=S[B];if(R===" "){if(I++,I>=4)return!0;continue}if(R===" ")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,B=!1,R=0;for(;I<S.length;){for(;I<S.length&&s(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(B=!0,I++;I<S.length&&s(S[I]);)I++;R=I}if(!B)return null;const P=S.slice(0,R);return{prefix:P,key:P.replace(/[ \t]+$/,""),content:S.slice(R)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const B=S[I];if(B!==" "&&B!==" ")return!1}return!0},u=S=>{if(o(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let B=1;for(;B<I.length&&s(I[B]);)B++;if(B>=I.length||I[B]==="/"||I[B]==="!"||I[B]==="?")return"";const R=B;for(;B<I.length&&i(I[B]);)B++;if(B===R)return"";const P=I.slice(R,B).toLowerCase();if(!n.has(P))return"";const W=I[B];return W&&W!==" "&&W!==" "&&W!==">"&&W!=="/"?"":P},d=S=>{if(o(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let B=1;for(;B<I.length&&s(I[B]);)B++;if(B>=I.length)return null;const R=I[B]==="/";if(R)for(B++;B<I.length&&s(I[B]);)B++;const P=I[B];if(!P||P==="!"||P==="?")return null;const W=B;for(;B<I.length&&i(I[B]);)B++;if(B===W)return null;const U=I.slice(W,B).toLowerCase();if(!n.has(U))return null;const Z=I[B];if(Z&&Z!==" "&&Z!==" "&&Z!==">"&&Z!=="/")return null;if(R)return{type:"close",name:U};if(/\/\s*>\s*$/.test(I))return{type:"open",name:U,complete:!0};const z=I.indexOf(">",B);if(z!==-1){const ee=I.slice(z+1);if(new RegExp(`<\\s*\\/\\s*${U}\\s*>`,"i").test(ee))return{type:"open",name:U,complete:!0}}return{type:"open",name:U,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 B=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(B?.[1])return B[1].toLowerCase();const R=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const P=R[1].toLowerCase();return P===R[2].toLowerCase()?P:null};let p=!1,h="",m=0;const _=S=>{let I=0;for(;I<S.length&&s(S[I]);)I++;const B=S[I];if(B!=="`"&&B!=="~")return null;let R=I;for(;R<S.length&&S[R]===B;)R++;const P=R-I;return P<3?null:{markerChar:B,markerLen:P,rest:S.slice(R)}},k=S=>_(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,B)=>{let R=S,P=0;for(;R<e.length;){const W=e.indexOf(`
251
+ `,R),U=W!==-1,Z=U&&W>R&&e[W-1]==="\r",z=U?Z?W-1:W:e.length,ee=e.slice(R,z),de=l(ee),J=de?.key??"";if(P>0&&I&&J!==I)break;const Y=de?.content??ee,X=d(Y);if(X?.name===B){if(X.type==="open")X.complete||P++;else if(P>0&&(P--,P===0))return!1}else if(P>0&&(c(Y)||g(Y)))return!0;if(U)R=W+1;else break}return!1};let y="",A=0,L=!0,$=!1,x=!1,E=`
252
+ `;const T=[];let F="";for(;A<e.length;){const S=e.indexOf(`
253
+ `,A),I=S!==-1,B=I&&S>A&&e[S-1]==="\r",R=I?B?S-1:S:e.length,P=e.slice(A,R),W=I?B?`\r
254
+ `:`
255
+ `:"",U=l(P),Z=U?.key??"",z=U?.content??P,ee=k(z);ee&&(p?ee.markerChar===h&&ee.markerLen>=m&&/^\s*$/.test(ee.rest)&&(p=!1,h="",m=0):(p=!0,h=ee.markerChar,m=ee.markerLen));const de=T.length>0;if(!p&&!de){const Y=u(z),X=!!Y&&!L&&$&&x&&v(A,Z,Y);Y&&!L&&(!$||X)&&(Z&&F&&Z===F?y+=`${Z}${E}`:Z||(y+=E))}if(y+=P,y+=W,W&&(E=W),!p){const Y=d(z);if(Y){if(Y.type==="open")Y.complete||T.push(Y.name);else for(let X=T.length-1;X>=0;X--)if(T[X]===Y.name){T.length=X;break}}}const J=c(z);L=J,$=!J&&a(z),x=!J&&!!f(z),F=Z,A=I?S+1:e.length}return y}function lM(e,t,n={}){const s=nM(n),o=s?Oc():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(JZ(t,n)&&(t.stream.reset(),eQ(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,_=>_.startsWith(`
256
+ `)?`
257
+ `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,_=>_.startsWith(`
258
+ `)?`
259
+ `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,_=>_.startsWith(`
260
+ `)?`
261
+ `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
262
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,_=>_.startsWith(`
263
+ `)?`
264
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(_,k,g)=>`${k}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,_=>_.startsWith(`
265
+ `)?`
266
+ `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
267
+ `))),n.customHtmlTags?.length&&r.includes("<")){const _=zc(n.customHtmlTags);if(_.length&&(r=TQ(r,_),r=NQ(r,_),r=$Q(r,_),r=IQ(r,_),r.includes("</")))for(const k of _){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=EQ(r));const l=fQ(r);if(l){const _=n.preTransformTokens,k=n.postTransformTokens;if(oM(t,n)||typeof _=="function"||typeof k=="function"){const g=qw(t,r,{__markstreamFinal:i},n),v=typeof _=="function"&&_(g)||g;typeof k=="function"&&k(v)}return h0(l,s,o)}const a=qw(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return h0([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,p=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),h={...n,validateLink:p,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=zw(d,h,s);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const k=_[0],g=k?.type;k&&typeof g=="string"?m=zw(_,void 0,s):m=_}}if(m=MQ(m,i,r),m=rM(m,r,t,n,i)[0],m=wQ(m,t,n,i),i){const _=new WeakSet,k=g=>{if(!g||typeof g!="object"||_.has(g))return;if(_.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),h0(m,s,o)}function Zw(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=Ml(t);let o=0;for(;o<e.length;){const i=Yy(e,o,s.options(),Gy);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=GZ(e,o,s.options(l)),c=Kw(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]=Uc(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=jc(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(KZ()),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=Zn(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=Kw(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const LQ=new Set([...$d,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),FQ=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"]),Qw=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function Xw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function OQ(e){return typeof e=="string"?e:e==null?"":String(e)}function aM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function ol(e){return OQ(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function cM(e){return ol(e).replace(/`/g,"&#96;")}function dm(e){return String(e??"").trim().toLowerCase()}function Jy(e,t="safe"){const n=dm(e);return n?t==="escape"?!0:t==="trusted"?$d.has(n):!FQ.has(n):!1}function uM(e,t="safe"){const n=dm(e);return n?t==="escape"?!0:t==="trusted"?$d.has(n):LQ.has(n):!1}function Jw(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${cM(s)}"`).join("")}function RQ(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||aa(o,{tagName:t,attrName:"srcset"})})}function dM(e,t,n,s){return kK.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?RQ(t,s):!!(bK.has(e)&&t&&aa(t,{tagName:s,attrName:e}))}function Xl(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function fM(e,t,n,s=!1){if(t!=="safe"||dm(n)!=="a")return e;const o=Xl(e,"href");if(s&&(!o||!e[o])){const a=Xl(e,"target"),c=Xl(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Xl(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Xl(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 eS(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!aM(r)||dM(l,i,t,n)||(s[r]=i)}return fM(s,t,n,!!Xl(e,"href"))}function hM(e,t){const n=e.toLowerCase();return k6.has(n)?!1:Xw(t,n)||Xw(t,e)}function ek(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!aM(r)||dM(l,i,t,n)||(s[r]=i)}return fM(s,t,n,!!Xl(e,"href"))}function np(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 Xg(e,t="safe",n){const s=ek(np(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function BQ(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 DQ(e){const t={};for(const[n,s]of Object.entries(e))t[n]=BQ(s,n);return t}function tS(e){return e.trim().length>0}function PQ(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);tS(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);tS(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 p;for(;(p=f.exec(u))!==null;){const h=p[1],m=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||_a.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function HQ(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 p;for(;(p=f.exec(u))!==null;){const h=p[1],m=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||_a.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function WQ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${ol(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${ol(s)}`:` ${ol(s)}="${cM(o)}"`).join("");return e.type==="self_closing"?`&lt;${ol(t)}${n} /&gt;`:`&lt;${ol(t)}${n}&gt;`}function zQ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;Qw.lastIndex=0;let n;for(;(n=Qw.exec(e))!==null;)if(hM(n[1],t))return!0;return!1}function Cc(e,t="safe"){if(!e)return"";if(t==="escape")return ol(e);const n=HQ(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(ol(r.content??""));continue}const l=dm(r.tagName);if(!l)continue;if(uM(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"&&Jy(l,t)){o.push(WQ(r));continue}if(r.type==="self_closing"){o.push(`<${l}${Jw(eS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${Jw(eS(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 UQ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],nS="http://www.w3.org/2000/svg",jQ=new Set(["script","style","iframe","object","embed","link","meta"]),qQ=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"]),VQ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),KQ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),GQ=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function YQ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function ZQ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function QQ(e){const t=e.nodeName.toLowerCase();return t==="use"?YQ(e):t==="image"?ZQ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():GQ.has(t)}function XQ(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 JQ(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")?aa(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?aa(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":aa(i,{tagName:s,attrName:o})?"":i:""}function eX(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 pM(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 mM(e){const t=pM(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=eX(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function sS(e){const t=pM(e);return UQ.some(n=>n.test(t))||mM(t)}function tX(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 Lf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function gM(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(!jQ.has(s)){if(s==="br"){t.push(`
268
+ `);return}for(const o of Array.from(n.childNodes))gM(o,t)}}function nX(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];gM(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=Lf(t.getAttribute("width")),i=Lf(t.getAttribute("height")),r=Lf(t.getAttribute("x")),l=Lf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(nS,"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 p=e.ownerDocument.createElementNS(nS,"tspan");p.setAttribute("x",String(r+o/2)),p.setAttribute("dy",d===0?`${u}em`:"1.2em"),p.textContent=f,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function sX(e){nX(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!qQ.has(s)){n.remove();continue}if(s==="style"&&sS(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&&sS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(VQ.has(r)&&i.value){const l=JQ(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(KQ.has(r)&&i.value&&mM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=XQ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}tX(n)}}function Lxe(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 sX(n),oX(n)?null:n}catch{return null}}function oX(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){QQ(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 oS=[];function m0(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function iX(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function rX(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function iS(e=`editor-${Date.now()}`,t={}){const n=wY(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=p=>f[p]??s[p]??p}else o=f=>s[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const p=f;if(Array.isArray(p)){const[h,...m]=p;typeof h=="function"&&n.use(h,...m)}else typeof p=="function"&&n.use(p)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(p){console.error("[getMarkdown] apply function threw an error",p)}if(oS.length)for(const f of oS)if(Array.isArray(f)){const[p,...h]=f;typeof p=="function"&&n.use(p,...h)}else typeof f=="function"&&n.use(f);n.use(Wz),n.use(jz),n.use(Dz);const i=oU,r=i.default??i;n.use(r),n.use(Bz),n.use(Rz),n.core.ruler.after("block","mark_fence_closed",f=>{const p=f,h=p.src,m=!!p.env?.__markstreamFinal,_=h.split(/\r?\n/);for(const k of p.tokens){if(k.type!=="fence"||!k.map||!k.markup)continue;const g=k.map[0],v=k.map[1],y=k.markup,A=y[0],L=y.length,$=_[Math.max(0,v-1)]??"";let x=0;for(;x<$.length&&($[x]===" "||$[x]===" ");)x++;let E=0;for(;x+E<$.length&&$[x+E]===A;)E++;let T=x+E;for(;T<$.length&&($[T]===" "||$[T]===" ");)T++;const F=m?!0:v>g+1&&E>=L&&T===$.length,S=k;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,p)=>{const h=f,m=h.pos;if(h.src[m]!=="~")return!1;const _=h.src[m-1],k=h.src[m+1];if(/\d/.test(_)&&/\d/.test(k)){if(!p){const g=h.push("text","",0);g.content="~"}return h.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,p)=>{const h=f[p],m=String(h.info??"").trim(),_=String(h.content??""),k=btoa(unescape(encodeURIComponent(_))),g=iX(m),v=m0(g),y=rX(`editor-${e}-${p}-${g}`),A=m0(o("common.copy"));return`<div class="code-block" data-code="${k}" data-lang="${v}" id="${y}">
269
+ <div class="code-header">
270
+ <span class="code-lang">${m0(g.toUpperCase())}</span>
271
+ <button class="copy-button" data-code="${k}">${A}</button>
272
+ </div>
273
+ <div class="code-editor"></div>
274
+ </div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const p=c.exec(f);if(!p)return f!=="["&&!/^\[\d+$/.test(f);const h=String(p[1]??"");return f.slice(p[0].length).startsWith("(")?!1:!/^\d+$/.test(h)},d=(f,p)=>{const h=f;if(h.src[h.pos]!=="[")return!1;const m=a.exec(h.src.slice(h.pos));if(!m)return!1;const _=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const k=h.src.slice(h.pos+m[0].length);if(k.startsWith("](")||k.startsWith("(")||u(k))return!1;if(!p){const g=m[1],v=h.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return h.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,p)=>{const m=String(f[p].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function lX({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 vM({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}:lX({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const rS=new WeakMap;function aX(e){let t=rS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},rS.set(e,t)),t}function lS(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 tk(e){return!!(e.themes?.length||e.langs?.length)}function yM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function cX(e,t){return!t?.length||e.registeredAllLangs?!0:yM(e.registeredLangs,t)}function g0(e,t){return tk(t)&&yM(e.registeredThemes,t.themes)&&cX(e,t.langs)}function uX(e,t){if(!tk(t))return t;const n=lS(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:lS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const dX={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 fX(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function kM(e){const t=fX(e);return dX[t]??t}function bM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>kM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function xM(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 hX(e){return xM(e)?.join("\0")??""}function _M(e,t){const n=xM(e),s=bM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function sp(e,t){return`${hX(e)}\0\0${bM(t)?.join("\0")??""}`}function Fxe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=_M(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:sp(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function Oxe(e,t={},n){if(!e)return"ready";const s=_M(t.themes,t.langs),o=sp(s.themes,s.langs),i=n&&n===o?n:o,r=aX(e);if(r.completed.has(i))return"ready";if(g0(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)||g0(r,s))return r.completed.add(i),"ready";const c=uX(r,s),u=sp(c.themes,c.langs);return r.completed.has(u)||g0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(tk(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 Va(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function aS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var pX=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,p=this.pendingChars<=0;if(this.source+=d,p){const h=cS();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,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=cS();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),p=Math.min(100,Math.max(0,d-this.lastTick));if(p<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const h=this.pendingChars,m=h>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=yX(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=vX(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=Va(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Va(s,1e3,1)),this.normalizedTargetLatencyMs=Va(o,900,1),this.normalizedCatchUpLatencyMs=Va(i,350,1),this.normalizedCatchUpThreshold=aS(r,600),this.normalizedStartDelayMs=aS(a,80),this.maxCommitFps=Math.trunc(Va(l,30,1)),this.maxCharsPerCommit=Math.trunc(Va(c,80,1)),this.flushOnFinish=u,this.segmenter=gX(),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 mX(e={},t){const n=new pX(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 gX(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function vX(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 cS(){return typeof performance<"u"?performance.now():Date.now()}function yX(e,t,n){return Math.min(n,Math.max(t,e))}var kX=(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 Jg=Symbol.for("markstream-vue:node-lifecycle"),uS='<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>',dS='<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>',bX={id:"material",core:{"":dS,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:dS,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:uS,csharp:uS,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:()=>io(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},ev=new Map;let fS="material";const uc=new Map,hS=new Map;let tv=null;function xX(e){ev.set(e.id,e)}function _X(e){return kX(this,null,function*(){var t,n,s;if(uc.has(e.id))return(t=uc.get(e.id))!=null?t:null;let o=hS.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(uc.set(e.id,i),tv?.(),i)).catch(()=>(uc.set(e.id,null),null)),hS.set(e.id,o)),o})}const wX=ka(0);tv=()=>{wX.value++},xX(bX);const SX={"":"",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 nk(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=SX[n])!=null?t:n}function Rxe(e){const t=nk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Bxe(e){return(function(s){const o=ev.get(fS);if(!o)return;const i=o.core[s];if(i)return i;const r=uc.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!uc.has(o.id)&&_X(o)})(nk(e))||((n=(t=ev.get(fS))==null?void 0:t.fallback)!=null?n:"");var t,n}const Dxe={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 wM=!1;function Pxe(){return wM}function Hxe(){wM=!0}var fm=(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 Ho=null,eh=!1,hm=ok;function pm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function sk(){try{const e=globalThis;return pm(e?.katex)}catch{return null}}function ok(){return fm(null,null,function*(){const e=sk();if(e)return e;const t=yield io(()=>import("./katex-DnlPpQZa.js"),[]);try{yield io(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return pm(t)})}function CX(e){hm=e,Ho=null,eh=!1}function AX(e){CX(ok)}function SM(){return typeof hm=="function"}function Wxe(){var e;const t=hm;if(!t||t===ok)return null;if(Ho)return Ho;const n=sk();if(n)return Ho=n,Ho;try{const s=t();return s&&typeof s?.then!="function"?(Ho=(e=pm(s))!=null?e:s,Ho):null}catch{return null}}function ik(){return fm(this,null,function*(){var e;const t=sk();if(t)return Ho=t,Ho;if(Ho)return Ho;if(eh)return null;const n=hm;if(!n)return eh=!0,null;try{const s=yield n();if(s)return Ho=(e=pm(s))!=null?e:s,Ho}catch{}return eh=!0,null})}function CM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let ll=null,tl=null;const ui=new Map,xr=new Map;let op=5;const na=new Set;function yd(){if(ui.size<op&&na.size){const e=Array.from(na);na.clear();for(const t of e)try{t()}catch{}}}function MX(e){ll=e,tl=null,ll.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=ui.get(n);if(i)if(ui.delete(n),clearTimeout(i.timeoutId),yd(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(xr.set(a,s),xr.size>200){const c=xr.keys().next().value;xr.delete(c)}}i.resolve(s)}},ll.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of ui.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));ui.clear(),yd()}}function EX(){var e;ll&&((e=ll.terminate)==null||e.call(ll)),ll=null,tl=null}function TX(e,t=!0,n=2e3,s){return fm(this,null,function*(){performance.now();const o=CM(e);if(!SM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(tl)return Promise.reject(tl);const i=`${t?"d":"i"}:${o}`,r=xr.get(i);if(r)return Promise.resolve(r);const l=ll||(tl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),tl.name="WorkerInitError",tl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(tl);if(ui.size>=op){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=ui.size,a.max=op,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const h=new Error("Aborted");return h.name="AbortError",void c(h)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{ui.delete(u);const h=new Error("Worker render timed out");h.name="WorkerTimeout",h.code="WORKER_TIMEOUT",c(h),yd()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),ui.has(u)&&ui.delete(u);const h=new Error("Aborted");h.name="AbortError",c(h),yd()},{once:!0});const f=a,p=c;ui.set(u,{resolve:h=>{f(h)},reject:h=>{p(h)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function zxe(e,t=!0,n){const s=`${t?"d":"i"}:${CM(e)}`;if(xr.set(s,n),xr.size>200){const o=xr.keys().next().value;xr.delete(o)}}const NX="WORKER_BUSY";function IX(e=2e3,t){return ui.size<op?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),na.delete(r),n())};if(na.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,na.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>yd()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),na.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const vu={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Uxe(e){return fm(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!SM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:vu.timeout,c=(i=s.waitTimeout)!=null?i:vu.waitTimeout,u=(r=s.backoffMs)!=null?r:vu.backoffMs,d=(l=s.maxRetries)!=null?l:vu.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):vu.maxRetries,p=s.signal;let h=0;for(;;){if(p?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield TX(t,n,a,p)}catch(m){if(m?.code!==NX||h>=f)throw m;if(h++,yield IX(c,p).catch(()=>{}),p?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*h)))}}})}function dc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function $X(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 nv(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=$X(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 sv(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 AM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function ov(e,t=360,n=500){return AM(e,t,n)}function iv(e,t=360,n=500){return AM(e,t,n)}var LX=Object.defineProperty,FX=Object.defineProperties,OX=Object.getOwnPropertyDescriptors,pS=Object.getOwnPropertySymbols,RX=Object.prototype.hasOwnProperty,BX=Object.prototype.propertyIsEnumerable,mS=(e,t,n)=>t in e?LX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MM=(e,t)=>{for(var n in t||(t={}))RX.call(t,n)&&mS(e,n,t[n]);if(pS)for(var n of pS(t))BX.call(t,n)&&mS(e,n,t[n]);return e},rk=(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 lk=()=>io(()=>import("./mermaid.core-BU-yVv7K.js").then(e=>e.bn),[]);let ar=null,ak=lk;function DX(e){ak=e,ar=null}function PX(e){DX(lk)}function HX(){return typeof ak=="function"}function gS(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=MM({},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},FX(n,OX(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function vS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=MM({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 jxe(){return rk(this,null,function*(){if(ar)return ar;const e=(function(){try{const s=globalThis;return gS(s?.mermaid)}catch{return null}})();if(e)return ar=e,vS(ar),ar;const t=ak;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===lk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(ar=gS(n),vS(ar),ar):null})}let so=null,nl=null;const Bs=new Map;let yS=5,kS=!1;const WX="WORKER_BUSY",zX="MERMAID_DISABLED";function UX(e){so=e,nl=null;const t=e;so.onmessage=n=>{if(so!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Bs.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},so.onerror=n=>{var s,o;if(so===t)if(Bs.size!==0){try{kS?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 Bs.entries())r.reject(new Error(`Worker error: ${n.message}`));Bs.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},so.onmessageerror=n=>{var s,o;if(so===t)if(Bs.size!==0){try{kS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Bs.entries())r.reject(new Error("Worker messageerror"));Bs.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function jX(){var e;if(so)try{for(const[t,n]of Bs.entries())n.reject(new Error("Worker cleared"));Bs.clear(),(e=so.terminate)==null||e.call(so)}catch{}so=null,nl=null}function EM(e,t,n=1400){if(!HX()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=zX,Promise.reject(o)}if(nl)return Promise.reject(nl);const s=so||(nl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),nl.name="WorkerInitError",nl.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(nl);if(Bs.size>=yS){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=WX,o.inFlight=Bs.size,o.max=yS,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),Bs.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Bs.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Bs.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=Bs.get(r);f&&f.reject(d)},n)})}function qxe(e,t,n=1400){return rk(this,null,function*(){try{return yield EM("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Vxe(e,t,n=1400){return rk(this,null,function*(){try{return yield EM("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function Kxe(){if(so)try{for(const[e,t]of Bs.entries())t.reject(new Error("Worker terminated"));Bs.clear(),so.terminate()}finally{so=null}}var qX=Object.defineProperty,VX=Object.defineProperties,KX=Object.getOwnPropertyDescriptors,bS=Object.getOwnPropertySymbols,GX=Object.prototype.hasOwnProperty,YX=Object.prototype.propertyIsEnumerable,xS=(e,t,n)=>t in e?qX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))GX.call(t,n)&&xS(e,n,t[n]);if(bS)for(var n of bS(t))YX.call(t,n)&&xS(e,n,t[n]);return e},qt=(e,t)=>VX(e,KX(t)),Gn=(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 ZX="__global__",v0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",rv=(()=>{const e=globalThis;if(e[v0])return e[v0];const t={scopedCustomComponents:{},revision:ka(0)};return e[v0]=t,t})(),_S=rv.revision,QX=Symbol("markstreamCustomComponents"),XX=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 Od(e){return XX.has(String(e).trim().toLowerCase())}function JX(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function y0(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([yi(n),yi(JX(n))]))!o||Od(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function ys(e){const t=Yt(QX,null);return D(()=>{var n;return _S.value,(function(s,o={}){return _S.value,rt(rt(rt({},y0(rv.scopedCustomComponents[ZX]||{})),y0(o)),y0((function(i){return i&&rv.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const eJ=["aria-label"],tJ={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"},nJ={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},_n=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},jo=_n(Ve({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),N("svg",nJ,[...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(),N("svg",tJ,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,eJ))}),[["__scopeId","data-v-be21ab83"]]);jo.install=e=>{e.component(jo.__name,jo)};const sJ={class:"emoji-node"},So=_n(Ve({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("span",sJ,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);So.install=e=>{e.component(So.__name,So)};const oJ=["id"],iJ=["title"],qo=_n(Ve({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(b(),N("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,iJ)],8,oJ))}}),[["__scopeId","data-v-c1463a29"]]);qo.install=e=>{e.component(qo.__name,qo)};const TM=(()=>{try{return!1}catch{}return!1})();function k0(e){TM&&console.warn(e)}function wS(e,t="safe",n){return ek(e,t,n)}function NM(e){return DQ(e)}function b0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function ck(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Xg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),b0(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),b0(r.value)]):Object.entries(o).map(([r,l])=>[r,b0(l)]):null,t,n);var o;if(!s)return;const i=NM(np(s));return Object.keys(i).length>0?i:void 0}function SS(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 yu(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function x0(e,t,n,s,o,i,r=!1){const l=(function(d,f){return hM(d,f)})(e,s);if($d.has(e.toLowerCase())||!l&&uM(e,i))return null;if(!l&&Jy(e,i))return r?[SS(e,t,!0)]:[SS(e,t),...n,`</${e}>`];const a=ek(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=NM(a);return bn(d,qt(rt({},f),{key:u}),n.length>0?n:void 0)}return bn(e,qt(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function IM(e,t){return zQ(e,t)}function ip(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=x0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);yu(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 p=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){p=h;break}if(p!==-1)for(;c.length>p;){const h=c.pop(),m=x0(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?yu(c[c.length-1].children,m):yu(u,m),h.tagName.toLowerCase()!==f&&c.length>p&&k0(`Auto-closing unclosed tag: <${h.tagName}>`)}else k0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=x0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?yu(c[c.length-1].children,f):yu(u,f),k0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(PQ(e),t,n)}catch(o){return s=o,TM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const rJ=["innerHTML"],Vo=_n(Ve({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Yt("markstreamHtmlPolicy",void 0),s=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=ys(()=>t.customId),i=Ve({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:Cc(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=ip(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!IM(l,o.value))return{mode:"html",content:Cc(l,s.value)};const a=ip(l,o.value,s.value);return a===null?{mode:"html",content:Cc(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),N("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(),N("span",{key:1,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(b(),N("span",{key:2,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,rJ))}}),[["__scopeId","data-v-d17f12b0"]]);Vo.install=e=>{e.component(Vo.__name,Vo)};const lJ={class:"inline-code"},aJ={key:0},Qs=_n(Ve({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Ad(),s=Yt("markstreamFade",void 0),o=Yt("markstreamTextStreamState",void 0),i=Yt("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 p=i?.value;const h=Q(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}Ge([()=>t.node.code,u,l,()=>i?.value],([g,v,y,A])=>{const L=String(g??""),$=u.value,x=A!==p;p=A;const E=vM({nextContent:L,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:x});d.value=E.settledContent,f.value=E.streamedDelta,E.appended&&(h.value+=1),$&&o?.set($,L)},{immediate:!0}),Ge(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const k=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(b(),N("code",lJ,[c.value?(b(),N(Be,{key:0},[Ye(O(a.value),1)],64)):(b(),N(Be,{key:1},[d.value?(b(),N("span",aJ,O(d.value),1)):re("",!0),f.value?(b(),N("span",{key:1,class:Pe(["inline-code-stream-delta",[k.value]]),onAnimationend:_},O(f.value),35)):re("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const lv=Q(!1),CS=Q(""),AS=Q("top"),Uu=Q(null),ju=Q(null),av=Q(null),cv=Q(null),MS=Q(null);let th=null,nh=null,uv=0;function $M(){th&&(clearTimeout(th),th=null),nh&&(clearTimeout(nh),nh=null)}let Ff=!1,Of=null,ES=!1;function cJ(e,t,n="top",s=!1,o,i){if(!e)return;const r=++uv;$M();const l=()=>Gn(null,null,function*(){var a,c;if(yield(function(){return Gn(this,null,function*(){if(!Ff&&!ES&&typeof document<"u"){Of!=null||(Of=Gn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([io(()=>import("./vue.runtime.esm-bundler-DPzO-Tma.js"),[]),io(()=>import("./Tooltip-BzkYFuS-.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var h;return d(f,{visible:lv.value,"anchor-el":Uu.value,content:CS.value,placement:AS.value,id:ju.value,originX:av.value,originY:cv.value,isDark:(h=MS.value)!=null?h:void 0})}}).mount(p),Ff=!0}));try{yield Of}catch(u){Ff=!1,Of=null,ES=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Ff&&r===uv){ju.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Uu.value=e,CS.value=t,AS.value=n,av.value=(a=o?.x)!=null?a:null,cv.value=(c=o?.y)!=null?c:null,MS.value=typeof i=="boolean"?i:null,lv.value=!0;try{e.setAttribute("aria-describedby",ju.value)}catch{}}});s?l():th=setTimeout(l,80)}function uJ(e=!1){uv+=1,$M();const t=()=>{if(Uu.value&&ju.value)try{Uu.value.removeAttribute("aria-describedby")}catch{}lv.value=!1,Uu.value=null,ju.value=null,av.value=null,cv.value=null};e?t():nh=setTimeout(t,120)}const dv={"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..."},fv=e=>{var t;return(t=dv[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 TS(e){return{t(t){if(e.te&&dv[t]&&!e.te(t))return fv(t);const n=e.t(t);return n===t&&dv[t]?fv(t):n}}}function dJ(){const e=(function(){var t,n;try{const s=zs(),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 TS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return TS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:fv}}function fJ(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 hJ=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],pJ={key:1,class:"image-placeholder"},mJ={key:1,class:"image-node__raw-text"},gJ={key:0,class:"image-shimmer-overlay"},vJ={key:1,class:"image-node__raw-text"},yJ={key:2,class:"image-error"},fl=_n(Ve({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=Q(!1),i=Q(!1),r=Q(""),l=Q("primary"),a=Q(null),c=Ad(),u=Yt(Jg,null);let d="",f=null;const p=D(()=>cw(n.node.src)),h=D(()=>cw(n.fallbackSrc)),m=D(()=>r.value),_=D(()=>!n.lazy),k=D(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=D(()=>l.value==="failed"),v=D(()=>!_.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=D(()=>fJ(n,c));function A(B=y.value){B&&a.value&&u?.reportHeight(B,a.value.offsetHeight)}function L(B=y.value){B&&vt(()=>{A(B)})}function $(){f&&(clearTimeout(f),f=null)}function x(){const B=y.value;B&&d!==B&&(d&&u?.markSettled(d),$(),d=B,u?.markPending(B),typeof window<"u"&&(f=window.setTimeout(()=>{d===B&&(L(B),E())},8e3)))}function E(){return Gn(this,null,function*(){const B=d;B&&($(),d="",yield vt(),A(B),u?.markSettled(B))})}function T(){if(l.value==="primary"&&h.value&&h.value!==r.value)return l.value="fallback",r.value=h.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(B){B.preventDefault(),o.value&&!i.value&&s("click",[B,m.value])}const{t:I}=dJ();return Ge([p,h,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||p.value?(r.value=p.value,void(l.value="primary")):h.value?(r.value=h.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ge([k,o,i,m,()=>n.lazy],([B,R,P,W,U])=>B&&W&&!P?R?(E(),void L()):U?(x(),void L()):void(R||P||x()):(E(),void L()),{flush:"post",immediate:!0}),rs(()=>{(function(){const B=d;B&&($(),d="",u?.markSettled(B))})()}),(B,R)=>{var P,W,U,Z,z;return b(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[k.value?(b(),N("img",{key:0,src:m.value,alt:String((W=(P=n.node.alt)!=null?P:n.node.title)!=null?W:""),title:String((Z=(U=n.node.title)!=null?U:n.node.alt)!=null?Z:""),class:Pe(["image-node__img",{"is-loading":!_.value&&!o.value,"is-loaded":_.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(z=n.node.alt)!=null?z:C(I)("image.preview"),onError:T,onLoad:F,onClick:S},null,42,hJ)):re("",!0),e.node.loading&&!i.value?(b(),N("span",pJ,[n.usePlaceholder?On(B.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[0]||(R[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),N("span",mJ,O(e.node.raw),1))])):re("",!0),ie(gl,{name:"shimmer-fade"},{default:Ee(()=>[v.value&&!e.node.loading?(b(),N("span",gJ,[n.usePlaceholder?On(B.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[1]||(R[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(b(),N("span",vJ,O(e.node.raw),1))])):re("",!0)]),_:3}),g.value?(b(),N("span",yJ,[On(B.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[R[2]||(R[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"]]);fl.install=e=>{e.component(fl.__name,fl)};const kJ={key:2},Gi=Ve({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ys(()=>t.customId),s=Yt("markstreamHtmlPolicy",void 0),o=Yt("markstreamNestedRendererProps",void 0),i=D(()=>{var h;return(h=s?.value)!=null?h:"safe"}),r=D(()=>{var h,m;const _=(h=o?.value)!=null?h:{};return qt(rt({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=Ci({loader:()=>Promise.resolve().then(()=>gk),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),c=D(()=>!!(a.value&&n.value[t.node.type]&&!Od(String(t.node.type)))),u=D(()=>c.value?ck(t.node,i.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var h;return String((h=t.node.content)!=null?h:"")}),p=D(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>a.value&&c.value?(b(),xe(Ps(a.value),Sn({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:Ee(()=>[d.value?(b(),xe(C(l),Sn({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(),xe(C(l),Sn({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(),xe(Ps(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(),N("span",kJ,O(p.value),1)):re("",!0)}}),bJ=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],xJ={key:0,translate:"no",class:"markstream-pre__diff-code"},_J={class:"markstream-pre__diff-number","aria-hidden":"true"},wJ={class:"markstream-pre__diff-content"},SJ={class:"markstream-pre__diff-content-inner"},CJ={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},AJ=["textContent"],Po=Ve({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=D(()=>{var S,I,B;const R=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((B=String(R).split(/\s+/g)[0])!=null?B:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=D(()=>`language-${n.value}`),o=D(()=>{var S,I,B,R,P;return((S=t.node)==null?void 0:S.diff)===!0?String((B=(I=t.node)==null?void 0:I.code)!=null?B:""):(function(W,U){const Z=String(W??"");return U?Z:Z.replace(/\r\n$|\n$|\r$/,"")})((R=t.node)==null?void 0:R.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",B={}){const R=u(S);return{code:S,kind:R&&I!=="hunk"&&!B.preserveBlankKind?"context":I,empty:R}}function f(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function p(S,I){return!u(S[I])||I<S.length-1}function h(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function _(S,I){const B=f(S),R=f(I),P=(function(de,J){const Y=de.length,X=J.length;if((Y+1)*(X+1)>15e5)return null;const fe=X+1,ce=new Uint32Array((Y+1)*(X+1));for(let le=1;le<=Y;le++)for(let he=1;he<=X;he++){const j=le*fe+he;if(de[le-1]===J[he-1])ce[j]=ce[(le-1)*fe+(he-1)]+1;else{const ne=ce[(le-1)*fe+he],ve=ce[le*fe+(he-1)];ce[j]=ne>=ve?ne:ve}}const We=[];let ge=Y,G=X;for(;ge>0&&G>0;)de[ge-1]===J[G-1]?(We.push({originalIndex:ge-1,modifiedIndex:G-1}),ge--,G--):ce[(ge-1)*fe+G]>=ce[ge*fe+(G-1)]?ge--:G--;return We.reverse(),We})(B,R);if(P){const de=[];let J=0,Y=0;for(const X of P){for(;J<X.originalIndex;)de.push(qt(rt({},d(B[J],"removed",{preserveBlankKind:p(B,J)})),{key:`inline-removed-source-${J}`,number:""})),J++;for(;Y<X.modifiedIndex;)de.push(qt(rt({},d(R[Y],"added",{preserveBlankKind:p(R,Y)})),{key:`inline-added-source-${Y}`,number:Y+1})),Y++;de.push(qt(rt({},d(R[X.modifiedIndex])),{key:`inline-context-source-${X.originalIndex}-${X.modifiedIndex}`,number:X.modifiedIndex+1})),J=X.originalIndex+1,Y=X.modifiedIndex+1}for(;J<B.length;)de.push(qt(rt({},d(B[J],"removed",{preserveBlankKind:p(B,J)})),{key:`inline-removed-source-${J}`,number:""})),J++;for(;Y<R.length;)de.push(qt(rt({},d(R[Y],"added",{preserveBlankKind:p(R,Y)})),{key:`inline-added-source-${Y}`,number:Y+1})),Y++;return de}const W=[];let U=0,Z=B.length-1,z=R.length-1;for(;U<=Z&&U<=z&&B[U]===R[U];)W.push(qt(rt({},d(R[U])),{key:`inline-prefix-${U}`,number:U+1})),U++;const ee=[];for(;Z>=U&&z>=U&&B[Z]===R[z];)ee.unshift(qt(rt({},d(R[z])),{key:`inline-suffix-${z}`,number:z+1})),Z--,z--;for(let de=U;de<=Z;de++)W.push(qt(rt({},d(B[de],"removed",{preserveBlankKind:p(B,de)})),{key:`inline-removed-source-${de}`,number:""}));for(let de=U;de<=z;de++)W.push(qt(rt({},d(R[de],"added",{preserveBlankKind:p(R,de)})),{key:`inline-added-source-${de}`,number:de+1}));return W.concat(ee)}const k=D(()=>{var S,I,B,R;const P=(function(z){const ee=z.some(J=>h(J)),de=z.some(J=>m(J));return ee&&de||(function(){var J,Y,X,fe;if(n.value==="diff")return!0;const ce=(fe=(X=String((Y=(J=t.node)==null?void 0:J.raw)!=null?Y:"").split(/\r?\n/,1)[0])==null?void 0:X.trim())!=null?fe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ce)})()&&(ee||de)})(i.value),W=(function(){var z,ee;return((z=t.node)==null?void 0:z.originalCode)!=null||((ee=t.node)==null?void 0:ee.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:P?(function(z){const ee=[];let de=1;for(const[J,Y]of z.entries())if(Y.startsWith("@@"))ee.push(qt(rt({},d(Y,"hunk")),{key:`inline-hunk-${J}`,number:""}));else if(h(Y))ee.push(qt(rt({},d(Y.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${J}`,number:""}));else if(m(Y))ee.push(qt(rt({},d(Y.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${J}`,number:de++}));else{const X=Y.startsWith(" ")?Y.slice(1):Y;ee.push(qt(rt({},d(X)),{key:`inline-context-${J}`,number:de})),de++}return ee})(i.value):_((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!P&&W){const z=f((B=t.node)==null?void 0:B.originalCode),ee=f((R=t.node)==null?void 0:R.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:z.map((de,J)=>{const Y=ee[J]===de?"context":"removed";return qt(rt({},d(de,Y,{preserveBlankKind:p(z,J)})),{key:`original-${J}`,number:J+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ee.map((de,J)=>{const Y=z[J]===de?"context":"added";return qt(rt({},d(de,Y,{preserveBlankKind:p(ee,J)})),{key:`modified-${J}`,number:J+1})})}]}const U=[],Z=[];for(const z of i.value)if(z.startsWith("@@"))U.push(d(z,"hunk")),Z.push(d(z,"hunk"));else if(z.startsWith("-")&&!z.startsWith("---"))U.push(d(z.slice(1),"removed",{preserveBlankKind:!0}));else if(z.startsWith("+")&&!z.startsWith("+++"))Z.push(d(z.slice(1),"added",{preserveBlankKind:!0}));else{const ee=z.startsWith(" ")?z.slice(1):z;U.push(d(ee)),Z.push(d(ee))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((z,ee)=>qt(rt({},z),{key:`original-${ee}`,number:ee+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((z,ee)=>qt(rt({},z),{key:`modified-${ee}`,number:ee+1}))}]}),g=D(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Q(null),y=Q([]);let A=null,L=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function x(S,I){var B;if(!S)return I;const R=S.querySelector(".markstream-pre__diff-content"),P=R?.getBoundingClientRect(),W=(B=P?.height)!=null?B:0;return Math.max(I,Math.ceil(W))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,I;A=null;const B=v.value;if(!B||!l.value)return void(y.value.length&&(y.value=[]));const R=(function(de){const J=window.getComputedStyle(de),Y=$(J.getPropertyValue("--markstream-pre-diff-line-height"));if(Y>0)return Y;const X=$(J.lineHeight);return X>0?X:18})(B),P=Array.from(B.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),W=Array.from(B.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),U=Math.max(P.length,W.length),Z=[];for(let de=0;de<U;de++){const J=x((S=P[de])!=null?S:null,R),Y=x((I=W[de])!=null?I:null,R),X=Math.max(R,J,Y);Z.push({rowHeight:X,originalHeight:J,modifiedHeight:Y})}var z,ee;z=y.value,ee=Z,z.length===ee.length&&z.every((de,J)=>{const Y=ee[J];return Y&&Math.abs(de.rowHeight-Y.rowHeight)<=.5&&Math.abs(de.originalHeight-Y.originalHeight)<=.5&&Math.abs(de.modifiedHeight-Y.modifiedHeight)<=.5})||(y.value=Z)})()}))}function T(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{E()}),L.observe(S))}function F(S,I){const B=y.value[S];if(!B)return;const R=I==="original"?B.originalHeight:B.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(B.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(R)}px`}}return Ge(v,S=>{T(S),vt(()=>E())},{flush:"post"}),Ge([l,k],()=>{T(v.value),vt(()=>E())},{flush:"post",immediate:!0}),rs(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),L?.disconnect(),L=null}),(S,I)=>(b(),N("pre",{ref_key:"preRef",ref:v,style:Jt(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(),N("code",xJ,[(b(!0),N(Be,null,st(k.value,B=>(b(),N("span",{key:B.key,class:Pe(["markstream-pre__diff-pane",B.className])},[(b(!0),N(Be,null,st(B.lines,(R,P)=>(b(),N("span",{key:R.key,class:Pe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${R.kind}`,{"markstream-pre__diff-line--empty":R.empty}]]),style:Jt(F(P,B.key))},[I[0]||(I[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",_J,O(R.number),1),w("span",wJ,[w("span",SJ,O(R.code),1)])],6))),128))],2))),128))])):(b(),N(Be,{key:1},[t.showLineNumbers?(b(),N("span",CJ,[(b(!0),N(Be,null,st(r.value,B=>(b(),N("span",{key:B,class:"markstream-pre__line-number"},O(B),1))),128))])):re("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,AJ)],64))],14,bJ))}});Po.install=e=>{e.component(Po.__name,Po)};const _0=ka(!1);let NS=null;const MJ={key:0},ns=_n(Ve({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(NS||(NS=ik().then(k=>{_0.value=!!k}).catch(()=>{_0.value=!1})),mh(_0)),s=Ad(),o=Yt("markstreamFade",void 0),i=Yt("markstreamTextStreamState",void 0),r=Yt("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 p=Q(0);function h(){return u.value+d.value}function m(){d.value&&(u.value=h(),d.value="")}Ge([()=>t.node.content,c,a,()=>r?.value],([k,g,v,y])=>{const A=String(k??""),L=c.value,$=y!==f;f=y;const x=vM({nextContent:A,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=x.settledContent,d.value=x.streamedDelta,x.appended&&(p.value+=1),L&&i?.set(L,A)},{immediate:!0}),Ge(a,k=>{var g;k||(g=h(),u.value=g,d.value="")});const _=D(()=>p.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,g)=>(b(),N("span",{class:Pe([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(b(),N("span",MJ,O(u.value),1)):re("",!0),d.value?(b(),N("span",{key:1,class:Pe(["text-node-stream-delta",[_.value]]),onAnimationend:m},O(d.value),35)):re("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);ns.install=e=>{e.component(ns.__name,ns)};const LM=Ve({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return bn(Po,qt(rt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),w0=Ci({loader:()=>Gn(null,null,function*(){try{return(yield io(()=>import("./CodeBlockNode-B5sM5iYb.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),Po}}),loadingComponent:LM,delay:0,suspensible:!1}),Ni=Ci(()=>Gn(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 bn(ns,qt(rt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield ik())return(yield io(()=>import("./index6-Bu6r1Fdb.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 bn(ns,qt(rt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),FM=Ci(()=>Gn(null,null,function*(){try{if(yield ik())return(yield io(()=>import("./index5-CuGXaX2S.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 bn(ns,qt(rt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),ao=_n(Ve({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);ao.install=e=>{e.component(ao.__name,ao)};const EJ={class:"superscript-node"},Co=_n(Ve({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ys(()=>t.customId),s=D(()=>rt({text:ns,inline_code:Qs,link:fo,html_inline:Vo,strong:co,emphasis:ho,footnote_reference:qo,strikethrough:uo,highlight:Ko,insert:Mo,subscript:Ao,emoji:So,math_inline:Ni,reference:ao},n.value));return(o,i)=>(b(),N("sup",EJ,[(b(!0),N(Be,null,st(e.node.children,(r,l)=>(b(),xe(C(Gi),{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"]]);Co.install=e=>{e.component(Co.__name,Co)};const TJ={class:"subscript-node"},Ao=_n(Ve({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ys(()=>t.customId),s=D(()=>rt({text:ns,inline_code:Qs,link:fo,html_inline:Vo,strong:co,emphasis:ho,footnote_reference:qo,strikethrough:uo,highlight:Ko,insert:Mo,superscript:Co,emoji:So,math_inline:Ni,reference:ao},n.value));return(o,i)=>(b(),N("sub",TJ,[(b(!0),N(Be,null,st(e.node.children,(r,l)=>(b(),xe(C(Gi),{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"]]);Ao.install=e=>{e.component(Ao.__name,Ao)};const NJ={class:"strong-node"},co=_n(Ve({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ys(()=>t.customId),s=D(()=>rt({text:ns,inline_code:Qs,link:fo,html_inline:Vo,emphasis:ho,strikethrough:uo,highlight:Ko,insert:Mo,subscript:Ao,superscript:Co,emoji:So,footnote_reference:qo,math_inline:Ni,reference:ao},n.value));return(o,i)=>(b(),N("strong",NJ,[(b(!0),N(Be,null,st(e.node.children,(r,l)=>(b(),xe(C(Gi),{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"]]);co.install=e=>{e.component(co.__name,co)};const IJ={class:"strikethrough-node"},uo=_n(Ve({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ys(()=>t.customId),s=D(()=>rt({text:ns,inline_code:Qs,link:fo,html_inline:Vo,strong:co,emphasis:ho,highlight:Ko,insert:Mo,subscript:Ao,superscript:Co,emoji:So,footnote_reference:qo,math_inline:Ni,reference:ao},n.value));return(o,i)=>(b(),N("del",IJ,[(b(!0),N(Be,null,st(e.node.children,(r,l)=>(b(),xe(C(Gi),{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"]]);uo.install=e=>{e.component(uo.__name,uo)};const $J=["href","title","aria-label","aria-hidden","target","rel"],LJ=["aria-hidden"],FJ={class:"link-text-wrapper relative inline-flex"},OJ={class:"leading-[normal] link-text"},fo=_n(Ve({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Yt("markstreamShowTooltips",void 0),s=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=D(()=>{var k,g,v,y,A;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(k=t.animationOpacity)!=null?k:.35,x=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(x),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=ys(()=>t.customId),r=D(()=>rt({text:ns,strong:co,strikethrough:uo,emphasis:ho,image:fl,html_inline:Vo,inline_code:Qs},i.value)),l=Ad(),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 A of v)Array.isArray(A)&&A[0]&&(y[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,L]of Object.entries(v))A&&L!=null&&L!==!1&&(y[A]=L===!0?"":String(L));return wS(y,"safe","a")}),c=D(()=>rt(rt({},l),a.value)),u=D(()=>{var k,g;return wS({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())||(CK(u.value)?"_blank":void 0)}),f=D(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),p=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}),h=D(()=>{const k=rt({},c.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function m(){s.value&&uJ()}const _=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(),N("span",Sn({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",FJ,[w("span",OJ,[ie(C(ns),{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,LJ)):(b(),N("a",Sn({key:0,class:"link-node",href:u.value,title:s.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},h.value,{style:o.value,onMouseenter:g[0]||(g[0]=A=>(function(L){var $,x,E,T;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)||((x=u.value)!=null&&x.includes("xn--")&&((T=(E=t.node)==null?void 0:E.text)!=null&&T.includes("://"))?t.node.text:u.value)||"";cJ(L.currentTarget,I,"top",!1,S)})(A)),onMouseleave:m}),[(b(!0),N(Be,null,st(e.node.children,(A,L)=>(b(),xe(C(Gi),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,$J))}}}),[["__scopeId","data-v-367e6ca4"]]);fo.install=e=>{e.component(fo.__name,fo)};const RJ={class:"insert-node"},Mo=_n(Ve({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ys(()=>t.customId),s=D(()=>rt({text:ns,inline_code:Qs,link:fo,html_inline:Vo,strong:co,emphasis:ho,strikethrough:uo,highlight:Ko,subscript:Ao,superscript:Co,emoji:So,footnote_reference:qo,math_inline:Ni,reference:ao},n.value));return(o,i)=>(b(),N("ins",RJ,[(b(!0),N(Be,null,st(e.node.children,(r,l)=>(b(),xe(C(Gi),{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"]]);Mo.install=e=>{e.component(Mo.__name,Mo)};const BJ={class:"highlight-node"},Ko=_n(Ve({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ys(()=>t.customId),s=D(()=>rt({text:ns,inline_code:Qs,link:fo,html_inline:Vo,strong:co,emphasis:ho,strikethrough:uo,insert:Mo,subscript:Ao,superscript:Co,emoji:So,footnote_reference:qo,math_inline:Ni,reference:ao},n.value));return(o,i)=>(b(),N("mark",BJ,[(b(!0),N(Be,null,st(e.node.children,(r,l)=>(b(),xe(C(Gi),{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"]]);Ko.install=e=>{e.component(Ko.__name,Ko)};const DJ={class:"emphasis-node"},ho=_n(Ve({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ys(()=>t.customId),s=D(()=>rt({text:ns,inline_code:Qs,link:fo,html_inline:Vo,strong:co,strikethrough:uo,highlight:Ko,insert:Mo,subscript:Ao,superscript:Co,emoji:So,footnote_reference:qo,math_inline:Ni,reference:ao},n.value));return(o,i)=>(b(),N("em",DJ,[(b(!0),N(Be,null,st(e.node.children,(r,l)=>(b(),xe(C(Gi),{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"]]);ho.install=e=>{e.component(ho.__name,ho)};const PJ={class:"hard-break"},hl=_n(Ve({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("br",PJ))}),[["__scopeId","data-v-50c58f70"]]);hl.install=e=>{e.component(hl.__name,hl)};const kd=Ve({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=yt({checkbox:jo,checkbox_input:jo,emoji:So,emphasis:ho,hardbreak:hl,highlight:Ko,inline_code:Qs,insert:Mo,link:fo,reference:ao,strikethrough:uo,strong:co,subscript:Ao,superscript:Co,text:ns}),s=ys(()=>t.customId),o=D(()=>{const i=s.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(b(!0),N(Be,null,st(e.nodes,(l,a)=>(b(),xe(C(Gi),{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 hv(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(hv)}function rp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(hv))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(hv)?o:null}function Rc(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const HJ=["cite"],WJ={key:0,dir:"auto",class:"paragraph-node"},zJ=["custom-id"],sh=_n(Ve({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ys(()=>t.customId),s=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),i=D(()=>rp(t.node.children,!s.value)),r=D(()=>t.fade!==!1||o.value?null:Rc(i.value));return In("markstreamShowTooltips",D(()=>t.showTooltips)),In("markstreamFade",D(()=>t.fade)),(l,a)=>(b(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(b(),N("p",WJ,[r.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,zJ)):(b(),xe(C(kd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),xe(C(Eo),{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,HJ))}}),[["__scopeId","data-v-abfecebc"]]);sh.install=e=>{e.component(sh.__name,sh)};const UJ={class:"definition-list"},jJ={class:"definition-term"},qJ={class:"definition-desc"},oh=_n(Ve({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),N("dl",UJ,[(b(!0),N(Be,null,st(t.node.items,(o,i)=>(b(),N(Be,{key:i},[w("dt",jJ,[ie(C(Eo),{"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",qJ,[ie(C(Eo),{"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"]]);oh.install=e=>{e.component(oh.__name,oh)};const VJ=["href","title"],qu=_n(Ve({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(b(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,VJ))}}),[["__scopeId","data-v-e1eb37b6"]]);qu.install=e=>{e.component(qu.__name,qu)};const KJ=["id"],GJ={class:"flex-1"},ih=Ve({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(b(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",GJ,[ie(C(Eo),{"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,KJ))}});ih.install=e=>{e.component(ih.__name,ih)};const YJ=["custom-id"],pv=_n(Ve({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ys(()=>t.customId),s=Yt("markstreamFade",void 0),o=D(()=>s?.value!==!1||n.value.text?null:Rc(t.node.children)),i=D(()=>rt({text:ns,inline_code:Qs,link:fo,image:fl,strong:co,emphasis:ho,strikethrough:uo,highlight:Ko,insert:Mo,subscript:Ao,superscript:Co,emoji:So,checkbox:jo,checkbox_input:jo,footnote_reference:qo,hardbreak:hl,math_inline:Ni,reference:ao},n.value));return(r,l)=>(b(),xe(Ps(`h${e.node.level}`),Sn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[o.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,YJ)):(b(!0),N(Be,{key:1},st(e.node.children,(a,c)=>(b(),xe(C(Gi),{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"]]),lp=pv;lp.install=e=>{e.component(pv.__name,pv)};const ZJ={key:0,dir:"auto",class:"paragraph-node"},QJ=["custom-id"],XJ={dir:"auto",class:"paragraph-node"},JJ=["custom-id"],Ac=_n(Ve({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var p;return(p=t.node)!=null?p:t.item}),s=ys(()=>t.customId),o=D(()=>!!s.value.paragraph),i=D(()=>!!s.value.text),r=D(()=>{var p;return rp((p=n.value)==null?void 0:p.children,!o.value)}),l=D(()=>{var p;if(o.value)return null;const h=(p=n.value)==null?void 0:p.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const _=h.slice(1);if(!_.every(g=>g?.type==="list"))return null;const k=rp([m]);return k?{paragraphChildren:k,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=D(()=>a()?Rc(r.value):null),u=D(()=>{var p;return a()?Rc((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return In("markstreamShowTooltips",D(()=>t.showTooltips)),In("markstreamFade",D(()=>t.fade)),(p,h)=>{var m,_;return b(),N("li",Sn({class:"list-item",dir:"auto"},f.value),[r.value?(b(),N("p",ZJ,[c.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,QJ)):(b(),xe(C(kd),{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(),N(Be,{key:1},[w("p",XJ,[u.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,JJ)):(b(),xe(C(kd),{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),N(Be,null,st(l.value.nestedLists,(k,g)=>(b(),xe(C(Eo),{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:h[0]||(h[0]=v=>p.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(b(),xe(C(Eo),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=k=>p.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Ac.install=e=>{e.component(Ac.__name,Ac)};const Mc=_n(Ve({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ys(()=>e.customId),n=D(()=>t.value.list_item||Ac);return(s,o)=>(b(),xe(Ps(e.node.ordered?"ol":"ul"),{class:Pe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(b(!0),N(Be,null,st(e.node.items,(i,r)=>{var l;return b(),xe(Ps(n.value),Sn({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"]]);Mc.install=e=>{e.component(Mc.__name,Mc)};const OM=Symbol("ViewportPriority");function eee(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 p(){if(f!=null){try{l?.(f)}catch{}f=null}}function h(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||p()}}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),h()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&_())},{timeout:1200}))}Ge(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);p()}},{flush:"sync"});const k=(g,v)=>{const y=Q(!1);let A,L=!1;const $=new Promise(T=>{A=()=>{L||(L=!0,T())}}),x=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),h()};if(!o||!i.value)return y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:x};const E=(function(T,F){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(R,P){var W,U,Z;return{root:(W=e?.(R??null))!=null?W:null,rootMargin:(U=P?.rootMargin)!=null?U:"300px",threshold:(Z=P?.threshold)!=null?Z:0}})(T,F);if(a&&(B=S,(I=c)&&I.root===B.root&&I.rootMargin===B.rootMargin&&I.threshold===B.threshold))return a;var I,B;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(R=>{for(const P of R)(P.isIntersecting||P.intersectionRatio>0)&&m(P.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const R of u.keys())a.observe(R);return a})(g,v);return E?(u.set(g,{resolve:A,visible:y}),E.observe(g),d.add(g),_(),{isVisible:y,whenVisible:$,destroy:x}):(y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:x})};return In(OM,k),k}function tee(){var e,t;const n=Yt(OM,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 p=s.get(f);if(p){if(!p.visible.value){p.visible.value=!0;try{p.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 p=Q(!1);let h,m=!1;const _=new Promise(v=>{h=()=>{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:h,visible:p}),g.observe(f),i.add(f),d(),{isVisible:p,whenVisible:_,destroy:k}):(p.value=!0,h(),{isVisible:p,whenVisible:_,destroy:k})}}const nee={key:2,class:"html-block-node__raw"},see=["innerHTML"],oee={key:1,class:"html-block-node__placeholder"},Vu=_n(Ve({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Yt("markstreamHtmlPolicy",void 0),s=Yt("markstreamNestedRendererProps",void 0),o=D(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=D(()=>{var L,$;const x=(L=s?.value)!=null?L:{};return qt(rt({},x),{customId:($=t.customId)!=null?$:x.customId,htmlPolicy:o.value})}),r=Ci({loader:()=>Promise.resolve().then(()=>gk),suspensible:!1}),l=D(()=>{const L=Xg(t.node.attrs,o.value);if(!L)return;const $=np(L);return Object.keys($).length>0?$:void 0}),a=D(()=>{const L=String(t.node.tag||"").trim(),$=Xg(t.node.attrs,o.value,L);if(!$)return;const x=np($);return Object.keys(x).length>0?x:void 0}),c=ys(()=>t.customId),u=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Q(null),f=Q(typeof window>"u"),p=Q(t.node.content),h=D(()=>Array.isArray(t.node.children)?t.node.children:[]),m=D(()=>String(t.node.tag||"div")),_=D(()=>{const L=m.value.trim().toLowerCase();return b6.has(L)||Jy(L,o.value)}),k=D(()=>h.value.length>0&&!!t.node.tag&&!_.value),g=D(()=>{var L,$,x;if(k.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=p.value)!=null?L:""};const E=($=p.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Cc(E,o.value)};if(t.node.loading){const F=ip(E,c.value,o.value);return F===null?{mode:"text",content:(x=t.node.raw)!=null?x:E}:{mode:"dynamic",nodes:F}}if(!IM(E,c.value))return{mode:"html",content:Cc(E,o.value)};const T=ip(E,c.value,o.value);return T===null?{mode:"html",content:Cc(E,o.value)}:{mode:"dynamic",nodes:T}}),v=tee(),y=Q(null),A=!!t.node.loading;return typeof window<"u"?(Ge(d,L=>{var $,x;if((x=($=y.value)==null?void 0:$.destroy)==null||x.call($),y.value=null,!A)return f.value=!0,void(p.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}),Ge(()=>t.node.content,L=>{A&&!f.value||(p.value=L)})):f.value=!0,rs(()=>{var L,$;($=(L=y.value)==null?void 0:L.destroy)==null||$.call(L),y.value=null}),(L,$)=>(b(),xe(Ps(k.value?m.value:"div"),Sn({ref_key:"htmlRef",ref:d,class:"html-block-node"},k.value?a.value:void 0),{default:Ee(()=>[f.value?(b(),N(Be,{key:0},[g.value.mode==="structured"?(b(),xe(C(r),Sn({key:0},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(b(),xe(C(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(b(),N("pre",nee,O(g.value.content),1)):(b(),N("div",Sn({key:3},l.value,{innerHTML:g.value.content}),null,16,see))],64)):(b(),N("div",oee,[On(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"]]);Vu.install=e=>{e.component(Vu.__name,Vu)};const iee={dir:"auto",class:"paragraph-node"},ree=["custom-id"],ua=_n(Ve({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ys(()=>t.customId),s=Yt("markstreamHtmlPolicy",void 0),o=Yt("markstreamFade",void 0),i=Yt("markstreamParseOptions",void 0),r=Yt("markstreamCustomMarkdownIt",void 0),l=Yt("markstreamNestedRendererProps",void 0),a=D(()=>{var x;return(x=s?.value)!=null?x:"safe"}),c=D(()=>{var x;return(x=t.parseOptions)!=null?x:i?.value}),u=D(()=>{var x;return(x=t.customMarkdownIt)!=null?x:r?.value}),d=D(()=>{var x,E;return(E=t.customHtmlTags)!=null?E:(x=l?.value)==null?void 0:x.customHtmlTags}),f=D(()=>{var x,E;const T=(x=l?.value)!=null?x:{};return qt(rt({},T),{customId:(E=t.customId)!=null?E:T.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=Ci({loader:()=>Promise.resolve().then(()=>gk),suspensible:!1});function h(x){var E;return x.type==="text"&&String((E=x.content)!=null?E:"").trim()===""}const m=D(()=>t.node.children.filter(x=>!h(x))),_=D(()=>m.value.length>0&&m.value.every(x=>x.type==="image"||(function(E){var T;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!h(I)):[]})(E);return F.length===1&&((T=F[0])==null?void 0:T.type)==="image"})(x))),k=D(()=>new Set(zc(d.value))),g=D(()=>{if(!_.value||m.value.length<=1)return t.node.children;const x=[];for(let E=0;E<t.node.children.length;E++){const T=t.node.children[E];if(!h(T)){x.push(T);continue}const F=x.length>0,S=t.node.children.slice(E+1).some(I=>!h(I));F&&S&&x.push(qt(rt({},T),{content:" ",raw:" "}))}return x}),v=D(()=>o?.value===!1&&!n.value.text),y=D(()=>v.value?Rc(g.value):null);function A(x,E){return{node:x,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=D(()=>rt({inline_code:Qs,image:fl,link:fo,hardbreak:hl,emphasis:ho,strong:co,strikethrough:uo,highlight:Ko,insert:Mo,subscript:Ao,superscript:Co,html_inline:Vo,html_block:Vu,emoji:So,checkbox:jo,math_inline:Ni,checkbox_input:jo,reference:ao,footnote_anchor:qu,footnote_reference:qo,text:ns},n.value)),$=D(()=>g.value.map((x,E)=>{var T;const F=(function(S){var I,B,R,P;if(S.type==="html_block"||S.type==="html_inline"){const W=String((I=S.tag)!=null?I:"").trim().toLowerCase()||S6(S.content);if(W&&!k.value.has(W)&&C6((B=S.content)!=null?B:S.raw,W)){const U=String((P=(R=S.content)!=null?R:S.raw)!=null?P:"");return{child:{type:"text",content:U,raw:U},component:ns,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!Od(String(S.type)))}})(x);return qt(rt({},F),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:F.isCustomComponent?ck(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((T=F.child.content)!=null?T:""),originalChild:x})}));return(x,E)=>(b(),N("p",iee,[y.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(y.value),9,ree)):(b(!0),N(Be,{key:1},st($.value,T=>{return b(),N(Be,{key:T.key},[_.value&&h(T.originalChild)?(b(),N(Be,{key:0},[Ye(O((F=T.originalChild,String((S=F.content)!=null?S:""))),1)],64)):T.isCustomComponent?(b(),xe(Ps(T.component),Sn({key:1,ref_for:!0},T.customAttrs,{node:T.child,loading:T.child.loading,"index-key":T.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[T.hasSlotChildren?(b(),xe(C(p),Sn({key:0,ref_for:!0},f.value,{nodes:T.child.children,"index-key":T.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):T.slotContent?(b(),xe(C(p),Sn({key:1,ref_for:!0},f.value,{content:T.slotContent,final:!T.child.loading,"index-key":`${T.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(),xe(Ps(T.component),Sn({key:2,ref_for:!0},A(T.child,T.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);ua.install=e=>{e.component(ua.__name,ua)};const lee={class:"table-node-wrapper"},aee=["aria-busy"],cee={key:0},uee=["custom-id"],dee=["aria-label","onPointerdown"],fee=["custom-id"],hee={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Ku=_n(Ve({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=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=ys(()=>t.customId),d=D(()=>!!u.value.text),f=D(()=>!!u.value.paragraph),p=new WeakMap;function h(k){const g=t.fade===!1&&!d.value,v=!f.value,y=p.get(k);if(y?.children===k.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const A=rp(k.children,v,!0),L={simpleChildren:A,plainText:A&&g?Rc(A):null};return p.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))),A=[...r.widths];A[r.index]=y,A[r.index+1]=g-y,i.value=A}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return Ge(l,()=>{_(),i.value=[]}),rs(_),(k,g)=>(b(),N("div",lee,[w("table",{ref_key:"tableRef",ref:o,class:Pe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),N("colgroup",cee,[(b(!0),N(Be,null,st(e.node.header.cells,(v,y)=>(b(),N("col",{key:y,style:Jt(c.value[y])},null,4))),128))])):re("",!0),w("thead",null,[w("tr",null,[(b(!0),N(Be,null,st(e.node.header.cells,(v,y)=>(b(),N("th",{key:y,dir:"auto",class:Pe([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[h(v).plainText!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(h(v).plainText),9,uee)):h(v).simpleChildren?(b(),xe(C(kd),{key:1,nodes:h(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(b(),xe(C(Eo),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>k.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(b(),N("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:A=>(function(L,$){if($.button!==0)return;const x=(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=x[L],T=x[L+1];E&&T&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:E,nextStartWidth:T,widths:x},i.value=x,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,A)},null,40,dee)):re("",!0)],2))),128))])]),w("tbody",null,[(b(!0),N(Be,null,st(s.value,(v,y)=>(b(),N("tr",{key:y},[(b(!0),N(Be,null,st(v.cells,(A,L)=>(b(),N("td",{key:L,class:Pe([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(A).plainText!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},O(h(A).plainText),9,fee)):h(A).simpleChildren?(b(),xe(C(kd),{key:1,nodes:h(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),xe(C(Eo),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=$=>k.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,aee),ie(gl,{name:"table-node-fade"},{default:Ee(()=>[n.value?(b(),N("div",hee,[On(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"]]);Ku.install=e=>{e.component(Ku.__name,Ku)};const pee={class:"hr-node"},rh=_n({},[["render",function(e,t){return b(),N("hr",pee)}],["__scopeId","data-v-39b2349c"]]);rh.install=e=>{e.component(rh.__name,rh)};const mee={class:"unknown-node"},mv=Ve({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),N("div",mee,O(e.node.raw),1))}),lh=_n(Ve({__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=ys(()=>t.customId),o=D(()=>rt({text:ns,paragraph:ua,heading:lp,inline_code:Qs,link:fo,image:fl,strong:co,emphasis:ho,strikethrough:uo,insert:Mo,subscript:Ao,superscript:Co,checkbox:jo,checkbox_input:jo,hardbreak:hl,math_inline:Ni,reference:ao,list:Mc,math_block:FM,table:Ku},s.value));return(i,r)=>(b(),N("div",Sn({class:n.value},e.node.attrs),[(b(!0),N(Be,null,st(e.node.children,(l,a)=>{return b(),xe(Ps((c=l.type,o.value[c]||mv)),{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"]]);lh.install=e=>{e.component(lh.__name,lh)};const gee=["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"],IS=[[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 vee(e){if(e<=255)return gee[e];let t=0,n=IS.length-1;for(;t<=n;){const s=t+n>>1,o=IS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const yee=/[ \t\n\r\f]+/g,kee=/[\t\n\r\f]| {2,}|^ | $/;let S0=null;const bee=new RegExp("\\p{Script=Arabic}","u"),mm=new RegExp("\\p{M}","u"),RM=new RegExp("\\p{Nd}","u");function $S(e){return bee.test(e)}function LS(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 wr(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(LS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(LS(n))return!0}}return!1}const xee=new Set([" "," ","⁠","\uFEFF"]);function _ee(e){return wr(e)}function gv(e){return!(function(t){const n=ap(t);return n!==null&&(uk.has(n)||pa.has(n))})(e)&&!(function(t){const n=ap(t);return n!==null&&xee.has(n)})(e)}const uk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),gm=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),dk=new Set(["'","’"]),pa=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),wee=new Set([":",".","،","؛"]),See=new Set(["၏"]),Cee=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Aee(e){if(fk(e))return!0;let t=!1;for(const n of e)if(pa.has(n))t=!0;else if(!t||!mm.test(n))return!1;return t}function Mee(e){for(const t of e)if(!uk.has(t)&&!pa.has(t))return!1;return e.length>0}function Eee(e){if(fk(e))return!0;for(const t of e)if(!gm.has(t)&&!dk.has(t)&&!mm.test(t))return!1;return e.length>0}function fk(e){let t=!1;for(const n of e)if(n!=="\\"&&!mm.test(n)){if(!(gm.has(n)||pa.has(n)||dk.has(n)))return!1;t=!0}return t}function BM(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 ap(e){if(e.length===0)return null;const t=BM(e,e.length);return e.slice(t)}function Tee(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(mm.test(s))n--;else{if(!gm.has(s)&&!dk.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Nee(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function FS(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 OS(e,t){return e&&t!==null&&wee.has(t)}function Iee(e){const t=ap(e);return t!==null&&See.has(t)}function $ee(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 vv(e){let t=e.length;for(;t>0;){const n=BM(e,t),s=e.slice(n,t);if(Cee.has(s))return!0;if(!pa.has(s))return!1;t=n}return!1}function Lee(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
275
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Fee=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function li(e){return e.length===1?e[0]:e.join("")}function Oee(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),li(n)}function Ree(e,t,n,s){if(!Fee.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=Lee(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:li(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:li(r),isWordLike:a,kind:i,start:l}),o}function C0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Bee=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Dee(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Bee.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Pee(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const Hee=new Set([":","-","/","×",",",".","+","–","—"]),RS=/^[A-Za-z0-9_]+[,:;]*$/,BS=/[,:;]+$/;function DS(e){for(const t of e)if(RM.test(t))return!0;return!1}function ah(e){if(e.length===0)return!1;for(const t of e)if(!RM.test(t)&&!Hee.has(t))return!1;return!0}function PS(e,t,n){var s,o,i;const r=(S0===null&&(S0=new Intl.Segmenter(void 0,{granularity:"word"})),S0);let l=0;const a=[],c=[],u=[],d=[],f=[],p=[],h=[],m=[],_=[],k=[],g=[],v=[];for(const x of r.segment(e))for(const E of Ree(x.segment,(s=x.isWordLike)!=null&&s,x.index,n)){let T=function(){p[U]!==null&&(c[U]=[FS(a,p,h,U)],p[U]=null),c[U].push(E.text),u[U]=u[U]||E.isWordLike,m[U]=m[U]||I,_[U]=_[U]||B,k[U]=P,g[U]=W,v[U]=OS(_[U],R)};const F=E.kind==="text",S=Nee(E.text,E.isWordLike,E.kind),I=wr(E.text),B=$S(E.text),R=ap(E.text),P=vv(E.text),W=Iee(E.text),U=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[U]==="text"&&I&&m[U]&&k[U]||F&&l>0&&d[U]==="text"&&Mee(E.text)&&m[U]||F&&l>0&&d[U]==="text"&&g[U]?T():F&&l>0&&d[U]==="text"&&E.isWordLike&&B&&v[U]?(T(),u[U]=!0):S!==null&&l>0&&d[U]==="text"&&p[U]===S?h[U]=((o=h[U])!=null?o:1)+1:F&&!E.isWordLike&&l>0&&d[U]==="text"&&(Aee(E.text)||E.text==="-"&&u[U])?T():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,f[l]=E.start,p[l]=S,h[l]=S===null?0:1,m[l]=I,_[l]=B,k[l]=P,g[l]=W,v[l]=OS(B,R),l++)}for(let x=0;x<l;x++)p[x]===null?a[x]=li(c[x]):a[x]=FS(a,p,h,x);for(let x=1;x<l;x++)d[x]==="text"&&!u[x]&&fk(a[x])&&d[x-1]==="text"&&(a[x-1]+=a[x],u[x-1]=u[x-1]||u[x],a[x]="");const y=Array.from({length:l},()=>null);let A=-1;for(let x=l-1;x>=0;x--){const E=a[x];if(E.length!==0){if(d[x]==="text"&&!u[x]&&Eee(E)&&A>=0&&d[A]==="text"){const T=(i=y[A])!=null?i:[];T.push(E),y[A]=T,f[A]=f[x],a[x]="";continue}A=x}}for(let x=0;x<l;x++){const E=y[x];E!=null&&(a[x]=Oee(E,a[x]))}let L=0;for(let x=0;x<l;x++){const E=a[x];E.length!==0&&(L!==x&&(a[L]=E,u[L]=u[x],d[L]=d[x],f[L]=f[x]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const $=(function(x){const E=x.texts.slice(),T=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let I=0;I<E.length-1;I++){if(F[I]!=="text"||F[I+1]!=="text"||!wr(E[I])||!wr(E[I+1]))continue;const B=Tee(E[I]);B!==null&&(E[I]=B.head,E[I+1]=B.tail+E[I+1],S[I+1]=S[I]+B.head.length)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(x){const E=[],T=[],F=[],S=[];for(let I=0;I<x.len;I++){const B=x.texts[I],R=x.kinds[I],P=x.isWordLike[I];if(R==="text"&&P&&RS.test(B)){const W=[B];let U=BS.test(B),Z=I+1;for(;U&&Z<x.len&&x.kinds[Z]==="text"&&x.isWordLike[Z]&&RS.test(x.texts[Z]);){const z=x.texts[Z];W.push(z),U=BS.test(z),Z++}E.push(li(W)),T.push(!0),F.push("text"),S.push(x.starts[I]),I=Z-1;continue}E.push(B),T.push(P),F.push(R),S.push(x.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(x){const E=[],T=[],F=[],S=[];for(let I=0;I<x.len;I++){const B=x.texts[I];if(x.kinds[I]==="text"&&B.includes("-")){const R=B.split("-");let P=R.length>1;for(let W=0;W<R.length;W++){const U=R[W];if(!P)break;U.length!==0&&DS(U)&&ah(U)||(P=!1)}if(P){let W=0;for(let U=0;U<R.length;U++){const Z=R[U],z=U<R.length-1?`${Z}-`:Z;E.push(z),T.push(!0),F.push("text"),S.push(x.starts[I]+W),W+=z.length}continue}}E.push(B),T.push(x.isWordLike[I]),F.push(x.kinds[I]),S.push(x.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(x){const E=[],T=[],F=[],S=[];for(let I=0;I<x.len;I++){const B=x.texts[I],R=x.kinds[I];if(R==="text"&&ah(B)&&DS(B)){const P=[B];let W=I+1;for(;W<x.len&&x.kinds[W]==="text"&&ah(x.texts[W]);)P.push(x.texts[W]),W++;E.push(li(P)),T.push(!0),F.push("text"),S.push(x.starts[I]),I=W-1;continue}E.push(B),T.push(x.isWordLike[I]),F.push(R),S.push(x.starts[I])}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(x){const E=[],T=[],F=[],S=[];for(let I=0;I<x.len;I++){const B=x.texts[I];if(E.push(B),T.push(x.isWordLike[I]),F.push(x.kinds[I]),S.push(x.starts[I]),!Pee(B))continue;const R=I+1;if(R>=x.len||C0(x.kinds[R]))continue;const P=[],W=x.starts[R];let U=R;for(;U<x.len&&!C0(x.kinds[U]);)P.push(x.texts[U]),U++;P.length>0&&(E.push(li(P)),T.push(!0),F.push("text"),S.push(W),I=U-1)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})((function(x){const E=x.texts.slice(),T=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let B=0;B<x.len;B++){if(F[B]!=="text"||!Dee(x,B))continue;const R=[E[B]];let P=B+1;for(;P<x.len&&!C0(F[P]);){R.push(E[P]),T[B]=!0;const W=E[P].includes("?");if(F[P]="text",E[P]="",P++,W)break}E[B]=li(R)}let I=0;for(let B=0;B<E.length;B++){const R=E[B];R.length!==0&&(I!==B&&(E[I]=R,T[I]=T[B],F[I]=F[B],S[I]=S[B]),I++)}return E.length=I,T.length=I,F.length=I,S.length=I,{len:I,texts:E,isWordLike:T,kinds:F,starts:S}})((function(x){const E=[],T=[],F=[],S=[];let I=0;for(;I<x.len;){const B=[x.texts[I]];let R=x.isWordLike[I],P=x.kinds[I],W=x.starts[I];if(P==="glue"){const U=[B[0]],Z=W;for(I++;I<x.len&&x.kinds[I]==="glue";)U.push(x.texts[I]),I++;const z=li(U);if(!(I<x.len&&x.kinds[I]==="text")){E.push(z),T.push(!1),F.push("glue"),S.push(Z);continue}B[0]=z,B.push(x.texts[I]),R=x.isWordLike[I],P="text",W=Z,I++}else I++;if(P==="text")for(;I<x.len&&x.kinds[I]==="glue";){const U=[];for(;I<x.len&&x.kinds[I]==="glue";)U.push(x.texts[I]),I++;const Z=li(U);I<x.len&&x.kinds[I]==="text"?(B.push(Z,x.texts[I]),R=R||x.isWordLike[I],I++):B.push(Z)}E.push(li(B)),T.push(R),F.push(P),S.push(W)}return{len:E.length,texts:E,isWordLike:T,kinds:F,starts:S}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let x=0;x<$.len-1;x++){const E=$ee($.texts[x]);E!==null&&($.kinds[x]!=="space"&&$.kinds[x]!=="preserved-space"||$.kinds[x+1]!=="text"||!$S($.texts[x+1])||($.texts[x]=E.space,$.isWordLike[x]=!1,$.kinds[x]=$.kinds[x]==="preserved-space"?"preserved-space":"space",$.texts[x+1]=E.marks+$.texts[x+1],$.starts[x+1]=$.starts[x]+E.space.length))}return $}function Wee(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Ka=null;const HS=new Map;let Ga=null;const zee=new RegExp("\\p{Emoji_Presentation}","u"),Uee=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let A0=null;const WS=new Map;function yv(){if(Ka!==null)return Ka;if(typeof OffscreenCanvas<"u")return Ka=new OffscreenCanvas(1,1).getContext("2d"),Ka;if(typeof document<"u")return Ka=document.createElement("canvas").getContext("2d"),Ka;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Gr(e,t){let n=t.get(e);return n===void 0&&(n={width:yv().measureText(e).width,containsCJK:wr(e)},t.set(e,n)),n}function vm(){if(Ga!==null)return Ga;if(typeof navigator>"u")return Ga={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ga;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 Ga={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ga}function DM(){return A0===null&&(A0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),A0}function jee(e){return zee.test(e)||e.includes("️")}function Kl(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=DM();for(const a of l.segment(i))jee(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function qee(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 Vee(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function zS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+vm().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,p=0;function h(y=u,A=d,L=a){l++,a=0,c=!1,f=-1,p=0}function m(y,A){c=!0,u=y+1,d=0,a=A}function _(y,A,L){c=!0,u=y,d=A+1,a=L}function k(y,A){c?(a+=A,u=y+1,d=0):m(y,A)}function g(y,A){const L=i[y];for(let $=A;$<L.length;$++){const x=L[$];c?a+x>r?(h(),_(y,$,x)):(a+=x,u=y,d=$+1):_(y,$,x)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=qee(e,v),!(v>=s.length)));){const y=s[v],A=o[v],L=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+y>r){if(L){k(v,y),h(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){h();continue}h(f,0,p);continue}if(y>t&&i[v]!==null){h(),g(v,0),v++;continue}h()}else k(v,y),L&&(f=v+1,p=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),L&&(f=v+1,p=a-y),v++}return c&&h(),l}let M0=null;function Kee(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,p){s=[d],o=f,i=p,r=vv(d),l=gm.has(d)}function u(d,f){s.push(d),i=i||f;const p=vv(d);r=d.length===1&&pa.has(d)&&r||p,l=!1}for(const d of(M0===null&&(M0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),M0).segment(e)){const f=d.segment,p=wr(f);s.length!==0?l||uk.has(f)||pa.has(f)||t.carryCJKAfterClosingQuote&&p&&r?u(f,p):i||p?(a(),c(f,d.index,p)):u(f,p):c(f,d.index,p)}return a(),n}function Gee(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=wr(e[0].text),i=gv(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=wr(a.text),u=gv(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 Yee(e,t,n,s){const o=vm(),{cache:i,emojiCorrection:r}=(function($,x){yv().font=$;const E=(function(S){let I=HS.get(S);return I||(I=new Map,HS.set(S,I)),I})($),T=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})($),F=x?(function(S,I){let B=WS.get(S);if(B!==void 0)return B;const R=yv();R.font=S;const P=R.measureText("😀").width;if(B=0,P>I+.5&&typeof document<"u"&&document.body!==null){const W=document.createElement("span");W.style.font=S,W.style.display="inline-block",W.style.visibility="hidden",W.style.position="absolute",W.textContent="😀",document.body.appendChild(W);const U=W.getBoundingClientRect().width;document.body.removeChild(W),P-U>.5&&(B=P-U)}return WS.set(S,B),B})($,T):0;return{cache:E,fontSize:T,emojiCorrection:F}})(t,(l=e.normalized,Uee.test(l)));var l;const a=Kl("-",Gr("-",i),r),c=8*Kl(" ",Gr(" ",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=[],p=[];let h=e.chunks.length<=1;const m=null,_=[],k=n?[]:null,g=Array.from({length:e.len});function v($,x,E,T,F,S,I){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(h=!1),u.push(x),d.push(E),f.push(T),p.push(F),_.push(I),k!==null&&k.push($)}function y($,x,E,T,F){const S=Gr($,i),I=Kl($,S,r),B=x==="space"||x==="preserved-space"||x==="zero-width-break"?0:I,R=x==="space"||x==="zero-width-break"?0:I;if(F&&T&&$.length>1){let P="sum-graphemes";ah($)?P="pair-context":o.preferPrefixWidthsForBreakableRuns&&(P="segment-prefixes");const W=(function(U,Z,z,ee,de){if(Z.breakableFitAdvances!==void 0)return Z.breakableFitAdvances;const J=DM(),Y=[];for(const We of J.segment(U))Y.push(We.segment);if(Y.length<=1)return Z.breakableFitAdvances=null,Z.breakableFitAdvances;if(de==="sum-graphemes"){const We=[];for(const ge of Y){const G=Gr(ge,z);We.push(Kl(ge,G,ee))}return Z.breakableFitAdvances=We,Z.breakableFitAdvances}if(de==="pair-context"||Y.length>96){const We=[];let ge=null,G=0;for(const le of Y){const he=Kl(le,Gr(le,z),ee);if(ge===null)We.push(he);else{const j=ge+le,ne=Gr(j,z);We.push(Kl(j,ne,ee)-G)}ge=le,G=he}return Z.breakableFitAdvances=We,Z.breakableFitAdvances}const X=[];let fe="",ce=0;for(const We of Y){fe+=We;const ge=Kl(fe,Gr(fe,z),ee);X.push(ge-ce),ce=ge}return Z.breakableFitAdvances=X,Z.breakableFitAdvances})($,S,i,r,P);return void v($,I,B,R,x,E,W)}v($,I,B,R,x,E,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const x=e.texts[$],E=e.isWordLike[$],T=e.kinds[$],F=e.starts[$];if(T==="soft-hyphen"){v(x,0,a,a,T,F,null);continue}if(T==="hard-break"){v(x,0,0,0,T,F,null);continue}if(T==="tab"){v(x,0,0,0,T,F,null);continue}const S=Gr(x,i);if(T==="text"&&S.containsCJK){const I=Kee(x,o),B=s==="keep-all"?Gee(I):I;for(let R=0;R<B.length;R++){const P=B[R];y(P.text,"text",F+P.start,E,s==="keep-all"||!wr(P.text))}continue}y(x,T,F,E,!0)}const A=(function($,x,E){const T=[];for(let F=0;F<$.length;F++){const S=$[F],I=S.startSegmentIndex<x.length?x[S.startSegmentIndex]:E,B=S.endSegmentIndex<x.length?x[S.endSegmentIndex]:E,R=S.consumedEndSegmentIndex<x.length?x[S.consumedEndSegmentIndex]:E;T.push({startSegmentIndex:I,endSegmentIndex:B,consumedEndSegmentIndex:R})}return T})(e.chunks,g,u.length),L=m===null?null:(function($,x){const E=(function(F){const S=F.length;if(S===0)return null;const I=new Array(S);let B=!1;for(let z=0;z<S;){const ee=F.charCodeAt(z);let de=ee,J=1;if(ee>=55296&&ee<=56319&&z+1<S){const X=F.charCodeAt(z+1);X>=56320&&X<=57343&&(de=X-56320+(ee-55296<<10)+65536,J=2)}const Y=vee(de);Y!=="R"&&Y!=="AL"&&Y!=="AN"||(B=!0);for(let X=0;X<J;X++)I[z+X]=Y;z+=J}if(!B)return null;let R=0;for(let z=0;z<S;z++){const ee=I[z];if(ee==="L"){R=0;break}if(ee==="R"||ee==="AL"){R=1;break}}const P=new Int8Array(S);for(let z=0;z<S;z++)P[z]=R;const W=1&R?"R":"L",U=W;let Z=U;for(let z=0;z<S;z++)I[z]==="NSM"?I[z]=Z:Z=I[z];Z=U;for(let z=0;z<S;z++){const ee=I[z];ee==="EN"?I[z]=Z==="AL"?"AN":"EN":ee!=="R"&&ee!=="L"&&ee!=="AL"||(Z=ee)}for(let z=0;z<S;z++)I[z]==="AL"&&(I[z]="R");for(let z=1;z<S-1;z++)I[z]==="ES"&&I[z-1]==="EN"&&I[z+1]==="EN"&&(I[z]="EN"),I[z]!=="CS"||I[z-1]!=="EN"&&I[z-1]!=="AN"||I[z+1]!==I[z-1]||(I[z]=I[z-1]);for(let z=0;z<S;z++){if(I[z]!=="EN")continue;let ee;for(ee=z-1;ee>=0&&I[ee]==="ET";ee--)I[ee]="EN";for(ee=z+1;ee<S&&I[ee]==="ET";ee++)I[ee]="EN"}for(let z=0;z<S;z++){const ee=I[z];ee!=="WS"&&ee!=="ES"&&ee!=="ET"&&ee!=="CS"||(I[z]="ON")}Z=U;for(let z=0;z<S;z++){const ee=I[z];ee==="EN"?I[z]=Z==="L"?"L":"EN":ee!=="R"&&ee!=="L"||(Z=ee)}for(let z=0;z<S;z++){if(I[z]!=="ON")continue;let ee=z+1;for(;ee<S&&I[ee]==="ON";)ee++;const de=(z>0?I[z-1]:U)!=="L"?"R":"L";if(de===((ee<S?I[ee]:U)!=="L"?"R":"L"))for(let J=z;J<ee;J++)I[J]=de;z=ee-1}for(let z=0;z<S;z++)I[z]==="ON"&&(I[z]=W);for(let z=0;z<S;z++){const ee=I[z];1&P[z]?ee!=="L"&&ee!=="AN"&&ee!=="EN"||P[z]++:ee==="R"?P[z]++:ee!=="AN"&&ee!=="EN"||(P[z]+=2)}return P})($);if(E===null)return null;const T=new Int8Array(x.length);for(let F=0;F<x.length;F++)T[F]=E[x[F]];return T})(e.normalized,m);return k!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:k}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function Zee(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return Yee((function(c,u,d="normal",f="normal"){const p=(function(_){const k=_??"normal";return k==="pre-wrap"?{mode:k,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:k,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),h=p.mode==="pre-wrap"?(function(_){return/[\r\f]/.test(_)?_.replace(/\r\n/g,`
276
+ `).replace(/[\r\f]/g,`
277
+ `):_.replace(/\r\n/g,`
278
+ `)})(c):(function(_){if(!kee.test(_))return _;let k=_.replace(yee," ");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(h.length===0)return{normalized:h,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(_){if(_.len<=1)return _;const k=[],g=[],v=[],y=[];let A=null,L=!1,$=0,x=!1,E=!1;function T(){A!==null&&(k.push(li(A)),g.push(L),v.push("text"),y.push($),A=null)}for(let F=0;F<_.len;F++){const S=_.texts[F],I=_.kinds[F],B=_.isWordLike[F],R=_.starts[F];if(I==="text"){const P=_ee(S),W=gv(S);if(A!==null&&x&&E){A.push(S),L=L||B,x=x||P,E=W;continue}T(),A=[S],L=B,$=R,x=P,E=W;continue}T(),k.push(S),g.push(B),v.push(I),y.push(R)}return T(),{len:k.length,texts:k,isWordLike:g,kinds:v,starts:y}})(PS(h,u,p)):PS(h,u,p);return rt({normalized:h,chunks:Wee(m,p)},m)})(s,vm(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const E0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",xs=(()=>{const e=globalThis;if(e[E0])return e[E0];const t={configs:{},controllers:{},revision:ka(0),preparedCache:new Map,blockEstimateCache:new Map};return e[E0]=t,t})();let ku=null;const US=xs.revision;function jS(e){var t;return e&&(t=xs.configs[e])!=null?t:null}function qS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Qee(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function T0(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!Qee(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+=`
279
+ `)}return o.length>0?o:null}function N0(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(ku!=null)return ku;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return ku=!!((i=r.getContext)!=null&&i.call(r,"2d")),ku}catch{return ku=!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=xs.blockEstimateCache.get(r);if(l)return xs.blockEstimateCache.delete(r),xs.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(p,h,m){const _=`${m}\0${h}\0${p}`,k=xs.preparedCache.get(_);if(k)return xs.preparedCache.delete(_),xs.preparedCache.set(_,k),k.prepared;const g=Zee(p,h,{whiteSpace:m});for(xs.preparedCache.set(_,{prepared:g});xs.preparedCache.size>240;){const v=xs.preparedCache.keys().next().value;if(!v)break;xs.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(p,h,m){const _=(function(k,g){return k.simpleLineWalkFastPath?zS(k,g):(function(v,y){if(v.simpleLineWalkFastPath)return zS(v,y);const{widths:A,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:x,breakableFitAdvances:E,discretionaryHyphenWidth:T,tabStopAdvance:F,chunks:S}=v;if(A.length===0||S.length===0)return 0;const I=vm(),B=I.lineFitEpsilon,R=y+B;let P=0,W=0,U=!1,Z=0,z=0,ee=-1,de=0,J=0,Y=null;function X(){ee=-1,de=0,J=0,Y=null}function fe(ne=Z,ve=z,ae=W){P++,W=0,U=!1,X()}function ce(ne,ve){U=!0,Z=ne+1,z=0,W=ve}function We(ne,ve,ae){U=!0,Z=ne,z=ve+1,W=ae}function ge(ne,ve){U?(W+=ve,Z=ne+1,z=0):ce(ne,ve)}function G(ne,ve,ae,ye){if(!ve)return;const q=ne==="tab"?0:L[ae],se=ne==="tab"?ye:$[ae];ee=ae+1,de=W-ye+q,J=W-ye+se,Y=ne}function le(ne,ve){const ae=E[ne];for(let ye=ve;ye<ae.length;ye++){const q=ae[ye];U?W+q>R?(fe(),We(ne,ye,q)):(W+=q,Z=ne,z=ye+1):We(ne,ye,q)}U&&Z===ne&&z===ae.length&&(Z=ne+1,z=0)}function he(ne){if(Y!=="soft-hyphen")return!1;const ve=E[ne];if(ve==null)return!1;const{fitCount:ae,fittedWidth:ye}=(function(q,se,me,Te,Me){let $e=0,pe=se;for(;$e<q.length;){const Ie=pe+q[$e];if(($e+1<q.length?Ie+Me:Ie)>me+Te)break;pe=Ie,$e++}return{fitCount:$e,fittedWidth:pe}})(ve,W,y,B,T);return ae!==0&&(W=ye,Z=ne,z=ae,X(),ae===ve.length?(Z=ne+1,z=0,!0):(fe(ne,ae,ye+T),le(ne,ae),!0))}function j(ne){P++,X()}for(let ne=0;ne<S.length;ne++){const ve=S[ne];if(ve.startSegmentIndex===ve.endSegmentIndex){j();continue}U=!1,W=0,ve.startSegmentIndex,Z=ve.startSegmentIndex,z=0,X();let ae=ve.startSegmentIndex;for(;ae<ve.endSegmentIndex;){const ye=x[ae],q=ye==="space"||ye==="preserved-space"||ye==="tab"||ye==="zero-width-break"||ye==="soft-hyphen",se=ye==="tab"?Vee(W,F):A[ae];if(ye!=="soft-hyphen")if(U){if(W+se>R){const me=W+(ye==="tab"?0:L[ae]),Te=W+(ye==="tab"?se:$[ae]);if(Y==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&de<=R){fe(ee,0,J);continue}if(Y==="soft-hyphen"&&he(ae)){ae++;continue}if(q&&me<=R){ge(ae,se),fe(ae+1,0,Te),ae++;continue}if(ee>=0&&de<=R){if(Z>ee||Z===ee&&z>0){fe();continue}const Me=ee;fe(Me,0,J),ae=Me;continue}if(se>y&&E[ae]!==null){fe(),le(ae,0),ae++;continue}fe();continue}ge(ae,se),G(ye,q,ae,se),ae++}else se>y&&E[ae]!==null?le(ae,0):ce(ae,se),G(ye,q,ae,se),ae++;else U&&(Z=ae+1,z=0,ee=ae+1,de=W+T,J=W+T,Y=ye),ae++}if(U){const ye=ee===ve.consumedEndSegmentIndex?J:W;fe(ve.consumedEndSegmentIndex,0,ye)}}return P})(k,g)})(p,h);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(xs.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});xs.blockEstimateCache.size>4e3;){const p=xs.blockEstimateCache.keys().next().value;if(!p)break;xs.blockEstimateCache.delete(p)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function PM(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=T0(e.children);return i&&n.paragraph?N0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=T0(e.children),l=n.headings[i];return r&&l?N0(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=T0((o=i[0])==null?void 0:o.children);return r?N0(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=PM(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 Rf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Xee(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,p;return u.diff?Math.max(Rf(String((d=u.originalCode)!=null?d:"")),Rf(String((f=u.updatedCode)!=null?f:"")),Rf(String((p=u.code)!=null?p:""))):Rf((function(h,m){const _=String(h??"");return m?_:_.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(p,h){const m=typeof p?.fontSize=="number"&&p.fontSize>0?p.fontSize:h?13:12;return typeof p?.lineHeight=="number"&&p.lineHeight>0?p.lineHeight:h?30:Math.round(1.5*m)})(u,r),f=(function(p,h){var m,_;if(!h)return 0;const k=typeof((m=p?.padding)==null?void 0:m.top)=="number"?p.padding.top:10,g=typeof((_=p?.padding)==null?void 0:_.bottom)=="number"?p.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 Jee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function I0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=qS(s.lineHeight,1.5*qS(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Jee(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const ete=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function VS(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))ete.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const tte=!1;function Gxe(){return tte}function KS(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,p){return Number.isFinite(f)?Math.min(Math.max(0,f),p):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 p=s.getNormalizedScrollTop(e,t,!1),h=Math.abs(p-r);h<u&&(u=h,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 HM=Symbol("MarkstreamMathBlockMinHeightCache");function Yxe(){return Yt(HM,null)}const nte=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],ste=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],ote=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),WM=["raw","content","code","originalCode","updatedCode"],GS=new WeakMap,YS=new WeakMap;let ite=1;function _i(){return typeof performance<"u"?performance.now():Date.now()}function ZS(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function fi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=GS.get(t);return n||(n=ite++,GS.set(t,n)),String(n)}function QS(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:fi(t),customMarkdownIt:fi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:fi(e.validateLink),preTransformTokens:fi(e.preTransformTokens),postTransformTokens:fi(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function XS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
280
+ `,t-1)+1;return e.slice(n,t).trim()}function JS(e){const t=zM(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function zM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function UM(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 hk(e){const t=String(e??"");return`${t.length}:${UM(t)}`}function kv(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?hk(r):`${r.length}:${UM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${fi(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:${fi(s)}`;const i=fi(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>kv(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}:${kv(r[c],t,n+1)}`).join(";")}`}return typeof e}function cp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function jM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>cp(s)?xl(s,t,n+1):jM(s,t,n+1)).join(",")}`:cp(e)?xl(e,t,n):kv(e,t,n)}function rte(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!WM.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${hk(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${fi(o)}`:ote.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${jM(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${fi(o)}`:""}).filter(Boolean).join(";")}function lte(e){return WM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${hk(n)}`:""}).filter(Boolean).join(";")}function xl(e,t=new WeakMap,n=0){const s=YS.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}:${fi(o)}`;const r=fi(o);t.set(o,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],p=f.length?f.slice(0,200).map(h=>xl(h,c,u+1)).join("|"):"";return[a.type,lte(d),rte(d,c,u),f.length,p].join(":")})(e,t,n);return YS.set(o,l),l}function qM(e,t){return xl(e)===xl(t)}function pk(e,t,n){const s=_i(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=_i()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function eC(e,t,n){return pk(t,n,()=>xl(e))}function VM(e,t,n){return eC(e,n,"stabilizeSignatureMs")===eC(t,n,"stabilizeSignatureMs")}function $0(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function tC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function ate(e,t){return e.length===t.length&&e===t}function mk(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],p=o[d];if(typeof f!=typeof p)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,p))return!1}else if(typeof p!="string"||!ate(f,p))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(!cp(d)||!cp(f))return null;const p=mk(d,f,n+1);if(p==null)return null;if(!p)return!1}return!0}function cte(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=mk(e,t);return n??qM(e,t)}function ute(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return pk(n,"stabilizeSignatureMs",()=>{s=mk(e,t)}),s??VM(e,t,n)}function dte(e,t){const n={};for(const s of nte){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function fte(e,t){var n;const s=iS(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,p=0,h=_i();function m(){l&&(clearTimeout(l),l=void 0)}function _(){m();const E=t.renderContent.value;r.value!==E&&(r.value=E),h=_i()}Ge([t.renderContent,t.effectiveFinal,i],([E,T,F])=>{r.value!==E&&(!F||T||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const B=I.slice(S.length);return!!B&&(!!JS(XS(I))||!(!B.includes(`
281
+
282
+ `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(B))||B.endsWith(`
283
+ `)&&!(function(R){const P=XS(R);if(JS(P))return!1;const W=zM(P);return W.length>=2&&W.some(U=>U.trim())})(I))})(r.value,E)?_():(function(){if(p+=1,l)return;const S=Math.max(0,(function(I){const B=I.parseCoalesceMs;return typeof B=="number"&&Number.isFinite(B)&&B>=0?B:80})(e)-(_i()-h));S<=0?_():l=setTimeout(_,S)})())},{flush:"sync",immediate:!0}),Uv(m);const k=D(()=>{var E,T,F,S;return IK(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(F=(T=t.customComponentsMap)==null?void 0:T.value)!=null?F:{},Object.entries(S).map(([I,B])=>{const R=yi(I);return B==null||!R||Od(R)||k6.has(R)||$d.has(R)?"":R}).filter(Boolean)))}),g=D(()=>{const{key:E,tags:T}=$K(k.value);if(!E)return s;const F=o.get(E);if(F)return F;const S=iS(t.instanceMsgId,{customHtmlTags:T});return o.set(E,S),S}),v=D(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=D(()=>{var E,T;const F=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,I=k.value,B=S!=null,R=I.length>0;return B||R||F.streamParse==null?rt(rt(qt(rt({},F),{streamParse:(T=F.streamParse)==null||T}),B?{final:S}:{}),R?{customHtmlTags:I}:{}):F}),A=D(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(T=>String(T).trim().toLowerCase()).filter(Boolean))}),L=D(()=>QS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=D(()=>QS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ge([L,$],([E,T],[F,S])=>{F&&(E===F&&T===S||(_(),T!==S&&(a=[],d="")))},{flush:"sync"});const x=D(()=>{var E,T,F,S,I,B,R,P;if((E=e.nodes)!=null&&E.length)return a=[],d="",yt(e.nodes.slice());const W=r.value;if(!W)return a=[],d="",[];const U=t.debugPerformanceEnabled.value,Z=U?_i():0,z=v.value,ee=L.value,de=$.value;c&&ee!==c&&(function(ve){var ae,ye;(ye=(ae=ve.stream)==null?void 0:ae.reset)==null||ye.call(ae)})(z),u&&de!==u&&(a=[],d="");const J=a.length>0&&W.startsWith(d)&&de===u,Y=U?ZS(z):null,X=U?{}:void 0,fe=X?qt(rt({},y.value),{__timing:X}):y.value,ce=lM(W,z,fe),We=U?_i():0,ge=U?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let G,le=U?$0(ce.length):void 0,he=0,j=0;if(J){const ve=U?_i():0;if(ge){const ae=(function(ye,q,se){if(!q.length)return{nodes:ye,metrics:$0(ye.length)};const me=(function($e,pe,Ie){const Qe=Math.min($e.length,pe.length);for(let lt=0;lt<Qe;lt++)if(!ute(pe[lt],$e[lt],Ie))return lt;return $e.length===pe.length?-1:Qe})(ye,q,se);if(me<0)return{nodes:q,metrics:{reusedNodeCount:ye.length,dirtyStartIndex:me,stablePrefixNodeCount:ye.length,dirtyTailNodeCount:0}};const Te=ye.slice();let Me=me;for(let $e=0;$e<me;$e++)Te[$e]=q[$e];for(let $e=me;$e<ye.length;$e++){const pe=q[$e],Ie=ye[$e];pe&&VM(pe,Ie,se)&&(Te[$e]=pe,Me+=1)}return{nodes:Te,metrics:{reusedNodeCount:Me,dirtyStartIndex:me,stablePrefixNodeCount:me,dirtyTailNodeCount:tC(me,ye,q)}}})(ce,a,ge);G=ae.nodes,le=ae.metrics}else{const ae=(function(ye,q){if(!q.length)return{nodes:ye,metrics:$0(ye.length)};const se=(function(Me,$e){const pe=Math.min(Me.length,$e.length);for(let Ie=0;Ie<pe;Ie++)if(!cte($e[Ie],Me[Ie]))return Ie;return Me.length===$e.length?-1:pe})(ye,q);if(se<0)return{nodes:q,metrics:{reusedNodeCount:ye.length,dirtyStartIndex:se,stablePrefixNodeCount:ye.length,dirtyTailNodeCount:0}};const me=ye.slice();let Te=se;for(let Me=0;Me<se;Me++)me[Me]=q[Me];for(let Me=se;Me<ye.length;Me++){const $e=q[Me],pe=ye[Me];$e&&qM($e,pe)&&(me[Me]=$e,Te+=1)}return{nodes:me,metrics:{reusedNodeCount:Te,dirtyStartIndex:se,stablePrefixNodeCount:se,dirtyTailNodeCount:tC(se,ye,q)}}})(ce,a);G=ae.nodes,le=ae.metrics}he=U?_i()-ve:0,j=le?.dirtyStartIndex==null||le.dirtyStartIndex<0?G.length:le.dirtyStartIndex}else G=ce;ge?(function(ve,ae,ye=0){for(let q=Math.max(0,ye);q<ve.length;q++)pk(ae,"primeSignatureMs",()=>xl(ve[q]))})(G,ge,j):(function(ve,ae=0){for(let ye=Math.max(0,ae);ye<ve.length;ye++)xl(ve[ye])})(G,j);const ne=U?_i()-We:0;if(f+=1,d=W,c=ee,u=de,a=G,U){const ve=ZS(z),ae=typeof ve?.total=="number"&&ve.total>((T=Y?.total)!=null?T:0);t.logPerf(ae?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(_i()-Z),nodes:G.length,contentLength:W.length,parseCommitCount:f,parseCoalescedCount:p,nodeReuseMs:ne,signatureMs:(F=ge?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=ge?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=ge?.primeSignatureMs)!=null?I:0,signatureCallCount:(B=ge?.signatureCallCount)!=null?B:0,stabilizeSignatureCallCount:(R=ge?.stabilizeSignatureCallCount)!=null?R:0,primeSignatureCallCount:(P=ge?.primeSignatureCallCount)!=null?P:0,stabilizeMs:he},le??{}),X?Object.fromEntries(ste.map(ye=>{var q;return[ye,(q=X[ye])!=null?q:0]})):{}),ve?{streamMode:ve.lastMode,streamDelta:dte(ve,Y),streamStats:ve}:{}))}return yt(G)});return{effectiveCustomHtmlTags:k,effectiveCustomHtmlTagsSet:A,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:x}}function hte(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,p){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const _=n.value,k=_.has(f);if(p){if(k)return;const v=new Set(_);return v.add(f),void(n.value=v)}if(!k)return;const g=new Set(_);g.delete(f),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,p]of o.entries())f<c||(p(),o.delete(f));for(const[f,p]of s.entries())f<c||(p.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 pte(e={}){const t=Q(""),n=Q(""),s=Q(!1),o=mX(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 zv()&&Uv(()=>{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 nC=/auto|scroll|overlay/i;function mte(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return nC.test(t)||nC.test(n)}function gte(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 vte=Ve({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 iv((s=dc(e.estimatedPreviewHeightPx))!=null?s:sv(String((n=e.node.code)!=null?n:"")))});return()=>bn("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?bn("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)"}},[bn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[bn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),bn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),bn("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},()=>bn("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,bn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[bn("div",{class:"absolute inset-0"},[bn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),yte=Ve({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 ov((s=dc(e.estimatedPreviewHeightPx))!=null?s:nv(String((n=e.node.code)!=null?n:"")))});return()=>bn("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?bn("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)"}},[bn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[bn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),bn("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},()=>bn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[bn("span",{class:"action-icon block"})])))]):null,bn("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)"}},[bn("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"}})])])}}),kte=["data-custom-id"],bte={class:"m-0 p-0"},xte=["data-probe"],_te=["data-node-index","data-node-type"],KM=_n(Ve(qt(rt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=zs(),r=Yt("markstreamNestedRendererProps",void 0);function l(M){var H,V;const K=s[M];return(function(oe){const _e=i?.vnode.props;return!!_e&&(Object.prototype.hasOwnProperty.call(_e,oe)||Object.prototype.hasOwnProperty.call(_e,String(oe).replace(/[A-Z]/g,Ce=>`-${Ce.toLowerCase()}`)))})(M)?K:(V=(H=r?.value)==null?void 0:H[M])!=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(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=D(()=>{const M=l("renderCodeBlocksAsPre"),H=l("codeRenderer");return M===!0?"pre":H==="pre"||H==="shiki"||H==="monaco"?H:M===!1||c.value==="docs"?"monaco":"pre"}),d=D(()=>a[c.value]),f=D(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),p=D(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),h=D(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),m=D(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),_=D(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),k=D(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),g=D(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),v=D(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),y=D(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=D(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),L=D(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),$=D(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),x={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 p.value},get batchRendering(){return h.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return k.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function E(M){o("height-change",M)}function T(M){o("virtual-state-change",M)}function F(M){o("anchor-change",M)}const S=Q(),I=Q(null),B=Q(null),R=Q(null),P=Ns({1:null,2:null,3:null,4:null,5:null,6:null}),W=Q(!1),U=new Map,Z=Q(0),z=Q(0),ee=Q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function de(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const V=(H=s.virtualScroll)==null?void 0:H.scrollRoot;return J(typeof V=="function"?V():V)}function J(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?J(M.value):typeof M=="object"&&"$el"in M?J(M.$el):null:null}const{isClient:Y,renderAsFragment:X,debugPerformanceEnabled:fe,resolvedShowTooltips:ce,resolvedHtmlPolicy:We,inheritedSmoothStreaming:ge,ownsTypewriterCursor:G}=(function(M){const H=typeof window<"u",V=Ad(),K=Yt("markstreamHtmlPolicy",void 0),oe=Yt("markstreamTypewriterCursor",void 0),_e=Yt("markstreamSmoothStreaming",void 0),Ce=D(()=>M.renderAsFragment===!0),Ne=D(()=>!!(M.debugPerformance&&H&&typeof console<"u")),He=D(()=>{var ze;if(typeof M.showTooltips=="boolean")return M.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=M.htmlPolicy)!=null?ze:K?.value)!=null?Oe:"safe"}),je=D(()=>oe?.value!==!0);return{isClient:H,renderAsFragment:Ce,debugPerformanceEnabled:Ne,resolvedShowTooltips:He,resolvedHtmlPolicy:Le,inheritedSmoothStreaming:_e,inheritedTypewriterCursor:oe,ownsTypewriterCursor:je}})(x),{resolveViewportRoot:le,resolveScrollContainer:he,isReverseFlexScrollRoot:j,getNormalizedScrollTop:ne,getOffsetTopWithinRoot:ve}=(function(M,H){function V(){var Ne,He;return(He=(Ne=H.scrollRoot)==null?void 0:Ne.call(H))!=null?He:null}function K(Ne){if(typeof window>"u")return null;const He=V();if(He)return He;const Le=Ne??M.value;if(!Le)return null;const je=Le.ownerDocument||document,ze=je.scrollingElement||je.documentElement;let Oe=Le;for(;Oe&&Oe!==je.body&&Oe!==ze;){if(mte(window.getComputedStyle(Oe))&&gte(Oe))return Oe;Oe=Oe.parentElement}return null}function oe(Ne){if(!H.isClient)return!1;try{const He=window.getComputedStyle(Ne);return!!(He.display||"").toLowerCase().includes("flex")&&(He.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function _e(Ne,He,Le){var je,ze;if(Le)return Ce(He);const Oe=Ne.scrollTop;if(!oe(Ne))return Oe;const Ue=Oe<0?-Oe:Oe;return Math.max(0,((je=Ne.scrollHeight)!=null?je:0)-((ze=Ne.clientHeight)!=null?ze:0))-Ue}function Ce(Ne){var He,Le,je,ze,Oe;const Ue=Number((He=Ne.scrollingElement)==null?void 0:He.scrollTop),Je=Number((je=(Le=Ne.documentElement)==null?void 0:Le.scrollTop)!=null?je:0),et=Number((Oe=(ze=Ne.body)==null?void 0:ze.scrollTop)!=null?Oe:0);return Math.max(0,Number.isFinite(Ue)?Ue:0,Number.isFinite(Je)?Je:0,Number.isFinite(et)?et:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(Ne){var He,Le,je,ze;const Oe=V();if(Oe)return Oe;const Ue=K((He=Ne??M.value)!=null?He:null);if(Ue)return Ue;const Je=(ze=(je=Ne?.ownerDocument)!=null?je:(Le=M.value)==null?void 0:Le.ownerDocument)!=null?ze:typeof document<"u"?document:null;return Je?.scrollingElement||Je?.documentElement||null},isReverseFlexScrollRoot:oe,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:function(Ne,He){const Le=He.ownerDocument||Ne.ownerDocument||document;if((function(Ue,Je){return Ue===Je.documentElement||Ue===Je.body||Ue===Je.scrollingElement})(He,Le))return Ne.getBoundingClientRect().top+Ce(Le);const je=He.getBoundingClientRect(),ze=Ne.getBoundingClientRect(),Oe=_e(He,Le,!1);return ze.top-je.top+Oe}}})(S,{isClient:Y,scrollRoot:de});In("markstreamShowTooltips",ce),In("markstreamHtmlPolicy",We),In("markstreamTypewriter",D(()=>x.typewriter!==!1)),In("markstreamFade",D(()=>x.fade!==!1)),In("markstreamTypewriterCursor",D(()=>!0)),In("markstreamTextStreamState",U),In("markstreamStreamVersion",Z),In("markstreamParseOptions",D(()=>x.parseOptions)),In("markstreamCustomMarkdownIt",D(()=>x.customMarkdownIt));const{smoothStreamingEnabled:ae,renderContent:ye,effectiveFinal:q}=(function(M,H){const V=pte(M.smoothStreamingOptions),K=D(()=>{var Le,je,ze;return M.smoothStreaming!==!1&&!((Le=M.nodes)!=null&&Le.length)&&(M.smoothStreaming===!0||!((je=H.inheritedSmoothStreaming)!=null&&je.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((ze=M.maxLiveNodes)!=null?ze:0)<=0)}),oe=Q(!H.isClient||M.smoothStreaming===!0);gn(()=>{oe.value=!0});const _e=D(()=>oe.value&&K.value),Ce=D(()=>{var Le;return _e.value?V.visible.value:(Le=M.content)!=null?Le:""}),Ne=D(()=>{var Le,je;const ze=(Le=M.parseOptions)!=null?Le:{};return(je=M.final)!=null?je:ze.final}),He=D(()=>{const Le=Ne.value;return _e.value&&Le!=null?!!Le&&V.caughtUp.value:Le});return Ge([()=>M.content,()=>M.nodes,_e,Ne],([Le,je,ze,Oe])=>{if(je?.length)return void V.reset("");const Ue=Le??"";if(!ze)return V.reset(Ue),void(Oe&&V.finish({flush:!0}));const Je=V.source.value;Ue?Ue===Je||(Ue.startsWith(Je)?V.enqueue(Ue.slice(Je.length)):V.reset(Ue)):V.reset(""),Oe&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:_e,renderContent:Ce,requestedFinal:Ne,effectiveFinal:He}})(x,{isClient:Y,inheritedSmoothStreaming:ge});In("markstreamSmoothStreaming",ae);const se=Q(!1);let me="",Te=!1,Me=null;function $e(){Y&&Me!=null&&(window.clearTimeout(Me),Me=null)}function pe(){se.value=!1,$e()}function Ie(M,H){if(!fe.value)return;const V=(function(){if(!fe.value)return null;const K=Tt(Qe),oe=Tt(lt),_e=Math.max(St,oe);if(K<=0&&_e<=0)return null;const Ce={total:K,maxPerFrame:_e,byLabel:(Ne=Qe,Object.fromEntries(Array.from(Ne.entries()).sort((He,Le)=>Le[1]-He[1]||He[0].localeCompare(Le[0]))))};var Ne;return Qe.clear(),lt.clear(),St=0,Ce})();console.info(`[markstream-vue][perf] ${M}`,V?qt(rt({},H),{layoutReads:V}):H)}Ge([ye,()=>s.nodes,q],([M,H,V])=>{const K=M??"";return H?.length||V===!0?(pe(),me=K,void(Te=!0)):Te?(me&&K.length>me.length&&K.startsWith(me)?(se.value=!0,Y&&($e(),Me=window.setTimeout(()=>{var oe;Me=null,q.value===!0||(oe=s.nodes)!=null&&oe.length||(Oa(),se.value=!1,Ji())},1200))):(K.length<me.length||!K.startsWith(me))&&pe(),void(me=K)):(me=K,void(Te=!0))},{flush:"sync",immediate:!0});const Qe=new Map,lt=new Map;let _t=!1,St=0;function Tt(M){let H=0;for(const V of M.values())H+=V;return H}function Ct(){St=Math.max(St,Tt(lt)),lt.clear(),_t=!1}function gt(M,H){return(function(V){var K,oe;fe.value&&(Qe.set(V,((K=Qe.get(V))!=null?K:0)+1),lt.set(V,((oe=lt.get(V))!=null?oe:0)+1),_t||(_t=!0,Y&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ct):typeof queueMicrotask!="function"?setTimeout(Ct,0):queueMicrotask(Ct)))})(M),H()}const nn=x.customId?`renderer-${x.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,rn=(function(M){const H=new Map;return{scope:M,cache:H,clear:()=>H.clear()}})(nn),Qn=D(()=>`${nn}:${Z.value}`);In(HM,rn);const Zt=ys(()=>x.customId),{effectiveCustomHtmlTagsSet:fn,mergedParseOptions:hn,parsedNodes:it}=fte(x,{instanceMsgId:nn,renderContent:ye,effectiveFinal:q,smoothStreamingEnabled:ae,debugPerformanceEnabled:fe,customComponentsMap:Zt,logPerf:Ie});Ge(it,()=>{rn.clear(),Z.value+=1},{immediate:!0});const zn=D(()=>({customId:x.customId,customHtmlTags:hn.value.customHtmlTags,parseOptions:x.parseOptions,customMarkdownIt:x.customMarkdownIt,htmlPolicy:We.value,viewportPriority:x.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:x.codeBlockStream,codeBlockDarkTheme:x.codeBlockDarkTheme,codeBlockLightTheme:x.codeBlockLightTheme,codeBlockMonacoOptions:x.codeBlockMonacoOptions,renderCodeBlocksAsPre:x.renderCodeBlocksAsPre,codeBlockMinWidth:x.codeBlockMinWidth,codeBlockMaxWidth:x.codeBlockMaxWidth,codeBlockProps:x.codeBlockProps,mermaidProps:x.mermaidProps,d2Props:x.d2Props,infographicProps:x.infographicProps,showTooltips:ce.value,themes:x.themes,langs:x.langs,isDark:x.isDark,typewriter:x.typewriter,smoothStreamingOptions:x.smoothStreamingOptions,parseCoalesceMs:x.parseCoalesceMs,fade:x.fade}));In("markstreamNestedRendererProps",zn);const Hn=D(()=>it.value),Wn=D(()=>it.value.length),Ze=Q(null),Xe=Q(null),Dt=Q(null),Pt=Q(null),an=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),wn=!an&&x.customId?jS(x.customId):null,Xn=D(()=>wn?(US.value,jS(x.customId)):null),Ss=D(()=>{var M;return!!(Y&&!X.value&&x.customId&&!an&&((M=Xn.value)!=null&&M.enabled))}),as=D(()=>{var M;return!!(!X.value&&((M=s.virtualScroll)!=null&&M.enabled))}),vn=Q(!1);gn(()=>{vn.value=!0});const Ft=D(()=>!!(Y&&as.value));In("markstreamHostScrollManaged",Ft);const Cs=D(()=>!!(vn.value&&Ft.value)),sn=D(()=>Ss.value||Ft.value),Xs=D(()=>Ss.value||Cs.value),cs=D(()=>{var M;return sn.value&&((M=Xn.value)==null?void 0:M.textEstimation)!==!1}),No=D(()=>{var M;return sn.value&&((M=Xn.value)==null?void 0:M.codeBlockEstimation)!==!1});function Zo(){const M=z.value||gt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=S.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const As=D(()=>{const M=Zo();return M>0?Math.max(1,Math.round(M)):640}),Qo=D(()=>{var M;return Math.max(1,(M=x.maxLiveNodes)!=null?M:320)}),jt=D(()=>{var M;return!X.value&&x.nodeVirtual!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&(x.nodeVirtual===!0?it.value.length>0:it.value.length>Qo.value)}),Xo=D(()=>jt.value||Ss.value||Ft.value),Io=D(()=>x.viewportPriority!==!1&&!W.value),mo=eee(M=>{var H;return le((H=M??S.value)!=null?H:null)},Io),{requestFrame:Jn,cancelFrame:os,hasIdleCallback:Yi,isTestEnv:Is}=(function(M){const H=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=M.isClient&&typeof window.requestIdleCallback=="function",oe=(function(){var _e;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ce=(_e=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:_e.value;return Ce?.env})();return{requestFrame:H,cancelFrame:V,hasIdleCallback:K,isTestEnv:oe?.NODE_ENV==="test"}})({isClient:Y}),{resolvedBatchSize:Zi,resolvedInitialBatch:$s,batchingEnabled:us,incrementalRenderingActive:Us,renderedCount:Un,previousRenderContext:$o,adaptiveBatchSize:Jo,previousBatchConfig:ks}=(function(M,H){var V;const K=D(()=>{var ze;const Oe=Math.trunc((ze=M.renderBatchSize)!=null?ze:80);return Number.isFinite(Oe)?Math.max(0,Oe):0}),oe=D(()=>{var ze;const Oe=Math.trunc((ze=M.initialRenderBatchSize)!=null?ze:K.value);return Number.isFinite(Oe)?Math.max(0,Oe):K.value}),_e=D(()=>!H.renderAsFragment.value&&M.batchRendering!==!1&&K.value>0&&H.isClient&&!H.isTestEnv),Ce=Q(0),Ne=Q({key:M.indexKey,total:0}),He=Q(Math.max(1,K.value||1)),Le=D(()=>{var ze;return _e.value&&((ze=M.maxLiveNodes)!=null?ze:0)<=0}),je=Q({batchSize:K.value,initial:oe.value,delay:(V=M.renderBatchDelay)!=null?V:16,enabled:Le.value});return{resolvedBatchSize:K,resolvedInitialBatch:oe,batchingEnabled:_e,incrementalRenderingActive:Le,renderedCount:Ce,previousRenderContext:Ne,adaptiveBatchSize:He,previousBatchConfig:je}})(x,{isClient:Y,isTestEnv:Is,renderAsFragment:X}),jn=new Map,ds=new Map,ct=new WeakMap;let be=null;const Fe=new WeakMap,Vt=new Map,Lo=Q(0),qe=D(()=>(Lo.value,Array.from(jn.entries()).sort((M,H)=>M[0]-H[0]))),nt=Q(null),ot=Q(null);let Rt=null,Fo=0,ei=null;const{activeRestoreAnchor:ki,getRelativeScrollTopWithinContainer:Tl,setRelativeScrollTopWithinContainer:te,resolveAnchorOffset:we,clearRestoreReconcile:Se,scheduleRestoreReconcile:De,captureRestoreAnchor:tt,restoreAnchor:ut,getAnchorDrift:It}=(function(M){const{isClient:H,containerRef:V,parsedNodeCount:K,requestFrame:oe,cancelFrame:_e,resolveScrollContainer:Ce,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:He,isReverseFlexScrollRoot:Le,estimateIndexForOffset:je,estimateHeightRange:ze,getFallbackNodeHeight:Oe,clamp:Ue}=M,Je=Q(null);let et=null,Mt=[];function at(){const Ot=Ce(),Gt=V.value;if(!Ot||!Gt)return null;const Kt=Ot.ownerDocument||Gt.ownerDocument||document;if(Ot===Kt.documentElement||Ot===Kt.body||Ot===Kt.scrollingElement){const yn=Gt.getBoundingClientRect();return Math.max(0,-yn.top)}return Math.max(0,Ne(Ot,Kt,!1)-He(Gt,Ot))}function ht(Ot){var Gt;const Kt=Ce(),yn=V.value;if(!Kt||!yn)return;const Do=Math.max(0,Ot),Js=Kt.ownerDocument||yn.ownerDocument||document,bi=Js.defaultView||(typeof window<"u"?window:null);if(Kt===Js.documentElement||Kt===Js.body||Kt===Js.scrollingElement){const Dr=Ne(Kt,Js,!0)+yn.getBoundingClientRect().top;return void((Gt=bi?.scrollTo)==null||Gt.call(bi,0,Math.max(0,Dr+Do)))}KS(Kt,Js,He(yn,Kt)+Do,{isReverseFlexScrollRoot:Dr=>{var Pr;return(Pr=Le?.(Dr))!=null&&Pr},getNormalizedScrollTop:Ne})}function Nt(Ot){const Gt=K.value,Kt=Ue(Ot.nodeIndex,0,Math.max(0,Gt-1));return ze(0,Kt)+Math.max(0,Ot.offsetWithinNodePx)}function Et(){if(et!=null&&(_e?.(et),et=null),H)for(const Ot of Mt)window.clearTimeout(Ot);Mt=[]}function cn(Ot){const Gt=Nt(Ot),Kt=at();Kt!=null&&Math.abs(Kt-Gt)<=.5||ht(Gt)}return{activeRestoreAnchor:Je,getRelativeScrollTopWithinContainer:at,setRelativeScrollTopWithinContainer:ht,resolveAnchorOffset:Nt,clearRestoreReconcile:Et,applyRestoreAnchor:cn,scheduleRestoreReconcile:function(){Je.value&&H&&et==null&&(et=oe?oe(()=>{et=null,Je.value&&cn(Je.value)}):null,et==null&&Je.value&&cn(Je.value))},captureRestoreAnchor:function(){const Ot=at(),Gt=K.value;if(Ot==null||Gt<=0)return null;const Kt=Ue(je(Ot+1),0,Gt-1),yn=ze(0,Kt),Do=Oe(Kt);return{nodeIndex:Kt,offsetWithinNodePx:Ue(Ot-yn,0,Math.max(0,Do-1))}},restoreAnchor:function(Ot){const Gt=K.value;if(Je.value={nodeIndex:Ue(Ot.nodeIndex,0,Math.max(0,Gt-1)),offsetWithinNodePx:Math.max(0,Ot.offsetWithinNodePx)},Et(),cn(Je.value),H)for(const Kt of[0,120,280,480])Mt.push(window.setTimeout(()=>{Je.value&&cn(Je.value)},Kt))},getAnchorDrift:function(Ot){const Gt=at();return Gt==null?null:Gt-Nt(Ot)}}})({isClient:Y,containerRef:S,parsedNodeCount:Wn,requestFrame:Jn,cancelFrame:os,resolveScrollContainer:()=>nt.value||he(),getNormalizedScrollTop:ne,getOffsetTopWithinRoot:ve,isReverseFlexScrollRoot:j,estimateIndexForOffset:d1,estimateHeightRange:Br,getFallbackNodeHeight:Vd,clamp:Os}),{nodeHeights:Wt,heightStats:$t,heightTreeSize:ue,heightSumTree:ke,heightKnownTree:Re,averageNodeHeight:ft,resetHeightMeasurements:At,pruneHeightMeasurements:zt,rebuildHeightTrees:Qt,recordNodeHeight:Rn,removeNodeHeights:Ls,exportHeightCache:Nl,importHeightCache:Em,fenwickRangeSum:Dd}=(function(M={}){const H=Ns({}),V=Ns({total:0,count:0}),K=Q(0),oe=Q([]),_e=Q([]);function Ce(){for(const Oe of Object.keys(H))delete H[Number(Oe)];V.total=0,V.count=0,K.value=0,oe.value=[],_e.value=[]}function Ne(Oe,Ue,Je){for(let et=Ue+1;et<Oe.length;et+=et&-et)Oe[et]+=Je}function He(Oe,Ue){let Je=0;for(let et=Ue+1;et>0;et-=et&-et)Je+=Oe[et];return Je}function Le(Oe){K.value=Oe;const Ue=new Array(Oe+1).fill(0),Je=new Array(Oe+1).fill(0);for(const[et,Mt]of Object.entries(H)){const at=Number(et),ht=Number(Mt);!Number.isFinite(at)||at<0||at>=Oe||!Number.isFinite(ht)||ht<=0||(Ne(Ue,at,ht),Ne(Je,at,1))}oe.value=Ue,_e.value=Je}function je(Oe){if(!Number.isInteger(Oe)||Oe<0)return!1;const Ue=H[Oe];if(!Number.isFinite(Ue)||Ue<=0)return!1;if(delete H[Oe],V.total=Math.max(0,V.total-Ue),V.count=Math.max(0,V.count-1),K.value>Oe){const Je=oe.value,et=_e.value;Je.length&&et.length&&(Ne(Je,Oe,-Ue),Ne(et,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:oe,heightKnownTree:_e,averageNodeHeight:ze,resetHeightMeasurements:Ce,pruneHeightMeasurements:function(Oe){if(Oe<=0)return void Ce();let Ue=0,Je=0;for(const[et,Mt]of Object.entries(H)){const at=Number(et),ht=Number(Mt);!Number.isFinite(at)||at<0||at>=Oe||!Number.isFinite(ht)||ht<=0?delete H[at]:(Ue+=ht,Je++)}V.total=Ue,V.count=Je},rebuildHeightTrees:Le,recordNodeHeight:function(Oe,Ue,Je={}){(function(et,Mt,at={}){var ht;if(!Number.isFinite(Mt)||Mt<=0)return!1;const Nt=H[et];if(Nt&&(at.allowShrink===!1&&Mt<Nt||Math.abs(Mt-Nt)<=1))return!1;if(H[et]=Mt,Nt?V.total+=Mt-Nt:(V.total+=Mt,V.count++),K.value>et){const Et=oe.value,cn=_e.value;if(Et.length&&cn.length)if(Nt){const Ot=Mt-Nt;Ot!==0&&Ne(Et,et,Ot)}else Ne(Et,et,Mt),Ne(cn,et,1)}at.notify!==!1&&((ht=M.onHeightRecorded)==null||ht.call(M))})(Oe,Ue,qt(rt({},Je),{notify:!0}))},removeNodeHeight:function(Oe,Ue={}){var Je;const et=je(Oe);return et&&Ue.notify!==!1&&((Je=M.onHeightRecorded)==null||Je.call(M)),et},removeNodeHeights:function(Oe,Ue={}){var Je;let et=0;for(const Mt of Oe)je(Number(Mt))&&et++;return et>0&&Ue.notify!==!1&&((Je=M.onHeightRecorded)==null||Je.call(M)),et},exportHeightCache:function(){return Object.entries(H).map(([Oe,Ue])=>({index:Number(Oe),height:Number(Ue)})).filter(Oe=>Number.isFinite(Oe.index)&&Oe.index>=0&&Number.isFinite(Oe.height)&&Oe.height>0).sort((Oe,Ue)=>Oe.index-Ue.index)},importHeightCache:function(Oe,Ue={}){var Je;if(!Array.isArray(Oe))return;const et=K.value;let Mt=!1;if(Ue.mode!=="merge"){const at=Object.keys(H);if(at.length>0){for(const ht of at)delete H[Number(ht)];Mt=!0}}for(const at of Oe){const ht=Number(at.index),Nt=Number(at.height);if(!Number.isInteger(ht)||ht<0||et>0&&ht>=et||!Number.isFinite(Nt)||Nt<=0)continue;const Et=H[ht];Et&&Math.abs(Et-Nt)<=1||(H[ht]=Nt,Mt=!0)}Mt&&((function(){let at=0,ht=0;const Nt=K.value;for(const[Et,cn]of Object.entries(H)){const Ot=Number(Et),Gt=Number(cn);!Number.isFinite(Ot)||Ot<0||Nt>0&&Ot>=Nt||!Number.isFinite(Gt)||Gt<=0?delete H[Ot]:(at+=Gt,ht++)}V.total=at,V.count=ht})(),et>0&&Le(et),(Je=M.onHeightRecorded)==null||Je.call(M))},fenwickRangeSum:function(Oe,Ue,Je){if(Je<=Ue)return 0;const et=He(Oe,Je-1);return Ue<=0?et:et-He(Oe,Ue-1)}}})({onHeightRecorded:()=>{ni(),Ft.value&&lu(),ki.value&&De(),ot.value&&$a(),Bn("node-resize")}});function Pd(){At(),Vt.clear()}function Kk(M){!Number.isInteger(M)||M<0||M>=it.value.length||Vt.set(M,Zc(M))}function Gk(M,H,V={}){const K=Wt[M];Rn(M,H,V);const oe=Wt[M];oe&&oe>0?Kk(M):K&&Vt.delete(M)}function Yk(M,H){const V=gt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,oe;return(oe=(K=jn.get(M))==null?void 0:K.offsetHeight)!=null?oe:0});return V>0?V:gt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function Zk(M,H={}){Em(M,H),n1()}const Lr=D(()=>{var M;return!X.value&&x.deferNodesUntilVisible!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&!jt.value&&!(it.value.length>900)&&Io.value}),Qk=D(()=>!!mo&&(Lr.value||jt.value)),Xk=D(()=>jt.value||Ft.value),{liveNodeBufferResolved:Vc,focusIndex:ti,liveRange:Fs,updateLiveRange:Il}=(function(M,H){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:oe,clamp:_e}=H,Ce=D(()=>{var Le;return Math.max(0,(Le=M.liveNodeBuffer)!=null?Le:60)}),Ne=Q(0),He=Ns({start:0,end:0});return{liveNodeBufferResolved:Ce,focusIndex:Ne,liveRange:He,updateLiveRange:function(){const Le=V.value;if(!K.value||Le===0)return He.start=0,void(He.end=Le);const je=Math.min(oe.value,Le),ze=Ce.value,Oe=_e(Ne.value-ze,0,Math.max(0,Le-je));He.start=Oe,He.end=Math.min(Le,Oe+je)}}})(x,{parsedNodeCount:Wn,virtualizationEnabled:jt,maxLiveNodesResolved:Qo,clamp:Os}),$i=new Map,$l=new Map,Fr=new Map,Hd=[],Qi=new Map,Or=new Set,Jk=Q(0);let Tm=!1;const e2=D(()=>(Jk.value,Or.size)),Oo=new Map,Li=new Map,t2=Q(0),Nm=D(()=>{t2.value;let M=0;for(const H of Oo.values())M+=Math.max(0,H);return M});let Ro=null,Im=!0,n2=[0],s2="";function ni(){Im=!0}const Wd=D(()=>{if(!jt.value)return it.value.length;const M=Vc.value,H=Math.max(Fs.end+M,$s.value),V=Math.min(it.value.length,H);return Math.max(Un.value,V)});function zd(){Tm||(Tm=!0,queueMicrotask(()=>{Tm=!1,Jk.value+=1}))}function o2(M,H,V="node-resize"){if(!Y||typeof window>"u")return null;const K=window.setTimeout(()=>{Or.delete(K)&&zd();try{H()}finally{Bn(V)}},Math.max(0,M));return Or.add(K),zd(),K}function Ud(M){Y&&M!=null&&(Or.delete(M)&&zd(),window.clearTimeout(M))}function i2(){if(Y&&typeof window<"u")for(const M of Or)window.clearTimeout(M);Or.size&&(Or.clear(),zd()),Hd.length=0,Fr.clear()}function c8(M){var H,V;return(V=(H=Pt.value)==null?void 0:H[M])!=null?V:null}const{cancelScheduledFocusSync:$m,scheduleFocusSync:Fi}=(function(M){const{isClient:H,containerRef:V,virtualizationEnabled:K,requestFrame:oe,cancelFrame:_e,syncFocusToScroll:Ce}=M;let Ne=null;function He(){var je,ze,Oe;return(Oe=(ze=(je=V.value)==null?void 0:je.ownerDocument)==null?void 0:ze.defaultView)!=null?Oe:typeof window<"u"?window:null}function Le(){if(!Ne)return;const je=He();Ne.viaTimeout?je?je.clearTimeout(Ne.id):clearTimeout(Ne.id):_e?.(Ne.id),Ne=null}return{cancelScheduledFocusSync:Le,scheduleFocusSync:function(je={}){if(!K.value)return;if(!H)return void Ce(!0);if(je.immediate)return Le(),void Ce(!0);if(Ne)return;const ze=()=>{Ne=null,Ce()};if(oe)return void(Ne={id:oe(ze),viaTimeout:!1});const Oe=He();Ne={id:Oe?Oe.setTimeout(ze,16):setTimeout(ze,16),viaTimeout:!0}}}})({isClient:Y,containerRef:S,virtualizationEnabled:jt,requestFrame:Jn,cancelFrame:os,syncFocusToScroll:function(M=!1){var H;if(!jt.value)return;const V=nt.value||he();if(!V)return;const K=V.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,oe=K?.defaultView||(typeof window<"u"?window:null),_e=V===K?.documentElement||V===K?.body,Ce=it.value.length;if(!_e&&Ce>0&&j(V)){const Je=gt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),et=gt("syncFocusToScroll.scrollTop",()=>V.scrollTop),Mt=et<0?-et:et,at=(function(Nt){var Et,cn;const Ot=it.value;if(!Ot.length)return 0;if(Nt<=0)return Math.max(0,Ot.length-1);if(sn.value){const Kt=(Et=Bm()[Ot.length])!=null?Et:0;return h2(Math.max(0,Kt-Nt))}if(ue.value===Ot.length){const Kt=Br(0,Ot.length);return d1(Math.max(0,Kt-Nt))}let Gt=Nt;for(let Kt=Ot.length-1;Kt>=0;Kt--){const yn=(cn=Wt[Kt])!=null?cn:ft.value;if(Gt<=yn)return Kt;Gt-=yn}return 0})(Math.max(0,Mt)+.5*Math.max(0,Je)),ht=Os(at,0,Math.max(0,Ce-1));return void((M||Math.abs(ht-ti.value)>1)&&(ti.value=ht,Il()))}const Ne=_e?null:gt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),He=_e?0:Ne.top,Le=_e?gt("syncFocusToScroll.viewport.clientHeight",()=>{var Je,et;return(et=(Je=oe?.innerHeight)!=null?Je:V.clientHeight)!=null?et:0}):Ne.bottom,je=qe.value;let ze=null,Oe=null;for(const[Je,et]of je){if(!et)continue;const Mt=gt("syncFocusToScroll.slot.getBoundingClientRect",()=>et.getBoundingClientRect());Mt.bottom<=He||Mt.top>=Le||(ze==null&&(ze=Je),Oe=Je)}if(ze==null||Oe==null){const Je=S.value;if(!Je)return;const et=_e?{top:0}:gt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Mt=gt("syncFocusToScroll.fallback.scrollTop",()=>ne(V,K,_e)),at=_e?(()=>{const Et=gt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Je.getBoundingClientRect()),cn=(_e?0:et.top)-Et.top;return Math.max(0,cn)})():(()=>{const Et=ve(Je,V);return Math.max(0,Mt-Et)})(),ht=_e?gt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Et,cn,Ot,Gt;return(Gt=(Ot=(cn=oe?.innerHeight)!=null?cn:(Et=K?.documentElement)==null?void 0:Et.clientHeight)!=null?Ot:V.clientHeight)!=null?Gt:0}):gt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),Nt=d1(at+.5*Math.max(0,ht));return ti.value=Os(Nt,0,Math.max(0,it.value.length-1)),void Il()}const Ue=Math.round((ze+Oe)/2);!M&&Math.abs(Ue-ti.value)<=1||(ti.value=Os(Ue,0,Math.max(0,it.value.length-1)),Il())}}),{visibleNodeIndices:Lm,nodeVisibilityHandles:Ca,nodeVisibilityWatchStops:jd,nodeVisibilityFallbackTimers:r2,clearVisibilityFallback:qd,markNodeVisible:Rr,cleanupNodeVisibility:u8,destroyNodeVisibilityState:Fm}=hte({isClient:Y,shouldTrackVisibleNodeIndices:()=>Lr.value,shouldCleanupNodeVisibility:()=>jt.value,onNodeMarkedVisible:M=>{jt.value?Fi():ti.value=Os(M,0,Math.max(0,it.value.length-1))},onNodeVisibilityCleaned:M=>{jn.delete(M)&&O2()}}),{cleanupScrollListener:l2,setupScrollListener:d8}=(function(M){const{isClient:H,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:oe,resolveScrollContainer:_e,scheduleFocusSync:Ce,onScroll:Ne}=M;let He=null,Le=null;function je(){He&&(He(),He=null),Le=null,oe.value=null}function ze(Oe){const Ue=M.getScrollTop?M.getScrollTop(Oe):Oe.scrollTop;return Math.max(0,Number.isFinite(Ue)?Math.abs(Ue):0)}return{cleanupScrollListener:je,setupScrollListener:function(){if(!H)return;if(!((Oe=K?.value)!=null?Oe:V.value))return void je();var Oe;const Ue=_e();if(!Ue)return void je();if(oe.value===Ue&&He)return;je(),Le=ze(Ue);const Je=()=>{if(Ne?.(),V.value){const et=(function(Mt){const at=ze(Mt),ht=Le;Le=at;const Nt=Math.max(480,.75*(Mt.clientHeight||0));return ht==null?at>Nt?{immediate:!0}:void 0:Math.abs(at-ht)>Nt?{immediate:!0}:void 0})(Ue);et?Ce(et):Ce()}};Ue.addEventListener("scroll",Je,{passive:!0}),oe.value=Ue,He=()=>{Ue.removeEventListener("scroll",Je)}}}})({isClient:Y,virtualizationEnabled:jt,listenerEnabled:Xk,scrollRootElement:nt,resolveScrollContainer:he,scheduleFocusSync:Fi,onScroll:function(){const M=ot.value;if(!M)return;const H=Yc();if(!H||(function(K){if(tu()>=Fo)return ei=null,!1;const oe=ei;if(oe==null)return!0;const _e=Math.abs(K.scrollTop-oe)<=2;return _e||(ei=null),_e})(H))return;const V=_2(H);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,M.distanceFromBottomPx))>32)&&Ia("restore"):Ia("restore")},getScrollTop:M=>{var H;const V=M.ownerDocument||((H=S.value)==null?void 0:H.ownerDocument)||document,K=M===V.documentElement||M===V.body||M===V.scrollingElement;return gt("scrollListener.getScrollTop",()=>ne(M,V,K))}});function Os(M,H,V){return Math.min(Math.max(M,H),V)}function Om(M){return M?.firstElementChild}function a2(M,H){var V;return M?(V=M.matches)!=null&&V.call(M,H)?M:M.querySelector(H):null}function c2(){if(!sn.value)return void(z.value=0);const M=gt("updateExperimentContainerWidth.clientWidth",()=>{var H,V;return(V=(H=S.value)==null?void 0:H.clientWidth)!=null?V:0});z.value=M>0?M:0}let Kc=null;function Rm(){Kc?.disconnect(),Kc=null}const u2=Ci({loader:()=>Gn(null,null,function*(){return(yield io(()=>import("./index8-B1e6fpQC.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:LM,delay:0,suspensible:!1});function d2(M){return M===u2}const f2=D(()=>u.value==="pre"?Po:u.value==="shiki"?u2:w0),Ll=D(()=>{const M=it.value;if(!M.length||!sn.value)return M.map(()=>null);const H=z.value||gt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(H)||H<=0?M.map(()=>null):M.map((V,K)=>{const oe=Wt[K],_e=typeof oe=="number"&&oe>0;if(cs.value&&!_e){const Ne=PM(V,H,ee.value);if(Ne)return Ne}if(No.value&&V.type==="code_block"){const Ne=(function(He){if(He.type!=="code_block")return null;const Le=G2(He,Jd(He));return d2(Le)?"markdown":Le===Po?"pre":Le===f2.value||Le===w0?"monaco":null})(V);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return Xee(V,{rendererKind:Ne,monacoOptions:x.codeBlockMonacoOptions,showHeader:((Ce=x.codeBlockProps)==null?void 0:Ce.showHeader)!==!1})}var Ce;return null})});function Vd(M){var H;const V=Wt[M];if(Number.isFinite(V)&&V>0)return V;const K=(H=Ll.value[M])==null?void 0:H.height;return Number.isFinite(K)&&K>0?K:Math.max(ft.value,(function(oe){var _e,Ce,Ne,He,Le,je,ze,Oe,Ue,Je,et,Mt,at;const ht=it.value[oe];if(!ht||typeof ht!="object")return 32;const Nt=String((_e=ht.type)!=null?_e:""),Et=Zo()||640;switch(Nt){case"heading":return 44;case"paragraph":return Aa(String((Ne=(Ce=ht.raw)!=null?Ce:ht.content)!=null?Ne:""),Et,34);case"list":{const cn=Array.isArray(ht.items)?ht.items.length:1;return Math.max(48,30*cn+12)}case"list_item":return Aa(String((Le=(He=ht.raw)!=null?He:ht.content)!=null?Le:""),Et,34);case"blockquote":return Aa(String((ze=(je=ht.raw)!=null?je:ht.content)!=null?ze:""),Et,56);case"table":{const cn=Array.isArray(ht.rows)?ht.rows.length:Array.isArray(ht.children)?ht.children.length:3;return Math.max(120,38*cn+48)}case"code_block":return Aa(String((Ue=(Oe=ht.code)!=null?Oe:ht.raw)!=null?Ue:""),Et,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Aa(String((et=(Je=ht.raw)!=null?Je:ht.content)!=null?et:""),Et,96);case"thematic_break":return 24;default:return Aa(String((at=(Mt=ht.raw)!=null?Mt:ht.content)!=null?at:""),Et,40)}})(M))}function Aa(M,H,V,K=22){const oe=String(M??"");if(!oe)return V;const _e=Math.max(18,Math.floor(Math.max(320,H)/8)),Ce=oe.split(/\r?\n/).length,Ne=Math.ceil(oe.length/_e),He=Math.max(1,Ce,Ne);return Math.max(V,Math.ceil(He*K+12))}function Gc(M){const H=Number(M);return!Number.isFinite(H)||H<=0?-1:Math.round(H/32)}function Bm(){var M,H;const V=it.value.length,K=Gc(z.value||gt("getFallbackHeightPrefix.clientWidth",()=>{var Ne;return((Ne=S.value)==null?void 0:Ne.clientWidth)||0})),oe=((M=s.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(s.virtualScroll.measurementKey),_e=[V,$t.count,Math.round($t.total),Math.round(100*ft.value),oe,K,sn.value?1:0,US.value,Z.value].join(":");if(!Im&&s2===_e)return n2;const Ce=new Array(V+1);Ce[0]=0;for(let Ne=0;Ne<V;Ne++)Ce[Ne+1]=Ce[Ne]+(sn.value?Vd(Ne):(H=Wt[Ne])!=null?H:ft.value);return n2=Ce,s2=_e,Im=!1,Ce}function h2(M){var H,V;const K=it.value.length;if(K<=0||M<=0)return 0;const oe=Bm();if(M>=((H=oe[K])!=null?H:0))return K-1;let _e=0,Ce=K-1,Ne=K-1;for(;_e<=Ce;){const He=_e+Ce>>1;((V=oe[He+1])!=null?V:0)>=M?(Ne=He,Ce=He-1):_e=He+1}return Ne}function Br(M,H){var V,K;if(M>=H)return 0;if(sn.value)return(function(Ce,Ne){var He,Le;const je=it.value.length,ze=Os(Math.trunc(Ce),0,je),Oe=Os(Math.trunc(Ne),ze,je);if(ze>=Oe)return 0;const Ue=Bm();return((He=Ue[Oe])!=null?He:0)-((Le=Ue[ze])!=null?Le:0)})(M,H);if(ue.value!==it.value.length){let Ce=0;for(let Ne=M;Ne<H;Ne++)Ce+=(V=Wt[Ne])!=null?V:ft.value;return Ce}const oe=ke.value,_e=Re.value;if(!oe.length||!_e.length){let Ce=0;for(let Ne=M;Ne<H;Ne++)Ce+=(K=Wt[Ne])!=null?K:ft.value;return Ce}return Dd(oe,M,H)+(H-M-Dd(_e,M,H))*ft.value}Ge(()=>it.value.length,M=>{ni(),M<=0?Pd():(M<ue.value&&zt(M),M!==ue.value&&Qt(M))},{immediate:!0});const f8=D(()=>{if(!jt.value)return it.value.map((K,oe)=>({node:K,index:oe}));const M=it.value.length,H=Os(Fs.start,0,M),V=Os(Fs.end,H,M);return it.value.slice(H,V).map((K,oe)=>({node:K,index:H+oe}))}),Dm=D(()=>jt.value?Br(0,Math.min(Fs.start,it.value.length)):0),Pm=D(()=>{if(!jt.value)return 0;const M=it.value.length;return Br(Math.min(Fs.end,M),M)});function p2(){if(!sn.value)return 0;let M=0;const H=Ll.value;for(let V=0;V<H.length;V++){if(!H[V])continue;const K=Wt[V];Number.isFinite(K)&&K>0||M++}return M}function m2(){const M=it.value.length;return{totalNodes:M,measuredCount:$t.count,estimatedCount:p2(),averageNodeHeight:ft.value,topSpacerHeight:Dm.value,bottomSpacerHeight:Pm.value,estimatedTotalHeight:Br(0,M),width:Fl()}}function h8(){const M=it.value,H=m2();return qt(rt({},H),{probe:{paragraphReady:!!ee.value.paragraph,listItemReady:!!ee.value.listItem,listWrapperOverhead:ee.value.listWrapperOverhead,headingReadyLevels:Object.entries(ee.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:M.map((V,K)=>{var oe,_e,Ce,Ne,He,Le,je,ze,Oe;return{index:K,type:V.type,estimateKind:(_e=(oe=Ll.value[K])==null?void 0:oe.kind)!=null?_e:null,rendererKind:(Ne=(Ce=Ll.value[K])==null?void 0:Ce.rendererKind)!=null?Ne:null,estimatedHeight:(Le=(He=Ll.value[K])==null?void 0:He.height)!=null?Le:null,estimatedContentHeight:(ze=(je=Ll.value[K])==null?void 0:je.contentHeight)!=null?ze:null,measuredHeight:(Oe=Wt[K])!=null?Oe:null}})})}function Hm(){return s.indexKey!=null?String(s.indexKey):as.value?`virtual-${qn()}`:"markdown-renderer"}function g2(M){const H=String(M),V=`${Hm()}-`;if(!H.startsWith(V))return null;const K=H.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const oe=Number(K[1]);return!Number.isInteger(oe)||oe<0||oe>=it.value.length?null:oe}function qn(){var M,H,V;const K=(M=s.virtualScroll)==null?void 0:M.sessionKey;return String(K!=null&&K!==""?K:(V=(H=s.indexKey)!=null?H:x.customId)!=null?V:nn)}function bs(){var M;const H=(M=s.virtualScroll)==null?void 0:M.threadKey;return H==null||H===""?void 0:String(H)}function Wm(M){var H;return(M??"")===((H=bs())!=null?H:"")}function p8(){var M;const H=(M=s.virtualScroll)==null?void 0:M.measurementKey;return H==null?"":String(H)}function m8(){var M,H;const V=u.value,K=V==="monaco"?x.codeBlockMonacoOptions:void 0,oe=x.codeBlockProps,_e=V==="shiki";return[x.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",x.codeBlockStream===!1?"code-static":"code-stream",Ms(x.codeBlockMinWidth),Ms(x.codeBlockMaxWidth),..._e?[sp((M=oe?.themes)!=null?M:x.themes,(H=oe?.langs)!=null?H:x.langs)]:[],Ms(K?.fontSize),Ms(K?.lineHeight),Ms(K?.fontFamily),Ms(K?.tabSize),Ms(K?.MAX_HEIGHT),Ms(K?.wordWrap),Ms(K?.wrappingIndent),Ms(K?.padding),Ms(oe?.showHeader),Ms(oe?.showCopyButton),Ms(oe?.showExpandButton),Ms(oe?.showPreviewButton),Ms(oe?.showCollapseButton),Ms(oe?.showFontSizeButtons)].join("\0")}function Xi(){return[p8(),m8()].join("\0")}function Fl(){return Zo()}const Kd=D(()=>Gc(Fl())),Bo=D(()=>[Xi(),Kd.value].join("\0")),g8=D(()=>{var M;return as.value?["virtual",(M=bs())!=null?M:"",qn(),Bo.value].join("\0"):s.indexKey});function Ma(){t2.value+=1}function zm(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=it.value.length||M.sessionKey!==qn()||M.threadKey!==bs()||M.layoutEpochKey!==Bo.value)}function v2(M){const H=String(M),V=Li.get(H);return V?zm(V)?V.index:null:g2(H)}function y2(M="async-node"){(Oo.size||Li.size)&&(Oo.clear(),Li.clear(),Ma(),Bn(M))}const Ea=Yt(Jg,null),Um={reportHeight(M,H){if(!Ft.value)return;const V=v2(M);if(V==null)return;const K=$i.get(V);if(!K)return;const oe=Number(H),_e=Yk(V,K);Gk(V,Number.isFinite(oe)&&oe>0?Math.max(oe,_e||0):_e)},markPending(M){if(!Ft.value)return;const H=g2(M);H!=null&&(function(V,K){var oe;const _e=Li.get(V);if(_e&&zm(_e))return Oo.set(V,Math.max(0,(oe=Oo.get(V))!=null?oe:0)+1),Ma(),void Bn("async-node");Oo.set(V,1),Li.set(V,(function(Ce){return{index:Ce,sessionKey:qn(),threadKey:bs(),layoutEpochKey:Bo.value}})(K)),Ma(),Bn("async-node")})(String(M),H)},markSettled(M){if(!Ft.value)return;const H=String(M),V=v2(M);(V!=null||(function(K){return Oo.has(String(K))})(H))&&(function(K){var oe;const _e=(oe=Oo.get(K))!=null?oe:0;return!(_e<=0||(_e<=1?(Oo.delete(K),Li.delete(K)):Oo.set(K,_e-1),Ma(),_e===1&&Bn("async-node"),0))})(H)&&V!=null&&Ji()}};function v8(){let M=0;for(const H of $i.values())M+=gt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=H?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,M))}In(Jg,{reportHeight(M,H){Um.reportHeight(M,H),Ea?.reportHeight(M,H)},markPending(M){Um.markPending(M),Ea?.markPending(M)},markSettled(M){Um.markSettled(M),Ea?.markSettled(M)}});let jm,qm=null,Ta=null;function Gd(M){return M!==!1&&M!=null&&M!==""}function k2(){return jt.value?(function(){if(!jt.value)return!0;const M=it.value.length,H=Os(Fs.start,0,M),V=Os(Fs.end,H,M);if(H>=V)return!0;for(let K=H;K<V;K++)if(!jn.has(K)||f1(K)&&!$i.has(K))return!1;return!0})():Un.value>=Wd.value}function Vm(){return q.value===!0&&!se.value&&Nm.value===0&&Or.size===0&&Qi.size===0&&Ro==null&&k2()}function b2(){var M,H;if(((M=s.virtualScroll)==null?void 0:M.settleMode)!=="manual"||qm===qn()&&jm===bs())return!0;const V=(H=s.virtualScroll)==null?void 0:H.settledToken;return!!Gd(V)&&Ta===au(V)}function Km(){return Vm()&&b2()}function y8(M,H){return H.totalNodes<=0?M==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?M==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function Ol(M="manual",H){const V=m2(),K=(function(oe){return oe||(q.value!==!0?it.value.length>0?"streaming":"estimating":!k2()||Qi.size>0||Ro!=null?"measuring":Km()?"settled":"settling")})(H);return{sessionKey:qn(),threadKey:bs(),phase:K,nodeCount:V.totalNodes,liveRange:{start:Fs.start,end:Fs.end},renderedCount:Un.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:v8(),totalHeight:x2(),width:V.width,final:q.value===!0,stable:Km(),confidence:y8(K,V),reason:M}}function Yc(){const M=nt.value||he(),H=S.value;if(!M||!H)return null;const V=M.ownerDocument||H.ownerDocument||document,K=M===V.documentElement||M===V.body||M===V.scrollingElement,oe=gt("getScrollBox.scrollTop",()=>ne(M,V,K)),_e=gt("getScrollBox.scrollHeight",()=>{var Ne,He,Le,je,ze;return K?Math.max((He=(Ne=V.documentElement)==null?void 0:Ne.scrollHeight)!=null?He:0,(je=(Le=V.body)==null?void 0:Le.scrollHeight)!=null?je:0,(ze=M.scrollHeight)!=null?ze:0):M.scrollHeight}),Ce=gt("getScrollBox.clientHeight",()=>{var Ne;return K?((Ne=V.documentElement)==null?void 0:Ne.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:V,isViewportRoot:K,scrollTop:oe,scrollHeight:_e,clientHeight:Ce}}function x2(){const M=it.value.length,H=Math.max(0,Br(0,M)),V=gt("getRendererLogicalHeight.offsetHeight",()=>{var oe,_e;return(_e=(oe=S.value)==null?void 0:oe.offsetHeight)!=null?_e:0}),K=Math.max(0,V>0?V:gt("getRendererLogicalHeight.scrollHeight",()=>{var oe,_e;return(_e=(oe=S.value)==null?void 0:oe.scrollHeight)!=null?_e:0}));return M<=0?Math.ceil(V):jt.value?H>0?Math.max(1,Math.ceil(H),(function(){let oe=Dm.value+Pm.value;for(const _e of jn.values())_e&&(oe+=Math.max(0,gt("getVirtualizedDomLogicalHeight.offsetHeight",()=>_e.offsetHeight||0)));return Math.ceil(Math.max(0,oe))})(),(function(oe,_e){return oe<=0||_e<=0?0:_e<=oe+Math.max(512,.05*oe)?Math.ceil(_e):0})(H,K)):Math.max(1,Math.ceil(K)):Ft.value?H>0||$t.count>0||p2()>0?(Us.value&&Un.value,Math.max(1,Math.ceil(K),Math.ceil(H))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(H))}function _2(M){const H=S.value;if(!H)return null;const V=gt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(oe){return oe.isViewportRoot?oe.clientHeight:gt("getViewportBottomInRoot.getBoundingClientRect",()=>oe.root.getBoundingClientRect().bottom)})(M)-V.bottom}function k8(M={}){const H=M.requireViewport!==!1,V=(function(_e=64){const Ce=Yc(),Ne=S.value;if(!Ce||!Ne)return!1;const He=(function(je){if(je.isViewportRoot)return{top:0,bottom:je.clientHeight};const ze=gt("getVirtualViewportRect.getBoundingClientRect",()=>je.root.getBoundingClientRect());return{top:ze.top,bottom:ze.bottom}})(Ce),Le=gt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ne.getBoundingClientRect());return Le.bottom>=He.top-_e&&Le.top<=He.bottom+_e})();if(H&&!V)return null;const K=(function(){const _e=Yc(),Ce=S.value;if(!_e||!Ce||Math.max(0,_e.scrollHeight-_e.scrollTop-_e.clientHeight)>64)return null;const Ne=_2(_e);return Ne==null?null:Ne>=-8&&Ne<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ne)}:null})();if(K)return{anchor:K,captured:!0};const oe=tt();if(oe)return{anchor:{type:"node",nodeIndex:oe.nodeIndex,offsetWithinNodePx:oe.offsetWithinNodePx},captured:V};if(M.allowFallback===!0){const _e=(function(){const Ce=it.value.length;return Ce<=0?null:{type:"node",nodeIndex:Os(ti.value,0,Math.max(0,Ce-1)),offsetWithinNodePx:0}})();return _e?{anchor:_e,captured:!1}:null}return null}function Gm(M){let H=2166136261;for(let V=0;V<M.length;V++)H^=M.charCodeAt(V),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function b8(M,H){let V=M;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 x8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Yd(M,H=new WeakSet,V=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(K){const oe=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${Gm(oe)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(H.has(M))return"cycle";if(V>=6)return"max-depth";H.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Le=[];for(let je=0;je<M.length;je++)Le.push(Yd(M[je],H,V+1));return`a:${M.length}:${Le.join(",")}`}const _e=[],Ce=[],Ne=Math.max(0,M.length-32);let He=2166136261;for(let Le=0;Le<M.length;Le++){const je=Yd(M[Le],H,V+1);He=b8(He,je),Le<32&&_e.push(je),Le>=Ne&&Ce.push(je)}return[`a:${M.length}`,`h=${_e.join(",")}`,`t=${Ce.join(",")}`,`all=${(He>>>0).toString(36)}`].join(":")}const K=M,oe=Object.keys(K).filter(_e=>{const Ce=K[_e];return _e!=="parent"&&_e!=="el"&&_e!=="component"&&(Ce==null||typeof Ce=="string"||typeof Ce=="number"||typeof Ce=="boolean"||x8.has(_e))}).sort();return`o:${oe.length}:${oe.map(_e=>`${_e}=${Yd(K[_e],H,V+1)}`).join(";")}`}finally{H.delete(M)}}let w2=-1,Ym="";function Zc(M){const H=it.value[M];return H?Gm(Yd(H)):""}function Zm(){const M=Z.value;if(w2===M)return Ym;let H=2166136261;for(let V=0;V<it.value.length;V++){const K=Zc(V);for(let oe=0;oe<K.length;oe++)H^=K.charCodeAt(oe),H=Math.imul(H,16777619)}return Ym=(H>>>0).toString(36),w2=M,Ym}function Na(M,H={}){var V;const K=H.includeHeightCache===!0,oe=(V=H.includeContentHash)!=null?V:K,_e=K?(function(Ne){const He=(function(){var et,Mt;const at=Number((Mt=(et=s.virtualScroll)==null?void 0:et.heightCacheLimit)!=null?Mt:5e3);return!Number.isFinite(at)||at<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(at))})();if(!Number.isFinite(He)||Ne.length<=He)return Ne;const Le=new Map,je=et=>{!et||Le.size>=He||Le.set(et.index,et)},ze=it.value.length,Oe=Os(Fs.start-2*Vc.value,0,ze),Ue=Os(Fs.end+2*Vc.value,Oe,ze);for(const et of Ne)et.index>=Oe&&et.index<Ue&&je(et);const Je=Math.max(1,Math.ceil(Ne.length/He));for(let et=0;et<Ne.length&&Le.size<He;et+=Je)je(Ne[et]);for(let et=Ne.length-1;et>=0&&Le.size<He;et-=Je)je(Ne[et]);return Array.from(Le.values()).sort((et,Mt)=>et.index-Mt.index).slice(0,He)})(Nl().map(Ne=>{var He;const Le=it.value[Ne.index];return Le?qt(rt({},Ne),{nodeType:String((He=Le.type)!=null?He:""),signature:Zc(Ne.index)}):null}).filter(Ne=>!!Ne)):[],Ce=k8({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Ce||_e.length||H.includeEmptyState===!0?qt(rt({sessionKey:M.sessionKey,threadKey:M.threadKey},Ce?{anchor:Ce.anchor,anchorCaptured:Ce.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:oe?Zm():void 0,measurementKey:Xi()||void 0,heightCache:_e.length?_e:void 0}):null}function Qm(M){var H,V;const K=Yc();if(!K)return;const oe=(function(Ne){const He=S.value;if(!He)return null;const Le=ve(He,Ne.root),je=it.value.length,ze=gt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>He.offsetHeight||0),Oe=Math.max(0,ze>0?ze:je>0?gt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>He.scrollHeight||0):0),Ue=x2();return Le+Math.max(Oe,Ue)})(K);if(oe==null)return;const _e=Math.max(0,M.distanceFromBottomPx),Ce=Math.max(0,oe-K.clientHeight-_e);(function(Ne){Fo=tu()+120,ei=Ne})(Ce),K.isViewportRoot?(V=(H=K.doc.defaultView)==null?void 0:H.scrollTo)==null||V.call(H,0,Ce):KS(K.root,K.doc,Ce,{isReverseFlexScrollRoot:j,getNormalizedScrollTop:ne})}const Xm=[];function S2(){if(Y)for(Rt!=null&&(os?.(Rt),Rt=null);Xm.length;){const M=Xm.pop();M!=null&&window.clearTimeout(M)}}function Ia(M){const H=!!ot.value;ot.value=null,Fo=0,ei=null,S2(),H&&M&&Bn(M)}function $a(){if(!ot.value||!Y||Rt!=null)return;const M=()=>{Rt=null;const H=ot.value;H&&Qm(H)};Rt=Jn?Jn(M):null,Rt==null&&M()}function C2(M,H={}){const V=it.value.length;return V<=0?[]:M.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(oe){var _e;const Ce=it.value[oe.index];return!(!Ce||oe.nodeType&&oe.nodeType!==String((_e=Ce.type)!=null?_e:"")||oe.signature&&oe.signature!==Zc(oe.index))})(K))}function A2(M){const H=Gc(Fl()),V=Gc(M);return H!==-1&&V!==-1&&H===V}function Jm(M){var H;const V=Number(M?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((H=M?.metrics)==null?void 0:H.width);return Number.isFinite(K)&&K>0?K:null}function M2(M){var H;return M.sessionKey===qn()&&!!Wm(M.threadKey)&&((H=M.measurementKey)!=null?H:"")===Xi()&&!!A2(Jm(M))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(E2(V)?K.some(oe=>!!(oe.nodeType||oe.signature)):K.some(oe=>!!oe.signature))})(M)}function E2(M){return!!(M.contentHash&&M.contentHash===Zm())}function _8(M){return!E2(M)}let Rl=null,Bl=null,Zd=null,Qc=null,Xc=null;function e1(M){var H;const V=M.map(oe=>{var _e,Ce;return[oe.index,Math.round(10*oe.height),(_e=oe.nodeType)!=null?_e:"",(Ce=oe.signature)!=null?Ce:""].join("")}).join(""),K=Gc(Fl());return[(H=bs())!=null?H:"",qn(),Xi(),it.value.length,K,M.length,Gm(V)].join(":")}function T2(M=(H=>(H=s.virtualScroll)==null?void 0:H.heightCache)()){if(!Ft.value||!M?.length||it.value.length<=0||!A2((H=s.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const V=C2(M,{requireSignature:!0});if(!V.length)return!1;const K=e1(V);return K===Rl?(Bl="standalone",!0):(Zk(V,{mode:"merge"}),ni(),Rl=K,Bl="standalone",su(),Bn("restore"),!0)}function t1(M,H={}){var V,K,oe;if(!Ft.value||!M||M.sessionKey!==qn()||!Wm(M.threadKey)||it.value.length<=0)return!1;const _e=!!((V=M.heightCache)!=null&&V.length)&&!Qd(),Ce=!M.anchor||M.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:M.anchor,Ne=H.restoreAnchor===!0&&!!Ce&&!Qd()&&Number(Jm(M))>0;let He=!1;if((K=M.heightCache)!=null&&K.length&&M2(M)){const je=C2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:_8(M)});je.length&&(Zk(je,{mode:"merge"}),ni(),Rl=e1(je),Bl="restore",su(),He=!0)}if(_e||Ne)return!1;if(!H.restoreAnchor||!Ce)return He&&Bn("restore"),!0;const Le=(function(je,ze){var Oe;const Ue=je.anchor,Je=Ue?Ue.type==="bottom"?`bottom:${Math.round(Ue.distanceFromBottomPx)}`:`node:${Ue.nodeIndex}:${Math.round(Ue.offsetWithinNodePx)}`:"none";return[(Oe=bs())!=null?Oe:"",qn(),Xi(),Kd.value,ze,Je].join(":")})(M,(oe=H.restoreToken)!=null?oe:"imperative");return Zd===Le?(He&&Bn("restore"),!0):(Zd=Le,(function(je){const ze=()=>{if(je.type==="node")return Ia(),void ut({nodeIndex:je.nodeIndex,offsetWithinNodePx:je.offsetWithinNodePx});if(Se(),ki.value=null,ot.value=je,S2(),Qm(je),Y)for(const Oe of[0,120,280,480])Xm.push(window.setTimeout(()=>{const Ue=ot.value;Ue&&Qm(Ue)},Oe))};(function(Oe){if(!jt.value)return!1;const Ue=it.value.length;return!(Ue<=0||(ti.value=Oe.type==="node"?Os(Oe.nodeIndex,0,Ue-1):Ue-1,Il(),0))})(je)?vt(ze):ze()})(Ce),Bn("restore"),!0)}function Qd(){const M=Fl();return Number.isFinite(M)&&M>0}function N2(M){var H;return M.sessionKey===qn()&&!!Wm(M.threadKey)&&(it.value.length<=0||!(!((H=M.heightCache)!=null&&H.length)||Qd())||!(!(M.anchor&&Number(Jm(M))>0)||Qd()))}function n1(){Vt.clear();for(const M of Object.keys(Wt)){const H=Number(M);Number.isInteger(H)&&H>=0&&H<it.value.length&&Kk(H)}}function Jc(){Ro!=null&&(os?.(Ro),Ro=null),h1()}function I2(){return!Y||Is?Promise.resolve():new Promise(M=>{let H=!1,V=null;const K=()=>{H||(H=!0,V!=null&&window.clearTimeout(V),M())};if(Jn)return Jn(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function s1(M,H=bs(),V=Bo.value){return qn()===M&&bs()===H&&Bo.value===V}function o1(){return Gn(this,arguments,function*(M={}){var H,V,K,oe,_e;const Ce=qn(),Ne=bs(),He=Bo.value,Le=(H=M.frames)!=null?H:2,je=(V=M.timeoutMs)!=null?V:120,ze=(K=M.reason)!=null?K:"manual",Oe=M.expectedSettledTokenKey,Ue=M.flushPendingTimers===!0,Je=Ol(ze),et=()=>qt(rt({},Je),{phase:Je.final?"settling":Je.phase,stable:!1,confidence:Je.confidence==="final"?"mixed":Je.confidence,reason:ze}),Mt=()=>s1(Ce,Ne,He)&&(Oe==null||nu()===Oe);for(let Et=0;Et<Le;Et++){if(yield vt(),!Mt()||(yield I2(),!Mt()))return et();Ji(),Jc()}if(yield(function(Et){return!Y||Et<=0?Promise.resolve():new Promise(cn=>window.setTimeout(cn,Et))})(je),!Mt()||(Ue&&i2(),Ji(),Jc(),!Mt()))return et();const at=Vm();at&&(qm=Ce,jm=Ne,((oe=s.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&Oe!=null&&Gd((_e=s.virtualScroll)==null?void 0:_e.settledToken)&&nu()===Oe&&(Ta=au(s.virtualScroll.settledToken)));const ht=Mt()&&at&&b2(),Nt=Ol(ze,ht?"final":void 0);return c1(Nt,!0),Nt})}let i1="content",Dl=null,Pl=null,r1=0,eu=null,La=null,l1=null,a1=null;function tu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function $2(M){var H,V;const K=eu;if(!K)return!0;const oe=(V=(H=s.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?V:1;return Math.abs(M.totalHeight-K.totalHeight)>oe||M.sessionKey!==K.sessionKey||M.phase!==K.phase||M.stable!==K.stable||M.final!==K.final||M.threadKey!==K.threadKey||M.nodeCount!==K.nodeCount||M.measuredCount!==K.measuredCount||M.width!==K.width}function Ms(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function nu(M=(H=>(H=s.virtualScroll)==null?void 0:H.settledToken)()){return Ms(M)}function L2(M,H){var V,K;return[M,H.sessionKey,(V=H.threadKey)!=null?V:"",Xi(),Zm(),Ms((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function su(){l1=null,a1=null,La=null}function w8(M){const H=M.heightCache;return H?.length?e1(H):""}function ou(M){var H,V,K;const oe=M.metrics,_e=M.anchor?(Ce=M.anchor).type==="bottom"?`bottom:${Math.round(Ce.distanceFromBottomPx)}`:`node:${Ce.nodeIndex}:${Math.round(Ce.offsetWithinNodePx)}`:"none";var Ce;return[M.sessionKey,(H=M.threadKey)!=null?H:"",(V=M.measurementKey)!=null?V:Xi(),(K=M.contentHash)!=null?K:"",w8(M),_e,M.anchorCaptured?1:0,oe.liveRange.start,oe.liveRange.end,oe.renderedCount,oe.nodeCount,Math.round(oe.totalHeight),Math.round(oe.width),oe.phase,oe.stable?1:0].join("\0")}function c1(M,H=!1){if(!Ft.value||(function(Ce=!1){return!Ce&&as.value&&!Cs.value})(H))return;const V=H||$2(M),K=(function(Ce,Ne=!1){return Ne||Ce.stable||Ce.phase==="final"?{state:Na(Ce,{includeHeightCache:!0})}:{state:Na(Ce)}})(M,H),oe=K.state,_e=!!(oe&&(V||(function(Ce,Ne=!1){return!!Ne||ou(Ce)!==La})(oe,H)));if(V&&(E(M),eu=M,r1=tu()),oe&&_e&&(T(oe),oe.anchor&&F(oe.anchor),La=ou(oe)),M.stable){const Ce=L2("settled",M);if(Ce!==l1){l1=Ce;const Ne=Na(M,{includeHeightCache:!0});Ne&&(T(Ne),La=ou(Ne)),(function(He){o("render-settled",He)})(M)}}if(M.phase==="final"){const Ce=L2("final",M);if(Ce!==a1){a1=Ce;const Ne=Na(M,{includeHeightCache:!0});Ne&&(T(Ne),La=ou(Ne)),(function(He){o("render-final",He)})(M)}}}function u1(){Dl!=null&&(os?.(Dl),Dl=null),Pl!=null&&Y&&(window.clearTimeout(Pl),Pl=null)}function F2(){Dl=null,Pl=null,(function(M){if(Qi.size>0||Ro!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(i1)&&(Ji(),Jc()),c1(Ol(i1))}function Bn(M){var H,V;if(!Ft.value||(i1=M,Dl!=null||Pl!=null))return;const K=Math.max(0,(V=(H=s.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?V:32),oe=Math.max(0,K-(tu()-r1)),_e=()=>{Pl=null,Dl=Jn?Jn(F2):null,Dl==null&&F2()};Y&&oe>0?Pl=window.setTimeout(_e,oe):_e()}function d1(M){var H;if(M<=0)return 0;const V=it.value;if(sn.value)return h2(M);if(ue.value===V.length&&ke.value.length&&Re.value.length){const oe=ft.value,_e=ke.value,Ce=Re.value,Ne=ze=>ze<=0?0:Dd(_e,0,ze)+(ze-Dd(Ce,0,ze))*oe;let He=0,Le=V.length-1,je=V.length-1;for(;He<=Le;){const ze=He+Le>>1;Ne(ze+1)>=M?(je=ze,Le=ze-1):He=ze+1}return je}let K=M;for(let oe=0;oe<V.length;oe++){const _e=(H=Wt[oe])!=null?H:ft.value;if(K<=_e)return oe;K-=_e}return Math.max(0,V.length-1)}function O2(){Lo.value+=1}function f1(M){return!(Us.value&&M>=Un.value)&&(!Lr.value||M<$s.value||Lm.value.has(M))}function Fa(M){const H=jd.get(M);H&&(H(),jd.delete(M));const V=Ca.get(M);V&&(V.destroy(),Ca.delete(M)),qd(M)}function R2(M,H){let V=!1;if(H){const _e=jn.get(M);jn.set(M,H),_e!==H&&(V=!0)}else jn.delete(M)&&(V=!0);if(V&&O2(),H||qd(M),!Qk.value||!mo||!jt.value&&Lr.value&&!W.value&&Ca.size>=640&&(W.value||(W.value=!0,Fm()),!Qk.value||!mo))return Fa(M),void(H&&Rr(M,!0));if(M<$s.value&&!jt.value||Lm.value.has(M))return Fa(M),void Rr(M,!0);if(!H)return void Fa(M);Fa(M);const K=mo(H,{rootMargin:"400px"});if(!K)return;Ca.set(M,K),Rr(M,K.isVisible.value),Lr.value&&(function(_e){if(!Y||!Lr.value)return;qd(_e);const Ce=_e%17*23,Ne=window.setTimeout(()=>{if(r2.delete(_e),!Lr.value||Lm.value.has(_e))return;const He=jn.get(_e);if(!He)return;const Le=he(He),je=He.ownerDocument||document,ze=je.defaultView||window,Oe=!Le||Le===je.documentElement||Le===je.body,Ue=!Oe&&Le?gt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Le.getBoundingClientRect()):null,Je=Oe?0:Ue.top,et=Oe?gt("nodeVisibilityFallback.clientHeight",()=>{var at,ht;return(ht=(at=ze.innerHeight)!=null?at:Le?.clientHeight)!=null?ht:0}):Ue.bottom,Mt=gt("nodeVisibilityFallback.node.getBoundingClientRect",()=>He.getBoundingClientRect());Mt.bottom>=Je-500&&Mt.top<=et+500&&Rr(_e,!0)},1800+Ce);r2.set(_e,Ne)})(M);let oe=null;oe=Ge(()=>K.isVisible.value,_e=>{if(_e){qd(M),Rr(M,!0),oe?.(),jd.delete(M),Ca.get(M)===K&&Ca.delete(M);try{K.destroy()}catch{}}},{immediate:!0}),jd.set(M,oe),jt.value&&Fi()}function h1(){Ro=null;for(const[M,H]of Qi)Qi.delete(M),$i.get(M)===H.el&&$l.get(M)===H.version&&Gk(M,H.height,{allowShrink:H.allowShrink})}function Oa(){Ro!=null&&(os?.(Ro),Ro=null),Qi.clear()}function Xd(M,H){(function(V,K,oe){var _e;if(!Number.isFinite(oe)||oe<=0||$i.get(V)!==K)return;const Ce=$l.get(V);if(Ce==null)return;const Ne=it.value[V],He=se.value&&q.value!==!0&&!((_e=s.nodes)!=null&&_e.length)&&V>=it.value.length-2,Le=!(Ne?.loading===!0||He),je=Qi.get(V),ze=je?je.allowShrink&&Le:Le,Oe=je&&!ze?Math.max(je.height,oe):oe;Qi.set(V,{height:Oe,allowShrink:ze,version:Ce,el:K}),Ro==null&&(Ro=Jn?Jn(h1):null,Ro==null&&h1())})(M,H,Yk(M,H))}function Ji(){for(const[M,H]of $i)H&&Xd(M,H)}function B2(){be?.disconnect(),be=null,ds.clear()}function p1(){for(;Hd.length;)Ud(Hd.pop())}Ge(Cs,M=>{M&&Bn("content")},{flush:"post"}),t({getVirtualMetrics:Ol,captureVirtualState:function(M={}){var H;return Na(Ol("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(H=M.includeEmptyState)==null||H})},restoreVirtualState:function(M,H={}){const V=H.restoreAnchor===!0,K=H.restoreToken==null?"imperative":String(H.restoreToken);Qc=M,Xc={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!t1(M,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&N2(M)||(Qc=null,Xc=null)},forceMeasure:function(M="manual"){return Gn(this,null,function*(){yield vt(),yield I2(),Ji(),Jc(),yield vt();const H=Ol(M);return c1(H,!0),H})},settle:o1,scrollToNode:function(M,H="start"){Ia(),Se();const V=it.value.length;if(V<=0)return;const K=Os(M,0,V-1),oe=()=>{var _e;const Ce=we({nodeIndex:K,offsetWithinNodePx:0}),Ne=Vd(K),He=Yc(),Le=(_e=He?.clientHeight)!=null?_e:0,je=Tl();let ze=Ce;if(H==="center")ze=Ce-Le/2+Ne/2;else if(H==="end")ze=Ce-Le+Ne;else if(H==="nearest"&&je!=null){if(Ce>=je&&Ce+Ne<=je+Le)return;ze=Ce<je?Ce:Ce-Le+Ne}te(Math.max(0,ze)),Fi({immediate:!0}),jt.value&&(ti.value=K,Il())};if(jt.value)return ti.value=K,Il(),void vt(oe);oe()}}),Ge(()=>Xo.value,M=>{if(!M){B2();for(const H of Fr.values())for(const V of H)Ud(V);Fr.clear(),$l.clear(),p1(),Oa()}},{immediate:!0}),Ge(q,M=>{M&&(function(){if(Y&&q.value&&$i.size){p1();for(const H of[80,240,640]){const V=o2(H,()=>{for(const[K,oe]of $i)oe&&Xd(K,oe)},"final");V!=null&&Hd.push(V)}}})(),Bn(M?"final":"content")}),Ge([()=>it.value.length,()=>Un.value],()=>{ot.value&&$a(),Bn("content")},{flush:"post",immediate:!0}),Ge([()=>Fs.start,()=>Fs.end],()=>{Bn("batch")},{flush:"post"});const{cleanupBatchScheduler:S8}=(function(M){const{props:H,isClient:V,isTestEnv:K,parsedNodesIdentity:oe,parsedNodeCount:_e,desiredRenderedCount:Ce,datasetKey:Ne,batchingEnabled:He,incrementalRenderingActive:Le,resolvedBatchSize:je,resolvedInitialBatch:ze,renderedCount:Oe,adaptiveBatchSize:Ue,previousRenderContext:Je,previousBatchConfig:et,requestFrame:Mt,cancelFrame:at,hasIdleCallback:ht,cleanupNodeVisibility:Nt,onDatasetKeyChanged:Et,onDatasetChanged:cn}=M;let Ot=null,Gt=null,Kt=!1,yn=null,Do=null,Js=0,bi=!1,Dr=!1;const Pr=new Set,Wl=new Set;function tb(){if(V){Ot!=null&&(at?.(Ot),Ot=null),Gt!=null&&(window.clearTimeout(Gt),Gt=null),Do!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Do),Do=null),Js+=1;for(const js of Pr)at?.(js);Pr.clear();for(const js of Wl)window.clearTimeout(js);Wl.clear(),Kt=!1,yn=null,bi=!1,Dr=!1}}function rf(){return typeof performance<"u"?performance.now():Date.now()}function nb(js){(function(er){var Hr;if(!Le.value)return;const tr=Math.max(2,(Hr=H.renderBatchBudgetMs)!=null?Hr:6),nr=Math.max(1,je.value||1),xi=Math.max(1,Math.floor(nr/4));er>1.2*tr?Ue.value=Math.max(xi,Math.floor(.7*Ue.value)):er<.5*tr&&Ue.value<nr&&(Ue.value=Math.min(nr,Math.ceil(1.2*Ue.value)))})(js),bi=!1;const go=Dr||Oe.value<Ce.value;Dr=!1,go&&ib()}function sb(js,go={}){var er,Hr;if(!Le.value)return;const tr=Ce.value;if(Oe.value>=tr)return;const nr=Math.max(1,js),xi=()=>{const Da=rf();let Pa=0;Ot=null,Gt=null,Do=null,Kt=!1;const Ha=yn??nr;yn=null;const _1=rf();Oe.value=Math.min(tr,Oe.value+Ha),Nt(Oe.value),Pa=rf()-_1,(function(w1,rb){if(!V)return void nb(rb);bi=!0;const lb=++Js;vt().then(()=>{var ab;if(lb!==Js)return;const j8=rf(),q8=Math.max(rb,j8-w1),cb=()=>{lb===Js&&nb(q8)};if(Mt){let db=!1,sr=null;const fb=()=>{db||(db=!0,cb())},lf=Mt(()=>{Pr.delete(lf),sr!=null&&(window.clearTimeout(sr),Wl.delete(sr),sr=null),fb()});return Pr.add(lf),sr=window.setTimeout(()=>{sr!=null&&Wl.delete(sr),sr=null,at?.(lf),Pr.delete(lf),fb()},Math.max(32,(ab=H.renderBatchIdleTimeoutMs)!=null?ab:120)),void Wl.add(sr)}const ub=window.setTimeout(()=>{Wl.delete(ub),cb()},0);Wl.add(ub)})})(Da,Pa)};if(!V||go.immediate)return void xi();const Wr=Math.max(0,(er=H.renderBatchDelay)!=null?er:16);if(yn=yn!=null?Math.max(yn,nr):nr,!Kt){if(Kt=!0,!K&&ht&&window.requestIdleCallback){const Da=Math.max(0,(Hr=H.renderBatchIdleTimeoutMs)!=null?Hr:120);return void(Do=window.requestIdleCallback(()=>xi(),{timeout:Da}))}Mt&&!K?Ot=Mt(()=>{Wr!==0?Gt=window.setTimeout(()=>xi(),Wr):xi()}):Gt=window.setTimeout(()=>xi(),Wr)}}function ob(js,go={}){bi?Dr=!0:js==null?ib():sb(js,go)}function ib(){Le.value&&sb(He.value?Math.max(1,Math.round(Ue.value)):Math.max(1,je.value))}return Ge([oe,_e,Ne,Le,je,ze,()=>H.renderBatchDelay],()=>{var js;const go=_e.value,er=Je.value,Hr=Ne.value,tr=!Object.is(Hr,er.key),nr=go!==er.total,xi=tr||nr;Je.value={key:Hr,total:go};const Wr=et.value,Da=(js=H.renderBatchDelay)!=null?js:16,Pa=Wr.batchSize!==je.value||Wr.initial!==ze.value||Wr.delay!==Da||Wr.enabled!==Le.value;et.value={batchSize:je.value,initial:ze.value,delay:Da,enabled:Le.value},tr&&Et(go),(xi||Pa||!Le.value)&&tb(),(xi||Pa)&&(Ue.value=Math.max(1,je.value||1)),xi&&cn();const Ha=Ce.value;if(!go)return Oe.value=0,void Nt(0);if(!Le.value)return Oe.value=Ha,void Nt(Oe.value);const _1=tr||er.total===0;Oe.value=_1||Pa?Math.min(Ha,ze.value):Math.min(Oe.value,Ha);const w1=Math.max(1,ze.value||je.value||go);Oe.value<Ha?ob(w1,{immediate:!V}):Nt(Oe.value)},{immediate:!0}),Ge(Ce,(js,go)=>{Le.value&&(typeof go=="number"&&js<=go||js>Oe.value&&ob())}),{cleanupBatchScheduler:tb}})({props:x,isClient:Y,isTestEnv:Is,parsedNodesIdentity:Hn,parsedNodeCount:Wn,desiredRenderedCount:Wd,datasetKey:g8,batchingEnabled:us,incrementalRenderingActive:Us,resolvedBatchSize:Zi,resolvedInitialBatch:$s,renderedCount:Un,adaptiveBatchSize:Jo,previousRenderContext:$o,previousBatchConfig:ks,requestFrame:Jn,cancelFrame:os,hasIdleCallback:Yi,cleanupNodeVisibility:u8,onDatasetKeyChanged:M=>{Oa(),Pd(),ni(),su(),M>0&&Qt(M)},onDatasetChanged:()=>{jt.value&&Fi({immediate:!0})}});Ge([Xk,jt,()=>S.value,()=>de()],([M,H])=>{if(!M)return l2(),void $m();d8(),H?Fi({immediate:!0}):$m()},{flush:"post",immediate:!0}),Ge([()=>it.value.length,()=>jt.value],M=>Gn(null,[M],function*([H,V]){V&&H&&Y&&(yield vt(),Fi({immediate:!0}))}),{flush:"post"}),Ge(sn,M=>{M&&(function(){var H;if(Ze.value&&Xe.value&&Dt.value&&((H=Pt.value)!=null&&H[1]))return;const V=yt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=yt({type:"list_item",children:[V],raw:"- Probe paragraph text"}),oe=yt({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});Ze.value=V,Xe.value=K,Dt.value=oe;const _e={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ce=1;Ce<=6;Ce++)_e[Ce]=yt({type:"heading",level:Ce,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ce)} Probe heading`});Pt.value=_e})()},{immediate:!0}),Ge([()=>S.value,sn],()=>{if(!sn.value)return Rm(),void(z.value=0);c2(),Rm(),sn.value&&S.value&&typeof ResizeObserver<"u"&&(Kc=new ResizeObserver(()=>{c2(),ki.value&&De(),ot.value&&$a(),Bn("resize")}),Kc.observe(S.value))},{immediate:!0}),Ge([sn,As,Bo],()=>Gn(null,null,function*(){if(!sn.value)return ee.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ni();yield vt(),(function(){if(!sn.value||typeof window>"u")return ee.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ni();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=a2(Om(I.value),".paragraph-node");M.paragraph=I0(I.value,H,"pre-wrap");const V=Om(B.value),K=V?.querySelector(".paragraph-node");M.listItem=I0(B.value,K,"pre-wrap");const oe=gt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ce,Ne;return(Ne=(Ce=R.value)==null?void 0:Ce.offsetHeight)!=null?Ne:0}),_e=gt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ce,Ne;return(Ne=(Ce=B.value)==null?void 0:Ce.offsetHeight)!=null?Ne:0});M.listWrapperOverhead=Math.max(0,oe-_e);for(let Ce=1;Ce<=6;Ce++){const Ne=a2(Om(P[Ce]),`h${Ce}`);M.headings[Ce]=I0(P[Ce],Ne,"pre-wrap")}ee.value=M,ni()})()}),{flush:"post",immediate:!0}),Ge(()=>it.value.length,()=>{jt.value&&Fi({immediate:!0})}),Ge([sn,z],()=>{ni(),jt.value&&Fi({immediate:!0}),ki.value&&De(),ot.value&&$a(),Bn("resize")},{immediate:!1}),Ge(()=>Lr.value,M=>{if(M)for(const[H,V]of jn)R2(H,V);else{Fm();for(const[H,V]of jn)V&&Rr(H,!0)}},{immediate:!1}),Ge([()=>x.viewportPriority,()=>it.value.length],([M,H])=>{M!==!1?W.value&&H<=200&&(W.value=!1):W.value=!1}),Ge(()=>Un.value,()=>{jt.value&&Fi({immediate:!0})}),Ge([ti,Qo,Vc,()=>it.value.length,jt],()=>{Il()},{immediate:!0});let iu=null,ru=!1,Ra=null;function lu(){iu=null,qm=null,jm=void 0,Ta=null,su()}function m1(){Oa(),Pd(),ni(),Vt.clear();const M=it.value.length;M>0&&Qt(M),n1()}function g1(){u1(),i2(),eu=null,Rl=null,Bl=null,Zd=null,Qc=null,Xc=null,ru=!1,lu(),y2("restore"),Se(),Ia()}function au(M){var H;return[(H=bs())!=null?H:"",qn(),Xi(),Kd.value,nu(M),it.value.length,Math.round(Br(0,it.value.length)),Math.round(Fl()),$t.count,Math.round($t.total)].join(":")}function D2(){return Gn(this,null,function*(){var M,H,V,K;const oe=(M=s.virtualScroll)==null?void 0:M.settledToken,_e=nu(oe),Ce=qn(),Ne=bs(),He=Bo.value;if(Ft.value&&((H=s.virtualScroll)==null?void 0:H.settleMode)==="manual"&&Gd(oe))if(Vm()){if(au(oe)!==Ta&&!ru){ru=!0;try{const Le=yield o1({reason:"manual",expectedSettledTokenKey:_e}),je=nu()===_e;s1(Ce,Ne,He)&&Le.sessionKey===Ce&&Le.threadKey===Ne&&je&&Le.stable&&Le.phase==="final"&&(Ta=au((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{ru=!1,yield vt();const Le=(K=s.virtualScroll)==null?void 0:K.settledToken,je=Gd(Le)?au(Le):"";s1(Ce,Ne,He)&&je&&Ta!==je&&D2()}}}else Bn("manual")})}Ge(Ft,(M,H)=>{if(M!==H){if(!M)return g1(),void u1();g1(),m1(),Ra=Bo.value,Bn("content")}},{flush:"post"}),Ge([Ft,Bo],([M,H])=>{M?Ra!=null?Ra!==H&&(Ra=H,(function(V="resize"){Oa(),Pd(),ni(),Vt.clear();const K=it.value.length;K>0&&Qt(K),n1(),Rl=null,Bl=null,Zd=null,eu=null,ru=!1,lu(),T2(),vt(()=>{Ji(),ki.value&&De(),ot.value&&$a(),Bn(V)})})("resize")):Ra=H:Ra=null},{flush:"post",immediate:!0}),Ge([Ft,()=>qn(),()=>bs()],([M])=>{M&&(g1(),m1(),y2("content"),Bn("content"))}),Ge([Ft,()=>qn(),()=>bs(),Bo,()=>it.value.length],([M])=>{M&&(function(H="async-node"){let V=!1;for(const[K,oe]of Array.from(Li.entries()))zm(oe)||(Li.delete(K),Oo.delete(K),V=!0);V&&(Ma(),Bn(H))})("async-node")},{flush:"post"}),Ge([Ft,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>s.indexKey,()=>Z.value],([M])=>{M&&(su(),(function(H="content"){if(!Ft.value)return;const V=[],K=it.value.length;for(const oe of Array.from(Vt.keys())){if(oe>=K){V.push(oe);continue}const _e=Zc(oe),Ce=Vt.get(oe);Ce!=null&&Ce!==_e&&V.push(oe),Vt.set(oe,_e)}for(const oe of Array.from(Vt.keys()))oe>=K&&Vt.delete(oe);V.length&&((function(oe,_e={}){const Ce=Array.from(oe,Number);Ls(Ce,_e)>0&&(function(He){for(const Le of He)Vt.delete(Le)})(Ce)})(V,{notify:!1}),ni(),lu(),ki.value&&De(),ot.value&&$a(),Bn(H))})("content"))},{flush:"post",immediate:!0}),Ge([Ft,()=>it.value.length,()=>qn(),()=>bs()],([M,H,V,K],[oe,_e,Ce,Ne])=>{M&&oe&&V===Ce&&K===Ne&&H!==_e&&lu()},{flush:"post"}),Ge([Ft,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>qn(),z],()=>{T2()},{flush:"post",immediate:!0}),Ge([Ft,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>qn(),z],M=>Gn(null,[M],function*([H,V]){if(!H||!V)return;yield vt();const K=(function(){var oe;const _e=(oe=s.virtualScroll)==null?void 0:oe.restoreAnchor;return _e==null||_e===!1?null:_e===!0?"true":String(_e)})();t1(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ge([Ft,z,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var H;if(!M)return;const V=(H=s.virtualScroll)==null?void 0:H.restoreState;V&&Rl&&Bl==="restore"&&(M2(V)||(m1(),Rl=null,Bl=null,Bn("resize")))},{flush:"post"}),Ge([Ft,()=>it.value.length,()=>qn(),z],M=>Gn(null,[M],function*([H]){var V;const K=Qc,oe=Xc;H&&K&&(yield vt(),!t1(K,{restoreAnchor:oe?.restoreAnchor===!0,restoreToken:(V=oe?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:oe?.allowUncapturedAnchor===!0})&&N2(K)||(Qc=null,Xc=null))}),{flush:"post",immediate:!0}),Ge([Ft,q,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>qn(),()=>bs(),Bo,Nm,e2,()=>Un.value,Wd,()=>$t.count,()=>$t.total],([M,H,V])=>{if(!M||H!==!0||V==="manual"||!Km())return;const K=(function(){var oe;const _e=it.value.length;return[(oe=bs())!=null?oe:"",qn(),Xi(),Kd.value,_e,Math.round(Br(0,_e)),Math.round(Fl()),$t.count,Math.round($t.total)].join(":")})();iu!==K&&(iu=K,o1({reason:"final"}).then(oe=>{oe.stable||iu!==K||(iu=null)}))},{flush:"post",immediate:!0}),Ge([Ft,q,()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=s.virtualScroll)==null?void 0:M.settledToken},()=>qn(),()=>bs(),Bo,Nm,e2,()=>Un.value,Wd,()=>it.value.length,()=>$t.count,()=>$t.total],()=>{D2()},{flush:"post",immediate:!0}),Ge([()=>it.value.length,jt,Qo,Vc,()=>Fs.start,()=>Fs.end],([M,H,V,K,oe,_e])=>{fe.value&&Ie("virtualization",{nodes:M,virtualization:H,maxLiveNodes:V,buffer:K,focusIndex:ti.value,scroll:H?(()=>{const Ce=nt.value||he();return Ce?{reverse:j(Ce),scrollTop:Math.round(Ce.scrollTop),scrollTopAbs:Math.round(Math.abs(Ce.scrollTop)),scrollHeight:Math.round(Ce.scrollHeight),clientHeight:Math.round(Ce.clientHeight)}:null})():null,liveRange:{start:oe,end:_e},rendered:Un.value})}),Ge([()=>x.customId],([M],H,V)=>{if(!M||an)return;const K=(function(oe,_e){return oe?(xs.controllers[oe]=_e,()=>{xs.controllers[oe]===_e&&delete xs.controllers[oe]}):()=>{}})(M,{captureRestoreAnchor:tt,restoreAnchor:ut,getAnchorDrift:It,getReport:h8});V(()=>{K()})},{immediate:!0}),rs(()=>{(function(){if(Ft.value)try{Ji(),Jc();const M=Ol("manual");$2(M)&&(E(M),eu=M,r1=tu());const H=Na(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(T(H),H.anchor&&F(H.anchor),La=ou(H))}catch{}})(),S8(),Fm(),$e(),B2();for(const M of Fr.values())for(const H of M)Ud(H);Fr.clear(),$l.clear(),Vt.clear(),p1(),Oa(),Rm(),Se(),Ia(),u1(),l2(),$m()});const C8=Ci({loader:()=>Gn(null,null,function*(){try{return(yield io(()=>import("./index11-CdYjVQZ3.js"),__vite__mapDeps([8,5]))).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',M),Po}}),loadingComponent:yte,delay:0}),A8=Ci({loader:()=>Gn(null,null,function*(){try{return(yield io(()=>import("./index10-B4kCqL2q.js"),[])).default}catch(M){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',M),Po}}),loadingComponent:vte,delay:0}),M8=Ci(()=>Gn(null,null,function*(){try{return(yield io(()=>import("./index7-BBWbs1u4.js"),[])).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',M),Po}})),P2={text:ns,paragraph:ua,heading:lp,code_block:w0,list:Mc,list_item:Ac,blockquote:sh,table:Ku,definition_list:oh,footnote:ih,footnote_reference:qo,footnote_anchor:qu,admonition:ch,vmr_container:lh,hardbreak:hl,link:fo,image:fl,thematic_break:rh,math_inline:Ni,math_block:FM,strong:co,emphasis:ho,strikethrough:uo,highlight:Ko,insert:Mo,subscript:Ao,superscript:Co,emoji:So,checkbox:jo,checkbox_input:jo,inline_code:Qs,html_inline:Vo,reference:ao,html_block:Vu},E8=D(()=>Hm()),H2=D(()=>VS(x.codeBlockProps)),T8=D(()=>VS(x.codeBlockProps,{omit:["langs"]})),W2=D(()=>rt(rt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,monacoOptions:x.codeBlockMonacoOptions,themes:x.themes,langs:u.value==="shiki"?x.langs:void 0,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof ce.value=="boolean"?{showTooltips:ce.value}:{}),T8.value)),z2=D(()=>rt(qt(rt({},W2.value),{langs:x.langs}),H2.value));function U2(M){return typeof M=="boolean"?M:void 0}const N8=D(()=>{const M=x.codeBlockProps||{},H={},V=U2(M.showLineNumbers);V!==void 0&&(H.showLineNumbers=V);const K=U2(M.diffInline);K!==void 0&&(H.diffInline=K);const oe=(function(_e){const Ce=Number(_e);return Number.isFinite(Ce)&&Ce>0?Ce:void 0})(M.reservedHeightPx);return oe!==void 0&&(H.reservedHeightPx=oe),H}),I8=D(()=>rt(rt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,themes:x.themes,langs:x.langs,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof ce.value=="boolean"?{showTooltips:ce.value}:{}),H2.value)),$8=D(()=>rt({},x.mermaidProps||{})),j2=D(()=>rt({},x.d2Props||{})),L8=D(()=>rt({},x.infographicProps||{})),cu=D(()=>({typewriter:x.typewriter,fade:x.fade,customHtmlTags:hn.value.customHtmlTags})),F8=D(()=>rt(rt({},cu.value),typeof ce.value=="boolean"?{showTooltip:ce.value}:{})),O8=D(()=>rt(rt({},cu.value),typeof ce.value=="boolean"?{showTooltips:ce.value}:{})),R8=D(()=>rt(rt({},cu.value),typeof ce.value=="boolean"?{showTooltips:ce.value}:{})),B8=D(()=>rt(rt({},cu.value),typeof ce.value=="boolean"?{showTooltips:ce.value}:{}));function D8(M){return Array.isArray(M.children)&&M.children.length>0}const v1=D(()=>f8.value.map(M=>{var H,V,K,oe,_e,Ce,Ne,He;let Le=(function(at){var ht,Nt,Et,cn,Ot,Gt,Kt;if(at.type!=="code_block")return at;const yn=at,Do=[String((ht=yn.language)!=null?ht:""),String((Nt=yn.loading)!=null?Nt:""),String((Et=yn.diff)!=null?Et:""),String((cn=yn.code)!=null?cn:""),String((Ot=yn.originalCode)!=null?Ot:""),String((Gt=yn.updatedCode)!=null?Gt:""),String((Kt=yn.raw)!=null?Kt:"")].join("\0"),Js=Fe.get(yn);if(Js&&Js.signature===Do)return Js.node;const bi=rt({},yn);return Fe.set(yn,{signature:Do,node:bi}),bi})(M.node);const je=Jd(Le);let ze=G2(Le,je);if((Le.type==="html_block"||Le.type==="html_inline")&&ze===P2[Le.type]){const at=Le,ht=String((H=at.tag)!=null?H:"").trim().toLowerCase()||S6(at.content);if(ht){const Nt=Zt.value[ht];if(fn.value.has(ht)&&Nt)ze=Nt,Le=qt(rt({},at),{type:ht,tag:ht,content:FK(at.content,ht)});else if(C6((V=at.content)!=null?V:at.raw,ht)){const Et=String((oe=(K=at.content)!=null?K:at.raw)!=null?oe:"");Le.type==="html_inline"?(ze=ns,Le={type:"text",content:Et,raw:Et}):(ze=ua,Le={type:"paragraph",children:[{type:"text",content:Et,raw:Et}],raw:Et})}}}const Oe=Le.type==="code_block"&&u.value==="pre"&&ze===Po&&!y1(Zt.value,je);let Ue=rt({},(function(at,ht,Nt){const Et=ht??Jd(at);if(at.type==="code_block"){const cn=Et?y1(Zt.value,Et):void 0;if(Nt&&u.value==="pre"&&!cn&&Nt===Po)return N8.value;if(Nt&&Et&&Nt===cn)return Et==="mermaid"?V2(at):Et==="infographic"?K2(at):Et==="d2"||Et==="d2lang"?j2.value:z2.value;if(Nt&&Nt===Zt.value.code_block)return z2.value;if(d2(Nt))return I8.value}return Et==="mermaid"?V2(at):Et==="infographic"?K2(at):Et==="d2"||Et==="d2lang"?j2.value:at.type==="link"?F8.value:at.type==="list"?O8.value:at.type==="blockquote"?R8.value:at.type==="table"?B8.value:at.type==="code_block"?W2.value:cu.value})(Le,je,ze));const Je=Ll.value[M.index];Le.type==="code_block"&&Je?.kind==="code-block"&&(Ue=qt(rt({},Ue),Oe?{reservedHeightPx:(_e=Je.height)!=null?_e:Je.contentHeight}:{estimatedHeightPx:Je.height,estimatedContentHeightPx:Je.contentHeight})),Oe||Le.type!=="code_block"||je!=="mermaid"||dc(Ue.estimatedPreviewHeightPx)!=null||(Ue=qt(rt({},Ue),{estimatedPreviewHeightPx:ov(nv(String((Ce=Le.code)!=null?Ce:"")))})),Oe||Le.type!=="code_block"||je!=="infographic"||dc(Ue.estimatedPreviewHeightPx)!=null||(Ue=qt(rt({},Ue),{estimatedPreviewHeightPx:iv(sv(String((Ne=Le.code)!=null?Ne:"")))})),Le.type==="math_block"&&(Ue=qt(rt({},Ue),{cacheScope:Qn.value}));const et=(function(at,ht){const Nt=String(at.type);return!Od(Nt)&&Zt.value[Nt]===ht})(Le,ze),Mt=et?ck(Le,We.value):void 0;return qt(rt({},M),{node:Le,component:ze,bindings:Ue,customBindings:rt(rt({},Mt??{}),Ue),rendersCustomNode:et,hasSlotChildren:D8(Le),slotContent:String((He=Le.content)!=null?He:""),isCodeBlock:Le.type==="code_block",indexKey:`${E8.value}-${M.index}`})}));function Jd(M){var H;return M?.type==="code_block"?String((H=M.language)!=null?H:"").trim().toLowerCase():""}function y1(M,H){const V=H.trim().toLowerCase();if(V)for(const K of[V,nk(V),kM(V)]){const oe=K&&M[K];if(oe)return oe}}function q2(M,H,V,K){var oe,_e;const Ce=rt({},M.value);return dc(Ce.estimatedPreviewHeightPx)==null&&(Ce.estimatedPreviewHeightPx=K(V(String((oe=H?.code)!=null?oe:"")),void 0,Ce.maxHeight==="none"?null:(_e=dc(Ce.maxHeight))!=null?_e:void 0)),Ce}function V2(M){return q2($8,M,nv,ov)}function K2(M){return q2(L8,M,sv,iv)}function G2(M,H){if(!M)return mv;const V=Zt.value,K=V[String(M.type)];if(M.type==="code_block"){const oe=H??Jd(M),_e=oe?y1(V,oe):void 0;return _e||(u.value==="pre"?V.code_block||Po:oe==="mermaid"?V.mermaid||C8:oe==="infographic"?V.infographic||A8:oe==="d2"||oe==="d2lang"?V.d2||M8:K||V.code_block||f2.value)}return K||P2[String(M.type)]||mv}function k1(M){o("click",M)}function P8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseover",M)}function H8(M){var H;(H=M.target)!=null&&H.closest("[data-node-index]")&&o("mouseout",M)}function Y2(M){o("mouseover",M)}function Z2(M){o("mouseout",M)}const Hl=Q(null),Oi=Q(!1);let uu,Ba=null,b1=0,ef=0,tf=0;const Q2=["code_block","admonition","table","math_block","html_block","image","thematic_break"],W8=new Set(Q2),X2=[".typewriter-cursor",".height-estimation-probes",...Q2.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function J2(M){if(!M||typeof M!="object")return!1;const H=M.type;return typeof H=="string"&&W8.has(H)}function nf(M){var H,V;if(!M||typeof M!="object")return 0;const K=M,oe=(V=(H=K.raw)!=null?H:K.content)!=null?V:K.code;if(typeof oe=="string")return oe.length;const _e=K.children;if(Array.isArray(_e))return _e.reduce((Ne,He)=>Ne+nf(He),0);const Ce=K.items;return Array.isArray(Ce)?Ce.reduce((Ne,He)=>Ne+nf(He),0):0}function sf(){uu&&(clearTimeout(uu),uu=void 0)}function eb(){b1+=1,Ba!=null&&(os?.(Ba),Ba=null)}function of(){eb(),Hl.value&&(Hl.value.style.visibility="hidden")}function z8(M){var H;if(M.nodeType!==Node.TEXT_NODE||!((H=M.textContent)!=null?H:"").trim())return!1;const V=M.parentElement;return!!V&&!V.closest(X2)}function U8(M){let H=M.lastChild;for(;H;){if(z8(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const V=H;if(!V.matches(X2)&&V.lastChild){H=V.lastChild;continue}}for(;H&&H!==M&&!H.previousSibling;)H=H.parentNode;if(!H||H===M)break;H=H.previousSibling}return null}function x1(){if(!Y||!Oi.value||Ba!=null)return;const M=b1,H=()=>{Ba=null,M===b1&&(function(){var V,K;if(!(Y&&Oi.value&&S.value&&Hl.value))return;const oe=S.value,_e=Hl.value;_e.style.visibility="hidden";const Ce=(function(){const ze=v1.value;for(let Oe=ze.length-1;Oe>=0;Oe--){const Ue=ze[Oe];if(!Ue||J2(Ue.node)||!f1(Ue.index))continue;const Je=jn.get(Ue.index);if(!Je)continue;const et=U8(Je);if(et)return et}return null})();if(!Ce)return;let Ne=0,He=0,Le=20,je=!1;if(Ce?.textContent){const ze=Ce.textContent.length,Oe=document.createRange();Oe.setStart(Ce,Math.max(0,ze-1)),Oe.setEnd(Ce,ze);const Ue=typeof Oe.getClientRects=="function"?Oe.getClientRects():void 0,Je=(K=Ue?.[Ue.length-1])!=null?K:(V=Ce.parentElement)==null?void 0:V.getBoundingClientRect();if(Je){const et=gt("typewriterCursor.root.getBoundingClientRect",()=>oe.getBoundingClientRect());Ne=Je.right-et.left+oe.scrollLeft,He=Je.top-et.top+oe.scrollTop,Le=Je.height||Le,je=!0}Oe.detach()}je&&(_e.style.transform=`translate(${Math.max(0,Ne)}px, ${Math.max(0,He)}px)`,_e.style.height=`${Le}px`,_e.style.visibility="visible")})()};Jn?Ba=Jn(H):H()}return Ge([ye,()=>s.content,()=>s.nodes,()=>x.typewriter,q],()=>Gn(null,null,function*(){var M,H;if(!Y||X.value||!G.value)return;if(q.value)return Oi.value=!1,sf(),void of();if((M=s.nodes)!=null&&M.length)return Oi.value=!1,sf(),of(),ef=((H=s.content)!=null?H:"").length,void(tf=ye.value.length);const V=(function(){var Ne,He;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((Le,je)=>Le+nf(je),0):((He=s.content)!=null?He:"").length})(),K=(function(){var Ne;return(Ne=s.nodes)!=null&&Ne.length?s.nodes.reduce((He,Le)=>He+nf(Le),0):ye.value.length})(),oe=!J2(it.value[it.value.length-1]),_e=V>ef,Ce=K>tf;if(x.typewriter===!1||!oe||!_e&&!Ce)return x.typewriter!==!1&&oe||(Oi.value=!1,of()),ef=V,void(tf=K);ef=V,tf=K,Oi.value=!0,Hl.value&&(Hl.value.style.visibility="hidden"),sf(),yield vt(),x1(),uu=setTimeout(()=>{uu=void 0,Oi.value=!1},3e3)}),{flush:"post",immediate:!0}),Ge(Oi,M=>Gn(null,null,function*(){M?(yield vt(),x1()):of()}),{flush:"post"}),Ge([()=>Un.value,()=>Fs.start,()=>Fs.end],()=>Gn(null,null,function*(){Y&&!X.value&&G.value&&Oi.value&&(yield vt(),x1())}),{flush:"post"}),rs(()=>{sf(),eb(),rn.clear()}),(M,H)=>{const V=gT("NodeRenderer",!0);return C(X)?(b(!0),N(Be,{key:0},st(v1.value,K=>(b(),N(Be,{key:K.index},[K.rendersCustomNode?(b(),xe(Ps(K.component),Sn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onClick:k1,onMouseover:Y2,onMouseout:Z2,onCopy:H[0]||(H[0]=oe=>o("copy",oe)),onHandleArtifactClick:H[1]||(H[1]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[K.hasSlotChildren?(b(),xe(V,Sn({key:0,ref_for:!0},zn.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(),xe(V,Sn({key:1,ref_for:!0},zn.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(),xe(Ps(K.component),Sn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onClick:k1,onMouseover:Y2,onMouseout:Z2,onCopy:H[2]||(H[2]=oe=>o("copy",oe)),onHandleArtifactClick:H[3]||(H[3]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),N("div",{key:1,ref_key:"containerRef",ref:S,class:Pe(["markstream-vue markdown-renderer",[{dark:x.isDark},{virtualized:jt.value},{"virtual-scroll-coordinated":Cs.value}]]),"data-custom-id":x.customId,onClick:k1,onMouseover:P8,onMouseout:H8},[Xs.value||jt.value?(b(),N(Be,{key:0},[Xs.value?(b(),N("div",{key:0,class:"height-estimation-probes",style:Jt({width:`${As.value}px`}),"aria-hidden":"true"},[w("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[ie(C(ua),{node:Ze.value,"index-key":"probe-paragraph"},null,8,["node"])],512),w("div",{ref_key:"listItemProbeWrapperRef",ref:B,class:"node-content","data-probe":"list-item"},[w("ul",bte,[ie(C(Ac),{node:Xe.value,"index-key":"probe-list-item"},null,8,["node"])])],512),w("div",{ref_key:"listProbeWrapperRef",ref:R,class:"node-content","data-probe":"list"},[ie(C(Mc),{node:Dt.value,"index-key":"probe-list"},null,8,["node"])],512),(b(),N(Be,null,st(6,K=>w("div",{key:`probe-heading-${K}`,ref_for:!0,ref:oe=>(function(_e,Ce){_e<1||_e>6||(P[_e]=Ce)})(K,oe),class:"node-content","data-probe":`heading-${K}`},[ie(C(lp),{node:c8(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,xte)),64))],4)):re("",!0),jt.value?(b(),N("div",{key:1,class:"node-spacer",style:Jt({height:`${Dm.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],64)):re("",!0),(b(!0),N(Be,null,st(v1.value,K=>(b(),N("div",{key:K.index,ref_for:!0,ref:oe=>R2(K.index,oe),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[f1(K.index)?(b(),N("div",{key:0,ref_for:!0,ref:oe=>(function(_e,Ce){var Ne;Ce||(function(ze){const Oe=`${Hm()}-${ze}`;let Ue=!1;for(const Je of Array.from(Oo.keys())){const et=Li.get(Je);(et?.index===ze||Je===Oe||Je.startsWith(`${Oe}-`))&&(Oo.delete(Je),Li.delete(Je),Ue=!0)}Ue&&(Ma(),Bn("async-node"))})(_e),Qi.delete(_e),(function(ze){var Oe;const Ue=((Oe=$l.get(ze))!=null?Oe:0)+1;$l.set(ze,Ue)})(_e);const He=Fr.get(_e);if(He){for(const ze of He)Ud(ze);Fr.delete(_e)}if((function(ze){const Oe=ds.get(ze);Oe&&(be?.unobserve(Oe),ct.delete(Oe),ds.delete(ze))})(_e),!Ce||!Xo.value)return $i.delete(_e),void $l.delete(_e);$i.set(_e,Ce);const Le=()=>{Xd(_e,Ce)};queueMicrotask(Le);const je=(be||typeof ResizeObserver>"u"||(be=new ResizeObserver(ze=>{if(ze.length)for(const Oe of ze){const Ue=ct.get(Oe.target),Je=ds.get(Ue??-1);Ue!=null&&Je&&Xd(Ue,Je)}else Ji()})),be);if(je&&(ds.set(_e,Ce),ct.set(Ce,_e),je.observe(Ce)),typeof window<"u"){const ze=((Ne=it.value[_e])==null?void 0:Ne.type)==="code_block"?[16,80,240,800]:q.value?[80]:[];if(ze.length){const Oe=ze.map(Ue=>o2(Ue,Le,"node-resize")).filter(Ue=>Ue!=null);Oe.length&&Fr.set(_e,Oe)}}})(K.index,oe),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(b(),xe(Ps(K.component),Sn({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[8]||(H[8]=oe=>o("copy",oe)),onHandleArtifactClick:H[9]||(H[9]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[K.hasSlotChildren?(b(),xe(V,Sn({key:0,ref_for:!0},zn.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(),xe(V,Sn({key:1,ref_for:!0},zn.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(),xe(Ps(K.component),Sn({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[10]||(H[10]=oe=>o("copy",oe)),onHandleArtifactClick:H[11]||(H[11]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),xe(gl,{key:0,name:"fade",css:x.fade!==!1,appear:x.fade!==!1},{default:Ee(()=>[K.rendersCustomNode?(b(),xe(Ps(K.component),Sn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[4]||(H[4]=oe=>o("copy",oe)),onHandleArtifactClick:H[5]||(H[5]=oe=>o("handleArtifactClick",oe))}),{default:Ee(()=>[K.hasSlotChildren?(b(),xe(V,Sn({key:0,ref_for:!0},zn.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(),xe(V,Sn({key:1,ref_for:!0},zn.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(),xe(Ps(K.component),Sn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:H[6]||(H[6]=oe=>o("copy",oe)),onHandleArtifactClick:H[7]||(H[7]=oe=>o("handleArtifactClick",oe))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),N("div",{key:1,class:"node-placeholder",style:Jt({height:`${Vd(K.index)}px`})},null,4))],8,_te))),128)),Oi.value?(b(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:Hl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):re("",!0),jt.value?(b(),N("div",{key:2,class:"node-spacer",style:Jt({height:`${Pm.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],42,kte))}}})),[["__scopeId","data-v-2e8e6e17"]]),Eo=KM;Eo.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Eo.__name,Eo.name].filter(n=>!!n));for(const n of t)e.component(n,KM)};const gk=Object.freeze(Object.defineProperty({__proto__:null,default:Eo},Symbol.toStringTag,{value:"Module"})),wte={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"},Ste={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"},Cte={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"},Ate={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"},Mte={class:"admonition-title"},Ete=["aria-expanded","aria-controls"],Tte=["id"],ch=_n(Ve({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=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(),N("div",{class:Pe(["admonition",[`admonition-${s.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(b(),N("svg",wte,[...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(),N("svg",Ste,[...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(),N("svg",Cte,[...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(),N("svg",Ate,[...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",Mte,O(i.value),1),s.node.collapsible?(b(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),N("svg",{style:Jt({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,Ete)):re("",!0)]),Fn(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ie(C(Eo),{"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,Tte),[[di,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);ch.install=e=>{e.component(ch.__name,ch)};const GM=()=>io(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Bf=null,Nte=GM;function Zxe(){return Gn(this,null,function*(){if(Bf)return Bf;const e=Nte;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===GM?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(Bf=(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),Bf):null})}function Qxe(){return!1}function Xxe(){return Gn(this,null,function*(){return null})}const Df=Q(!1);let sC=!1;function L0(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Ite(){return!sC&&typeof window<"u"&&typeof document<"u"&&(sC=!0,Df.value=L0(),new MutationObserver(()=>{Df.value=L0()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Df.value=L0()})),Df}const YM=["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"],$te=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),bv=[...YM].sort((e,t)=>t.length-e.length).join("|"),F0=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${bv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${bv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),ZM=/[),.;!?,。;!?)]+$/;function Lte(e){const t=e.toLowerCase();return YM.some(n=>t.endsWith(`.${n}`))}function Fte(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${bv}))["']`,"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 Ote(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(ZM,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=$te.has(i),a=Lte(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 Rte(e,t={}){const n=[];F0.lastIndex=0;let s;for(;(s=F0.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(ZM,""),u=a.length-c.length;a=c;const d=Ote(a,t);if(!d)continue;const f=s.index+r,p=f+a.length;n.push({...d,start:f,end:p,text:a}),u>0&&(F0.lastIndex-=u)}return n}const Bte=12e4,Dte=6e4,Pte=32,Hte=3e4,oC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Wte(e){let t=0,n=0,s=0;oC.lastIndex=0;let o;for(;(o=oC.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=Bte||n>=Dte||t>=Pte||s>=Hte?"pre":"shiki",codeFenceCount:t,codeChars:n}}function zte(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Ute(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const jte={key:1,class:"diff-wrap"},qte={class:"diff-bar"},Vte=["aria-label","onClick"],Kte={class:"diff-pre"},Gte={key:0,class:"diff-sign"},Yte={class:"diff-text"},Zte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",iC="github-light",rC="github-dark",Qte=Ve({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){AX(),PX(),EX(),jX(),MX(new zte),UX(new Ute);function t(B){return B.inline.ruler.disable("math"),B}const{t:n}=Lt(),s=Yt("resolveImage"),o=Q(null),i=e,r=D(()=>!i.streaming),l=D(()=>Fte(i.text??"")),a=D(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Wte(i.text??"")),c=Ite(),u=D(()=>!i.streaming),d=Ns(new Map),f=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(B){return!/^(https?:|data:|blob:)/i.test(B)}function _(B){if(!s)return;const R=[];for(const P of[p,h]){P.lastIndex=0;let W;for(;(W=P.exec(B))!==null;)R.push(W[2]??"")}for(const P of R)!P||!m(P)||d.has(P)||f.has(P)||(f.add(P),s(P).then(W=>{d.set(P,W!==P?W:"")}).catch(()=>{d.set(P,"")}).finally(()=>{f.delete(P)}))}function k(B){if(!s)return B;const R=P=>{if(!m(P))return null;const W=d.get(P);return W===void 0?Zte:W===""?null:W};return B.replace(p,(P,W,U,Z)=>{const z=R(U);return z===null?P:`${W}${z}${Z}`}).replace(h,(P,W,U,Z)=>{const z=R(U);return z===null?P:`${W}${z}${Z}`})}Ge(()=>i.text,B=>_(B??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const B=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),R=[];let P=B.nextNode();for(;P;){const W=P,U=W.parentElement;U&&!U.closest("a, pre, .md-file-link, svg")&&W.data.trim().length>0&&R.push(W),P=B.nextNode()}for(const W of R){const U=Rte(W.data,{aliases:l.value});if(U.length===0||!W.parentNode)continue;const Z=document.createDocumentFragment();let z=0;for(const ee of U){ee.start>z&&Z.append(document.createTextNode(W.data.slice(z,ee.start)));const de=document.createElement("button");de.type="button",de.className="md-file-link",de.textContent=ee.text,de.title=ee.line?`${ee.path}:${ee.line}`:ee.path,de.addEventListener("click",J=>{J.preventDefault(),J.stopPropagation(),i.openFile?.({path:ee.path,line:ee.line})}),Z.append(de),z=ee.end}z<W.data.length&&Z.append(document.createTextNode(W.data.slice(z))),W.parentNode.replaceChild(Z,W)}}function v(B){return!(!B||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(B))}function y(B){let R=B.length;for(const P of["#","?"]){const W=B.indexOf(P);W!==-1&&W<R&&(R=W)}return B.slice(0,R)}function A(){if(!o.value||!i.openFile||i.streaming)return;const B=o.value.querySelectorAll("a[href]");for(const R of B){if(R.dataset.mdLinkHandled==="true"||R.closest("svg"))continue;const P=R.getAttribute("href")??"";v(P)&&(R.dataset.mdLinkHandled="true",R.addEventListener("click",W=>{W.preventDefault(),W.stopPropagation(),i.openFile?.({path:y(P)})}))}}function L(){vt().then(()=>{g(),A()})}Ge(()=>i.text,L),Ge(()=>i.streaming,L);let $=null;gn(()=>{L(),o.value&&($=new MutationObserver(L),$.observe(o.value,{childList:!0,subtree:!0}))}),xn(()=>{$?.disconnect()});const x={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,T=D(()=>{const B=k(i.text??""),R=[];let P=0;E.lastIndex=0;let W;for(;(W=E.exec(B))!==null;){const Z=W[1]??"",z=B.slice(P,W.index)+(Z||"");z.trim()&&R.push({kind:"md",text:z}),R.push({kind:"diff",code:W[2]??""}),P=E.lastIndex}const U=B.slice(P);return(U.trim()||R.length===0)&&R.push({kind:"md",text:U}),R});function F(B){return B.split(`
284
+ `).map(R=>R.startsWith("@@")?{type:"hunk",sign:"",text:R}:/^\+(?!\+\+)/.test(R)?{type:"add",sign:"+",text:R.slice(1)}:/^-(?!--)/.test(R)?{type:"del",sign:"-",text:R.slice(1)}:R.startsWith(" ")?{type:"ctx",sign:"",text:R.slice(1)}:{type:"ctx",sign:"",text:R})}const S=Q(null);function I(B,R){Zs(B).then(P=>{P&&(S.value=R,setTimeout(()=>{S.value=null},1400))})}return(B,R)=>(b(),N("div",{ref_key:"mdRef",ref:o,class:"md"},[(b(!0),N(Be,null,st(T.value,(P,W)=>(b(),N(Be,{key:W},[P.kind==="md"?(b(),xe(C(Eo),{key:0,content:P.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":iC,"code-block-dark-theme":rC,themes:[iC,rC],"code-block-props":x,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(),N("div",jte,[w("div",qte,[R[0]||(R[0]=w("span",{class:"diff-lang"},"diff",-1)),ie(Xt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[w("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:U=>I(P.code,W)},[ie(Ke,{name:S.value===W?"check":"copy",size:"sm"},null,8,["name"])],8,Vte)]),_:2},1032,["text"])]),w("pre",Kte,[w("code",null,[(b(!0),N(Be,null,st(F(P.code),(U,Z)=>(b(),N("span",{key:Z,class:Pe(["diff-line",`diff-${U.type}`])},[U.type!=="hunk"?(b(),N("span",Gte,O(U.sign),1)):re("",!0),w("span",Yte,O(U.text),1)],2))),128))])])]))],64))),128))],512))}}),ym=dt(Qte,[["__scopeId","data-v-34efeb35"]]),Xte={class:"tc-anim"},Jte={class:"prev-anim"},ene={class:"prev"},tne=Ve({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=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 gn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ge(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||vt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(b(),N("div",{class:Pe(["think",{mob:e.mobile}])},[i.value?(b(),N("div",{key:0,class:Pe(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[w("div",Xte,[w("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),w("div",Jte,[w("span",ene,O(l.value),1)])],2)):(b(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),nne=dt(tne,[["__scopeId","data-v-fdc551ea"]]),sne={class:"activity-notice",role:"status"},one={"aria-hidden":"true"},ine={class:"an-label"},rne=Ve({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(b(),N("div",sne,[w("span",one,[ie(To,{size:"sm"})]),w("span",ine,O(e.label),1)]))}}),lne=dt(rne,[["__scopeId","data-v-0d497074"]]);function ane(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 cne=Ve({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Lt(),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:ane(t.time,n("conversation.yesterday")));function r(){s.value=!s.value}return(l,a)=>(b(),N("button",{type:"button",class:"msg-time",onClick:xt(r,["stop"])},O(i.value),1))}}),QM=dt(cne,[["__scopeId","data-v-9672fbd5"]]);function une(e){return e.length===1?`0${e}`:e}function dne(e,t){return`${String(Number(e))}:${une(t)}`}const lC=e=>/^\d+$/.test(e);function fne(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(lC(s)&&lC(o)&&c){const f=dne(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 hne=["data-turn-id"],pne={class:"cn-bubble"},mne={class:"cn-title"},gne={key:0,class:"cn-prompt"},vne={class:"cn-meta"},yne={key:0,class:"cn-meta-item"},kne={key:1,class:"cn-meta-item"},bne=["aria-label"],xne=["title"],_ne=Ve({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Lt(),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?fne(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(),N("div",{class:Pe(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[w("div",pne,[w("span",mne,O(i.value),1),c.value?(b(),N("span",gne,O(c.value),1)):re("",!0)]),w("div",vne,[ie(Ke,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(b(),N("span",yne,O(r.value),1)):re("",!0),a.value?(b(),N("span",kne,O(a.value),1)):re("",!0),w("span",{class:Pe(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):(b(),xe(Ke,{key:1,name:"close",size:"sm"}))],10,bne),s.value?.jobId?(b(),N("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:s.value.jobId})},O(s.value.jobId),9,xne)):re("",!0),e.createdAt?(b(),xe(QM,{key:3,time:e.createdAt},null,8,["time"])):re("",!0)])],10,hne))}}),wne=dt(_ne,[["__scopeId","data-v-a62a6587"]]);function XM(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 xv(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 Sne(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 wi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:xv(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:XM(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 Gu(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function aC(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url}}function vk(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:aC(e.source)};case"video":return{type:"video",source:aC(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function _v(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(vk),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Cne(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 Ane(e){return{content:e.content.map(Cne),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 Mne(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function JM(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 Ene(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Tne(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Ene),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function e5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Tne),createdAt:e.created_at}}function Nne(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 Ine(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=Nne(s);return{answers:t,method:e.method,note:e.note}}function wv(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.kind==="subagent"?!0:void 0}}function cC(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 Yr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Ya(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function oi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function $ne(e){if(!e||typeof e!="object")return null;const t=e,n=Yr(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:Yr(t,"goalId")??Yr(t,"goal_id")??"goal",objective:Yr(t,"objective")??"",completionCriterion:Yr(t,"completionCriterion")??Yr(t,"completion_criterion"),status:n,turnsUsed:Ya(t,"turnsUsed")??Ya(t,"turns_used")??0,tokensUsed:Ya(t,"tokensUsed")??Ya(t,"tokens_used")??0,wallClockMs:Ya(t,"wallClockMs")??Ya(t,"wall_clock_ms")??0,terminalReason:Yr(t,"terminalReason")??Yr(t,"terminal_reason"),budget:{tokenBudget:oi(o,"tokenBudget")??oi(o,"token_budget"),remainingTokens:oi(o,"remainingTokens")??oi(o,"remaining_tokens"),turnBudget:oi(o,"turnBudget")??oi(o,"turn_budget"),remainingTurns:oi(o,"remainingTurns")??oi(o,"remaining_turns"),wallClockBudgetMs:oi(o,"wallClockBudgetMs")??oi(o,"wall_clock_budget_ms"),remainingWallClockMs:oi(o,"remainingWallClockMs")??oi(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Lne(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:wi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:wi(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:Gu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Gu(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:xv(t.payload.status),previousStatus:xv(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:XM(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=$ne(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:_v(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(vk),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:JM(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:e5(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:wv(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:Sv(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 Fne(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 uC(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 Sv(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 One(e){return e.session_id}function Rne(e){return e.seq}const Bne="main",Dne=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function dr(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 Pne(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 dC(){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 no(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Yl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ii(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Hne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=no(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=no(t,"goalId")??no(t,"goal_id")??"goal",r=no(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:no(t,"completionCriterion")??no(t,"completion_criterion"),status:o,turnsUsed:Yl(t,"turnsUsed")??Yl(t,"turns_used")??0,tokensUsed:Yl(t,"tokensUsed")??Yl(t,"tokens_used")??0,wallClockMs:Yl(t,"wallClockMs")??Yl(t,"wall_clock_ms")??0,terminalReason:no(t,"terminalReason")??no(t,"terminal_reason"),budget:{tokenBudget:ii(s,"tokenBudget")??ii(s,"token_budget"),remainingTokens:ii(s,"remainingTokens")??ii(s,"remaining_tokens"),turnBudget:ii(s,"turnBudget")??ii(s,"turn_budget"),remainingTurns:ii(s,"remainingTurns")??ii(s,"remaining_turns"),wallClockBudgetMs:ii(s,"wallClockBudgetMs")??ii(s,"wall_clock_budget_ms"),remainingWallClockMs:ii(s,"remainingWallClockMs")??ii(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function fc(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 Wne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=no(t,"name")??no(t,"toolName")??"tool",s=xa(zne(n)),o=Une(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=no(n,"text");if(o)return O0(o);const i=no(n,"message");if(i)return O0(i)}const s=no(t,"message");if(s)return O0(s)}return null}function zne(e){return e.replace(/_\d+$/,"")}const fC=2e3;function O0(e){return e.length>fC?`${e.slice(0,fC)}…`:e}function Une(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return cd(e,n)}function jne(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=no(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=fc(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),p=[];return f&&p.push({type:"taskCreated",sessionId:t,task:f}),p.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),p}const r=Wne(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=fc(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 bu(e){return{...e,content:e.content.map(t=>({...t}))}}function hC(e,t,n){const s={id:dr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function qne(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 Vne(e){return Array.isArray(e)?e.map(t=>vk(t)):[]}function pC(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 Kne(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 Gne(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 mC(e,t){e.messages.find(n=>n.id===t)}function Yne(e,t,n,s,o,i){const r={id:dr("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 R0(e,t){return e.messages.find(n=>n.id===t)}function gC(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 Zne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=dC(),e.set(u,d)),d}function s(u){e.set(u,dC())}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),p=d.promptId??dr("pr_");f.currentPromptId=p,f.turnPromptId.set(d.turnId,p);const h=hC(f,u,p);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const _=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:bu(h)}]}function l(u,d,f,p){try{return c(u,d,f,p)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,p){const h=n(f),m=d,_=[],k=m?.agentId;if(typeof k=="string"&&k!==Bne){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(Dne.has(u))return jne(h,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)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=Vne(m?.content);if(y.length===0)break;h.currentPromptId=g;const A=qne(h,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:bu(A)});break}case"turn.started":{const g=m?.turnId,v=h.currentPromptId??dr("pr_");h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v),h.turnTextLen=0,h.turnThinkLen=0;break}case"turn.step.started":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=dr("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=hC(h,f,v);h.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:bu(y)});break}case"thinking.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const y=a(h.turnThinkLen,p?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=pC(h,g,"thinking",v);if(A<0)break;h.turnThinkLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=h.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const y=a(h.turnTextLen,p?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=pC(h,g,"text",v);if(A<0)break;h.turnTextLen+=v.length,_.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=h.currentAssistantMsgId,v=m?.turnId,y=h.turnPromptId.get(v)??h.currentPromptId;if(!g||!y)break;const A=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};Kne(h,g,A,L,$);const x=R0(h,g);x&&x.content.length-1,h.toolStartTimes.set(A,Date.now()),x&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:x.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=Gne(m??{});g&&v&&_.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=h.turnPromptId.get(g)??h.currentPromptId;v||(v=dr("pr_"),h.currentPromptId=v,g!==void 0&&h.turnPromptId.set(g,v));const y=m?.toolCallId,A=m?.output,L=m?.isError??!1;h.toolStartTimes.get(y)??Date.now(),h.toolStartTimes.delete(y);const $=Yne(h,f,y,A,L,v);_.push({type:"messageCreated",message:bu($)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=h.currentAssistantMsgId,v=Pne(m?.usage);if(h.totalInput+=v.input,h.totalOutput+=v.output,h.totalCacheRead+=v.cacheRead,h.totalCacheCreate+=v.cacheCreate,g){mC(h,g);const y=R0(h,g);y&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:f,usage:gC(h),model:h.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=h.currentAssistantMsgId,v=m?.reason??"completed",y=Yl(m??{},"durationMs");if(g){mC(h,g);const L=R0(h,g);L&&_.push({type:"messageUpdated",sessionId:f,messageId:g,content:L.content.map($=>({...$})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}h.turnCount++;const A=gC(h);_.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{h.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:dr("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};h.subagentMeta.set(v.id,v),_.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=fc(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=fc(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&_.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=fc(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=fc(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&_.push({type:"taskCreated",sessionId:f,task:v}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):dr("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:Mn.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:A,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};_.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=Hne(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=no(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const y={id:dr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};h.messages.push(y),_.push({type:"messageCreated",message:bu(y)})}break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const Qne=new Set(["server_hello","ack","ping","resync_required","error","pong"]),vC=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated","cron.fired"]),Xne=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"]),Jne=new Set(["assistant.delta","thinking.delta"]);function ese(e,t){if(Qne.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return Jne.has(s)?tse(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Xne.has(s)?{route:"protocol"}:vC.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:vC.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function tse(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 uh 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 nc 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 Sr(e){return e instanceof uh||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function t5(e){return e instanceof nc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const yC=1e3,B0=16384,D0=500,P0=50,nse=6,sse=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,ose=/^[A-Za-z0-9+/=_-]{200,}$/;let H0=null;function Ii(){if(H0!==null)return H0;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=ss(Ht.debug)==="1"),H0=e,e}const al=[];let ise=1;const yk=Q(0),Eu=ka(!1);function rse(){return al}function lse(){al.length=0,yk.value++}function El(e){Eu.value||(al.push({id:ise++,ts:Date.now(),...e}),al.length>yC&&al.splice(0,al.length-yC),yk.value++)}function Cv(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return ose.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>D0?`${o.slice(0,D0)}… [+${o.length-D0} chars]`:o}if(n!=="object")return String(e);if(t>=nse)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,P0).map(i=>Cv(i,t+1));return e.length>P0&&o.push(`[+${e.length-P0} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=sse.test(o)?"[redacted]":Cv(i,t+1);return s}function wa(e){if(e===void 0)return;const t=Cv(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>B0)return{_truncated:`detail JSON was ${n.length} chars; first ${B0} kept`,preview:n.slice(0,B0)}}catch{return"[unserializable detail]"}return t}function W0(e){Ii()&&El({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:wa(e.body)}})}function Pf(e){if(!Ii())return;const t=e.code!==0;El({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:wa(e.data)}})}function xu(e){Ii()&&El({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 Za(e,t){Ii()&&El({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:wa(t)})}function ase(e){if(!Ii())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;El({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:wa(e)})}function cse(e){if(!Ii())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);El({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:wa(t.payload)})}const use={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function z0(e,t,n){Ii()&&El({source:"client",kind:`client:${e}`,label:`${use[e]} ${t}`,detail:wa(n)})}function mr(e,t){Ii()&&El({source:"client",kind:"client:event",label:`· ${e}`,detail:wa(t)})}let kC=!1;function dse(){if(!(kC||!Ii())){kC=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{z0("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;z0("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{z0(e,n.map(fse).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function fse(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 n5(e=al){if(typeof document>"u")return;const t=new Blob([hse(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function hse(e=al){return e.map(t=>JSON.stringify(t)).join(`
285
+ `)}const Rs="kimi-web.server-credential",pse="token",mse=10080*60*1e3;let qi;const Av=new Set;function gse(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(pse);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 Mv(e){return{version:1,credential:e,expiresAt:Date.now()+mse}}function vse(e){return JSON.stringify(e)}function kk(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 Ev(e){globalThis.localStorage?.setItem(Rs,vse(e))}function yse(){try{const e=globalThis.localStorage?.getItem(Rs);if(e){const n=kk(e);if(n===void 0){const s=Mv(e);let o=!1;try{Ev(s),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(Rs)===e&&globalThis.localStorage?.removeItem(Rs),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Rs)}catch{}return o?s:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Rs),globalThis.localStorage?.getItem(Rs)===e&&globalThis.localStorage?.removeItem(Rs);return}const t=globalThis.sessionStorage?.getItem(Rs);if(t){const n=Mv(t);let s=!1;try{Ev(n),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Rs),s=!0}catch{}return s?n:void 0}return}catch{return}}function kse(){const e=gse();return e?(o5(e),!0):(qi=yse(),qi!==void 0)}function s5(){if(qi!==void 0){if(qi.expiresAt<=Date.now()){bse(qi);return}return qi.credential}}function bse(e){qi=void 0;try{globalThis.sessionStorage?.removeItem(Rs);const t=globalThis.localStorage?.getItem(Rs),n=t==null?void 0:kk(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Rs)}catch{}}function o5(e){const t=Mv(e);qi=t;try{Ev(t)}catch{}try{globalThis.sessionStorage?.removeItem(Rs)}catch{}}function xse(){const e=qi;qi=void 0;try{const t=globalThis.localStorage?.getItem(Rs),s=(t==null?void 0:kk(t))?.credential??t;e!==void 0&&s===e.credential&&globalThis.localStorage?.removeItem(Rs),globalThis.sessionStorage?.removeItem(Rs)}catch{}}function _se(e){return Av.add(e),()=>{Av.delete(e)}}function wse(){xse();for(const e of Av)try{e()}catch{}}const sc=3e4,i5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",bC=500,r5=40101;function U0(){try{return AbortSignal.timeout(sc)}catch{return}}function Sse(e,t){let n="",s=e;for(let o=0;o<t;o++)n=i5[s%32]+n,s=Math.floor(s/32);return n}function Cse(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=>i5[n%32]).join("")}function j0(){return`${Sse(Date.now(),10)}${Cse(16)}`}function Ase(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 xC(e){try{const t=await e.text();return t?t.length>bC?`${t.slice(0,bC)}...`:t:void 0}catch{return}}class Mse{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=Fu(this.origin,t),s=j0(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();W0({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:U0()})}catch(a){throw xu({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new nc({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:sc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return Pf({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),Pf({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 uh({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 postForm(t,n){const s=Fu(this.origin,t),o=j0(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();W0({method:"POST",path:t,url:s,requestId:o,body:Ase(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:U0()})}catch(u){throw xu({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new nc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:sc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw xu({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new nc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:sc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await xC(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(Pf({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 uh({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=Fu(this.origin,n);if(o){const p=new URLSearchParams;for(const[m,_]of Object.entries(o))_!==void 0&&p.set(m,String(_));const h=p.toString();h&&(r=`${r}?${h}`)}const l=j0(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();W0({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:U0()})}catch(p){throw xu({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:p}),new nc({message:`Network error calling ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:sc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(p){throw xu({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:p}),new nc({message:`Failed to parse JSON response from ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:sc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await xC(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(Pf({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 uh({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=s5();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===r5)&&wse()}}const Ese="kimi-code.bearer.",Tse=3e4;class Nse{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(),Za("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=s5(),n=t!==void 0?[`${Ese}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{Za("open")},s.onmessage=o=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(o.data));cse(i),this.handleFrame(i)}catch(i){Za("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{Za("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{Za("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,Za("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=Hf(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(Hf(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(Hf(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Tse),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=Hf(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=ese(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)),ase(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Hf(e,t){return`${e}\0${t}`}function q0(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 Ise{http;config;constructor(t){this.config=t,this.http=new Mse(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?Sne(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(wi),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 wi(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return wi(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 wi(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return wi(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(_v),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:wi(n.session),messages:n.messages.items.map(_v),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(JM),pendingQuestions:n.pending_questions.map(e5)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Ane(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return wi(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 wi(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(wi)}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)}`,Mne(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)}`,Ine(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(wv)}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 wv(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(q0)}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 q0(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return q0(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(cC)])):void 0;return{items:o.items.map(cC),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 Fu(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(Gu)}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 Gu(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 Gu(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(Fne)}async listProviders(){return(await this.http.get("/providers")).items.map(uC)}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 uC(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 V0(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return V0(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return V0(t)}async getConfig(){const t=await this.http.get("/config");return Sv(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 Sv(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return Fu(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=nI(this.config.serverHttpUrl,this.config.clientId),s=Zne(),o=new Nse(n,this.config.clientId,{onWireEvent:i=>{const r=One(i),l=Rne(i),a=Lne(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 V0(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 mt(){return wC??=new Ise(QN()),wC}const $se=["src","controls","muted"],Lse=["src","alt"],K0=Ve({__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 mt().getFileBlob(t.fileId),p=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(p);return}i=p,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ge(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),gn(()=>{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}),rs(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(b(),N("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,$se)):(b(),N("img",{key:1,ref_key:"mediaEl",ref:s,class:Pe(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Lse))}}),Fse=["aria-label"],Ose=120,Rse=60,Bse=Ve({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*Ose}ms`,"--moon-frame-fast-delay":`${s*Rse}ms`}}return(s,o)=>(b(),N("span",{class:Pe(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(b(),N(Be,null,st(t,(i,r)=>w("span",{key:i,class:"ui-moon__frame",style:Jt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Fse))}}),l5=dt(Bse,[["__scopeId","data-v-a6b7ec07"]]),Dse={class:"chat"},Pse={key:0,class:"chat-loading"},Hse={class:"chat-loading-text"},Wse={key:1,class:"chat-empty"},zse={key:1,class:"top-sentinel-text"},Use={key:0,class:"u-turn"},jse=["data-turn-id"],qse={key:0,class:"u-imgs"},Vse=["aria-label","onClick"],Kse={key:1,class:"skill-act"},Gse={class:"skill-act-head"},Yse={key:0,class:"skill-act-args"},Zse={key:2,class:"skill-act"},Qse={class:"skill-act-head"},Xse={key:0,class:"skill-act-args"},Jse={key:3,class:"u-text"},eoe={key:0,class:"u-meta"},toe=["aria-label","onClick"],noe=["aria-label","onClick"],soe=["data-turn-id"],ooe=["onClick"],ioe={class:"cd-view"},roe={key:1,class:"cd-label"},loe=["data-turn-id"],aoe={key:1,class:"msg"},coe={key:0,class:"a-msg-ft"},uoe={key:0,class:"a-duration"},doe=["aria-label","onClick"],foe={key:4,class:"sending-placeholder"},hoe={key:5,class:"q-stack"},poe={class:"q-head"},moe={class:"q-title"},goe={class:"q-hint"},voe=["onDragover","onDrop"],yoe={class:"u-bub q-bub"},koe=["title","onDragstart"],boe=["title","onClick"],xoe={key:0,class:"u-text q-text"},_oe={key:1,class:"q-text q-text-placeholder"},woe={key:0,class:"q-imgs"},Soe={key:1,class:"q-tag q-tag-next"},Coe={key:2,class:"q-tag q-tag-idx"},Aoe=["aria-label","onClick"],Moe=2500,Eoe=Ve({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:s}=Lt(),{confirm:o}=Cl();xn(()=>{z!==null&&(clearTimeout(z),z=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(X=>{X[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))}gn(a),xn(()=>{l?.disconnect(),l=null}),Ge(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{vt().then(a)});const c=D(()=>{if(!i.running||i.turns.length===0)return null;const X=i.turns.at(-1);return X.role==="assistant"?X.id:null}),u=D(()=>i.sending||i.running),d=n,f=Q(null),p=Q(null);function h(X){return(X.attachments?.length??0)>0}function m(X){d("editQueued",X)}function _(X,fe){if(f.value=X,!fe.dataTransfer)return;fe.dataTransfer.effectAllowed="move",fe.dataTransfer.setData("text/plain",String(X));const ce=fe.currentTarget?.closest(".q-turn");ce&&fe.dataTransfer.setDragImage(ce,24,24)}function k(X,fe){if(f.value===null)return;fe.preventDefault(),fe.dataTransfer&&(fe.dataTransfer.dropEffect="move");const ce=fe.currentTarget.getBoundingClientRect(),We=fe.clientY<ce.top+ce.height/2?"before":"after";p.value={index:X,position:We}}function g(X,fe){fe.preventDefault();const ce=f.value,We=p.value?.position??"before";if(f.value=null,p.value=null,ce===null)return;let ge=We==="before"?X:X+1;ce<ge&&(ge-=1),ce!==ge&&d("reorderQueue",{from:ce,to:ge})}function v(){f.value=null,p.value=null}const y=D(()=>{for(let X=i.turns.length-1;X>=0;X--)if(i.turns[X].role==="user")return i.turns[X].id;return null});function A(X){return X.role==="user"&&X.id===y.value&&!i.running&&!i.sending&&!X.skillActivation&&!X.pluginCommand}function L(X){const fe=X.compaction,ce=fe?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof fe?.tokensBefore=="number"&&typeof fe?.tokensAfter=="number"?ce+s("conversation.compactedTokens",{before:f_(fe.tokensBefore),after:f_(fe.tokensAfter)}):ce}const $=Q(null),x=Q(null);let E=null;async function T(X){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&F(X)}function F(X){x.value===null&&(x.value=X.id,d("editMessage",{text:X.text,images:X.images}),E=setTimeout(()=>{E=null,x.value=null},Moe))}Ge(()=>i.turns,X=>{x.value!==null&&(X.some(fe=>fe.id===x.value)||(x.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const S=Q(!1);let I=null;function B(){if(i.turns.length===0)return;const X=[];for(const ce of i.turns){if(ce.role==="compaction"||ce.role==="cron")continue;const We=ce.role==="user"?"User":"Assistant",ge=pz(ce);ge.trim()&&X.push(`**${We}**
286
+
287
+ ${ge}`)}const fe=X.join(`
288
+
289
+ ---
290
+
291
+ `);Zs(fe).then(ce=>{ce&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}function R(X){const fe=[];for(let ce=X;ce>=0;ce--){const We=i.turns[ce];if(!We||We.role!=="assistant")break;fe.unshift(We)}return fe}function P(X){return R(X).map(fe=>hz(fe)).filter(Boolean).join(`
292
+
293
+ `)}function W(){for(let X=i.turns.length-1;X>=0;X-=1)if(i.turns[X]?.role==="assistant")return P(X);return""}function U(){const X=W();X.trim()&&Zs(X).then(fe=>{fe&&(S.value=!0,d("copyConversationCopied"),I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:B,copyFinalSummary:U});function Z(X){const fe=i.turns[X];if(!fe||fe.role!=="assistant")return!1;const ce=i.turns[X+1];return!ce||ce.role!=="assistant"}let z=null;function ee(X){const fe=i.turns[X];if(!fe)return;const ce=P(X);ce.trim()&&Zs(ce).then(We=>{We&&($.value=fe.id,z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,$.value=null},1400))}).catch(()=>{})}function de(X){const fe=X.text;fe.trim()&&Zs(fe).then(ce=>{ce&&($.value=X.id,z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,$.value=null},1400))}).catch(()=>{})}function J(X){return{kind:"image",url:X.url,path:X.alt,fileId:X.fileId}}function Y(X,fe){return X.id!==c.value?!1:fe.sourceIndex===Xp(X).length-1}return(X,fe)=>(b(),N("div",Dse,[e.sessionLoading?(b(),N("div",Pse,[ie(To,{size:"sm"}),w("span",Hse,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(b(),N("div",Wse)):re("",!0),e.hasMoreMessages||e.loadingMore?(b(),N("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Pe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(b(),N("span",zse,[ie(To,{size:"sm"}),Ye(" "+O(C(s)("conversation.loadingOlder")),1)])):(b(),N("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:fe[0]||(fe[0]=ce=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):re("",!0),(b(!0),N(Be,null,st(e.turns,(ce,We)=>(b(),N(Be,{key:ce.id},[ce.role==="user"?(b(),N("div",Use,[w("div",{class:Pe(["u-bub turn-anchor",{undoing:x.value===ce.id}]),"data-turn-id":ce.id},[ce.images&&ce.images.length>0?(b(),N("div",qse,[(b(!0),N(Be,null,st(ce.images,(ge,G)=>(b(),N(Be,{key:G},[ge.kind==="video"?(b(),xe(K0,{key:0,url:ge.url,kind:"video","file-id":ge.fileId,"media-class":"u-img"},null,8,["url","file-id"])):(b(),N("button",{key:1,type:"button",class:"u-img-btn","aria-label":C(s)("filePreview.enlargeImage"),onClick:le=>d("openMedia",J(ge))},[ie(K0,{url:ge.url,kind:"image",alt:ge.alt,"file-id":ge.fileId,"media-class":"u-img"},null,8,["url","alt","file-id"])],8,Vse))],64))),128))])):re("",!0),ce.skillActivation?(b(),N("div",Kse,[w("div",Gse,[fe[9]||(fe[9]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,O(C(s)("conversation.activatedSkill",{name:ce.skillActivation.name})),1)]),ce.skillActivation.args?(b(),N("div",Yse,O(ce.skillActivation.args),1)):re("",!0)])):ce.pluginCommand?(b(),N("div",Zse,[w("div",Qse,[fe[10]||(fe[10]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,"/"+O(ce.pluginCommand.pluginId)+":"+O(ce.pluginCommand.commandName),1)]),ce.pluginCommand.args?(b(),N("div",Xse,O(ce.pluginCommand.args),1)):re("",!0)])):(b(),N("div",Jse,O(ce.text),1))],10,jse),ce.createdAt||A(ce)?(b(),N("div",eoe,[A(ce)?(b(),N("div",{key:0,class:Pe(["u-edit-wrap",{undoing:x.value===ce.id}])},[w("button",{type:"button",class:"u-edit","aria-label":C(s)("conversation.undoTooltip"),onClick:ge=>T(ce)},[ie(Ke,{name:"undo",size:"sm"})],8,toe)],2)):re("",!0),ce.text.trim().length>0?(b(),N("button",{key:1,type:"button",class:"u-copy","aria-label":C(s)("filePreview.copy"),onClick:xt(ge=>de(ce),["stop"])},[$.value!==ce.id?(b(),xe(Ke,{key:0,name:"copy",size:"sm"})):(b(),xe(Ke,{key:1,name:"check",size:"sm"}))],8,noe)):re("",!0),ce.createdAt?(b(),xe(QM,{key:2,time:ce.createdAt},null,8,["time"])):re("",!0)])):re("",!0)])):ce.role==="compaction"?(b(),N("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":ce.id,role:"separator"},[fe[11]||(fe[11]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ce.text?(b(),N("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ge=>d("openCompaction",{turnId:ce.id})},[w("span",null,O(L(ce)),1),w("span",ioe,O(C(s)("conversation.viewSummary")),1)],8,ooe)):(b(),N("span",roe,O(L(ce)),1)),fe[12]||(fe[12]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,soe)):ce.role==="cron"?(b(),xe(wne,{key:2,text:ce.text,cron:ce.cron,"turn-id":ce.id,"created-at":ce.createdAt},null,8,["text","cron","turn-id","created-at"])):(b(),N("div",{key:3,class:"a-msg turn-anchor","data-turn-id":ce.id},[(b(!0),N(Be,null,st(C(fz)(ce),(ge,G)=>(b(),N(Be,{key:C(mz)(ge,G)},[ge.kind==="thinking"?(b(),xe(nne,{key:0,text:ge.thinking,mobile:"",streaming:Y(ce,ge),onOpen:le=>d("openThinking",{turnId:ce.id,blockIndex:ge.sourceIndex})},null,8,["text","streaming","onOpen"])):ge.kind==="text"&&ge.text?(b(),N("div",aoe,[ie(ym,{text:ge.text,streaming:Y(ce,ge),"open-file":le=>d("openFile",le)},null,8,["text","streaming","open-file"])])):ge.kind==="tool-stack"?(b(),xe(_z,{key:2,tools:ge.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:fe[1]||(fe[1]=le=>d("openMedia",le)),onOpenFile:fe[2]||(fe[2]=le=>d("openFile",le)),onOpenToolDiff:fe[3]||(fe[3]=le=>d("openToolDiff",le)),onOpenAgent:fe[4]||(fe[4]=le=>d("openAgent",le))},null,8,["tools","tool-diff-panel"])):ge.kind==="tool"?(b(),xe(mA,{key:3,tool:ge.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:fe[5]||(fe[5]=le=>d("openMedia",le)),onOpenFile:fe[6]||(fe[6]=le=>d("openFile",le)),onOpenToolDiff:fe[7]||(fe[7]=le=>d("openToolDiff",le)),onOpenAgent:fe[8]||(fe[8]=le=>d("openAgent",le))},null,8,["tool","tool-diff-panel"])):re("",!0)],64))),128)),ce.id!==c.value&&Z(We)&&(P(We).trim().length>0||ce.durationMs!==void 0)?(b(),N("div",coe,[ie(Xt,{text:`${ce.durationMs} ms`},{default:Ee(()=>[ce.durationMs!==void 0?(b(),N("span",uoe,O(C(cz)(ce.durationMs)),1)):re("",!0)]),_:2},1032,["text"]),P(We).trim().length>0?(b(),N("button",{key:0,class:"a-cpbtn","aria-label":C(s)("filePreview.copy"),onClick:ge=>ee(We)},[$.value!==ce.id?(b(),xe(Ke,{key:0,name:"copy",size:"sm"})):(b(),xe(Ke,{key:1,name:"check",size:"sm"}))],8,doe)):re("",!0)])):re("",!0)],8,loe))],64))),128)),e.compaction?(b(),xe(lne,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(b(),N("div",foe,[ie(l5,{fast:e.fastMoon},null,8,["fast"])])):re("",!0),e.queued.length>0?(b(),N("div",hoe,[w("div",poe,[w("span",moe,[ie(Ke,{name:"mail",size:"sm"}),Ye(" "+O(C(s)("composer.queueLabel"))+" · ",1),w("b",null,O(e.queued.length),1)]),w("span",goe,O(C(s)("composer.queueAutoDrain")),1)]),(b(!0),N(Be,null,st(e.queued,(ce,We)=>(b(),N("div",{key:We,class:Pe(["u-turn q-turn",{"q-dragging":f.value===We,"drop-before":p.value?.index===We&&p.value.position==="before","drop-after":p.value?.index===We&&p.value.position==="after"}]),onDragover:ge=>k(We,ge),onDrop:ge=>g(We,ge)},[w("div",yoe,[w("span",{class:"q-grip",title:C(s)("composer.queueDragTitle"),draggable:"true",onDragstart:ge=>_(We,ge),onDragend:v},[ie(Ke,{name:"grip",size:"sm"})],40,koe),w("button",{type:"button",class:"q-body",title:C(s)("composer.editQueued"),onClick:ge=>m(We)},[ce.text?(b(),N("span",xoe,O(ce.text),1)):(b(),N("span",_oe,[ie(Ke,{name:"image",size:"sm"}),Ye(" "+O(C(s)("composer.queuedImageOnly",{n:ce.attachments?.length??0})),1)]))],8,boe),h(ce)?(b(),N("div",woe,[(b(!0),N(Be,null,st(ce.attachments,(ge,G)=>(b(),xe(K0,{key:G,url:ge.url,kind:ge.kind,"file-id":ge.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))),128))])):re("",!0),We===0?(b(),N("span",Soe,O(C(s)("composer.queueNext")),1)):(b(),N("span",Coe,"#"+O(We+1),1)),w("button",{type:"button",class:"q-rm","aria-label":C(s)("composer.remove"),onClick:xt(ge=>d("unqueue",We),["stop"])},[ie(Ke,{name:"close",size:"sm"})],8,Aoe)])],42,voe))),128))])):re("",!0)]))}}),a5=dt(Eoe,[["__scopeId","data-v-a8f7c9a5"]]),Toe={class:"ch-id"},Noe={key:0,class:"ch-ws"},Ioe={key:1,class:"ch-sep"},$oe=["onKeydown"],Loe={class:"ch-ses"},Foe={key:0,class:"ch-pill ch-sync-pill"},Ooe={key:0,class:"ch-ahead"},Roe={key:1,class:"ch-behind"},Boe={key:1,class:"ch-pill ch-diff-pill"},Doe={key:0,class:"ch-add"},Poe={key:1,class:"ch-del"},Hoe=Ve({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=Lt(),{confirm:s}=Cl(),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(Z){return Z.trim().toLowerCase().replaceAll("_","-")}function p(Z){const z=f(Z);return d[z]?`pr-${z}`:"pr-unknown"}function h(Z){return n(d[f(Z)]??"header.prStatusUnknown")}const m=Q(!1),_=Q(null),k=Q(null),g=Q({});function v(Z){const z=Z.target;k.value?.el?.contains(z)||_.value?.el?.contains(z)||L()}function y(){L()}async function A(Z){if(Z.stopPropagation(),m.value){L();return}m.value=!0,document.addEventListener("mousedown",v),window.addEventListener("resize",y),await vt();const z=_.value?.el,ee=k.value?.el;if(!z||!ee)return;const de=z.getBoundingClientRect(),J=4,Y=8,X=ee.offsetWidth,fe=ee.offsetHeight;let ce=de.bottom+J;ce+fe>window.innerHeight-Y&&(ce=Math.max(Y,de.top-fe-J));let We=de.left;We+X>window.innerWidth-Y&&(We=Math.max(Y,de.right-X)),g.value={top:`${Math.round(ce)}px`,left:`${Math.round(We)}px`}}function L(){m.value=!1,document.removeEventListener("mousedown",v),window.removeEventListener("resize",y)}xn(()=>{document.removeEventListener("mousedown",v),window.removeEventListener("resize",y)});function $(){i("copyAll"),L()}function x(){i("copyFinalSummary"),L()}const E=Q(!1);function T(){o.sessionId&&Zs(o.sessionId).then(Z=>{Z&&(E.value=!0,setTimeout(()=>{E.value=!1},1200))})}const F=Q(!1),S=Q(""),I=Q(null);async function B(){if(L(),!!o.sessionId){F.value=!0,S.value=o.sessionTitle??"",await vt();try{I.value?.focus(),I.value?.select()}catch{}}}function R(){const Z=S.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&i("renameSession",o.sessionId,Z),F.value=!1}function P(){F.value=!1}function W(){o.sessionId&&(L(),i("forkSession",o.sessionId))}async function U(){o.sessionId&&(L(),await s({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",o.sessionId))}return(Z,z)=>(b(),N("header",{class:Pe(["chat-header",{"macos-desktop":C(xc)}])},[w("div",Toe,[e.workspaceName?(b(),N("span",Noe,O(e.workspaceName),1)):re("",!0),e.workspaceName&&e.sessionTitle?(b(),N("span",Ioe,"/")):re("",!0),F.value?Fn((b(),N("input",{key:2,ref_key:"renameInputRef",ref:I,"onUpdate:modelValue":z[0]||(z[0]=ee=>S.value=ee),class:"ch-rename",type:"text",onKeydown:[ji(xt(R,["stop"]),["enter"]),ji(xt(P,["stop"]),["esc"])],onBlur:R,onClick:z[1]||(z[1]=xt(()=>{},["stop"]))},null,40,$oe)),[[po,S.value]]):e.sessionTitle?(b(),xe(Xt,{key:3,text:e.sessionTitle},{default:Ee(()=>[w("span",Loe,O(e.sessionTitle),1)]),_:1},8,["text"])):re("",!0)]),ie(Pn,{ref_key:"kebabRef",ref:_,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]=xt(ee=>A(ee),["stop"]))},{default:Ee(()=>[ie(Ke,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),m.value?(b(),xe(la,{key:0,ref_key:"menuRef",ref:k,class:"ch-menu",style:Jt(g.value),onClick:z[3]||(z[3]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie($n,{onClick:$},{default:Ee(()=>[Ye(O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ie($n,{onClick:x},{default:Ee(()=>[Ye(O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(b(),N(Be,{key:0},[ie($n,{separator:""}),ie($n,{onClick:T},{default:Ee(()=>[Ye(O(E.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ie($n,{onClick:B},{default:Ee(()=>[Ye(O(C(n)("header.renameSession")),1)]),_:1}),ie($n,{onClick:W},{default:Ee(()=>[Ye(O(C(n)("header.forkSession")),1)]),_:1}),ie($n,{danger:"",onClick:U},{default:Ee(()=>[Ye(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(),N("button",{key:1,type:"button",class:"ch-git",onClick:z[4]||(z[4]=ee=>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(),N("span",Foe,[r.value>0?(b(),N("span",Ooe,"↑"+O(r.value),1)):re("",!0),l.value>0?(b(),N("span",Roe,"↓"+O(l.value),1)):re("",!0)])):re("",!0),u.value?(b(),N("span",Boe,[a.value>0?(b(),N("span",Doe,"+"+O(a.value),1)):re("",!0),c.value>0?(b(),N("span",Poe,"-"+O(c.value),1)):re("",!0)])):re("",!0)])):re("",!0),e.pr?(b(),N("button",{key:2,type:"button",class:Pe(["ch-pill ch-pr",p(e.pr.state)]),onClick:z[5]||(z[5]=ee=>e.pr&&i("openPr",e.pr.url))},[ie(Ke,{name:"git-pull-request",size:"sm"}),w("span",null,"PR #"+O(e.pr.number)+" · "+O(h(e.pr.state)),1)],2)):re("",!0)],2))}}),Woe=dt(Hoe,[["__scopeId","data-v-141e88ee"]]),zoe={key:0,class:"slash-menu",role:"listbox"},Uoe=["aria-selected","onMouseenter","onMousedown"],joe={class:"slash-name"},qoe={class:"slash-desc"},Voe=Ve({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Lt(),s=e,o=t,i=Q([]);return Ge(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(b(),N("div",zoe,[(b(!0),N(Be,null,st(e.items,(a,c)=>(b(),N("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:xt(u=>o("select",a),["prevent"])},[w("span",joe,O(a.name),1),w("span",qoe,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,Uoe))),128))])):re("",!0)}}),Koe=dt(Voe,[["__scopeId","data-v-f60b70d9"]]),Goe={class:"mention-menu",role:"listbox"},Yoe={key:0,class:"mention-state dim"},Zoe={key:1,class:"mention-state dim"},Qoe=["aria-selected","onMouseenter","onMousedown"],Xoe=["innerHTML"],Joe={class:"mention-name"},eie={class:"mention-path"},tie=Ve({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Lt(),i=tc("folder","sm"),r=tc("code","sm"),l=tc("file-text","sm"),a=tc("image","sm"),c=tc("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 p(h){const m=h.path;if(m.endsWith("/"))return i;const _=h.name||m.split("/").pop()||m,k=_.lastIndexOf("."),g=k>0?_.slice(k+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(h,m)=>(b(),N("div",Goe,[n.loading?(b(),N("div",Yoe,O(C(o)("mention.searching")),1)):n.items.length===0?(b(),N("div",Zoe,O(C(o)("mention.noMatch")),1)):(b(!0),N(Be,{key:2},st(n.items,(_,k)=>(b(),N("div",{key:_.path,class:Pe(["mention-item",{active:k===n.activeIndex}]),role:"option","aria-selected":k===n.activeIndex,onMouseenter:g=>s("hover",k),onMousedown:xt(g=>s("select",_),["prevent"])},[w("span",{class:"mention-icon",innerHTML:p(_),"aria-hidden":"true"},null,8,Xoe),w("span",Joe,O(_.name),1),w("span",eie,O(_.path),1)],42,Qoe))),128))]))}}),nie=dt(tie,[["__scopeId","data-v-f4d6b958"]]),c5=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function sie(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 up="skill:";function oie(e){return e.startsWith(up)?e.slice(up.length):e}function u5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${up}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...c5,...t]}function iie(e,t=c5){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 Rd(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 bk(e){return e?.supportEfforts??[]}function rie(e){return e[Math.floor(e.length/2)]}function dp(e){if(Rd(e)==="unsupported")return"off";const t=bk(e);return t.length>0?e?.defaultEffort??rie(t):"on"}function xk(e){const t=bk(e),n=Rd(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Tv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function lie(e){return e!=="off"}function Sa(e,t){if(e===void 0)return t;const n=Rd(e);if(n==="unsupported")return"off";if(t==="off")return n==="always-on"?dp(e):"off";const s=bk(e);return s.length>0?s.includes(t)?t:dp(e):"on"}function _k(e,t){return t==="off"?"off":t==="on"?dp(e):t}function aie(e,t,n){return n&&t==="off"&&(e?.supportEfforts?.length??0)>0?dp(e):Sa(e,t)}const fp=100;function cie(e){const t=qp(Ht.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>fp?n.slice(-fp):n,o={[e]:s};return Ed(Ht.inputHistory,o),o}return t&&typeof t=="object"?t:{}}function uie(e){const{text:t,textareaRef:n,autosize:s,sessionId:o}=e,i=Q(cie(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 A=[...y,v],L=A.length>fp?A.slice(-fp):A;i.value={...i.value,[g]:L},Ed(Ht.inputHistory,i.value)}function u(){const k=n.value;return k?(k.selectionStart??0)===0:!1}function d(k){t.value=k,vt(()=>{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 p(){if(l===-1)return;const k=r.value;l<k.length-1?(l+=1,d(k[l])):(l=-1,d(a))}function h(){l=-1}function m(){return l!==-1}function _(){return r.value.length>0}return Ge(o,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:p,resetBrowsing:h,isBrowsing:m,hasHistory:_}}function die(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 p=t.value;p.startsWith("/")&&!p.includes(" ")?(c.value=iie(p,u5(o())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(p){if(a.value=!1,p.acceptsInput){t.value=`${p.name} `,vt(()=>{const h=n.value;if(!h)return;const m=t.value.length;h.setSelectionRange(m,m),h.focus(),s()});return}t.value="",l?.(),r(p.name),i(p.name)}return{open:a,items:c,active:u,update:d,select:f}}function fie(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 p=t.value,h=n.value?.selectionStart??p.length;let m=h-1;for(;m>=0&&!/\s/.test(p[m]);)m--;m++;const _=p.slice(m,h);return _.startsWith("@")?{token:_.slice(1),start:m,end:h}:null}function d(){const p=u(),h=o();if(!p||!h){i.value=!1;return}const m=p.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await h(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(p){const h=u();if(!h)return;const m=t.value;t.value=m.slice(0,h.start)+p.path+m.slice(h.end),i.value=!1,vt(()=>{const _=n.value;if(!_)return;const k=h.start+p.path.length;_.setSelectionRange(k,k),_.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function hie(e){const{sessionId:t}=e;function n(c){return ss(Fx(c))??""}function s(c,u){const d=Fx(c);u?ls(d,u):Fc(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`)}Ge(o,c=>{vt(r),s(t(),c)}),Ge(t,(c,u)=>{c!==u&&(s(u,o.value),o.value=n(c),vt(r))});function l(c){o.value=c,vt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){s(t(),"")}return{text:o,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function pie(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 p(F){const S=t();if(!S)return;const I=n()??"",B=F.map(R=>({file:R,kind:f(R.type)})).filter(R=>R.kind!==null);if(B.length!==0)for(const{file:R,kind:P}of B){const W=c(),U=URL.createObjectURL(R),Z={localId:W,name:R.name,kind:P,previewUrl:U,uploading:!0};u(I,[...s.value[I]??[],Z]),S(R,R.name).then(z=>{const ee=s.value[I]??[];u(I,ee.map(de=>de.localId===W?{...de,uploading:!1,fileId:z?.fileId,error:z===null}:de))}).catch(()=>{const z=s.value[I]??[];u(I,z.map(ee=>ee.localId===W?{...ee,uploading:!1,error:!0}:ee))})}}function h(F){const S=n()??"",I=s.value[S]??[],B=I.find(R=>R.localId===F);i.value?.localId===F&&(i.value=null),B&&d(B),u(S,I.filter(R=>R.localId!==F))}function m(F){i.value=F}function _(){i.value=null}function k(){r.value?.click()}function g(F){const S=F.target,I=Array.from(S.files??[]);p(I),S.value=""}function v(F){if(!t())return;const S=F.clipboardData;if(!S)return;const I=[],B=new Set,R=(P,W)=>{const U=`${P.size}:${P.type}:${W}`;if(B.has(U))return;B.add(U);const Z=P.type.split("/")[1]??"png",z=W.includes(".")?W:`paste-${Date.now()}.${Z}`;I.push(P instanceof File?P:new File([P],z,{type:P.type}))};for(const P of Array.from(S.items))if(P.kind==="file"&&f(P.type)){const W=P.getAsFile();W&&R(W,W.name||`paste-${Date.now()}.${P.type.split("/")[1]??"png"}`)}for(const P of Array.from(S.files))f(P.type)&&R(P,P.name);I.length!==0&&(F.preventDefault(),p(I))}function y(F){!t()||!Array.from(F.dataTransfer?.items??[]).some(I=>I.kind==="file")||(F.preventDefault(),l.value=!0)}function A(){l.value=!1}function L(F){if(l.value=!1,!t())return;F.preventDefault();const S=Array.from(F.dataTransfer?.files??[]);p(S)}function $(){const F=n()??"";for(const S of s.value[F]??[])d(S);u(F,[])}function x(F,S,I){const B=s.value[F]??[];B.some(R=>R.localId===S)&&u(F,B.map(R=>R.localId===S?{...R,...I}:R))}function E(F){return fetch(F).then(S=>{if(!S.ok)throw new Error(`fetch failed: ${S.status}`);return S.blob()})}function T(F){const S=n()??"";for(const I of s.value[S]??[])d(I);u(S,[]);for(const I of F){const B=c(),R=/^data:/i.test(I.url),P=/^blob:/i.test(I.url),W=I.name??I.kind;if(I.fileId){const U={localId:B,name:W,kind:I.kind,previewUrl:I.url,uploading:!1,fileId:I.fileId};u(S,[...s.value[S]??[],U]),!R&&!P&&mt().getFileBlob(I.fileId).then(Z=>{const z=URL.createObjectURL(Z);if(!(s.value[S]??[]).some(de=>de.localId===B)){URL.revokeObjectURL(z);return}x(S,B,{previewUrl:z})}).catch(()=>{})}else{const U=t();if(!U)continue;const Z={localId:B,name:W,kind:I.kind,previewUrl:I.url,uploading:!0};u(S,[...s.value[S]??[],Z]),E(I.url).then(z=>{const ee=W.includes(".")?W:`${W}.${z.type.split("/")[1]??"bin"}`;return U(z,ee)}).then(z=>{if(z===null){const ee=s.value[S]??[];u(S,ee.filter(de=>de.localId!==B));return}x(S,B,{uploading:!1,fileId:z.fileId})}).catch(()=>{const z=s.value[S]??[];u(S,z.filter(ee=>ee.localId!==B))})}}}return Ge(n,()=>{i.value=null}),gn(()=>{document.addEventListener("paste",v)}),xn(()=>{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:h,openAttachmentPreview:m,closeAttachmentPreview:_,openFilePicker:k,handleFileInputChange:g,handleDragOver:y,handleDragLeave:A,handleDrop:L,clearAfterSubmit:$,loadAttachments:T}}const mie=["type","disabled"],gie={class:"ui-button__content"},vie=Ve({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(b(),N("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(),xe(To,{key:0,size:"sm",class:"ui-button__spinner"})):re("",!0),w("span",gie,[On(t.$slots,"default",{},void 0,!0)])],10,mie))}}),Ut=dt(vie,[["__scopeId","data-v-e58393a8"]]),yie={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},kie=["stroke-dasharray","stroke-dashoffset"],G0=7,bie=Ve({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*G0;return(s,o)=>(b(),N("svg",yie,[w("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:G0,fill:"none","stroke-width":"2.5"}),w("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:G0,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,kie)]))}}),xie=dt(bie,[["__scopeId","data-v-a364f1f1"]]),_ie={key:0,class:"att-strip"},wie=["onClick"],Sie=["src"],Cie=["src","alt"],Aie={key:2,class:"att-video-badge","aria-hidden":"true"},Mie={class:"att-name"},Eie={class:"att-err-icon"},Tie=["onClick"],Nie={class:"att-lightbox-card"},Iie=["src"],$ie=["src","alt"],Lie={class:"att-lightbox-name"},Fie={class:"composer-card"},Oie={class:"cin-wrap"},Rie={class:"input-row"},Bie=["placeholder","disabled"],Die=["aria-label"],Pie={class:"toolbar-left"},Hie=["onKeydown"],Wie=["onClick"],zie={class:"pd-check"},Uie={class:"pd-info"},jie={class:"pd-desc"},qie={class:"mode-label"},Vie={key:0,class:"mode-tag"},Kie={key:1,class:"mode-tag"},Gie={key:2,class:"mode-tag"},Yie={class:"mode-row-icon"},Zie={class:"mode-row-info"},Qie={class:"mode-row-name"},Xie={class:"mode-row-desc"},Jie={class:"mode-row-icon"},ere={class:"mode-row-info"},tre={class:"mode-row-name"},nre={class:"mode-row-desc"},sre={class:"mode-row-icon"},ore={class:"mode-row-info"},ire={class:"mode-row-name"},rre={class:"mode-row-desc"},lre={key:0,class:"mode-row-actions"},are={class:"toolbar-right"},cre=["aria-label"],ure={class:"ctx-num"},dre=["onKeydown"],fre={key:0,class:"think-suffix"},hre=["aria-label"],pre=["aria-label","disabled"],mre={key:0,class:"md-section"},gre=["onClick"],vre={class:"md-check"},yre={class:"md-name"},kre={class:"md-provider"},bre={key:1,class:"md-divider"},xre={key:2,class:"md-section"},_re=["onClick"],wre={class:"md-check"},Sre={class:"md-name"},Cre={key:3,class:"md-divider"},Are={class:"md-name"},Mre={key:0,class:"md-note"},Ere=["aria-label"],Tre=["disabled","onClick"],Nre={class:"md-name"},SC=36,Ire=Ve({__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}=Lt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=hie({sessionId:()=>s.sessionId}),p=Q(!1);function h(){p.value=!p.value,vt(()=>{u(),g(),c.value?.focus()})}function m(){p.value&&(p.value=!1,vt(u))}function _(qe){if(typeof getComputedStyle>"u")return SC;const nt=Number.parseFloat(getComputedStyle(qe).minHeight);return Number.isFinite(nt)&&nt>0?nt:SC}const k=Q(!1);function g(){const qe=c.value;k.value=!!qe&&qe.scrollHeight>_(qe)}Ge(a,()=>{vt(g)}),Ge(()=>s.sessionId,()=>{p.value=!1});const v=uie({text:a,textareaRef:c,autosize:u,sessionId:()=>s.sessionId}),{open:y,items:A,active:L,update:$,select:x}=die({text:a,textareaRef:c,autosize:u,skills:()=>s.skills,emitCommand:qe=>i("command",qe),historyPush:qe=>v.push(qe),clearDraft:f}),{open:E,items:T,active:F,loading:S,update:I,select:B}=fie({text:a,textareaRef:c,autosize:u,searchFiles:()=>s.searchFiles});function R(){v.resetBrowsing(),$(),I()}const{attachments:P,previewAttachment:W,fileInputRef:U,isDragOver:Z,removeAttachment:z,openAttachmentPreview:ee,closeAttachmentPreview:de,openFilePicker:J,handleFileInputChange:Y,handleDragOver:X,handleDragLeave:fe,handleDrop:ce,clearAfterSubmit:We,loadAttachments:ge}=pie({uploadImage:()=>s.uploadImage,sessionId:()=>s.sessionId});gn(()=>{a.value&&vt(()=>{u(),g()})}),xn(()=>{document.removeEventListener("mousedown",No),ae()});function G(){c.value?.focus({preventScroll:!0})}function le(qe){ge(qe)}t({loadForEdit:d,loadAttachmentsForEdit:le,focus:G});function he(){const qe=a.value.trim();if(P.value.some(Rt=>Rt.uploading))return;const nt=P.value.filter(Rt=>!Rt.uploading&&!Rt.error&&Rt.fileId);if(!qe&&nt.length===0)return;if(v.push(qe),qe){const Rt=sie(qe),Fo=Rt?u5(s.skills).some(ei=>ei.name===Rt.cmd||ei.name===`/${up}${Rt.cmd.slice(1)}`):!1;if(Rt&&Fo){a.value="",f(),y.value=!1,m(),i("command",Rt.arg?`${Rt.cmd} ${Rt.arg}`:Rt.cmd);return}}const ot={text:qe,attachments:nt.map(Rt=>({fileId:Rt.fileId,kind:Rt.kind}))};W.value=null,We(),a.value="",f(),y.value=!1,E.value=!1,m(),i("submit",ot)}function j(){if(!s.running||P.value.some(Rt=>Rt.uploading))return;const qe=a.value.trim(),nt=P.value.filter(Rt=>!Rt.uploading&&!Rt.error&&Rt.fileId);if(!qe&&nt.length===0&&s.queued.length===0)return;const ot={text:qe,attachments:nt.map(Rt=>({fileId:Rt.fileId,kind:Rt.kind}))};We(),v.push(qe),a.value="",f(),y.value=!1,E.value=!1,m(),i("steer",ot)}let ne=!1,ve=null;function ae(){ve!==null&&(clearTimeout(ve),ve=null)}function ye(){ae(),ne=!0}function q(){ae(),ve=setTimeout(()=>{ve=null,ne=!1},0)}function se(qe){return ne||qe.isComposing||qe.keyCode===229}function me(qe){if(!se(qe)){if(qe.key==="Escape"){if($e.value){qe.preventDefault(),lt();return}if(pe.value){qe.preventDefault(),St();return}}if(y.value){if(qe.key==="ArrowDown"){qe.preventDefault(),L.value=(L.value+1)%A.value.length;return}if(qe.key==="ArrowUp"){qe.preventDefault(),L.value=(L.value-1+A.value.length)%A.value.length;return}if(qe.key==="Enter"||qe.key==="Tab"){qe.preventDefault();const nt=A.value[L.value];nt&&x(nt);return}if(qe.key==="Escape"){qe.preventDefault(),y.value=!1;return}}if(E.value&&!S.value){if(qe.key==="ArrowDown"){qe.preventDefault(),F.value=(F.value+1)%Math.max(1,T.value.length);return}if(qe.key==="ArrowUp"){qe.preventDefault(),F.value=(F.value-1+Math.max(1,T.value.length))%Math.max(1,T.value.length);return}if(qe.key==="Enter"||qe.key==="Tab"){qe.preventDefault();const nt=T.value[F.value];nt&&B(nt);return}if(qe.key==="Escape"){qe.preventDefault(),E.value=!1;return}}if(qe.key==="s"&&(qe.ctrlKey||qe.metaKey)&&!qe.shiftKey&&!qe.altKey){s.running&&(qe.preventDefault(),j());return}if(!p.value&&!y.value&&!E.value&&!qe.shiftKey&&!qe.altKey&&!qe.metaKey&&!qe.ctrlKey){const nt=v.isBrowsing();if(qe.key==="ArrowUp"&&v.hasHistory()&&(nt||v.caretAtTextStart())){qe.preventDefault(),v.recallOlder();return}if(qe.key==="ArrowDown"&&nt){qe.preventDefault(),v.recallNewer();return}}if(qe.key==="Enter"&&!qe.shiftKey){if(p.value&&!(qe.metaKey||qe.ctrlKey))return;qe.preventDefault(),he()}}}const Te=D(()=>r("composer.send")),Me=D(()=>!!s.uploadImage),$e=Q(!1),pe=Q(!1),Ie=Q(null);function Qe(){$e.value=!$e.value,$e.value?(pe.value=!1,cs(),document.addEventListener("click",Tt,!0)):document.removeEventListener("click",Tt,!0)}function lt(){$e.value=!1,pe.value||document.removeEventListener("click",Tt,!0)}function _t(){pe.value=!pe.value,pe.value?($e.value=!1,cs(),document.addEventListener("click",Tt,!0)):document.removeEventListener("click",Tt,!0)}function St(){pe.value=!1,$e.value||document.removeEventListener("click",Tt,!0)}function Tt(qe){Ie.value&&!Ie.value.contains(qe.target)&&(lt(),St())}xn(()=>{document.removeEventListener("click",Tt,!0)});const Ct=qe=>`${Math.round(qe/1e3)}k`,gt=D(()=>{const qe=s.status?.ctxMax??0;return qe<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/qe*100)))}),nn=D(()=>{const qe=(s.status?.ctxUsed??0).toLocaleString(),nt=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:qe,max:nt,pct:gt.value})}),rn=D(()=>gt.value>=80),Qn=D(()=>s.models?.find(qe=>qe.id===s.status?.modelId)),Zt=D(()=>Rd(Qn.value)),fn=D(()=>xk(Qn.value)),hn=D(()=>Sa(Qn.value,s.thinking??"off")),it=D(()=>{const qe=fn.value,nt=hn.value;return qe.includes(nt)?nt:qe.includes("on")?"on":qe[0]??"off"}),zn=D(()=>Zt.value==="always-on"?!0:Zt.value==="unsupported"?!1:lie(hn.value)),Hn=D(()=>Zt.value==="unsupported"||fn.value.length<=1),Wn=D(()=>{if(!zn.value)return"";const qe=(Qn.value?.supportEfforts?.length??0)>0,nt=hn.value;return qe&&nt!=="on"?r("composer.thinkingSuffixEffort",{level:nt}):r("composer.thinkingSuffix")});function Ze(qe){Hn.value||i("setThinking",_k(Qn.value,qe))}function Xe(qe){return qe==="on"?r("status.thinkingOn"):qe==="off"?r("status.thinkingOff"):Tv(qe)}const Dt=D(()=>s.planMode===!0),Pt=D(()=>s.swarmMode===!0),an=D(()=>s.goal?.status??s.activationBadges?.goal?.status??null),wn=D(()=>an.value!==null&&an.value!=="complete"),Xn=D(()=>wn.value||s.goalMode===!0),Ss=D(()=>an.value==="active"),as=D(()=>an.value==="paused"||an.value==="blocked"),vn=Q(!1),Ft=Q(null),Cs=Q(null),sn=Q({}),Xs=D(()=>Dt.value||Pt.value||Xn.value);function cs(){vn.value=!1,document.removeEventListener("mousedown",No)}function No(qe){const nt=qe.target;Ft.value?.contains(nt)||Cs.value?.contains(nt)||cs()}function Zo(){if(vn.value){cs();return}lt(),St();const qe=Ft.value?.getBoundingClientRect();qe&&(sn.value={left:`${Math.round(qe.left)}px`,bottom:`${Math.round(window.innerHeight-qe.top+8)}px`}),vn.value=!0,setTimeout(()=>document.addEventListener("mousedown",No),0)}const As=[{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"}],Qo=["status.planDesc","status.swarmDesc","status.goalDesc"],jt=Q(null),Xo=Q(""),Io=Q("");function mo(qe){const nt={};return qe&&(nt["--composer-menu-desc-width"]=qe),nt}const Jn=D(()=>mo(Xo.value)),os=D(()=>mo(Io.value)),Yi=D(()=>({...sn.value,...os.value}));let Is=null;function Zi(qe){const nt=Number.parseFloat(qe);return Number.isFinite(nt)?nt:0}function $s(qe){return`${qe.fontStyle||"normal"} ${qe.fontWeight||"400"} ${qe.fontSize} ${qe.fontFamily}`}function us(qe){return qe.letterSpacing==="normal"?0:Zi(qe.letterSpacing)}function Us(qe,nt){if(!qe)return 0;const ot=lA(qe,$s(nt),{letterSpacing:us(nt)});return aA(ot)}function Un(){const qe=jt.value?.querySelector(".pd-desc");if(!qe)return;const nt=getComputedStyle(qe),ot=Math.max(0,...As.map(Fo=>Us(r(Fo.descKey),nt))),Rt=Math.max(0,...Qo.map(Fo=>Us(r(Fo),nt)));Xo.value=ot>0?`${Math.ceil(ot)}px`:"",Io.value=Rt>0?`${Math.ceil(Rt)}px`:""}function $o(){typeof window>"u"||(Is!==null&&window.cancelAnimationFrame(Is),vt(()=>{Is=window.requestAnimationFrame(()=>{Is=null,Un()})}))}Ge(l,$o,{immediate:!0}),gn(()=>{$o(),document.fonts?.ready.then($o)}),xn(()=>{Is!==null&&(window.cancelAnimationFrame(Is),Is=null)});function Jo(qe){i("setPermission",qe),St()}const ks=D(()=>As.find(qe=>qe.mode===s.status?.permission)),jn=D(()=>ks.value?r(ks.value.labelKey):""),ds=D(()=>Qn.value?.provider??""),ct=D(()=>!ds.value||!s.models?.length?[]:s.models.filter(qe=>qe.provider===ds.value)),be=D(()=>new Set(s.starredIds??[]));function Fe(qe){return be.value.has(qe)}const Vt=D(()=>s.models?.length?s.models.filter(qe=>Fe(qe.id)&&qe.provider!==ds.value):[]);function Lo(qe){i("selectModel",qe),lt()}return(qe,nt)=>(b(),N("div",{class:Pe(["composer",{"drag-over":C(Z),expanded:p.value}]),onDragover:nt[18]||(nt[18]=(...ot)=>C(X)&&C(X)(...ot)),onDragleave:nt[19]||(nt[19]=(...ot)=>C(fe)&&C(fe)(...ot)),onDrop:nt[20]||(nt[20]=(...ot)=>C(ce)&&C(ce)(...ot))},[C(P).length>0?(b(),N("div",_ie,[(b(!0),N(Be,null,st(C(P),ot=>(b(),N("div",{key:ot.localId,class:Pe(["att-chip",{"att-error":ot.error}])},[ie(Xt,{text:C(r)("composer.previewAttachment",{name:ot.name})},{default:Ee(()=>[w("button",{type:"button",class:"att-preview",onClick:Rt=>C(ee)(ot)},[ot.kind==="video"?(b(),N("video",{key:0,class:"att-thumb",src:ot.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,Sie)):(b(),N("img",{key:1,class:"att-thumb",src:ot.previewUrl,alt:ot.name},null,8,Cie)),ot.kind==="video"?(b(),N("span",Aie,[ie(Ke,{name:"play",size:"sm"})])):re("",!0)],8,wie)]),_:2},1032,["text"]),w("span",Mie,O(ot.name),1),ot.uploading?(b(),xe(To,{key:0,size:"sm",label:C(r)("composer.uploading")},null,8,["label"])):ot.error?(b(),xe(Xt,{key:1,text:C(r)("composer.uploadFailed")},{default:Ee(()=>[w("span",Eie,[ie(Ke,{name:"info",size:"sm"})])]),_:1},8,["text"])):re("",!0),ie(Xt,{text:C(r)("composer.removeNamed",{name:ot.name})},{default:Ee(()=>[w("button",{class:"att-rm",onClick:Rt=>C(z)(ot.localId)},[ie(Ke,{name:"close",size:"sm"})],8,Tie)]),_:2},1032,["text"])],2))),128))])):re("",!0),C(W)?(b(),N("div",{key:1,class:"att-lightbox",onClick:nt[1]||(nt[1]=xt((...ot)=>C(de)&&C(de)(...ot),["self"]))},[w("div",Nie,[ie(Xt,{text:C(r)("model.close")},{default:Ee(()=>[w("button",{type:"button",class:"att-lightbox-close",onClick:nt[0]||(nt[0]=(...ot)=>C(de)&&C(de)(...ot))},"✕")]),_:1},8,["text"]),C(W).kind==="video"?(b(),N("video",{key:0,class:"att-lightbox-media",src:C(W).previewUrl,controls:"",playsinline:""},null,8,Iie)):(b(),N("img",{key:1,class:"att-lightbox-media",src:C(W).previewUrl,alt:C(W).name},null,8,$ie)),w("div",Lie,O(C(W).name),1)])])):re("",!0),w("div",Fie,[w("div",Oie,[C(y)?(b(),xe(Koe,{key:0,items:C(A),"active-index":C(L),onSelect:C(x),onHover:nt[2]||(nt[2]=ot=>L.value=ot)},null,8,["items","active-index","onSelect"])):re("",!0),C(E)?(b(),xe(nie,{key:1,items:C(T),"active-index":C(F),loading:C(S),onSelect:C(B),onHover:nt[3]||(nt[3]=ot=>F.value=ot)},null,8,["items","active-index","loading","onSelect"])):re("",!0),w("div",Rie,[Fn(w("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":nt[4]||(nt[4]=ot=>is(a)?a.value=ot:null),class:"ph",placeholder:o.value,disabled:e.starting,rows:"1",onKeydown:me,onCompositionstart:ye,onCompositionend:q,onInput:R},null,40,Bie),[[po,C(a)]]),p.value||k.value?(b(),N("button",{key:0,class:"expand-btn",type:"button","aria-label":p.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:h},[p.value?(b(),xe(Ke,{key:0,name:"collapse",size:"sm"})):(b(),xe(Ke,{key:1,name:"expand",size:"sm"}))],8,Die)):re("",!0)])]),Me.value?(b(),N("input",{key:0,ref_key:"fileInputRef",ref:U,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:nt[5]||(nt[5]=(...ot)=>C(Y)&&C(Y)(...ot))},null,544)):re("",!0),w("div",{ref_key:"toolbarRef",ref:Ie,class:"toolbar"},[w("div",{ref_key:"menuMeasureRef",ref:jt,class:"menu-measure","aria-hidden":"true"},[...nt[21]||(nt[21]=[w("span",{class:"pd-desc"},null,-1)])],512),w("div",Pie,[Me.value?(b(),xe(Pn,{key:0,size:"md",label:C(r)("composer.attachImage"),onClick:C(J)},{default:Ee(()=>[ie(Ke,{name:"image"})]),_:1},8,["label","onClick"])):re("",!0),e.status?(b(),N("span",{key:1,class:Pe(["perm-pill",["perm-"+e.status.permission,{open:pe.value}]]),role:"button",tabindex:"0",onClick:xt(_t,["stop"]),onKeydown:[ji(_t,["enter"]),ji(xt(_t,["prevent"]),["space"])]},O(jn.value),43,Hie)):re("",!0),pe.value&&e.status?(b(),N("div",{key:2,class:"perm-dropdown",style:Jt(Jn.value),role:"menu",onClick:nt[6]||(nt[6]=xt(()=>{},["stop"]))},[(b(),N(Be,null,st(As,ot=>w("button",{key:ot.mode,class:Pe(["pd-row",{"is-current":ot.mode===e.status.permission}]),role:"menuitem",onClick:Rt=>Jo(ot.mode)},[w("span",zie,[ot.mode===e.status.permission?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",Uie,[w("span",{class:"pd-name",style:Jt({color:ot.color})},O(C(r)(ot.labelKey)),5),w("span",jie,O(C(r)(ot.descKey)),1)])],10,Wie)),64))],4)):re("",!0),e.status?(b(),N("div",{key:3,ref_key:"modesRef",ref:Ft,class:"modes"},[w("button",{type:"button",class:Pe(["mode-pill",{on:Xs.value,open:vn.value}]),onClick:xt(Zo,["stop"])},[w("span",qie,O(C(r)("status.modesLabel")),1),Dt.value?(b(),N("span",Vie,O(C(r)("status.planLabel")),1)):re("",!0),Pt.value?(b(),N("span",Kie,O(C(r)("status.swarmLabel")),1)):re("",!0),Xn.value?(b(),N("span",Gie,O(C(r)("status.goalLabel")),1)):re("",!0)],2),vn.value?(b(),N("div",{key:0,ref_key:"modesMenuRef",ref:Cs,class:"modes-menu",style:Jt(Yi.value),role:"menu"},[w("button",{type:"button",class:Pe(["mode-row",{on:Dt.value}]),role:"menuitem",onClick:nt[7]||(nt[7]=ot=>i("togglePlan"))},[w("span",Yie,[ie(Ke,{name:"file-edit",size:"sm"})]),w("span",Zie,[w("span",Qie,O(C(r)("status.planLabel")),1),w("span",Xie,O(C(r)("status.planDesc")),1)]),w("span",{class:Pe(["mode-switch",{on:Dt.value}])},[...nt[22]||(nt[22]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("button",{type:"button",class:Pe(["mode-row",{on:Pt.value}]),role:"menuitem",onClick:nt[8]||(nt[8]=ot=>i("toggleSwarm"))},[w("span",Jie,[ie(Ke,{name:"sparkles",size:"sm"})]),w("span",ere,[w("span",tre,O(C(r)("status.swarmLabel")),1),w("span",nre,O(C(r)("status.swarmDesc")),1)]),w("span",{class:Pe(["mode-switch",{on:Pt.value}])},[...nt[23]||(nt[23]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("div",{class:Pe(["mode-row mode-row-goal",{on:wn.value||s.goalMode}])},[w("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:nt[9]||(nt[9]=ot=>wn.value?i("focusGoal"):i("toggleGoal"))},[w("span",sre,[ie(Ke,{name:"target",size:"sm"})]),w("span",ore,[w("span",ire,O(C(r)("status.goalLabel")),1),w("span",rre,O(C(r)("status.goalDesc")),1)]),wn.value?re("",!0):(b(),N("span",{key:0,class:Pe(["mode-switch",{on:s.goalMode}])},[...nt[24]||(nt[24]=[w("span",{class:"mode-knob"},null,-1)])],2))]),wn.value?(b(),N("div",lre,[Ss.value?(b(),xe(Ut,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:nt[10]||(nt[10]=ot=>i("controlGoal","pause"))},{default:Ee(()=>[ie(Ke,{name:"pause",size:"sm"}),w("span",null,O(C(r)("status.goalPause")),1)]),_:1})):re("",!0),as.value?(b(),xe(Ut,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:nt[11]||(nt[11]=ot=>i("controlGoal","resume"))},{default:Ee(()=>[ie(Ke,{name:"play",size:"sm"}),w("span",null,O(C(r)("status.goalResume")),1)]),_:1})):re("",!0),ie(Ut,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:nt[12]||(nt[12]=ot=>i("controlGoal","cancel"))},{default:Ee(()=>[ie(Ke,{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",are,[rn.value?(b(),N("button",{key:0,class:"compact-chip",onClick:nt[13]||(nt[13]=xt(ot=>i("compact"),["stop"]))},"/compact")):re("",!0),ie(Xt,{text:nn.value},{default:Ee(()=>[e.status&&!e.hideContext?(b(),N("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":nn.value},[ie(xie,{pct:gt.value},null,8,["pct"]),w("span",ure,O(Ct(e.status.ctxUsed))+"/"+O(Ct(e.status.ctxMax)),1)],8,cre)):re("",!0)]),_:1},8,["text"]),e.status?(b(),N("span",{key:1,class:Pe(["model-pill",{open:$e.value}]),role:"button",tabindex:"0",onClick:xt(Qe,["stop"]),onKeydown:[ji(Qe,["enter"]),ji(xt(Qe,["prevent"]),["space"])]},[w("b",null,O(e.status.model),1),Wn.value?(b(),N("span",fre,O(Wn.value),1)):re("",!0),ie(Ke,{class:"cv",name:"chevron-down",size:"sm"})],42,dre)):re("",!0),e.running?(b(),xe(Xt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ee(()=>[w("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:nt[14]||(nt[14]=ot=>i("interrupt"))},[ie(Ke,{name:"stop",size:"sm"})],8,hre)]),_:1},8,["text"])):re("",!0),w("button",{class:Pe(["send",{"is-starting":e.starting}]),"aria-label":Te.value,disabled:e.starting,onClick:nt[15]||(nt[15]=ot=>he())},[e.starting?(b(),xe(To,{key:0,size:"sm"})):(b(),xe(Ke,{key:1,name:"send",size:"sm"}))],10,pre)]),$e.value&&e.status?(b(),N("div",{key:0,class:"model-dropdown",role:"menu",onClick:nt[17]||(nt[17]=xt(()=>{},["stop"]))},[Vt.value.length>0?(b(),N("div",mre,O(C(r)("status.starredModels")),1)):re("",!0),(b(!0),N(Be,null,st(Vt.value,ot=>(b(),N("button",{key:ot.id,class:Pe(["md-row",{"is-current":ot.id===e.status.modelId}]),role:"menuitem",onClick:Rt=>Lo(ot.id)},[w("span",vre,[ot.id===e.status.modelId?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",yre,O(ot.displayName??ot.model),1),w("span",kre,O(ot.provider),1),ie(Ke,{class:"md-star",name:"star",size:"sm"})],10,gre))),128)),Vt.value.length>0?(b(),N("div",bre)):re("",!0),ct.value.length>0?(b(),N("div",xre,O(ds.value),1)):re("",!0),(b(!0),N(Be,null,st(ct.value,ot=>(b(),N("button",{key:ot.id,class:Pe(["md-row",{"is-current":ot.id===e.status.modelId}]),role:"menuitem",onClick:Rt=>Lo(ot.id)},[w("span",wre,[ot.id===e.status.modelId?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",Sre,O(ot.displayName??ot.model),1),Fe(ot.id)?(b(),xe(Ke,{key:0,class:"md-star",name:"star",size:"sm"})):re("",!0)],10,_re))),128)),ct.value.length>0?(b(),N("div",Cre)):re("",!0),w("div",{class:Pe(["md-thinking",{"is-readonly":Hn.value}])},[w("span",Are,O(C(r)("status.thinkingLabel")),1),Zt.value==="unsupported"?(b(),N("span",Mre,O(C(r)("status.modeNotSupported")),1)):(b(),N("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(b(!0),N(Be,null,st(fn.value,ot=>(b(),N("button",{key:ot,type:"button",class:Pe(["effort-seg",{"is-active":ot===it.value}]),disabled:Hn.value,onClick:Rt=>Ze(ot)},O(Xe(ot)),11,Tre))),128))],8,Ere))],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=>{lt(),i("pickModel")})},[w("span",Nre,O(C(r)("status.moreModels")),1)])])):re("",!0)],512)])],34))}}),d5=dt(Ire,[["__scopeId","data-v-ba6c5bb0"]]),$re={key:0,class:"ui-card__head"},Lre={class:"ui-card__body"},Fre={key:1,class:"ui-card__foot"},Ore=Ve({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(b(),N("div",{class:Pe(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(b(),N("div",$re,[On(t.$slots,"head",{},void 0,!0)])):re("",!0),w("div",Lre,[On(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(b(),N("div",Fre,[On(t.$slots,"foot",{},void 0,!0)])):re("",!0)],2))}}),wk=dt(Ore,[["__scopeId","data-v-9c9f9a9a"]]),Rre={class:"goal-kicker"},Bre={class:"goal-progress","aria-hidden":"true"},Dre={class:"goal-full"},Pre={key:0,class:"goal-criterion"},Hre={class:"goal-footer"},Wre={class:"goal-meta"},zre={key:0},Ure={class:"goal-actions"},jre=Ve({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Lt(),i=Q(!1);Ge(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=D(()=>{const c=n.goal.budget.tokenBudget;return!c||c<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/c*100)))});function l(c){switch(c){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 a(c){const u=Math.max(0,Math.round(c/1e3)),d=Math.floor(u/60),f=u%60;return d<=0?`${f}s`:d<60?`${d}m ${f}s`:`${Math.floor(d/60)}h ${d%60}m`}return(c,u)=>(b(),xe(wk,{class:Pe(["goal-strip",{expanded:i.value}])},Jv({head:Ee(()=>[w("button",{class:"goal-row",type:"button",onClick:u[0]||(u[0]=d=>i.value=!i.value)},[w("span",Rre,O(C(o)("status.goalLabel")),1),w("span",{class:Pe(["goal-objective",{"expanded-hidden":i.value}])},O(e.goal.objective),3),ie(wo,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ee(()=>[Ye(O(l(e.goal.status)),1)]),_:1},8,["variant"]),w("span",Bre,[w("span",{class:"goal-progress-fill",style:Jt({width:`${r.value}%`})},null,4)]),ie(Ke,{class:Pe(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:Ee(()=>[w("div",Dre,O(e.goal.objective),1),e.goal.completionCriterion?(b(),N("div",Pre,[u[4]||(u[4]=w("span",null,"Done when",-1)),w("p",null,O(e.goal.completionCriterion),1)])):re("",!0)]),key:"0"}:void 0,i.value?{name:"foot",fn:Ee(()=>[w("div",Hre,[w("div",Wre,[w("span",null,O(e.goal.turnsUsed)+" turns",1),w("span",null,O(e.goal.tokensUsed.toLocaleString())+" tokens",1),w("span",null,O(a(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(b(),N("span",zre,O(r.value)+"% token budget",1)):re("",!0)]),w("div",Ure,[e.goal.status==="active"?(b(),xe(Ut,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:u[1]||(u[1]=xt(d=>s("controlGoal","pause"),["stop"]))},{default:Ee(()=>[ie(Ke,{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(),xe(Ut,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:u[2]||(u[2]=xt(d=>s("controlGoal","resume"),["stop"]))},{default:Ee(()=>[ie(Ke,{name:"play",size:"md"}),w("span",null,O(C(o)("status.goalResume")),1)]),_:1})):re("",!0),ie(Ut,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:u[3]||(u[3]=xt(d=>s("controlGoal","cancel"),["stop"]))},{default:Ee(()=>[ie(Ke,{name:"close",size:"md"}),w("span",null,O(C(o)("status.goalCancel")),1)]),_:1})])])]),key:"1"}:void 0]),1032,["class"]))}}),qre=dt(jre,[["__scopeId","data-v-439258c7"]]),Vre={class:"qh"},Kre={class:"qtitle"},Gre={key:0,class:"qstep"},Yre={key:1,class:"qmin-peek"},Zre={class:"qbody"},Qre=["aria-label"],Xre=["aria-selected","aria-label","onClick"],Jre={class:"qstep-num"},ele={key:1,class:"qheader-chip"},tle={class:"qtext"},nle={class:"qopts"},sle=["onClick"],ole={class:"qopt-key"},ile={class:"qopt-glyph"},rle={key:0,class:"chk"},lle={key:1,class:"rad"},ale={class:"qopt-text"},cle={class:"qopt-label"},ule={key:0,class:"qopt-desc"},dle={class:"qopt-glyph"},fle={key:0,class:"chk"},hle={key:1,class:"rad"},ple={class:"qopt-label"},mle=["placeholder"],gle={class:"qfoot"},vle=Ve({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=Lt(),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 W=h.value[P];return W?W.kind==="multi"?W.optionIds.length>0:W.kind==="multiWithOther"?W.optionIds.length>0||W.otherText.trim().length>0:W.kind==="other"?W.text.trim().length>0:!0:!1}function p(){return f(l.value.id)}const h=Q({});function m(P){return P.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${P.label} ${P.description??""}`.toLowerCase())}function _(){const P={...h.value};let W=!1;for(const U of n.question.questions){if(P[U.id])continue;const Z=U.options.filter(m);Z.length!==0&&(P[U.id]=U.multiSelect?{kind:"multi",optionIds:Z.map(z=>z.id)}:{kind:"single",optionId:Z[0].id},W=!0)}W&&(h.value=P)}Ge(()=>n.question.questionId,()=>{i.value=0,r.value=!1,h.value={},v.value={}}),Ge(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),_()},{immediate:!0,deep:!0});function k(P,W){const U=h.value[P];if(U&&U.kind==="single"&&U.optionId===W){const Z={...h.value};delete Z[P],h.value=Z}else h.value={...h.value,[P]:{kind:"single",optionId:W}}}function g(P,W){const U=h.value[P],Z=U&&(U.kind==="multi"||U.kind==="multiWithOther")?U.kind==="multi"?[...U.optionIds]:[...U.optionIds]:[],z=Z.indexOf(W);z>=0?Z.splice(z,1):Z.push(W);const ee=h.value[P],de=ee&&ee.kind==="multiWithOther"?ee.otherText:"";de?h.value={...h.value,[P]:{kind:"multiWithOther",optionIds:Z,otherText:de}}:h.value={...h.value,[P]:{kind:"multi",optionIds:Z}}}const v=Q({}),y=Q(null);function A(P){const W=n.question.questions.find(Z=>Z.id===P),U=v.value[P]??"";if(W.multiSelect){const Z=h.value[P],z=Z&&(Z.kind==="multi"||Z.kind==="multiWithOther")?Z.kind==="multi"?[...Z.optionIds]:[...Z.optionIds]:[];h.value={...h.value,[P]:{kind:"multiWithOther",optionIds:z,otherText:U}}}else h.value={...h.value,[P]:{kind:"other",text:U}}}function L(P){A(P),vt(()=>y.value?.focus())}function $(P,W){const U=h.value[P];return U?U.kind==="single"?U.optionId===W:U.kind==="multi"||U.kind==="multiWithOther"?U.optionIds.includes(W):!1:!1}function x(P){const W=h.value[P];return!!(W&&(W.kind==="other"||W.kind==="multiWithOther"))}function E(){return n.question.questions.every(P=>f(P.id))}const T=D(()=>n.busyKind==="answer"),F=D(()=>n.busyKind==="dismiss"),S=D(()=>!!n.busyKind);function I(){if(S.value||!E())return;const P={answers:h.value,method:"click"};o("answer",n.question.questionId,P)}function B(){S.value||o("dismiss",n.question.questionId)}function R(P){const W=(document.activeElement?.tagName??"").toLowerCase(),U=W==="input"||W==="textarea";if(S.value)return;if(P.key==="Enter"){if(P.preventDefault(),r.value)return;i.value<a.value-1&&p()?u():E()&&I();return}if(U)return;if(P.key==="Escape"){P.preventDefault(),B();return}if(r.value)return;const Z=parseInt(P.key,10);if(!isNaN(Z)&&Z>=1&&Z<=9){P.preventDefault();const z=l.value,ee=Z-1,de=z.options[ee];de&&(z.multiSelect?g(z.id,de.id):k(z.id,de.id))}}return gn(()=>document.addEventListener("keydown",R)),xn(()=>document.removeEventListener("keydown",R)),(P,W)=>(b(),xe(wk,{class:Pe(["qcard",{minimized:r.value}])},Jv({head:Ee(()=>[w("div",Vre,[W[5]||(W[5]=w("span",{class:"qh-ic"},"?",-1)),w("span",Kre,O(C(s)("question.title")),1),a.value>1&&!r.value?(b(),N("span",Gre,O(C(s)("question.step",{current:i.value+1,total:a.value})),1)):re("",!0),r.value?(b(),N("span",Yre,O(l.value.question),1)):re("",!0),ie(Pn,{class:"qmin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:W[0]||(W[0]=U=>r.value=!r.value)},{default:Ee(()=>[r.value?(b(),xe(Ke,{key:0,name:"chevron-down",size:"md"})):(b(),xe(Ke,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[w("div",Zre,[a.value>1?(b(),N("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(s)("question.step",{current:i.value+1,total:a.value})},[(b(!0),N(Be,null,st(n.question.questions,(U,Z)=>(b(),N("button",{key:U.id,type:"button",class:Pe(["qstep-dot",{active:Z===i.value,answered:f(U.id)}]),"aria-selected":Z===i.value,"aria-label":C(s)("question.step",{current:Z+1,total:a.value}),onClick:z=>d(Z)},[w("span",Jre,O(Z+1),1)],10,Xre))),128))],8,Qre)):re("",!0),l.value.header?(b(),N("div",ele,[ie(wo,{variant:"neutral",size:"sm"},{default:Ee(()=>[Ye(O(l.value.header),1)]),_:1})])):re("",!0),w("div",tle,O(l.value.question),1),l.value.body?(b(),xe(ym,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):re("",!0),w("div",nle,[(b(!0),N(Be,null,st(l.value.options,(U,Z)=>(b(),N("label",{key:U.id,class:Pe(["qopt",{selected:$(l.value.id,U.id)}]),onClick:xt(z=>l.value.multiSelect?g(l.value.id,U.id):k(l.value.id,U.id),["prevent"])},[w("span",ole,O(Z+1),1),w("span",ile,[l.value.multiSelect?(b(),N("span",rle,O($(l.value.id,U.id)?"■":"□"),1)):(b(),N("span",lle,O($(l.value.id,U.id)?"●":"○"),1))]),w("span",ale,[w("span",cle,O(U.label),1),U.description?(b(),N("span",ule,O(U.description),1)):re("",!0)])],10,sle))),128)),l.value.allowOther?(b(),N("label",{key:0,class:Pe(["qopt",{selected:x(l.value.id)}]),onClick:W[4]||(W[4]=xt(U=>L(l.value.id),["prevent"]))},[W[6]||(W[6]=w("span",{class:"qopt-key"},null,-1)),w("span",dle,[l.value.multiSelect?(b(),N("span",fle,O(x(l.value.id)?"■":"□"),1)):(b(),N("span",hle,O(x(l.value.id)?"●":"○"),1))]),w("span",ple,O(l.value.otherLabel??C(s)("question.otherDefault")),1),Fn(w("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":W[1]||(W[1]=U=>v.value[l.value.id]=U),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:W[2]||(W[2]=U=>A(l.value.id)),onFocus:W[3]||(W[3]=U=>A(l.value.id))},null,40,mle),[[po,v.value[l.value.id]]])],2)):re("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[w("div",gle,[i.value<a.value-1?(b(),xe(Ut,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!p(),onClick:u},{default:Ee(()=>[Ye(O(C(s)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(b(),xe(Ut,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!E(),loading:T.value,onClick:I},{default:Ee(()=>[Ye(O(C(s)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(b(),xe(Ut,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ee(()=>[Ye(O(C(s)("question.back")),1)]),_:1},8,["disabled"])):re("",!0),ie(Ut,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:B},{default:Ee(()=>[Ye(O(C(s)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),yle=dt(vle,[["__scopeId","data-v-9525707a"]]),kle={class:"ah"},ble={class:"akind"},xle={class:"apath"},_le={class:"ah-path"},wle={key:1,class:"diff"},Sle={class:"dg"},Cle={class:"dc"},Ale={key:2,class:"body-shell"},Mle={class:"shell-cmd"},Ele={key:0,class:"shell-cwd"},Tle={key:1,class:"shell-danger"},Nle={key:3,class:"body-file"},Ile={class:"file-bar"},$le={class:"file-lang"},Lle={class:"file-content"},Fle={class:"file-ln"},Ole={class:"file-text"},Rle={key:4,class:"body-chip"},Ble={class:"chip-label"},Dle={class:"chip-value"},Ple={key:0,class:"chip-detail"},Hle={key:5,class:"body-chip"},Wle={key:0,class:"chip-label"},zle={class:"chip-value"},Ule={key:6,class:"body-chip"},jle={class:"chip-label"},qle={class:"chip-value"},Vle={key:0,class:"chip-detail"},Kle={key:7,class:"body-chip"},Gle={class:"chip-label"},Yle={class:"chip-value"},Zle={key:0,class:"chip-detail"},Qle={key:8,class:"body-todo"},Xle={class:"todo-glyph"},Jle={key:9,class:"body-plan"},eae={key:10,class:"body-generic"},tae={class:"gen-text"},nae={key:11,class:"feedback-wrap"},sae=["placeholder"],oae={class:"feedback-hint"},iae={key:0,class:"plan-actions"},rae={key:1,class:"abtn"},lae=Ve({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Lt(),i=D(()=>{const T=n.block;return T.kind!=="plan_review"?null:{plan:T.plan,path:T.path,options:T.options??[]}}),r=Q(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const T=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${T}`)}const c=Q(!1),u=Q(""),d=Q(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function p(){if(n.busy)return;const T=u.value.trim();i.value?k("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:T||void 0}):k("feedback",{decision:"rejected",feedback:T||void 0}),c.value=!1,u.value=""}function h(){c.value=!1,u.value=""}function m(T){T.key==="Enter"&&!T.shiftKey?(T.preventDefault(),p()):T.key==="Escape"&&(T.preventDefault(),h())}const _=Q(null);Ge(()=>n.busy,T=>{T||(_.value=null)});function k(T,F){n.busy||(_.value=T,s("decide",F))}function g(){k("approve",{decision:"approved"})}function v(){k("approveSession",{decision:"approved",scope:"session"})}function y(){k("reject",{decision:"rejected"})}function A(){k("approvePlan",{decision:"approved"})}function L(T){k(`option:${T}`,{decision:"approved",selectedLabel:T})}function $(){n.busy||f()}function x(){k("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(T){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){T.key==="1"?(T.preventDefault(),A()):T.key==="2"?(T.preventDefault(),$()):T.key==="3"&&(T.preventDefault(),x());return}T.key==="1"&&S.options[0]?(T.preventDefault(),L(S.options[0].label)):T.key==="2"&&S.options[1]?(T.preventDefault(),L(S.options[1].label)):T.key==="3"&&S.options[2]&&(T.preventDefault(),L(S.options[2].label));return}T.key==="1"?(T.preventDefault(),g()):T.key==="2"?(T.preventDefault(),v()):T.key==="3"?(T.preventDefault(),y()):T.key==="4"&&(T.preventDefault(),f())}return gn(()=>document.addEventListener("keydown",E)),xn(()=>document.removeEventListener("keydown",E)),(T,F)=>(b(),xe(wk,{class:Pe(["appr",{minimized:r.value}])},Jv({head:Ee(()=>[w("div",kle,[F[2]||(F[2]=w("span",{class:"ah-ic"},"!",-1)),w("span",ble,O(a()),1),w("span",xle,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(b(),N(Be,{key:0},[Ye(O(e.block.path),1)],64)):e.block.kind==="shell"?(b(),N(Be,{key:1},[Ye(O(e.block.command),1)],64)):e.block.kind==="url"?(b(),N(Be,{key:2},[Ye(O(e.block.url),1)],64)):e.block.kind==="search"?(b(),N(Be,{key:3},[Ye(O(e.block.query),1)],64)):e.block.kind==="invocation"?(b(),N(Be,{key:4},[Ye(O(e.block.name),1)],64)):e.block.kind==="generic"?(b(),N(Be,{key:5},[Ye(O(e.block.summary),1)],64)):re("",!0)]),e.agentName&&!r.value?(b(),xe(wo,{key:0,variant:"neutral",size:"sm"},{default:Ee(()=>[Ye(O(C(o)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):re("",!0),r.value?re("",!0):(b(),xe(wo,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ee(()=>[Ye(O(C(o)("approval.required")),1)]),_:1})),ie(Pn,{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:Ee(()=>[r.value?(b(),xe(Ke,{key:0,name:"chevron-down",size:"md"})):(b(),xe(Ke,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[e.block.kind==="plan_review"&&e.block.path?(b(),xe(Xt,{key:0,text:e.block.path},{default:Ee(()=>[w("div",_le,O(e.block.path),1)]),_:1},8,["text"])):re("",!0),e.block.kind==="diff"?(b(),N("div",wle,[(b(!0),N(Be,null,st(e.block.diff,(S,I)=>(b(),N("div",{key:I,class:Pe(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[w("span",Sle,O(S.gutter),1),w("span",Cle,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(b(),N("div",Ale,[w("div",Mle,[F[3]||(F[3]=w("span",{class:"shell-dollar"},"$",-1)),Ye(" "+O(e.block.command),1)]),e.block.cwd?(b(),N("div",Ele,"cwd: "+O(e.block.cwd),1)):re("",!0),e.block.danger?(b(),N("div",Tle,O(C(o)("approval.danger",{detail:e.block.danger})),1)):re("",!0)])):e.block.kind==="file"?(b(),N("div",Nle,[w("div",Ile,[w("span",$le,O(e.block.language??""),1)]),w("div",Lle,[(b(!0),N(Be,null,st(e.block.content.split(`
294
+ `),(S,I)=>(b(),N("div",{key:I,class:"file-line"},[w("span",Fle,O(I+1),1),w("span",Ole,O(S),1)]))),128))])])):e.block.kind==="fileop"?(b(),N("div",Rle,[w("span",Ble,O(e.block.op),1),w("span",Dle,O(e.block.path),1),e.block.detail?(b(),N("span",Ple,O(e.block.detail),1)):re("",!0)])):e.block.kind==="url"?(b(),N("div",Hle,[e.block.method?(b(),N("span",Wle,O(e.block.method),1)):re("",!0),w("span",zle,O(e.block.url),1)])):e.block.kind==="search"?(b(),N("div",Ule,[w("span",jle,O(C(o)("approval.searchQueryLabel")),1),w("span",qle,O(e.block.query),1),e.block.scope?(b(),N("span",Vle,O(C(o)("approval.searchScope",{scope:e.block.scope})),1)):re("",!0)])):e.block.kind==="invocation"?(b(),N("div",Kle,[w("span",Gle,O(e.block.kind2),1),w("span",Yle,O(e.block.name),1),e.block.description?(b(),N("span",Zle,O(e.block.description),1)):re("",!0)])):e.block.kind==="todo"?(b(),N("div",Qle,[(b(!0),N(Be,null,st(e.block.items,(S,I)=>(b(),N("div",{key:I,class:"todo-item"},[w("span",Xle,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(),N("div",Jle,[ie(ym,{text:e.block.plan},null,8,["text"])])):(b(),N("div",eae,[w("span",tae,O(e.block.summary),1)])),c.value?(b(),N("div",nae,[Fn(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,sae),[[po,u.value]]),w("div",oae,O(C(o)("approval.feedbackHint")),1)])):re("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[i.value?(b(),N("div",iae,[i.value.options.length>0?(b(!0),N(Be,{key:0},st(i.value.options,(S,I)=>(b(),xe(Xt,{key:I,text:S.description},{default:Ee(()=>[ie(Ut,{class:"kbtn",size:"sm",variant:"primary",loading:_.value===`option:${S.label}`,disabled:e.busy,onClick:B=>L(S.label)},{default:Ee(()=>[Ye(O(S.label),1),ie(lr,{class:"k",keys:[String(I+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(b(),xe(Ut,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ee(()=>[Ye(O(C(o)("approval.approvePlan")),1),ie(lr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),ie(Ut,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:$},{default:Ee(()=>[Ye(O(C(o)("approval.revise")),1),i.value.options.length===0?(b(),xe(lr,{key:0,class:"k",keys:["2"]})):re("",!0)]),_:1},8,["disabled"]),ie(Ut,{class:"kbtn",size:"sm",variant:"danger-soft",loading:_.value==="rejectAndExit",disabled:e.busy,onClick:x},{default:Ee(()=>[Ye(O(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(b(),xe(lr,{key:0,class:"k",keys:["3"]})):re("",!0)]),_:1},8,["loading","disabled"])])):(b(),N("div",rae,[ie(Ut,{class:"kbtn",size:"sm",variant:"primary",loading:_.value==="approve",disabled:e.busy,onClick:g},{default:Ee(()=>[Ye(O(C(o)("approval.approve")),1),ie(lr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),ie(Ut,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="approveSession",disabled:e.busy,onClick:v},{default:Ee(()=>[Ye(O(C(o)("approval.approveSession")),1),ie(lr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),ie(Ut,{class:"kbtn",size:"sm",variant:"secondary",loading:_.value==="reject",disabled:e.busy,onClick:y},{default:Ee(()=>[Ye(O(C(o)("approval.reject")),1),ie(lr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),ie(Ut,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ee(()=>[Ye(O(C(o)("approval.feedback")),1),ie(lr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),aae=dt(lae,[["__scopeId","data-v-12609161"]]),cae=Ve({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(s,o)=>(b(),N("span",{class:Pe(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),f5=dt(cae,[["__scopeId","data-v-f595d935"]]),uae={class:"taskspane"},dae={class:"tp-head"},fae={class:"tp-title"},hae={class:"tp-count"},pae={class:"tp-list"},mae={key:0,class:"tp-empty"},gae=["role","onClick"],vae={class:"tp-name"},yae={class:"tp-time"},kae=["onClick"],bae={key:0,class:"tp-detail"},xae={key:0,class:"tp-codebox"},_ae=["onClick"],wae={class:"tp-pre"},Sae={class:"tp-cmd"},Cae={key:1,class:"tp-codebox"},Aae=["onClick"],Mae={class:"tp-pre"},Eae=Ve({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:s}=Lt(),o=Ns(new Set),i=Ns(new Set),r=Ns(new Set);function l(h){return!!(h.output&&h.output.length>0||h.meta)}function a(h){if(h.kind==="subagent"){n("open",h.id);return}l(h)&&(o.has(h.id)?o.delete(h.id):o.add(h.id))}function c(h){return h.kind==="subagent"||l(h)}function u(h){return h==="run"||h==="done"||h==="fail"?h:"pending"}async function d(h,m,_){await Zs(h)&&(_.add(m),setTimeout(()=>_.delete(m),1500))}async function f(h){h.meta&&await d(h.meta,h.id,i)}async function p(h){const m=h.output?.join(`
295
+ `)??"";m&&await d(m,h.id,r)}return(h,m)=>(b(),N("div",uae,[w("div",dae,[w("span",fae,O(C(s)("tasks.tag")),1),w("span",hae,O(e.tasks.length),1)]),w("div",pae,[e.tasks.length===0?(b(),N("div",mae,O(C(s)("tasks.emptyTasks")),1)):(b(!0),N(Be,{key:1},st(e.tasks,_=>(b(),N("div",{key:_.id,class:Pe(["tp-row",{done:_.state==="done",fail:_.state==="fail",expandable:c(_)}])},[w("div",{class:"tp-main",role:c(_)?"button":void 0,onClick:k=>a(_)},[ie(f5,{status:u(_.state)},null,8,["status"]),w("span",vae,O(_.name),1),ie(wo,{variant:"neutral",size:"sm"},{default:Ee(()=>[Ye(O(_.kind),1)]),_:2},1024),w("span",yae,O(_.timing),1),_.state==="run"?(b(),N("button",{key:0,class:"tp-stop",onClick:xt(k=>n("cancel",_.id),["stop"])},O(C(s)("tasks.stop")),9,kae)):re("",!0),_.kind==="subagent"?(b(),xe(Ke,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(_)?(b(),xe(Ke,{key:2,class:Pe(["tp-chevron",{open:o.has(_.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):re("",!0)],8,gae),o.has(_.id)&&l(_)?(b(),N("div",bae,[_.meta?(b(),N("div",xae,[w("button",{class:Pe(["tp-copy",{copied:i.has(_.id)}]),onClick:xt(k=>f(_),["stop"])},O(i.has(_.id)?"已复制":"复制"),11,_ae),w("pre",wae,[w("code",null,[w("span",Sae,O(_.meta),1)])])])):re("",!0),_.output&&_.output.length>0?(b(),N("div",Cae,[w("button",{class:Pe(["tp-copy",{copied:r.has(_.id)}]),onClick:xt(k=>p(_),["stop"])},O(r.has(_.id)?"已复制":"复制"),11,Aae),w("pre",Mae,[w("code",null,[m[0]||(m[0]=Ye(`
296
+ `,-1)),(b(!0),N(Be,null,st(_.output,(k,g)=>(b(),N("span",{key:g,class:"tp-line"},O(k),1))),128)),m[1]||(m[1]=Ye(`
297
+ `,-1))])])])):re("",!0)])):re("",!0)],2))),128))])]))}}),CC=dt(Eae,[["__scopeId","data-v-28fd5fc0"]]),Tae={class:"todo-card"},Nae={key:0,class:"tc-empty"},Iae={class:"tc-name"},$ae=Ve({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Lt();function s(o){return o==="in_progress"?"run":o}return(o,i)=>(b(),N("div",Tae,[t.todos.length===0?(b(),N("div",Nae,[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),N(Be,null,st(t.todos,(r,l)=>(b(),N("div",{key:l,class:Pe(["tc-row",`s-${r.status}`])},[ie(f5,{status:s(r.status)},null,8,["status"]),w("span",Iae,O(r.title),1)],2))),128))]))}}),Lae=dt($ae,[["__scopeId","data-v-01c65735"]]),Fae=["disabled","aria-pressed"],Oae=Ve({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(b(),N("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))},[On(t.$slots,"default",{},void 0,!0)],10,Fae)):(b(),N("span",{key:1,class:Pe(["ui-pill",{"is-active":e.active}])},[On(t.$slots,"default",{},void 0,!0)],2))}}),Y0=dt(Oae,[["__scopeId","data-v-317ace1a"]]),Rae={class:"dock-work-head"},Bae={key:0,class:"dock-work-tab static"},Dae={key:1,class:"dock-work-tab static"},Pae={key:2,class:"dock-work-tab static"},Hae={class:"dock-work-body"},Wae={class:"dw-count"},zae={class:"dw-count"},Uae={class:"dw-count"},jae=Ve({__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}=Lt(),r=Q(null),l=Q(null),a=Q(null);function c(p){return r.value?(r.value.loadForEdit(p),!0):!1}function u(p){r.value?.loadAttachmentsForEdit(p)}function d(){r.value?.focus()}function f(p){if(!s.dockPanel)return;const h=p.target;h&&(l.value?.contains(h)||a.value?.contains(h)||o("close-dock-panel"))}return Ge(()=>s.dockPanel,p=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),p&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),xn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,loadAttachmentsForEdit:u,focus:d}),(p,h)=>(b(),N("div",{class:Pe(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[28]||(h[28]=xt(()=>{},["stop"]))},[ie(gl,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(b(),N("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[3]||(h[3]=xt(()=>{},["stop"]))},[w("div",Rae,[e.dockPanel==="bash"?(b(),N("span",Bae,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(b(),N("span",Dae,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(b(),N("span",Pae,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):re("",!0)]),w("div",Hae,[e.dockPanel==="bash"?(b(),xe(CC,{key:0,tasks:e.bashTasks,onCancel:h[0]||(h[0]=m=>o("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(b(),xe(CC,{key:1,tasks:e.subagentTasks,onCancel:h[1]||(h[1]=m=>o("cancelTask",m)),onOpen:h[2]||(h[2]=m=>o("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(b(),xe(Lae,{key:2,todos:e.todos??[]},null,8,["todos"])):re("",!0)])],512)):re("",!0)]),_:1}),e.goal?(b(),xe(qre,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[4]||(h[4]=m=>o("controlGoal",m))},null,8,["goal","force-expanded"])):re("",!0),e.hasDockWork?(b(),N("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(b(),xe(Y0,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:h[5]||(h[5]=m=>o("toggle-dock-panel","bash"))},{default:Ee(()=>[ie(Ke,{name:"clock",size:"md"}),w("span",null,O(C(i)("tasks.dockBash")),1),w("span",Wae,[h[29]||(h[29]=Ye("(",-1)),w("b",null,O(e.bashTasks.length),1),h[30]||(h[30]=Ye(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),e.subagentTasks.length>0?(b(),xe(Y0,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:h[6]||(h[6]=m=>o("toggle-dock-panel","subagent"))},{default:Ee(()=>[ie(Ke,{name:"sparkles",size:"md"}),w("span",null,O(C(i)("tasks.dockSubagent")),1),w("span",zae,[h[31]||(h[31]=Ye("(",-1)),w("b",null,O(e.subagentTasks.length),1),h[32]||(h[32]=Ye(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0),(e.todos?.length??0)>0?(b(),xe(Y0,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:h[7]||(h[7]=m=>o("toggle-dock-panel","todos"))},{default:Ee(()=>[ie(Ke,{name:"check-list",size:"md"}),w("span",null,O(C(i)("tasks.dockTodos")),1),w("span",Uae,[h[33]||(h[33]=Ye("(",-1)),w("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),h[34]||(h[34]=Ye(")",-1))])]),_:1},8,["active","aria-pressed"])):re("",!0)],512)):re("",!0),e.pendingQuestion?(b(),xe(yle,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:h[8]||(h[8]=(m,_)=>o("answer",m,_)),onDismiss:h[9]||(h[9]=m=>o("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(b(),xe(aae,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:h[10]||(h[10]=m=>o("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(b(),xe(d5,{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:h[11]||(h[11]=m=>o("submit",m)),onSteer:h[12]||(h[12]=m=>o("steer",m)),onCommand:h[13]||(h[13]=m=>o("command",m)),onInterrupt:h[14]||(h[14]=m=>o("interrupt")),onSetPermission:h[15]||(h[15]=m=>o("setPermission",m)),onSetThinking:h[16]||(h[16]=m=>o("setThinking",m)),onTogglePlan:h[17]||(h[17]=m=>o("togglePlan")),onToggleSwarm:h[18]||(h[18]=m=>o("toggleSwarm")),onToggleGoal:h[19]||(h[19]=m=>o("toggleGoal")),onOpenBtw:h[20]||(h[20]=m=>o("openBtw")),onCreateGoal:h[21]||(h[21]=m=>o("createGoal",m)),onControlGoal:h[22]||(h[22]=m=>o("controlGoal",m)),onFocusGoal:h[23]||(h[23]=m=>o("focusGoal")),onFocusSwarm:h[24]||(h[24]=m=>o("focusSwarm")),onCompact:h[25]||(h[25]=m=>o("compact")),onPickModel:h[26]||(h[26]=m=>o("pickModel")),onSelectModel:h[27]||(h[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))}}),qae=dt(jae,[["__scopeId","data-v-67df0d16"]]),Vae=["aria-label","aria-hidden"],Kae={class:"toc-scroll"},Gae=["onClick"],Yae={class:"toc-label"},Zae=240,Qae=Ve({__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}=Lt(),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,p=d.getBoundingClientRect().right;r.value=p-f>=Zae}const c=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ge(c,u=>{l?.disconnect(),l=null,u&&vt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),rs(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(b(),N("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",Kae,[(b(!0),N(Be,null,st(e.items,f=>(b(),N("button",{key:f.id,type:"button",class:Pe(["toc-row",{active:e.activeTurnId===f.id}]),onClick:p=>s("select",f.id)},[d[0]||(d[0]=w("span",{class:"toc-bar"},null,-1)),w("span",Yae,O(f.title),1)],10,Gae))),128))])],10,Vae)):re("",!0)}}),Xae=dt(Qae,[["__scopeId","data-v-3f1c1f66"]]),Jae=5;function ece(e,t,n,s=Jae){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 tce={class:"chat-layout"},nce={class:"empty-hint"},sce={key:0,class:"empty-hint-text"},oce={type:"button",class:"ws-pick-btn",tabindex:"-1"},ice={class:"ws-pick-name"},rce={class:"ws-pick-menu"},lce={type:"button",class:"ws-pick-item ws-pick-more",tabindex:"-1"},ace={type:"button",class:"ws-pick-action",tabindex:"-1"},cce={class:"ws-pick-name"},uce={key:1,class:"ws-pick-menu"},dce=["onClick"],fce={class:"ws-pick-item-name"},hce={class:"ws-pick-item-path"},pce=["aria-label"],mce={key:0,class:"abort-toast",role:"status","aria-live":"polite"},gce={class:"abort-toast-text"},Z0=80,AC=1e3,vce=420,yce=3e3,kce=Ve({__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"],setup(e,{expose:t,emit:n}){const{t:s,locale:o}=Lt(),i=e,r=n,l=Q(!1),a=Q(!1),c=Q(null),u=Q(null),d=Q(""),f=D(()=>d.value?{"--ws-pick-menu-width":d.value}:void 0);let p=null;const h=D(()=>i.workspaces?.find(ke=>ke.id===i.activeWorkspaceId)?.name??i.workspaceName??""),m=D(()=>(i.workspaces?.length??0)>0),_=D(()=>ece(i.workspaces??[],i.activeWorkspaceId,a.value)),k=D(()=>(i.workspaces?.length??0)-_.value.length);Ge(l,ue=>{ue||(a.value=!1)});function g(ue){l.value=!1,ue!==i.activeWorkspaceId&&r("selectWorkspace",ue)}function v(ue){const ke=Number.parseFloat(ue);return Number.isFinite(ke)?ke:0}function y(ue){return`${ue.fontStyle||"normal"} ${ue.fontWeight||"400"} ${ue.fontSize} ${ue.fontFamily}`}function A(ue){return ue.letterSpacing==="normal"?0:v(ue.letterSpacing)}function L(ue,ke){if(!ue)return 0;const Re=lA(ue,y(ke),{letterSpacing:A(ke)});return aA(Re)}function $(){const ue=c.value?.getBoundingClientRect().width??window.innerWidth;return Math.max(0,ue*.75)}function x(){const ue=u.value;if(!ue)return;const ke=ue.querySelector(".ws-pick-item-path");if(!ke)return;const Re=getComputedStyle(ke),ft=(i.workspaces??[]).reduce((At,zt)=>Math.max(At,L(zt.shortPath,Re)),0);d.value=ft?`${Math.ceil(Math.min(ft,$()))}px`:""}function E(){typeof window>"u"||vt(()=>{p!==null&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{p=null,x()})})}Ge(()=>[i.activeWorkspaceId,i.workspaceName,i.workspaces?.map(ue=>`${ue.id}\0${ue.name}\0${ue.shortPath}`).join("")??"",k.value,o.value],E,{immediate:!0}),gn(()=>{E(),window.addEventListener("resize",E),document.fonts?.ready.then(E)}),xn(()=>{p!==null&&window.cancelAnimationFrame(p),window.removeEventListener("resize",E)}),Fc(Ht.contentAlign);const T=Q(null),F=Q(null),S=Q(null),I=Q(!1),B=Q(0);let R=null;function P(ue,ke){const Re=S.value??F.value;return!Re||Re.loadForEdit(ue)===!1?!1:(Re.loadAttachmentsForEdit(ke??[]),!0)}function W(){I.value=!0,R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null,I.value=!1},2e3)}function U(){B.value++}const Z=D(()=>i.tasks.filter(ue=>ue.kind!=="subagent")),z=D(()=>i.tasks.filter(ue=>ue.kind==="subagent"&&ue.runInBackground)),ee=D(()=>Z.value.filter(ue=>ue.state==="run").length),de=D(()=>z.value.filter(ue=>ue.state==="run").length);function J(ue){const ke=i.tasks,Re=ke.find(At=>At.id===ue)??ke.find(At=>At.parentToolCallId===ue);if(Re)return Re.id;const ft=ke.filter(At=>At.kind==="subagent"&&!At.parentToolCallId);if(ft.length===1)return ft[0].id}In("resolveAgentTaskId",J),In("pinScroll",Zo);const Y=D(()=>(i.todos??[]).filter(ue=>ue.status==="done").length),X=D(()=>Z.value.length>0||z.value.length>0||(i.todos?.length??0)>0||(i.queued?.length??0)>0),fe=Q(null),ce=D(()=>i.gitInfo?i.changes?.length??0:0);function We(ue){fe.value=fe.value===ue?null:ue}function ge(){fe.value=null}Ge(X,ue=>{ue||ge()});function G(ue){if(ue.role==="compaction")return s("conversation.compactedPlain");if(ue.role==="user"){if(ue.skillActivation)return`/${ue.skillActivation.name}`;if(ue.pluginCommand)return`/${ue.pluginCommand.pluginId}:${ue.pluginCommand.commandName}`;const Re=ue.text.trim().replaceAll(/\s+/g," ");return Re.length>0?Re:"user"}const ke=(ue.text||ue.thinking||"").trim().replaceAll(/\s+/g," ");return ke.length>0?ke:(ue.tools?.length??0)>0?`${ue.tools.length} tools`:"kimi"}const le=D(()=>i.turns.filter(ue=>ue.role==="user").map((ue,ke)=>({id:ue.id,role:ue.role,no:ke+1,title:G(ue)}))),he=Q(null);function j(){const ue=Me.value;if(!ue)return;const ke=ue.querySelectorAll(".turn-anchor[data-turn-id]");if(ke.length===0)return;const Re=le.value;if(Re.length===0)return;const ft=new Set(Re.map(Rn=>Rn.id));if(nn()<=Z0){he.value=Re[Re.length-1].id;return}const At=ue.getBoundingClientRect(),zt=At.height/2;let Qt=null;ke.forEach(Rn=>{const Ls=Rn.dataset.turnId;if(!Ls||!ft.has(Ls))return;Rn.getBoundingClientRect().top-At.top<=zt&&(Qt=Ls)}),he.value=Qt??Re[0].id}const ne=Q(!1);let ve=0;function ae(){ve||(ve=vn(()=>{ve=0,ye()}))}function ye(){const ue=Me.value,ke=!i.mobile&&i.conversationToc&&ue?ue.closest(".con")?.querySelector(".conversation-toc"):null,Re=ke?.querySelector(".toc-bar");let ft=!1;if(ue&&ke&&Re){const At=Re.getBoundingClientRect(),zt=ke.getBoundingClientRect(),Qt=At.left+At.width/2;ft=Array.from(ue.querySelectorAll(".table-node-wrapper")).some(Rn=>{const Ls=Rn.getBoundingClientRect();return Ls.left<=Qt&&Qt<=Ls.right&&Ls.top<zt.bottom&&Ls.bottom>zt.top})}ne.value!==ft&&(ne.value=ft)}const q=D(()=>i.questions&&i.questions.length>0?i.questions[0]:void 0),se=D(()=>{const ue=q.value;if(ue)return i.pendingQuestionActions?.[ue.questionId]}),me=D(()=>i.approvals&&i.approvals.length>0?i.approvals[0]:void 0),Te=D(()=>{const ue=me.value;return ue?!!i.pendingApprovalActions?.[ue.approvalId]:!1}),Me=Q(null),$e=Q(null),pe=Q(0),Ie=Q(0),Qe=D(()=>({"--panes-scrollbar-width":`${pe.value}px`}));function lt(ue){return ue instanceof HTMLElement?ue:ue&&"$el"in ue&&ue.$el instanceof HTMLElement?ue.$el:null}function _t(){const ue=Me.value;pe.value=ue?Math.max(0,ue.offsetWidth-ue.clientWidth):0,Ie.value=$e.value?.offsetHeight??0}function St(ue){const ke=lt(ue);Me.value=ke,ke&&te()}function Tt(ue){const ke=lt(ue);$e.value=ke??null,ue&&"loadForEdit"in ue&&typeof ue.loadForEdit=="function"&&"focus"in ue&&typeof ue.focus=="function"?S.value={loadForEdit:ue.loadForEdit.bind(ue),loadAttachmentsForEdit:"loadAttachmentsForEdit"in ue&&typeof ue.loadAttachmentsForEdit=="function"?ue.loadAttachmentsForEdit.bind(ue):()=>{},focus:ue.focus.bind(ue)}:S.value=null,Tl()}const Ct=Q(!0),gt=Q(!1);function nn(){const ue=Me.value;return ue?ue.scrollHeight-ue.scrollTop-ue.clientHeight:0}let rn=0,Qn=0,Zt=0,fn=0,hn=0,it=0;function zn(){return Date.now()<Qn}function Hn(){ae();const ue=Me.value;if(!ue)return;const ke=ue.scrollTop;if(No()){rn=ke;return}if(performance.now()-Zt<100){rn=ke;return}const Re=nn();if(zn()){Ct.value=!0,gt.value=!1,rn=ke;return}ke<rn-1&&Re>1?(Ct.value=!1,gt.value=!0):Re<=Z0&&ke>rn+1&&(Ct.value=!0,gt.value=!1),rn=ke,j()}function Wn(ue=!1){const ke=Me.value;Ct.value=!0,gt.value=!1,ke&&(!ue&&performance.now()<fn||(ue&&typeof ke.scrollTo=="function"?(Zt=performance.now(),fn=performance.now()+vce,ke.scrollTo({top:ke.scrollHeight,behavior:"smooth"})):ke.scrollTop=ke.scrollHeight,rn=ke.scrollTop))}function Ze(ue,ke){return(ke.closest("[inert]")?.closest(".tool-group")??ke).getBoundingClientRect().top-ue.getBoundingClientRect().top+ue.scrollTop}function Xe(ue,ke){const Re=Array.from(ue.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(zt=>({node:zt,top:Ze(ue,zt)})),ft=Re.findIndex(zt=>zt.top>=ke),At=ft<0?Math.max(0,Re.length-1):ft;return Re.slice(At,At+2).flatMap(zt=>{const Qt=zt.node.dataset.scrollAnchorId,Rn=Qt??zt.node.dataset.turnId;return Rn?[{kind:Qt?"tool":"turn",id:Rn,top:zt.top}]:[]})}const Dt=new Map;function Pt(ue,ke){for(const Re of ke.anchors){const ft=Re.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",At=ue.querySelector(`[${ft}="${Xn(Re.id)}"]`);if(At)return Ze(ue,At)-Re.top}return ue.scrollHeight-ke.oldHeight}function an(ue,ke,Re=ue.scrollTop){return ue.scrollTop=Re+Pt(ue,ke),rn=ue.scrollTop,ue.scrollTop}async function wn(){if(!i.sessionId||!i.loadOlderMessages||i.loadingMore||ds.value||!i.hasMoreMessages)return;const ue=i.sessionId,ke=Me.value,Re=ke?.scrollTop??0,ft={anchors:ke?Xe(ke,Re):[],oldHeight:ke?.scrollHeight??0};ct(ue,!0),Fe();try{if(await vt(),await i.loadOlderMessages(ue),await vt(),i.sessionId!==ue){Dt.set(ue,ft);return}const At=Me.value;if(!At)return;an(At,ft),Dt.delete(ue)}finally{ct(ue,!1)}}function Xn(ue){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(ue):ue.replaceAll(/["\\]/g,"\\$&")}function Ss(ue){const ke=Me.value;if(!ke)return;const Re=ke.querySelector(`.turn-anchor[data-turn-id="${Xn(ue)}"]`);Re&&(Vt(),Ct.value=!1,gt.value=nn()>Z0,Re.scrollIntoView({behavior:"smooth",block:"center"}))}function as(){const ue=Me.value;if(!ue)return"none";const ke=ue.firstElementChild,Re=ke instanceof HTMLElement?ke.offsetHeight:0,ft=$e.value?.offsetHeight??0;return`${ue.scrollHeight}:${ue.clientHeight}:${Re}:${ft}`}function vn(ue){return typeof requestAnimationFrame=="function"?requestAnimationFrame(ue):setTimeout(ue,16)}function Ft(ue){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(ue):clearTimeout(ue)}let Cs=0,sn=0,Xs=null,cs=0;function No(){return performance.now()<Cs}function Zo(ue,ke=260){const Re=Me.value;if(!Re||(Xs=ue,cs=ue.getBoundingClientRect().top,Cs=performance.now()+ke,sn))return;const ft=()=>{if(sn=0,performance.now()>=Cs||!Xs){Xs=null;return}const At=Xs.getBoundingClientRect().top-cs;At&&(Re.scrollTop+=At),sn=vn(ft)};sn=vn(ft)}function As(ue=36){if(!Ct.value&&!zn())return;const ke=++it;let Re="",ft=0,At=0;hn&&(Ft(hn),hn=0);const zt=()=>{if(hn=0,ke!==it||!Ct.value&&!zn())return;Wn(!1);const Qt=as();ft=Qt===Re?ft+1:0,Re=Qt,At++,ft<3&&At<ue&&(hn=vn(zt))};hn=vn(zt)}function Qo(ue,ke){return ue!==void 0&&ue.length>0&&ke.length>=ue.length&&ue.firstId!==ke.firstId&&ue.lastId===ke.lastId&&ue.lastTextLen===ke.lastTextLen&&ue.lastThinkingLen===ke.lastThinkingLen&&ue.lastToolsLen===ke.lastToolsLen&&ue.approvalIds===ke.approvalIds}const jt=D(()=>{const ue=(i.approvals??[]).map(zt=>zt.approvalId).join(","),ke=i.turns,Re=ke.at(-1),ft=Re?.thinking?.length??0,At=Re?.tools?.reduce((zt,Qt)=>zt+Qt.name.length+(Qt.arg?.length??0)+(Qt.output?.join("").length??0),0)??0;return{length:ke.length,firstId:ke[0]?.id??"",lastId:Re?.id??"",lastTextLen:Re?.text.length??0,lastThinkingLen:ft,lastToolsLen:At,approvalIds:ue}});Ge(jt,async(ue,ke)=>{if(ds.value&&Qo(ke,ue)){j();return}await vt(),Ct.value||zn()?Wn(ue.length<ke.length):gt.value=!0,j()}),Ge($e,()=>{Tl()}),Ge(()=>i.mobile,async()=>{await vt(),_t()});const Xo=new Map;Ge(()=>i.fileReloadKey,async(ue,ke)=>{const Re=Me.value;ke&&Re&&Xo.set(String(ke),{top:Re.scrollTop,following:Ct.value}),Vt(),await vt();const ft=Me.value,At=ue?Xo.get(String(ue)):void 0;if(At&&ft){const zt=Dt.get(String(ue)),Qt=zt?an(ft,zt,At.top):At.top;zt&&Dt.delete(String(ue)),Ct.value=At.following,ft.scrollTop=Qt,rn=ft.scrollTop,gt.value=!At.following&&nn()>1,At.following&&As()}else Ct.value=!0,rn=0,Wn(!1),As();j()}),Ge(()=>i.sessionLoading,async(ue,ke)=>{ue||!ke||(Ct.value=!0,await vt(),As(),j())}),Ge(()=>i.running,async(ue,ke)=>{ue||!ke||!Ct.value&&!zn()||(await vt(),As(48),j())});function Io(){Ct.value=!0,gt.value=!1,Qn=Date.now()+AC,vt(()=>{Wn(!0),As(16)})}function mo(ue){Io(),r("submit",ue)}function Jn(ue){Ct.value=!0,gt.value=!1,Qn=Date.now()+AC,r("editMessage",ue)}function os(ue){const ke=i.queued?.[ue],Re=ke?.text??"";P(Re,ke?.attachments)&&r("editQueued",ue)}function Yi(ue){r("reorderQueue",ue)}function Is(ue,ke){Io(),r("answer",ue,ke)}function Zi(ue,ke){!ue||!ke||r("approval",ue,ke)}let $s=null,us=null,Us=null,Un=null,$o=0,Jo=0,ks=0;const jn=Q(new Set),ds=D(()=>!!i.sessionId&&jn.value.has(i.sessionId));function ct(ue,ke){const Re=new Set(jn.value);ke?Re.add(ue):Re.delete(ue),jn.value=Re}function be(){ds.value||ks||(ks=vn(()=>{ks=0,!ds.value&&(No()||(Ct.value||zn())&&Wn(!1))}))}function Fe(){it++,hn&&(Ft(hn),hn=0),ks&&(Ft(ks),ks=0)}function Vt(){const ue=Me.value;if(Qn=0,Fe(),Cs=0,Xs=null,ue){const ke=ue.scrollTop;typeof ue.scrollTo=="function"?ue.scrollTo({top:ke,behavior:"auto"}):ue.scrollTop=ke}fn=0,Zt=Number.NEGATIVE_INFINITY,ue&&(rn=ue.scrollTop)}function Lo(){const ue=Me.value;!ue||ue.scrollHeight-ue.clientHeight<=1&&!i.hasMoreMessages||(Ct.value=!1,Vt(),ue.scrollHeight-ue.clientHeight>1&&(gt.value=!0))}function qe(ue){const ke=Me.value;if(!ke)return!1;for(const Re of ue.composedPath()){if(Re===ke)return!1;if(Re instanceof HTMLElement&&Re.scrollHeight>Re.clientHeight+1&&Re.scrollTop>1)return!0}return!1}function nt(ue){ue.defaultPrevented||ue.ctrlKey||ue.shiftKey||ue.deltaY>=0||qe(ue)||Lo()}function ot(ue){const ke=Me.value;if(!ke||ue.defaultPrevented||ue.button!==0||ue.pointerType==="touch")return;const Re=ke.getBoundingClientRect(),ft=ke.offsetWidth-ke.clientWidth,At=ft>0?ft:12;ue.target===ke&&ue.clientX>=Re.right-At&&Lo()}let Rt=null;function Fo(ue){Rt=ue.touches.length===1?ue.touches[0].clientY:null}function ei(ue){const ke=ue.touches.length===1?ue.touches[0].clientY:null;ke!==null&&Rt!==null&&ke>Rt+2&&!qe(ue)&&Lo(),Rt=ke}function ki(){if(!us)return;const ue=Me.value?.firstElementChild??null;ue!==Us&&(Us&&us.unobserve(Us),Us=ue,ue&&us.observe(ue))}function Tl(){if(!us)return;const ue=$e.value;ue!==Un&&(Un&&us.unobserve(Un),Un=ue,ue&&us.observe(ue))}function te(){const ue=Me.value;_t(),$s&&($s.disconnect(),ue&&$s.observe(ue,{childList:!0,subtree:!0,characterData:!0})),us&&(us.disconnect(),Us=null,Un=null,ue&&us.observe(ue),ki(),Tl()),$o=ue?.scrollHeight??0,Jo=ue?.clientHeight??0,ae()}function we(){ki(),be(),ae()}function Se(){typeof document>"u"||document.visibilityState==="visible"&&Ct.value&&As()}const De=Q(!1);let tt=null;function ut(){De.value=!0,tt!==null&&clearTimeout(tt),tt=setTimeout(()=>{De.value=!1},yce)}function It(){ut(),r("interrupt")}function Wt(ue){ue.key==="Escape"&&(i.running||i.sending)&&(ue.preventDefault(),It())}gn(()=>{vt(()=>{typeof MutationObserver=="function"&&($s=new MutationObserver(we)),typeof ResizeObserver=="function"&&(us=new ResizeObserver(()=>{ae(),_t();const ue=Me.value;if(!ue)return;const{scrollHeight:ke,clientHeight:Re}=ue,ft=ke>$o+1,At=Re<Jo-1;$o=ke,Jo=Re,!No()&&(ft||At)&&be()})),te(),As(48),j(),typeof document<"u"&&(document.addEventListener("visibilitychange",Se),document.addEventListener("keydown",Wt))})}),xn(()=>{$s&&$s.disconnect(),us&&us.disconnect(),ks&&Ft(ks),hn&&Ft(hn),sn&&Ft(sn),ve&&Ft(ve),tt!==null&&clearTimeout(tt),R!==null&&(clearTimeout(R),R=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Se),document.removeEventListener("keydown",Wt))});function $t(){(S.value??F.value)?.focus()}return t({loadComposerForEdit:P,focusComposer:$t}),(ue,ke)=>(b(),N("section",{class:Pe(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(b(),xe(Woe,{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":ce.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:I.value,onOpenChanges:ke[0]||(ke[0]=Re=>r("openChanges")),onCopyAll:ke[1]||(ke[1]=Re=>T.value?.copyConversation()),onCopyFinalSummary:ke[2]||(ke[2]=Re=>T.value?.copyFinalSummary()),onOpenPr:ke[3]||(ke[3]=Re=>e.pr&&r("openPr",e.pr.url)),onRenameSession:ke[4]||(ke[4]=(Re,ft)=>r("renameSession",Re,ft)),onForkSession:ke[5]||(ke[5]=Re=>r("forkSession",Re)),onArchiveSession:ke[6]||(ke[6]=Re=>r("archiveSession",Re))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):re("",!0),e.conversationToc?(b(),xe(Xae,{key:1,items:le.value,"active-turn-id":he.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:ne.value,onSelect:Ss},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):re("",!0),w("div",tce,[w("div",{ref:St,class:Pe(["panes chat-scroll",{"is-following":Ct.value,"history-prepending":ds.value}]),onScrollPassive:Hn,onWheelPassive:nt,onPointerdownPassive:ot,onTouchstartPassive:Fo,onTouchmovePassive:ei},[w("div",{ref_key:"contentWrapRef",ref:c,class:Pe(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(b(),N(Be,{key:0},[ke[55]||(ke[55]=w("div",{class:"empty-spacer"},null,-1)),w("div",nce,[w("span",{class:Pe(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(b(),xe(To,{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(),N("span",sce,O(C(s)("composer.emptyConversation")),1)),m.value&&!e.starting?(b(),N("div",{key:1,class:"ws-pick",style:Jt(f.value)},[w("div",{ref_key:"wsPickMeasureRef",ref:u,class:"ws-pick-measure","aria-hidden":"true"},[w("button",oce,[ie(Ke,{name:"folder",size:"sm"}),w("span",ice,O(h.value),1),ie(Ke,{class:"ws-pick-chev",name:"chevron-down",size:"sm"})]),w("div",rce,[ke[53]||(ke[53]=w("button",{type:"button",class:"ws-pick-item",tabindex:"-1"},[w("span",{class:"ws-pick-item-name"}),w("span",{class:"ws-pick-item-path"})],-1)),w("button",lce,[w("span",null,O(C(s)("conversation.moreWorkspaces",{count:k.value})),1)]),w("button",ace,[ie(Ke,{name:"plus",size:"sm"}),w("span",null,O(C(s)("conversation.addWorkspace")),1)])])],512),ie(Xt,{text:C(s)("conversation.switchWorkspace")},{default:Ee(()=>[w("button",{type:"button",class:"ws-pick-btn",onClick:ke[7]||(ke[7]=xt(Re=>l.value=!l.value,["stop"]))},[ie(Ke,{name:"folder",size:"sm"}),w("span",cce,O(h.value),1),ie(Ke,{class:Pe(["ws-pick-chev",{open:l.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),l.value?(b(),N("div",{key:0,class:"ws-pick-backdrop",onClick:ke[8]||(ke[8]=Re=>l.value=!1)})):re("",!0),l.value?(b(),N("div",uce,[(b(!0),N(Be,null,st(_.value,Re=>(b(),N("button",{key:Re.id,type:"button",class:Pe(["ws-pick-item",{on:Re.id===e.activeWorkspaceId}]),onClick:xt(ft=>g(Re.id),["stop"])},[w("span",fce,O(Re.name),1),w("span",hce,O(Re.shortPath),1)],10,dce))),128)),k.value>0?(b(),N("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:ke[9]||(ke[9]=xt(Re=>a.value=!a.value,["stop"]))},[w("span",null,O(C(s)("conversation.moreWorkspaces",{count:k.value})),1)])):re("",!0),ke[54]||(ke[54]=w("div",{class:"ws-pick-divider"},null,-1)),w("button",{type:"button",class:"ws-pick-action",onClick:ke[10]||(ke[10]=xt(Re=>{l.value=!1,r("addWorkspace")},["stop"]))},[ie(Ke,{name:"plus",size:"sm"}),w("span",null,O(C(s)("conversation.addWorkspace")),1)])])):re("",!0)],4)):e.starting?re("",!0):(b(),N("button",{key:2,type:"button",class:"empty-add-workspace",onClick:ke[11]||(ke[11]=Re=>r("addWorkspace"))},[ie(Ke,{name:"folder-plus",size:"sm"}),w("span",null,O(C(s)("conversation.addWorkspace")),1)]))]),ie(d5,{ref_key:"emptyComposerRef",ref:F,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:mo,onSteer:ke[12]||(ke[12]=Re=>r("steer",Re)),onCommand:ke[13]||(ke[13]=Re=>r("command",Re)),onInterrupt:It,onUnqueue:ke[14]||(ke[14]=Re=>r("unqueue",Re)),onEditQueued:ke[15]||(ke[15]=Re=>r("editQueued",Re)),onSetPermission:ke[16]||(ke[16]=Re=>r("setPermission",Re)),onSetThinking:ke[17]||(ke[17]=Re=>r("setThinking",Re)),onTogglePlan:ke[18]||(ke[18]=Re=>r("togglePlan")),onToggleSwarm:ke[19]||(ke[19]=Re=>r("toggleSwarm")),onToggleGoal:ke[20]||(ke[20]=Re=>r("toggleGoal")),onOpenBtw:ke[21]||(ke[21]=Re=>r("command","/btw")),onCreateGoal:ke[22]||(ke[22]=Re=>r("createGoal",Re)),onControlGoal:ke[23]||(ke[23]=Re=>r("controlGoal",Re)),onFocusGoal:U,onCompact:ke[24]||(ke[24]=Re=>r("compact")),onPickModel:ke[25]||(ke[25]=Re=>r("pickModel")),onSelectModel:ke[26]||(ke[26]=Re=>r("selectModel",Re))},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"]),ke[56]||(ke[56]=w("div",{class:"empty-spacer"},null,-1))],64)):(b(),xe(a5,{ref_key:"chatPaneRef",ref:T,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":Ct.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:ke[27]||(ke[27]=Re=>r("openFile",Re)),onOpenMedia:ke[28]||(ke[28]=Re=>r("openMedia",Re)),onCopyConversationCopied:W,onOpenThinking:ke[29]||(ke[29]=Re=>r("openThinking",Re)),onOpenCompaction:ke[30]||(ke[30]=Re=>r("openCompaction",Re)),onOpenAgent:ke[31]||(ke[31]=Re=>r("openAgent",Re)),onOpenToolDiff:ke[32]||(ke[32]=Re=>r("openToolDiff",Re)),onEditMessage:Jn,onLoadOlderMessages:wn,onUnqueue:ke[33]||(ke[33]=Re=>r("unqueue",Re)),onEditQueued:os,onReorderQueue:Yi},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(),xe(qae,{key:0,ref:Tt,style:Jt(Qe.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":B.value,"dock-panel":fe.value,"bash-tasks":Z.value,"subagent-tasks":z.value,"bash-running":ee.value,"subagent-running":de.value,"todo-done-count":Y.value,"has-dock-work":X.value,todos:e.todos,"pending-question":q.value,"question-busy-kind":se.value,"pending-approval":me.value,"approval-busy":Te.value,mobile:e.mobile,onToggleDockPanel:ke[34]||(ke[34]=Re=>We(Re)),onCloseDockPanel:ke[35]||(ke[35]=Re=>ge()),onOpenAgent:ke[36]||(ke[36]=Re=>r("openAgent",Re)),onAnswer:Is,onDismiss:ke[37]||(ke[37]=Re=>r("dismiss",Re)),onApproval:Zi,onCancelTask:ke[38]||(ke[38]=Re=>r("cancelTask",Re)),onControlGoal:ke[39]||(ke[39]=Re=>r("controlGoal",Re)),onSubmit:mo,onSteer:ke[40]||(ke[40]=Re=>r("steer",Re)),onCommand:ke[41]||(ke[41]=Re=>r("command",Re)),onInterrupt:It,onSetPermission:ke[42]||(ke[42]=Re=>r("setPermission",Re)),onSetThinking:ke[43]||(ke[43]=Re=>r("setThinking",Re)),onTogglePlan:ke[44]||(ke[44]=Re=>r("togglePlan")),onToggleSwarm:ke[45]||(ke[45]=Re=>r("toggleSwarm")),onToggleGoal:ke[46]||(ke[46]=Re=>r("toggleGoal")),onOpenBtw:ke[47]||(ke[47]=Re=>r("command","/btw")),onCreateGoal:ke[48]||(ke[48]=Re=>r("createGoal",Re)),onFocusGoal:U,onCompact:ke[49]||(ke[49]=Re=>r("compact")),onPickModel:ke[50]||(ke[50]=Re=>r("pickModel")),onSelectModel:ke[51]||(ke[51]=Re=>r("selectModel",Re))},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(gl,{name:"pill"},{default:Ee(()=>[gt.value?(b(),N("button",{key:0,class:"newmsg-pill",style:Jt({bottom:`${Ie.value+12}px`}),"aria-label":C(s)("conversation.jumpToLatestAria"),onClick:ke[52]||(ke[52]=Re=>Wn(!0))},[ie(Ke,{class:"pill-chevron",name:"chevron-down",size:"md"}),Ye(" "+O(C(s)("conversation.newMessages")),1)],12,pce)):re("",!0)]),_:1}),ie(gl,{name:"abort-toast"},{default:Ee(()=>[De.value?(b(),N("div",mce,[w("span",gce,O(C(s)("conversation.manuallyAborted")),1)])):re("",!0)]),_:1})],2))}}),bce=dt(kce,[["__scopeId","data-v-2d6856b0"]]),xce=["aria-selected","onClick"],_ce=Ve({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),N("div",{class:Pe(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(b(!0),N(Be,null,st(e.options,i=>(b(),N("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,xce))),128))],2))}}),ro=dt(_ce,[["__scopeId","data-v-d1aaccd7"]]),wce={class:"ui-panel-header__title"},Sce={key:0,class:"ui-panel-header__sub"},Cce=Ve({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(b(),N("div",{class:Pe(["ui-panel-header",{wrap:e.wrap}])},[w("span",wce,O(e.title),1),ie(Xt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(b(),N("span",Sce,O(e.subtitle),1)):re("",!0)]),_:1},8,["text"]),On(t.$slots,"default",{},void 0,!0),e.closable?(b(),xe(Pn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=s=>t.$emit("close"))},{default:Ee(()=>[ie(Ke,{name:"close",size:"sm"})]),_:1},8,["label"])):re("",!0)],2))}}),ma=dt(Cce,[["__scopeId","data-v-c47879ad"]]),Ace={key:0,class:"fp-empty fp-error"},Mce={key:1,class:"fp-empty"},Ece={key:2,class:"fp-loading"},Tce={class:"fp-path"},Nce={class:"fp-meta"},Ice={key:0,class:"fp-lines"},$ce={class:"fp-size"},Lce={key:3,class:"fp-search"},Fce=["placeholder"],Oce={key:0,class:"fp-search-count"},Rce=["href","aria-label"],Bce={key:1,class:"fp-code"},Dce={class:"fp-line-table"},Pce=["data-line"],Hce={class:"fp-gutter"},Wce=["innerHTML"],zce={key:1,class:"fp-body fp-code"},Uce={class:"fp-line-table"},jce=["data-line"],qce={class:"fp-gutter"},Vce=["innerHTML"],Kce={key:2,class:"fp-body"},Gce=["srcdoc","title"],Yce={key:1,class:"fp-code"},Zce={class:"fp-line-table"},Qce=["data-line"],Xce={class:"fp-gutter"},Jce=["innerHTML"],eue={key:3,class:"fp-body fp-pdf-wrap"},tue=["src","title"],nue={key:1,class:"fp-binary-card"},sue={class:"fp-binary-label"},oue={key:4,class:"fp-body fp-table-wrap"},iue={class:"fp-table"},rue=["data-line"],lue={key:5,class:"fp-body fp-image-wrap"},aue=["src","alt"],cue={key:1,class:"fp-binary-card"},uue={class:"fp-binary-icon"},due={class:"fp-binary-label"},fue={key:6,class:"fp-body fp-code"},hue={class:"fp-line-table"},pue=["data-line"],mue={class:"fp-gutter"},gue=["innerHTML"],vue={key:7,class:"fp-body fp-binary-wrap"},yue={class:"fp-binary-card"},kue={class:"fp-binary-icon"},bue={class:"fp-binary-label"},xue=Ve({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=Lt();function s(ge,G){const le=G?G.split("/").filter(Boolean):[];for(const he of ge.split("/"))he===""||he==="."||(he===".."?le.pop():le.push(he));return le.join("/")}const o=Yt("resolveImage",async ge=>ge),i=D(()=>{const ge=c.file?.path??"",G=ge.lastIndexOf("/");return G>0?ge.slice(0,G):""});function r(ge){if(/^(https?:|data:|blob:)/i.test(ge)||ge.startsWith("/"))return ge;const G=i.value;return G?s(ge,G):ge}async function l(ge){const G=r(ge);return o?o(G):G}In("resolveImage",l);function a(ge){let G=ge.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(G)||G.startsWith("/"))return ge;for(const he of["#","?"]){const j=G.indexOf(he);j!==-1&&(G=G.slice(0,j))}const le=i.value;return{...ge,path:s(G,le)}}const c=e,u=t;function d(ge){c.openFile?.(a(ge))}const f=Q(null),p=D(()=>{const ge=c.file;if(!ge)return"binary";const G=ge.mime??"",le=ge.languageId??"",he=ge.path.toLowerCase();return G==="text/markdown"||le==="markdown"||le==="md"||he.endsWith(".mdx")?"markdown":G==="application/json"||le==="json"?"json":G==="text/html"||le==="html"||he.endsWith(".html")||he.endsWith(".htm")?"html":G==="application/pdf"||he.endsWith(".pdf")?"pdf":G==="text/csv"||le==="csv"||he.endsWith(".csv")?"csv":G.startsWith("image/")?"image":ge.isBinary?"binary":G.startsWith("text/")||le!==""?"text":"binary"});function h(ge){const G=atob(ge),le=Uint8Array.from(G,he=>he.charCodeAt(0));return new TextDecoder().decode(le)}const m=D(()=>{const ge=c.file;if(!ge)return"";if(ge.encoding==="base64")try{return h(ge.content)}catch{return ge.content}return ge.content}),_=D(()=>{if(p.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),k=D(()=>c.file?(p.value==="json"?_.value:m.value).split(`
298
+ `):[]),g=D(()=>c.file?p.value==="json"?_.value:m.value:""),v=Q(""),y=Q(0),A=D(()=>{const ge=v.value.trim().toLowerCase();if(!ge)return[];const G=[];return k.value.forEach((le,he)=>{le.toLowerCase().includes(ge)&&G.push(he+1)}),G});Ge(v,()=>{y.value=0});function L(ge,G=!1){ge&&vt(()=>{const le=f.value?.querySelector(".fp-body"),he=le?.querySelector(`[data-line="${ge}"]`);if(!le||!he)return;G&&(le.scrollTop=0);const j=le.getBoundingClientRect(),ne=he.getBoundingClientRect(),ve=ne.top-j.top+le.scrollTop;le.scrollTop=ve-le.clientHeight/2+ne.height/2})}Ge(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(ge){const G=A.value;G.length!==0&&(y.value=(y.value+ge+G.length)%G.length,L(G[y.value]))}function x(ge){const G=A.value;return{target:c.line===ge,hit:G.includes(ge),active:G[y.value]===ge}}function E(ge){return ge<1024?`${ge} B`:ge<1024*1024?`${(ge/1024).toFixed(1)} KB`:`${(ge/(1024*1024)).toFixed(1)} MB`}const T=Q(!1),F=Q(!1);function S(){c.file&&Zs(g.value).then(ge=>{ge&&(T.value=!0,setTimeout(()=>{T.value=!1},1400))})}function I(){c.file&&Zs(c.file.path).then(ge=>{ge&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const B=Q("preview"),R=Q("preview"),P=Q("fit");function W(ge){B.value=ge}function U(ge){R.value=ge}function Z(ge){P.value=ge}Ge(p,ge=>{B.value=ge==="html"?"preview":"source",R.value="preview",P.value="fit"});const z=D(()=>{const ge=c.file;return!ge||p.value!=="image"?null:ge.sourceUrl?ge.sourceUrl:ge.encoding==="base64"?`data:${ge.mime};base64,${ge.content}`:ge.mime==="image/svg+xml"?`data:${ge.mime};charset=utf-8,${encodeURIComponent(ge.content)}`:null}),ee=D(()=>{const ge=c.file;return!ge||p.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ge.encoding==="base64"?`data:${ge.mime};base64,${ge.content}`:null}),de=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 J(ge){const G=[];let le="",he=!1;for(let j=0;j<ge.length;j++){const ne=ge[j];ne==='"'&&ge[j+1]==='"'?(le+='"',j++):ne==='"'?he=!he:ne===","&&!he?(G.push(le),le=""):le+=ne}return G.push(le),G}const Y=D(()=>k.value.slice(0,200).map(J));function X(ge){return ge.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function fe(){const ge=c.file;if(!ge)return"";const G=ge.languageId?.toLowerCase();return G||(ge.path.split(".").pop()?.toLowerCase()??"")}function ce(ge){const G=fe();let le=X(ge);return p.value==="json"||G==="json"||G==="jsonc"?(le=le.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),le=le.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),le=le.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),le=le.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),le):p.value==="html"||G==="html"||G==="xml"||G==="svg"?(le=le.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),le=le.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),le=le.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),le):(le=le.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>'),le=le.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),le=le.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),le)}function We(ge,G=55){return!ge||ge.length<=G?ge:"…"+ge.slice(ge.length-G+1)}return(ge,G)=>(b(),N("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(b(),N("div",Ace,[w("span",null,O(e.error),1),e.closable?(b(),xe(Ut,{key:0,variant:"secondary",size:"sm",onClick:G[0]||(G[0]=le=>u("close"))},{default:Ee(()=>[Ye(O(C(n)("filePreview.close")),1)]),_:1})):re("",!0)])):!e.file&&!e.loading?(b(),N("div",Mce,O(C(n)("filePreview.empty")),1)):e.loading?(b(),N("div",Ece,[G[7]||(G[7]=w("span",{class:"spinner"},null,-1)),w("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(b(),N(Be,{key:3},[ie(ma,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:G[6]||(G[6]=le=>u("close"))},{default:Ee(()=>[ie(Xt,{text:e.file.path},{default:Ee(()=>[w("span",Tce,O(We(e.file.path)),1)]),_:1},8,["text"]),w("span",Nce,[e.file.lineCount?(b(),N("span",Ice,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):re("",!0),w("span",$ce,O(E(e.file.size)),1)]),p.value==="html"?(b(),xe(ro,{key:0,"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),p.value==="markdown"?(b(),xe(ro,{key:1,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":U},null,8,["model-value","options"])):re("",!0),p.value==="image"?(b(),xe(ro,{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":Z},null,8,["model-value","options"])):re("",!0),p.value==="text"||p.value==="json"||p.value==="html"||p.value==="csv"?(b(),N("div",Lce,[Fn(w("input",{"onUpdate:modelValue":G[1]||(G[1]=le=>v.value=le),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Fce),[[po,v.value]]),v.value.trim()?(b(),N("span",Oce,O(A.value.length),1)):re("",!0),ie(Pn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:G[2]||(G[2]=le=>$(-1))},{default:Ee(()=>[ie(Ke,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ie(Pn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:G[3]||(G[3]=le=>$(1))},{default:Ee(()=>[ie(Ke,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):re("",!0),ie(Pn,{size:"sm",class:Pe({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:I},{default:Ee(()=>[F.value?(b(),xe(Ke,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),xe(Ke,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(b(),xe(Pn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:G[4]||(G[4]=le=>u("openExternal"))},{default:Ee(()=>[ie(Ke,{name:"external-link",size:"md"})]),_:1},8,["label"])):re("",!0),e.externalActions?(b(),xe(Pn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:G[5]||(G[5]=le=>u("reveal"))},{default:Ee(()=>[ie(Ke,{name:"folder",size:"md"})]),_:1},8,["label"])):re("",!0),e.downloadUrl?(b(),N("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ie(Ke,{name:"download",size:"md"})],8,Rce)):re("",!0),!e.file.isBinary&&p.value!=="image"?(b(),xe(Pn,{key:7,size:"sm",class:Pe({copied:T.value}),label:T.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[T.value?(b(),xe(Ke,{key:1,class:"fp-check",name:"check",size:"md"})):(b(),xe(Ke,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):re("",!0)]),_:1},8,["title","closable","close-label"]),p.value==="markdown"?(b(),N("div",{key:0,class:Pe(["fp-body",{"fp-markdown":R.value==="preview"}])},[R.value==="preview"?(b(),xe(ym,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(b(),N("div",Bce,[w("div",Dce,[(b(!0),N(Be,null,st(k.value,(le,he)=>(b(),N("div",{key:he,class:Pe(["fp-line-row",x(he+1)]),"data-line":he+1},[w("span",Hce,O(he+1),1),w("span",{class:"fp-line-text",innerHTML:ce(le)},null,8,Wce)],10,Pce))),128))])]))],2)):p.value==="json"?(b(),N("div",zce,[w("div",Uce,[(b(!0),N(Be,null,st(k.value,(le,he)=>(b(),N("div",{key:he,class:Pe(["fp-line-row",x(he+1)]),"data-line":he+1},[w("span",qce,O(he+1),1),w("span",{class:"fp-line-text",innerHTML:ce(le)},null,8,Vce)],10,jce))),128))])])):p.value==="html"?(b(),N("div",Kce,[B.value==="preview"?(b(),N("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:de.value,title:e.file.path},null,8,Gce)):(b(),N("div",Yce,[w("div",Zce,[(b(!0),N(Be,null,st(k.value,(le,he)=>(b(),N("div",{key:he,class:Pe(["fp-line-row",x(he+1)]),"data-line":he+1},[w("span",Xce,O(he+1),1),w("span",{class:"fp-line-text",innerHTML:ce(le)},null,8,Jce)],10,Qce))),128))])]))])):p.value==="pdf"?(b(),N("div",eue,[ee.value?(b(),N("iframe",{key:0,class:"fp-pdf-frame",src:ee.value,title:e.file.path},null,8,tue)):(b(),N("div",nue,[w("span",sue,O(C(n)("filePreview.pdfNoPreview")),1)]))])):p.value==="csv"?(b(),N("div",oue,[w("table",iue,[w("tbody",null,[(b(!0),N(Be,null,st(Y.value,(le,he)=>(b(),N("tr",{key:he,class:Pe(x(he+1)),"data-line":he+1},[w("th",null,O(he+1),1),(b(!0),N(Be,null,st(le,(j,ne)=>(b(),N("td",{key:ne},O(j),1))),128))],10,rue))),128))])])])):p.value==="image"?(b(),N("div",lue,[z.value?(b(),N("img",{key:0,src:z.value,alt:e.file.path,class:Pe(["fp-image",{actual:P.value==="actual"}])},null,10,aue)):(b(),N("div",cue,[w("span",uue,[ie(Ke,{name:"image-off",size:"lg"})]),w("span",due,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):p.value==="text"?(b(),N("div",fue,[w("div",hue,[(b(!0),N(Be,null,st(k.value,(le,he)=>(b(),N("div",{key:he,class:Pe(["fp-line-row",x(he+1)]),"data-line":he+1},[w("span",mue,O(he+1),1),w("span",{class:"fp-line-text",innerHTML:ce(le)},null,8,gue)],10,pue))),128))])])):(b(),N("div",vue,[w("div",yue,[w("span",kue,[ie(Ke,{name:"file-off",size:"lg"})]),w("span",bue,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):re("",!0)],512))}}),_ue=dt(xue,[["__scopeId","data-v-62bfaf2d"]]),wue={class:"tp"},Sue=Ve({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Lt(),i=Q(null);return Ge(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||vt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(b(),N("div",wue,[ie(ma,{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)]))}}),MC=dt(Sue,[["__scopeId","data-v-cf9c560b"]]),Cue={class:"ap"},Aue={key:0,class:"ap-type"},Mue={key:1,class:"ap-reason"},Eue={key:2,class:"ap-field"},Tue={class:"ap-field-body"},Nue={key:3,class:"ap-field"},Iue={class:"ap-field-body ap-live"},$ue={key:4,class:"ap-field"},Lue={class:"ap-field-body ap-progress"},Fue={key:0,class:"ap-call"},Oue={key:1,class:"ap-output"},Rue=["onClick"],Bue={key:5,class:"ap-field"},Due={class:"ap-field-body"},Pue=8,EC=5,TC=2,Hue=Ve({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Lt(),i=D(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=D(()=>(n.member.text??"").trimEnd());function l(m){const _=[];let k=null,g=0;for(const v of m)v.startsWith("Calling ")?(k={key:`g${g++}`,call:v,output:[]},_.push(k)):k?k.output.push(v):(k={key:`g${g++}`,call:"",output:[v]},_.push(k));return _}const a=D(()=>l(i.value)),c=Q(new Set);function u(m){return c.value.has(m)}function d(m){const _=new Set(c.value);_.has(m)?_.delete(m):_.add(m),c.value=_}function f(m){return m.output.length-EC-TC}function p(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const h=Q(null);return Ge(()=>i.value.length+r.value.length,()=>{const m=h.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||vt(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})},{immediate:!0}),(m,_)=>(b(),N("div",Cue,[ie(ma,{title:C(o)("common.preview"),subtitle:e.member.name,"close-label":C(o)("thinking.close"),onClose:_[0]||(_[0]=k=>s("close"))},{default:Ee(()=>[ie(wo,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Ye(O(p(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyEl",ref:h,class:"ap-body"},[e.member.subagentType?(b(),N("div",Aue,O(e.member.subagentType),1)):re("",!0),e.member.suspendedReason?(b(),N("div",Mue,O(e.member.suspendedReason),1)):re("",!0),e.member.prompt?(b(),N("div",Eue,[_[1]||(_[1]=w("span",{class:"ap-field-label"},"Task",-1)),w("div",Tue,O(e.member.prompt),1)])):re("",!0),r.value?(b(),N("div",Nue,[_[2]||(_[2]=w("span",{class:"ap-field-label"},"Output",-1)),w("div",Iue,O(r.value),1)])):re("",!0),a.value.length>0?(b(),N("div",$ue,[_[4]||(_[4]=w("span",{class:"ap-field-label"},"Progress",-1)),w("div",Lue,[(b(!0),N(Be,null,st(a.value,k=>(b(),N("div",{key:k.key,class:"ap-group"},[k.call?(b(),N("div",Fue,[_[3]||(_[3]=w("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Ye(" "+O(k.call),1)])):re("",!0),k.output.length>0?(b(),N("div",Oue,[k.output.length<=Pue||u(k.key)?(b(!0),N(Be,{key:0},st(k.output,(g,v)=>(b(),N("div",{key:v,class:"ap-out-line"},O(g),1))),128)):(b(),N(Be,{key:1},[(b(!0),N(Be,null,st(k.output.slice(0,EC),(g,v)=>(b(),N("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,Rue),(b(!0),N(Be,null,st(k.output.slice(-TC),(g,v)=>(b(),N("div",{key:"t"+v,class:"ap-out-line"},O(g),1))),128))],64))])):re("",!0)]))),128))])])):re("",!0),e.member.summary?(b(),N("div",Bue,[_[5]||(_[5]=w("span",{class:"ap-field-label"},"Result",-1)),w("div",Due,O(e.member.summary),1)])):re("",!0)],512)]))}}),Wue=dt(Hue,[["__scopeId","data-v-715bd93e"]]),zue={class:"diff-lines"},Uue={key:0,class:"hunk-text"},jue={class:"dl-gutter old"},que={class:"dl-gutter new"},Vue={class:"dl-sign"},Kue={class:"dl-text"},Gue=Ve({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(b(),N("div",zue,[(b(!0),N(Be,null,st(e.lines,(r,l)=>(b(),N("div",{key:l,class:Pe(["dl",s(r)])},[r.type==="hunk"?(b(),N("span",Uue,O(r.text),1)):(b(),N(Be,{key:1},[w("span",jue,O(t(r)),1),w("span",que,O(n(r)),1),w("span",Vue,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),w("span",Kue,O(r.text),1)],64))],2))),128))]))}}),h5=dt(Gue,[["__scopeId","data-v-2f6bc1cc"]]),Yue={class:"tdp"},Zue={class:"tdp-body"},Que={key:1,class:"tdp-output"},Xue={key:2,class:"tdp-empty"},Jue=Ve({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=Lt();return(o,i)=>(b(),N("div",Yue,[ie(ma,{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",Zue,[e.target.lines&&e.target.lines.length>0?(b(),xe(h5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(b(),N("div",Que,[(b(!0),N(Be,null,st(e.target.output,(r,l)=>(b(),N("div",{key:l},O(r),1))),128))])):(b(),N("div",Xue,O(C(s)("diff.noDiff")),1))])]))}}),ede=dt(Jue,[["__scopeId","data-v-76f2fbca"]]),tde={class:"sc"},nde={key:0,class:"sc-empty"},sde={key:2,class:"sc-loading","aria-hidden":"true"},ode={class:"sc-composer"},ide=["placeholder"],rde=["disabled"],lde=Ve({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Lt(),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="",vt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const k=u.value;k&&(k.scrollTop=k.scrollHeight)}const p=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((A,L)=>A+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${k.length}:${g.text.length}:${v}:${y}`});Ge(p,async()=>{!n.running&&!n.sending||(await vt(),f())});const h=D(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(k){k.key==="Enter"&&!k.shiftKey&&!k.isComposing&&(k.preventDefault(),d())}function _(){const k=c.value;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`)}return(k,g)=>(b(),N("div",tde,[ie(ma,{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(),N("div",nde,O(C(o)("sideChat.empty")),1)):(b(),xe(a5,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),h.value?(b(),N("div",sde,[ie(l5)])):re("",!0)],512),w("div",ode,[Fn(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:_,onKeydown:m},null,40,ide),[[po,a.value]]),ie(Xt,{text:C(o)("sideChat.send")},{default:Ee(()=>[w("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ie(Ke,{name:"arrow-right",size:"sm"})],8,rde)]),_:1},8,["text"])])]))}}),ade=dt(lde,[["__scopeId","data-v-9ee5df02"]]),cde={class:"changes-pane"},ude={class:"dv-path"},dde={class:"diff-head"},fde={class:"back-label"},hde={key:0,class:"empty-state"},pde={key:1,class:"dv-lines-wrap"},mde={key:2,class:"empty-state"},gde={class:"dv-change-count"},vde={class:"ch-head"},yde={class:"br-label"},kde={class:"br-name"},bde={key:0,class:"sync-info"},xde={key:0,class:"ahead"},_de={key:0,class:"behind"},wde={key:1,class:"empty-head"},Sde={key:0,class:"ch-list"},Cde=["onClick"],Ade={class:"fpath"},Mde={key:1,class:"ch-list ch-tree"},Ede={class:"tree-list"},Tde=["onClick"],Nde={class:"tree-name"},Ide=["onClick"],$de={class:"tree-name"},Lde={key:2,class:"empty-state"},Fde={key:3,class:"empty-state"},Ode=Ve({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Lt(),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),p=D(()=>s.fileDiff??[]),h=D(()=>s.fileDiffLoading===!0);function m(F){o("open",F)}function _(){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((B,R)=>B.path.localeCompare(R.path));for(const B of I){const R=B.path.split("/");let P=S;for(let W=0;W<R.length;W++){const U=R[W],Z=W===R.length-1,z=R.slice(0,W+1).join("/");let ee=P.children.find(de=>de.name===U&&de.kind===(Z?"file":"folder"));ee||(ee={name:U,path:z,kind:Z?"file":"folder",status:Z?B.status:void 0,children:[]},P.children.push(ee)),P=ee}}return S.children}const A=D(()=>y(s.changes)),L=Q(new Set);function $(F){return!L.value.has(F)}const x=D(()=>{const F=[];function S(I,B){for(const R of I)F.push({node:R,depth:B}),R.kind==="folder"&&$(R.path)&&S(R.children,B+1)}return S(A.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 T(F){return`${16+F*16}px`}return(F,S)=>(b(),N("div",cde,[f.value?(b(),N(Be,{key:0},[ie(ma,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ee(()=>[ie(Xt,{text:e.selectedDiffPath??""},{default:Ee(()=>[w("span",ude,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),w("div",dde,[e.hideBack?re("",!0):(b(),xe(Ut,{key:0,variant:"ghost",size:"sm",onClick:_},{default:Ee(()=>[S[0]||(S[0]=w("span",{"aria-hidden":"true"},"←",-1)),w("span",fde,O(C(n)("diff.back")),1)]),_:1}))]),h.value?(b(),N("div",hde,O(C(n)("diff.loading")),1)):p.value.length>0?(b(),N("div",pde,[ie(h5,{lines:p.value},null,8,["lines"])])):(b(),N("div",mde,O(C(n)("diff.noDiff")),1))],64)):(b(),N(Be,{key:1},[ie(ma,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:k},{default:Ee(()=>[w("span",gde,O(C(n)("diff.changeCount",{count:e.changes.length})),1),ie(ro,{"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",vde,[c.value?(b(),N(Be,{key:0},[w("span",yde,O(C(n)("diff.branch")),1),w("span",kde,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(b(),N("span",bde,[ie(Xt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(b(),N("span",xde,"↑"+O(e.gitInfo.ahead),1)):re("",!0)]),_:1},8,["text"]),ie(Xt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(b(),N("span",_de,"↓"+O(e.gitInfo.behind),1)):re("",!0)]),_:1},8,["text"])])):re("",!0)],64)):(b(),N("span",wde,O(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(b(),N("div",Sde,[(b(!0),N(Be,null,st(e.changes,I=>(b(),xe(Xt,{key:I.path,text:I.path},{default:Ee(()=>[w("button",{type:"button",class:"ch-row",onClick:B=>m(I.path)},[w("span",{class:Pe(["badge",i(I.status)])},O(l(I.status)),3),w("span",Ade,O(a(I.path)),1)],8,Cde)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(b(),N("div",Mde,[w("ul",Ede,[(b(!0),N(Be,null,st(x.value,({node:I,depth:B})=>(b(),N("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(b(),N("button",{key:0,type:"button",class:"tree-row tree-folder",style:Jt({paddingLeft:T(B)}),onClick:R=>E(I)},[ie(Ke,{class:"tree-icon",name:"folder-solid",size:"sm"}),w("span",Nde,O(I.name),1)],12,Tde)):(b(),xe(Xt,{key:1,text:I.path},{default:Ee(()=>[w("button",{type:"button",class:"tree-row tree-file",style:Jt({paddingLeft:T(B)}),onClick:R=>m(I.path)},[w("span",{class:Pe(["badge",i(I.status)])},O(l(I.status)),3),w("span",$de,O(I.name),1)],12,Ide)]),_:2},1032,["text"]))]))),128))])])):c.value?(b(),N("div",Lde,O(C(n)("diff.clean")),1)):(b(),N("div",Fde,O(C(n)("diff.empty")),1))],64))]))}}),Rde=dt(Ode,[["__scopeId","data-v-7778610a"]]);function Sk(e,t){let n=null;gn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,vt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),rs(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const Bde=["type","value","placeholder","disabled","readonly"],Dde=Ve({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const s=n,o=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(),N("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,Bde))}}),Ec=dt(Dde,[["__scopeId","data-v-340f0da2"]]),Pde={class:"search-wrap"},Hde={key:0,class:"tab-strip"},Wde={key:1,class:"state-row"},zde={key:2,class:"state-row unavail"},Ude={key:3,class:"model-list"},jde=["aria-selected","onClick","onMouseenter"],qde={class:"check"},Vde={class:"model-main"},Kde={class:"model-name"},Gde={class:"model-id"},Yde={key:0,class:"caps"},Zde={class:"model-provider"},Qde={class:"model-ctx"},Xde={key:0,class:"empty"},Jde={class:"footer-hint"},efe=Ve({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Lt(),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");Sk(c,a);const d=D(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const A of s.models)v.has(A.provider)||(v.add(A.provider),y.push({id:A.provider,label:A.provider}));return y}),f=D(()=>{const v=l.value.toLowerCase().trim(),y=s.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const L=(A.displayName??A.model).toLowerCase().includes(v),$=A.provider.toLowerCase().includes(v),x=A.id.toLowerCase().includes(v);return!v||L||$||x});return u.value!=="all"?y:y.sort((A,L)=>{const $=r(A.id)?1:0;return(r(L.id)?1:0)-$})}),p=D(()=>f.value),h=Q(0);Ge([l,u],()=>{h.value=0}),Ge(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ge(p,v=>{h.value=Math.min(h.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){o("close");return}if(v.key==="ArrowDown")v.preventDefault(),h.value=Math.min(h.value+1,p.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),h.value=Math.max(h.value-1,0);else if(v.key==="Enter"){const y=p.value[h.value];y&&o("select",y.id)}}gn(()=>{document.addEventListener("keydown",m)}),xn(()=>{document.removeEventListener("keydown",m)});function _(v){o("select",v)}function k(v){return p.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(b(),xe($r,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=A=>o("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:c,class:"mp"},[w("div",Pde,[ie(Ec,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(b(),N("div",Hde,[(b(!0),N(Be,null,st(d.value,A=>(b(),xe(Ut,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(A.id)},{default:Ee(()=>[Ye(O(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):re("",!0),e.loading?(b(),N("div",Wde,[ie(To,{size:"sm"}),w("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(b(),N("div",zde,[ie(Ke,{name:"alert-triangle",size:"lg"}),w("span",null,O(C(n)("model.unavailable")),1)])):(b(),N("div",Ude,[(b(!0),N(Be,null,st(p.value,A=>(b(),N("div",{key:A.id,class:Pe(["model-row",{"is-current":A.id===e.current,"is-selected":k(A)===h.value}]),role:"option","aria-selected":A.id===e.current,onClick:L=>_(A.id),onMouseenter:L=>h.value=k(A)},[w("span",qde,[A.id===e.current?(b(),xe(Ke,{key:0,name:"check",size:"sm"})):re("",!0)]),w("span",Vde,[w("span",Kde,O(A.displayName??A.model),1),w("span",Gde,O(A.id),1),A.capabilities&&A.capabilities.length>0?(b(),N("span",Yde,[(b(!0),N(Be,null,st(A.capabilities,L=>(b(),xe(wo,{key:L,variant:"info",size:"sm"},{default:Ee(()=>[Ye(O(L),1)]),_:2},1024))),128))])):re("",!0)]),w("span",Zde,O(A.provider),1),w("span",Qde,O(C(n)("model.contextSuffix",{size:Math.round(A.maxContextSize/1e3)})),1),ie(Pn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:xt(L=>o("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(b(),xe(Ke,{key:0,name:"star",size:"md"})):(b(),xe(Ke,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,jde))),128)),p.value.length===0&&!e.loading&&!e.unavailable?(b(),N("div",Xde,O(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):re("",!0)])),w("div",Jde,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),tfe=dt(efe,[["__scopeId","data-v-e93073d7"]]),nfe={key:0,class:"ui-field__label"},sfe={key:1,class:"ui-field__error"},ofe={key:2,class:"ui-field__hint"},ife=Ve({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(b(),N("div",{class:Pe(["ui-field",{"has-error":!!e.error}])},[e.label?(b(),N("label",nfe,O(e.label),1)):re("",!0),On(t.$slots,"default",{},void 0,!0),e.error?(b(),N("span",sfe,O(e.error),1)):e.hint?(b(),N("span",ofe,O(e.hint),1)):re("",!0)],2))}}),Wf=dt(ife,[["__scopeId","data-v-49bce958"]]),rfe=["value","disabled"],lfe=Ve({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function s(o){n("update:modelValue",o.target.value)}return(o,i)=>(b(),N("select",{class:Pe(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:s},[On(o.$slots,"default",{},void 0,!0)],42,rfe))}}),Nv=dt(lfe,[["__scopeId","data-v-92a040fd"]]),afe={class:"prov-list"},cfe={key:0,class:"state-row"},ufe={key:1,class:"state-row unavail"},dfe={key:2,class:"empty"},ffe={class:"prov-info"},hfe={class:"prov-type"},pfe={key:0,class:"prov-url"},mfe={class:"prov-meta"},gfe={key:0},vfe={class:"prov-actions"},yfe={key:0,class:"add-section"},kfe={key:0,class:"add-btns"},bfe={key:1,class:"add-form"},xfe=["value"],_fe={key:0,class:"add-error"},wfe={class:"form-btns"},Sfe={class:"footer-hint"},Cfe=Ve({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Lt(),{confirm:s}=Cl(),o=Q(null);Sk(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=Ns({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 p(){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 h(k){if(k.key==="Escape"){if(l.value){f();return}i("close")}}gn(()=>document.addEventListener("keydown",h)),xn(()=>document.removeEventListener("keydown",h));function m(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function _(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,g)=>(b(),xe($r,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:Ee(()=>[w("div",{ref_key:"dialogRef",ref:o,class:"pm"},[w("div",afe,[e.loading?(b(),N("div",cfe,[ie(To,{size:"sm"}),w("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(b(),N("div",ufe,[ie(Ke,{name:"alert-triangle",size:"md"}),w("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(b(),N("div",dfe,O(C(n)("providers.empty")),1)):(b(!0),N(Be,{key:3},st(e.providers,v=>(b(),N("div",{key:v.id,class:"prov-row"},[ie(Xt,{text:_(v.status)},{default:Ee(()=>[w("span",{class:Pe(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Jt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),w("div",ffe,[w("span",hfe,O(v.type),1),v.baseUrl?(b(),N("span",pfe,O(v.baseUrl),1)):re("",!0),w("span",mfe,[ie(wo,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Ye(O(v.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(b(),N("span",gfe," · "+O(C(n)("providers.modelCount",{count:v.models.length})),1)):re("",!0)])]),w("div",vfe,[ie(Xt,{text:C(n)("providers.refreshTitle",{type:v.type})},{default:Ee(()=>[ie(Ut,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:Ee(()=>[Ye(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ie(Xt,{text:C(n)("providers.deleteTitle",{type:v.type})},{default:Ee(()=>[ie(Ut,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:Ee(()=>[Ye(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?re("",!0):(b(),N("div",yfe,[l.value?(b(),N("div",bfe,[ie(Wf,{label:C(n)("providers.fieldType")},{default:Ee(()=>[ie(Nv,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:Ee(()=>[(b(),N(Be,null,st(u,v=>w("option",{key:v,value:v},O(v),9,xfe)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ie(Wf,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[ie(Ec,{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(Wf,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[ie(Ec,{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(Wf,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[ie(Ec,{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(),N("div",_fe,O(c.value),1)):re("",!0),w("div",wfe,[ie(Ut,{variant:"primary",size:"sm",onClick:p},{default:Ee(()=>[Ye(O(C(n)("providers.add")),1)]),_:1}),ie(Ut,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Ye(O(C(n)("common.cancel")),1)]),_:1})])])):(b(),N("div",kfe,[ie(Ut,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:Ee(()=>[ie(Ke,{name:"user",size:"sm"}),Ye(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),ie(Ut,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:Ee(()=>[ie(Ke,{name:"user",size:"sm"}),Ye(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),ie(Ut,{variant:"primary",size:"sm",onClick:d},{default:Ee(()=>[ie(Ke,{name:"plus",size:"sm"}),Ye(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),w("div",Sfe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Afe=dt(Cfe,[["__scopeId","data-v-fb6f1365"]]),Mfe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Efe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Tfe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},Q0=Ve({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(b(),N("svg",Mfe,[...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(),N("svg",Efe,[...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(),N("svg",Tfe,[...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)])]))}}),Nfe={key:0,class:"center-body"},Ife={class:"center-text"},$fe={key:1,class:"nb"},Lfe={class:"nb-lead"},Ffe=["href"],Ofe={class:"nb-or"},Rfe={class:"nb-fallback"},Bfe={class:"nb-fb-text"},Dfe=["href"],Pfe={class:"nb-code-row"},Hfe={class:"nb-code"},Wfe={class:"nb-status"},zfe={class:"nb-status-text"},Ufe={class:"nb-countdown"},jfe={key:2,class:"center-body"},qfe={class:"center-text success-text"},Vfe={class:"center-hint"},Kfe={class:"center-body"},Gfe={class:"center-text err-text"},Yfe={class:"center-hint"},Zfe={class:"actions"},Qfe={class:"center-body"},Xfe={class:"center-text warn-text"},Jfe={class:"center-hint"},ehe={class:"actions"},the=Ve({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Lt(),s=Q(!0),o=t,i=e,r=Q("starting"),l=Q(null),a=Q(0),c=Q(!1);let u=null,d=null;gn(async()=>{await f()}),xn(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",p(),h(y.interval)}function p(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function h(y){u&&clearTimeout(u),u=setTimeout(async()=>{const A=await i.onPollOAuthLogin();A?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):A?.status==="expired"||A?.status==="cancelled"?(m(),r.value="expired"):h(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function k(){!l.value||!await Zs(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 A=Math.floor(y/60),L=y%60;return`${A}:${String(L).padStart(2,"0")}`}return(y,A)=>(b(),xe($r,{open:s.value,"onUpdate:open":A[0]||(A[0]=L=>s.value=L),title:C(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:Ee(()=>[r.value==="starting"?(b(),N("div",Nfe,[ie(To,{size:"md"}),w("span",Ife,O(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(b(),N("div",$fe,[w("div",Lfe,O(C(n)("login.lead")),1),w("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Ye(O(C(n)("login.authorizeInBrowser"))+" ",1),ie(Ke,{name:"external-link",size:"sm"})],8,Ffe),w("div",Ofe,O(C(n)("login.orDivider")),1),w("div",Rfe,[w("div",Bfe,[Ye(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,Dfe),Ye(O(C(n)("login.fallbackSuffix")),1)]),w("div",Pfe,[w("span",Hfe,O(l.value.userCode),1),ie(Ut,{class:Pe(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:k},{default:Ee(()=>[c.value?(b(),N(Be,{key:0},[ie(Ke,{name:"check",size:"sm"}),Ye(" "+O(C(n)("login.copied")),1)],64)):(b(),N(Be,{key:1},[ie(Ke,{name:"copy",size:"sm"}),Ye(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),w("div",Wfe,[ie(To,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),w("span",zfe,O(C(n)("login.waitingAutoClose")),1),w("span",Ufe,O(v(a.value)),1)])])):r.value==="success"?(b(),N("div",jfe,[ie(Q0,{kind:"success"}),w("span",qfe,O(C(n)("login.success")),1),w("span",Vfe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(b(),N(Be,{key:3},[w("div",Kfe,[ie(Q0,{kind:"expired"}),w("span",Gfe,O(C(n)("login.expiredTitle")),1),w("span",Yfe,O(C(n)("login.expiredHint")),1)]),w("div",Zfe,[ie(Ut,{variant:"primary",onClick:_},{default:Ee(()=>[Ye(O(C(n)("login.retry")),1)]),_:1}),ie(Ut,{variant:"secondary",onClick:g},{default:Ee(()=>[Ye(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(b(),N(Be,{key:4},[w("div",Qfe,[ie(Q0,{kind:"error"}),w("span",Xfe,O(C(n)("login.errorTitle")),1),w("span",Jfe,O(C(n)("login.errorHint")),1)]),w("div",ehe,[ie(Ut,{variant:"primary",onClick:_},{default:Ee(()=>[Ye(O(C(n)("login.retry")),1)]),_:1}),ie(Ut,{variant:"secondary",onClick:g},{default:Ee(()=>[Ye(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):re("",!0)]),_:1},8,["open","title"]))}}),nhe=dt(the,[["__scopeId","data-v-b228800e"]]);function she(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function ohe(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function ihe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:s,activeRoot:o,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(s),a=new Map;for(const p of t)l.has(p.root)||a.has(p.root)||a.set(p.root,{...p});for(const p of n){const h=p.cwd;h&&(l.has(h)||a.has(h)||a.set(h,{id:p.workspaceId??h,root:h,name:she(h),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const p of n){const h=ohe(t,p);c.set(h,(c.get(h)??0)+1)}const u=[...new Set(t.filter(p=>!l.has(p.root)).map(p=>p.root))],d=[...a.keys()].filter(p=>!u.includes(p));d.sort((p,h)=>p.localeCompare(h));const f=[];for(const p of[...u,...d]){const h=a.get(p),m=c.get(h.id)??c.get(h.root)??0,_=r[h.id]===!1?m:Math.max(h.sessionCount,m);let k=h.branch;!k&&i&&o===h.root&&(k=i),f.push({...h,sessionCount:_,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=e.filter(o=>{const i=Date.parse(o.createdAt);return!Number.isNaN(i)&&i<n});return s.length>0?[...s,...t]:t}function lhe(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 ahe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function che(e){return ahe.has(e.type)}function uhe(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function dhe(e,t,n=uhe){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 p5=["blue","mono"],m5=["light","dark","system"],g5=14,fhe=12,hhe=20;function phe(){const e=ss(Ht.accent);return e&&p5.includes(e)?e:"blue"}function mhe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function ghe(){const e=ss(Ht.colorScheme);return e&&m5.includes(e)?e:"system"}function vhe(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 Ck(e){return Number.isFinite(e)?Math.min(hhe,Math.max(fhe,Math.round(e))):g5}function yhe(){const e=ss(Ht.uiFontSize);return e===null?g5:Ck(Number(e))}function khe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Ck(e)}px`)}const Ak=Q(ghe()),Mk=Q(phe()),Ek=Q(yhe());Ge(Ak,vhe,{immediate:!0});Ge(Mk,mhe,{immediate:!0});Ge(Ek,khe,{immediate:!0});function bhe(e){m5.includes(e)&&(Ak.value=e,ls(Ht.colorScheme,e))}function xhe(e){p5.includes(e)&&(Mk.value=e,ls(Ht.accent,e))}function _he(e){const t=Ck(e);Ek.value=t,ls(Ht.uiFontSize,String(t))}const whe=600,She=250,km=250,Che=1e3,Ahe=160,hp=Q(!1);let Jl=[],sa=null,pp=-km;function Mhe(){Jl=[],pp=-km,hp.value=!1,sa!==null&&(clearTimeout(sa),sa=null)}function Ehe(){hp.value=!0,sa!==null&&clearTimeout(sa),sa=setTimeout(()=>{sa=null,Jl=[],pp=-km,hp.value=!1},Che)}function The(e){if(e<=0)return;const t=Date.now();Jl.push({time:t,chars:e});const n=t-whe;if(Jl=Jl.filter(l=>l.time>=n),t-pp<km)return;pp=t;const s=Jl[0]?.time??t,o=Math.max(t-s,She);Jl.reduce((l,a)=>l+a.chars,0)/o*1e3>=Ahe&&Ehe()}function v5(){return{colorScheme:Ak,accent:Mk,uiFontSize:Ek,fastMoon:hp,setColorScheme:bhe,setAccent:xhe,setUiFontSize:_he,resetFastMoon:Mhe,recordMoonDelta:The}}function Nhe(e,t,n){return e==="idle"&&!t&&!n}function Tk(e,t){const n=ss(e);return n===null?t:n==="1"}const Nk=Q(Tk(Ht.notifyOnComplete,!0)),Ik=Q(Tk(Ht.notifyOnQuestion,!1)),$k=Q(Tk(Ht.notifyOnApproval,!1)),Lk=Q(typeof Notification<"u"?Notification.permission:"denied"),Ihe="/favicon.ico";async function Fk(e,t,n){if(!n){e.value=!1,ls(t,"0");return}if(typeof Notification>"u")return;let s=Notification.permission;if(s==="default")try{s=await Notification.requestPermission()}catch{}Lk.value=s,s==="granted"&&(e.value=!0,ls(t,"1"))}function $he(e){return Fk(Nk,Ht.notifyOnComplete,e)}function Lhe(e){return Fk(Ik,Ht.notifyOnQuestion,e)}function Fhe(e){return Fk($k,Ht.notifyOnApproval,e)}function Ok(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Ohe(e){return{title:Mn.global.t("settings.notifyTitle"),body:Ok(e,Mn.global.t("settings.notifyFallback"))}}function Rhe(e,t){return{title:Mn.global.t("settings.notifyQuestionTitle"),body:Ok(t,e,Mn.global.t("settings.notifyQuestionFallback"))}}function Bhe(e,t){return{title:Mn.global.t("settings.notifyApprovalTitle"),body:Ok(t,e,Mn.global.t("settings.notifyApprovalFallback"))}}function Rk(e,t,n,s){if(!e||typeof Notification>"u")return;const o=Notification.permission;if(o!=="denied"){if(o==="default"){Notification.requestPermission().then(i=>{Lk.value=i,i==="granted"&&NC(t,n,s)});return}NC(t,n,s)}}function NC(e,t,n){if(!e.isUserWatching)try{const s=new Notification(t.title,{body:t.body,tag:n,icon:Ihe});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function Dhe(e,t){Rk(Nk.value,t,Ohe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function Phe(e){Rk(Ik.value,e,Rhe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function Hhe(e){Rk($k.value,e,Bhe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function Whe(){return{notifyOnComplete:Nk,notifyOnQuestion:Ik,notifyOnApproval:$k,notifyPermission:Lk,setNotifyOnComplete:$he,setNotifyOnQuestion:Lhe,setNotifyOnApproval:Fhe,maybeNotifyCompletion:Dhe,maybeNotifyQuestion:Phe,maybeNotifyApproval:Hhe}}function zhe(){return ss(Ht.soundOnComplete)==="1"}const qc=Q(zhe());function Uhe(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let X0=null;function y5(){const e=Uhe();if(!e)return null;if(X0===null)try{X0=new e}catch{return null}return X0}function k5(){if(!qc.value)return;const e=y5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{mr("sound: audio context resumed",{state:e.state})},t=>{mr("sound: audio context resume rejected",{error:String(t)})})}let IC=!1;function jhe(){if(IC||typeof window>"u")return;IC=!0;const e=()=>{k5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}jhe();function qhe(e){qc.value=e,ls(Ht.soundOnComplete,e?"1":"0"),e&&k5()}function $C(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 Bk(){const e=y5();if(e===null){mr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){mr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{mr("sound: context resumed for next time",{state:e.state})},t=>{mr("sound: resume rejected",{error:String(t)})});return}try{$C(e,880,0,.16,.18),$C(e,1320,.1,.22,.16),mr("sound: chime scheduled",{state:e.state})}catch(t){mr("sound: failed to play",{error:String(t)})}}function Vhe(){qc.value&&Bk()}function Khe(){qc.value&&Bk()}function Ghe(){qc.value&&Bk()}function Yhe(){return{soundOnComplete:qc,setSoundOnComplete:qhe,maybePlayCompletionSound:Vhe,maybePlayQuestionSound:Khe,maybePlayApprovalSound:Ghe}}function LC(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const Zhe=1e3,Qhe=4096,FC=32*1024;function Xhe(e,t){let n=null,s;const o=new Set;async function i(f){try{const h=await mt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:LC(h,e.tasksBySession[f]??[])},await r(f,h)}catch{}}async function r(f,p){if(e.activeSessionId!==f)return;const h=p??e.tasksBySession[f]??[],m=mt(),_=new Map;if(await Promise.all(h.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:FC});y.outputPreview!==void 0&&_.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{o.add(g.id)}})),_.size===0)return;const k=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:k.map(g=>{const v=_.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const p=mt();let h;try{h=await p.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async v=>{const y=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!A)&&!(A&&(o.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await p.getTask(f,v.id,{withOutput:!0,outputBytes:y?Qhe:FC});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{A&&o.add(v.id)}}));const _=e.tasksBySession[f]??[],k=new Map(_.map(v=>[v.id,v])),g=h.map(v=>{const y=k.get(v.id),A=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:A?.preview??y?.outputPreview,outputBytes:A?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:LC(g,_)}}function a(f){n!==null&&s===f||(c(),s=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Zhe))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=Q(0);let d=null;return Ge(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ge(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const p=e.tasksBySession[f]??[];return{sid:f,hasRunning:p.some(h=>h.status==="running")}},({sid:f,hasRunning:p},h,m)=>{let _;p&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:D(()=>u.value),loadTasksForSession:i}}function Jhe(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 epe(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
299
+ `)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&Jhe(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 Iv="/sessions/";function OC(e){const{pathname:t}=e;if(!t.startsWith(Iv))return;const n=t.slice(Iv.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function tpe(e){return e===void 0||e.length===0?"/":`${Iv}${encodeURIComponent(e)}`}const npe=50,$v=5,spe=40402,ope=40410,ipe=40902,rpe=2e3;function J0(e){return Sr(e)&&e.code===ipe}const lpe=40904;function ape(e){return Sr(e)&&e.code===lpe}const Gl=Ns({}),zf=Ns({}),eg=Ns({}),Di=Ns(new Set),bm=new Map,ga=new Map,mp=new Map;let cpe=0;function upe(e){return{generation:bm.get(e)??0,pending:(ga.get(e)?.size??0)>0}}function Lv(e){const t=++cpe;bm.set(e,t);const n=ga.get(e)??new Set;return n.add(t),ga.set(e,n),t}function Fv(e,t){const n=ga.get(e);if(n===void 0||(n.delete(t),n.size>0))return;ga.delete(e);const s=mp.get(e);mp.delete(e),s?.()}function dpe(e){bm.delete(e),ga.delete(e),mp.delete(e)}function fpe(e,t){return!t.pending&&t.generation===(bm.get(e)??0)}function hpe(e,t){if((ga.get(e)?.size??0)===0){t();return}mp.set(e,t)}function ppe(e,t){const{t:n}=Mn.global,{confirm:s}=Cl(),{taskPoller:o,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:p,appendSession:h,forgetSession:m,setActiveSessionId:_,updateSessionMessages:k,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:A,hasLoadedMessages:L,refreshSessionStatus:$,persistSessionProfile:x,mergedWorkspaces:E,workspacesView:T,status:F,workspaceIdForSession:S,savePermissionToStorage:I,savePlanModeToStorage:B,saveSwarmModeToStorage:R,saveGoalModeToStorage:P,draftModes:W,saveUnread:U,saveActiveWorkspaceToStorage:Z,saveHiddenWorkspacesToStorage:z,goalErrorMessage:ee,resetFastMoon:de,initialized:J,connectIssue:Y,selectedDiffPath:X,fileDiffLines:fe,fileDiffLoading:ce}=t;async function We(te){if(e.messagesLoadingMoreBySession[te])return;const we=e.messagesBySession[te];if(!we||we.length===0)return;const Se=we[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[te]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[te]:!1};try{const De=await mt().listMessages(te,{beforeId:Se,pageSize:npe}),tt=[...De.items].reverse();k(te,ut=>[...tt,...ut]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[te]:De.hasMore}}catch(De){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[te]:!0},l("loadOlderMessages",De,{sessionId:te})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[te]:!1}}}function ge(te){o.loadTasksForSession(te),he(te),$(te),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,te)||r.loadSkillsForSession(te)}async function G(te){const we=e.activeSessionId;if(we){X.value=te,fe.value=[],ce.value=!0;try{const De=await mt().getFileDiff(we,te);if(X.value!==te)return;fe.value=epe(De.diff)}catch(Se){X.value===te&&(fe.value=[]),console.warn("[loadFileDiff] diff unavailable for",te,Se)}finally{X.value===te&&(ce.value=!1)}}}function le(){X.value=null,fe.value=[],ce.value=!1}async function he(te){try{const Se=await mt().getGitStatus(te);e.gitStatusBySession={...e.gitStatusBySession,[te]:Se}}catch{}}async function j(){try{const we=await mt().getAuth();return e.authReady=we.ready,e.defaultModel=we.defaultModel,e.managedProviderStatus=we.managedProvider?.status??null,Y.value=null,"proceed"}catch(te){return Sr(te)&&(te.code===401||te.code===r5)?(Y.value=null,"server-auth-required"):(Y.value=(te instanceof Error?te.message:String(te)).slice(0,140),"retry")}}async function ne(){let te=!0;for(;;){const we=await j();if(we!=="retry")return we;te&&(Y.value=null,te=!1),await new Promise(Se=>{setTimeout(Se,rpe)})}}async function ve(){try{const te=mt();e.config=await te.getConfig()}catch{}}async function ae(te){try{const Se=await mt().setConfig(te);return e.config=Se,e.defaultModel=Se.defaultModel??null,!0}catch(we){return l("setConfig",we),!1}}const ye=100,q=30,se=720*60*1e3;async function me(){const te=mt(),we=[];let Se;for(;;){const De=await te.listSessions({pageSize:ye,beforeId:Se,excludeEmpty:!0});if(we.push(...De.items),!De.hasMore||De.items.length===0)break;Se=De.items[De.items.length-1].id}return we}async function Te(te){const we=mt(),Se=[],De=Date.now(),tt=$t=>De-new Date($t.updatedAt).getTime();let ut,It=!1,Wt=!0;for(;;){let $t;try{$t=await we.listSessions({workspaceId:te,pageSize:$v,beforeId:ut,excludeEmpty:!0})}catch(Re){if(Wt)throw Re;break}if(It=$t.hasMore,$t.items.length===0)break;const ue=$t.items[$t.items.length-1],ke=tt(ue)>=se;if(!Wt&&ke){const Re=$t.items.findIndex(At=>tt(At)>=se),ft=Re>=0?Re+1:$t.items.length;Se.push(...$t.items.slice(0,ft)),It=$t.hasMore||ft<$t.items.length;break}if(Se.push(...$t.items),Wt=!1,!$t.hasMore||ke)break;ut=ue.id}return{workspaceId:te,page:{items:Se,hasMore:It}}}async function Me(){const te=e.workspaces;if(te.length===0){const It=await me().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,It}const we=await Promise.all(te.map(It=>Te(It.id).catch(()=>({workspaceId:It.id,page:{items:[],hasMore:!1}})))),Se=[],De={},tt={},ut={};for(const{workspaceId:It,page:Wt}of we)Se.push(...Wt.items),De[It]=Wt.hasMore,tt[It]=Wt.items.length>0?Wt.items[Wt.items.length-1].id:void 0,ut[It]=Math.max(Wt.items.length,$v);return e.sessionsHasMoreByWorkspace=De,e.sessionsCursorByWorkspace=tt,e.sessionsInitialCountByWorkspace=ut,e.sessionsFullyLoaded=!1,Se.sort((It,Wt)=>new Date(Wt.updatedAt).getTime()-new Date(It.updatedAt).getTime()),Se}async function $e(te){if(e.sessionsLoadingMoreByWorkspace[te]||e.sessionsHasMoreByWorkspace[te]===!1)return;const we=e.sessionsCursorByWorkspace[te];if(we!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[te]:!0};try{const Se=await mt().listSessions({workspaceId:te,pageSize:q,beforeId:we,excludeEmpty:!0}),De=new Set(e.sessions.map(ut=>ut.id)),tt=Se.items.filter(ut=>!De.has(ut.id));tt.length>0&&d([...e.sessions,...tt]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[te]:Se.items.length>0?Se.items[Se.items.length-1].id:we},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[te]:Se.hasMore}}catch(Se){l("loadMoreSessions",Se)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[te]:!1}}}}async function pe(){if(e.sessionsFullyLoaded)return;const te=await me().catch(()=>null);if(te===null)return;d(te),e.sessionsFullyLoaded=!0;const we={};for(const Se of e.workspaces)we[Se.id]=!1;e.sessionsHasMoreByWorkspace=we}async function Ie(){e.loading=!0;const te=!J.value;let we=!0;try{if(te&&await ne()==="server-auth-required"){we=!1;return}const Se=mt();await Promise.all([Se.getHealth().catch(()=>null),Se.getMeta().then($t=>{e.serverVersion=$t.serverVersion,e.availableOpenInApps=$t.openInApps,e.dangerousBypassAuth=$t.dangerousBypassAuth}).catch(()=>null),r.loadModels()]),te||await j(),await ve(),await Qe();const De=await Me();d(De);const tt=De[0],ut=e.activeWorkspaceId;!(ut!==null&&E.value.some($t=>$t.id===ut))&&tt&&_t(S(tt)),Dt();const Wt=typeof window<"u"?OC(window.location):void 0;!e.activeSessionId&&Wt!==void 0&&(e.sessions.some(ue=>ue.id===Wt)||await Wn(Wt))&&await Pt(Wt,{urlMode:"replace"}),!e.activeSessionId&&De.length>0&&await Pt(De[0].id,{urlMode:"replace"})}catch(Se){l("load",Se)}finally{e.loading=!1,we&&(J.value=!0)}}async function Qe(){try{const te=mt(),[we,Se]=await Promise.all([te.listWorkspaces().catch(()=>[]),te.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=lt(we),e.fsHome=Se.home||null,e.recentRoots=Se.recentRoots}catch{}}function lt(te){const we=xf();return Object.keys(we).length===0?te:te.map(Se=>{const De=we[Se.root];return De!==void 0?{...Se,name:De}:Se})}function _t(te){e.activeWorkspaceId=te,Z(te)}function St(te){_t(te);const we=e.sessions.filter(Se=>S(Se)===te);if(we.length>0){const Se=we[0];Se&&Se.id!==e.activeSessionId&&Pt(Se.id)}else _(void 0),Hn(void 0,"push")}function Tt(te){const we=xf()[te.root],Se=we!==void 0?{...te,name:we}:te;e.hiddenWorkspaceRoots.includes(Se.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(ut=>ut!==Se.root),z(e.hiddenWorkspaceRoots));const De=e.workspaces.findIndex(ut=>ut.id===Se.id||ut.root===Se.root);if(De===-1){e.workspaces=[Se,...e.workspaces];return}const tt=[...e.workspaces];tt[De]=Se,e.workspaces=tt}function Ct(te){if(te.type==="workspaceCreated"||te.type==="workspaceUpdated"){Tt(te.workspace);return}const we=e.workspaces.find(De=>De.id===te.workspaceId)?.root??te.root;if(we&&!e.hiddenWorkspaceRoots.includes(we)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,we],z(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(De=>De.id!==te.workspaceId&&De.root!==we),e.activeWorkspaceId===te.workspaceId||e.activeWorkspaceId===we){const De=T.value[0]?.id??null;if(e.activeWorkspaceId=De,De)Z(De);else try{Fc(Ht.activeWorkspace)}catch{}_(void 0),e.sessionLoading=!1,le(),Hn(void 0,"replace")}}function gt(){_(void 0),Hn(void 0,"push")}function nn(te){_t(te),gt(),le()}async function rn(te){const we=E.value.find(ue=>ue.id===te);if(!we)return null;const Se=mt();let De,tt=we.root;try{const ue=await Se.addWorkspace({root:we.root});De=ue.id,tt=ue.root,Tt(ue)}catch{}const ut=r.draftModel.value??void 0,It=await Se.createSession({workspaceId:De,cwd:tt,model:ut});r.draftModel.value=null;const Wt=ut!==void 0&&(!It.model||It.model.length===0)?{...It,model:ut}:It;p(Wt),_t(It.workspaceId??De??te),await Pt(It.id);const $t=It.id;return W.planMode&&(e.planModeBySession={...e.planModeBySession,[$t]:!0},B()),W.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[$t]:!0},R()),W.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[$t]:!0},P()),W.planMode=!1,W.swarmMode=!1,W.goalMode=!1,$t}async function Qn(te,we,Se){if(!Di.has(te)){Di.add(te);try{const De=await rn(te);if(!De)return;await wn(De,we,Se)}catch(De){l("startSessionAndSendPrompt",De)}finally{Di.delete(te)}}}async function Zt(te,we,Se){if(!Di.has(te)){Di.add(te);try{const De=await rn(te);if(!De)return;const tt=e.planModeBySession[De]??!1,ut=e.swarmModeBySession[De]??!1,It=e.sessions.find($t=>$t.id===De),Wt=(It?.model&&It.model.length>0?It.model:e.defaultModel)??void 0;await x({model:Wt,planMode:tt,swarmMode:ut,permissionMode:e.permission,thinking:an(Wt)},De),await r.activateSkill(we,Se,De)}catch(De){l("startSessionAndActivateSkill",De)}finally{Di.delete(te)}}}async function fn(te,we){if(!Di.has(te)){Di.add(te);try{const Se=await rn(te);if(!Se)return;await i.openSideChatOn(Se,we)}catch(Se){l("startSessionAndOpenSideChat",Se)}finally{Di.delete(te)}}}async function hn(te){const we=te.trim();if(!we)return!1;const Se=mt();try{const De=await Se.addWorkspace({root:we});return Tt(De),nn(De.id),!0}catch{return!1}}async function it(te){try{return await mt().browseFs(te)}catch{return{path:"",parent:null,entries:[]}}}async function zn(){try{return await mt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Hn(te,we){if(we==="none"||typeof window>"u"||!window.history)return;const Se=tpe(te);if(window.location.pathname!==Se)try{we==="push"?window.history.pushState(null,"",Se):window.history.replaceState(null,"",Se)}catch{}}async function Wn(te){try{const we=await mt().getSession(te);return e.sessions.some(Se=>Se.id===we.id)||h(we),!0}catch{return!1}}function Ze(){const te=OC(window.location);if(te===void 0){_(void 0);return}if(te!==e.activeSessionId){if(e.sessions.some(we=>we.id===te)){Pt(te,{urlMode:"none"});return}(async()=>{if(await Wn(te)){await Pt(te,{urlMode:"none"});return}const we=e.sessions[0];we?await Pt(we.id,{urlMode:"replace"}):(_(void 0),Hn(void 0,"replace"))})()}}let Xe=!1;function Dt(){Xe||typeof window>"u"||(Xe=!0,window.addEventListener("popstate",Ze))}async function Pt(te,we){const Se=L(te),De=!Se&&u.has(te);u.delete(te);try{Hn(te,we?.urlMode??"push"),e.sessionLoading=!Se&&!De,_(te),de(),e.unreadBySession[te]&&(e.unreadBySession={...e.unreadBySession,[te]:!1},U({[te]:!1})),le();const tt=e.sessions.find(ut=>ut.id===te);if(tt){const ut=S(tt);e.activeWorkspaceId!==ut&&_t(ut)}if(Se){if(await A(te)==="not-found")return}else if(await y(te)==="not-found")return;ge(te)}catch(tt){l("selectSession",tt,{sessionId:te})}finally{e.activeSessionId===te&&(e.sessionLoading=!1)}}function an(te){const we=te===void 0?void 0:r.models.value.find(Se=>Se.model===te||Se.id===te||Se.displayName===te);return Sa(we,e.thinking)}async function wn(te,we,Se){const De=Lv(te);c.add(te),e.sendingBySession={...e.sendingBySession,[te]:!0};const tt=g();try{const ut=mt(),It=[];we&&It.push({type:"text",text:we});for(const zt of Se??[])zt.kind==="video"?It.push({type:"video",source:{kind:"file",fileId:zt.fileId}}):It.push({type:"image",source:{kind:"file",fileId:zt.fileId}});if(It.length===0)return c.delete(te),e.sendingBySession={...e.sendingBySession,[te]:!1},!1;const Wt={id:tt,sessionId:te,role:"user",content:It,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(te,zt=>[...zt,Wt]);const $t=e.sessions.find(zt=>zt.id===te),ue=($t?.model&&$t.model.length>0?$t.model:e.defaultModel)??void 0,ke=e.planModeBySession[te]??!1,Re=e.swarmModeBySession[te]??!1,ft=e.goalModeBySession[te]??!1;if(ft&&we)try{await ut.updateSession(te,{goalObjective:we.trim()})}catch(zt){return l("createGoal",zt,{sessionId:te}),c.delete(te),e.sendingBySession={...e.sendingBySession,[te]:!1},k(te,Qt=>Qt.some(Rn=>Rn.id===tt)?Qt.filter(Rn=>Rn.id!==tt):Qt),!1}const At=await ut.submitPrompt(te,{content:It,model:ue,thinking:an(ue),permissionMode:e.permission,planMode:ke,swarmMode:Re});return ft&&(e.goalModeBySession={...e.goalModeBySession,[te]:!1},P()),e.promptIdBySession={...e.promptIdBySession,[te]:At.promptId},k(te,zt=>{const Qt=zt.findIndex(Ls=>Ls.id===tt);if(Qt===-1)return zt;const Rn=[...zt];return Rn[Qt]={...Rn[Qt],promptId:Rn[Qt].promptId??At.promptId},Rn}),v()?.bindNextPromptId(te,At.promptId),!0}catch(ut){return c.delete(te),e.sendingBySession={...e.sendingBySession,[te]:!1},k(te,It=>It.some(Wt=>Wt.id===tt)?It.filter(Wt=>Wt.id!==tt):It),l("sendPrompt",ut,{sessionId:te}),!1}finally{Fv(te,De)}}async function Xn(te,we){const Se=e.activeSessionId;if(Se){if(a.value!=="idle"||c.has(Se)){vn(te,we);return}await wn(Se,te,we)}}async function Ss(te,we){const Se=e.activeSessionId;if(!Se)return;const De=e.queuedBySession[Se]??[],tt=[],ut=[];for(const ft of De){const At=ft.text.trim();At&&tt.push(At),ft.attachments?.length&&ut.push(...ft.attachments)}const It=te.trim();if(It&&tt.push(It),we?.length&&ut.push(...we),tt.length===0&&ut.length===0)return;De.length>0&&(e.queuedBySession={...e.queuedBySession,[Se]:[]});const Wt=tt.join(`
300
+
301
+ `);if(a.value==="idle"&&!c.has(Se)){await wn(Se,Wt,ut);return}const $t=[];Wt&&$t.push({type:"text",text:Wt});for(const ft of ut)ft.kind==="video"?$t.push({type:"video",source:{kind:"file",fileId:ft.fileId}}):$t.push({type:"image",source:{kind:"file",fileId:ft.fileId}});const ue=g(),ke={id:ue,sessionId:Se,role:"user",content:$t,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(Se,ft=>[...ft,ke]);const Re=Lv(Se);try{const ft=mt(),At=e.sessions.find(Rn=>Rn.id===Se),zt=(At?.model&&At.model.length>0?At.model:e.defaultModel)??void 0,Qt=await ft.submitPrompt(Se,{content:$t,model:zt,thinking:an(zt),permissionMode:e.permission,planMode:e.planModeBySession[Se]??!1,swarmMode:e.swarmModeBySession[Se]??!1});if(k(Se,Rn=>{const Ls=Rn.findIndex(Em=>Em.id===ue);if(Ls===-1)return Rn;const Nl=[...Rn];return Nl[Ls]={...Nl[Ls],promptId:Nl[Ls].promptId??Qt.promptId},Nl}),Qt.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Se]:Qt.promptId},v()?.bindNextPromptId(Se,Qt.promptId);return}try{await ft.steerPrompts(Se,[Qt.promptId])}catch{}}catch(ft){k(Se,At=>At.filter(zt=>zt.id!==ue)),l("steer",ft,{sessionId:Se})}finally{Fv(Se,Re)}}async function as(te,we){try{const De=await mt().uploadFile({file:te,name:we});return{fileId:De.id,name:De.name,mediaType:De.mediaType}}catch(Se){return l("uploadImage",Se),null}}function vn(te,we){const Se=e.activeSessionId;if(!Se)return;const De=e.queuedBySession[Se]??[];e.queuedBySession={...e.queuedBySession,[Se]:[...De,{text:te,attachments:we}]}}function Ft(te){const we=c.delete(te);if(e.sendingBySession={...e.sendingBySession,[te]:!1},e.promptIdBySession[te]!==void 0){const De={...e.promptIdBySession};delete De[te],e.promptIdBySession=De}te===e.activeSessionId&&de();const Se=e.queuedBySession[te]??[];if(Se.length>0){const[De,...tt]=Se;e.queuedBySession={...e.queuedBySession,[te]:tt},De!==void 0&&wn(te,De.text,De.attachments).then(ut=>{if(!ut){const It=e.queuedBySession[te]??[];e.queuedBySession={...e.queuedBySession,[te]:[De,...It]}}})}return we}function Cs(te,we){we.inFlightTurn===null&&(we.status!=="idle"&&we.status!=="aborted"||Ft(te))}async function sn(){const te=e.activeSessionId;if(!te)return;const we=e.sessions.find(tt=>tt.id===te);let Se=e.promptIdBySession[te];if(Se===void 0){const tt=we?.currentPromptId;tt?.startsWith("prompt_")&&(Se=tt)}const De=mt();if(Se!==void 0)try{if((await De.abortPrompt(te,Se)).aborted)return;const ut={...e.promptIdBySession};delete ut[te],e.promptIdBySession=ut}catch(tt){if(Sr(tt)&&tt.code===spe){const ut={...e.promptIdBySession};delete ut[te],e.promptIdBySession=ut}else{l("abortCurrentPrompt",tt,{sessionId:te});return}}try{await De.abortSession(te)}catch(tt){l("abortCurrentPrompt",tt,{sessionId:te})}}function Xs(te,we){const Se=e.approvalsBySession[te]??[];e.approvalsBySession={...e.approvalsBySession,[te]:Se.filter(De=>De.approvalId!==we)}}function cs(te,we){const Se=e.questionsBySession[te]??[];e.questionsBySession={...e.questionsBySession,[te]:Se.filter(De=>De.questionId!==we)}}async function No(te,we){const Se=e.activeSessionId;if(Se&&!zf[te]){zf[te]=!0;try{const De=mt(),tt={decision:we.decision,scope:we.scope,feedback:we.feedback,selectedLabel:we.selectedLabel};await De.respondApproval(Se,te,tt),Xs(Se,te)}catch(De){J0(De)?Xs(Se,te):l("respondApproval",De,{sessionId:Se})}finally{delete zf[te]}}}async function Zo(te,we){const Se=e.activeSessionId;if(Se&&!Gl[te]){Gl[te]="answer";try{await mt().respondQuestion(Se,te,we),cs(Se,te)}catch(De){J0(De)?cs(Se,te):l("respondQuestion",De,{sessionId:Se})}finally{delete Gl[te]}}}async function As(te){const we=e.activeSessionId;if(we&&!Gl[te]){Gl[te]="dismiss";try{await mt().dismissQuestion(we,te),cs(we,te)}catch(Se){J0(Se)?cs(we,te):l("dismissQuestion",Se,{sessionId:we})}finally{delete Gl[te]}}}async function Qo(te){const we=e.activeSessionId;if(we&&!eg[te]){eg[te]=!0;try{await mt().cancelTask(we,te);const De=e.tasksBySession[we]??[];e.tasksBySession={...e.tasksBySession,[we]:De.map(tt=>tt.id===te?{...tt,status:"cancelled"}:tt)}}catch(Se){ape(Se)||l("cancelTask",Se,{sessionId:we})}finally{delete eg[te]}}}function jt(te){const we=e.activeSessionId;we?(e.planModeBySession={...e.planModeBySession,[we]:te},B(),x({planMode:te})):W.planMode=te}function Xo(){const te=e.activeSessionId,we=te?e.planModeBySession[te]??!1:W.planMode;jt(!we)}function Io(te){const we=e.activeSessionId;we?(e.swarmModeBySession={...e.swarmModeBySession,[we]:te},R(),x({swarmMode:te})):W.swarmMode=te}async function mo(){const te=e.activeSessionId,Se=!(te?e.swarmModeBySession[te]??!1:W.swarmMode);Se&&e.permission==="manual"&&!await s({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Io(Se)}function Jn(te){const we=e.activeSessionId;we?(e.goalModeBySession={...e.goalModeBySession,[we]:te},P()):W.goalMode=te}function os(){const te=e.activeSessionId,we=te?e.goalModeBySession[te]??!1:W.goalMode;Jn(!we)}async function Yi(te){const we=te.trim();if(!we||e.permission==="manual"&&!await s({title:n("workspace.goalStartConfirm",{objective:we}),variant:"primary"}))return;let Se=e.activeSessionId;if(!Se){const De=e.activeWorkspaceId,tt=De&&T.value.some(ut=>ut.id===De)?De:T.value[0]?.id??null;if(!tt)return;try{Se=await rn(tt)??void 0}catch(ut){l("createGoal",ut);return}if(!Se)return}try{await mt().updateSession(Se,{goalObjective:we})}catch(De){l("createGoal",De,{sessionId:Se,message:ee(De)});return}e.goalModeBySession[Se]&&(e.goalModeBySession={...e.goalModeBySession,[Se]:!1},P()),e.activeSessionId===Se?await Xn(we):await wn(Se,we)}function Is(te){const we=e.activeSessionId;we&&Promise.resolve(mt().updateSession(we,{goalControl:te})).catch(Se=>{l("controlGoal",Se,{sessionId:we,message:ee(Se)})})}function Zi(te){e.permission=te,I(te),x({permissionMode:te})}function $s(te){const we=[...e.warnings];we.splice(te,1),e.warnings=we}async function us(te,we){try{await mt().updateSession(te,{title:we}),f(te,De=>({...De,title:we}))}catch(Se){l("renameSession",Se,{sessionId:te})}}async function Us(te,we){const Se=e.workspaces.find(tt=>tt.id===te)?.root,De=()=>{e.workspaces=e.workspaces.map(tt=>tt.id===te?{...tt,name:we}:tt)};try{if(await mt().updateWorkspace(te,{name:we}),Se!==void 0){const tt=xf();Se in tt&&(delete tt[Se],Ox(tt))}De()}catch(tt){if(Se!==void 0&&Sr(tt)&&tt.code===ope){Ox({...xf(),[Se]:we}),De();return}l("renameWorkspace",tt)}}async function Un(te){const we=e.workspaces.find(ut=>ut.id===te)?.root??E.value.find(ut=>ut.id===te)?.root??te,Se=e.activeSessionId?e.sessions.find(ut=>ut.id===e.activeSessionId):void 0,De=e.activeWorkspaceId===te||e.activeWorkspaceId===we,tt=!!(Se&&(Se.cwd===we||Se.workspaceId===te||S(Se)===te));we&&!e.hiddenWorkspaceRoots.includes(we)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,we],z(e.hiddenWorkspaceRoots));try{await mt().deleteWorkspace(te)}catch{}if(e.workspaces=e.workspaces.filter(ut=>ut.id!==te&&ut.root!==we),De||tt){const ut=T.value[0]?.id??null;if(e.activeWorkspaceId=ut,ut)Z(ut);else try{Fc(Ht.activeWorkspace)}catch{}}(De||tt)&&(_(void 0),e.sessionLoading=!1,le(),Hn(void 0,"replace"))}async function $o(te){try{await mt().archiveSession(te),m(te),i.clearSideChatForSession(te);const{[te]:Se,...De}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=De,e.activeSessionId===te){const tt=e.sessions[0];tt?await Pt(tt.id,{urlMode:"replace"}):(_(void 0),Hn(void 0,"replace"))}}catch(we){l("archiveSession",we,{sessionId:te})}}async function Jo(te){try{const we=await mt().restoreSession(te);return p(we),!0}catch(we){return l("restoreSession",we,{sessionId:te}),!1}}function ks(te){return mt().listSessions({archivedOnly:!0,beforeId:te?.beforeId,pageSize:te?.pageSize??50})}async function jn(){try{await mt().logout(),await j(),await Ie()}catch(te){l("logout",te)}}function ds(te){const we=e.activeSessionId;we&&mt().compactSession(we,te).catch(Se=>{l("compact",Se,{sessionId:we})})}async function ct(te){const we=te??e.activeSessionId;if(we)try{const Se=await mt().forkSession(we);p(Se),await Pt(Se.id)}catch(Se){l("fork",Se,{sessionId:we})}}async function be(te=1){const we=e.activeSessionId;if(!we)return null;const Se=(()=>{const De=e.messagesBySession[we]??[];for(let tt=De.length-1;tt>=0;tt--){const ut=De[tt];if(ut.role==="user"&&!(ut.metadata?.origin&&ut.metadata.origin.kind!=="user"))return ut.content.filter(It=>It.type==="text").map(It=>It.text).join(`
302
+ `)}return null})();try{return await mt().undoSession(we,te),await y(we),Se}catch(De){return l("undo",De,{sessionId:we}),null}}function Fe(te){const we=e.activeSessionId;if(!we)return;const Se=e.queuedBySession[we]??[];if(te<0||te>=Se.length)return;const De=[...Se];De.splice(te,1),e.queuedBySession={...e.queuedBySession,[we]:De}}function Vt(te,we){const Se=e.activeSessionId;if(!Se)return;const De=e.queuedBySession[Se]??[];if(te===we||te<0||te>=De.length||we<0||we>=De.length)return;const tt=[...De],[ut]=tt.splice(te,1);ut!==void 0&&(tt.splice(we,0,ut),e.queuedBySession={...e.queuedBySession,[Se]:tt})}async function Lo(te){const we=e.activeSessionId;if(!we)return[];try{return(await mt().listDirectory(we,{path:te,includeGitStatus:!0})).items}catch{return[]}}async function qe(te){const we=e.activeSessionId;if(!we)return null;try{const De=await mt().readFile(we,{path:te});return{path:De.path,content:De.content,encoding:De.encoding,mime:De.mime,languageId:De.languageId,isBinary:De.isBinary,size:De.size,lineCount:De.lineCount}}catch{return null}}const nt=10485760;function ot(te){const we=e.activeSessionId;return we?mt().getFileDownloadUrl(we,te):null}async function Rt(te,we){const Se=e.activeSessionId;if(!Se)return!1;try{return await mt().openFile(Se,{path:te,line:we}),!0}catch(De){return l("openFile",De,{sessionId:Se}),!1}}async function Fo(te){const we=e.activeSessionId;if(!we)return;const Se=F.value.cwd||".";try{await mt().openInApp(we,te,Se)}catch(De){l("openInApp",De,{sessionId:we})}}async function ei(te){const we=e.activeSessionId;if(!we)return!1;try{return await mt().revealFile(we,{path:te}),!0}catch(Se){return l("revealFile",Se,{sessionId:we}),!1}}async function ki(te){if(/^(https?:|data:|blob:)/i.test(te))return te;const we=e.activeSessionId;if(!we)return te;let Se=te;if(Se.startsWith("/")){const De=e.sessions.find(tt=>tt.id===we)?.cwd;if(De&&(Se===De||Se.startsWith(De.endsWith("/")?De:`${De}/`))){if(Se=Se.slice(De.length).replace(/^\//,""),!Se)return te}else return te}try{const tt=await mt().readFile(we,{path:Se,length:nt});return!tt.isBinary||tt.encoding!=="base64"||tt.truncated?te:`data:${tt.mime};base64,${tt.content}`}catch{return te}}async function Tl(te){const we=e.activeSessionId;if(!we)return[];try{return(await mt().searchFiles(we,{query:te,limit:20})).items.map(tt=>({path:tt.path,name:tt.name}))}catch{return[]}}return{loadFileDiff:G,clearFileDiff:le,loadGitStatus:he,checkAuth:j,loadConfig:ve,updateConfig:ae,listAllSessionsGlobal:me,load:Ie,loadWorkspaces:Qe,loadMoreSessions:$e,loadAllSessions:pe,selectWorkspace:_t,openWorkspace:St,upsertWorkspacePreserveOrder:Tt,applyWorkspaceEvent:Ct,clearActiveSession:gt,openWorkspaceDraft:nn,startSessionAndSendPrompt:Qn,startSessionAndActivateSkill:Zt,startSessionAndOpenSideChat:fn,addWorkspaceByPath:hn,browseFs:it,getFsHome:zn,writeSessionUrl:Hn,fetchSessionIntoList:Wn,onSessionRoutePopState:Ze,bindSessionRoute:Dt,selectSession:Pt,submitPromptInternal:wn,finishPromptLocal:Ft,localTurnStartState:upe,isLocalTurnSnapshotCurrent:fpe,afterLocalTurnStartsSettle:hpe,handleSessionSnapshot:Cs,sendPrompt:Xn,steerPrompt:Ss,uploadImage:as,enqueue:vn,unqueue:Fe,reorderQueue:Vt,abortCurrentPrompt:sn,respondApproval:No,respondQuestion:Zo,dismissQuestion:As,pendingQuestionActions:Gl,pendingApprovalActions:zf,cancelTask:Qo,setPlanMode:jt,togglePlanMode:Xo,setSwarmMode:Io,toggleSwarmMode:mo,setGoalMode:Jn,toggleGoalMode:os,createGoal:Yi,controlGoal:Is,setPermission:Zi,dismissWarning:$s,renameSession:us,renameWorkspace:Us,deleteWorkspace:Un,archiveSession:$o,restoreSession:Jo,loadArchivedSessions:ks,logout:jn,compact:ds,forkSession:ct,undo:be,listDir:Lo,readFileContent:qe,getFileDownloadUrl:ot,openWorkspaceFile:Rt,openInApp:Fo,revealWorkspaceFile:ei,resolveImageUrl:ki,searchFiles:Tl,loadOlderMessages:We,refreshSessionSidecars:ge,isStartingFirstPrompt:()=>Di.size>0}}const b5=Ht.starredModels;function mpe(){try{const e=ss(b5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function gpe(e){try{ls(b5,JSON.stringify(e))}catch{}}function vpe(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Q([]),d=Q(mpe()),f=Q({}),p=Q({}),h=Q([]),m=Q(null);function _(z){if(!(z==null||z.length===0))return u.value.find(ee=>ee.id===z)??u.value.find(ee=>ee.model===z)}function k(){const z=e.activeSessionId?e.sessions.find(de=>de.id===e.activeSessionId):void 0,ee=z===void 0?m.value??e.defaultModel:z.model||e.defaultModel;return _(ee)?.id??ee??void 0}function g(){return _(k())}function v(z){const ee=Sa(g(),z);return e.thinking=ee,l(ee),ee}async function y(z){try{const de=await mt().listSkills(z);f.value={...f.value,[z]:de}}catch{}}async function A(z){try{const de=await mt().listSkillsForWorkspace(z);p.value={...p.value,[z]:de}}catch{}}async function L(){try{const z=mt();u.value=await z.listModels(),v(e.thinking)}catch(z){n("loadModels",z)}}async function $(){try{const z=await mt().refreshOAuthProviderModels();for(const ee of z.failed)n("refreshOAuthProviderModels",new Error(ee.reason),{message:ee.provider})}catch{}}async function x(){try{const z=mt();h.value=await z.listProviders()}catch(z){n("loadProviders",z)}}async function E(z){const ee=e.activeSessionId,de=_(z),J=e.thinking,Y=ee?e.sessions.find(ce=>ce.id===ee)?.model:void 0,X=k()!==(de?.id??z),fe=aie(de,J,X);if(!ee)return m.value=z,v(fe),!0;a(ee,ce=>({...ce,model:z})),fe!==J&&(e.thinking=fe,l(fe));try{await mt().updateSession(ee,{model:z,thinking:fe!==J?fe:void 0})}catch(ce){return a(ee,We=>({...We,model:Y??We.model})),fe!==J&&(e.thinking=J,l(J)),n("setModel",ce,{sessionId:ee}),!1}return await s(ee),!0}function T(z){const ee=new Set(d.value);ee.has(z)?ee.delete(z):ee.add(z),d.value=Array.from(ee),gpe(d.value)}async function F(z,ee,de){const J=de??e.activeSessionId;if(!J)return;const Y=i.value==="idle"&&!r.has(J),X=`msg_skill_opt_${Date.now().toString(36)}`,fe=Y?Lv(J):void 0;if(Y){r.add(J),e.sendingBySession={...e.sendingBySession,[J]:!0};const ce={id:X,sessionId:J,role:"user",content:[{type:"text",text:`/${z}${ee?` ${ee}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:z,skillArgs:ee}}};c(J,We=>[...We,ce])}try{await mt().activateSkill(J,z,ee)}catch(ce){Y&&(r.delete(J),e.sendingBySession={...e.sendingBySession,[J]:!1},c(J,We=>We.filter(ge=>ge.id!==X))),n("activateSkill",ce,{sessionId:J})}finally{fe!==void 0&&Fv(J,fe)}}async function S(z){try{await mt().addProvider(z),await Promise.all([x(),L()])}catch(ee){n("addProvider",ee)}}async function I(z){try{await mt().deleteProvider(z),await Promise.all([x(),L()])}catch(ee){n("deleteProvider",ee)}}async function B(z){try{const ee=await mt().refreshProvider(z);for(const de of ee.failed)n("refreshProvider",new Error(de.reason),{message:de.provider});await Promise.all([x(),L()])}catch(ee){n("refreshProvider",ee)}}async function R(){try{const z=await mt().refreshAllProviders();for(const ee of z.failed)n("refreshAllProviders",new Error(ee.reason),{message:ee.provider});await Promise.all([x(),L()])}catch(z){n("refreshAllProviders",z)}}async function P(){try{return await mt().startOAuthLogin()}catch{return null}}async function W(){try{return await mt().pollOAuthLogin()}catch{return null}}async function U(){try{await mt().cancelOAuthLogin()}catch{}}function Z(z){const ee=v(z);o({thinking:ee})}return{models:u,starredModelIds:d,providers:h,draftModel:m,skillsBySession:f,skillsByWorkspace:p,loadSkillsForSession:y,loadSkillsForWorkspace:A,loadModels:L,refreshOAuthProviderModels:$,loadProviders:x,setModel:E,toggleStarModel:T,activateSkill:F,addProvider:S,deleteProvider:I,refreshProvider:B,refreshAllProviders:R,startOAuthLogin:P,pollOAuthLogin:W,cancelOAuthLogin:U,setThinking:Z}}const x5="kimiWeb.compaction",ype=/^read[_-]?media(?:file)?$/i,kpe=/^data:([^;]+);base64,(.*)$/s,bpe=/^<(image|video|audio)\s+path="([^"]+)">$/,xpe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,_pe=/Mime type:\s*([^.\s]+)/i,wpe=/Size:\s*(\d+)\s*bytes/i,Spe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Cpe="<system>Image compressed to fit model limits:",Ape=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function Mpe(e){return e.includes(Cpe)?e.replace(Ape,""):e}function Epe(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function Tpe(e){const t=xpe.exec(e.trim());return t?{kind:t[1],path:Epe(t[2])}:null}const Npe=/^f_[A-Za-z0-9]{10,}$/;function Ipe(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),s=n>0?t.slice(0,n):t;return Npe.test(s)?s:void 0}function $pe(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 Lpe(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 Fpe(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 Ope(e,t){if(!ype.test(e))return;const n=Lpe(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 p=d.text,h=bpe.exec(p);h&&(o=h[1],s=h[2]);const m=_pe.exec(p);m?.[1]&&(i=m[1]);const _=wpe.exec(p);_?.[1]&&(r=Number(_[1]));const k=Spe.exec(p);k?.[1]&&k[2]&&(l=`${k[1]}x${k[2]}`);continue}const f=Fpe(d);f&&(a=f)}if(a===null)return;const c=kpe.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=$pe(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Rpe(e){if(e!=null){if(typeof e=="string")return e.split(`
303
+ `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
304
+ `));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
305
+ `)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
306
+ `)):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 Bpe(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 Dpe(e,t){const n=e.split(`
307
+ `),s=t.split(`
308
+ `),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 Ppe(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:Dpe(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 Hpe(e){const t=`<prompt>
309
+ `,n=`
310
+ </prompt>`,s=e.indexOf(t),o=e.lastIndexOf(n);return s>=0&&o>=s+t.length?e.slice(s+t.length,o):Wpe(e)}function Wpe(e){const t=e.split(`
311
+ `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
312
+ `):e}function zpe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Upe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
313
+ `);return Hpe(t)}function jpe(e,t){const n=e.metadata?.origin??{},s=Upe(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 qpe(e,t,n){const{text:s,cron:o}=jpe(e,n);return{id:e.id,role:"cron",no:t,text:s,createdAt:e.createdAt,cron:o}}function Vpe(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 Kpe(e){return e.metadata?.origin?.kind==="compaction_summary"}function Gpe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Ype(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 _5(e,t,n,s=!0,o={}){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);let a=null;function c(f=!1){if(!a)return;const p=a;if(a=null,!f||!s)for(let h=0;h<p.tools.length;h++){const m=p.tools[h];if(m.status!=="running")continue;const _={...m,status:"ok"};p.tools[h]=_;const k=p.blocks.find(g=>g.kind==="tool"&&g.tool.id===_.id);k&&k.kind==="tool"&&(k.tool=_)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
314
+ `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
315
+ `):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(f,p){for(const h of p)if(h.type==="text"){if(h.text){f.textParts.push(h.text);const m=f.blocks.at(-1);m&&m.kind==="text"?m.text+=`
316
+ `+h.text:f.blocks.push({kind:"text",text:h.text})}}else if(h.type==="thinking"){if(h.thinking){f.thinkingParts.push(h.thinking);const m=f.blocks.at(-1);m&&m.kind==="thinking"?m.thinking+=`
317
+ `+h.thinking:f.blocks.push({kind:"thinking",thinking:h.thinking})}}else if(h.type==="toolUse"){const m=l.get(h.toolCallId),_={id:h.toolCallId,name:h.toolName,arg:typeof h.input=="string"?h.input:JSON.stringify(h.input),status:"running",output:h.outputLines,planPath:h.toolName==="ExitPlanMode"?o[h.toolCallId]?.path:void 0};f.tools.push(_),f.blocks.push({kind:"tool",tool:_}),m&&(f.approval=Ppe(m),f.approvalId=m.approvalId)}else if(h.type==="toolResult"){const m=f.tools.findIndex(_=>_.id===h.toolCallId);if(m!==-1){const _=f.tools[m],k={..._,status:h.isError?"error":"ok",output:Rpe(h.output),media:h.isError?void 0:Ope(_.name,h.output)};k.name==="ExitPlanMode"&&!k.planPath&&(k.planPath=Ype(k.output)),f.tools[m]=k;const g=f.blocks.find(v=>v.kind==="tool"&&v.tool.id===h.toolCallId);g&&g.kind==="tool"&&(g.tool=k)}}}function d(f){if(f.type==="image"||f.type==="video"){const p=f.type,h=f.source;if(h.kind==="url")return{url:h.url,kind:p};if(h.kind==="base64")return{url:`data:${h.mediaType};base64,${h.data}`,kind:p};if(h.kind==="file"&&n)return{url:n(h.fileId),kind:p,fileId:h.fileId}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image",fileId:f.fileId};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video",fileId:f.fileId}}}for(const f of e){if(f.role==="system")continue;if(Kpe(f)){c();const k=f.metadata?.[x5];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(g=>g.type==="text").map(g=>g.text).join(`
318
+ `),compaction:{trigger:k?.trigger,tokensBefore:k?.tokensBefore,tokensAfter:k?.tokensAfter}});continue}if(f.role==="user"){const k=zpe(f);if(c(),k!==void 0){i.push(qpe(f,r++,k));continue}if(!Vpe(f))continue;const g=f.metadata?.origin,v=g?.kind==="skill_activation"&&g?.trigger==="user-slash",y=g?.kind==="plugin_command"&&g?.trigger==="user-slash",A=[],L=[];for(const $ of f.content){if($.type==="text")if(v)A.push(g.skillArgs??"");else if(y)A.push(g.commandArgs??"");else{const E=Tpe($.text);if(E&&(E.kind==="video"||E.kind==="image")&&n){const F=Ipe(E.path);if(F){L.push({url:n(F),kind:E.kind,alt:F,fileId:F});continue}}const T=Mpe($.text);if(T!==$.text&&T.trim().length===0)continue;A.push(T)}const x=d($);x&&L.push({url:x.url,kind:x.kind,alt:$.type==="file"?$.name:void 0,fileId:x.fileId})}i.push({id:f.id,role:"user",no:r++,text:A.join(`
319
+ `),images:L.length>0?L:void 0,skillActivation:v?{name:g.skillName,args:g.skillArgs}:void 0,pluginCommand:y?{pluginId:g.pluginId,commandName:g.commandName,args:g.commandArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){a&&u(a,f.content);continue}const p=f.promptId;Gpe(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:f.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const m=a;if(m===null)continue;const _=JSON.stringify(f.content);m.promptId!==void 0&&m.seenSigs.has(_)||(m.seenSigs.add(_),u(m,f.content))}return c(!0),i}function Zpe(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 T=r.value[E];return T?{parentId:E,agentId:T.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(T=>T.id===E.agentId&&T.status==="running"):!1}),f=D(()=>{const E=l.value;if(!E)return[];const T=e.sideChatMessagesByAgent[E.agentId]??[];return _5(T,[],F=>mt().getFileUrl(F),d.value)});function p(E,T){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:T(e.sideChatMessagesByAgent[E]??[])}}function h(E,T){p(E,F=>[...F,T])}function m(E){p(E,T=>{const F=[...T].reverse().findIndex(I=>I.role==="user");if(F===-1)return T;const S=T.length-1-F;return T.filter((I,B)=>B!==S)})}function _(E,T){p(E,F=>{const S=[...F];for(let I=S.length-1;I>=0;I-=1){const B=S[I];if(B.role==="user")return S[I]={...B,promptId:B.promptId??T},S}return F})}function k(E,T,F){F&&p(E,S=>{const I=S.at(-1);if(I?.role==="assistant"){const B=I.content[0],R=B?.type==="text"?B.text:"";return[...S.slice(0,-1),{...I,content:[{type:"text",text:`${R}${F}`}]}]}return[...S,{id:s(),sessionId:T,role:"assistant",content:[{type:"text",text:F}],createdAt:new Date().toISOString()}]})}function g(E,T,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,T,F)}async function v(E){const T=e.activeSessionId;T&&await y(T,E)}async function y(E,T){if(!r.value[E]){let F;try{({agentId:F}=await mt().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)}T&&T.trim()&&await A(E,T.trim())}async function A(E,T){const F=r.value[E],S=T.trim();if(!F||!S)return;const I=E,B=F.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[B]:!0};const R={id:s(),sessionId:I,role:"user",content:[{type:"text",text:S}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};h(B,R);try{const P=e.sessions.find(z=>z.id===I),W=(P?.model&&P.model.length>0?P.model:e.defaultModel)??void 0,U=W===void 0?void 0:t.models().find(z=>z.model===W||z.id===W||z.displayName===W),Z=await mt().submitPrompt(I,{content:[{type:"text",text:S}],agentId:B,model:W,thinking:Sa(U,e.thinking),permissionMode:e.permission,planMode:e.planModeBySession[I]??!1,swarmMode:e.swarmModeBySession[I]??!1});_(B,Z.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],Z.userMessageId]}}catch(P){n("sendSideChatPrompt",P,{sessionId:I}),m(B),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[B]:!1}}}function L(){const E=e.activeSessionId;if(!E)return;const{[E]:T,...F}=r.value;r.value=F}async function $(E){const T=l.value;T&&await A(T.parentId,E)}function x(E){if(!r.value[E])return;const{[E]:T,...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:x}}const Qpe="kimiWeb.optimisticUserMessage";function Xpe(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Jpe(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function eme(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 tg(e){return e.role==="user"&&e.metadata?.[Qpe]===!0}function tme(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function nme(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const sme=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function RC(e){let t="",n=0;for(const s of e.content)s.type==="text"?sme.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 ome(e,t){const n=RC(e),s=RC(t);return n.text===s.text&&n.media===s.media}function ime(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(tg(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(tg(o)&&nme(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(tg(o)&&ome(o,t))return s}return-1}function rme(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 lme(e,t,n){const s=Jpe(e);switch(eme(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"},[x5]: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"&&!tme(t.message)){const a=ime(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]=rme(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,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;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?Mn.global.t("warnings.errorLabel"):Mn.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 ame(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function cme(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"||ba(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:ame(a.status)}]:[]})}}return[]}const ume=["queued","working","suspended","completed","failed"];function w5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function dme(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function fme(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:w5(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=dme();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 hme(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 pme(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:w5(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 fr=v5(),zi=Whe(),bd=Yhe(),S5=Ht.permission,C5=Ht.activeWorkspace,A5=Ht.thinking,M5=Ht.planMode,E5=Ht.swarmMode,T5=Ht.goalMode,BC=40401,N5=Ht.onboarded,mme=/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$/;Fc(Ht.codeFont);Fc(Ht.theme);function gme(){try{const e=ss(S5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function vme(e){try{ls(S5,e)}catch{}}function yme(){try{const e=ss(A5);if(e&&mme.test(e))return e}catch{}return"high"}function kme(e){try{ls(A5,e)}catch{}}function ng(e){const t=ss(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 Dk(e,t){try{const n={};for(const[s,o]of Object.entries(t))o&&(n[s]=!0);ls(e,JSON.stringify(n))}catch{}}function I5(){Dk(M5,Ae.planModeBySession)}function $5(){Dk(E5,Ae.swarmModeBySession)}function L5(){Dk(T5,Ae.goalModeBySession)}function bme(){try{return ss(C5)}catch{return null}}const F5=Ht.hiddenWorkspaces;function xme(){try{const e=ss(F5);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function _me(e){try{ls(F5,JSON.stringify(e))}catch{}}function wme(e){try{ls(C5,e)}catch{}}function Sme(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 Ae=Ns({...Xpe(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,workspaceName:"kimi-web",connection:"disconnected",permission:gme(),thinking:yme(),planModeBySession:ng(M5),swarmModeBySession:ng(E5),goalModeBySession:ng(T5),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:vy(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:bme(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:xme(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),xm=Ns({planMode:!1,swarmMode:!1,goalMode:!1});function O5(e){Ae.sessions=e}function _m(e,t){Ae.sessions=Ae.sessions.map(n=>n.id===e?t(n):n)}function Cme(e){Ae.sessions=[e,...Ae.sessions.filter(t=>t.id!==e.id)]}function Ame(e){Ae.sessions=[...Ae.sessions,e]}function Mme(e){Ae.sessions=Ae.sessions.filter(t=>t.id!==e)}function R5(){const e=Ae.activeSessionId;e&&Ae.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ae.unreadBySession={...Ae.unreadBySession,[e]:!1},yy({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ht.unread&&(Ae.unreadBySession=vy(),R5())});function Ov(){if(gi===null||!gi.health().stale)return;mr("ws: stale socket on focus, reconnecting",{activeSessionId:Ae.activeSessionId}),gi.reconnect();const e=Ae.activeSessionId;e&&yp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(R5(),Ov())});typeof window<"u"&&(window.addEventListener("focus",Ov),window.addEventListener("online",Ov));function Pk(e){Ae.activeSessionId=e}function Eme(e){Ae.messagesBySession=e}function Tme(e,t){Ae.messagesBySession={...Ae.messagesBySession,[e]:t}}function B5(e,t){Ae.messagesBySession={...Ae.messagesBySession,[e]:t(Ae.messagesBySession[e]??[])}}function Nme(e){const{[e]:t,...n}=Ae.messagesBySession;Ae.messagesBySession=n}function D5(e){gi?.unsubscribe(e),Jme(e),gp.flush(),Mme(e),Nme(e),delete Ae.approvalsBySession[e],delete Ae.questionsBySession[e],delete Ae.tasksBySession[e],delete Ae.goalBySession[e],delete Ae.gitStatusBySession[e],delete Ae.lastSeqBySession[e],delete Ae.compactionBySession[e],delete Ae.messagesLoadingMoreBySession[e],delete Ae.messagesHasMoreBySession[e],delete Ae.messagesLoadMoreErrorBySession[e],delete Rv[e],vp.delete(e),dh.delete(e),Z5.delete(e),Hk.delete(e),dpe(e),delete Ae.queuedBySession[e],delete Ae.promptIdBySession[e],delete Ae.sendingBySession[e],delete Ae.planModeBySession[e],delete Ae.swarmModeBySession[e],delete Ae.goalModeBySession[e],I5(),$5(),L5()}const P5=Q(null),H5=Q([]),W5=Q(!1),z5=Q(!1),U5=Q(null);async function wm(e){let t;try{t=await mt().getSessionStatus(e)}catch{return}_m(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ae.swarmModeBySession={...Ae.swarmModeBySession,[e]:t.swarmMode},Ae.planModeBySession={...Ae.planModeBySession,[e]:t.planMode}}function j5(e,t){const n=t??Ae.activeSessionId;return n?Promise.resolve(mt().updateSession(n,e)).then(()=>wm(n)).catch(()=>{}):Promise.resolve()}const q5=Ht.conversationToc;function Ime(){try{const e=ss(q5);return e===null?!0:e==="true"}catch{return!0}}function $me(e){try{ls(q5,e?"true":"false")}catch{}}const V5=Q(Ime());function Lme(e){V5.value=e,$me(e)}function Fme(e){try{return ss(e)??""}catch{return""}}const K5=Q(Fme(N5)==="1");function Ome(e){K5.value=e;try{ls(N5,e?"1":"0")}catch{}}let gi=null,DC=0;function G5(){return DC+=1,`msg_opt_${Date.now().toString(36)}_${DC}`}const Hk=new Set;function Rme(e,t,n){const s={sessions:Ae.sessions,activeSessionId:Ae.activeSessionId,messagesBySession:Ae.messagesBySession,approvalsBySession:Ae.approvalsBySession,planReviewByToolCallId:Ae.planReviewByToolCallId,questionsBySession:Ae.questionsBySession,tasksBySession:Ae.tasksBySession,goalBySession:Ae.goalBySession,lastSeqBySession:Ae.lastSeqBySession,compactionBySession:Ae.compactionBySession,config:Ae.config,warnings:Ae.warnings},o=lme(s,e,{sessionId:t,seq:n});O5(o.sessions),Pk(o.activeSessionId),Eme(o.messagesBySession),Ae.approvalsBySession=o.approvalsBySession,Ae.planReviewByToolCallId=o.planReviewByToolCallId,Ae.questionsBySession=o.questionsBySession,Ae.tasksBySession=o.tasksBySession,Ae.goalBySession=o.goalBySession,Ae.lastSeqBySession=o.lastSeqBySession,Ae.compactionBySession=o.compactionBySession,Ae.config=o.config??null,Ae.warnings=o.warnings,e.type==="configChanged"&&(Ae.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(An.loadModels(),An.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(Ae.swarmModeBySession={...Ae.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(Ae.planModeBySession={...Ae.planModeBySession,[e.sessionId]:e.planMode}))}function Bme(e,t){const n=Ae.lastSeqBySession[t.sessionId]??0;Rme(e,t.sessionId,t.seq);const s=Vs.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:o}=s,i=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&Vs.appendSideChatAssistantText(o,i,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?Vs.finishSideChatAgent(o,i):e.type==="taskProgress"&&e.taskId===o?Vs.appendSideChatAssistantText(o,i,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&Vs.finishSideChatAgent(o,i,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;Ae.promptIdBySession[o]!==e.message.promptId&&(Ae.promptIdBySession={...Ae.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Ae.activeSessionId&&fr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&t.seq>n&&s0e(e.sessionId,e.status),e.type==="questionRequested"&&o0e(e.sessionId,e.question),e.type==="approvalRequested"&&i0e(e.sessionId,e.approval)}const gp=dhe(({appEvent:e,meta:t})=>Bme(e,t),({appEvent:e})=>che(e));function Y5(){if(gi!==null||typeof WebSocket>"u")return;Ae.connection="connecting",gi=mt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){pt.applyWorkspaceEvent(t);return}gp({appEvent:t,meta:n})},onResync(t,n,s){gp.flush(),vp.add(t),yp.request(t)},onError(t,n,s){Wk({severity:"error",title:Mn.global.t("warnings.wsTitle"),message:n,details:[Kn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Ae.connected=t,Ae.connection=t?"connected":"disconnected",t&&qme()}})}const Rv={},vp=new Set,dh=new Set,Z5=new Set;function Dme(e){return Sr(e)&&e.code===BC?!0:typeof e=="object"&&e!==null&&e.code===BC}function Kn(e,t){if(!(t==null||t===""))return{label:Mn.global.t(`warnings.details.${e}`),value:Q5(t)}}function Q5(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 Pme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Hme(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Wme(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function zme(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function PC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function Ume(e,t,n){const s=t5(t),o=Sr(t),i=s||o?t.timestamp:void 0,r=s||o?t.durationMs:void 0,l=[Kn("operation",e),Kn("sessionId",n??Ae.activeSessionId),Kn("connection",Ae.connection),Kn("timestamp",zme(i??Date.now()))];return s?l.push(Kn("duration",PC(r)),Kn("request",`${t.method} ${t.path}`),Kn("endpoint",t.url),Kn("requestId",t.requestId),Kn("phase",t.phase),Kn("timeout",`${t.timeoutMs}ms`),Kn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Kn("contentType",t.contentType),Kn("responsePreview",t.bodyPreview),Kn("cause",t.cause)):o?l.push(Kn("duration",PC(r)),Kn("code",t.code),Kn("requestId",t.requestId),Kn("message",t.message),Kn("details",t.details)):l.push(Kn("errorName",Pme(t)),Kn("message",Hme(t)??Q5(t)),Kn("stack",Wme(t))),l.filter(a=>a!==void 0)}function jme(e,t,n={}){const s=t5(t),o=Sr(t),i=n.title??(s?Mn.global.t("warnings.daemonNetworkTitle"):o?Mn.global.t("warnings.daemonApiTitle"):Mn.global.t("warnings.operationFailedTitle")),r=n.message??(s?Mn.global.t("warnings.daemonNetworkMessage"):o?t.message:Mn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Ume(e,t,n.sessionId)}}function Wk(e){Ae.warnings=[...Ae.warnings,e]}function qme(){const e=Mn.global.t("warnings.wsTitle"),t=Ae.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Ae.warnings.length&&(Ae.warnings=t)}function Sm(e,t,n){Wk(jme(e,t,n))}const Vme={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function Kme(e){if(!Sr(e))return;const t=Vme[e.code];return t?Mn.global.t(t):void 0}async function Gme(e){if(D5(e),Ae.activeSessionId!==e)return;const t=Ae.sessions[0];t?await pt.selectSession(t.id,{urlMode:"replace"}):(Pk(void 0),Ae.sessionLoading=!1,pt.writeSessionUrl(void 0,"replace"))}const HC=new Set;async function Yme(e){if(!HC.has(e)){HC.add(e);try{const t=await mt().getSessionWarnings(e),n=Mn.global.t("warnings.noteLabel");for(const s of t)Wk(`${n}: ${s.message}`)}catch{}}}async function zk(e){const t=pt.localTurnStartState(e);try{const s=await mt().getSessionSnapshot(e);if(!Ae.sessions.some(l=>l.id===e))return"ok";gp.flush();const o=Ae.lastSeqBySession[e]??0,i=Rv[e];if(!(vp.has(e)||kp.has(e))&&i!==void 0&&i===s.epoch&&o>s.asOfSeq)return dh.delete(e)||(dh.add(e),yp.request(e)),"ok";if(!pt.isLocalTurnSnapshotCurrent(e,t))return pt.afterLocalTurnStartsSettle(e,()=>{yp.request(e)}),"ok";_m(e,l=>({...s.session,model:s.session.model&&s.session.model.length>0?s.session.model:l.model})),Tme(e,rhe(Ae.messagesBySession[e]??[],s.messages)),Ae.messagesHasMoreBySession={...Ae.messagesHasMoreBySession,[e]:s.hasMoreMessages},Ae.approvalsBySession={...Ae.approvalsBySession,[e]:s.pendingApprovals};for(const l of s.pendingApprovals){const a=l.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(Ae.planReviewByToolCallId={...Ae.planReviewByToolCallId,[l.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}})}return Ae.questionsBySession={...Ae.questionsBySession,[e]:s.pendingQuestions},Ae.lastSeqBySession={...Ae.lastSeqBySession,[e]:s.asOfSeq},Rv[e]=s.epoch,vp.delete(e),dh.delete(e),pt.handleSessionSnapshot(e,{inFlightTurn:s.inFlightTurn,status:s.session.status}),Y5(),gi&&(gi.seedSnapshot(e,s),gi.subscribe(e,{seq:s.asOfSeq,epoch:s.epoch}),Xme(e)),kp.delete(e),Yme(e),"ok"}catch(n){return Dme(n)?(await Gme(e),"not-found"):(Sm("getSessionSnapshot",n,{title:Mn.global.t("warnings.sessionSnapshotTitle"),message:Mn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const yp=lhe(zk);function Zme(e){return Object.prototype.hasOwnProperty.call(Ae.messagesBySession,e)}const Qme=4,hr=[],kp=new Set;function Xme(e){const t=hr.indexOf(e);for(t!==-1&&hr.splice(t,1),hr.unshift(e);hr.length>Qme;){let n=-1;for(let o=hr.length-1;o>=0;o--)if(hr[o]!==Ae.activeSessionId){n=o;break}if(n===-1)break;const[s]=hr.splice(n,1);if(s===void 0)break;gi?.unsubscribe(s),kp.add(s)}}function Jme(e){const t=hr.indexOf(e);t!==-1&&hr.splice(t,1),kp.delete(e)}async function e1e(e){return zk(e)}function Cm(e){if(!e||e.status!=="running")return!1;const t=e.id,n=Vs.sideChatTargetBySession.value[t]?.agentId,o=(Ae.tasksBySession[t]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Ae.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Uk(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;if(o<6e4)return Mn.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 t1e=3e4,xd=Q(0);let sg=null;function n1e(){sg===null&&(sg=setInterval(()=>{xd.value=(xd.value+1)%Number.MAX_SAFE_INTEGER},t1e),sg.unref?.())}function s1e(e,t){const n=e.split(`
320
+ `),s=t.split(`
321
+ `),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 o1e(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:s1e(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 i1e(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 r1e(e){const t=Ae.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 l1e(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=Mn.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=Mn.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??r1e(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 a1e=D(()=>{const e=Ae.sessions.find(n=>n.id===Ae.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ae.workspaceName,branch:t}}),c1e=D(()=>(xd.value,Ae.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Uk(e.updatedAt,e.status),status:e.status,busy:Cm(e)})))),u1e=D(()=>Ae.activeSessionId??""),d1e=D(()=>{const e=Ae.activeSessionId;if(e)return An.skillsBySession.value[e]??[];const t=Mm.value;return t?An.skillsByWorkspace.value[t]??[]:[]}),f1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.sendingBySession[e]??!1:!1}),h1e=D(()=>pt.isStartingFirstPrompt()),Vs=Zpe(Ae,{pushOperationFailure:Sm,nextOptimisticMsgId:G5,connectEventsIfNeeded:Y5,getEventConn:()=>gi,models:()=>An.models.value}),Bd=D(()=>{const e=Ae.activeSessionId;if(!e)return[];const t=Vs.sideChatTargetBySession.value[e]?.agentId;return(Ae.tasksBySession[e]??[]).filter(n=>n.id!==t)}),X5=Xhe(Ae,Bd),p1e=D(()=>{const e=Ae.activeSessionId;if(!e)return[];const t=new Set(Ae.sideChatUserMessageIdsBySession[e]??[]),n=(Ae.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Ae.approvalsBySession[e]??[];return _5(n,s,o=>mt().getFileUrl(o),Am.value!=="idle",Ae.planReviewByToolCallId)}),m1e=D(()=>(X5.taskClock.value,Bd.value.map(l1e))),J5=D(()=>fme(Bd.value)),g1e=D(()=>pme(Bd.value)),oc=D(()=>{const e=Ae.activeSessionId;return e?Ae.goalBySession[e]??null:null}),v1e=D(()=>{const e=Ae.activeSessionId;return e?cme(Ae.messagesBySession[e]??[]):[]}),y1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.compactionBySession[e]??null:null}),k1e=D(()=>Ae.connection),b1e=D(()=>Ae.loading),x1e=D(()=>Ae.sessionLoading),_1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.messagesLoadingMoreBySession[e]??!1:!1}),w1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.messagesHasMoreBySession[e]??!1:!1}),S1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.messagesLoadMoreErrorBySession[e]??!1:!1}),C1e=D(()=>Ae.serverVersion),A1e=D(()=>Ae.dangerousBypassAuth);function M1e(){Ae.dangerousBypassAuth=!1}const E1e=D(()=>Ae.permission),T1e=D(()=>Ae.thinking),e8=D(()=>{const e=Ae.activeSessionId;return e?Ae.planModeBySession[e]??!1:xm.planMode}),N1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.swarmModeBySession[e]??!1:xm.swarmMode}),I1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.goalModeBySession[e]??!1:xm.goalMode}),$1e=D(()=>{const e=hme(J5.value);return{plan:e8.value,goal:oc.value&&oc.value.status!=="complete"?{status:oc.value.status,turnsUsed:oc.value.turnsUsed,elapsedMs:oc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),L1e=D(()=>{const e=Ae.activeSessionId;if(!e)return[];const t=mt();return(Ae.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)}))}))}),F1e=D(()=>Ae.warnings),O1e=D(()=>{const e=Ae.activeSessionId;return e?(Ae.questionsBySession[e]??[]).map(i1e):[]}),R1e=D(()=>{const e=Ae.activeSessionId;return e?(Ae.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:o1e(t),agentName:t.agentName})):[]}),Am=D(()=>{const e=Ae.activeSessionId;if(!e)return"idle";if((Ae.approvalsBySession[e]??[]).length>0)return"awaiting-approval";if((Ae.questionsBySession[e]??[]).length>0)return"awaiting-question";const s=Ae.sessions.find(o=>o.id===e);return Cm(s)?"running":"idle"}),An=vpe(Ae,{pushOperationFailure:Sm,refreshSessionStatus:wm,persistSessionProfile:j5,activity:Am,inFlightPromptSessions:Hk,saveThinkingToStorage:kme,updateSession:_m,updateSessionMessages:B5}),bp=D(()=>{const e=Ae.activeSessionId;if(!e)return null;const t=Ae.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),B1e=D(()=>{const e=Ae.activeSessionId;return e?Ae.gitStatusBySession[e]?.pullRequest??null:null}),D1e=D(()=>{const e=Ae.activeSessionId;if(!e)return[];const t=Ae.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),P1e=D(()=>{const e=Ae.activeSessionId;if(!e)return null;const t=Ae.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),t8=D(()=>{const e=Ae.sessions.find(r=>r.id===Ae.activeSessionId),t=bp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?An.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Ae.defaultModel)??"—",o=An.models.value.find(r=>r.id===s)??An.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:Ae.permission,branch:t,cwd:e?.cwd??"",isGitRepo:bp.value!==null}}),H1e=D(()=>H5.value),W1e=D(()=>Ae.sessions.find(t=>t.id===Ae.activeSessionId)?.usage.totalCostUsd??0),z1e=D(()=>Ae.authReady),U1e=D(()=>Ae.defaultModel),j1e=D(()=>Ae.managedProviderStatus),q1e=D(()=>Ae.config),V1e=D(()=>{const e=Ae.activeSessionId;if(!e)return{};const t=Ae.gitStatusBySession[e];return t?{...t.entries}:{}});function Bc(e){return Ae.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const jk=D(()=>ihe({workspaces:Ae.workspaces,sessions:Ae.sessions,hiddenWorkspaceRoots:Ae.hiddenWorkspaceRoots,activeRoot:Ae.sessions.find(e=>e.id===Ae.activeSessionId)?.cwd,activeBranch:bp.value?.branch??null,sessionsHasMoreByWorkspace:Ae.sessionsHasMoreByWorkspace})),xp=Q(KN()),Dc=Q(GN()==="manual"?"manual":"recent");Ge(()=>[jk.value.map(e=>e.id).join("\0"),Ae.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=rI(n,xp.value);s!==null&&(xp.value=s,Z3(s))});const va=D(()=>{const e=jk.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Sme(t.root,Ae.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(Dc.value==="recent"){const t=new Map;for(const n of Ae.sessions){if(n.parentSessionId)continue;const s=Bc(n),o=new Date(n.updatedAt).getTime();o>(t.get(s)??Number.NEGATIVE_INFINITY)&&t.set(s,o)}return cI(e,t)}return lI(e,xp.value)}),Mm=D(()=>{const e=Ae.activeWorkspaceId,t=va.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ge(Mm,e=>{e&&(Object.prototype.hasOwnProperty.call(An.skillsByWorkspace.value,e)||An.loadSkillsForWorkspace(e))},{immediate:!0});const K1e=D(()=>{const e=Mm.value;return e?va.value.find(t=>t.id===e)??null:null}),G1e=D(()=>{xd.value;const e=new Set(va.value.map(n=>n.id)),t=new Map(va.value.map(n=>[n.id,n.name]));return Ae.sessions.filter(n=>!n.parentSessionId&&e.has(Bc(n))).map(n=>{const s=Bc(n);return{id:n.id,title:n.title,time:Uk(n.updatedAt,n.status),status:n.status,busy:Cm(n),lastPrompt:n.lastPrompt,workspaceId:s,workspaceName:t.get(s)}})}),Y1e=D(()=>{xd.value;const e=new Map;for(const t of Ae.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Bc(t),s={id:t.id,title:t.title,time:Uk(t.updatedAt,t.status),status:t.status,busy:Cm(t),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return va.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ae.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ae.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Ae.sessionsInitialCountByWorkspace[t.id]??$v}))});function Z1e(e){xp.value=e,Z3(e),Dc.value!=="manual"&&(Dc.value="manual",Q3("manual"))}function Q1e(e){Dc.value!==e&&(Dc.value=e,Q3(e))}const n8=D(()=>{const e={};for(const[t,n]of Object.entries(Ae.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ae.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),X1e=D(()=>{const e={};for(const[t,n]of Object.entries(Ae.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ae.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),J1e=D(()=>{const e={};for(const[t,n]of Object.entries(Ae.unreadBySession))n&&(e[t]=!0);return e}),e0e=D(()=>{const e={},t=n8.value;for(const n of Ae.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=Bc(n);e[o]=(e[o]??0)+s}return e}),t0e=D(()=>Ae.recentRoots),n0e=D(()=>Ae.availableOpenInApps),pt=ppe(Ae,{taskPoller:X5,sideChat:Vs,modelProvider:An,pushOperationFailure:Sm,activity:Am,inFlightPromptSessions:Hk,sessionsKnownEmpty:Z5,setSessions:O5,updateSession:_m,upsertSessionFront:Cme,appendSession:Ame,forgetSession:D5,setActiveSessionId:Pk,updateSessionMessages:B5,nextOptimisticMsgId:G5,getEventConn:()=>gi,syncSessionFromSnapshot:zk,reopenSession:e1e,hasLoadedMessages:Zme,refreshSessionStatus:wm,persistSessionProfile:j5,mergedWorkspaces:jk,workspacesView:va,status:t8,workspaceIdForSession:Bc,savePermissionToStorage:vme,savePlanModeToStorage:I5,saveSwarmModeToStorage:$5,saveGoalModeToStorage:L5,draftModes:xm,saveUnread:yy,saveActiveWorkspaceToStorage:wme,saveHiddenWorkspacesToStorage:_me,goalErrorMessage:Kme,resetFastMoon:fr.resetFastMoon,initialized:z5,connectIssue:U5,selectedDiffPath:P5,fileDiffLines:H5,fileDiffLoading:W5});function qk(e){return e===Ae.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function s0e(e,t){const n=Ae.promptIdBySession[e];pt.finishPromptLocal(e),e===Ae.activeSessionId?(pt.loadGitStatus(e),wm(e)):t==="idle"&&(Ae.unreadBySession={...Ae.unreadBySession,[e]:!0},yy({[e]:!0}));const s=(Ae.approvalsBySession[e]??[]).length>0,o=(Ae.questionsBySession[e]??[]).length>0;Nhe(t,s,o)&&zi.maybeNotifyCompletion(e,{isUserWatching:qk(e),sessionTitle:Ae.sessions.find(i=>i.id===e)?.title??"",promptId:n,onClick:()=>{pt.selectSession(e)}}),t==="idle"&&bd.maybePlayCompletionSound()}function o0e(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:qk(e),sessionTitle:Ae.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{pt.selectSession(e)}}),bd.maybePlayQuestionSound()}function i0e(e,t){zi.maybeNotifyApproval({isUserWatching:qk(e),sessionTitle:Ae.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{pt.selectSession(e)}}),bd.maybePlayApprovalSound()}function Vk(){return n1e(),{workspace:a1e,sessions:c1e,activeSessionId:u1e,workspacesView:va,workspaceSortMode:Dc,visibleWorkspace:K1e,activeWorkspaceId:Mm,sessionsForView:G1e,workspaceGroups:Y1e,attentionBySession:n8,pendingBySession:X1e,attentionByWorkspace:e0e,unreadBySession:J1e,recentRoots:t0e,turns:p1e,tasks:m1e,activeAppTasks:Bd,todos:v1e,goal:oc,swarms:J5,swarmMembersByToolCallId:g1e,activationBadges:$1e,compaction:y1e,status:t8,sessionCost:W1e,fileDiff:H1e,selectedDiffPath:P5,fileDiffLoading:W5,changes:D1e,gitInfo:bp,gitDiffStats:P1e,activePullRequest:B1e,changesByPath:V1e,pendingApprovals:R1e,availableOpenInApps:n0e,connection:k1e,loading:b1e,sessionLoading:x1e,loadingMoreMessages:_1e,hasMoreMessages:w1e,loadMoreMessagesError:S1e,serverVersion:C1e,dangerousBypassAuth:A1e,clearDangerousBypassAuth:M1e,initialized:z5,connectIssue:U5,permission:E1e,thinking:T1e,planMode:e8,swarmMode:N1e,goalMode:I1e,queued:L1e,warnings:F1e,questions:O1e,activity:Am,isSending:f1e,isStartingFirstPrompt:h1e,fastMoon:fr.fastMoon,models:An.models,starredModelIds:An.starredModelIds,providers:An.providers,uiFontSize:fr.uiFontSize,setUiFontSize:fr.setUiFontSize,conversationToc:V5,setConversationToc:Lme,colorScheme:fr.colorScheme,setColorScheme:fr.setColorScheme,accent:fr.accent,setAccent:fr.setAccent,notifyOnComplete:zi.notifyOnComplete,notifyOnQuestion:zi.notifyOnQuestion,notifyOnApproval:zi.notifyOnApproval,notifyPermission:zi.notifyPermission,setNotifyOnComplete:zi.setNotifyOnComplete,setNotifyOnQuestion:zi.setNotifyOnQuestion,setNotifyOnApproval:zi.setNotifyOnApproval,soundOnComplete:bd.soundOnComplete,setSoundOnComplete:bd.setSoundOnComplete,onboarded:K5,setOnboarded:Ome,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:Vs.sideChatVisible,sideChatSessionId:Vs.sideChatSessionId,sideChatTurns:Vs.sideChatTurns,sideChatRunning:Vs.sideChatRunning,sideChatSending:Vs.sideChatSending,openSideChat:Vs.openSideChat,closeSideChat:Vs.closeSideChat,sendSideChatPrompt:Vs.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:An.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:Z1e,setWorkspaceSortMode:Q1e,archiveSession:pt.archiveSession,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:An.refreshOAuthProviderModels,loadModels:An.loadModels,loadProviders:An.loadProviders,skills:d1e,activateSkill:An.activateSkill,setModel:An.setModel,toggleStarModel:An.toggleStarModel,addProvider:An.addProvider,deleteProvider:An.deleteProvider,refreshProvider:An.refreshProvider,refreshAllProviders:An.refreshAllProviders,authReady:z1e,defaultModel:U1e,managedProviderStatus:j1e,config:q1e,updateConfig:pt.updateConfig,checkAuth:pt.checkAuth,startOAuthLogin:An.startOAuthLogin,pollOAuthLogin:An.pollOAuthLogin,cancelOAuthLogin:An.cancelOAuthLogin,logout:pt.logout}}const s8=Ve({__name:"LanguageSwitcher",setup(e){const{locale:t}=Lt(),n=cA.map(o=>({value:o.code,label:o.label}));function s(o){t.value!==o&&uA(o)}return(o,i)=>(b(),xe(ro,{"model-value":C(t),options:C(n),"onUpdate:modelValue":s},null,8,["model-value","options"]))}}),r0e=["aria-checked","aria-label","disabled"],l0e=Ve({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,o)=>(b(),N("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,r0e))}}),rr=dt(l0e,[["__scopeId","data-v-dbe22dc4"]]),a0e=["aria-label"],c0e=["aria-selected","onClick"],u0e={class:"body"},d0e={class:"panel"},f0e={class:"sec"},h0e={class:"sec-title"},p0e={class:"row"},m0e={class:"rlabel"},g0e={class:"row"},v0e={class:"rlabel"},y0e={class:"row"},k0e={class:"rlabel"},b0e={class:"num-field"},x0e=["value","aria-label"],_0e={class:"row"},w0e={class:"rlabel"},S0e={class:"row"},C0e={class:"rlabel"},A0e={class:"hint"},M0e={class:"sec"},E0e={class:"sec-title"},T0e={class:"row"},N0e={class:"rlabel"},I0e={key:0,class:"hint"},$0e={class:"row"},L0e={class:"rlabel"},F0e={key:0,class:"hint"},O0e={class:"row"},R0e={class:"rlabel"},B0e={key:0,class:"hint"},D0e={class:"row"},P0e={class:"rlabel"},H0e={class:"panel"},W0e={class:"sec"},z0e={class:"sec-title"},U0e={class:"row"},j0e={class:"rlabel"},q0e={key:0,class:"rvalue"},V0e={class:"actions"},K0e={class:"panel"},G0e={class:"sec"},Y0e={class:"sec-head"},Z0e={class:"sec-title"},Q0e={key:0,class:"saving"},X0e={class:"row"},J0e={class:"rlabel"},ege={class:"hint"},tge={key:0,class:"select-wrap"},nge={key:0,value:"",disabled:""},sge=["label"],oge=["value"],ige={key:1,class:"rvalue mono"},rge={class:"row"},lge={class:"rlabel"},age={class:"hint"},cge={class:"row"},uge={class:"rlabel"},dge={class:"hint"},fge={class:"row"},hge={class:"rlabel"},pge={class:"hint"},mge={class:"row"},gge={class:"rlabel"},vge={class:"hint"},yge={key:1,class:"empty-config"},kge={class:"panel"},bge={class:"sec"},xge={class:"sec-title"},_ge={class:"row"},wge={class:"rlabel"},Sge={class:"rvalue mono"},Cge={class:"row"},Age={class:"rlabel"},Mge={class:"rvalue mono"},Ege={key:0,class:"row"},Tge={class:"rlabel"},Nge={class:"hint"},Ige={class:"hint"},$ge={class:"row"},Lge={class:"rlabel"},Fge={key:0,class:"hint"},Oge={class:"panel"},Rge={class:"panel-head"},Bge={class:"panel-title"},Dge={class:"panel-desc"},Pge={class:"archive-toolbar"},Hge={class:"archive-search"},Wge=["placeholder"],zge={value:"all"},Uge=["value"],jge={key:0,class:"archive-empty"},qge={key:0,class:"archive-list"},Vge={class:"archive-workspace"},Kge={class:"path"},Gge={class:"count"},Yge={class:"setting-card"},Zge={class:"archive-meta"},Qge={class:"archive-name"},Xge={class:"archive-time"},Jge={key:1,class:"archive-empty"},eve=100,tve=Ve({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Lt(),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=tI(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=Q(null);Sk(u);function d(J){J.key==="Escape"&&o("close")}gn(()=>document.addEventListener("keydown",d)),xn(()=>document.removeEventListener("keydown",d));function f(){n5()}const p=D(()=>{const J=new Map;for(const Y of s.models??[])J.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(J.has(Y))continue;const fe=_(X);J.set(Y,{id:Y,label:k(Y,X,fe),provider:fe??Y})}return Array.from(J.values())}),h=D(()=>{const J=new Map;for(const Y of p.value){const X=J.get(Y.provider)??[];X.push(Y),J.set(Y.provider,X)}for(const Y of J.values())Y.sort((X,fe)=>X.label.localeCompare(fe.label));return Array.from(J.entries()).toSorted(([Y],[X])=>Y.localeCompare(X)).map(([Y,X])=>({provider:Y,options:X}))}),m=D(()=>{const J=s.config?.defaultPermissionMode;return J==="auto"||J==="yolo"||J==="manual"?J:"manual"});function _(J){if(!J||typeof J!="object")return;const Y=J;return typeof Y.provider=="string"?Y.provider:void 0}function k(J,Y,X){if(!Y||typeof Y!="object")return J;const fe=Y,ce=typeof fe.model=="string"?fe.model:void 0,We=X??_(Y);return ce&&We?`${J} (${We}/${ce})`:ce?`${J} (${ce})`:J}function g(J){return J===!0}function v(J){!J||J===s.config?.defaultModel||o("updateConfig",{defaultModel:J})}function y(J){J!==m.value&&o("updateConfig",{defaultPermissionMode:J})}function A(J){const Y=s.config?.[J];o("updateConfig",{[J]:!g(Y)})}function L(){const J=s.config?.thinking;return!J||typeof J!="object"?!0:J.enabled!==!1}function $(){o("updateConfig",{thinking:{enabled:!L()}})}function x(){const J=s.config?.telemetry!==!1;o("updateConfig",{telemetry:!J})}function E(J){i.value=J}const T=Vk(),F=Q([]),S=Q(!1),I=Q(!1),B=Q(""),R=Q("all"),P=Q("archived-desc");async function W(){if(!(S.value||I.value)){S.value=!0;try{const J=[];let Y;for(;;){const X=await T.loadArchivedSessions({beforeId:Y,pageSize:eve});if(J.push(...X.items),!X.hasMore||X.items.length===0)break;const fe=X.items.at(-1)?.id;if(fe===void 0)break;Y=fe}F.value=J,I.value=!0}catch(J){console.warn("loadAllArchived failed",J)}finally{S.value=!1}}}Ge(i,J=>{J==="archived"&&!I.value&&W()});const U=D(()=>{const J=new Set;for(const Y of F.value)J.add(Y.cwd);return Array.from(J).sort((Y,X)=>Y.localeCompare(X))}),Z=D(()=>{const J=B.value.trim().toLowerCase();let Y=F.value.filter(X=>X.archived===!0);return R.value!=="all"&&(Y=Y.filter(X=>X.cwd===R.value)),J&&(Y=Y.filter(X=>X.title.toLowerCase().includes(J))),Y=Y.slice(),P.value==="archived-desc"?Y.sort((X,fe)=>fe.updatedAt.localeCompare(X.updatedAt)):P.value==="created-desc"?Y.sort((X,fe)=>fe.createdAt.localeCompare(X.createdAt)):Y.sort((X,fe)=>X.title.localeCompare(fe.title,"zh")),Y}),z=D(()=>{const J=new Map;for(const Y of Z.value){const X=J.get(Y.cwd)??[];X.push(Y),J.set(Y.cwd,X)}return Array.from(J.entries()).map(([Y,X])=>({cwd:Y,items:X}))});async function ee(J){await T.restoreSession(J)&&(F.value=F.value.filter(X=>X.id!==J))}function de(J){const Y=new Date(J);if(Number.isNaN(Y.getTime()))return J;const X=fe=>String(fe).padStart(2,"0");return`${Y.getFullYear()}-${X(Y.getMonth()+1)}-${X(Y.getDate())} ${X(Y.getHours())}:${X(Y.getMinutes())}`}return(J,Y)=>(b(),xe($r,{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:Ee(()=>[w("div",{ref_key:"dialogRef",ref:u,class:"sd"},[w("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(b(),N(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:fe=>E(X.id)},O(C(n)(X.labelKey)),11,c0e)),64))],8,a0e),w("div",u0e,[Fn(w("section",d0e,[w("section",f0e,[w("h3",h0e,O(C(n)("settings.appearance")),1),w("div",p0e,[w("span",m0e,O(C(n)("theme.colorSchemeLabel")),1),ie(ro,{"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",g0e,[w("span",v0e,O(C(n)("theme.accentLabel")),1),ie(ro,{"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",y0e,[w("span",k0e,O(C(n)("settings.uiFontSize")),1),w("label",b0e,[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,x0e),Y[20]||(Y[20]=w("span",{class:"num-unit"},"px",-1))])]),w("div",_0e,[w("span",w0e,O(C(n)("sidebar.language")),1),ie(s8)]),w("div",S0e,[w("span",C0e,[Ye(O(C(n)("settings.conversationToc"))+" ",1),w("span",A0e,O(C(n)("settings.conversationTocHint")),1)]),ie(rr,{"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",M0e,[w("h3",E0e,O(C(n)("settings.notifications")),1),w("div",T0e,[w("span",N0e,[Ye(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(b(),N("span",I0e,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(rr,{"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",$0e,[w("span",L0e,[Ye(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(b(),N("span",F0e,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(rr,{"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",O0e,[w("span",R0e,[Ye(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(b(),N("span",B0e,O(C(n)("settings.notifyDenied")),1)):re("",!0)]),ie(rr,{"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",D0e,[w("span",P0e,O(C(n)("settings.soundOnComplete")),1),ie(rr,{"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),[[di,i.value==="general"]]),Fn(w("section",H0e,[w("section",W0e,[w("h3",z0e,O(C(n)("settings.account")),1),w("div",U0e,[w("span",j0e,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ie(Xt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(b(),N("span",q0e,O(e.accountModel),1)):re("",!0)]),_:1},8,["text"])]),w("div",V0e,[ie(Ut,{variant:"secondary",size:"sm",onClick:Y[8]||(Y[8]=X=>{o("openOnboarding"),o("close")})},{default:Ee(()=>[Ye(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(b(),xe(Ut,{key:0,variant:"danger-soft",size:"sm",onClick:Y[9]||(Y[9]=X=>o("logout"))},{default:Ee(()=>[Ye(O(C(n)("sidebar.signOut")),1)]),_:1})):(b(),xe(Ut,{key:1,variant:"primary",size:"sm",onClick:Y[10]||(Y[10]=X=>o("login"))},{default:Ee(()=>[Ye(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[di,i.value==="account"]]),Fn(w("section",K0e,[w("section",G0e,[w("div",Y0e,[w("h3",Z0e,O(C(n)("settings.agentDefaults")),1),e.configSaving?(b(),N("span",Q0e,O(C(n)("settings.saving")),1)):re("",!0)]),e.config?(b(),N(Be,{key:0},[w("div",X0e,[w("span",J0e,[Ye(O(C(n)("settings.defaultModel"))+" ",1),w("span",ege,O(C(n)("settings.defaultModelHint")),1)]),h.value.length>0?(b(),N("div",tge,[ie(Nv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:Ee(()=>[e.config.defaultModel?re("",!0):(b(),N("option",nge,O(C(n)("settings.noDefaultModel")),1)),(b(!0),N(Be,null,st(h.value,X=>(b(),N("optgroup",{key:X.provider,label:X.provider},[(b(!0),N(Be,null,st(X.options,fe=>(b(),N("option",{key:fe.id,value:fe.id},O(fe.label),9,oge))),128))],8,sge))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(b(),N("span",ige,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),w("div",rge,[w("span",lge,[Ye(O(C(n)("settings.defaultPermission"))+" ",1),w("span",age,O(C(n)("settings.defaultPermissionHint")),1)]),ie(ro,{"model-value":m.value,options:a.map(X=>({value:X,label:C(n)(c[X])})),"onUpdate:modelValue":Y[11]||(Y[11]=X=>y(X))},null,8,["model-value","options"])]),w("div",cge,[w("span",uge,[Ye(O(C(n)("settings.defaultThinking"))+" ",1),w("span",dge,O(C(n)("settings.defaultThinkingHint")),1)]),ie(rr,{"model-value":L(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":Y[12]||(Y[12]=X=>$())},null,8,["model-value","disabled","label"])]),w("div",fge,[w("span",hge,[Ye(O(C(n)("settings.defaultPlanMode"))+" ",1),w("span",pge,O(C(n)("settings.defaultPlanModeHint")),1)]),ie(rr,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Y[13]||(Y[13]=X=>A("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),w("div",mge,[w("span",gge,[Ye(O(C(n)("settings.mergeSkills"))+" ",1),w("span",vge,O(C(n)("settings.mergeSkillsHint")),1)]),ie(rr,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":Y[14]||(Y[14]=X=>A("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(b(),N("div",yge,O(C(n)("settings.configUnavailable")),1))])],512),[[di,i.value==="agent"]]),Fn(w("section",kge,[w("section",bge,[w("h3",xge,O(C(n)("settings.advanced")),1),w("div",_ge,[w("span",wge,O(C(n)("sidebar.daemon")),1),w("span",Sge,O(C(l)),1)]),w("div",Cge,[w("span",Age,O(C(n)("settings.serverVersion")),1),w("span",Mge,O(e.serverVersion||"-"),1)]),e.config?(b(),N("div",Ege,[w("span",Tge,[Ye(O(C(n)("settings.telemetry"))+" ",1),w("span",Nge,O(C(n)("settings.telemetryHint")),1),w("span",Ige,O(C(n)("settings.telemetryRestartHint")),1)]),ie(rr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":Y[15]||(Y[15]=X=>x())},null,8,["model-value","disabled","label"])])):re("",!0),w("div",$ge,[w("span",Lge,[Ye(O(C(n)("settings.exportLog"))+" ",1),C(Ii)()?re("",!0):(b(),N("span",Fge,O(C(n)("settings.logHint")),1))]),ie(Ut,{variant:"secondary",size:"sm",onClick:f},{default:Ee(()=>[Ye(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[di,i.value==="advanced"]]),Fn(w("section",Oge,[w("div",Rge,[Y[21]||(Y[21]=w("div",{class:"panel-kicker"},"Archived sessions",-1)),w("h4",Bge,O(C(n)("settings.archivedTitle")),1),w("p",Dge,O(C(n)("settings.archivedDesc")),1)]),w("div",Pge,[w("label",Hge,[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)),Fn(w("input",{"onUpdate:modelValue":Y[16]||(Y[16]=X=>B.value=X),placeholder:C(n)("settings.archivedSearch")},null,8,Wge),[[po,B.value]])]),ie(Nv,{"model-value":R.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Y[17]||(Y[17]=X=>R.value=X)},{default:Ee(()=>[w("option",zge,O(C(n)("settings.archivedAllWorkspaces")),1),(b(!0),N(Be,null,st(U.value,X=>(b(),N("option",{key:X,value:X},O(X),9,Uge))),128))]),_:1},8,["model-value","aria-label"]),ie(ro,{size:"sm","model-value":P.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=>P.value=X)},null,8,["model-value","options"])]),S.value?(b(),N("div",jge,O(C(n)("settings.archivedLoadingAll")),1)):(b(),N(Be,{key:1},[z.value.length>0?(b(),N("div",qge,[(b(!0),N(Be,null,st(z.value,X=>(b(),N("section",{key:X.cwd,class:"archive-card"},[w("div",Vge,[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",Kge,O(X.cwd),1),w("span",Gge,O(C(n)("settings.archivedSessionsCount",{count:X.items.length})),1)]),w("div",Yge,[(b(!0),N(Be,null,st(X.items,fe=>(b(),N("div",{key:fe.id,class:"archive-row"},[w("div",Zge,[w("div",Qge,O(fe.title),1),w("div",Xge,O(C(n)("settings.archivedAt",{time:de(fe.updatedAt)})),1)]),ie(Ut,{variant:"secondary",size:"sm",onClick:ce=>ee(fe.id)},{default:Ee(()=>[Ye(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(b(),N("div",Jge,O(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[di,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),nve=dt(tve,[["__scopeId","data-v-0c2e1aca"]]),sve=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,o8=/^[A-Za-z]:[\\/]/,ove=/^\/\/(?!\/)/;function og(e){return sve.test(e.trim())}function ive(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function rve(e){return ove.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function lve(e){return o8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function ave(e){return o8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function Bv(e,t){let n=rve(ive(e.trim(),t));const s=lve(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=ave(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 cve(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function uve(e,t,n){if(n===null)return null;const{target:s}=Bv(e,t);return s===n?n:null}const dve={class:"aw"},fve={key:0,class:"crumbbar"},hve={class:"crumbs"},pve={key:0,class:"crumb-sep"},mve=["onClick"],gve=["placeholder"],vve={key:2,class:"folder-list"},yve={key:0,class:"fl-loading"},kve={key:0,class:"fl-loading"},bve={key:0,class:"fl-note"},xve=["onClick"],_ve={class:"folder-name"},wve={key:0,class:"git-branch"},Sve={key:1,class:"fl-empty fl-error"},Cve={key:2,class:"fl-empty fl-error"},Ave=["onClick"],Mve={class:"folder-name search-rel"},Eve={key:0,class:"git-branch"},Tve={key:0,class:"fl-empty"},Nve={key:1,class:"fl-loading"},Ive=["onClick"],$ve={class:"folder-name"},Lve={key:0,class:"git-branch"},Fve={key:0,class:"fl-empty"},Ove={key:3,class:"degraded-hint"},Rve={key:4,class:"add-error",role:"alert"},Bve={class:"actions"},Dve={class:"footer-hint"},Pve=600,Hve=6,WC=150,Wve=Ve({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Lt(),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),p=Q([]),h=D(()=>d.value.trim().length>0);let m=0,_=null;const k=D(()=>og(d.value)),g=Q("idle"),v=Q(""),y=Q("/"),A=Q([]),L=Q(""),$=Q(null),x=Q(null),E=D(()=>g.value!=="valid"?null:uve(d.value,L.value,x.value));let T=0,F=null;function S(X,fe){const ce=X.toLowerCase(),We=fe.toLowerCase();let ge=0;for(let G=0;G<We.length&&ge<ce.length;G++)We[G]===ce[ge]&&ge++;return ge===ce.length}async function I(X){const fe=a.value,ce=X.trim();if(!fe||ce===""){p.value=[],f.value=!1;return}const We=++m;f.value=!0;const ge=[],G=[{path:fe,depth:0}];let le=0;for(;G.length>0&&le<Pve&&ge.length<WC;){if(We!==m)return;const he=G.shift();le++;let j;try{j=await s.browseFs(he.path)}catch{continue}if(We!==m)return;for(const ne of j.entries){if(!ne.isDir)continue;const ve=ne.path.startsWith(fe)?ne.path.slice(fe.length).replace(/^\/+/,""):ne.path;if(S(ce,ve||ne.name)&&(ge.push({path:ne.path,name:ne.name,rel:ve||ne.name,isGitRepo:ne.isGitRepo,branch:ne.branch}),ge.length>=WC))break;he.depth+1<Hve&&G.push({path:ne.path,depth:he.depth+1})}We===m&&(p.value=[...ge])}We===m&&(f.value=!1)}Ge(d,X=>{_&&clearTimeout(_),F&&clearTimeout(F),T++,g.value="idle",A.value=[],x.value=null;const fe=X.trim();if(fe===""){m++,p.value=[],f.value=!1;return}if(og(fe)){if(m++,p.value=[],f.value=!1,l.value)return;g.value="checking",F=setTimeout(()=>void B(fe),150);return}_=setTimeout(()=>void I(X),220)});async function B(X){const fe=++T;g.value="checking",x.value=null;const ce=Bv(X,L.value),{target:We}=ce;try{const G=await s.browseFs(We);if(fe!==T)return;if(G.path){g.value="valid",A.value=[],x.value=We,a.value=G.path,c.value=G.parent,u.value=G.entries,l.value=!1;return}}catch{}if(fe!==T)return;const ge=ce.base.toLowerCase();v.value=ce.parent,y.value=ce.separator;try{const G=await s.browseFs(ce.parent);if(fe!==T)return;if(G.path){A.value=G.entries.filter(le=>le.isDir&&le.name.toLowerCase().startsWith(ge)),g.value="not-found";return}}catch{}fe===T&&(A.value=[],g.value="bad-parent")}function R(X){d.value=cve(v.value,X,y.value),$.value?.focus()}const P=D(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),W=D(()=>l.value?n("workspace.degradedHint"):k.value&&g.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function U(X){if(X.key==="Escape"){d.value?d.value="":o("close");return}if(X.key!=="Enter")return;const fe=d.value.trim();if(og(fe)){if(X.preventDefault(),l.value){const{target:ce}=Bv(fe,L.value);ce&&o("add",ce);return}g.value==="valid"?Y():g.value==="not-found"&&A.value[0]&&R(A.value[0].name)}}const Z=D(()=>{const X=a.value;if(!X)return[];const fe=X.split("/").filter(Boolean),ce=[{label:"/",path:"/"}];let We="";for(const ge of fe)We+=`/${ge}`,ce.push({label:ge,path:We});return ce}),z=D(()=>!(a.value.length===0||k.value&&E.value===null));async function ee(X){r.value=!0;try{const fe=await s.browseFs(X);if(!fe.path){l.value=!0;return}a.value=fe.path,c.value=fe.parent,u.value=fe.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function de(X){X.isDir&&ee(X.path)}function J(){c.value&&ee(c.value)}function Y(){z.value&&o("add",E.value??a.value)}return gn(async()=>{r.value=!0;try{const X=await s.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(X.home&&(L.value=X.home),s.defaultPath&&(await ee(s.defaultPath),!l.value))return;L.value?await ee(L.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),xn(()=>{_&&clearTimeout(_),F&&clearTimeout(F)}),(X,fe)=>(b(),xe($r,{open:i.value,"onUpdate:open":fe[2]||(fe[2]=ce=>i.value=ce),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:fe[3]||(fe[3]=ce=>o("close"))},{default:Ee(()=>[w("div",dve,[l.value?re("",!0):(b(),N("div",fve,[ie(Pn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:J},{default:Ee(()=>[ie(Ke,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),w("div",hve,[(b(!0),N(Be,null,st(Z.value,(ce,We)=>(b(),N(Be,{key:ce.path},[We>1?(b(),N("span",pve,"/")):re("",!0),w("button",{class:Pe(["crumb",{last:We===Z.value.length-1}]),onClick:ge=>ee(ce.path)},O(ce.label),11,mve)],64))),128))])])),!r.value||l.value?(b(),N("div",{key:1,class:Pe(["filterbar",{"has-error":g.value==="not-found"||g.value==="bad-parent"}])},[ie(Ke,{class:"filter-icon",name:"search",size:"md"}),Fn(w("input",{ref_key:"filterEl",ref:$,"onUpdate:modelValue":fe[0]||(fe[0]=ce=>d.value=ce),class:"filter-input",type:"text",placeholder:P.value,autocomplete:"off",spellcheck:"false",onKeydown:xt(U,["stop"])},null,40,gve),[[po,d.value]]),f.value||g.value==="checking"?(b(),xe(To,{key:0,size:"sm"})):re("",!0)],2)):re("",!0),l.value?(b(),N("div",Ove,O(C(n)("workspace.degradedHint")),1)):(b(),N("div",vve,[r.value?(b(),N("div",yve,O(C(n)("workspace.browsing")),1)):k.value&&g.value!=="valid"?(b(),N(Be,{key:1},[g.value==="checking"?(b(),N("div",kve,O(C(n)("workspace.checkingPath")),1)):g.value==="not-found"?(b(),N(Be,{key:1},[A.value.length>0?(b(),N("div",bve,O(C(n)("workspace.pathPickHint")),1)):re("",!0),(b(!0),N(Be,null,st(A.value,ce=>(b(),N("button",{key:ce.path,class:"folder-row",onClick:We=>R(ce.name)},[ie(Ke,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",_ve,O(ce.name),1),ce.isGitRepo?(b(),xe(wo,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ye(O(C(n)("workspace.gitTag")),1),ce.branch?(b(),N("span",wve,O(ce.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,xve))),128)),A.value.length===0?(b(),N("div",Sve,O(C(n)("workspace.noPathMatch",{parent:v.value})),1)):re("",!0)],64)):g.value==="bad-parent"?(b(),N("div",Cve,O(C(n)("workspace.badParent",{parent:v.value})),1)):re("",!0)],64)):h.value&&!k.value?(b(),N(Be,{key:2},[(b(!0),N(Be,null,st(p.value,ce=>(b(),N("button",{key:ce.path,class:"folder-row",onClick:We=>ee(ce.path)},[ie(Ke,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Mve,O(ce.rel),1),ce.isGitRepo?(b(),xe(wo,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ye(O(C(n)("workspace.gitTag")),1),ce.branch?(b(),N("span",Eve,O(ce.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,Ave))),128)),!f.value&&p.value.length===0?(b(),N("div",Tve,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&p.value.length===0?(b(),N("div",Nve,O(C(n)("workspace.searching")),1)):re("",!0)],64)):(b(),N(Be,{key:3},[(b(!0),N(Be,null,st(u.value,ce=>(b(),N("button",{key:ce.path,class:"folder-row",onClick:We=>de(ce)},[ie(Ke,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",$ve,O(ce.name),1),ce.isGitRepo?(b(),xe(wo,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Ye(O(C(n)("workspace.gitTag")),1),ce.branch?(b(),N("span",Lve,O(ce.branch),1)):re("",!0)]),_:2},1024)):re("",!0)],8,Ive))),128)),u.value.length===0?(b(),N("div",Fve,O(C(n)("workspace.noSubfolders")),1)):re("",!0)],64))])),e.error?(b(),N("div",Rve,O(e.error),1)):re("",!0),w("div",Bve,[ie(Xt,{text:a.value},{default:Ee(()=>[l.value?re("",!0):(b(),xe(Ut,{key:0,variant:"primary",disabled:!z.value,onClick:Y},{default:Ee(()=>[Ye(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ie(Ut,{variant:"secondary",onClick:fe[1]||(fe[1]=ce=>o("close"))},{default:Ee(()=>[Ye(O(C(n)("workspace.cancel")),1)]),_:1})]),w("div",Dve,O(W.value),1)])]),_:1},8,["open","title"]))}}),zve=dt(Wve,[["__scopeId","data-v-b24b02ce"]]),Uve={key:0,class:"confirm-dialog__message"},jve=Ve({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=Q(null);function s(){const c=n.value?.$el;return c instanceof HTMLElement?c:null}const o=e,i=t,{t:r}=Lt();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),rs(()=>{typeof window<"u"&&window.removeEventListener("keydown",a)}),(c,u)=>(b(),xe($r,{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:Ee(()=>[ie(Ut,{variant:"secondary",disabled:e.loading,onClick:l},{default:Ee(()=>[Ye(O(e.cancelLabel??C(r)("common.cancel")),1)]),_:1},8,["disabled"]),ie(Ut,{ref_key:"confirmButtonRef",ref:n,variant:e.variant,loading:e.loading,onClick:u[0]||(u[0]=d=>i("confirm"))},{default:Ee(()=>[Ye(O(e.confirmLabel??C(r)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(b(),N("p",Uve,O(e.message),1)):re("",!0)]),_:1},8,["open","title"]))}}),qve=dt(jve,[["__scopeId","data-v-76e206e7"]]),Vve=Ve({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=Cl();return(s,o)=>(b(),xe(qve,{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"]))}}),Kve={class:"rows"},Gve={class:"row"},Yve={class:"row"},Zve={class:"row"},Qve={class:"row"},Xve={class:"row"},Jve={class:"row"},eye={class:"ctx-text"},tye={key:0,class:"bar"},nye={class:"row"},sye=Ve({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Lt(),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(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const c=D(()=>{const h=s.status.permission;return h==="yolo"?"var(--color-danger)":h==="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),p=D(()=>f.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));return(h,m)=>(b(),xe($r,{open:i.value,"onUpdate:open":m[0]||(m[0]=_=>i.value=_),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=_=>o("close"))},{default:Ee(()=>[w("dl",Kve,[w("div",Gve,[w("dt",null,O(C(n)("status.statusModel")),1),w("dd",null,O(e.status.model),1)]),w("div",Yve,[w("dt",null,O(C(n)("status.statusThinking")),1),w("dd",null,O(e.thinking),1)]),w("div",Zve,[w("dt",null,O(C(n)("status.statusPermission")),1),w("dd",{style:Jt({color:c.value})},O(a(e.status.permission)),5)]),w("div",Qve,[w("dt",null,O(C(n)("status.statusPlanMode")),1),w("dd",{class:Pe({"plan-on":e.planMode})},O(u.value),3)]),w("div",Xve,[w("dt",null,O(C(n)("status.statusSwarmMode")),1),w("dd",{class:Pe({"swarm-on":e.swarmMode})},O(d.value),3)]),w("div",Jve,[w("dt",null,O(C(n)("status.statusContext")),1),w("dd",null,[w("span",eye,O(l.value),1),e.status.ctxMax>0?(b(),N("span",tye,[w("i",{style:Jt({width:r.value+"%"})},null,4)])):re("",!0)])]),w("div",nye,[w("dt",null,O(C(n)("status.statusCost")),1),w("dd",null,O(p.value),1)])])]),_:1},8,["open","title"]))}}),oye=dt(sye,[["__scopeId","data-v-59dd31f3"]]),iye={class:"ui-toast__icon","aria-hidden":"true"},rye={class:"ui-toast__body"},lye={class:"ui-toast__title"},aye={key:0,class:"ui-toast__msg"},cye=Ve({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(b(),N("div",{class:Pe(["ui-toast",`ui-toast--${e.variant}`])},[w("span",iye,[On(t.$slots,"icon",{},()=>[e.variant==="success"?(b(),xe(Ke,{key:0,name:"check"})):e.variant==="danger"?(b(),xe(Ke,{key:1,name:"close"})):e.variant==="warning"?(b(),xe(Ke,{key:2,name:"alert-triangle"})):(b(),xe(Ke,{key:3,name:"info"}))],!0)]),w("div",rye,[w("div",lye,O(e.title),1),e.message?(b(),N("div",aye,O(e.message),1)):re("",!0),On(t.$slots,"default",{},void 0,!0)]),ie(Pn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=s=>t.$emit("dismiss"))},{default:Ee(()=>[ie(Ke,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),uye=dt(cye,[["__scopeId","data-v-adc6f346"]]),dye={key:0,class:"actions"},fye=["onClick"],hye=["onClick"],pye={key:1,class:"details"},mye=Ve({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=Lt();function i(x){return typeof x=="object"&&x!==null}function r(x){return i(x)?x.title:x}function l(x){return i(x)?x.message??"":""}function a(x){return i(x)?x.details:void 0}function c(x){return i(x)?x.severity==="error":x.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function u(x){return i(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function d(x){if(!i(x))return x;const E=[x.title];x.message&&E.push(x.message);const T=x.details??[];if(T.length>0){E.push("",`${o("warnings.diagnostics")}:`);for(const F of T)E.push(`${F.label}: ${F.value}`)}return E.join(`
322
+ `)}let f=1;const p=Q([]),h=new Map,m=new Map;function _(x){const E=c(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function k(x,E){const T=h.get(x)??{handle:null,deadline:0,remaining:0};T.handle=setTimeout(()=>$(x),E),T.deadline=Date.now()+E,h.set(x,T)}function g(x){const E=h.get(x);E&&E.handle!==null&&clearTimeout(E.handle),h.delete(x)}function v(x){const E=h.get(x);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function y(x){if(p.value.find(F=>F.id===x)?.detailsOpen)return;const T=h.get(x);!T||T.handle!==null||k(x,T.remaining)}function A(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?v(x.id):y(x.id)}async function L(x){if(!await Zs(d(x.warning)))return;x.copied=!0;const T=m.get(x.id);T&&clearTimeout(T),m.set(x.id,setTimeout(()=>{x.copied=!1,m.delete(x.id)},1400))}function $(x){g(x);const E=m.get(x);E&&clearTimeout(E),m.delete(x);const T=p.value.findIndex(F=>F.id===x);T!==-1&&(p.value=p.value.filter(F=>F.id!==x),s("dismiss",T))}return Ge(()=>n.warnings,x=>{const E=[...p.value];p.value=x.map(T=>{const F=u(T),S=E.findIndex(R=>R.key===F),I=S===-1?void 0:E.splice(S,1)[0];if(I)return I.warning=T,I;const B={id:f++,key:F,warning:T,detailsOpen:!1,copied:!1};return k(B.id,_(T)),B});for(const T of E){g(T.id);const F=m.get(T.id);F&&clearTimeout(F),m.delete(T.id)}},{immediate:!0,flush:"post"}),xn(()=>{h.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),h.clear(),m.forEach(x=>clearTimeout(x)),m.clear()}),(x,E)=>(b(),xe(E9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(b(!0),N(Be,null,st(p.value,T=>(b(),xe(uye,{key:T.id,variant:c(T.warning)?"danger":"warning",title:r(T.warning),message:l(T.warning),"dismiss-label":C(o)("warnings.dismiss"),onDismiss:F=>$(T.id),onPointerenter:F=>v(T.id),onPointerleave:F=>y(T.id)},{default:Ee(()=>[a(T.warning)?.length?(b(),N("div",dye,[w("button",{class:"link",type:"button",onClick:F=>A(T)},O(T.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,fye),w("button",{class:"link",type:"button",onClick:F=>L(T)},O(T.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,hye)])):re("",!0),T.detailsOpen&&a(T.warning)?.length?(b(),N("dl",pye,[(b(!0),N(Be,null,st(a(T.warning),F=>(b(),N("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}))}}),gye=dt(mye,[["__scopeId","data-v-92efeff8"]]),vye={class:"topbar"},yye={class:"wsq"},kye=["aria-label"],bye={class:"tb-path"},xye={class:"ws"},_ye={class:"se"},wye={class:"tb-sub"},Sye=Ve({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Lt(),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(),N("div",vye,[w("span",yye,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",bye,[w("span",xye,O(r.value),1),e.sessionTitle?(b(),N(Be,{key:0},[c[2]||(c[2]=w("span",{class:"sl"},"/",-1)),w("span",_ye,O(e.sessionTitle),1)],64)):re("",!0),c[3]||(c[3]=w("span",{class:"cv"},"⌄",-1))]),w("span",wye,[w("span",{class:Pe(["rd",{on:e.running}])},null,2),w("span",null,O(l.value),1),e.branch?(b(),N(Be,{key:0},[Ye(" · "+O(e.branch),1)],64)):re("",!0),e.sessionCount>0?(b(),N(Be,{key:1},[Ye(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):re("",!0)])],8,kye),ie(Pn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},{default:Ee(()=>[ie(Ke,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Cye=dt(Sye,[["__scopeId","data-v-59a11935"]]),Aye={key:0,class:"sheet-root"},Mye=["aria-label"],Eye=["aria-label"],Tye={key:0,class:"sheet-head"},Nye={class:"sheet-title"},Iye={class:"sheet-body"},$ye=Ve({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Lt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ge(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),xn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(b(),xe(gl,{name:"sheet"},{default:Ee(()=>[e.modelValue?(b(),N("div",Aye,[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,Eye),e.title?(b(),N("div",Tye,[w("span",Nye,O(e.title),1)])):re("",!0),w("div",Iye,[On(l.$slots,"default",{},void 0,!0)])],8,Mye)])):re("",!0)]),_:3}))}}),i8=dt($ye,[["__scopeId","data-v-4441dd70"]]),Lye={class:"mlist"},Fye={key:0,class:"mempty"},Oye=["onClick"],Rye={class:"mgh-main"},Bye={class:"mgh-name"},Dye={class:"mgh-path"},Pye={key:2,class:"att"},Hye={key:0,class:"mempty small"},Wye=["onClick"],zye={class:"m"},Uye={class:"s"},jye={key:0,class:"att"},qye=["disabled","onClick"],Vye=["onClick"],Kye=Ve({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Lt(),{confirm:s}=Cl(),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 p(S){const I=new Set(d.value);I.has(S)?I.delete(S):I.add(S),d.value=I,y.value=null,x.value=null}const h=Q(new Set);function m(S){return h.value.has(S)}function _(S){const I=new Set(h.value);I.has(S)?I.delete(S):I.add(S),h.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(B=>B.id===o.activeId)){const B=S.sessions.find(R=>R.id===o.activeId);if(B)return[...I,B]}return I}function g(S){if(!h.value.has(S)){const I=new Set(h.value);I.add(S),h.value=I}i("loadMore",S)}function v(S){return o.attentionByWorkspace[S]??0}const y=Q(null);function A(S){y.value=y.value===S?null:S,x.value=null}function L(S){y.value=null;const B=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();B&&i("rename",S.id,B)}async function $(S){y.value=null,await s({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const x=Q(null);function E(S){x.value=x.value===S?null:S,y.value=null}function T(S){Zs(S.root),x.value=null}async function F(S){x.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(),xe(i8,{"model-value":e.modelValue,"onUpdate:modelValue":I[2]||(I[2]=B=>i("update:modelValue",B))},{default:Ee(()=>[w("button",{type:"button",class:"newrow",onClick:c},[ie(Ke,{name:"message",size:"sm"}),Ye(" "+O(C(n)("sidebar.newChat")),1)]),w("button",{type:"button",class:"newrow secondary",onClick:u},[ie(Ke,{name:"folder",size:"sm"}),Ye(" "+O(C(n)("sidebar.newWorkspace")),1)]),w("div",Lye,[e.groups.length===0?(b(),N("div",Fye,O(C(n)("workspace.noWorkspace")),1)):re("",!0),(b(!0),N(Be,null,st(e.groups,B=>(b(),N("div",{key:B.workspace.id,class:"mgroup"},[w("div",{class:Pe(["mgh",{on:B.workspace.id===e.activeWorkspaceId}]),onClick:R=>p(B.workspace.id)},[f(B.workspace.id)?(b(),xe(Ke,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(b(),xe(Ke,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),w("div",Rye,[w("span",Bye,O(B.workspace.name),1),ie(Xt,{text:B.workspace.root},{default:Ee(()=>[w("span",Dye,O(B.workspace.branch||B.workspace.shortPath),1)]),_:2},1032,["text"])]),f(B.workspace.id)&&v(B.workspace.id)>0?(b(),N("span",Pye,O(v(B.workspace.id)),1)):re("",!0),ie(Pn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:xt(R=>E(B.workspace.id),["stop"])},{default:Ee(()=>[ie(Ke,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ie(Pn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:xt(R=>a(B.workspace.id),["stop"])},{default:Ee(()=>[ie(Ke,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),x.value===B.workspace.id?(b(),xe(la,{key:3,class:"kmenu wsmenu",onClick:I[0]||(I[0]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie($n,{size:"lg",onClick:R=>T(B.workspace)},{default:Ee(()=>[Ye(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ie($n,{size:"lg",danger:"",onClick:R=>F(B.workspace)},{default:Ee(()=>[Ye(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Oye),Fn(w("div",null,[B.sessions.length===0?(b(),N("div",Hye,O(C(n)("sidebar.noSessions")),1)):re("",!0),(b(!0),N(Be,null,st(k(B),R=>(b(),N("div",{key:R.id,class:Pe(["srow",{cur:R.id===e.activeId}]),onClick:P=>l(R.id)},[w("div",zye,[w("div",{class:Pe(["t",{run:R.busy,aborted:R.status==="aborted"}])},O(R.title),3),w("div",Uye,O(R.time),1)]),(e.attentionBySession[R.id]??0)>0?(b(),N("span",jye,O(e.attentionBySession[R.id]),1)):re("",!0),ie(Pn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:xt(P=>A(R.id),["stop"])},{default:Ee(()=>[ie(Ke,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===R.id?(b(),xe(la,{key:1,class:"kmenu",onClick:I[1]||(I[1]=xt(()=>{},["stop"]))},{default:Ee(()=>[ie($n,{size:"lg",onClick:P=>L(R)},{default:Ee(()=>[Ye(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ie($n,{size:"lg",danger:"",onClick:P=>$(R.id)},{default:Ee(()=>[Ye(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):re("",!0)],10,Wye))),128)),B.hasMore||B.loadingMore?(b(),N("button",{key:1,type:"button",class:"mshow-more",disabled:B.loadingMore,onClick:xt(R=>g(B.workspace.id),["stop"])},O(B.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,B.workspace.sessionCount-B.sessions.length)})),9,qye)):re("",!0),B.sessions.length>B.initialCount?(b(),N("button",{key:2,type:"button",class:"mshow-more",onClick:xt(R=>_(B.workspace.id),["stop"])},O(m(B.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:B.sessions.length-B.initialCount})),9,Vye)):re("",!0)],512),[[di,!f(B.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Gye=dt(Kye,[["__scopeId","data-v-7ca5a6a0"]]),Yye={class:"group-title"},Zye={class:"srow-main"},Qye={class:"srow-label"},Xye={class:"srow-sub"},Jye={class:"srow read-only"},eke={class:"srow-main"},tke={class:"srow-label"},nke={key:0,class:"srow-sub"},ske={class:"srow-main"},oke={class:"srow-label"},ike={class:"srow-sub"},rke=["aria-checked"],lke={class:"srow-main"},ake={class:"srow-label"},cke={class:"srow-sub"},uke=["aria-checked"],dke={class:"srow-main"},fke={class:"srow-label"},hke={class:"srow read-only"},pke={class:"srow-main"},mke={class:"srow-label"},gke={class:"srow-sub"},vke=["aria-label"],yke={class:"group-title"},kke={class:"srow-main"},bke={class:"srow-label"},xke={class:"srow-sub"},_ke={class:"srow read-only pref"},wke={class:"srow-main"},Ske={class:"srow-label"},Cke={class:"srow read-only pref"},Ake={class:"srow-main"},Mke={class:"srow-label"},Eke={class:"srow read-only pref"},Tke={class:"srow-main"},Nke={class:"srow-label"},Ike={class:"num-field"},$ke=["value","aria-label"],Lke={class:"srow-main"},Fke={class:"srow-label"},Oke={class:"srow-sub"},Rke=["aria-checked"],Bke={class:"srow-main"},Dke={class:"srow-label"},Pke={class:"srow-main"},Hke={class:"srow-label"},Wke={key:2,class:"srow read-only"},zke={class:"srow-main"},Uke={class:"srow-label"},jke={class:"srow-val dim"},qke={class:"arch-subhead"},Vke={class:"arch-count"},Kke={class:"arch-tools"},Gke={key:0,class:"arch-empty"},Yke={class:"arch-meta"},Zke={class:"arch-name"},Qke={class:"arch-time"},Xke={key:2,class:"arch-empty"},Jke=100,e2e=Ve({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Lt(),s=e,o=t;function i(de){o("setColorScheme",de)}const r=["manual","auto","yolo"],l=D(()=>s.models?.find(de=>de.id===s.status?.modelId)),a=D(()=>Rd(l.value)),c=D(()=>xk(l.value)),u=D(()=>Sa(l.value,s.thinking??"off")),d=D(()=>{const de=c.value,J=u.value;return de.includes(J)?J:de.includes("on")?"on":de[0]??"off"}),f=D(()=>c.value.map(de=>({value:de,label:Tv(de)}))),p=D(()=>s.planMode===!0),h=D(()=>s.swarmMode===!0),m=D(()=>{const de=s.status.permission;return de==="yolo"?"var(--color-danger)":de==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),_=D(()=>{const de=s.status.permission,J=n(de==="yolo"?"mobile.permYoloSub":de==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${de} · ${J}`}),k=de=>`${Math.round(de/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(de){o("setThinking",_k(l.value,de))}function A(){const de=r.indexOf(s.status.permission),J=r[(de+1)%r.length];o("setPermission",J)}function L(){o("pickModel"),o("update:modelValue",!1)}function $(){o("login"),o("update:modelValue",!1)}function x(){o("logout"),o("update:modelValue",!1)}const E=Vk(),T=Q("main"),F=Q([]),S=Q(!1),I=Q(!1),B=Q(""),R=Q("archived-desc");async function P(){if(!S.value){S.value=!0,I.value=!1;try{const de=[];let J;for(;;){const Y=await E.loadArchivedSessions({beforeId:J,pageSize:Jke});if(de.push(...Y.items),!Y.hasMore||Y.items.length===0)break;const X=Y.items.at(-1)?.id;if(X===void 0)break;J=X}F.value=de,I.value=!0}catch(de){console.warn("loadAllArchived failed",de)}finally{S.value=!1}}}function W(){T.value="archived",B.value="",P()}function U(){T.value="main"}const Z=D(()=>{const de=B.value.trim().toLowerCase();let J=F.value.filter(Y=>Y.archived===!0);return de&&(J=J.filter(Y=>Y.title.toLowerCase().includes(de))),J=J.slice(),R.value==="archived-desc"?J.sort((Y,X)=>X.updatedAt.localeCompare(Y.updatedAt)):R.value==="created-desc"?J.sort((Y,X)=>X.createdAt.localeCompare(Y.createdAt)):J.sort((Y,X)=>Y.title.localeCompare(X.title,"zh")),J});async function z(de){await E.restoreSession(de)&&(F.value=F.value.filter(Y=>Y.id!==de))}function ee(de){const J=new Date(de);if(Number.isNaN(J.getTime()))return de;const Y=X=>String(X).padStart(2,"0");return`${J.getFullYear()}-${Y(J.getMonth()+1)}-${Y(J.getDate())} ${Y(J.getHours())}:${Y(J.getMinutes())}`}return Ge(()=>s.modelValue,de=>{de||(T.value="main")}),(de,J)=>(b(),xe(i8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":J[6]||(J[6]=Y=>o("update:modelValue",Y))},{default:Ee(()=>[T.value==="main"?(b(),N(Be,{key:0},[w("div",Yye,O(C(n)("mobile.groupSession")),1),w("button",{type:"button",class:"srow",onClick:L},[w("span",Zye,[w("span",Qye,O(C(n)("status.statusModel")),1),w("span",Xye,O(e.status.model),1)]),J[7]||(J[7]=w("span",{class:"chev"},"›",-1))]),w("div",Jye,[w("span",eke,[w("span",tke,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(b(),N("span",nke,O(C(n)("status.modeNotSupported")),1)):re("",!0)]),c.value.length>1?(b(),xe(ro,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(b(),N("span",{key:1,class:Pe(["srow-val",{dim:d.value==="off"}])},O(d.value==="off"?C(n)("status.planOff"):C(Tv)(d.value)),3))]),w("button",{type:"button",class:"srow",onClick:J[0]||(J[0]=Y=>o("togglePlan"))},[w("span",ske,[w("span",oke,O(C(n)("status.statusPlanMode")),1),w("span",ike,O(C(n)("mobile.planModeSub")),1)]),w("span",{class:Pe(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,rke)]),w("button",{type:"button",class:"srow",onClick:J[1]||(J[1]=Y=>o("toggleSwarm"))},[w("span",lke,[w("span",ake,O(C(n)("status.statusSwarmMode")),1),w("span",cke,O(C(n)("mobile.swarmModeSub")),1)]),w("span",{class:Pe(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,uke)]),w("button",{type:"button",class:"srow",onClick:A},[w("span",dke,[w("span",fke,O(C(n)("status.statusPermission")),1),w("span",{class:"srow-sub",style:Jt({color:m.value})},O(_.value),5)]),J[8]||(J[8]=w("span",{class:"chev"},"›",-1))]),w("div",hke,[w("span",pke,[w("span",mke,O(C(n)("status.statusContext")),1),w("span",gke,O(v.value),1)]),w("span",{class:"ctx-meter","aria-label":v.value},[w("i",{style:Jt({width:g.value+"%"})},null,4)],8,vke)]),w("div",yke,O(C(n)("mobile.groupApp")),1),w("button",{type:"button",class:"srow",onClick:W},[w("span",kke,[w("span",bke,O(C(n)("mobile.archivedSessions")),1),w("span",xke,O(C(n)("mobile.archivedSessionsSub")),1)]),J[9]||(J[9]=w("span",{class:"chev"},"›",-1))]),w("div",_ke,[w("span",wke,[w("span",Ske,O(C(n)("theme.colorSchemeLabel")),1)]),ie(ro,{"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",Cke,[w("span",Ake,[w("span",Mke,O(C(n)("sidebar.language")),1)]),ie(s8)]),w("div",Eke,[w("span",Tke,[w("span",Nke,O(C(n)("settings.uiFontSize")),1)]),w("label",Ike,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:J[2]||(J[2]=Y=>o("setUiFontSize",Number(Y.target.value)))},null,40,$ke),J[10]||(J[10]=w("span",{class:"num-unit"},"px",-1))])]),w("button",{type:"button",class:"srow",onClick:J[3]||(J[3]=Y=>o("setConversationToc",!e.conversationToc))},[w("span",Lke,[w("span",Fke,O(C(n)("settings.conversationToc")),1),w("span",Oke,O(C(n)("settings.conversationTocHint")),1)]),w("span",{class:Pe(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Rke)]),e.authReady?(b(),N("button",{key:0,type:"button",class:"srow acct out",onClick:x},[w("span",Bke,[w("span",Dke,O(C(n)("sidebar.signOut")),1)])])):(b(),N("button",{key:1,type:"button",class:"srow acct in",onClick:$},[w("span",Pke,[w("span",Hke,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(b(),N("div",Wke,[w("span",zke,[w("span",Uke,O(C(n)("settings.serverVersion")),1)]),w("span",jke,O(e.serverVersion),1)])):re("",!0)],64)):(b(),N(Be,{key:1},[w("div",qke,[w("button",{type:"button",class:"arch-back",onClick:U},[J[11]||(J[11]=w("span",{class:"chev back"},"‹",-1)),Ye(" "+O(C(n)("mobile.archivedBack")),1)]),w("span",Vke,O(C(n)("mobile.sessionCount",{n:Z.value.length})),1)]),w("div",Kke,[ie(Ec,{class:"arch-search-input","model-value":B.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":J[4]||(J[4]=Y=>B.value=Y)},null,8,["model-value","placeholder"]),ie(ro,{size:"sm","model-value":R.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":J[5]||(J[5]=Y=>R.value=Y)},null,8,["model-value","options"])]),S.value?(b(),N("div",Gke,O(C(n)("settings.archivedLoadingAll")),1)):Z.value.length>0?(b(!0),N(Be,{key:1},st(Z.value,Y=>(b(),N("div",{key:Y.id,class:"arch-row"},[w("div",Yke,[w("div",Zke,O(Y.title),1),w("div",Qke,O(C(n)("settings.archivedAt",{time:ee(Y.updatedAt)})),1)]),ie(Ut,{variant:"secondary",size:"sm",onClick:X=>z(Y.id)},{default:Ee(()=>[Ye(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(b(),N("div",Xke,O(F.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),t2e=dt(e2e,[["__scopeId","data-v-24273113"]]),n2e={class:"ob-brand"},s2e={class:"ob-brand-text"},o2e={class:"ob-title"},i2e={class:"ob-sub"},r2e={class:"ob-sec"},l2e={class:"ob-label"},a2e={class:"ob-sec"},c2e={class:"ob-label"},u2e={class:"ob-sec"},d2e={class:"ob-label"},f2e=Ve({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:s,locale:o}=Lt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=v5();function c(d){o.value!==d&&uA(d)}function u(){n("complete")}return(d,f)=>(b(),xe($r,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=p=>n("skip"))},{head:Ee(()=>[w("div",n2e,[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",s2e,[w("div",o2e,O(C(s)("onboarding.title")),1),w("div",i2e,O(C(s)("onboarding.subtitle")),1)])])]),default:Ee(()=>[w("section",r2e,[w("div",l2e,O(C(s)("onboarding.languageLabel")),1),ie(ro,{"model-value":C(o),options:C(cA).map(p=>({value:p.code,label:p.label})),"onUpdate:modelValue":f[0]||(f[0]=p=>c(p))},null,8,["model-value","options"])]),w("section",a2e,[w("div",c2e,O(C(s)("theme.colorSchemeLabel")),1),ie(ro,{"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]=p=>C(l)(p))},null,8,["model-value","options"])]),w("section",u2e,[w("div",d2e,O(C(s)("theme.accentLabel")),1),ie(ro,{"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]=p=>C(a)(p))},null,8,["model-value","options"])]),ie(Ut,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Ye(O(C(s)("onboarding.start")),1)]),_:1})]),_:1}))}}),h2e=dt(f2e,[["__scopeId","data-v-fbdd3eab"]]),p2e=["aria-label"],m2e={class:"gload-box"},g2e={class:"gload-text"},v2e={key:0,class:"gload-issue"},y2e={class:"gload-issue-detail"},k2e=Ve({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Lt();return(n,s)=>(b(),N("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[w("div",m2e,[s[0]||(s[0]=iy('<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(To,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),w("div",g2e,O(C(t)("app.connecting")),1),e.issue?(b(),N("div",v2e,[w("div",null,O(C(t)("app.connectRetrying")),1),w("div",y2e,O(e.issue),1)])):re("",!0)])],8,p2e))}}),b2e=dt(k2e,[["__scopeId","data-v-0b6dec6a"]]),x2e={class:"kap-root"},_2e={class:"kap-head"},w2e={class:"kap-count"},S2e={class:"kap-head-actions"},C2e={class:"kap-filters"},A2e=["value"],M2e={class:"kap-check"},E2e={class:"kap-check"},T2e={class:"kap-view-toggle",role:"group"},N2e={key:0,class:"kap-empty"},I2e=["onClick"],$2e={class:"kap-ts"},L2e={class:"kap-label"},F2e={key:0,class:"kap-detail"},O2e={class:"kap-detail-actions"},R2e=["onClick"],B2e={key:1,class:"kap-agg"},D2e={class:"mono"},P2e={class:"mono"},H2e={class:"num"},W2e={class:"num"},z2e={key:0},U2e={class:"mono"},j2e={class:"num"},q2e={class:"num"},V2e={key:0},K2e=Ve({__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(()=>(yk.value,[...rse()])),c=D(()=>{const E=new Set;for(const T of a.value)T.sessionId&&E.add(T.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(T=>!(s.value!=="all"&&T.source!==s.value||i.value&&T.sessionId!==i.value||r.value&&!u(T)||E&&!`${T.label} ${T.kind} ${T.eventType??""} ${T.sessionId??""} ${T.requestId??""}`.toLowerCase().includes(E)))}),f=D(()=>{const E=new Map;for(const T of d.value){if(T.kind!=="ws:in"&&T.kind!=="ws:out")continue;const F=T.kind==="ws:in"?"←":"→",S=`${F} ${T.eventType??"?"} @ ${T.sessionId??"-"}`,I=E.get(S)??{key:S,sessionId:T.sessionId??"-",eventType:T.eventType??"?",dir:F,count:0};I.count++,T.seq!==void 0&&(I.lastSeq=T.seq),E.set(S,I)}return[...E.values()].sort((T,F)=>F.count-T.count)}),p=D(()=>{const E=new Map;for(const T of d.value){if(T.source!=="rest"||T.kind==="rest:request")continue;const F=`${T.method??"?"} ${T.path??"?"}`,S=E.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(T)&&S.errors++,T.durationMs!==void 0&&(S.totalMs+=T.durationMs,S.timed++),E.set(F,S)}return[...E.entries()].map(([T,F])=>({key:T,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((T,F)=>F.count-T.count)}),h=Q(null),m=Q(!0),_=Q(null),k=Q(null);Ge(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await vt();const E=_.value;E&&(E.scrollTop=E.scrollHeight)});function g(E){h.value=h.value===E?null:E}function v(E){const T=new Date(E),F=(S,I=2)=>String(S).padStart(I,"0");return`${F(T.getHours())}:${F(T.getMinutes())}:${F(T.getSeconds())}.${F(T.getMilliseconds(),3)}`}function y(E){return JSON.stringify(E,null,2)}async function A(E){await Zs(y(E))&&(k.value=E.id,setTimeout(()=>{k.value===E.id&&(k.value=null)},1500))}function L(){n5(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 x(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,T)=>(b(),N("section",x2e,[w("header",_2e,[T[11]||(T[11]=w("strong",null,"KAP debug",-1)),w("span",w2e,O(d.value.length)+"/"+O(a.value.length),1),w("div",S2e,[w("button",{type:"button",class:Pe({on:C(Eu)}),onClick:T[0]||(T[0]=F=>Eu.value=!C(Eu))},O(C(Eu)?"resume":"pause"),3),w("button",{type:"button",onClick:T[1]||(T[1]=F=>C(lse)())},"clear"),w("button",{type:"button",onClick:T[2]||(T[2]=F=>L())},"export jsonl"),ie(Xt,{text:"Close window"},{default:Ee(()=>[w("button",{type:"button",onClick:T[3]||(T[3]=F=>n("close"))},"✕")]),_:1})])]),w("div",C2e,[Fn(w("select",{"onUpdate:modelValue":T[4]||(T[4]=F=>s.value=F),"aria-label":"Source filter"},[...T[12]||(T[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),[[wg,s.value]]),Fn(w("select",{"onUpdate:modelValue":T[5]||(T[5]=F=>i.value=F),"aria-label":"Session filter"},[T[13]||(T[13]=w("option",{value:""},"all sessions",-1)),(b(!0),N(Be,null,st(c.value,F=>(b(),N("option",{key:F,value:F},O(F),9,A2e))),128))],512),[[wg,i.value]]),Fn(w("input",{"onUpdate:modelValue":T[6]||(T[6]=F=>o.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[po,o.value]]),w("label",M2e,[Fn(w("input",{"onUpdate:modelValue":T[7]||(T[7]=F=>r.value=F),type:"checkbox"},null,512),[[Nh,r.value]]),T[14]||(T[14]=Ye(" errors",-1))]),w("label",E2e,[Fn(w("input",{"onUpdate:modelValue":T[8]||(T[8]=F=>m.value=F),type:"checkbox"},null,512),[[Nh,m.value]]),T[15]||(T[15]=Ye(" follow",-1))]),w("div",T2e,[w("button",{type:"button",class:Pe({on:l.value==="timeline"}),onClick:T[9]||(T[9]=F=>l.value="timeline")},"timeline",2),w("button",{type:"button",class:Pe({on:l.value==="aggregate"}),onClick:T[10]||(T[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(b(),N("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(b(),N("div",N2e," No trace entries yet. REST calls and WS frames will appear here. ")):re("",!0),(b(!0),N(Be,null,st(d.value,F=>(b(),N("div",{key:F.id,class:"kap-row-wrap"},[w("button",{type:"button",class:Pe(["kap-row",{expanded:h.value===F.id}]),onClick:S=>g(F.id)},[w("span",$2e,O(v(F.ts)),1),w("span",{class:Pe(["kap-badge",$(F)])},O(x(F)),3),w("span",L2e,O(F.label),1)],10,I2e),h.value===F.id?(b(),N("div",F2e,[w("div",O2e,[w("button",{type:"button",onClick:S=>A(F)},O(k.value===F.id?"copied ✓":"copy json"),9,R2e)]),w("pre",null,O(y(F)),1)])):re("",!0)]))),128))],512)):(b(),N("div",B2e,[T[20]||(T[20]=w("h4",null,"WS frames by session / type",-1)),w("table",null,[T[17]||(T[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),N(Be,null,st(f.value,F=>(b(),N("tr",{key:F.key},[w("td",null,O(F.dir),1),w("td",D2e,O(F.eventType),1),w("td",P2e,O(F.sessionId),1),w("td",H2e,O(F.count),1),w("td",W2e,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(b(),N("tr",z2e,[...T[16]||(T[16]=[w("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):re("",!0)])]),T[21]||(T[21]=w("h4",null,"REST by endpoint",-1)),w("table",null,[T[19]||(T[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),N(Be,null,st(p.value,F=>(b(),N("tr",{key:F.key},[w("td",U2e,O(F.key),1),w("td",j2e,O(F.count),1),w("td",{class:Pe(["num",{err:F.errors>0}])},O(F.errors),3),w("td",q2e,O(F.avgMs),1)]))),128)),p.value.length===0?(b(),N("tr",V2e,[...T[18]||(T[18]=[w("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):re("",!0)])])]))]))}}),G2e=dt(K2e,[["__scopeId","data-v-3cda6fe3"]]),Y2e=Ve({__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 p of i){const h=d.getAttribute(p);h!==null?f.setAttribute(p,h):f.removeAttribute(p)}}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 h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));r(d),d.body.style.margin="0";const p=d.createElement("div");return p.style.height="100vh",d.body.appendChild(p),p}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=Ih(G2e,{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 gn(()=>{c()}),rs(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(b(),xe(Xt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[w("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),Z2e=dt(Y2e,[["__scopeId","data-v-21346738"]]);function Q2e({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)}Ge(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return xn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function X2e({running:e,showAuthGate:t}){const{t:n}=Lt(),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}Ge(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`});jE(()=>{typeof document<"u"&&(document.title=a.value)}),xn(()=>{l()})}const r8=Q(typeof window>"u"?0:window.innerWidth);let Uf=0,_p=!1;function Dv(){r8.value=window.innerWidth}function J2e(){_p||typeof window>"u"||(window.addEventListener("resize",Dv),_p=!0,Dv())}function ebe(){!_p||typeof window>"u"||(window.removeEventListener("resize",Dv),_p=!1)}function l8(e,t,n){return Math.max(t,e-n)}function Pv(e,t,n){return Math.min(n,Math.max(t,e))}function a8(){return gn(()=>{Uf+=1,J2e()}),rs(()=>{Uf=Math.max(0,Uf-1),Uf===0&&ebe()}),{viewportWidth:r8}}const tbe="kimi-web.file-preview-width",ic=320;function nbe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=a8(),i=D(()=>Math.max(0,o.value-t.value)),r=D(()=>l8(i.value,ic,ic));function l(he){return Pv(Math.round(he),ic,r.value)}function a(){return l(i.value/2)}const c=D(()=>a()),u=Q(c.value),d=D(()=>Pv(u.value,ic,r.value)),f=Q(null),p=D(()=>{const he=f.value;if(!he)return null;const ne=e.turns.value.find(ve=>ve.id===he.turnId)?.blocks?.[he.blockIndex];return ne?.kind==="thinking"?ne.thinking:null}),h=D(()=>p.value!==null);function m(he){const j=f.value;if(j&&j.turnId===he.turnId&&j.blockIndex===he.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=he}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const k=Q(null),g=D(()=>{const he=k.value;if(!he)return null;const j=e.turns.value.find(ne=>ne.id===he.turnId);return j?.role==="compaction"&&j.text?j.text:null}),v=D(()=>g.value!==null);function y(he){if(k.value?.turnId===he.turnId){k.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",k.value=he}function A(){k.value=null,n.value==="compaction"&&(n.value=null)}const L=Q(null);function $(he){const j=e.activeAppTasks.value,ne=j.find(ae=>ae.id===he)??j.find(ae=>ae.parentToolCallId===he);if(ne)return ne.id;const ve=j.filter(ae=>ae.kind==="subagent"&&!ae.parentToolCallId);if(ve.length===1)return ve[0].id}const x=D(()=>{const he=L.value;if(!he)return null;const j=e.activeAppTasks.value.find(ne=>ne.id===he.subagentId);return j?Bpe(j):null}),E=D(()=>x.value!==null);function T(he){const j=$(he);if(j){if(L.value?.subagentId===j){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:j},n.value="agent"}}function F(){L.value=null,n.value==="agent"&&(n.value=null)}const S=Q(null),I=D(()=>{const he=S.value;if(!he)return null;const j=rW(e.turns.value,he);return j?{id:he,title:xa(j.name),path:iW(j.arg),lines:j.status==="error"?null:hA(j),output:j.output}:null}),B=D(()=>I.value!==null);function R(he){if(n.value==="toolDiff"&&S.value===he){P();return}n.value="toolDiff",S.value=he}function P(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const W=Q("list"),U=Q(null);function Z(){if(n.value==="diff"){z();return}n.value="diff",W.value="list",U.value=null,e.loadGitStatus(e.activeSessionId.value)}function z(){n.value==="diff"&&(n.value=null),W.value="list",U.value=null,e.clearFileDiff()}async function ee(he){W.value="detail",U.value=he,await e.loadFileDiff(he)}async function de(he){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,he):await e.openSideChat(he),n.value="btw"}function J(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function Y(){n.value==="btw"&&(n.value=null)}const X=D(()=>e.sideChatVisible.value),fe=D(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||E.value)&&(n.value!=="toolDiff"||B.value)&&(n.value!=="btw"||X.value)),ce=Q(!1),We=Q({});function ge(){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(he){if(he)switch(he.kind){case"thinking":f.value={turnId:he.turnId,blockIndex:he.blockIndex},n.value="thinking";break;case"compaction":k.value={turnId:he.turnId},n.value="compaction";break;case"agent":L.value={subagentId:he.subagentId},n.value="agent";break;case"toolDiff":S.value=he.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function le(){return n.value==="thinking"&&h.value?(_(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&E.value?(F(),!0):n.value==="toolDiff"&&B.value?(P(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(z(),!0):n.value==="btw"?(J(),!0):!1}return Ge(e.activeSessionId,(he,j)=>{if(j){const ne=ge();ne?We.value[j]=ne:delete We.value[j]}s(),_(),A(),F(),P(),z(),Y(),he&&G(We.value[he])}),{PREVIEW_WIDTH_KEY:tbe,PREVIEW_MIN:ic,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:p,thinkingVisible:h,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:A,agentPanelMember:x,agentPanelVisible:E,openAgentPanel:T,closeAgentPanel:F,toolDiffTarget:I,toolDiffVisible:B,openToolDiff:R,closeToolDiff:P,detailDiffMode:W,detailDiffPath:U,openDiffDetail:Z,closeDiffDetail:z,selectDiffFile:ee,btwVisible:X,openSideChatTab:de,closeSideChat:J,hideSideChatPanel:Y,sidePanelVisible:fe,panelDragging:ce,closeOpenSidePanel:le}}const sbe=Ht.sidebarWidth,zC=Ht.sidebarCollapsed,UC=270,ig=170,obe=480,ibe=320;function rbe(e={}){const{viewportWidth:t}=a8(),n=Q(UC),s=Q(!1),o=Q(!1),i=D(()=>{const u=ibe+(h4(e.previewOpen)?ic:0);return Math.min(obe,l8(t.value,ig,u))}),r=D(()=>Pv(n.value,ig,i.value));function l(){try{s.value=ss(zC)==="true"}catch{s.value=!1}}function a(){try{ls(zC,String(s.value))}catch{}}function c(){s.value=!s.value,a()}return{SIDEBAR_WIDTH_KEY:sbe,SIDEBAR_DEFAULT:UC,SIDEBAR_MIN:ig,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:s,sidebarDragging:o,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function lbe({client:e,detailTarget:t}){const{t:n}=Lt(),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 p($){return $.length>1?$.replace(/\/+$/,""):$}function h($){const x=[];for(const E of $.split(/[\\/]+/))if(!(!E||E===".")){if(E===".."){x.pop();continue}x.push(E)}return x.join("/")}function m($){const x=$.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const E=p(e.status.value.cwd);if(x.startsWith("/")){if(!E||x!==E&&!x.startsWith(`${E}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=x===E?"":x.slice(E.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=h(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const T=h(x);return T?{path:T}:{error:n("filePreview.errors.emptyPath")}}async function _($){const x=s.value;if(t.value==="file"&&x&&x.path===$.path&&x.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 T=m($.path);if("error"in T){i.value=!1,r.value=T.error;return}l.value=T.path;try{const F=await e.readFileContent(T.path);if(E!==a)return;F?o.value={...F,path:F.path||T.path}:o.value={path:T.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 x=++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,mt().getFileBlob($.fileId).then(T=>{if(x===a){if(t.value!=="file"||!o.value){i.value=!1;return}c=URL.createObjectURL(T),o.value={...o.value,sourceUrl:c},i.value=!1}}).catch(()=>{x===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)}Ge(t,($,x)=>{x==="file"&&$!=="file"&&v()});function A(){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:_,openMediaPreview:g,closeFilePreview:y,openPreviewInEditor:A,revealPreviewFile:L}}const abe=640,cbe=`(max-width: ${abe}px)`;function ube(){const e=Q(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(cbe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),xn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),xn(()=>t.removeListener(n))),e}const dbe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},fbe={class:"server-auth-card"},hbe={class:"server-auth-body"},pbe={class:"server-auth-foot"},mbe=Ve({__name:"ServerAuthDialog",setup(e){const t=Q(""),n=Q(null),s=Q(!1);gn(()=>{vt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,o5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(b(),N("div",dbe,[w("div",fbe,[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"},[Ye(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),w("code",null,"KIMI_CODE_PASSWORD"),Ye("). ")])],-1)),w("div",hbe,[ie(Ec,{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",pbe,[ie(Ut,{variant:"primary",disabled:!t.value||s.value,loading:s.value,onClick:o},{default:Ee(()=>[Ye(O(s.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),gbe=dt(mbe,[["__scopeId","data-v-6f624612"]]),vbe=["aria-label"],ybe=Ve({__name:"InternalBuildBanner",setup(e){const{t}=Lt(),n=qR;return(s,o)=>C(n)?(b(),N("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,vbe)):re("",!0)}}),kbe=dt(ybe,[["__scopeId","data-v-166b3735"]]),bbe={class:"app-shell"},xbe={key:1,class:"auth-page"},_be={class:"auth-page-inner"},wbe={class:"auth-page-copy"},Sbe=["aria-label","aria-hidden"],Cbe=Ve({__name:"App",setup(e){kse();const t=Q(!1);let n=null;const s=Vk(),o=D(()=>!s.dangerousBypassAuth.value&&t.value);In("resolveImage",s.resolveImageUrl),In("resolveSwarmMembers",ct=>s.swarmMembersByToolCallId.value.get(ct)??[]);const{t:i}=Lt(),r=Ii(),l=ube(),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"),p=Q(null),{showAuthGate:h,blinkAuthLogo:m}=Q2e({client:s,authLogoRef:p});X2e({running:f,showAuthGate:h});function _(ct){const be=s.models.value.find(nt=>nt.id===s.status.value.modelId),Fe=xk(be),Vt=Sa(be,ct),Lo=Fe.indexOf(Vt),qe=Fe[(Lo+1)%Fe.length]??Fe[0]??"off";return _k(be,qe)}const k=Q(!s.onboarded.value);function g(){s.setOnboarded(!0),k.value=!1}function v(){k.value=!0}gn(()=>{n=_se(()=>{t.value=!0,s.clearDangerousBypassAuth()}),s.load(),ce(),document.addEventListener("keydown",y,!0)}),xn(()=>{document.removeEventListener("keydown",y,!0),n!==null&&(n(),n=null)});function y(ct){ct.key==="Escape"&&(Xn.value||it()&&(ct.stopPropagation(),ct.preventDefault()))}const A=Q(null),L=Q(!1);Ge(s.activeSessionId,()=>{L.value=!0,vt(()=>{L.value=!1})});const{previewTarget:$,previewFile:x,previewLoading:E,previewError:T,previewDownloadUrl:F,previewExternalActions:S,openFilePreview:I,openMediaPreview:B,closeFilePreview:R,openPreviewInEditor:P,revealPreviewFile:W}=lbe({client:s,detailTarget:A}),U=D(()=>A.value!==null),{SIDEBAR_WIDTH_KEY:Z,SIDEBAR_DEFAULT:z,SIDEBAR_MIN:ee,sidebarMax:de,sessionColWidth:J,sidebarCollapsed:Y,sidebarDragging:X,sideWidth:fe,loadSidebarCollapsed:ce,toggleSidebarCollapse:We}=rbe({previewOpen:U}),{PREVIEW_WIDTH_KEY:ge,PREVIEW_MIN:G,previewDefaultWidth:le,previewMax:he,previewWidth:j,previewPanelWidth:ne,thinkingPanelText:ve,thinkingVisible:ae,openThinkingPanel:ye,closeThinkingPanel:q,compactionPanelText:se,compactionPanelVisible:me,openCompactionPanel:Te,closeCompactionPanel:Me,agentPanelMember:$e,openAgentPanel:pe,closeAgentPanel:Ie,toolDiffTarget:Qe,openToolDiff:lt,closeToolDiff:_t,detailDiffMode:St,detailDiffPath:Tt,openDiffDetail:Ct,closeDiffDetail:gt,selectDiffFile:nn,btwVisible:rn,openSideChatTab:Qn,closeSideChat:Zt,sidePanelVisible:fn,panelDragging:hn,closeOpenSidePanel:it}=nbe({client:s,sideWidth:fe,detailTarget:A,closeFilePreview:R}),zn=Q(null),Hn=Q(!1),Wn=Q(!1),Ze=Q(!1),Xe=Q(!1),Dt=Q(!1),Pt=Q(!1),an=Q(null),wn=Q(null),Xn=D(()=>ec.value>0||Hn.value||Wn.value||Ze.value||Xe.value||Dt.value||Pt.value||k.value||a.value||c.value),Ss=Q(!1),as=Q(!1),vn=Q(!1),Ft=Q(!1),Cs=Q(!1);async function sn(){Ss.value=!0,as.value=!1,Hn.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{as.value=!0}finally{Ss.value=!1}}async function Xs(){vn.value=!0,Ft.value=!1,Wn.value=!0;try{await s.loadProviders()}catch{Ft.value=!0}finally{vn.value=!1}}function cs(){Ze.value=!0}async function No(ct){Hn.value=!1,await Zo(ct)}async function Zo(ct){await s.setModel(ct)&&ct!==s.defaultModel.value&&s.updateConfig({defaultModel:ct})}async function As(ct){await s.addProvider(ct)}async function Qo(ct){await s.deleteProvider(ct)}async function jt(ct){await s.refreshProvider(ct)}async function Xo(ct){Cs.value=!0;try{await s.updateConfig(ct)&&await s.checkAuth()}finally{Cs.value=!1}}async function Io(){return s.startOAuthLogin()}async function mo(){return s.pollOAuthLogin()}async function Jn(){return s.cancelOAuthLogin()}async function os(){Ze.value=!1,await s.checkAuth(),await s.load()}async function Yi(ct){await s.undo(1),await vt(),zn.value?.loadComposerForEdit(ct.text,ct.images)}function Is(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?Zt():Qn(be||void 0);return}switch(ct){case"/new":case"/clear":ks();break;case"/fork":s.forkSession();break;case"/undo":s.undo();break;case"/permission":{const be=s.permission.value,Fe=be==="manual"?"auto":be==="auto"?"yolo":"manual";s.setPermission(Fe);break}case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(_(s.thinking.value));break;case"/help":s.dismissWarning(-1);break;case"/status":Dt.value=!0;break;case"/model":sn();break;case"/provider":break;case"/login":cs();break;default:{const be=ct.indexOf(" "),Fe=oie((be===-1?ct:ct.slice(0,be)).slice(1)),Vt=be===-1?void 0:ct.slice(be+1).trim()||void 0;if(!Fe)break;!s.activeSessionId.value&&s.activeWorkspaceId.value?s.startSessionAndActivateSkill(s.activeWorkspaceId.value,Fe,Vt):s.activateSkill(Fe,Vt);break}}}function Zi(ct){s.unqueue(ct)}function $s(ct){s.unqueue(ct)}function us(ct){s.reorderQueue(ct.from,ct.to)}async function Us(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){an.value=ct,Xe.value=!0;return}s.sendPrompt(ct.text,ct.attachments)}async function Un(ct){if(wn.value=null,!await s.addWorkspaceByPath(ct)){wn.value=i("workspace.addFailed");return}Xe.value=!1;const Fe=an.value;an.value=null;const Vt=s.activeWorkspaceId.value;Fe&&Vt&&await s.startSessionAndSendPrompt(Vt,Fe.text,Fe.attachments)}function $o(){an.value=null,wn.value=null,Xe.value=!1}function Jo(){vt(()=>{zn.value?.focusComposer()})}function ks(){const ct=s.activeWorkspaceId.value;ct?s.openWorkspaceDraft(ct):s.clearActiveSession(),Jo()}function jn(ct){s.openWorkspaceDraft(ct),Jo()}function ds(ct){ct&&window.open(ct,"_blank","noopener")}return(ct,be)=>(b(),N("div",bbe,[o.value?(b(),xe(gbe,{key:0})):re("",!0),C(h)?(b(),N("section",xbe,[w("div",_be,[(b(),N("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:be[0]||(be[0]=xt(()=>{},["prevent"])),onClick:be[1]||(be[1]=(...Fe)=>C(m)&&C(m)(...Fe))},[...be[96]||(be[96]=[iy('<defs data-v-97411642><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-97411642><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-97411642></rect><g class="ch-eyes" fill="#000" data-v-97411642><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-97411642></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-97411642></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-97411642></rect>',2)])],544)),w("div",wbe,[w("h1",null,O(C(i)("app.authPageTitle")),1),w("p",null,O(C(i)("app.authPageMessage")),1)]),ie(Ut,{class:"auth-page-btn",variant:"primary",onClick:cs},{default:Ee(()=>[ie(Ke,{name:"log-in",size:"md"}),w("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(b(),N("div",{key:2,class:Pe(["app",{mobile:C(l),"sidebar-collapsed":C(Y)&&!C(l),"macos-desktop":C(xc)}]),style:Jt({"--preview-w":C(ne)+"px"})},[C(l)?(b(),xe(Cye,{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[18]||(be[18]=Fe=>a.value=!0),onOpenSettings:be[19]||(be[19]=Fe=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(b(),N(Be,{key:0},[ie(uB,{collapsed:C(Y),dragging:C(X),"col-width":C(fe),"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,onSelect:be[2]||(be[2]=Fe=>C(s).selectSession(Fe)),onCreate:ks,onCreateInWorkspace:be[3]||(be[3]=Fe=>jn(Fe)),onSelectWorkspace:be[4]||(be[4]=Fe=>C(s).openWorkspace(Fe)),onAddWorkspace:be[5]||(be[5]=Fe=>Xe.value=!0),onRename:be[6]||(be[6]=(Fe,Vt)=>C(s).renameSession(Fe,Vt)),onArchive:be[7]||(be[7]=Fe=>C(s).archiveSession(Fe)),onFork:be[8]||(be[8]=Fe=>C(s).forkSession(Fe)),onRenameWorkspace:be[9]||(be[9]=(Fe,Vt)=>C(s).renameWorkspace(Fe,Vt)),onDeleteWorkspace:be[10]||(be[10]=Fe=>C(s).deleteWorkspace(Fe)),onReorderWorkspaces:be[11]||(be[11]=Fe=>C(s).reorderWorkspaces(Fe)),onSetWorkspaceSortMode:be[12]||(be[12]=Fe=>C(s).setWorkspaceSortMode(Fe)),onLoadMoreSessions:be[13]||(be[13]=Fe=>void C(s).loadMoreSessions(Fe)),onLoadAllSessions:be[14]||(be[14]=Fe=>void C(s).loadAllSessions()),onOpenSettings:be[15]||(be[15]=Fe=>Pt.value=!0),onCollapse:C(We)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),Fn(ie(Kx,{class:"side-handle","storage-key":C(Z),"default-width":C(z),min:C(ee),max:C(de),"onUpdate:width":be[16]||(be[16]=Fe=>J.value=Fe),"onUpdate:dragging":be[17]||(be[17]=Fe=>X.value=Fe)},null,8,["storage-key","default-width","min","max"]),[[di,!C(Y)]])],64)),ie(bce,{ref_key:"conversationPaneRef",ref:zn,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[20]||(be[20]=Fe=>C(Ct)()),onSelectWorkspace:be[21]||(be[21]=Fe=>jn(Fe)),onAddWorkspace:be[22]||(be[22]=Fe=>Xe.value=!0),onOpenPr:ds,onSubmit:be[23]||(be[23]=Fe=>Us(Fe)),onSteer:be[24]||(be[24]=Fe=>C(s).steerPrompt(Fe.text,Fe.attachments)),onApproval:be[25]||(be[25]=(Fe,Vt)=>C(s).respondApproval(Fe,Vt)),onCancelTask:be[26]||(be[26]=Fe=>C(s).cancelTask(Fe)),onAnswer:be[27]||(be[27]=(Fe,Vt)=>C(s).respondQuestion(Fe,Vt)),onDismiss:be[28]||(be[28]=Fe=>C(s).dismissQuestion(Fe)),onCommand:Is,onInterrupt:be[29]||(be[29]=Fe=>C(s).abortCurrentPrompt()),onUnqueue:Zi,onEditQueued:$s,onReorderQueue:us,onSetPermission:be[30]||(be[30]=Fe=>C(s).setPermission(Fe)),onSetThinking:be[31]||(be[31]=Fe=>C(s).setThinking(Fe)),onTogglePlan:be[32]||(be[32]=Fe=>C(s).togglePlanMode()),onToggleSwarm:be[33]||(be[33]=Fe=>C(s).toggleSwarmMode()),onToggleGoal:be[34]||(be[34]=Fe=>C(s).toggleGoalMode()),onCreateGoal:be[35]||(be[35]=Fe=>C(s).createGoal(Fe)),onControlGoal:be[36]||(be[36]=Fe=>C(s).controlGoal(Fe)),onRefreshGitStatus:be[37]||(be[37]=Fe=>C(s).activeSessionId.value&&C(s).loadGitStatus(C(s).activeSessionId.value)),onRenameSession:be[38]||(be[38]=(Fe,Vt)=>C(s).renameSession(Fe,Vt)),onForkSession:be[39]||(be[39]=Fe=>C(s).forkSession(Fe)),onArchiveSession:be[40]||(be[40]=Fe=>C(s).archiveSession(Fe)),onCompact:be[41]||(be[41]=Fe=>C(s).compact()),onPickModel:be[42]||(be[42]=Fe=>sn()),onSelectModel:be[43]||(be[43]=Fe=>Zo(Fe)),onOpenFile:be[44]||(be[44]=Fe=>C(I)(Fe)),onOpenMedia:be[45]||(be[45]=Fe=>C(B)(Fe)),onOpenThinking:be[46]||(be[46]=Fe=>C(ye)(Fe)),onOpenCompaction:be[47]||(be[47]=Fe=>C(Te)(Fe)),onOpenAgent:be[48]||(be[48]=Fe=>C(pe)(Fe)),onOpenToolDiff:be[49]||(be[49]=Fe=>C(lt)(Fe)),onEditMessage:Yi},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(xc)||C(Y))?(b(),xe(Pn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(Y)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(We)},{default:Ee(()=>[ie(Ke,{name:C(Y)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):re("",!0),C(fn)&&!C(l)?(b(),xe(Kx,{key:3,class:"preview-handle","storage-key":C(ge),"default-width":C(le),min:C(G),max:C(he),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":be[50]||(be[50]=Fe=>j.value=Fe),"onUpdate:dragging":be[51]||(be[51]=Fe=>hn.value=Fe)},null,8,["storage-key","default-width","min","max","aria-label"])):re("",!0),!C(l)||C(fn)?(b(),N("aside",{key:4,class:Pe(["global-preview",{open:C(fn),mobile:C(l),"no-anim":C(hn)||L.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(fn)},[A.value==="thinking"&&C(ae)?(b(),xe(MC,{key:0,text:C(ve)??"",onClose:C(q)},null,8,["text","onClose"])):A.value==="compaction"&&C(me)?(b(),xe(MC,{key:1,text:C(se)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(Me)},null,8,["text","subtitle","onClose"])):A.value==="agent"&&C($e)?(b(),xe(Wue,{key:2,member:C($e),onClose:C(Ie)},null,8,["member","onClose"])):A.value==="btw"&&C(rn)?(b(),xe(ade,{key:3,turns:C(s).sideChatTurns.value,running:C(s).sideChatRunning.value,sending:C(s).sideChatSending.value,onSend:be[52]||(be[52]=Fe=>C(s).sendSideChatPrompt(Fe)),onClose:C(Zt)},null,8,["turns","running","sending","onClose"])):A.value==="diff"?(b(),xe(Rde,{key:4,mode:C(St),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(nn),onBack:be[53]||(be[53]=Fe=>{St.value="list",Tt.value=null,C(s).clearFileDiff()}),onClose:C(gt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):A.value==="toolDiff"&&C(Qe)?(b(),xe(ede,{key:5,target:C(Qe),onClose:C(_t)},null,8,["target","onClose"])):A.value==="file"?(b(),xe(_ue,{key:6,file:C(x),loading:C(E),error:C(T),line:C($)?.line,"download-url":C(F),closable:"","external-actions":C(S),"open-file":C(I),onClose:C(R),onOpenExternal:C(P),onReveal:C(W)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):re("",!0)],10,Sbe)):re("",!0),ie(kbe,{class:"internal-build-fab"}),Hn.value?(b(),xe(tfe,{key:5,models:C(s).models.value,current:C(s).status.value.modelId,"starred-ids":C(s).starredModelIds.value,loading:Ss.value,unavailable:as.value,onSelect:be[54]||(be[54]=Fe=>No(Fe)),onToggleStar:be[55]||(be[55]=Fe=>C(s).toggleStarModel(Fe)),onClose:be[56]||(be[56]=Fe=>Hn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):re("",!0),Pt.value?(b(),xe(nve,{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":Cs.value,"server-version":C(s).serverVersion.value,onSetColorScheme:be[57]||(be[57]=Fe=>C(s).setColorScheme(Fe)),onSetAccent:be[58]||(be[58]=Fe=>C(s).setAccent(Fe)),onSetUiFontSize:be[59]||(be[59]=Fe=>C(s).setUiFontSize(Fe)),onSetNotify:be[60]||(be[60]=Fe=>C(s).setNotifyOnComplete(Fe)),onSetNotifyQuestion:be[61]||(be[61]=Fe=>C(s).setNotifyOnQuestion(Fe)),onSetNotifyApproval:be[62]||(be[62]=Fe=>C(s).setNotifyOnApproval(Fe)),onSetSound:be[63]||(be[63]=Fe=>C(s).setSoundOnComplete(Fe)),onSetConversationToc:be[64]||(be[64]=Fe=>C(s).setConversationToc(Fe)),onUpdateConfig:be[65]||(be[65]=Fe=>Xo(Fe)),onLogin:be[66]||(be[66]=()=>{Pt.value=!1,cs()}),onLogout:C(s).logout,onOpenOnboarding:be[67]||(be[67]=()=>{Pt.value=!1,v()}),onOpenProviders:be[68]||(be[68]=()=>{Pt.value=!1,Xs()}),onClose:be[69]||(be[69]=Fe=>Pt.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):re("",!0),Wn.value?(b(),xe(Afe,{key:7,providers:C(s).providers.value,loading:vn.value,unavailable:Ft.value,onAdd:be[70]||(be[70]=Fe=>As(Fe)),onRefresh:be[71]||(be[71]=Fe=>jt(Fe)),onDelete:be[72]||(be[72]=Fe=>Qo(Fe)),onOpenLogin:be[73]||(be[73]=()=>{Wn.value=!1,cs()}),onClose:be[74]||(be[74]=Fe=>Wn.value=!1)},null,8,["providers","loading","unavailable"])):re("",!0),Dt.value?(b(),xe(oye,{key:8,status:C(s).status.value,thinking:C(s).thinking.value,"plan-mode":C(s).planMode.value,"swarm-mode":C(s).swarmMode.value,"cost-usd":C(s).sessionCost.value,onClose:be[75]||(be[75]=Fe=>Dt.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):re("",!0),Xe.value?(b(),xe(zve,{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:wn.value,onAdd:be[76]||(be[76]=Fe=>Un(Fe)),onClose:$o},null,8,["browse-fs","get-fs-home","default-path","error"])):re("",!0),ie(gl,{name:"gload-fade"},{default:Ee(()=>[C(s).initialized.value?re("",!0):(b(),xe(b2e,{key:0,issue:C(s).connectIssue.value},null,8,["issue"]))]),_:1}),C(s).initialized.value&&k.value&&!C(h)?(b(),xe(h2e,{key:10,onComplete:g,onSkip:g})):re("",!0),ie(gye,{warnings:C(s).warnings.value,onDismiss:C(s).dismissWarning},null,8,["warnings","onDismiss"]),C(r)?(b(),xe(Z2e,{key:11})):re("",!0),ie(Vve),C(l)?(b(),xe(Gye,{key:12,modelValue:a.value,"onUpdate:modelValue":be[77]||(be[77]=Fe=>a.value=Fe),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[78]||(be[78]=Fe=>C(s).selectSession(Fe)),onCreate:ks,onCreateInWorkspace:be[79]||(be[79]=Fe=>jn(Fe)),onAddWorkspace:be[80]||(be[80]=Fe=>Xe.value=!0),onRename:be[81]||(be[81]=(Fe,Vt)=>C(s).renameSession(Fe,Vt)),onArchive:be[82]||(be[82]=Fe=>C(s).archiveSession(Fe)),onDeleteWorkspace:be[83]||(be[83]=Fe=>C(s).deleteWorkspace(Fe)),onLoadMore:be[84]||(be[84]=Fe=>void C(s).loadMoreSessions(Fe))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):re("",!0),C(l)?(b(),xe(t2e,{key:13,modelValue:c.value,"onUpdate:modelValue":be[85]||(be[85]=Fe=>c.value=Fe),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[86]||(be[86]=Fe=>sn()),onSetThinking:be[87]||(be[87]=Fe=>C(s).setThinking(Fe)),onTogglePlan:be[88]||(be[88]=Fe=>C(s).togglePlanMode()),onToggleSwarm:be[89]||(be[89]=Fe=>C(s).toggleSwarmMode()),onSetPermission:be[90]||(be[90]=Fe=>C(s).setPermission(Fe)),onSetColorScheme:be[91]||(be[91]=Fe=>C(s).setColorScheme(Fe)),onSetUiFontSize:be[92]||(be[92]=Fe=>C(s).setUiFontSize(Fe)),onSetConversationToc:be[93]||(be[93]=Fe=>C(s).setConversationToc(Fe)),onLogin:be[94]||(be[94]=()=>{c.value=!1,cs()}),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)),Ze.value?(b(),xe(nhe,{key:3,"on-start-o-auth-login":Io,"on-poll-o-auth-login":mo,"on-cancel-o-auth-login":Jn,onSuccess:os,onClose:be[95]||(be[95]=Fe=>Ze.value=!1)})):re("",!0)]))}}),Abe=dt(Cbe,[["__scopeId","data-v-97411642"]]);dse();Ih(Abe).use(Mn).mount("#app");export{lE as $,Jv as A,QE as B,ps as C,Cxe as D,ZC as E,Be as F,iy as G,Ye as H,ie as I,NE as J,Zbe as K,Ci as L,Ve as M,w9 as N,exe as O,txe as P,oxe as Q,hh as R,kc as S,Dp as T,nxe as U,ly as V,Jbe as W,Mxe as X,sxe as Y,bxe as Z,Ebe as _,C4 as a,Ps as a$,zs as a0,zv as a1,Rbe as a2,Gv as a3,KT as a4,bn as a5,Hc as a6,zbe as a7,Nxe as a8,Vbe as a9,N4 as aA,aT as aB,pT as aC,gn as aD,hT as aE,fT as aF,Uv as aG,dT as aH,xn as aI,Zv as aJ,OE as aK,b as aL,b9 as aM,Hbe as aN,In as aO,p4 as aP,Pbe as aQ,yh as aR,Ns as aS,mh as aT,Q as aU,pxe as aV,P9 as aW,st as aX,On as aY,gT as aZ,Qbe as a_,Ybe as aa,Gbe as ab,Kbe as ac,gxe as ad,Ixe as ae,Yt as af,JT as ag,Rp as ah,cl as ai,Er as aj,is as ak,mxe as al,zo as am,ml as an,yt as ao,lxe as ap,axe as aq,Sn as ar,vt as as,o9 as at,Pe as au,Mbe as av,Jt as aw,lT as ax,uT as ay,rs as az,Dbe as b,fJ as b$,wxe as b0,Ju as b1,Sh as b2,xxe as b3,pl as b4,AE as b5,Nbe as b6,ka as b7,zE as b8,_xe as b9,po as bA,di as bB,e9 as bC,yxe as bD,Ge as bE,jE as bF,Ube as bG,qE as bH,uxe as bI,Ee as bJ,ixe as bK,Fn as bL,ji as bM,vxe as bN,xt as bO,Wbe as bP,_n as bQ,io as bR,Wxe as bS,tee as bT,CM as bU,Uxe as bV,NX as bW,ik as bX,zxe as bY,Jg as bZ,Yxe as b_,Tbe as ba,O as bb,jf as bc,Xbe as bd,ln as be,Lbe as bf,$be as bg,h4 as bh,hxe as bi,Ibe as bj,C as bk,Ad as bl,Txe as bm,Axe as bn,C9 as bo,jbe as bp,dxe as bq,UE as br,Exe as bs,rxe as bt,qbe as bu,S4 as bv,Nh as bw,F9 as bx,g3 as by,wg as bz,kxe as c,dJ as c0,nk as c1,uJ as c2,Dxe as c3,wX as c4,Bxe as c5,sp as c6,Fxe as c7,cJ as c8,kM as c9,Gxe as ca,Oxe as cb,Qxe as cc,iv as cd,dc as ce,sv as cf,Xxe as cg,Zxe as ch,Hxe as ci,Po as cj,Rxe as ck,Pxe as cl,$X as cm,Kxe as cn,ov as co,nv as cp,Vxe as cq,Lxe as cr,qxe as cs,jxe as ct,Ke as cu,$xe as cv,dt as cw,fxe as d,ul as e,Fbe as f,gl as g,E9 as h,Obe as i,Bbe as j,vi as k,wd as l,ws as m,Ep as n,Tr as o,Sxe as p,D as q,Ih as r,xe as s,re as t,N as u,w as v,DT as w,cxe as x,BT as y,H9 as z};