@moonshot-ai/kimi-code 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/main.mjs +6770 -1618
  2. package/dist-web/assets/CodeBlockNode-CaV-jku-.js +22 -0
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-C0rAlIZT.js → CodeBlockShell.vue_vue_type_style_index_0_lang-D2LMLnjQ.js} +1 -1
  4. package/dist-web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  5. package/dist-web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  6. package/dist-web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  7. package/dist-web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  8. package/dist-web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  9. package/dist-web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  10. package/dist-web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  11. package/dist-web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  12. package/dist-web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  13. package/dist-web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  14. package/dist-web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  15. package/dist-web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  16. package/dist-web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  17. package/dist-web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  18. package/dist-web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  19. package/dist-web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  20. package/dist-web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  21. package/dist-web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  22. package/dist-web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  23. package/dist-web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  24. package/dist-web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  25. package/dist-web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  26. package/dist-web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  27. package/dist-web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  28. package/dist-web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  29. package/dist-web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  30. package/dist-web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  31. package/dist-web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  32. package/dist-web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  33. package/dist-web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  34. package/dist-web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  35. package/dist-web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  36. package/dist-web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  37. package/dist-web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  38. package/dist-web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  39. package/dist-web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  40. package/dist-web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  41. package/dist-web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  42. package/dist-web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  43. package/dist-web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  44. package/dist-web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  45. package/dist-web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  46. package/dist-web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  47. package/dist-web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  48. package/dist-web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  49. package/dist-web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  50. package/dist-web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  51. package/dist-web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. package/dist-web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  53. package/dist-web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  54. package/dist-web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  55. package/dist-web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  56. package/dist-web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  57. package/dist-web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  58. package/dist-web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  59. package/dist-web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  60. package/dist-web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  61. package/dist-web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. package/dist-web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  63. package/dist-web/assets/{Tooltip-BGNN9cLC.js → Tooltip-BkDnpjpB.js} +1 -1
  64. package/dist-web/assets/arc-BpCxx-Lm.js +1 -0
  65. package/dist-web/assets/{architectureDiagram-3BPJPVTR-CdJj5NzX.js → architectureDiagram-3BPJPVTR-BUzyMdWP.js} +1 -1
  66. package/dist-web/assets/{blockDiagram-GPEHLZMM-BM14SQiN.js → blockDiagram-GPEHLZMM-BUkuE4Df.js} +1 -1
  67. package/dist-web/assets/{c4Diagram-AAUBKEIU-FYQfQdwd.js → c4Diagram-AAUBKEIU-Cyx2I5NF.js} +1 -1
  68. package/dist-web/assets/channel-BPMCBZZJ.js +1 -0
  69. package/dist-web/assets/{chunk-2J33WTMH-V2R-DrVS.js → chunk-2J33WTMH-D1yizOHn.js} +1 -1
  70. package/dist-web/assets/{chunk-4BX2VUAB-BabgZRBA.js → chunk-4BX2VUAB-Dh0raYq6.js} +1 -1
  71. package/dist-web/assets/{chunk-55IACEB6-DkJmDlyu.js → chunk-55IACEB6-BEhXMK8a.js} +1 -1
  72. package/dist-web/assets/{chunk-727SXJPM-CvIYC9nm.js → chunk-727SXJPM-DNNSkr-u.js} +2 -2
  73. package/dist-web/assets/{chunk-AQP2D5EJ-uL8LYMfy.js → chunk-AQP2D5EJ-BdIEtlnn.js} +1 -1
  74. package/dist-web/assets/{chunk-FMBD7UC4-EcbDOlvH.js → chunk-FMBD7UC4-CkJ1iFLI.js} +1 -1
  75. package/dist-web/assets/{chunk-ND2GUHAM-C8Qo5Bp8.js → chunk-ND2GUHAM-BHPtuSG5.js} +1 -1
  76. package/dist-web/assets/{chunk-QZHKN3VN-DqF-jFth.js → chunk-QZHKN3VN-CkJm98VG.js} +1 -1
  77. package/dist-web/assets/classDiagram-4FO5ZUOK-JXNmNMT4.js +1 -0
  78. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-JXNmNMT4.js +1 -0
  79. package/dist-web/assets/{cose-bilkent-S5V4N54A-BP-HoEg_.js → cose-bilkent-S5V4N54A-x5W3gqTd.js} +1 -1
  80. package/dist-web/assets/{dagre-BM42HDAG-BAqAth0y.js → dagre-BM42HDAG-eSRg4w-M.js} +1 -1
  81. package/dist-web/assets/{diagram-2AECGRRQ-CXLHAdSr.js → diagram-2AECGRRQ-Cifjip15.js} +1 -1
  82. package/dist-web/assets/{diagram-5GNKFQAL-BoPiyK2f.js → diagram-5GNKFQAL-DLv5M6zi.js} +1 -1
  83. package/dist-web/assets/{diagram-KO2AKTUF-B11ZVuuX.js → diagram-KO2AKTUF-DlsIZYaS.js} +1 -1
  84. package/dist-web/assets/{diagram-LMA3HP47-B8fTjZXi.js → diagram-LMA3HP47-CbDbbTBN.js} +1 -1
  85. package/dist-web/assets/{diagram-OG6HWLK6-DWzU9uYr.js → diagram-OG6HWLK6-DmIs02eE.js} +1 -1
  86. package/dist-web/assets/{erDiagram-TEJ5UH35-4MqNXbsL.js → erDiagram-TEJ5UH35-DKiJXrkX.js} +1 -1
  87. package/dist-web/assets/{flowDiagram-I6XJVG4X-CCJIZLVz.js → flowDiagram-I6XJVG4X-Diwcs-TL.js} +1 -1
  88. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DNfMlT11.js → ganttDiagram-6RSMTGT7-C1Z7ZuXq.js} +1 -1
  89. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-IBySLi3i.js → gitGraphDiagram-PVQCEYII-zAnihooO.js} +1 -1
  90. package/dist-web/assets/index-Cm9Q4xVi.js +3 -0
  91. package/dist-web/assets/index-CytBc_Au.css +1 -0
  92. package/dist-web/assets/index-DsKglRi9.js +273 -0
  93. package/dist-web/assets/index-MiWa00oP.js +9 -0
  94. package/dist-web/assets/{index-CqOt95r5.js → index-sGTig1yI.js} +1 -1
  95. package/dist-web/assets/{index10-9hz8xOXN.js → index10-D-oYkFkv.js} +2 -2
  96. package/dist-web/assets/index11-BZ-VpLJZ.js +9 -0
  97. package/dist-web/assets/{index5-DYhhPUDp.js → index5-BHU3YSPN.js} +1 -1
  98. package/dist-web/assets/{index6-DdsuTXIR.js → index6-DktmVOWV.js} +1 -1
  99. package/dist-web/assets/{index7-CoWnZiYw.js → index7-5thVZydO.js} +1 -1
  100. package/dist-web/assets/index8-oLPFpvcC.js +2 -0
  101. package/dist-web/assets/{infoDiagram-5YYISTIA-BoRSkIVT.js → infoDiagram-5YYISTIA-CTtKRrDv.js} +1 -1
  102. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-oMuu2qq0.js → ishikawaDiagram-YF4QCWOH-CpeSKUEO.js} +1 -1
  103. package/dist-web/assets/{journeyDiagram-JHISSGLW-DeuffmUz.js → journeyDiagram-JHISSGLW-CqozeoGf.js} +1 -1
  104. package/dist-web/assets/{kanban-definition-UN3LZRKU-DLxFUMop.js → kanban-definition-UN3LZRKU-D8fkRjdV.js} +1 -1
  105. package/dist-web/assets/{linear-Lxe_18BZ.js → linear-CcasoJPT.js} +1 -1
  106. package/dist-web/assets/{mermaid.core-4YTQ-5V5.js → mermaid.core-DQW_ubr6.js} +5 -5
  107. package/dist-web/assets/{mindmap-definition-RKZ34NQL-Bb4Tm8kX.js → mindmap-definition-RKZ34NQL-Ds4S3Jr8.js} +1 -1
  108. package/dist-web/assets/{pieDiagram-4H26LBE5-Bl8T3fZ7.js → pieDiagram-4H26LBE5-B6flMWC0.js} +2 -2
  109. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-BoEFFDkb.js → quadrantDiagram-W4KKPZXB-Dp7Mce_9.js} +1 -1
  110. package/dist-web/assets/{requirementDiagram-4Y6WPE33-B-op7Gg7.js → requirementDiagram-4Y6WPE33-POD8vh5c.js} +1 -1
  111. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DEMaMFQJ.js → sankeyDiagram-5OEKKPKP-DPTFBsjO.js} +1 -1
  112. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-B0FEdEjA.js → sequenceDiagram-3UESZ5HK-D7J9QzqQ.js} +1 -1
  113. package/dist-web/assets/{stateDiagram-AJRCARHV-BbCmT6m3.js → stateDiagram-AJRCARHV-BPCTy0Vu.js} +1 -1
  114. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CJbfs5Xz.js +1 -0
  115. package/dist-web/assets/{timeline-definition-PNZ67QCA-DsuaxnT6.js → timeline-definition-PNZ67QCA-CjYdXq94.js} +1 -1
  116. package/dist-web/assets/{vennDiagram-CIIHVFJN-CC9doxKp.js → vennDiagram-CIIHVFJN-DopODwti.js} +1 -1
  117. package/dist-web/assets/{vue.runtime.esm-bundler-DPCj1V1e.js → vue.runtime.esm-bundler-HPT0I7TD.js} +1 -1
  118. package/dist-web/assets/{wardley-L42UT6IY-C1rlxzgy.js → wardley-L42UT6IY-t4Clap_T.js} +1 -1
  119. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-gCZUj4SL.js → wardleyDiagram-YWT4CUSO-DT5OKzVz.js} +1 -1
  120. package/dist-web/assets/{xychartDiagram-2RQKCTM6-Bg1yj2-o.js → xychartDiagram-2RQKCTM6-BePku_Rt.js} +1 -1
  121. package/dist-web/index.html +2 -2
  122. package/package.json +5 -5
  123. package/dist-web/assets/CodeBlockNode-CEaJG3Ru.js +0 -22
  124. package/dist-web/assets/arc-DZU5jAun.js +0 -1
  125. package/dist-web/assets/channel-y98-FGX8.js +0 -1
  126. package/dist-web/assets/classDiagram-4FO5ZUOK-DIygKdRl.js +0 -1
  127. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DIygKdRl.js +0 -1
  128. package/dist-web/assets/index-CiC6jpjA.js +0 -268
  129. package/dist-web/assets/index-Cp4cno62.css +0 -1
  130. package/dist-web/assets/index-D9E1vajk.js +0 -9
  131. package/dist-web/assets/index11-jpw4aORI.js +0 -9
  132. package/dist-web/assets/index8-nFDUP4kC.js +0 -2
  133. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-DVIg4v2K.js +0 -1
@@ -0,0 +1,273 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-KEf2LMH_.js","assets/katex-HP8lGamR.js","assets/CodeBlockNode-CaV-jku-.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-D2LMLnjQ.js","assets/index8-oLPFpvcC.js","assets/index11-BZ-VpLJZ.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 Gf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Nt={},ea=[],Eo=()=>{},N2=()=>!1,ru=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Yf=e=>e.startsWith("onUpdate:"),tn=Object.assign,M1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},mA=Object.prototype.hasOwnProperty,zt=(e,t)=>mA.call(e,t),at=Array.isArray,ta=e=>Ca(e)==="[object Map]",fl=e=>Ca(e)==="[object Set]",Ay=e=>Ca(e)==="[object Date]",gA=e=>Ca(e)==="[object RegExp]",bt=e=>typeof e=="function",sn=e=>typeof e=="string",co=e=>typeof e=="symbol",Vt=e=>e!==null&&typeof e=="object",A1=e=>(Vt(e)||bt(e))&&bt(e.then)&&bt(e.catch),L2=Object.prototype.toString,Ca=e=>L2.call(e),vA=e=>Ca(e).slice(8,-1),Xf=e=>Ca(e)==="[object Object]",Zf=e=>sn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ol=Gf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Jf=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},yA=/-\w/g,Xn=Jf(e=>e.replace(yA,t=>t.slice(1).toUpperCase())),kA=/\B([A-Z])/g,Ds=Jf(e=>e.replace(kA,"-$1").toLowerCase()),Qf=Jf(e=>e.charAt(0).toUpperCase()+e.slice(1)),Cd=Jf(e=>e?`on${Qf(e)}`:""),rs=(e,t)=>!Object.is(e,t),na=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},O2=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},eh=e=>{const t=parseFloat(e);return isNaN(t)?e:t},qd=e=>{const t=sn(e)?Number(e):NaN;return isNaN(t)?e:t};let Ey;const th=()=>Ey||(Ey=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),bA="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",_A=Gf(bA);function Bt(e){if(at(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=sn(s)?xA(s):Bt(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(sn(e)||Vt(e))return e}const wA=/;(?![^(]*\))/g,SA=/:([^]+)/,CA=/\/\*[^]*?\*\//g;function xA(e){const t={};return e.replace(CA,"").split(wA).forEach(n=>{if(n){const s=n.split(SA);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Le(e){let t="";if(sn(e))t=e;else if(at(e))for(let n=0;n<e.length;n++){const s=Le(e[n]);s&&(t+=s+" ")}else if(Vt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Yfe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!sn(t)&&(e.class=Le(t)),n&&(e.style=Bt(n)),e}const TA="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",MA=Gf(TA);function P2(e){return!!e||e===""}function AA(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Ei(e[s],t[s]);return n}function Ei(e,t){if(e===t)return!0;let n=Ay(e),s=Ay(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=co(e),s=co(t),n||s)return e===t;if(n=at(e),s=at(t),n||s)return n&&s?AA(e,t):!1;if(n=Vt(e),s=Vt(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Ei(e[r],t[r]))return!1}}return String(e)===String(t)}function nh(e,t){return e.findIndex(n=>Ei(n,t))}const R2=e=>!!(e&&e.__v_isRef===!0),O=e=>sn(e)?e:e==null?"":at(e)||Vt(e)&&(e.toString===L2||!bt(e.toString))?R2(e)?O(e.value):JSON.stringify(e,D2,2):String(e),D2=(e,t)=>R2(t)?D2(e,t.value):ta(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[jp(s,i)+" =>"]=o,n),{})}:fl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>jp(n))}:co(t)?jp(t):Vt(t)&&!at(t)&&!Xf(t)?String(t):t,jp=(e,t="")=>{var n;return co(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function EA(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 Yn;class B2{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&&Yn&&(Yn.active?(this.parent=Yn,this.index=(Yn.scopes||(Yn.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=Yn;try{return Yn=this,t()}finally{Yn=n}}}on(){++this._on===1&&(this.prevScope=Yn,Yn=this)}off(){if(this._on>0&&--this._on===0){if(Yn===this)Yn=this.prevScope;else{let t=Yn;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 $A(e){return new B2(e)}function E1(){return Yn}function $1(e,t=!1){Yn&&Yn.cleanups.push(e)}let fn;const qp=new WeakSet;class zd{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,Yn&&(Yn.active?Yn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,qp.has(this)&&(qp.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||H2(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,$y(this),W2(this);const t=fn,n=Ho;fn=this,Ho=!0;try{return this.fn()}finally{U2(this),fn=t,Ho=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)L1(t);this.deps=this.depsTail=void 0,$y(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?qp.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){tg(this)&&this.run()}get dirty(){return tg(this)}}let F2=0,yc,kc;function H2(e,t=!1){if(e.flags|=8,t){e.next=kc,kc=e;return}e.next=yc,yc=e}function I1(){F2++}function N1(){if(--F2>0)return;if(kc){let t=kc;for(kc=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;yc;){let t=yc;for(yc=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 W2(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function U2(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),L1(s),IA(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function tg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(j2(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function j2(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Oc)||(e.globalVersion=Oc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!tg(e))))return;e.flags|=2;const t=e.dep,n=fn,s=Ho;fn=e,Ho=!0;try{W2(e);const o=e.fn(e._value);(t.version===0||rs(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{fn=n,Ho=s,U2(e),e.flags&=-3}}function L1(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)L1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function IA(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Xfe(e,t){e.effect instanceof zd&&(e=e.effect.fn);const n=new zd(e);t&&tn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function Zfe(e){e.effect.stop()}let Ho=!0;const q2=[];function $i(){q2.push(Ho),Ho=!1}function Ii(){const e=q2.pop();Ho=e===void 0?!0:e}function $y(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=fn;fn=void 0;try{t()}finally{fn=n}}}let Oc=0;class NA{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 sh{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(!fn||!Ho||fn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==fn)n=this.activeLink=new NA(fn,this),fn.deps?(n.prevDep=fn.depsTail,fn.depsTail.nextDep=n,fn.depsTail=n):fn.deps=fn.depsTail=n,z2(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=fn.depsTail,n.nextDep=void 0,fn.depsTail.nextDep=n,fn.depsTail=n,fn.deps===n&&(fn.deps=s)}return n}trigger(t){this.version++,Oc++,this.notify(t)}notify(t){I1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{N1()}}}function z2(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)z2(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Vd=new WeakMap,il=Symbol(""),ng=Symbol(""),Pc=Symbol("");function gs(e,t,n){if(Ho&&fn){let s=Vd.get(e);s||Vd.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new sh),o.map=s,o.key=n),o.track()}}function wi(e,t,n,s,o,i){const r=Vd.get(e);if(!r){Oc++;return}const l=a=>{a&&a.trigger()};if(I1(),t==="clear")r.forEach(l);else{const a=at(e),c=a&&Zf(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===Pc||!co(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Pc)),t){case"add":a?c&&l(r.get("length")):(l(r.get(il)),ta(e)&&l(r.get(ng)));break;case"delete":a||(l(r.get(il)),ta(e)&&l(r.get(ng)));break;case"set":ta(e)&&l(r.get(il));break}}N1()}function LA(e,t){const n=Vd.get(e);return n&&n.get(t)}function Pl(e){const t=Dt(e);return t===e?t:(gs(t,"iterate",Pc),so(e)?t:t.map(Wo))}function oh(e){return gs(e=Dt(e),"iterate",Pc),e}function ni(e,t){return Ni(e)?va(dr(e)?Wo(t):t):Wo(t)}const OA={__proto__:null,[Symbol.iterator](){return zp(this,Symbol.iterator,e=>ni(this,e))},concat(...e){return Pl(this).concat(...e.map(t=>at(t)?Pl(t):t))},entries(){return zp(this,"entries",e=>(e[1]=ni(this,e[1]),e))},every(e,t){return vi(this,"every",e,t,void 0,arguments)},filter(e,t){return vi(this,"filter",e,t,n=>n.map(s=>ni(this,s)),arguments)},find(e,t){return vi(this,"find",e,t,n=>ni(this,n),arguments)},findIndex(e,t){return vi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return vi(this,"findLast",e,t,n=>ni(this,n),arguments)},findLastIndex(e,t){return vi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return vi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Vp(this,"includes",e)},indexOf(...e){return Vp(this,"indexOf",e)},join(e){return Pl(this).join(e)},lastIndexOf(...e){return Vp(this,"lastIndexOf",e)},map(e,t){return vi(this,"map",e,t,void 0,arguments)},pop(){return Ja(this,"pop")},push(...e){return Ja(this,"push",e)},reduce(e,...t){return Iy(this,"reduce",e,t)},reduceRight(e,...t){return Iy(this,"reduceRight",e,t)},shift(){return Ja(this,"shift")},some(e,t){return vi(this,"some",e,t,void 0,arguments)},splice(...e){return Ja(this,"splice",e)},toReversed(){return Pl(this).toReversed()},toSorted(e){return Pl(this).toSorted(e)},toSpliced(...e){return Pl(this).toSpliced(...e)},unshift(...e){return Ja(this,"unshift",e)},values(){return zp(this,"values",e=>ni(this,e))}};function zp(e,t,n){const s=oh(e),o=s[t]();return s!==e&&!so(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const PA=Array.prototype;function vi(e,t,n,s,o,i){const r=oh(e),l=r!==e&&!so(e),a=r[t];if(a!==PA[t]){const d=a.apply(e,i);return l?Wo(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,ni(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 Iy(e,t,n,s){const o=oh(e),i=o!==e&&!so(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=ni(e,c)),n.call(this,c,ni(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?ni(e,a):a}function Vp(e,t,n){const s=Dt(e);gs(s,"iterate",Pc);const o=s[t](...n);return(o===-1||o===!1)&&lh(n[0])?(n[0]=Dt(n[0]),s[t](...n)):o}function Ja(e,t,n=[]){$i(),I1();const s=Dt(e)[t].apply(e,n);return N1(),Ii(),s}const RA=Gf("__proto__,__v_isRef,__isVue"),V2=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(co));function DA(e){co(e)||(e=String(e));const t=Dt(this);return gs(t,"has",e),t.hasOwnProperty(e)}class K2{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?Q2:J2:i?Z2:X2).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=at(t);if(!o){let a;if(r&&(a=OA[n]))return a;if(n==="hasOwnProperty")return DA}const l=Reflect.get(t,n,Fn(t)?t:s);if((co(n)?V2.has(n):RA(n))||(o||gs(t,"get",n),i))return l;if(Fn(l)){const a=r&&Zf(n)?l:l.value;return o&&Vt(a)?Kd(a):a}return Vt(l)?o?Kd(l):to(l):l}}class G2 extends K2{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=at(t)&&Zf(n);if(!this._isShallow){const c=Ni(i);if(!so(s)&&!Ni(s)&&(i=Dt(i),s=Dt(s)),!r&&Fn(i)&&!Fn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:zt(t,n),a=Reflect.set(t,n,s,Fn(t)?t:o);return t===Dt(o)&&(l?rs(s,i)&&wi(t,"set",n,s):wi(t,"add",n,s)),a}deleteProperty(t,n){const s=zt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&wi(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!co(n)||!V2.has(n))&&gs(t,"has",n),s}ownKeys(t){return gs(t,"iterate",at(t)?"length":il),Reflect.ownKeys(t)}}class Y2 extends K2{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const BA=new G2,FA=new Y2,HA=new G2(!0),WA=new Y2(!0),sg=e=>e,qu=e=>Reflect.getPrototypeOf(e);function UA(e,t,n){return function(...s){const o=this.__v_raw,i=Dt(o),r=ta(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?sg:t?va:Wo;return!t&&gs(i,"iterate",a?ng:il),tn(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 zu(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function jA(e,t){const n={get(o){const i=this.__v_raw,r=Dt(i),l=Dt(o);e||(rs(o,l)&&gs(r,"get",o),gs(r,"get",l));const{has:a}=qu(r),c=t?sg:e?va:Wo;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(Dt(o),"iterate",il),o.size},has(o){const i=this.__v_raw,r=Dt(i),l=Dt(o);return e||(rs(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=Dt(l),c=t?sg:e?va:Wo;return!e&&gs(a,"iterate",il),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return tn(n,e?{add:zu("add"),set:zu("set"),delete:zu("delete"),clear:zu("clear")}:{add(o){const i=Dt(this),r=qu(i),l=Dt(o),a=!t&&!so(o)&&!Ni(o)?l:o;return r.has.call(i,a)||rs(o,a)&&r.has.call(i,o)||rs(l,a)&&r.has.call(i,l)||(i.add(a),wi(i,"add",a,a)),this},set(o,i){!t&&!so(i)&&!Ni(i)&&(i=Dt(i));const r=Dt(this),{has:l,get:a}=qu(r);let c=l.call(r,o);c||(o=Dt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?rs(i,u)&&wi(r,"set",o,i):wi(r,"add",o,i),this},delete(o){const i=Dt(this),{has:r,get:l}=qu(i);let a=r.call(i,o);a||(o=Dt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&wi(i,"delete",o,void 0),c},clear(){const o=Dt(this),i=o.size!==0,r=o.clear();return i&&wi(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=UA(o,e,t)}),n}function ih(e,t){const n=jA(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(zt(n,o)&&o in s?n:s,o,i)}const qA={get:ih(!1,!1)},zA={get:ih(!1,!0)},VA={get:ih(!0,!1)},KA={get:ih(!0,!0)},X2=new WeakMap,Z2=new WeakMap,J2=new WeakMap,Q2=new WeakMap;function GA(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function to(e){return Ni(e)?e:rh(e,!1,BA,qA,X2)}function YA(e){return rh(e,!1,HA,zA,Z2)}function Kd(e){return rh(e,!0,FA,VA,J2)}function Jfe(e){return rh(e,!0,WA,KA,Q2)}function rh(e,t,n,s,o){if(!Vt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=GA(vA(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function dr(e){return Ni(e)?dr(e.__v_raw):!!(e&&e.__v_isReactive)}function Ni(e){return!!(e&&e.__v_isReadonly)}function so(e){return!!(e&&e.__v_isShallow)}function lh(e){return e?!!e.__v_raw:!1}function Dt(e){const t=e&&e.__v_raw;return t?Dt(t):e}function ar(e){return!zt(e,"__v_skip")&&Object.isExtensible(e)&&O2(e,"__v_skip",!0),e}const Wo=e=>Vt(e)?to(e):e,va=e=>Vt(e)?Kd(e):e;function Fn(e){return e?e.__v_isRef===!0:!1}function te(e){return eS(e,!1)}function hl(e){return eS(e,!0)}function eS(e,t){return Fn(e)?e:new XA(e,t)}class XA{constructor(t,n){this.dep=new sh,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Dt(t),this._value=n?t:Wo(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||so(t)||Ni(t);t=s?t:Dt(t),rs(t,n)&&(this._rawValue=t,this._value=s?t:Wo(t),this.dep.trigger())}}function Qfe(e){e.dep&&e.dep.trigger()}function C(e){return Fn(e)?e.value:e}function tS(e){return bt(e)?e():C(e)}const ZA={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Fn(o)&&!Fn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function nS(e){return dr(e)?e:new Proxy(e,ZA)}class JA{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new sh,{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 QA(e){return new JA(e)}function ehe(e){const t=at(e)?new Array(e.length):{};for(const n in e)t[n]=sS(e,n);return t}class eE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=co(n)?n:String(n),this._raw=Dt(t);let o=!0,i=t;if(!at(t)||co(this._key)||!Zf(this._key))do o=!lh(i)||so(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&&Fn(this._raw[this._key])){const n=this._object[this._key];if(Fn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return LA(this._raw,this._key)}}class tE{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 the(e,t,n){return Fn(e)?e:bt(e)?new tE(e):Vt(e)&&arguments.length>1?sS(e,t,n):te(e)}function sS(e,t,n){return new eE(e,t,n)}class nE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new sh(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Oc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&fn!==this)return H2(this,!0),!0}get value(){const t=this.dep.track();return j2(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function sE(e,t,n=!1){let s,o;return bt(e)?s=e:(s=e.get,o=e.set),new nE(s,o,n)}const nhe={GET:"get",HAS:"has",ITERATE:"iterate"},she={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Vu={},Gd=new WeakMap;let sr;function ohe(){return sr}function oE(e,t=!1,n=sr){if(n){let s=Gd.get(n);s||Gd.set(n,s=[]),s.push(e)}}function iE(e,t,n=Nt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=v=>o?v:so(v)||o===!1||o===0?Si(v,1):Si(v);let u,d,f,p,h=!1,g=!1;if(Fn(e)?(d=()=>e.value,h=so(e)):dr(e)?(d=()=>c(e),h=!0):at(e)?(g=!0,h=e.some(v=>dr(v)||so(v)),d=()=>e.map(v=>{if(Fn(v))return v.value;if(dr(v))return c(v);if(bt(v))return a?a(v,2):v()})):bt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){$i();try{f()}finally{Ii()}}const v=sr;sr=u;try{return a?a(e,3,[p]):e(p)}finally{sr=v}}:d=Eo,t&&o){const v=d,w=o===!0?1/0:o;d=()=>Si(v(),w)}const S=E1(),_=()=>{u.stop(),S&&S.active&&M1(S.effects,u)};if(i&&t){const v=t;t=(...w)=>{v(...w),_()}}let y=g?new Array(e.length).fill(Vu):Vu;const b=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(t){const w=u.run();if(o||h||(g?w.some((N,E)=>rs(N,y[E])):rs(w,y))){f&&f();const N=sr;sr=u;try{const E=[w,y===Vu?void 0:g&&y[0]===Vu?[]:y,p];y=w,a?a(t,3,E):t(...E)}finally{sr=N}}}else u.run()};return l&&l(b),u=new zd(d),u.scheduler=r?()=>r(b,!1):b,p=v=>oE(v,!1,u),f=u.onStop=()=>{const v=Gd.get(u);if(v){if(a)a(v,4);else for(const w of v)w();Gd.delete(u)}},t?s?b(!0):y=u.run():r?r(b.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Si(e,t=1/0,n){if(t<=0||!Vt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Fn(e))Si(e.value,t,n);else if(at(e))for(let s=0;s<e.length;s++)Si(e[s],t,n);else if(fl(e)||ta(e))e.forEach(s=>{Si(s,t,n)});else if(Xf(e)){for(const s in e)Si(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Si(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 oS=[];function rE(e){oS.push(e)}function lE(){oS.pop()}function ihe(e,t){}const rhe={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"},aE={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 lu(e,t,n,s){try{return s?e(...s):e()}catch(o){xa(o,t,n)}}function Io(e,t,n,s){if(bt(e)){const o=lu(e,t,n,s);return o&&A1(o)&&o.catch(i=>{xa(i,t,n)}),o}if(at(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Io(e[i],t,n,s));return o}}function xa(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Nt;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){$i(),lu(i,null,10,[e,a,c]),Ii();return}}cE(e,n,o,s,r)}function cE(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const xs=[];let Qo=-1;const sa=[];let or=null,ql=0;const iS=Promise.resolve();let Yd=null;function mt(e){const t=Yd||iS;return e?t.then(this?e.bind(this):e):t}function uE(e){let t=Qo+1,n=xs.length;for(;t<n;){const s=t+n>>>1,o=xs[s],i=Rc(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function O1(e){if(!(e.flags&1)){const t=Rc(e),n=xs[xs.length-1];!n||!(e.flags&2)&&t>=Rc(n)?xs.push(e):xs.splice(uE(t),0,e),e.flags|=1,rS()}}function rS(){Yd||(Yd=iS.then(lS))}function Xd(e){at(e)?sa.push(...e):or&&e.id===-1?or.splice(ql+1,0,e):e.flags&1||(sa.push(e),e.flags|=1),rS()}function Ny(e,t,n=Qo+1){for(;n<xs.length;n++){const s=xs[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;xs.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Zd(e){if(sa.length){const t=[...new Set(sa)].sort((n,s)=>Rc(n)-Rc(s));if(sa.length=0,or){or.push(...t);return}for(or=t,ql=0;ql<or.length;ql++){const n=or[ql];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}or=null,ql=0}}const Rc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function lS(e){try{for(Qo=0;Qo<xs.length;Qo++){const t=xs[Qo];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),lu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Qo<xs.length;Qo++){const t=xs[Qo];t&&(t.flags&=-2)}Qo=-1,xs.length=0,Zd(),Yd=null,(xs.length||sa.length)&&lS()}}let zl,Ku=[];function aS(e,t){var n,s;zl=e,zl?(zl.enabled=!0,Ku.forEach(({event:o,args:i})=>zl.emit(o,...i)),Ku=[]):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=>{aS(i,t)}),setTimeout(()=>{zl||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ku=[])},3e3)):Ku=[]}let cs=null,ah=null;function Dc(e){const t=cs;return cs=e,ah=e&&e.type.__scopeId||null,t}function lhe(e){ah=e}function ahe(){ah=null}const che=e=>In;function In(e,t=cs,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&nf(-1);const i=Dc(t);let r;try{r=e(...o)}finally{Dc(i),s._d&&nf(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Lt(e,t){if(cs===null)return e;const n=du(cs),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Nt]=t[o];i&&(bt(i)&&(i={mounted:i,updated:i}),i.deep&&Si(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function ti(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&&($i(),Io(a,n,8,[e.el,l,e,t]),Ii())}}function gn(e,t){if(ls){let n=ls.provides;const s=ls.parent&&ls.parent.provides;s===n&&(n=ls.provides=Object.create(s)),n[e]=t}}function Rt(e,t,n=!1){const s=us();if(s||rl){let o=rl?rl._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 uhe(){return!!(us()||rl)}const dE=Symbol.for("v-scx"),fE=()=>Rt(dE);function hE(e,t){return au(e,null,t)}function dhe(e,t){return au(e,null,{flush:"post"})}function pE(e,t){return au(e,null,{flush:"sync"})}function Ke(e,t,n){return au(e,t,n)}function au(e,t,n=Nt){const{immediate:s,deep:o,flush:i,once:r}=n,l=tn({},n),a=t&&s||!t&&i!=="post";let c;if(ul){if(i==="sync"){const p=fE();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=Eo,p.resume=Eo,p.pause=Eo,p}}const u=ls;l.call=(p,h,g)=>Io(p,u,h,g);let d=!1;i==="post"?l.scheduler=p=>{Wn(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():O1(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=iE(e,t,l);return ul&&(c?c.push(f):a&&f()),f}function mE(e,t,n){const s=this.proxy,o=sn(e)?e.includes(".")?cS(s,e):()=>s[e]:e.bind(s,s);let i;bt(t)?i=t:(i=t.handler,n=t);const r=Ta(this),l=au(o,i.bind(s),n);return r(),l}function cS(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 tr=new WeakMap,uS=Symbol("_vte"),dS=e=>e.__isTeleport,Zr=e=>e&&(e.disabled||e.disabled===""),gE=e=>e&&(e.defer||e.defer===""),Ly=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Oy=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,og=(e,t)=>{const n=e&&e.to;return sn(n)?t?t(n):null:n},vE={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:g,createComment:S,parentNode:_}}=c,y=Zr(t.props);let{dynamicChildren:b}=t;const v=(E,k,A)=>{E.shapeFlag&16&&u(E.children,k,A,o,i,r,l,a)},w=(E=t)=>{const k=Zr(E.props),A=E.target=og(E.props,h),I=ig(A,E,g,p);A&&(r!=="svg"&&Ly(A)?r="svg":r!=="mathml"&&Oy(A)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(A),k||(v(E,A,I),ac(E,!1)))},N=E=>{const k=()=>{if(tr.get(E)===k){if(tr.delete(E),Zr(E.props)){const A=_(E.el)||n;v(E,A,E.anchor),ac(E,!0)}w(E)}};tr.set(E,k),Wn(k,i)};if(e==null){const E=t.el=g(""),k=t.anchor=g("");if(p(E,n,s),p(k,n,s),gE(t.props)||i&&i.pendingBranch){N(t);return}y&&(v(t,n,k),ac(t,!0)),w()}else{t.el=e.el;const E=t.anchor=e.anchor,k=tr.get(e);if(k){k.flags|=8,tr.delete(e),N(t);return}t.targetStart=e.targetStart;const A=t.target=e.target,I=t.targetAnchor=e.targetAnchor,P=Zr(e.props),M=P?n:A,L=P?E:I;if(r==="svg"||Ly(A)?r="svg":(r==="mathml"||Oy(A))&&(r="mathml"),b?(f(e.dynamicChildren,b,M,o,i,r,l),q1(e,t,!0)):a||d(e,t,M,L,o,i,r,l,!1),y)P?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Gu(t,n,E,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=og(t.props,h);R&&Gu(t,R,null,c,0)}else P&&Gu(t,A,I,c,1);ac(t,y)}},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||!Zr(f),h=tr.get(e);if(h&&(h.flags|=8,tr.delete(e)),d&&(o(c),o(u)),i&&o(a),!h&&r&16)for(let g=0;g<l.length;g++){const S=l[g];s(S,t,n,p,!!S.dynamicChildren)}},move:Gu,hydrate:yE};function Gu(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),!tr.has(e)&&(!d||Zr(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(S,_){let y=_;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")t.targetStart=y;else if(y.data==="teleport anchor"){t.targetAnchor=y,S._lpa=t.targetAnchor&&r(t.targetAnchor);break}}y=r(y)}}function p(S,_){_.anchor=d(r(S),_,l(S),n,s,o,i)}const h=t.target=og(t.props,a),g=Zr(t.props);if(h){const S=h._lpa||h.firstChild;t.shapeFlag&16&&(g?(p(e,t),f(h,S),t.targetAnchor||ig(h,t,u,c,l(e)===h?e:null)):(t.anchor=r(e),f(h,S),t.targetAnchor||ig(h,t,u,c),d(S&&r(S),t,h,n,s,o,i))),ac(t,g)}else g&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const fhe=vE;function ac(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 ig(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[uS]=r,e&&(s(i,e,o),s(r,e,o)),r}const Co=Symbol("_leaveCb"),Qa=Symbol("_enterCb");function fS(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Zt(()=>{e.isMounted=!0}),qs(()=>{e.isUnmounting=!0}),e}const ko=[Function,Array],hS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ko,onEnter:ko,onAfterEnter:ko,onEnterCancelled:ko,onBeforeLeave:ko,onLeave:ko,onAfterLeave:ko,onLeaveCancelled:ko,onBeforeAppear:ko,onAppear:ko,onAfterAppear:ko,onAppearCancelled:ko},pS=e=>{const t=e.subTree;return t.component?pS(t.component):t},kE={name:"BaseTransition",props:hS,setup(e,{slots:t}){const n=us(),s=fS();return()=>{const o=t.default&&P1(t.default(),!0),i=o&&o.length?mS(o):n.subTree?ie():void 0;if(!i)return;const r=Dt(e),{mode:l}=r;if(s.isLeaving)return Kp(i);const a=Py(i);if(!a)return Kp(i);let c=Bc(a,r,s,n,d=>c=d);a.type!==Un&&gr(a,c);let u=n.subTree&&Py(n.subTree);if(u&&u.type!==Un&&!Do(u,a)&&pS(n).type!==Un){let d=Bc(u,r,s,n);if(gr(u,d),l==="out-in"&&a.type!==Un)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Kp(i);l==="in-out"&&a.type!==Un?d.delayLeave=(f,p,h)=>{const g=gS(s,u);g[String(u.key)]=u,f[Co]=()=>{p(),f[Co]=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 mS(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Un){t=n;break}}return t}const bE=kE;function gS(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 Bc(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:g,onBeforeAppear:S,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,v=String(e.key),w=gS(n,e),N=(A,I)=>{A&&Io(A,s,9,I)},E=(A,I)=>{const P=I[1];N(A,I),at(A)?A.every(M=>M.length<=1)&&P():A.length<=1&&P()},k={mode:r,persisted:l,beforeEnter(A){let I=a;if(!n.isMounted)if(i)I=S||a;else return;A[Co]&&A[Co](!0);const P=w[v];P&&Do(e,P)&&P.el[Co]&&P.el[Co](),N(I,[A])},enter(A){if(w[v]===e)return;let I=c,P=u,M=d;if(!n.isMounted)if(i)I=_||c,P=y||u,M=b||d;else return;let L=!1;A[Qa]=B=>{L||(L=!0,B?N(M,[A]):N(P,[A]),k.delayedLeave&&k.delayedLeave(),A[Qa]=void 0)};const R=A[Qa].bind(null,!1);I?E(I,[A,R]):R()},leave(A,I){const P=String(e.key);if(A[Qa]&&A[Qa](!0),n.isUnmounting)return I();N(f,[A]);let M=!1;A[Co]=R=>{M||(M=!0,I(),R?N(g,[A]):N(h,[A]),A[Co]=void 0,w[P]===e&&delete w[P])};const L=A[Co].bind(null,!1);w[P]=e,p?E(p,[A,L]):L()},clone(A){const I=Bc(A,t,n,s,o);return o&&o(I),I}};return k}function Kp(e){if(cu(e))return e=Li(e),e.children=null,e}function Py(e){if(!cu(e))return dS(e.type)&&e.children?mS(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 gr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,gr(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 P1(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Pe?(r.patchFlag&128&&o++,s=s.concat(P1(r.children,t,l))):(t||r.type!==Un)&&s.push(l!=null?Li(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Ze(e,t){return bt(e)?tn({name:e.name},t,{setup:e}):e}function hhe(){const e=us();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function R1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function phe(e){const t=us(),n=hl(null);if(t){const o=t.refs===Nt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Ry(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Jd=new WeakMap;function oa(e,t,n,s,o=!1){if(at(e)){e.forEach((g,S)=>oa(g,t&&(at(t)?t[S]:t),n,s,o));return}if(Mi(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&oa(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?du(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Nt?l.refs={}:l.refs,d=l.setupState,f=Dt(d),p=d===Nt?N2:g=>Ry(u,g)?!1:zt(f,g),h=(g,S)=>!(S&&Ry(u,S));if(c!=null&&c!==a){if(Dy(t),sn(c))u[c]=null,p(c)&&(d[c]=null);else if(Fn(c)){const g=t;h(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if(bt(a))lu(a,l,12,[r,u]);else{const g=sn(a),S=Fn(a);if(g||S){const _=()=>{if(e.f){const y=g?p(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(o)at(y)&&M1(y,i);else if(at(y))y.includes(i)||y.push(i);else if(g)u[a]=[i],p(a)&&(d[a]=u[a]);else{const b=[i];h(a,e.k)&&(a.value=b),e.k&&(u[e.k]=b)}}else g?(u[a]=r,p(a)&&(d[a]=r)):S&&(h(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const y=()=>{_(),Jd.delete(e)};y.id=-1,Jd.set(e,y),Wn(y,n)}else Dy(e),_()}}}function Dy(e){const t=Jd.get(e);t&&(t.flags|=8,Jd.delete(e))}let By=!1;const Rl=()=>{By||(console.error("Hydration completed but contains mismatches."),By=!0)},_E=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",wE=e=>e.namespaceURI.includes("MathML"),Yu=e=>{if(e.nodeType===1){if(_E(e))return"svg";if(wE(e))return"mathml"}},Yl=e=>e.nodeType===8;function SE(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(b,v)=>{if(!v.hasChildNodes()){n(null,b,v),Zd(),v._vnode=b;return}d(v.firstChild,b,null,null,null),Zd(),v._vnode=b},d=(b,v,w,N,E,k=!1)=>{k=k||!!v.dynamicChildren;const A=Yl(b)&&b.data==="[",I=()=>g(b,v,w,N,E,A),{type:P,ref:M,shapeFlag:L,patchFlag:R}=v;let B=b.nodeType;v.el=b,R===-2&&(k=!1,v.dynamicChildren=null);let U=null;switch(P){case fr:B!==3?v.children===""?(a(v.el=o(""),r(b),b),U=b):U=I():(b.data!==v.children&&(Rl(),b.data=v.children),U=i(b));break;case Un:y(b)?(U=i(b),_(v.el=b.content.firstChild,b,w)):B!==8||A?U=I():U=i(b);break;case la:if(A&&(b=i(b),B=b.nodeType),B===1||B===3){U=b;const K=!v.children.length;for(let V=0;V<v.staticCount;V++)K&&(v.children+=U.nodeType===1?U.outerHTML:U.data),V===v.staticCount-1&&(v.anchor=U),U=i(U);return A?i(U):U}else I();break;case Pe:A?U=h(b,v,w,N,E,k):U=I();break;default:if(L&1)(B!==1||v.type.toLowerCase()!==b.tagName.toLowerCase())&&!y(b)?U=I():U=f(b,v,w,N,E,k);else if(L&6){v.slotScopeIds=E;const K=r(b);if(A?U=S(b):Yl(b)&&b.data==="teleport start"?U=S(b,b.data,"teleport end"):U=i(b),t(v,K,null,w,N,Yu(K),k),Mi(v)&&!v.type.__asyncResolved){let V;A?(V=gt(Pe),V.anchor=U?U.previousSibling:K.lastChild):V=b.nodeType===3?dt(""):gt("div"),V.el=b,v.component.subTree=V}}else L&64?B!==8?U=I():U=v.type.hydrate(b,v,w,N,E,k,e,p):L&128&&(U=v.type.hydrate(b,v,w,N,Yu(r(b)),E,k,e,d))}return M!=null&&oa(M,null,N,v),U},f=(b,v,w,N,E,k)=>{k=k||!!v.dynamicChildren;const{type:A,props:I,patchFlag:P,shapeFlag:M,dirs:L,transition:R}=v,B=A==="input"||A==="option";if(B||P!==-1){L&&ti(v,null,w,"created");let U=!1;if(y(b)){U=PS(null,R)&&w&&w.vnode.props&&w.vnode.props.appear;const V=b.content.firstChild;if(U){const se=V.getAttribute("class");se&&(V.$cls=se),R.beforeEnter(V)}_(V,b,w),v.el=b=V}if(M&16&&!(I&&(I.innerHTML||I.textContent))){let V=p(b.firstChild,v,b,w,N,E,k);for(V&&!Xu(b,1)&&Rl();V;){const se=V;V=V.nextSibling,l(se)}}else if(M&8){let V=v.children;V[0]===`
15
+ `&&(b.tagName==="PRE"||b.tagName==="TEXTAREA")&&(V=V.slice(1));const{textContent:se}=b;se!==V&&se!==V.replace(/\r\n|\r/g,`
16
+ `)&&(Xu(b,0)||Rl(),b.textContent=v.children)}if(I){if(B||!k||P&48){const V=b.tagName.includes("-");for(const se in I)(B&&(se.endsWith("value")||se==="indeterminate")||ru(se)&&!ol(se)||se[0]==="."||V&&!ol(se))&&s(b,se,null,I[se],void 0,w)}else if(I.onClick)s(b,"onClick",null,I.onClick,void 0,w);else if(P&4&&dr(I.style))for(const V in I.style)I.style[V]}let K;(K=I&&I.onVnodeBeforeMount)&&Ps(K,w,v),L&&ti(v,null,w,"beforeMount"),((K=I&&I.onVnodeMounted)||L||U)&&FS(()=>{K&&Ps(K,w,v),U&&R.enter(b),L&&ti(v,null,w,"mounted")},N)}return b.nextSibling},p=(b,v,w,N,E,k,A)=>{A=A||!!v.dynamicChildren;const I=v.children,P=I.length;let M=!1;for(let L=0;L<P;L++){const R=A?I[L]:I[L]=Rs(I[L]),B=R.type===fr;b?(B&&!A&&L+1<P&&Rs(I[L+1]).type===fr&&(a(o(b.data.slice(R.children.length)),w,i(b)),b.data=R.children),b=d(b,R,N,E,k,A)):B&&!R.children?a(R.el=o(""),w):(M||(M=!0,Xu(w,1)||Rl()),n(null,R,w,null,N,E,Yu(w),k))}return b},h=(b,v,w,N,E,k)=>{const{slotScopeIds:A}=v;A&&(E=E?E.concat(A):A);const I=r(b),P=p(i(b),v,I,w,N,E,k);return P&&Yl(P)&&P.data==="]"?i(v.anchor=P):(Rl(),a(v.anchor=c("]"),I,P),P)},g=(b,v,w,N,E,k)=>{if(Xu(b.parentElement,1)||Rl(),v.el=null,k){const P=S(b);for(;;){const M=i(b);if(M&&M!==P)l(M);else break}}const A=i(b),I=r(b);return l(b),n(null,v,I,A,w,N,Yu(I),E),w&&(w.vnode.el=v.el,dh(w,v.el)),A},S=(b,v="[",w="]")=>{let N=0;for(;b;)if(b=i(b),b&&Yl(b)&&(b.data===v&&N++,b.data===w)){if(N===0)return i(b);N--}return b},_=(b,v,w)=>{const N=v.parentNode;N&&N.replaceChild(b,v);let E=w;for(;E;)E.vnode.el===v&&(E.vnode.el=E.subTree.el=b),E=E.parent},y=b=>b.nodeType===1&&b.tagName==="TEMPLATE";return[u,d]}const Fy="data-allow-mismatch",CE={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Xu(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Fy);)e=e.parentElement;const n=e&&e.getAttribute(Fy);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(CE[t])}}const xE=th().requestIdleCallback||(e=>setTimeout(e,1)),TE=th().cancelIdleCallback||(e=>clearTimeout(e)),mhe=(e=1e4)=>t=>{const n=xE(t,{timeout:e});return()=>TE(n)};function ME(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 ghe=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(ME(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},vhe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},yhe=(e=[])=>(t,n)=>{sn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function AE(e,t){if(Yl(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Yl(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Mi=e=>!!e.type.__asyncLoader;function si(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(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((S,_)=>{a(g,()=>S(f()),()=>_(g),d+1)});throw g}).then(g=>h!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Ze({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,g,S){let _=!1;(g.bu||(g.bu=[])).push(()=>_=!0);const y=()=>{_||S()},b=i?()=>{const v=i(y,w=>AE(h,w));v&&(g.bum||(g.bum=[])).push(v)}:y;u?b():p().then(()=>!g.isUnmounted&&b())},get __asyncResolved(){return u},setup(){const h=ls;if(R1(h),u)return()=>Zu(u,h);const g=b=>{c=null,xa(b,h,13,!s)};if(l&&h.suspense||ul)return p().then(b=>()=>Zu(b,h)).catch(b=>(g(b),()=>s?gt(s,{error:b}):null));const S=te(!1),_=te(),y=te(!!o);return o&&setTimeout(()=>{y.value=!1},o),r!=null&&setTimeout(()=>{if(!S.value&&!_.value){const b=new Error(`Async component timed out after ${r}ms.`);g(b),_.value=b}},r),p().then(()=>{S.value=!0,h.parent&&cu(h.parent.vnode)&&h.parent.update()}).catch(b=>{g(b),_.value=b}),()=>{if(S.value&&u)return Zu(u,h);if(_.value&&s)return gt(s,{error:_.value});if(n&&!y.value)return Zu(n,h)}}})}function Zu(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=gt(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const cu=e=>e.type.__isKeepAlive,EE={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=us(),s=n.ctx;if(!s.renderer)return()=>{const y=t.default&&t.default();return y&&y.length===1?y[0]:y};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=(y,b,v,w,N)=>{const E=y.component;c(y,b,v,0,l),a(E.vnode,y,b,v,E,l,w,y.slotScopeIds,N),Wn(()=>{E.isDeactivated=!1,E.a&&na(E.a);const k=y.props&&y.props.onVnodeMounted;k&&Ps(k,E.parent,y)},l)},s.deactivate=y=>{const b=y.component;ef(b.m),ef(b.a),c(y,f,null,1,l),Wn(()=>{b.da&&na(b.da);const v=y.props&&y.props.onVnodeUnmounted;v&&Ps(v,b.parent,y),b.isDeactivated=!0},l)};function p(y){Gp(y),u(y,n,l,!0)}function h(y){o.forEach((b,v)=>{const w=pg(Mi(b)?b.type.__asyncResolved||{}:b.type);w&&!y(w)&&g(v)})}function g(y){const b=o.get(y);b&&(!r||!Do(b,r))?p(b):r&&Gp(r),o.delete(y),i.delete(y)}Ke(()=>[e.include,e.exclude],([y,b])=>{y&&h(v=>cc(y,v)),b&&h(v=>!cc(b,v))},{flush:"post",deep:!0});let S=null;const _=()=>{S!=null&&(tf(n.subTree.type)?Wn(()=>{o.set(S,Ju(n.subTree))},n.subTree.suspense):o.set(S,Ju(n.subTree)))};return Zt(_),D1(_),qs(()=>{o.forEach(y=>{const{subTree:b,suspense:v}=n,w=Ju(b);if(y.type===w.type&&y.key===w.key){Gp(w);const N=w.component.da;N&&Wn(N,v);return}p(y)})}),()=>{if(S=null,!t.default)return r=null;const y=t.default(),b=y[0];if(y.length>1)return r=null,y;if(!vr(b)||!(b.shapeFlag&4)&&!(b.shapeFlag&128))return r=null,b;let v=Ju(b);if(v.type===Un)return r=null,v;const w=v.type,N=pg(Mi(v)?v.type.__asyncResolved||{}:w),{include:E,exclude:k,max:A}=e;if(E&&(!N||!cc(E,N))||k&&N&&cc(k,N))return v.shapeFlag&=-257,r=v,b;const I=v.key==null?w:v.key,P=o.get(I);return v.el&&(v=Li(v),b.shapeFlag&128&&(b.ssContent=v)),S=I,P?(v.el=P.el,v.component=P.component,v.transition&&gr(v,v.transition),v.shapeFlag|=512,i.delete(I),i.add(I)):(i.add(I),A&&i.size>parseInt(A,10)&&g(i.values().next().value)),v.shapeFlag|=256,r=v,tf(b.type)?b:v}}},khe=EE;function cc(e,t){return at(e)?e.some(n=>cc(n,t)):sn(e)?e.split(",").includes(t):gA(e)?(e.lastIndex=0,e.test(t)):!1}function $E(e,t){vS(e,"a",t)}function IE(e,t){vS(e,"da",t)}function vS(e,t,n=ls){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ch(t,s,n),n){let o=n.parent;for(;o&&o.parent;)cu(o.parent.vnode)&&NE(s,t,n,o),o=o.parent}}function NE(e,t,n,s){const o=ch(t,e,s,!0);Ft(()=>{M1(s[t],o)},n)}function Gp(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ju(e){return e.shapeFlag&128?e.ssContent:e}function ch(e,t,n=ls,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{$i();const l=Ta(n),a=Io(t,n,e,r);return l(),Ii(),a});return s?o.unshift(i):o.push(i),i}}const Ri=e=>(t,n=ls)=>{(!ul||e==="sp")&&ch(e,(...s)=>t(...s),n)},LE=Ri("bm"),Zt=Ri("m"),yS=Ri("bu"),D1=Ri("u"),qs=Ri("bum"),Ft=Ri("um"),OE=Ri("sp"),PE=Ri("rtg"),RE=Ri("rtc");function DE(e,t=ls){ch("ec",e,t)}const B1="components",BE="directives";function FE(e,t){return F1(B1,e,!0,t)||e}const kS=Symbol.for("v-ndc");function vs(e){return sn(e)?F1(B1,e,!1)||e:e||kS}function bhe(e){return F1(BE,e)}function F1(e,t,n=!0,s=!1){const o=cs||ls;if(o){const i=o.type;if(e===B1){const l=pg(i,!1);if(l&&(l===t||l===Xn(t)||l===Qf(Xn(t))))return i}const r=Hy(o[e]||i[e],t)||Hy(o.appContext[e],t);return!r&&s?i:r}}function Hy(e,t){return e&&(e[t]||e[Xn(t)]||e[Qf(Xn(t))])}function Xe(e,t,n,s){let o;const i=n&&n[s],r=at(e);if(r||sn(e)){const l=r&&dr(e);let a=!1,c=!1;l&&(a=!so(e),c=Ni(e),e=oh(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?va(Wo(e[u])):Wo(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(Vt(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function _he(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(at(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 ia(e,t,n={},s,o){if(cs.ce||cs.parent&&Mi(cs.parent)&&cs.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),je(Pe,null,[gt("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&H1(i(n)),l=n.key||r&&r.key,a=je(Pe,{key:(l&&!co(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 H1(e){return e.some(t=>vr(t)?!(t.type===Un||t.type===Pe&&!H1(t.children)):!0)?e:null}function whe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:Cd(s)]=e[s];return n}const rg=e=>e?qS(e)?du(e):rg(e.parent):null,bc=tn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>rg(e.parent),$root:e=>rg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>W1(e),$forceUpdate:e=>e.f||(e.f=()=>{O1(e.update)}),$nextTick:e=>e.n||(e.n=mt.bind(e.proxy)),$watch:e=>mE.bind(e)}),Yp=(e,t)=>e!==Nt&&!e.__isScriptSetup&&zt(e,t),lg={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(Yp(s,t))return r[t]=1,s[t];if(o!==Nt&&zt(o,t))return r[t]=2,o[t];if(zt(i,t))return r[t]=3,i[t];if(n!==Nt&&zt(n,t))return r[t]=4,n[t];ag&&(r[t]=0)}}const c=bc[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!==Nt&&zt(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,zt(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Yp(o,t)?(o[t]=n,!0):s!==Nt&&zt(s,t)?(s[t]=n,!0):zt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Nt&&l[0]!=="$"&&zt(e,l)||Yp(t,l)||zt(i,l)||zt(s,l)||zt(bc,l)||zt(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:zt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},HE=tn({},lg,{get(e,t){if(t!==Symbol.unscopables)return lg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!_A(t)}});function She(){return null}function Che(){return null}function xhe(e){}function The(e){}function Mhe(){return null}function Ahe(){}function Ehe(e,t){return null}function $he(){return bS().slots}function uu(){return bS().attrs}function bS(e){const t=us();return t.setupContext||(t.setupContext=KS(t))}function Fc(e){return at(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Ihe(e,t){const n=Fc(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?at(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 Nhe(e,t){return!e||!t?e||t:at(e)&&at(t)?e.concat(t):tn({},Fc(e),Fc(t))}function Lhe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Ohe(e){const t=us(),n=ul;let s=e();Wc(),n&&aa(!1);const o=()=>{Ta(t),n&&aa(!0)},i=()=>{us()!==t&&t.scope.off(),Wc(),n&&aa(!1)};return A1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let ag=!0;function WE(e){const t=W1(e),n=e.proxy,s=e.ctx;ag=!1,t.beforeCreate&&Wy(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:g,deactivated:S,beforeDestroy:_,beforeUnmount:y,destroyed:b,unmounted:v,render:w,renderTracked:N,renderTriggered:E,errorCaptured:k,serverPrefetch:A,expose:I,inheritAttrs:P,components:M,directives:L,filters:R}=t;if(c&&UE(c,s,null),r)for(const K in r){const V=r[K];bt(V)&&(s[K]=V.bind(n))}if(o){const K=o.call(n,n);Vt(K)&&(e.data=to(K))}if(ag=!0,i)for(const K in i){const V=i[K],se=bt(V)?V.bind(n,n):bt(V.get)?V.get.bind(n,n):Eo,Y=!bt(V)&&bt(V.set)?V.set.bind(n):Eo,G=F({get:se,set:Y});Object.defineProperty(s,K,{enumerable:!0,configurable:!0,get:()=>G.value,set:ee=>G.value=ee})}if(l)for(const K in l)_S(l[K],s,n,K);if(a){const K=bt(a)?a.call(n):a;Reflect.ownKeys(K).forEach(V=>{gn(V,K[V])})}u&&Wy(u,e,"c");function U(K,V){at(V)?V.forEach(se=>K(se.bind(n))):V&&K(V.bind(n))}if(U(LE,d),U(Zt,f),U(yS,p),U(D1,h),U($E,g),U(IE,S),U(DE,k),U(RE,N),U(PE,E),U(qs,y),U(Ft,v),U(OE,A),at(I))if(I.length){const K=e.exposed||(e.exposed={});I.forEach(V=>{Object.defineProperty(K,V,{get:()=>n[V],set:se=>n[V]=se,enumerable:!0})})}else e.exposed||(e.exposed={});w&&e.render===Eo&&(e.render=w),P!=null&&(e.inheritAttrs=P),M&&(e.components=M),L&&(e.directives=L),A&&R1(e)}function UE(e,t,n=Eo){at(e)&&(e=cg(e));for(const s in e){const o=e[s];let i;Vt(o)?"default"in o?i=Rt(o.from||s,o.default,!0):i=Rt(o.from||s):i=Rt(o),Fn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Wy(e,t,n){Io(at(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function _S(e,t,n,s){let o=s.includes(".")?cS(n,s):()=>n[s];if(sn(e)){const i=t[e];bt(i)&&Ke(o,i)}else if(bt(e))Ke(o,e.bind(n));else if(Vt(e))if(at(e))e.forEach(i=>_S(i,t,n,s));else{const i=bt(e.handler)?e.handler.bind(n):t[e.handler];bt(i)&&Ke(o,i,e)}}function W1(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=>Qd(a,c,r,!0)),Qd(a,t,r)),Vt(t)&&i.set(t,a),a}function Qd(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Qd(e,i,n,!0),o&&o.forEach(r=>Qd(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=jE[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const jE={data:Uy,props:jy,emits:jy,methods:uc,computed:uc,beforeCreate:Cs,created:Cs,beforeMount:Cs,mounted:Cs,beforeUpdate:Cs,updated:Cs,beforeDestroy:Cs,beforeUnmount:Cs,destroyed:Cs,unmounted:Cs,activated:Cs,deactivated:Cs,errorCaptured:Cs,serverPrefetch:Cs,components:uc,directives:uc,watch:zE,provide:Uy,inject:qE};function Uy(e,t){return t?e?function(){return tn(bt(e)?e.call(this,this):e,bt(t)?t.call(this,this):t)}:t:e}function qE(e,t){return uc(cg(e),cg(t))}function cg(e){if(at(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Cs(e,t){return e?[...new Set([].concat(e,t))]:t}function uc(e,t){return e?tn(Object.create(null),e,t):t}function jy(e,t){return e?at(e)&&at(t)?[...new Set([...e,...t])]:tn(Object.create(null),Fc(e),Fc(t??{})):t}function zE(e,t){if(!e)return t;if(!t)return e;const n=tn(Object.create(null),e);for(const s in t)n[s]=Cs(e[s],t[s]);return n}function wS(){return{app:null,config:{isNativeTag:N2,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 VE=0;function KE(e,t){return function(s,o=null){bt(s)||(s=tn({},s)),o!=null&&!Vt(o)&&(o=null);const i=wS(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:VE++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:S4,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||gt(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,du(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Io(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=rl;rl=c;try{return u()}finally{rl=d}}};return c}}let rl=null;function Phe(e,t,n=Nt){const s=us(),o=Xn(t),i=Ds(t),r=SS(e,o),l=QA((a,c)=>{let u,d=Nt,f;return pE(()=>{const p=e[o];rs(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(!rs(h,u)&&!(d!==Nt&&rs(p,d)))return;const g=s.vnode.props;g&&(t in g||o in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${o}`in g||`onUpdate:${i}`in g)||(u=p,c()),s.emit(`update:${t}`,h),rs(p,h)&&rs(p,d)&&!rs(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Nt:l,done:!1}:{done:!0}}}},l}const SS=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xn(t)}Modifiers`]||e[`${Ds(t)}Modifiers`];function GE(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Nt;let o=n;const i=t.startsWith("update:"),r=i&&SS(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>sn(u)?u.trim():u)),r.number&&(o=n.map(eh)));let l,a=s[l=Cd(t)]||s[l=Cd(Xn(t))];!a&&i&&(a=s[l=Cd(Ds(t))]),a&&Io(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,Io(c,e,6,o)}}const YE=new WeakMap;function CS(e,t,n=!1){const s=n?YE: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=CS(c,t,!0);u&&(l=!0,tn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Vt(e)&&s.set(e,null),null):(at(i)?i.forEach(a=>r[a]=null):tn(r,i),Vt(e)&&s.set(e,r),r)}function uh(e,t){return!e||!ru(t)?!1:(t=t.slice(2).replace(/Once$/,""),zt(e,t[0].toLowerCase()+t.slice(1))||zt(e,Ds(t))||zt(e,t))}function xd(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:g}=e,S=Dc(e);let _,y;try{if(n.shapeFlag&4){const v=o||s,w=v;_=Rs(c.call(w,v,u,d,p,f,h)),y=l}else{const v=t;_=Rs(v.length>1?v(d,{attrs:l,slots:r,emit:a}):v(d,null)),y=t.props?l:ZE(l)}}catch(v){_c.length=0,xa(v,e,1),_=gt(Un)}let b=_;if(y&&g!==!1){const v=Object.keys(y),{shapeFlag:w}=b;v.length&&w&7&&(i&&v.some(Yf)&&(y=JE(y,i)),b=Li(b,y,!1,!0))}return n.dirs&&(b=Li(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&gr(b,n.transition),_=b,Dc(S),_}function XE(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(vr(o)){if(o.type!==Un||o.children==="v-if"){if(n)return;n=o}}else return}return n}const ZE=e=>{let t;for(const n in e)(n==="class"||n==="style"||ru(n))&&((t||(t={}))[n]=e[n]);return t},JE=(e,t)=>{const n={};for(const s in e)(!Yf(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function QE(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?qy(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(xS(r,s,f)&&!uh(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?qy(s,r,c):!0:!!r;return!1}function qy(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(xS(t,e,i)&&!uh(n,i))return!0}return!1}function xS(e,t,n){const s=e[n],o=t[n];return n==="style"&&Vt(s)&&Vt(o)?!Ei(s,o):s!==o}function dh({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 TS={},MS=()=>Object.create(TS),AS=e=>Object.getPrototypeOf(e)===TS;function e4(e,t,n,s=!1){const o={},i=MS();e.propsDefaults=Object.create(null),ES(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:YA(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function t4(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Dt(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(uh(e.emitsOptions,f))continue;const p=t[f];if(a)if(zt(i,f))p!==i[f]&&(i[f]=p,c=!0);else{const h=Xn(f);o[h]=ug(a,l,h,p,e,!1)}else p!==i[f]&&(i[f]=p,c=!0)}}}else{ES(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!zt(t,d)&&((u=Ds(d))===d||!zt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=ug(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!zt(t,d))&&(delete i[d],c=!0)}c&&wi(e.attrs,"set","")}function ES(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(ol(a))continue;const c=t[a];let u;o&&zt(o,u=Xn(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:uh(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Dt(n),c=l||Nt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=ug(o,a,d,c[d],e,!zt(c,d))}}return r}function ug(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=zt(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&bt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Ta(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===Ds(n))&&(s=!0))}return s}const n4=new WeakMap;function $S(e,t,n=!1){const s=n?n4: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]=$S(d,t,!0);tn(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 Vt(e)&&s.set(e,ea),ea;if(at(i))for(let u=0;u<i.length;u++){const d=Xn(i[u]);zy(d)&&(r[d]=Nt)}else if(i)for(const u in i){const d=Xn(u);if(zy(d)){const f=i[u],p=r[d]=at(f)||bt(f)?{type:f}:tn({},f),h=p.type;let g=!1,S=!0;if(at(h))for(let _=0;_<h.length;++_){const y=h[_],b=bt(y)&&y.name;if(b==="Boolean"){g=!0;break}else b==="String"&&(S=!1)}else g=bt(h)&&h.name==="Boolean";p[0]=g,p[1]=S,(g||zt(p,"default"))&&l.push(d)}}const c=[r,l];return Vt(e)&&s.set(e,c),c}function zy(e){return e[0]!=="$"&&!ol(e)}const U1=e=>e==="_"||e==="_ctx"||e==="$stable",j1=e=>at(e)?e.map(Rs):[Rs(e)],s4=(e,t,n)=>{if(t._n)return t;const s=In((...o)=>j1(t(...o)),n);return s._c=!1,s},IS=(e,t,n)=>{const s=e._ctx;for(const o in e){if(U1(o))continue;const i=e[o];if(bt(i))t[o]=s4(o,i,s);else if(i!=null){const r=j1(i);t[o]=()=>r}}},NS=(e,t)=>{const n=j1(t);e.slots.default=()=>n},LS=(e,t,n)=>{for(const s in t)(n||!U1(s))&&(e[s]=t[s])},o4=(e,t,n)=>{const s=e.slots=MS();if(e.vnode.shapeFlag&32){const o=t._;o?(LS(s,t,n),n&&O2(s,"_",o,!0)):IS(t,s)}else t&&NS(e,t)},i4=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Nt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:LS(o,t,n):(i=!t.$stable,IS(t,o)),r=t}else t&&(NS(e,t),r={default:1});if(i)for(const l in o)!U1(l)&&r[l]==null&&delete o[l]},Wn=FS;function r4(e){return OS(e)}function l4(e){return OS(e,SE)}function OS(e,t){const n=th();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=Eo,insertStaticContent:h}=e,g=(W,Z,fe,oe=null,he=null,H=null,X=void 0,ce=null,ke=!!Z.dynamicChildren)=>{if(W===Z)return;W&&!Do(W,Z)&&(oe=we(W),ee(W,he,H,!0),W=null),Z.patchFlag===-2&&(ke=!1,Z.dynamicChildren=null);const{type:Me,ref:Ne,shapeFlag:re}=Z;switch(Me){case fr:S(W,Z,fe,oe);break;case Un:_(W,Z,fe,oe);break;case la:W==null&&y(Z,fe,oe,X);break;case Pe:M(W,Z,fe,oe,he,H,X,ce,ke);break;default:re&1?w(W,Z,fe,oe,he,H,X,ce,ke):re&6?L(W,Z,fe,oe,he,H,X,ce,ke):(re&64||re&128)&&Me.process(W,Z,fe,oe,he,H,X,ce,ke,J)}Ne!=null&&he?oa(Ne,W&&W.ref,H,Z||W,!Z):Ne==null&&W&&W.ref!=null&&oa(W.ref,null,H,W,!0)},S=(W,Z,fe,oe)=>{if(W==null)s(Z.el=l(Z.children),fe,oe);else{const he=Z.el=W.el;Z.children!==W.children&&c(he,Z.children)}},_=(W,Z,fe,oe)=>{W==null?s(Z.el=a(Z.children||""),fe,oe):Z.el=W.el},y=(W,Z,fe,oe)=>{[W.el,W.anchor]=h(W.children,Z,fe,oe,W.el,W.anchor)},b=({el:W,anchor:Z},fe,oe)=>{let he;for(;W&&W!==Z;)he=f(W),s(W,fe,oe),W=he;s(Z,fe,oe)},v=({el:W,anchor:Z})=>{let fe;for(;W&&W!==Z;)fe=f(W),o(W),W=fe;o(Z)},w=(W,Z,fe,oe,he,H,X,ce,ke)=>{if(Z.type==="svg"?X="svg":Z.type==="math"&&(X="mathml"),W==null)N(Z,fe,oe,he,H,X,ce,ke);else{const Me=W.el&&W.el._isVueCE?W.el:null;try{Me&&Me._beginPatch(),A(W,Z,he,H,X,ce,ke)}finally{Me&&Me._endPatch()}}},N=(W,Z,fe,oe,he,H,X,ce)=>{let ke,Me;const{props:Ne,shapeFlag:re,transition:le,dirs:Ce}=W;if(ke=W.el=r(W.type,H,Ne&&Ne.is,Ne),re&8?u(ke,W.children):re&16&&k(W.children,ke,null,oe,he,Xp(W,H),X,ce),Ce&&ti(W,null,oe,"created"),E(ke,W,W.scopeId,X,oe),Ne){for(const nt in Ne)nt!=="value"&&!ol(nt)&&i(ke,nt,null,Ne[nt],H,oe);"value"in Ne&&i(ke,"value",null,Ne.value,H),(Me=Ne.onVnodeBeforeMount)&&Ps(Me,oe,W)}Ce&&ti(W,null,oe,"beforeMount");const We=PS(he,le);We&&le.beforeEnter(ke),s(ke,Z,fe),((Me=Ne&&Ne.onVnodeMounted)||We||Ce)&&Wn(()=>{try{Me&&Ps(Me,oe,W),We&&le.enter(ke),Ce&&ti(W,null,oe,"mounted")}finally{}},he)},E=(W,Z,fe,oe,he)=>{if(fe&&p(W,fe),oe)for(let H=0;H<oe.length;H++)p(W,oe[H]);if(he){let H=he.subTree;if(Z===H||tf(H.type)&&(H.ssContent===Z||H.ssFallback===Z)){const X=he.vnode;E(W,X,X.scopeId,X.slotScopeIds,he.parent)}}},k=(W,Z,fe,oe,he,H,X,ce,ke=0)=>{for(let Me=ke;Me<W.length;Me++){const Ne=W[Me]=ce?_i(W[Me]):Rs(W[Me]);g(null,Ne,Z,fe,oe,he,H,X,ce)}},A=(W,Z,fe,oe,he,H,X)=>{const ce=Z.el=W.el;let{patchFlag:ke,dynamicChildren:Me,dirs:Ne}=Z;ke|=W.patchFlag&16;const re=W.props||Nt,le=Z.props||Nt;let Ce;if(fe&&qr(fe,!1),(Ce=le.onVnodeBeforeUpdate)&&Ps(Ce,fe,Z,W),Ne&&ti(Z,W,fe,"beforeUpdate"),fe&&qr(fe,!0),(re.innerHTML&&le.innerHTML==null||re.textContent&&le.textContent==null)&&u(ce,""),Me?I(W.dynamicChildren,Me,ce,fe,oe,Xp(Z,he),H):X||V(W,Z,ce,null,fe,oe,Xp(Z,he),H,!1),ke>0){if(ke&16)P(ce,re,le,fe,he);else if(ke&2&&re.class!==le.class&&i(ce,"class",null,le.class,he),ke&4&&i(ce,"style",re.style,le.style,he),ke&8){const We=Z.dynamicProps;for(let nt=0;nt<We.length;nt++){const lt=We[nt],kt=re[lt],Ct=le[lt];(Ct!==kt||lt==="value")&&i(ce,lt,kt,Ct,he,fe)}}ke&1&&W.children!==Z.children&&u(ce,Z.children)}else!X&&Me==null&&P(ce,re,le,fe,he);((Ce=le.onVnodeUpdated)||Ne)&&Wn(()=>{Ce&&Ps(Ce,fe,Z,W),Ne&&ti(Z,W,fe,"updated")},oe)},I=(W,Z,fe,oe,he,H,X)=>{for(let ce=0;ce<Z.length;ce++){const ke=W[ce],Me=Z[ce],Ne=ke.el&&(ke.type===Pe||!Do(ke,Me)||ke.shapeFlag&198)?d(ke.el):fe;g(ke,Me,Ne,null,oe,he,H,X,!0)}},P=(W,Z,fe,oe,he)=>{if(Z!==fe){if(Z!==Nt)for(const H in Z)!ol(H)&&!(H in fe)&&i(W,H,Z[H],null,he,oe);for(const H in fe){if(ol(H))continue;const X=fe[H],ce=Z[H];X!==ce&&H!=="value"&&i(W,H,ce,X,he,oe)}"value"in fe&&i(W,"value",Z.value,fe.value,he)}},M=(W,Z,fe,oe,he,H,X,ce,ke)=>{const Me=Z.el=W?W.el:l(""),Ne=Z.anchor=W?W.anchor:l("");let{patchFlag:re,dynamicChildren:le,slotScopeIds:Ce}=Z;Ce&&(ce=ce?ce.concat(Ce):Ce),W==null?(s(Me,fe,oe),s(Ne,fe,oe),k(Z.children||[],fe,Ne,he,H,X,ce,ke)):re>0&&re&64&&le&&W.dynamicChildren&&W.dynamicChildren.length===le.length?(I(W.dynamicChildren,le,fe,he,H,X,ce),(Z.key!=null||he&&Z===he.subTree)&&q1(W,Z,!0)):V(W,Z,fe,Ne,he,H,X,ce,ke)},L=(W,Z,fe,oe,he,H,X,ce,ke)=>{Z.slotScopeIds=ce,W==null?Z.shapeFlag&512?he.ctx.activate(Z,fe,oe,X,ke):R(Z,fe,oe,he,H,X,ke):B(W,Z,ke)},R=(W,Z,fe,oe,he,H,X)=>{const ce=W.component=jS(W,oe,he);if(cu(W)&&(ce.ctx.renderer=J),zS(ce,!1,X),ce.asyncDep){if(he&&he.registerDep(ce,U,X),!W.el){const ke=ce.subTree=gt(Un);_(null,ke,Z,fe),W.placeholder=ke.el}}else U(ce,W,Z,fe,he,H,X)},B=(W,Z,fe)=>{const oe=Z.component=W.component;if(QE(W,Z,fe))if(oe.asyncDep&&!oe.asyncResolved){K(oe,Z,fe);return}else oe.next=Z,oe.update();else Z.el=W.el,oe.vnode=Z},U=(W,Z,fe,oe,he,H,X)=>{const ce=()=>{if(W.isMounted){let{next:re,bu:le,u:Ce,parent:We,vnode:nt}=W;{const Et=RS(W);if(Et){re&&(re.el=nt.el,K(W,re,X)),Et.asyncDep.then(()=>{Wn(()=>{W.isUnmounted||Me()},he)});return}}let lt=re,kt;qr(W,!1),re?(re.el=nt.el,K(W,re,X)):re=nt,le&&na(le),(kt=re.props&&re.props.onVnodeBeforeUpdate)&&Ps(kt,We,re,nt),qr(W,!0);const Ct=xd(W),ut=W.subTree;W.subTree=Ct,g(ut,Ct,d(ut.el),we(ut),W,he,H),re.el=Ct.el,lt===null&&dh(W,Ct.el),Ce&&Wn(Ce,he),(kt=re.props&&re.props.onVnodeUpdated)&&Wn(()=>Ps(kt,We,re,nt),he)}else{let re;const{el:le,props:Ce}=Z,{bm:We,m:nt,parent:lt,root:kt,type:Ct}=W,ut=Mi(Z);if(qr(W,!1),We&&na(We),!ut&&(re=Ce&&Ce.onVnodeBeforeMount)&&Ps(re,lt,Z),qr(W,!0),le&&_e){const Et=()=>{W.subTree=xd(W),_e(le,W.subTree,W,he,null)};ut&&Ct.__asyncHydrate?Ct.__asyncHydrate(le,W,Et):Et()}else{kt.ce&&kt.ce._hasShadowRoot()&&kt.ce._injectChildStyle(Ct,W.parent?W.parent.type:void 0);const Et=W.subTree=xd(W);g(null,Et,fe,oe,W,he,H),Z.el=Et.el}if(nt&&Wn(nt,he),!ut&&(re=Ce&&Ce.onVnodeMounted)){const Et=Z;Wn(()=>Ps(re,lt,Et),he)}(Z.shapeFlag&256||lt&&Mi(lt.vnode)&&lt.vnode.shapeFlag&256)&&W.a&&Wn(W.a,he),W.isMounted=!0,Z=fe=oe=null}};W.scope.on();const ke=W.effect=new zd(ce);W.scope.off();const Me=W.update=ke.run.bind(ke),Ne=W.job=ke.runIfDirty.bind(ke);Ne.i=W,Ne.id=W.uid,ke.scheduler=()=>O1(Ne),qr(W,!0),Me()},K=(W,Z,fe)=>{Z.component=W;const oe=W.vnode.props;W.vnode=Z,W.next=null,t4(W,Z.props,oe,fe),i4(W,Z.children,fe),$i(),Ny(W),Ii()},V=(W,Z,fe,oe,he,H,X,ce,ke=!1)=>{const Me=W&&W.children,Ne=W?W.shapeFlag:0,re=Z.children,{patchFlag:le,shapeFlag:Ce}=Z;if(le>0){if(le&128){Y(Me,re,fe,oe,he,H,X,ce,ke);return}else if(le&256){se(Me,re,fe,oe,he,H,X,ce,ke);return}}Ce&8?(Ne&16&&de(Me,he,H),re!==Me&&u(fe,re)):Ne&16?Ce&16?Y(Me,re,fe,oe,he,H,X,ce,ke):de(Me,he,H,!0):(Ne&8&&u(fe,""),Ce&16&&k(re,fe,oe,he,H,X,ce,ke))},se=(W,Z,fe,oe,he,H,X,ce,ke)=>{W=W||ea,Z=Z||ea;const Me=W.length,Ne=Z.length,re=Math.min(Me,Ne);let le;for(le=0;le<re;le++){const Ce=Z[le]=ke?_i(Z[le]):Rs(Z[le]);g(W[le],Ce,fe,null,he,H,X,ce,ke)}Me>Ne?de(W,he,H,!0,!1,re):k(Z,fe,oe,he,H,X,ce,ke,re)},Y=(W,Z,fe,oe,he,H,X,ce,ke)=>{let Me=0;const Ne=Z.length;let re=W.length-1,le=Ne-1;for(;Me<=re&&Me<=le;){const Ce=W[Me],We=Z[Me]=ke?_i(Z[Me]):Rs(Z[Me]);if(Do(Ce,We))g(Ce,We,fe,null,he,H,X,ce,ke);else break;Me++}for(;Me<=re&&Me<=le;){const Ce=W[re],We=Z[le]=ke?_i(Z[le]):Rs(Z[le]);if(Do(Ce,We))g(Ce,We,fe,null,he,H,X,ce,ke);else break;re--,le--}if(Me>re){if(Me<=le){const Ce=le+1,We=Ce<Ne?Z[Ce].el:oe;for(;Me<=le;)g(null,Z[Me]=ke?_i(Z[Me]):Rs(Z[Me]),fe,We,he,H,X,ce,ke),Me++}}else if(Me>le)for(;Me<=re;)ee(W[Me],he,H,!0),Me++;else{const Ce=Me,We=Me,nt=new Map;for(Me=We;Me<=le;Me++){const $t=Z[Me]=ke?_i(Z[Me]):Rs(Z[Me]);$t.key!=null&&nt.set($t.key,Me)}let lt,kt=0;const Ct=le-We+1;let ut=!1,Et=0;const on=new Array(Ct);for(Me=0;Me<Ct;Me++)on[Me]=0;for(Me=Ce;Me<=re;Me++){const $t=W[Me];if(kt>=Ct){ee($t,he,H,!0);continue}let On;if($t.key!=null)On=nt.get($t.key);else for(lt=We;lt<=le;lt++)if(on[lt-We]===0&&Do($t,Z[lt])){On=lt;break}On===void 0?ee($t,he,H,!0):(on[On-We]=Me+1,On>=Et?Et=On:ut=!0,g($t,Z[On],fe,null,he,H,X,ce,ke),kt++)}const Tn=ut?a4(on):ea;for(lt=Tn.length-1,Me=Ct-1;Me>=0;Me--){const $t=We+Me,On=Z[$t],un=Z[$t+1],tt=$t+1<Ne?un.el||DS(un):oe;on[Me]===0?g(null,On,fe,tt,he,H,X,ce,ke):ut&&(lt<0||Me!==Tn[lt]?G(On,fe,tt,2):lt--)}}},G=(W,Z,fe,oe,he=null)=>{const{el:H,type:X,transition:ce,children:ke,shapeFlag:Me}=W;if(Me&6){G(W.component.subTree,Z,fe,oe);return}if(Me&128){W.suspense.move(Z,fe,oe);return}if(Me&64){X.move(W,Z,fe,J);return}if(X===Pe){s(H,Z,fe);for(let re=0;re<ke.length;re++)G(ke[re],Z,fe,oe);s(W.anchor,Z,fe);return}if(X===la){b(W,Z,fe);return}if(oe!==2&&Me&1&&ce)if(oe===0)ce.persisted&&!H[Co]?s(H,Z,fe):(ce.beforeEnter(H),s(H,Z,fe),Wn(()=>ce.enter(H),he));else{const{leave:re,delayLeave:le,afterLeave:Ce}=ce,We=()=>{W.ctx.isUnmounted?o(H):s(H,Z,fe)},nt=()=>{const lt=H._isLeaving||!!H[Co];H._isLeaving&&H[Co](!0),ce.persisted&&!lt?We():re(H,()=>{We(),Ce&&Ce()})};le?le(H,We,nt):nt()}else s(H,Z,fe)},ee=(W,Z,fe,oe=!1,he=!1)=>{const{type:H,props:X,ref:ce,children:ke,dynamicChildren:Me,shapeFlag:Ne,patchFlag:re,dirs:le,cacheIndex:Ce,memo:We}=W;if(re===-2&&(he=!1),ce!=null&&($i(),oa(ce,null,fe,W,!0),Ii()),Ce!=null&&(Z.renderCache[Ce]=void 0),Ne&256){Z.ctx.deactivate(W);return}const nt=Ne&1&&le,lt=!Mi(W);let kt;if(lt&&(kt=X&&X.onVnodeBeforeUnmount)&&Ps(kt,Z,W),Ne&6)Ie(W.component,fe,oe);else{if(Ne&128){W.suspense.unmount(fe,oe);return}nt&&ti(W,null,Z,"beforeUnmount"),Ne&64?W.type.remove(W,Z,fe,J,oe):Me&&!Me.hasOnce&&(H!==Pe||re>0&&re&64)?de(Me,Z,fe,!1,!0):(H===Pe&&re&384||!he&&Ne&16)&&de(ke,Z,fe),oe&&Se(W)}const Ct=We!=null&&Ce==null;(lt&&(kt=X&&X.onVnodeUnmounted)||nt||Ct)&&Wn(()=>{kt&&Ps(kt,Z,W),nt&&ti(W,null,Z,"unmounted"),Ct&&(W.el=null)},fe)},Se=W=>{const{type:Z,el:fe,anchor:oe,transition:he}=W;if(Z===Pe){ae(fe,oe);return}if(Z===la){v(W);return}const H=()=>{o(fe),he&&!he.persisted&&he.afterLeave&&he.afterLeave()};if(W.shapeFlag&1&&he&&!he.persisted){const{leave:X,delayLeave:ce}=he,ke=()=>X(fe,H);ce?ce(W.el,H,ke):ke()}else H()},ae=(W,Z)=>{let fe;for(;W!==Z;)fe=f(W),o(W),W=fe;o(Z)},Ie=(W,Z,fe)=>{const{bum:oe,scope:he,job:H,subTree:X,um:ce,m:ke,a:Me}=W;ef(ke),ef(Me),oe&&na(oe),he.stop(),H&&(H.flags|=8,ee(X,W,Z,fe)),ce&&Wn(ce,Z),Wn(()=>{W.isUnmounted=!0},Z)},de=(W,Z,fe,oe=!1,he=!1,H=0)=>{for(let X=H;X<W.length;X++)ee(W[X],Z,fe,oe,he)},we=W=>{if(W.shapeFlag&6)return we(W.component.subTree);if(W.shapeFlag&128)return W.suspense.next();const Z=f(W.anchor||W.el),fe=Z&&Z[uS];return fe?f(fe):Z};let me=!1;const $e=(W,Z,fe)=>{let oe;W==null?Z._vnode&&(ee(Z._vnode,null,null,!0),oe=Z._vnode.component):g(Z._vnode||null,W,Z,null,null,null,fe),Z._vnode=W,me||(me=!0,Ny(oe),Zd(),me=!1)},J={p:g,um:ee,m:G,r:Se,mt:R,mc:k,pc:V,pbc:I,n:we,o:e};let ye,_e;return t&&([ye,_e]=t(J)),{render:$e,hydrate:ye,createApp:KE($e,ye)}}function Xp({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 qr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function PS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function q1(e,t,n=!1){const s=e.children,o=t.children;if(at(s)&&at(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]=_i(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&q1(r,l)),l.type===fr&&(l.patchFlag===-1&&(l=o[i]=_i(l)),l.el=r.el),l.type===Un&&!l.el&&(l.el=r.el)}}function a4(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 RS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:RS(t)}function ef(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function DS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?DS(t.subTree):null}const tf=e=>e.__isSuspense;let dg=0;const c4={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)u4(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}d4(e,t,n,s,o,r,l,a,c)}},hydrate:f4,normalize:h4},Rhe=c4;function Hc(e,t){const n=e.props&&e.props[t];bt(n)&&n()}function u4(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=BS(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?(Hc(e,"onPending"),Hc(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),ra(f,e.ssFallback)):f.resolve(!1,!0)}function d4(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:g,isInFallback:S,isHydrating:_}=d;if(g)d.pendingBranch=f,Do(g,f)?(a(g,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():S&&(_||(a(h,p,n,s,o,null,i,r,l),ra(d,p)))):(d.pendingId=dg++,_?(d.isHydrating=!1,d.activeBranch=g):c(g,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),S?(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),ra(d,p))):h&&Do(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&&Do(h,f))a(h,f,n,s,o,d,i,r,l),ra(d,f);else if(Hc(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=dg++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:y,pendingId:b}=d;y>0?setTimeout(()=>{d.pendingId===b&&d.fallback(p)},y):y===0&&d.fallback(p)}}function BS(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:g,remove:S}}=c;let _;const y=p4(e);y&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const b=e.props?qd(e.props.timeout):void 0,v=i,w={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:dg++,timeout:typeof b=="number"?b:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(N=!1,E=!1){const{vnode:k,activeBranch:A,pendingBranch:I,pendingId:P,effects:M,parentComponent:L,container:R,isInFallback:B}=w;let U=!1;if(w.isHydrating)w.isHydrating=!1;else if(!N){U=A&&I.transition&&I.transition.mode==="out-in";let se=!1;U&&(A.transition.afterLeave=()=>{P===w.pendingId&&(f(I,R,i===v&&!se?h(A):i,0),Xd(M),B&&k.ssFallback&&(k.ssFallback.el=null))}),A&&!w.isFallbackMountPending&&(g(A.el)===R&&(i=h(A),se=!0),p(A,L,w,!0),!U&&B&&k.ssFallback&&Wn(()=>k.ssFallback.el=null,w)),U||f(I,R,i,0)}w.isFallbackMountPending=!1,ra(w,I),w.pendingBranch=null,w.isInFallback=!1;let K=w.parent,V=!1;for(;K;){if(K.pendingBranch){K.effects.push(...M),V=!0;break}K=K.parent}!V&&!U&&Xd(M),w.effects=[],y&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!E&&t.resolve()),Hc(k,"onResolve")},fallback(N){if(!w.pendingBranch)return;const{vnode:E,activeBranch:k,parentComponent:A,container:I,namespace:P}=w;Hc(E,"onFallback");const M=h(k),L=()=>{w.isFallbackMountPending=!1,w.isInFallback&&(d(null,N,I,M,A,null,P,l,a),ra(w,N))},R=N.transition&&N.transition.mode==="out-in";R&&(w.isFallbackMountPending=!0,k.transition.afterLeave=L),w.isInFallback=!0,p(k,A,null,!0),R||L()},move(N,E,k){w.activeBranch&&f(w.activeBranch,N,E,k),w.container=N},next(){return w.activeBranch&&h(w.activeBranch)},registerDep(N,E,k){const A=!!w.pendingBranch;A&&w.deps++;const I=N.vnode.el;N.asyncDep.catch(P=>{xa(P,N,0)}).then(P=>{if(N.isUnmounted||w.isUnmounted||w.pendingId!==N.suspenseId)return;Wc(),N.asyncResolved=!0;const{vnode:M}=N;fg(N,P,!1),I&&(M.el=I);const L=!I&&N.subTree.el;E(N,M,g(I||N.subTree.el),I?null:h(N.subTree),w,r,k),L&&(M.placeholder=null,S(L)),dh(N,M.el),A&&--w.deps===0&&w.resolve()})},unmount(N,E){w.isUnmounted=!0,w.activeBranch&&p(w.activeBranch,n,N,E),w.pendingBranch&&p(w.pendingBranch,n,N,E)}};return w}function f4(e,t,n,s,o,i,r,l,a){const c=t.suspense=BS(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 h4(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Vy(s?n.default:n),e.ssFallback=s?Vy(n.fallback):gt(Un)}function Vy(e){let t;if(bt(e)){const n=cl&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=ys,HS())}return at(e)&&(e=XE(e)),e=Rs(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function FS(e,t){t&&t.pendingBranch?at(e)?t.effects.push(...e):t.effects.push(e):Xd(e)}function ra(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,dh(s,o))}function p4(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),fr=Symbol.for("v-txt"),Un=Symbol.for("v-cmt"),la=Symbol.for("v-stc"),_c=[];let ys=null;function x(e=!1){_c.push(ys=e?null:[])}function HS(){_c.pop(),ys=_c[_c.length-1]||null}let cl=1;function nf(e,t=!1){cl+=e,e<0&&ys&&t&&(ys.hasOnce=!0)}function WS(e){return e.dynamicChildren=cl>0?ys||ea:null,HS(),cl>0&&ys&&ys.push(e),e}function $(e,t,n,s,o,i){return WS(m(e,t,n,s,o,i,!0))}function je(e,t,n,s,o){return WS(gt(e,t,n,s,o,!0))}function vr(e){return e?e.__v_isVNode===!0:!1}function Do(e,t){return e.type===t.type&&e.key===t.key}function Dhe(e){}const US=({key:e})=>e??null,Td=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?sn(e)||Fn(e)||bt(e)?{i:cs,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,s=0,o=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&US(t),ref:t&&Td(t),scopeId:ah,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:cs};return l?(z1(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=sn(n)?8:16),cl>0&&!r&&ys&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&ys.push(a),a}const gt=m4;function m4(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===kS)&&(e=Un),vr(e)){const l=Li(e,t,!0);return n&&z1(l,n),cl>0&&!i&&ys&&(l.shapeFlag&6?ys[ys.indexOf(e)]=l:ys.push(l)),l.patchFlag=-2,l}if(_4(e)&&(e=e.__vccOpts),t){t=g4(t);let{class:l,style:a}=t;l&&!sn(l)&&(t.class=Le(l)),Vt(a)&&(lh(a)&&!at(a)&&(a=tn({},a)),t.style=Bt(a))}const r=sn(e)?1:tf(e)?128:dS(e)?64:Vt(e)?4:bt(e)?2:0;return m(e,t,n,s,o,r,i,!0)}function g4(e){return e?lh(e)||AS(e)?tn({},e):e:null}function Li(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?en(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&US(c),ref:t&&t.ref?n&&i?at(i)?i.concat(Td(t)):[i,Td(t)]:Td(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Pe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Li(e.ssContent),ssFallback:e.ssFallback&&Li(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&gr(u,a.clone(u)),u}function dt(e=" ",t=0){return gt(fr,null,e,t)}function yr(e,t){const n=gt(la,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(x(),je(Un,null,e)):gt(Un,null,e)}function Rs(e){return e==null||typeof e=="boolean"?gt(Un):at(e)?gt(Pe,null,e.slice()):vr(e)?_i(e):gt(fr,null,String(e))}function _i(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Li(e)}function z1(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(at(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),z1(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!AS(t)?t._ctx=cs:o===3&&cs&&(cs.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else bt(t)?(t={default:t,_ctx:cs},n=32):(t=String(t),s&64?(n=16,t=[dt(t)]):n=8);e.children=t,e.shapeFlag|=n}function en(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Le([t.class,s.class]));else if(o==="style")t.style=Bt([t.style,s.style]);else if(ru(o)){const i=t[o],r=s[o];r&&i!==r&&!(at(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Yf(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function Ps(e,t,n,s=null){Io(e,t,7,[n,s])}const v4=wS();let y4=0;function jS(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||v4,i={uid:y4++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new B2(!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:$S(s,o),emitsOptions:CS(s,o),emit:null,emitted:null,propsDefaults:Nt,inheritAttrs:s.inheritAttrs,ctx:Nt,data:Nt,props:Nt,attrs:Nt,slots:Nt,refs:Nt,setupState:Nt,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=GE.bind(null,i),e.ce&&e.ce(i),i}let ls=null;const us=()=>ls||cs;let sf,aa;{const e=th(),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)}};sf=t("__VUE_INSTANCE_SETTERS__",n=>ls=n),aa=t("__VUE_SSR_SETTERS__",n=>ul=n)}const Ta=e=>{const t=ls;return sf(e),e.scope.on(),()=>{e.scope.off(),sf(t)}},Wc=()=>{ls&&ls.scope.off(),sf(null)};function qS(e){return e.vnode.shapeFlag&4}let ul=!1;function zS(e,t=!1,n=!1){t&&aa(t);const{props:s,children:o}=e.vnode,i=qS(e);e4(e,s,i,t),o4(e,o,n||t);const r=i?k4(e,t):void 0;return t&&aa(!1),r}function k4(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,lg);const{setup:s}=n;if(s){$i();const o=e.setupContext=s.length>1?KS(e):null,i=Ta(e),r=lu(s,e,0,[e.props,o]),l=A1(r);if(Ii(),i(),(l||e.sp)&&!Mi(e)&&R1(e),l){if(r.then(Wc,Wc),t)return r.then(a=>{fg(e,a,t)}).catch(a=>{xa(a,e,0)});e.asyncDep=r}else fg(e,r,t)}else VS(e,t)}function fg(e,t,n){bt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Vt(t)&&(e.setupState=nS(t)),VS(e,n)}let of,hg;function Bhe(e){of=e,hg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,HE))}}const Fhe=()=>!of;function VS(e,t,n){const s=e.type;if(!e.render){if(!t&&of&&!s.render){const o=s.template||W1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=tn(tn({isCustomElement:i,delimiters:l},r),a);s.render=of(o,c)}}e.render=s.render||Eo,hg&&hg(e)}{const o=Ta(e);$i();try{WE(e)}finally{Ii(),o()}}}const b4={get(e,t){return gs(e,"get",""),e[t]}};function KS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,b4),slots:e.slots,emit:e.emit,expose:t}}function du(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(nS(ar(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in bc)return bc[n](e)},has(t,n){return n in t||n in bc}})):e.proxy}function pg(e,t=!0){return bt(e)?e.displayName||e.name:e.name||t&&e.__name}function _4(e){return bt(e)&&"__vccOpts"in e}const F=(e,t)=>sE(e,t,ul);function Xt(e,t,n){try{nf(-1);const s=arguments.length;return s===2?Vt(t)&&!at(t)?vr(t)?gt(e,null,[t]):gt(e,t):gt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&vr(n)&&(n=[n]),gt(e,t,n))}finally{nf(1)}}function Hhe(){}function Whe(e,t,n,s){const o=n[s];if(o&&w4(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function w4(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(rs(n[s],t[s]))return!1;return cl>0&&ys&&ys.push(e),!0}const S4="3.5.35",Uhe=Eo,jhe=aE,qhe=zl,zhe=aS,C4={createComponentInstance:jS,setupComponent:zS,renderComponentRoot:xd,setCurrentRenderingInstance:Dc,isVNode:vr,normalizeVNode:Rs,getComponentPublicInstance:du,ensureValidVNode:H1,pushWarningContext:rE,popWarningContext:lE},Vhe=C4,Khe=null,Ghe=null,Yhe=null;/**
17
+ * @vue/runtime-dom v3.5.35
18
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
+ * @license MIT
20
+ **/let mg;const Ky=typeof window<"u"&&window.trustedTypes;if(Ky)try{mg=Ky.createPolicy("vue",{createHTML:e=>e})}catch{}const GS=mg?e=>mg.createHTML(e):e=>e,x4="http://www.w3.org/2000/svg",T4="http://www.w3.org/1998/Math/MathML",ki=typeof document<"u"?document:null,Gy=ki&&ki.createElement("template"),M4={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"?ki.createElementNS(x4,e):t==="mathml"?ki.createElementNS(T4,e):n?ki.createElement(e,{is:n}):ki.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>ki.createTextNode(e),createComment:e=>ki.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ki.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{Gy.innerHTML=GS(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Gy.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]}},Yi="transition",ec="animation",ya=Symbol("_vtc"),YS={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},XS=tn({},hS,YS),A4=e=>(e.displayName="Transition",e.props=XS,e),Oi=A4((e,{slots:t})=>Xt(bE,ZS(e),t)),zr=(e,t=[])=>{at(e)?e.forEach(n=>n(...t)):e&&e(...t)},Yy=e=>e?at(e)?e.some(t=>t.length>1):e.length>1:!1;function ZS(e){const t={};for(const M in e)M in YS||(t[M]=e[M]);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=E4(o),g=h&&h[0],S=h&&h[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:v,onLeaveCancelled:w,onBeforeAppear:N=_,onAppear:E=y,onAppearCancelled:k=b}=t,A=(M,L,R,B)=>{M._enterCancelled=B,nr(M,L?u:l),nr(M,L?c:r),R&&R()},I=(M,L)=>{M._isLeaving=!1,nr(M,d),nr(M,p),nr(M,f),L&&L()},P=M=>(L,R)=>{const B=M?E:y,U=()=>A(L,M,R);zr(B,[L,U]),Xy(()=>{nr(L,M?a:i),Jo(L,M?u:l),Yy(B)||Zy(L,s,g,U)})};return tn(t,{onBeforeEnter(M){zr(_,[M]),Jo(M,i),Jo(M,r)},onBeforeAppear(M){zr(N,[M]),Jo(M,a),Jo(M,c)},onEnter:P(!1),onAppear:P(!0),onLeave(M,L){M._isLeaving=!0;const R=()=>I(M,L);Jo(M,d),M._enterCancelled?(Jo(M,f),gg(M)):(gg(M),Jo(M,f)),Xy(()=>{M._isLeaving&&(nr(M,d),Jo(M,p),Yy(v)||Zy(M,s,S,R))}),zr(v,[M,R])},onEnterCancelled(M){A(M,!1,void 0,!0),zr(b,[M])},onAppearCancelled(M){A(M,!0,void 0,!0),zr(k,[M])},onLeaveCancelled(M){I(M),zr(w,[M])}})}function E4(e){if(e==null)return null;if(Vt(e))return[Zp(e.enter),Zp(e.leave)];{const t=Zp(e);return[t,t]}}function Zp(e){return qd(e)}function Jo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ya]||(e[ya]=new Set)).add(t)}function nr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[ya];n&&(n.delete(t),n.size||(e[ya]=void 0))}function Xy(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let $4=0;function Zy(e,t,n,s){const o=e._endId=++$4,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=JS(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 JS(e,t){const n=window.getComputedStyle(e),s=h=>(n[h]||"").split(", "),o=s(`${Yi}Delay`),i=s(`${Yi}Duration`),r=Jy(o,i),l=s(`${ec}Delay`),a=s(`${ec}Duration`),c=Jy(l,a);let u=null,d=0,f=0;t===Yi?r>0&&(u=Yi,d=r,f=i.length):t===ec?c>0&&(u=ec,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Yi:ec:null,f=u?u===Yi?i.length:a.length:0);const p=u===Yi&&/\b(?:transform|all)(?:,|$)/.test(s(`${Yi}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Jy(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Qy(n)+Qy(e[s])))}function Qy(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function gg(e){return(e?e.ownerDocument:document).body.offsetHeight}function I4(e,t,n){const s=e[ya];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const rf=Symbol("_vod"),QS=Symbol("_vsh"),Bo={name:"show",beforeMount(e,{value:t},{transition:n}){e[rf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):tc(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),tc(e,!0),s.enter(e)):s.leave(e,()=>{tc(e,!1)}):tc(e,t))},beforeUnmount(e,{value:t}){tc(e,t)}};function tc(e,t){e.style.display=t?e[rf]:"none",e[QS]=!t}function N4(){Bo.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const eC=Symbol("");function Xhe(e){const t=us();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>lf(i,o))},s=()=>{const o=e(t.proxy);t.ce?lf(t.ce,o):vg(t.subTree,o),n(o)};yS(()=>{Xd(s)}),Zt(()=>{Ke(s,Eo,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Ft(()=>o.disconnect())})}function vg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{vg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)lf(e.el,t);else if(e.type===Pe)e.children.forEach(n=>vg(n,t));else if(e.type===la){let{el:n,anchor:s}=e;for(;n&&(lf(n,t),n!==s);)n=n.nextSibling}}function lf(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=EA(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[eC]=s}}const L4=/(?:^|;)\s*display\s*:/;function O4(e,t,n){const s=e.style,o=sn(n);let i=!1;if(n&&!o){if(t)if(sn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&dc(s,l,"")}else for(const r in t)n[r]==null&&dc(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?R4(e,r,!sn(t)&&t?t[r]:void 0,l)||dc(s,r,l):dc(s,r,"")}}else if(o){if(t!==n){const r=s[eC];r&&(n+=";"+r),s.cssText=n,i=L4.test(n)}}else t&&e.removeAttribute("style");rf in e&&(e[rf]=i?s.display:"",e[QS]&&(s.display="none"))}const ek=/\s*!important$/;function dc(e,t,n){if(at(n))n.forEach(s=>dc(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=P4(e,t);ek.test(n)?e.setProperty(Ds(s),n.replace(ek,""),"important"):e[s]=n}}const tk=["Webkit","Moz","ms"],Jp={};function P4(e,t){const n=Jp[t];if(n)return n;let s=Xn(t);if(s!=="filter"&&s in e)return Jp[t]=s;s=Qf(s);for(let o=0;o<tk.length;o++){const i=tk[o]+s;if(i in e)return Jp[t]=i}return t}function R4(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&sn(s)&&n===s}const nk="http://www.w3.org/1999/xlink";function sk(e,t,n,s,o,i=MA(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(nk,t.slice(6,t.length)):e.setAttributeNS(nk,t,n):n==null||i&&!P2(n)?e.removeAttribute(t):e.setAttribute(t,i?"":co(n)?String(n):n)}function ok(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?GS(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=P2(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 Ci(e,t,n,s){e.addEventListener(t,n,s)}function D4(e,t,n,s){e.removeEventListener(t,n,s)}const ik=Symbol("_vei");function B4(e,t,n,s,o=null){const i=e[ik]||(e[ik]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=F4(t);if(s){const c=i[t]=U4(s,o);Ci(e,l,c,a)}else r&&(D4(e,l,r,a),i[t]=void 0)}}const rk=/(?:Once|Passive|Capture)$/;function F4(e){let t;if(rk.test(e)){t={};let s;for(;s=e.match(rk);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ds(e.slice(2)),t]}let Qp=0;const H4=Promise.resolve(),W4=()=>Qp||(H4.then(()=>Qp=0),Qp=Date.now());function U4(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(at(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&&Io(c,t,5,l)}}else Io(o,t,5,[s])};return n.value=e,n.attached=W4(),n}const lk=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,j4=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?I4(e,s,r):t==="style"?O4(e,n,s):ru(t)?Yf(t)||B4(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):q4(e,t,s,r))?(ok(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&sk(e,t,s,r,i,t!=="value")):e._isVueCE&&(z4(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!sn(s)))?ok(e,Xn(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),sk(e,t,s,r))};function q4(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&lk(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 lk(t)&&sn(n)?!1:t in e}function z4(e,t){const n=e._def.props;if(!n)return!1;const s=Xn(t);return Array.isArray(n)?n.some(o=>Xn(o)===s):Object.keys(n).some(o=>Xn(o)===s)}const ak={};function V4(e,t,n){let s=Ze(e,t);Xf(s)&&(s=tn({},s,t));class o extends V1{constructor(r){super(s,r,n)}}return o.def=s,o}const Zhe=((e,t)=>V4(e,t,a$)),K4=typeof HTMLElement<"u"?HTMLElement:class{};class V1 extends K4{constructor(t,n={},s=df){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!==df?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(tn({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof V1){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,mt(()=>{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&&!at(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=qd(this._props[a])),(l||(l=Object.create(null)))[Xn(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)zt(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=at(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(Xn))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):ak;const o=Xn(t);n&&this._numberProps&&this._numberProps[o]&&(s=qd(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===ak?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Ds(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ds(t),n+""):n||this.removeAttribute(Ds(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),l$(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=gt(this._def,tn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Xf(r[0])?tn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),Ds(i)!==i&&o(Ds(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function G4(e){const t=us(),n=t&&t.ce;return n||null}function Jhe(){const e=G4();return e&&e.shadowRoot}function Qhe(e="$style"){{const t=us();if(!t)return Nt;const n=t.type.__cssModules;if(!n)return Nt;const s=n[e];return s||Nt}}const tC=new WeakMap,nC=new WeakMap,af=Symbol("_moveCb"),ck=Symbol("_enterCb"),Y4=e=>(delete e.props.mode,e),X4=Y4({name:"TransitionGroup",props:tn({},XS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=us(),s=fS();let o,i;return D1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!e$(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(Z4),o.forEach(J4);const l=o.filter(Q4);gg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Jo(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[af]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[af]=null,nr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Dt(e),l=ZS(r);let a=r.tag||Pe;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),gr(u,Bc(u,l,s,n)),tC.set(u,sC(u.el)))}i=t.default?P1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&gr(u,Bc(u,l,s,n))}return gt(a,null,i)}}}),epe=X4;function Z4(e){const t=e.el;t[af]&&t[af](),t[ck]&&t[ck]()}function J4(e){nC.set(e,sC(e.el))}function Q4(e){const t=tC.get(e),n=nC.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 sC(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function e$(e,t,n){const s=e.cloneNode(),o=e[ya];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}=JS(s);return i.removeChild(s),r}const kr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return at(t)?n=>na(t,n):t};function t$(e){e.target.composing=!0}function uk(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const $o=Symbol("_assign");function dk(e,t,n){return t&&(e=e.trim()),n&&(e=eh(e)),e}const wn={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[$o]=kr(o);const i=s||o.props&&o.props.type==="number";Ci(e,t?"change":"input",r=>{r.target.composing||e[$o](dk(e.value,n,i))}),(n||i)&&Ci(e,"change",()=>{e.value=dk(e.value,n,i)}),t||(Ci(e,"compositionstart",t$),Ci(e,"compositionend",uk),Ci(e,"change",uk))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[$o]=kr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?eh(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)}},cf={deep:!0,created(e,t,n){e[$o]=kr(n),Ci(e,"change",()=>{const s=e._modelValue,o=ka(e),i=e.checked,r=e[$o];if(at(s)){const l=nh(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(fl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(iC(e,i))})},mounted:fk,beforeUpdate(e,t,n){e[$o]=kr(n),fk(e,t,n)}};function fk(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(at(t))o=nh(t,s.props.value)>-1;else if(fl(t))o=t.has(s.props.value);else{if(t===n)return;o=Ei(t,iC(e,!0))}e.checked!==o&&(e.checked=o)}const oC={created(e,{value:t},n){e.checked=Ei(t,n.props.value),e[$o]=kr(n),Ci(e,"change",()=>{e[$o](ka(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[$o]=kr(s),t!==n&&(e.checked=Ei(t,s.props.value))}},uf={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=fl(t);Ci(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?eh(ka(r)):ka(r));e[$o](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,mt(()=>{e._assigning=!1})}),e[$o]=kr(s)},mounted(e,{value:t}){hk(e,t)},beforeUpdate(e,t,n){e[$o]=kr(n)},updated(e,{value:t}){e._assigning||hk(e,t)}};function hk(e,t){const n=e.multiple,s=at(t);if(!(n&&!s&&!fl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=ka(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=nh(t,l)>-1}else r.selected=t.has(l);else if(Ei(ka(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ka(e){return"_value"in e?e._value:e.value}function iC(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const n$={created(e,t,n){Qu(e,t,n,null,"created")},mounted(e,t,n){Qu(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Qu(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Qu(e,t,n,s,"updated")}};function rC(e,t){switch(e){case"SELECT":return uf;case"TEXTAREA":return wn;default:switch(t){case"checkbox":return cf;case"radio":return oC;default:return wn}}}function Qu(e,t,n,s,o){const r=rC(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function s$(){wn.getSSRProps=({value:e})=>({value:e}),oC.getSSRProps=({value:e},t)=>{if(t.props&&Ei(t.props.value,e))return{checked:!0}},cf.getSSRProps=({value:e},t)=>{if(at(e)){if(t.props&&nh(e,t.props.value)>-1)return{checked:!0}}else if(fl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},n$.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=rC(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const o$=["ctrl","shift","alt","meta"],i$={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)=>o$.some(n=>e[`${n}Key`]&&!t.includes(n))},Je=(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=i$[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},r$={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Mo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=Ds(o.key);if(t.some(r=>r===i||r$[r]===i))return e(o)}))},lC=tn({patchProp:j4},M4);let wc,pk=!1;function aC(){return wc||(wc=r4(lC))}function cC(){return wc=pk?wc:l4(lC),pk=!0,wc}const l$=((...e)=>{aC().render(...e)}),tpe=((...e)=>{cC().hydrate(...e)}),df=((...e)=>{const t=aC().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=dC(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,uC(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),a$=((...e)=>{const t=cC().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=dC(s);if(o)return n(o,!0,uC(o))},t});function uC(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function dC(e){return sn(e)?document.querySelector(e):e}let mk=!1;const npe=()=>{mk||(mk=!0,s$(),N4())};/*!
21
+ * shared v11.4.5
22
+ * (c) 2026 kazuya kawaguchi
23
+ * Released under the MIT License.
24
+ */function c$(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const ff=typeof window<"u",Cr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),u$=(e,t,n)=>d$({l:e,k:t,s:n}),d$=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),jn=e=>typeof e=="number"&&isFinite(e),fC=e=>G1(e)==="[object Date]",ba=e=>G1(e)==="[object RegExp]",fh=e=>Pt(e)&&Object.keys(e).length===0,qn=Object.assign,f$=Object.create,nn=(e=null)=>f$(e);let gk;const tl=()=>gk||(gk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:nn());function vk(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 h$(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 p$=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,m$=/^(?:href|src|action|formaction)$/i;function K1(e){return p$.test(e)}function g$(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+=K1(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function yk(e,t){if(m$.test(e)&&K1(t))return"about:blank";const n=e.toLowerCase()==="style"?g$(t):t;return h$(n)}function v$(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${yk(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${yk(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)=>K1(o)?`${s}about:blank`:n),e}const y$=Object.prototype.hasOwnProperty;function Ao(e,t){return y$.call(e,t)}const En=Array.isArray,vn=e=>typeof e=="function",it=e=>typeof e=="string",Wt=e=>typeof e=="boolean",Ut=e=>e!==null&&typeof e=="object",k$=e=>Ut(e)&&vn(e.then)&&vn(e.catch),hC=Object.prototype.toString,G1=e=>hC.call(e),Pt=e=>G1(e)==="[object Object]",b$=e=>e==null?"":En(e)||Pt(e)&&e.toString===hC?JSON.stringify(e,null,2):String(e);function Y1(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const ed=e=>!Ut(e)||En(e);function Md(e,t){if(ed(e)||ed(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__"&&(Ut(s[i])&&!Ut(o[i])&&(o[i]=Array.isArray(s[i])?[]:nn()),ed(o[i])||ed(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 _$(e,t,n){return{line:e,column:t,offset:n}}function yg(e,t,n){return{start:e,end:t}}const Yt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},w$=17;function hh(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 S$(e){throw e}const Xo=" ",C$="\r",hs=`
29
+ `,x$="\u2028",T$="\u2029";function M$(e){const t=e;let n=0,s=1,o=1,i=0;const r=E=>t[E]===C$&&t[E+1]===hs,l=E=>t[E]===hs,a=E=>t[E]===T$,c=E=>t[E]===x$,u=E=>r(E)||l(E)||a(E)||c(E),d=()=>n,f=()=>s,p=()=>o,h=()=>i,g=E=>r(E)||a(E)||c(E)?hs:t[E],S=()=>g(n),_=()=>g(n+i);function y(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function b(){return r(n+i)&&i++,i++,t[n+i]}function v(){n=0,s=1,o=1,i=0}function w(E=0){i=E}function N(){const E=n+i;for(;E!==n;)y();i=0}return{index:d,line:f,column:p,peekOffset:h,charAt:g,currentChar:S,currentPeek:_,next:y,peek:b,reset:v,resetPeek:w,skipToPeek:N}}const yi=void 0,A$=".",kk="'",E$="tokenizer";function $$(e,t={}){const n=t.location!==!1,s=M$(e),o=()=>s.index(),i=()=>_$(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(H,X,ce,...ke){const Me=c();if(X.column+=ce,X.offset+=ce,u){const Ne=n?yg(Me.startLoc,X):null,re=hh(H,Ne,{domain:E$,args:ke});u(re)}}function f(H,X,ce){H.endLoc=i(),H.currentType=X;const ke={type:X};return n&&(ke.loc=yg(H.startLoc,H.endLoc)),ce!=null&&(ke.value=ce),ke}const p=H=>f(H,13);function h(H,X){return H.currentChar()===X?(H.next(),X):(d(Yt.EXPECTED_TOKEN,i(),0,X),"")}function g(H){let X="";for(;H.currentPeek()===Xo||H.currentPeek()===hs;)X+=H.currentPeek(),H.peek();return X}function S(H){const X=g(H);return H.skipToPeek(),X}function _(H){if(H===yi)return!1;const X=H.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X===95}function y(H){if(H===yi)return!1;const X=H.charCodeAt(0);return X>=48&&X<=57}function b(H,X){const{currentType:ce}=X;if(ce!==2)return!1;g(H);const ke=_(H.currentPeek());return H.resetPeek(),ke}function v(H,X){const{currentType:ce}=X;if(ce!==2)return!1;g(H);const ke=H.currentPeek()==="-"?H.peek():H.currentPeek(),Me=y(ke);return H.resetPeek(),Me}function w(H,X){const{currentType:ce}=X;if(ce!==2)return!1;g(H);const ke=H.currentPeek()===kk;return H.resetPeek(),ke}function N(H,X){const{currentType:ce}=X;if(ce!==7)return!1;g(H);const ke=H.currentPeek()===".";return H.resetPeek(),ke}function E(H,X){const{currentType:ce}=X;if(ce!==8)return!1;g(H);const ke=_(H.currentPeek());return H.resetPeek(),ke}function k(H,X){const{currentType:ce}=X;if(!(ce===7||ce===11))return!1;g(H);const ke=H.currentPeek()===":";return H.resetPeek(),ke}function A(H,X){const{currentType:ce}=X;if(ce!==9)return!1;const ke=()=>{const Ne=H.currentPeek();return Ne==="{"?_(H.peek()):Ne==="@"||Ne==="|"||Ne===":"||Ne==="."||Ne===Xo||!Ne?!1:Ne===hs?(H.peek(),ke()):P(H,!1)},Me=ke();return H.resetPeek(),Me}function I(H){g(H);const X=H.currentPeek()==="|";return H.resetPeek(),X}function P(H,X=!0){const ce=(Me=!1,Ne="")=>{const re=H.currentPeek();return re==="{"||re==="@"||!re?Me:re==="|"?!(Ne===Xo||Ne===hs):re===Xo?(H.peek(),ce(!0,Xo)):re===hs?(H.peek(),ce(!0,hs)):!0},ke=ce();return X&&H.resetPeek(),ke}function M(H,X){const ce=H.currentChar();return ce===yi?yi:X(ce)?(H.next(),ce):null}function L(H){const X=H.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X>=48&&X<=57||X===95||X===36}function R(H){return M(H,L)}function B(H){const X=H.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X>=48&&X<=57||X===95||X===36||X===45}function U(H){return M(H,B)}function K(H){const X=H.charCodeAt(0);return X>=48&&X<=57}function V(H){return M(H,K)}function se(H){const X=H.charCodeAt(0);return X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102}function Y(H){return M(H,se)}function G(H){let X="",ce="";for(;X=V(H);)ce+=X;return ce}function ee(H){let X="";for(;;){const ce=H.currentChar();if(ce==="\\"){const ke=H.peek();ke==="{"||ke==="}"||ke==="@"||ke==="|"||ke==="\\"?(X+=ce+ke,H.next(),H.next()):(H.resetPeek(),X+=ce,H.next())}else{if(ce==="{"||ce==="}"||ce==="@"||ce==="|"||!ce)break;if(ce===Xo||ce===hs)if(P(H))X+=ce,H.next();else{if(I(H))break;X+=ce,H.next()}else X+=ce,H.next()}}return X}function Se(H){S(H);let X="",ce="";for(;X=U(H);)ce+=X;const ke=H.currentChar();if(ke&&ke!=="}"&&ke!==yi&&ke!==Xo&&ke!==hs&&ke!==" "){const Me=J(H);return d(Yt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ce+Me),ce+Me}return H.currentChar()===yi&&d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),ce}function ae(H){S(H);let X="";return H.currentChar()==="-"?(H.next(),X+=`-${G(H)}`):X+=G(H),H.currentChar()===yi&&d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),X}function Ie(H){return H!==kk&&H!==hs}function de(H){S(H),h(H,"'");let X="",ce="";for(;X=M(H,Ie);)X==="\\"?ce+=we(H):ce+=X;const ke=H.currentChar();return ke===hs||ke===yi?(d(Yt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ke===hs&&(H.next(),h(H,"'")),ce):(h(H,"'"),ce)}function we(H){const X=H.currentChar();switch(X){case"\\":case"'":return H.next(),`\\${X}`;case"u":return me(H,X,4);case"U":return me(H,X,6);default:return d(Yt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,X),""}}function me(H,X,ce){h(H,X);let ke="";for(let Me=0;Me<ce;Me++){const Ne=Y(H);if(!Ne){d(Yt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${X}${ke}${H.currentChar()}`);break}ke+=Ne}return`\\${X}${ke}`}function $e(H){return H!=="{"&&H!=="}"&&H!==Xo&&H!==hs}function J(H){S(H);let X="",ce="";for(;X=M(H,$e);)ce+=X;return ce}function ye(H){let X="",ce="";for(;X=R(H);)ce+=X;return ce}function _e(H){const X=ce=>{const ke=H.currentChar();return ke==="{"||ke==="@"||ke==="|"||ke==="("||ke===")"||!ke||ke===Xo?ce:(ce+=ke,H.next(),X(ce))};return X("")}function W(H){S(H);const X=h(H,"|");return S(H),X}function Z(H,X){let ce=null;switch(H.currentChar()){case"{":return X.braceNest>=1&&d(Yt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),H.next(),ce=f(X,2,"{"),S(H),X.braceNest++,ce;case"}":return X.braceNest>0&&X.currentType===2&&d(Yt.EMPTY_PLACEHOLDER,i(),0),H.next(),ce=f(X,3,"}"),X.braceNest--,X.braceNest>0&&S(H),X.inLinked&&X.braceNest===0&&(X.inLinked=!1),ce;case"@":return X.braceNest>0&&d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),ce=fe(H,X)||p(X),X.braceNest=0,ce;default:{let Me=!0,Ne=!0,re=!0;if(I(H))return X.braceNest>0&&d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),ce=f(X,1,W(H)),X.braceNest=0,X.inLinked=!1,ce;if(X.braceNest>0&&(X.currentType===4||X.currentType===5||X.currentType===6))return d(Yt.UNTERMINATED_CLOSING_BRACE,i(),0),X.braceNest=0,oe(H,X);if(Me=b(H,X))return ce=f(X,4,Se(H)),S(H),ce;if(Ne=v(H,X))return ce=f(X,5,ae(H)),S(H),ce;if(re=w(H,X))return ce=f(X,6,de(H)),S(H),ce;if(!Me&&!Ne&&!re)return ce=f(X,12,J(H)),d(Yt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ce.value),S(H),ce;break}}return ce}function fe(H,X){const{currentType:ce}=X;let ke=null;const Me=H.currentChar();switch((ce===7||ce===8||ce===11||ce===9)&&(Me===hs||Me===Xo)&&d(Yt.INVALID_LINKED_FORMAT,i(),0),Me){case"@":return H.next(),ke=f(X,7,"@"),X.inLinked=!0,ke;case".":return S(H),H.next(),f(X,8,".");case":":return S(H),H.next(),f(X,9,":");default:return I(H)?(ke=f(X,1,W(H)),X.braceNest=0,X.inLinked=!1,ke):N(H,X)||k(H,X)?(S(H),fe(H,X)):E(H,X)?(S(H),f(X,11,ye(H))):A(H,X)?(S(H),Me==="{"?Z(H,X)||ke:f(X,10,_e(H))):(ce===7&&d(Yt.INVALID_LINKED_FORMAT,i(),0),X.braceNest=0,X.inLinked=!1,oe(H,X))}}function oe(H,X){let ce={type:13};if(X.braceNest>0)return Z(H,X)||p(X);if(X.inLinked)return fe(H,X)||p(X);switch(H.currentChar()){case"{":return Z(H,X)||p(X);case"}":return d(Yt.UNBALANCED_CLOSING_BRACE,i(),0),H.next(),f(X,3,"}");case"@":return fe(H,X)||p(X);default:{if(I(H))return ce=f(X,1,W(H)),X.braceNest=0,X.inLinked=!1,ce;if(P(H))return f(X,0,ee(H));break}}return ce}function he(){const{currentType:H,offset:X,startLoc:ce,endLoc:ke}=a;return a.lastType=H,a.lastOffset=X,a.lastStartLoc=ce,a.lastEndLoc=ke,a.offset=o(),a.startLoc=i(),s.currentChar()===yi?f(a,13):oe(s,a)}return{nextToken:he,currentOffset:o,currentPosition:i,context:c}}const I$="parser",N$=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,L$=/\\([\\@{}|])/g;function O$(e,t){return t}function P$(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 R$(e={}){const t=e.location!==!1,{onError:n}=e;function s(_,y,b,v,...w){const N=_.currentPosition();if(N.offset+=v,N.column+=v,n){const E=t?yg(b,N):null,k=hh(y,E,{domain:I$,args:w});n(k)}}function o(_,y,b){const v={type:_};return t&&(v.start=y,v.end=y,v.loc={start:b,end:b}),v}function i(_,y,b,v){t&&(_.end=y,_.loc&&(_.loc.end=b))}function r(_,y){const b=_.context(),v=o(3,b.offset,b.startLoc);return v.value=y.replace(L$,O$),i(v,_.currentOffset(),_.currentPosition()),v}function l(_,y){const b=_.context(),{lastOffset:v,lastStartLoc:w}=b,N=o(5,v,w);return N.index=parseInt(y,10),_.nextToken(),i(N,_.currentOffset(),_.currentPosition()),N}function a(_,y){const b=_.context(),{lastOffset:v,lastStartLoc:w}=b,N=o(4,v,w);return N.key=y,_.nextToken(),i(N,_.currentOffset(),_.currentPosition()),N}function c(_,y){const b=_.context(),{lastOffset:v,lastStartLoc:w}=b,N=o(9,v,w);return N.value=y.replace(N$,P$),_.nextToken(),i(N,_.currentOffset(),_.currentPosition()),N}function u(_){const y=_.nextToken(),b=_.context(),{lastOffset:v,lastStartLoc:w}=b,N=o(8,v,w);return y.type!==11?(s(_,Yt.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),N.value="",i(N,v,w),{nextConsumeToken:y,node:N}):(y.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Zo(y)),N.value=y.value||"",i(N,_.currentOffset(),_.currentPosition()),{node:N})}function d(_,y){const b=_.context(),v=o(7,b.offset,b.startLoc);return v.value=y,i(v,_.currentOffset(),_.currentPosition()),v}function f(_){const y=_.context(),b=o(6,y.offset,y.startLoc);let v=_.nextToken();if(v.type===8){const w=u(_);b.modifier=w.node,v=w.nextConsumeToken||_.nextToken()}switch(v.type!==9&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(v)),v=_.nextToken(),v.type===2&&(v=_.nextToken()),v.type){case 10:v.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(v)),b.key=d(_,v.value||"");break;case 4:v.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(v)),b.key=a(_,v.value||"");break;case 5:v.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(v)),b.key=l(_,v.value||"");break;case 6:v.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(v)),b.key=c(_,v.value||"");break;default:{s(_,Yt.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const w=_.context(),N=o(7,w.offset,w.startLoc);return N.value="",i(N,w.offset,w.startLoc),b.key=N,i(b,w.offset,w.startLoc),{nextConsumeToken:v,node:b}}}return i(b,_.currentOffset(),_.currentPosition()),{node:b}}function p(_){const y=_.context(),b=y.currentType===1?_.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,w=o(2,b,v);w.items=[];let N=null;do{const A=N||_.nextToken();switch(N=null,A.type){case 0:A.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(A)),w.items.push(r(_,A.value||""));break;case 5:A.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(A)),w.items.push(l(_,A.value||""));break;case 4:A.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(A)),w.items.push(a(_,A.value||""));break;case 6:A.value==null&&s(_,Yt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Zo(A)),w.items.push(c(_,A.value||""));break;case 7:{const I=f(_);w.items.push(I.node),N=I.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const E=y.currentType===1?y.lastOffset:_.currentOffset(),k=y.currentType===1?y.lastEndLoc:_.currentPosition();return i(w,E,k),w}function h(_,y,b,v){const w=_.context();let N=v.items.length===0;const E=o(1,y,b);E.cases=[],E.cases.push(v);do{const k=p(_);N||(N=k.items.length===0),E.cases.push(k)}while(w.currentType!==13);return N&&s(_,Yt.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),i(E,_.currentOffset(),_.currentPosition()),E}function g(_){const y=_.context(),{offset:b,startLoc:v}=y,w=p(_);return y.currentType===13?w:h(_,b,v,w)}function S(_){const y=$$(_,qn({},e)),b=y.context(),v=o(0,b.offset,b.startLoc);return t&&v.loc&&(v.loc.source=_),v.body=g(y),e.onCacheKey&&(v.cacheKey=e.onCacheKey(_)),b.currentType!==13&&s(y,Yt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,_[b.offset]||""),i(v,y.currentOffset(),y.currentPosition()),v}return{parse:S}}function Zo(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 D$(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function bk(e,t){for(let n=0;n<e.length;n++)X1(e[n],t)}function X1(e,t){switch(e.type){case 1:bk(e.cases,t),t.helper("plural");break;case 2:bk(e.items,t);break;case 6:{X1(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 B$(e,t={}){const n=D$(e);n.helper("normalize"),e.body&&X1(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function F$(e){const t=e.body;return t.type===2?_k(t):t.cases.forEach(n=>_k(n)),e}function _k(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=Y1(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 Vl(e){switch(e.t=e.type,e.type){case 0:{const t=e;Vl(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++)Vl(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++)Vl(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;Vl(t.key),t.k=t.key,delete t.key,t.modifier&&(Vl(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 H$(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(g,S){r.code+=g}function c(g,S=!0){const _=S?s:"";a(o?_+" ".repeat(g):_)}function u(g=!0){const S=++r.indentLevel;g&&c(S)}function d(g=!0){const S=--r.indentLevel;g&&c(S)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function W$(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),_a(e,t.key),t.modifier?(e.push(", "),_a(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function U$(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&&(_a(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function j$(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&&(_a(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function q$(e,t){t.body?_a(e,t.body):e.push("null")}function _a(e,t){const{helper:n}=e;switch(t.type){case 0:q$(e,t);break;case 1:j$(e,t);break;case 2:U$(e,t);break;case 6:W$(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 z$=(e,t={})=>{const n=it(t.mode)?t.mode:"normal",s=it(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=H$(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Y1(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),_a(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 V$(e,t={}){const n=qn({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=R$(n).parse(e);return s?(i&&F$(l),o&&Vl(l),{ast:l,code:""}):(B$(l,n),z$(l,n))}/*!
31
+ * core-base v11.4.5
32
+ * (c) 2026 kazuya kawaguchi
33
+ * Released under the MIT License.
34
+ */function K$(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(tl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(tl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function oi(e){return Ut(e)&&Z1(e)===0&&(Ao(e,"b")||Ao(e,"body"))}const pC=["b","body"];function G$(e){return xr(e,pC)}const mC=["c","cases"];function Y$(e){return xr(e,mC,[])}const gC=["s","static"];function X$(e){return xr(e,gC)}const vC=["i","items"];function Z$(e){return xr(e,vC,[])}const yC=["t","type"];function Z1(e){return xr(e,yC)}const kC=["v","value"];function td(e,t){const n=xr(e,kC);if(n!=null)return n;throw Uc(t)}const bC=["m","modifier"];function J$(e){return xr(e,bC)}const _C=["k","key"];function Q$(e){const t=xr(e,_C);if(t)return t;throw Uc(6)}function xr(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(Ao(e,o)&&e[o]!=null)return e[o]}return n}const wC=[...pC,...mC,...gC,...vC,..._C,...bC,...kC,...yC];function Uc(e){return new Error(`unhandled node type: ${e}`)}function em(e){return n=>eI(n,e)}function eI(e,t){const n=G$(t);if(n==null)throw Uc(0);if(Z1(n)===1){const i=Y$(n);return e.plural(i.reduce((r,l)=>[...r,wk(e,l)],[]))}else return wk(e,n)}function wk(e,t){const n=X$(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=Z$(t).reduce((o,i)=>[...o,kg(e,i)],[]);return e.normalize(s)}}function kg(e,t){const n=Z1(t);switch(n){case 3:return td(t,n);case 9:return td(t,n);case 4:{const s=t;if(Ao(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(Ao(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Uc(n)}case 5:{const s=t;if(Ao(s,"i")&&jn(s.i))return e.interpolate(e.list(s.i));if(Ao(s,"index")&&jn(s.index))return e.interpolate(e.list(s.index));throw Uc(n)}case 6:{const s=t,o=J$(s),i=Q$(s);return e.linked(kg(e,i),o?kg(e,o):void 0,e.type)}case 7:return td(t,n);case 8:return td(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const tI=e=>e;let nd=nn();function nI(e,t={}){let n=!1;const s=t.onError||S$;return t.onError=o=>{n=!0,s(o)},{...V$(e,t),detectError:n}}function sI(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&it(e)){Wt(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||tI)(e),o=nd[s];if(o)return o;const{ast:i,detectError:r}=nI(e,{...t,location:!1,jit:!0}),l=em(i);return r?l:nd[s]=l}else{const n=e.cacheKey;if(n){const s=nd[n];return s||(nd[n]=em(e))}else return em(e)}}let jc=null;function oI(e){jc=e}function iI(e,t,n){jc&&jc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const rI=lI("function:translate");function lI(e){return t=>jc&&jc.emit(e,t)}const xi={INVALID_ARGUMENT:w$,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},aI=24;function Ti(e){return hh(e,null,void 0)}function J1(e,t){return t.locale!=null?Sk(t.locale):Sk(e.locale)}let tm;function Sk(e){if(it(e))return e;if(vn(e)){if(e.resolvedOnce&&tm!=null)return tm;if(e.constructor.name==="Function"){const t=e();if(k$(t))throw Ti(xi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return tm=t}else throw Ti(xi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ti(xi.NOT_SUPPORT_LOCALE_TYPE)}function cI(e,t,n){return[...new Set([n,...En(t)?t:Ut(t)?Object.keys(t):it(t)?[t]:[n]])]}function bg(e,t,n){const s=it(n)?n:qc,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;En(r);)r=Ck(i,r,t);const l=En(t)||!Pt(t)?t:t.default?t.default:null;r=it(l)?[l]:l,En(r)&&Ck(i,r,!1),o.__localeChainCache.set(s,i)}return i}function Ck(e,t,n){let s=!0;for(let o=0;o<t.length&&Wt(s);o++){const i=t[o];it(i)&&(s=uI(e,t[o],n))}return s}function uI(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=dI(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function dI(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),(En(n)||Pt(n))&&n[o]&&(s=n[o])}return s}const Tr=[];Tr[0]={w:[0],i:[3,0],"[":[4],o:[7]};Tr[1]={w:[1],".":[2],"[":[4],o:[7]};Tr[2]={w:[2],i:[3,0],0:[3,0]};Tr[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Tr[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Tr[5]={"'":[4,0],o:8,l:[5,0]};Tr[6]={'"':[4,0],o:8,l:[6,0]};const fI=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function hI(e){return fI.test(e)}function pI(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 mI(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 gI(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:hI(t)?pI(t):"*"+t}function vI(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=gI(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=mI(i),d=Tr[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 xk=new Map;function yI(e,t){return Ut(e)?e[t]:null}function kI(e,t){if(!Ut(e))return null;let n=xk.get(t);if(n||(n=vI(t),n&&xk.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(wC.includes(r)&&oi(o)||!Ut(o)||!Ao(o,r))return null;const l=o[r];if(l===void 0||vn(o))return null;o=l,i++}return o}const bI="11.4.5",ph=-1,qc="en-US",hf="",Tk=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function _I(){return{upper:(e,t)=>t==="text"&&it(e)?e.toUpperCase():t==="vnode"&&Ut(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&it(e)?e.toLowerCase():t==="vnode"&&Ut(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&it(e)?Tk(e):t==="vnode"&&Ut(e)&&"__v_isVNode"in e?Tk(e.children):e}}let SC;function wI(e){SC=e}let CC;function SI(e){CC=e}let xC;function CI(e){xC=e}let TC=null;const xI=e=>{TC=e},TI=()=>TC;let MC=null;const Mk=e=>{MC=e},MI=()=>MC;let Ak=0;function AI(e={}){const t=vn(e.onWarn)?e.onWarn:c$,n=it(e.version)?e.version:bI,s=it(e.locale)||vn(e.locale)?e.locale:qc,o=vn(s)?qc:s,i=En(e.fallbackLocale)||Pt(e.fallbackLocale)||it(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Pt(e.messages)?e.messages:nm(o),l=Pt(e.datetimeFormats)?e.datetimeFormats:nm(o),a=Pt(e.numberFormats)?e.numberFormats:nm(o),c=qn(nn(),e.modifiers,_I()),u=e.pluralRules||nn(),d=vn(e.missing)?e.missing:null,f=Wt(e.missingWarn)||ba(e.missingWarn)?e.missingWarn:!0,p=Wt(e.fallbackWarn)||ba(e.fallbackWarn)?e.fallbackWarn:!0,h=!!e.fallbackFormat,g=!!e.unresolving,S=vn(e.postTranslation)?e.postTranslation:null,_=Pt(e.processor)?e.processor:null,y=Wt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,v=vn(e.messageCompiler)?e.messageCompiler:SC,w=vn(e.messageResolver)?e.messageResolver:CC||yI,N=vn(e.localeFallbacker)?e.localeFallbacker:xC||cI,E=Ut(e.fallbackContext)?e.fallbackContext:void 0,k=e,A=Ut(k.__datetimeFormatters)?k.__datetimeFormatters:new Map,I=Ut(k.__numberFormatters)?k.__numberFormatters:new Map,P=Ut(k.__meta)?k.__meta:{};Ak++;const M={version:n,cid:Ak,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:g,postTranslation:S,processor:_,warnHtmlMessage:y,escapeParameter:b,messageCompiler:v,messageResolver:w,localeFallbacker:N,fallbackContext:E,onWarn:t,__meta:P};return M.datetimeFormats=l,M.numberFormats=a,M.__datetimeFormatters=A,M.__numberFormatters=I,__INTLIFY_PROD_DEVTOOLS__&&iI(M,n,P),M}const nm=e=>({[e]:nn()});function Q1(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return it(l)?l:t}else return t}function nc(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function EI(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function $I(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(EI(e,t[s]))return!0;return!1}function Ek(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!it(t[0])&&!fC(t[0])&&!jn(t[0]))return hf;const[a,c,u,d]=_g(...t),f=Wt(u.missingWarn)?u.missingWarn:e.missingWarn;Wt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=J1(e,u),g=r(e,o,h);if(!it(a)||a===""){const N=new Intl.DateTimeFormat(h.replace(/!/g,""),d);return p?N.formatToParts(c):N.format(c)}let S={},_,y=null;const b="datetime format";for(let N=0;N<g.length&&(_=g[N],S=n[_]||{},y=S[a],!Pt(y));N++)Q1(e,a,_,f,b);if(!Pt(y)||!it(_))return s?ph:a;let v=`${_}__${a}`;fh(d)||(v=`${v}__${JSON.stringify(d)}`);let w=l.get(v);return w||(w=new Intl.DateTimeFormat(_,qn({},y,d)),l.set(v,w)),p?w.formatToParts(c):w.format(c)}const AC=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function _g(...e){const[t,n,s,o]=e,i=nn();let r=nn(),l;if(it(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Ti(xi.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw Ti(xi.INVALID_ISO_DATE_ARGUMENT)}}else if(fC(t)){if(isNaN(t.getTime()))throw Ti(xi.INVALID_DATE_ARGUMENT);l=t}else if(jn(t))l=t;else throw Ti(xi.INVALID_ARGUMENT);return it(n)?i.key=n:Pt(n)&&Object.keys(n).forEach(a=>{AC.includes(a)?r[a]=n[a]:i[a]=n[a]}),it(s)?i.locale=s:Pt(s)&&(r=s),Pt(o)&&(r=o),[i.key||"",l,i,r]}function $k(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function Ik(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!jn(t[0]))return hf;const[a,c,u,d]=wg(...t),f=Wt(u.missingWarn)?u.missingWarn:e.missingWarn;Wt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=J1(e,u),g=r(e,o,h);if(!it(a)||a===""){const N=new Intl.NumberFormat(h.replace(/!/g,""),d);return p?N.formatToParts(c):N.format(c)}let S={},_,y=null;const b="number format";for(let N=0;N<g.length&&(_=g[N],S=n[_]||{},y=S[a],!Pt(y));N++)Q1(e,a,_,f,b);if(!Pt(y)||!it(_))return s?ph:a;let v=`${_}__${a}`;fh(d)||(v=`${v}__${JSON.stringify(d)}`);let w=l.get(v);return w||(w=new Intl.NumberFormat(_,qn({},y,d)),l.set(v,w)),p?w.formatToParts(c):w.format(c)}const EC=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function wg(...e){const[t,n,s,o]=e,i=nn();let r=nn();if(!jn(t))throw Ti(xi.INVALID_ARGUMENT);const l=t;return it(n)?i.key=n:Pt(n)&&Object.keys(n).forEach(a=>{EC.includes(a)?r[a]=n[a]:i[a]=n[a]}),it(s)?i.locale=s:Pt(s)&&(r=s),Pt(o)&&(r=o),[i.key||"",l,i,r]}function Nk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const II=e=>e,NI=e=>"",LI="text",OI=e=>e.length===0?"":Y1(e),PI=b$;function sm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function RI(e){const t=jn(e.pluralIndex)?e.pluralIndex:-1;return jn(e.named?.count)?e.named.count:jn(e.named?.n)?e.named.n:t}function DI(e={}){const t=e.locale,n=RI(e),s=it(t)&&vn(e.pluralRules?.[t])?e.pluralRules[t]:sm,o=s===sm?void 0:sm,i=_=>_[s(n,_.length,o)],r=e.list||[],l=_=>r[_],a=e.named||nn();jn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=_=>a[_];function u(_,y){const b=vn(e.messages)?e.messages(_,!!y):Ut(e.messages)?e.messages[_]:!1;return b||(e.parent?e.parent.message(_):NI)}const d=_=>e.modifiers?e.modifiers[_]:II,f=vn(e.processor?.normalize)?e.processor.normalize:OI,p=vn(e.processor?.interpolate)?e.processor.interpolate:PI,h=it(e.processor?.type)?e.processor.type:LI,S={list:l,named:c,plural:i,linked:(_,...y)=>{const[b,v]=y;let w="text",N="";y.length===1?Ut(b)?(N=b.modifier||N,w=b.type||w):it(b)&&(N=b||N):y.length===2&&(it(b)&&(N=b||N),it(v)&&(w=v||w));const E=u(_,!0)(S),k=E===""||E===void 0?_:E,A=w==="vnode"&&En(k)&&N?k[0]:k;return N?d(N)(A,w):A},message:u,type:h,interpolate:p,normalize:f,values:qn(nn(),r,a)};return S}const Lk=()=>"",xo=e=>vn(e);function Ok(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Sg(...t),u=Wt(c.missingWarn)?c.missingWarn:e.missingWarn,d=Wt(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=Wt(c.escapeParameter)?c.escapeParameter:e.escapeParameter,p=!!c.resolvedMessage,h=it(c.default)||Wt(c.default)?Wt(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||h!=null&&(it(h)||vn(h)),S=J1(e,c);f&&BI(c);let[_,y,b]=p?[a,S,l[S]||nn()]:$C(e,a,S,r,d,u),v=_,w=a;if(!p&&!(it(v)||oi(v)||xo(v))&&g&&(v=h,w=v),!p&&(!(it(v)||oi(v)||xo(v))||!it(y)))return o?ph:a;let N=!1;const E=()=>{N=!0},k=xo(v)?v:IC(e,a,y,v,w,E);if(N)return v;const A=WI(e,y,b,c),I=DI(A),P=FI(e,k,I);let M=s?s(P,a):P;if(f&&it(M)&&(M=v$(M)),__INTLIFY_PROD_DEVTOOLS__){const L={timestamp:Date.now(),key:it(a)?a:xo(v)?v.key:"",locale:y||(xo(v)?v.locale:""),format:it(v)?v:xo(v)?v.source:"",message:M};L.meta=qn({},e.__meta,TI()||{}),rI(L)}return M}function BI(e){En(e.list)?e.list=e.list.map(t=>it(t)?vk(t):t):Ut(e.named)&&Object.keys(e.named).forEach(t=>{it(e.named[t])&&(e.named[t]=vk(e.named[t]))})}function $C(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=nn(),f,p=null;const h="translate";for(let g=0;g<u.length&&(f=u[g],d=r[f]||nn(),(p=a(d,t))===null&&(p=d[t]),!(it(p)||oi(p)||xo(p)));g++)if(!$I(f,u)){const S=Q1(e,t,f,i,h);S!==t&&(p=S)}return[p,f,d]}function IC(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(xo(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,HI(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function FI(e,t,n){return t(n)}function Sg(...e){const[t,n,s]=e,o=nn();if(!it(t)&&!jn(t)&&!xo(t)&&!oi(t))throw Ti(xi.INVALID_ARGUMENT);const i=jn(t)?String(t):(xo(t),t);return jn(n)?o.plural=n:it(n)?o.default=n:Pt(n)&&!fh(n)?o.named=n:En(n)&&(o.list=n),jn(s)?o.plural=s:it(s)?o.default=s:Pt(s)&&qn(o,s),[i,o]}function HI(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>u$(t,n,r)}}function WI(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 g=r(n,p);if(g==null&&(u||h)){const[S,,_]=$C(u||e,p,t,l,a,c);g=S??r(_,p)}if(it(g)||oi(g)){let S=!1;const y=IC(e,p,t,g,p,()=>{S=!0});return S?Lk:y}else return xo(g)?g:Lk}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),jn(s.plural)&&(f.pluralIndex=s.plural),f}K$();/*!
35
+ * vue-i18n v11.4.5
36
+ * (c) 2026 kazuya kawaguchi
37
+ * Released under the MIT License.
38
+ */const UI="11.4.5";function jI(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(tl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(tl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(tl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(tl().__INTLIFY_PROD_DEVTOOLS__=!1)}const Ts={UNEXPECTED_RETURN_TYPE:aI,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Bs(e,...t){return hh(e,null,void 0)}const Cg=Cr("__translateVNode"),xg=Cr("__datetimeParts"),Tg=Cr("__numberParts"),NC=Cr("__setPluralRules"),LC=Cr("__injectWithOption"),Xl=Cr("__dispose");function zc(e){if(!Ut(e)||oi(e))return e;for(const t in e)if(Ao(e,t))if(!t.includes("."))Ut(e[t])&&zc(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=nn()),!Ut(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(oi(o)?wC.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!oi(o)){const r=o[n[s]];Ut(r)&&zc(r)}}return e}function ev(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Pt(n)?n:En(s)?nn():{[e]:nn()};if(En(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||nn(),Md(c,r[a])):Md(c,r)}else it(l)&&Md(JSON.parse(l),r)}),o==null&&i)for(const l in r)Ao(r,l)&&zc(r[l]);return r}function OC(e){return e.type}function PC(e,t,n){let s=Ut(t.messages)?t.messages:nn();"__i18nGlobal"in n&&(s=ev(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(Ut(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Ut(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Pk(e){return gt(fr,null,e,0)}function Vc(){return us()}const Rk="__INTLIFY_META__",Dk=()=>[],qI=()=>!1;let Bk=0;function Fk(e){return((t,n,s,o)=>e(n,s,Vc()||void 0,o))}const zI=()=>{const e=Vc();let t=null;return e&&(t=OC(e)[Rk])?{[Rk]:t}:null};function pf(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=ff?te:hl;let r=Wt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:it(e.locale)?e.locale:qc),a=i(t&&r?t.fallbackLocale.value:it(e.fallbackLocale)||En(e.fallbackLocale)||Pt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(ev(l.value,e)),u=i(Pt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Pt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:Wt(e.missingWarn)||ba(e.missingWarn)?e.missingWarn:!0,p=t?t.fallbackWarn:Wt(e.fallbackWarn)||ba(e.fallbackWarn)?e.fallbackWarn:!0,h=t?t.fallbackRoot:Wt(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,S=vn(e.missing)?e.missing:null,_=vn(e.missing)?Fk(e.missing):null,y=vn(e.postTranslation)?e.postTranslation:null,b=t?t.warnHtmlMessage:Wt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter;const w=t?t.modifiers:Pt(e.modifiers)?e.modifiers:{};let N=e.pluralRules||t&&t.pluralRules,E;E=(()=>{s&&Mk(null);const re={version:UI,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:w,pluralRules:N,missing:_===null?void 0:_,missingWarn:f,fallbackWarn:p,fallbackFormat:g,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:b,escapeParameter:v,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};re.datetimeFormats=u.value,re.numberFormats=d.value,re.__datetimeFormatters=Pt(E)?E.__datetimeFormatters:void 0,re.__numberFormatters=Pt(E)?E.__numberFormatters:void 0;const le=AI(re);return s&&Mk(le),le})(),nc(E,l.value,a.value);function A(){return[l.value,a.value,c.value,u.value,d.value]}const I=F({get:()=>l.value,set:re=>{E.locale=re,l.value=re}}),P=F({get:()=>a.value,set:re=>{E.fallbackLocale=re,a.value=re,nc(E,l.value,re)}}),M=F(()=>c.value),L=F(()=>u.value),R=F(()=>d.value);function B(){return vn(y)?y:null}function U(re){y=re,E.postTranslation=re}function K(){return S}function V(re){re!==null&&(_=Fk(re)),S=re,E.missing=_}const se=(re,le,Ce,We,nt,lt)=>{A();let kt;try{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=t?MI():void 0),kt=re(E)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=void 0)}if(Ce!=="translate exists"&&jn(kt)&&kt===ph||Ce==="translate exists"&&!kt){const[Ct,ut]=le();return t&&h?We(t):nt(Ct)}else{if(lt(kt))return kt;throw Bs(Ts.UNEXPECTED_RETURN_TYPE)}};function Y(...re){return se(le=>Reflect.apply(Ok,null,[le,...re]),()=>Sg(...re),"translate",le=>Reflect.apply(le.t,le,[...re]),le=>le,le=>it(le))}function G(...re){const[le,Ce,We]=re;if(We&&!Ut(We))throw Bs(Ts.INVALID_ARGUMENT);return Y(le,Ce,qn({resolvedMessage:!0},We||{}))}function ee(...re){return se(le=>Reflect.apply(Ek,null,[le,...re]),()=>_g(...re),"datetime format",le=>Reflect.apply(le.d,le,[...re]),()=>hf,le=>it(le)||En(le))}function Se(...re){return se(le=>Reflect.apply(Ik,null,[le,...re]),()=>wg(...re),"number format",le=>Reflect.apply(le.n,le,[...re]),()=>hf,le=>it(le)||En(le))}function ae(re){return re.map(le=>it(le)||jn(le)||Wt(le)?Pk(String(le)):le)}const de={normalize:ae,interpolate:re=>re,type:"vnode"};function we(...re){return se(le=>{let Ce;const We=le;try{We.processor=de,Ce=Reflect.apply(Ok,null,[We,...re])}finally{We.processor=null}return Ce},()=>Sg(...re),"translate",le=>le[Cg](...re),le=>[Pk(le)],le=>En(le))}function me(...re){return se(le=>Reflect.apply(Ik,null,[le,...re]),()=>wg(...re),"number format",le=>le[Tg](...re),Dk,le=>it(le)||En(le))}function $e(...re){return se(le=>Reflect.apply(Ek,null,[le,...re]),()=>_g(...re),"datetime format",le=>le[xg](...re),Dk,le=>it(le)||En(le))}function J(re){N=re,E.pluralRules=N}function ye(re,le){return se(()=>{if(!re)return!1;const Ce=it(le)?le:l.value,We=it(le)?[Ce]:bg(E,a.value,Ce);for(let nt=0;nt<We.length;nt++){const lt=Z(We[nt]);let kt=E.messageResolver(lt,re);if(kt===null&&(kt=lt[re]),oi(kt)||xo(kt)||it(kt))return!0}return!1},()=>[re],"translate exists",Ce=>Reflect.apply(Ce.te,Ce,[re,le]),qI,Ce=>Wt(Ce))}function _e(re){let le=null;const Ce=bg(E,a.value,l.value);for(let We=0;We<Ce.length;We++){const nt=c.value[Ce[We]]||{},lt=E.messageResolver(nt,re);if(lt!=null){le=lt;break}}return le}function W(re){const le=_e(re);return le??(t?t.tm(re)||{}:{})}function Z(re){return c.value[re]||{}}function fe(re,le){if(o){const Ce={[re]:le};for(const We in Ce)Ao(Ce,We)&&zc(Ce[We]);le=Ce[re]}c.value[re]=le,E.messages=c.value}function oe(re,le){c.value[re]=c.value[re]||{};const Ce={[re]:le};if(o)for(const We in Ce)Ao(Ce,We)&&zc(Ce[We]);le=Ce[re],Md(le,c.value[re]),E.messages=c.value}function he(re){return u.value[re]||{}}function H(re,le){u.value[re]=le,E.datetimeFormats=u.value,$k(E,re,le)}function X(re,le){u.value[re]=qn(u.value[re]||{},le),E.datetimeFormats=u.value,$k(E,re,le)}function ce(re){return d.value[re]||{}}function ke(re,le){d.value[re]=le,E.numberFormats=d.value,Nk(E,re,le)}function Me(re,le){d.value[re]=qn(d.value[re]||{},le),E.numberFormats=d.value,Nk(E,re,le)}Bk++,t&&ff&&(Ke(t.locale,re=>{r&&(l.value=re,E.locale=re,nc(E,l.value,a.value))}),Ke(t.fallbackLocale,re=>{r&&(a.value=re,E.fallbackLocale=re,nc(E,l.value,a.value))}));const Ne={id:Bk,locale:I,fallbackLocale:P,get inheritLocale(){return r},set inheritLocale(re){r=re,re&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,nc(E,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:M,get modifiers(){return w},get pluralRules(){return N||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(re){f=re,E.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(re){p=re,E.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(re){h=re},get fallbackFormat(){return g},set fallbackFormat(re){g=re,E.fallbackFormat=g},get warnHtmlMessage(){return b},set warnHtmlMessage(re){b=re,E.warnHtmlMessage=re},get escapeParameter(){return v},set escapeParameter(re){v=re,E.escapeParameter=re},t:Y,getLocaleMessage:Z,setLocaleMessage:fe,mergeLocaleMessage:oe,getPostTranslationHandler:B,setPostTranslationHandler:U,getMissingHandler:K,setMissingHandler:V,[NC]:J};return Ne.datetimeFormats=L,Ne.numberFormats=R,Ne.rt=G,Ne.te=ye,Ne.tm=W,Ne.d=ee,Ne.n=Se,Ne.getDateTimeFormat=he,Ne.setDateTimeFormat=H,Ne.mergeDateTimeFormat=X,Ne.getNumberFormat=ce,Ne.setNumberFormat=ke,Ne.mergeNumberFormat=Me,Ne[LC]=n,Ne[Cg]=we,Ne[xg]=$e,Ne[Tg]=me,Ne}function VI(e){const t=it(e.locale)?e.locale:qc,n=it(e.fallbackLocale)||En(e.fallbackLocale)||Pt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=vn(e.missing)?e.missing:void 0,o=Wt(e.silentTranslationWarn)||ba(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Wt(e.silentFallbackWarn)||ba(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Wt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Pt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=vn(e.postTranslation)?e.postTranslation:void 0,d=it(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,p=Wt(e.sync)?e.sync:!0;let h=e.messages;if(Pt(e.sharedMessages)){const w=e.sharedMessages;h=Object.keys(w).reduce((E,k)=>{const A=E[k]||(E[k]={});return qn(A,w[k]),E},h||{})}const{__i18n:g,__root:S,__injectWithOption:_}=e,y=e.datetimeFormats,b=e.numberFormats,v=e.flatJson;return{locale:t,fallbackLocale:n,messages:h,flatJson:v,datetimeFormats:y,numberFormats:b,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:g,__root:S,__injectWithOption:_}}function Mg(e={}){const t=pf(VI(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 Wt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Wt(o)?!o:o},get silentFallbackWarn(){return Wt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Wt(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 KI(e,t,n){return{beforeCreate(){const s=Vc();if(!s)throw Bs(Ts.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=Hk(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Mg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Hk(e,o);else{this.$i18n=Mg({__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&&PC(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=Vc();if(!s)throw Bs(Ts.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 Hk(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[NC](t.pluralizationRules||e.pluralizationRules);const n=ev(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 tv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function GI({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Pe?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},nn())}function RC(){return Pe}const YI=Ze({name:"i18n-t",props:qn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>jn(e)||!isNaN(e)}},tv),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||_t({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=nn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=it(e.plural)?+e.plural:e.plural);const u=GI(t,a);return o[Cg](e.keypath,u,c)},r=qn(nn(),s),l=it(e.tag)||Ut(e.tag)?e.tag:RC();return Ut(l)?Xt(l,r,{default:i}):Xt(l,r,i())}}}),Wk=YI;function XI(e){return En(e)&&!it(e[0])}function DC(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=nn();e.locale&&(c.locale=e.locale),it(e.format)?c.key=e.format:Ut(e.format)&&(it(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((p,h)=>n.includes(h)?qn(nn(),p,{[h]:e.format[h]}):p,nn()));const d=s(e.value,c,u);let f=[c.key];return En(d)?f=d.map((p,h)=>{const g=o[p.type],S=g?g({[p.type]:p.value,index:h,parts:d}):[p.value];return XI(S)&&(S[0].key=`${p.type}-${h}`),S}):it(d)&&(f=[d]),f},l=qn(nn(),i),a=it(e.tag)||Ut(e.tag)?e.tag:RC();return Ut(a)?Xt(a,l,{default:r}):Xt(a,l,r())}}const ZI=Ze({name:"i18n-n",props:qn({value:{type:Number,required:!0},format:{type:[String,Object]}},tv),setup(e,t){const n=e.i18n||_t({useScope:e.scope,__useComponent:!0});return DC(e,t,EC,(...s)=>n[Tg](...s))}}),Uk=ZI;function JI(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 QI(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Bs(Ts.UNEXPECTED_ERROR);const c=JI(e,l.$),u=jk(a);return[Reflect.apply(c.t,c,[...qk(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);ff&&(r.__i18nWatcher=Ke(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{ff&&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=jk(l);r.textContent=Reflect.apply(a.t,a,[...qk(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function jk(e){if(it(e))return{path:e};if(Pt(e)){if(!("path"in e))throw Bs(Ts.REQUIRED_VALUE,"path");return e}else throw Bs(Ts.INVALID_VALUE)}function qk(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return it(n)&&(r.locale=n),jn(o)&&(r.plural=o),jn(i)&&(r.plural=i),[t,l,r]}function e6(e,t,...n){const s=Pt(n[0])?n[0]:{};(Wt(s.globalInstall)?s.globalInstall:!0)&&([Wk.name,"I18nT"].forEach(i=>e.component(i,Wk)),[Uk.name,"I18nN"].forEach(i=>e.component(i,Uk)),[Kk.name,"I18nD"].forEach(i=>e.component(i,Kk))),e.directive("t",QI(t))}const t6=Cr("global-vue-i18n");function n6(e={}){const t=__VUE_I18N_LEGACY_API__&&Wt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Wt(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=s6(e,t),r=Cr("");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),Pt(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let p=null;!t&&n&&(p=u6(d,u.global)),__VUE_I18N_FULL_INSTALL__&&e6(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(KI(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 _t(e={}){const t=Vc();if(t==null)throw Bs(Ts.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Bs(Ts.NOT_INSTALLED);const n=o6(t),s=r6(n),o=OC(t),i=i6(e,o);if(i==="global")return PC(s,e,o),s;if(i==="parent"){let a=zk(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Bs(Ts.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=qn({},e),u=zk(n,t);c.__root=u||s;const d=pf(c);return a.__composerExtend&&(d[Xl]=a.__composerExtend(d)),E1()&&$1(()=>{const p=d[Xl];p&&(p(),delete d[Xl])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=qn({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=pf(a),r.__composerExtend&&(l[Xl]=r.__composerExtend(l)),a6(r,t,l),r.__setInstance(t,l)}return l}function s6(e,t){const n=$A(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Mg(e)):n.run(()=>pf(e));if(s==null)throw Bs(Ts.UNEXPECTED_ERROR);return[n,s]}function o6(e){const t=Rt(e.isCE?t6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Bs(e.isCE?Ts.NOT_INSTALLED_WITH_PROVIDE:Ts.UNEXPECTED_ERROR);return t}function i6(e,t){return fh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function r6(e){return e.mode==="composition"?e.global:e.global.__composer}function zk(e,t,n=!1){let s=null;const o=t.root;let i=l6(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[LC]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function l6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function a6(e,t,n){Zt(()=>{},t),Ft(()=>{const s=n;e.__deleteInstance(t);const o=s[Xl];o&&(o(),delete s[Xl])},t)}const c6=["locale","fallbackLocale","availableLocales"],Vk=["t","rt","d","n","tm","te"];function u6(e,t){const n=Object.create(null);return c6.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Bs(Ts.UNEXPECTED_ERROR);const r=Fn(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,Vk.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Bs(Ts.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Vk.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const d6=Ze({name:"i18n-d",props:qn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},tv),setup(e,t){const n=e.i18n||_t({useScope:e.scope,__useComponent:!0});return DC(e,t,AC,(...s)=>n[xg](...s))}}),Kk=d6;jI();wI(sI);SI(kI);CI(bg);if(__INTLIFY_PROD_DEVTOOLS__){const e=tl();e.__INTLIFY__=!0,oI(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const At={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",theme:"kimi-web.theme",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",betaToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-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"};function Gk(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function xn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function Ln(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Kc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function nv(e){const t=xn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function sv(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function ov(){const e=xn(At.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 iv(e){const n={...ov()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];Ln(At.unread,JSON.stringify(n))}function f6(){const e=nv(At.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function h6(e){sv(At.collapsedWorkspaces,Array.from(e))}function p6(){const e=nv(At.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function BC(e){sv(At.workspaceOrder,Array.from(e))}const Yk=At.clientId,m6="kimi-code-web",g6="web";function v6(){return{serverHttpUrl:k6(),clientId:S6(),clientName:m6,clientVersion:C6(),clientUiMode:g6}}function y6(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function k6(e){const t=y6(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function b6(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function _6(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return b6(e)}function mf(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function w6(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 S6(){const e=xn(Yk);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return Ln(Yk,t),t}function C6(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function ks(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 x6(e)}function x6(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 T6(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 M6(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 A6(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}const E6={class:"row"},$6={class:"lead","aria-hidden":"true"},I6={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},N6={key:1,class:"unread-dot"},L6={class:"archive-label"},O6={class:"left"},P6=["onKeydown"],R6={class:"ts"},D6=["title"],B6={class:"tag-text"},F6=["title"],H6={class:"tag-text"},W6=["title"],U6={class:"tag-text"},j6=["title"],q6=Ze({__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}=_t(),o=e,i=n,r=te(!1),l=te(null),a=te(null);function c(I){const P=I.target;a.value?.contains(P)||l.value?.contains(P)||d()}function u(I){I.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}Ft(()=>document.removeEventListener("mousedown",c));const f=te(!1),p=te(""),h=te(null);async function g(){d(),f.value=!0,p.value=o.session.title,await mt();try{h.value?.focus(),h.value?.select()}catch{}}function S(){const I=p.value.trim();I&&i("rename",o.session.id,I),f.value=!1}function _(){f.value=!1}const y=te(!1),b=te(!1);async function v(){const I=await ks(o.session.id);y.value=I,b.value=!I,setTimeout(()=>{y.value=!1,b.value=!1,d()},1500)}function w(){d(),i("fork",o.session.id)}const N=te(!1);function E(){d(),N.value=!0}function k(){i("archive",o.session.id),N.value=!1}function A(){N.value=!1}return t({closeMenu:d,cancelArchive:A}),(I,P)=>(x(),$("div",{class:Le(["se",{on:e.active}]),onClick:P[5]||(P[5]=M=>i("select",e.session.id))},[m("div",E6,[m("span",$6,[e.session.busy?(x(),$("svg",I6,[...P[6]||(P[6]=[m("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),m("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(x(),$("span",N6)):ie("",!0)]),N.value?(x(),$("div",{key:0,class:"archive-confirm",onClick:P[0]||(P[0]=Je(()=>{},["stop"]))},[m("span",L6,O(C(s)("sidebar.archiveConfirm")),1),m("button",{class:"btn-confirm",onClick:Je(k,["stop"])},O(C(s)("sidebar.confirm")),1),m("button",{class:"btn-cancel",onClick:Je(A,["stop"])},O(C(s)("sidebar.cancel")),1)])):(x(),$(Pe,{key:1},[m("div",O6,[f.value?Lt((x(),$("input",{key:0,ref_key:"renameInputRef",ref:h,"onUpdate:modelValue":P[1]||(P[1]=M=>p.value=M),class:"rename-input",onClick:P[2]||(P[2]=Je(()=>{},["stop"])),onKeydown:[Mo(Je(S,["stop"]),["enter"]),Mo(Je(_,["stop"]),["esc"])],onBlur:S},null,40,P6)),[[wn,p.value]]):(x(),$("span",{key:1,class:"t",onDblclick:Je(g,["stop"])},O(e.session.title),33))]),m("span",R6,O(e.session.time),1),!f.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(x(),$("span",{key:0,class:"tag tag-ask",title:C(s)("workspace.awaitingAnswerTitle")},[m("span",B6,O(C(s)("workspace.awaitingAnswer")),1)],8,D6)):ie("",!0),!f.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(x(),$("span",{key:1,class:"tag tag-approve",title:C(s)("workspace.awaitingPermissionTitle")},[m("span",H6,O(C(s)("workspace.awaitingPermission")),1)],8,F6)):ie("",!0),!f.value&&e.session.status==="aborted"?(x(),$("span",{key:2,class:"tag tag-aborted",title:C(s)("workspace.abortedTitle")},[m("span",U6,O(C(s)("workspace.aborted")),1)],8,W6)):ie("",!0),f.value?ie("",!0):(x(),$("button",{key:3,ref_key:"kebabRef",ref:l,class:Le(["kebab",{open:r.value}]),title:C(s)("sidebar.options"),onClick:P[3]||(P[3]=Je(M=>u(M),["stop"]))},[...P[7]||(P[7]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,j6))],64))]),r.value?(x(),$("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:P[4]||(P[4]=Je(()=>{},["stop"]))},[m("button",{class:Le(["menu-item copy-id",{failed:b.value}]),onClick:Je(v,["stop"])},O(b.value?C(s)("sidebar.copyFailed"):y.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),3),P[8]||(P[8]=m("div",{class:"menu-divider"},null,-1)),m("button",{class:"menu-item",onClick:Je(g,["stop"])},O(C(s)("sidebar.rename")),1),m("button",{class:"menu-item",onClick:Je(w,["stop"])},O(C(s)("sidebar.fork")),1),m("button",{class:"menu-item archive",onClick:Je(E,["stop"])},O(C(s)("sidebar.archive")),1)],512)):ie("",!0)],2))}}),vt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},FC=vt(q6,[["__scopeId","data-v-8222aa18"]]),z6={class:"gh-top"},V6={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},K6={key:0,class:"gh-name"},G6=["title","aria-label","aria-expanded"],Y6=["title","aria-label"],X6=["title"],Z6={class:"group-sessions"},J6=["disabled"],Q6={key:1,class:"group-empty"},e5=Ze({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},selectedIds:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F({get:()=>s.renameValue,set:a=>o("updateRenameValue",a)});function r(a){s.renameInputRef.value=a instanceof HTMLInputElement?a:null}function l(a){a.dataTransfer&&(a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(a,c)=>(x(),$("div",{class:Le(["group",{dragging:e.dragging}])},[m("div",{class:Le(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,sel:e.selectedIds.has(e.group.workspace.id)}]),draggable:"true",onClick:c[7]||(c[7]=Je(u=>o("groupClick",e.group.workspace.id,u),["stop"])),onContextmenu:c[8]||(c[8]=u=>o("groupContextmenu",e.group.workspace,u)),onDragstart:l,onDragend:c[9]||(c[9]=u=>o("wsDragend"))},[m("div",z6,[(x(),$("svg",V6,[e.isCollapsed(e.group.workspace.id)?(x(),$(Pe,{key:0},[c[15]||(c[15]=m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),c[16]||(c[16]=m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(x(),$(Pe,{key:1},[c[17]||(c[17]=m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),c[18]||(c[18]=m("path",{d:"M1 5.5h12"},null,-1))],64))])),e.renamingId!==e.group.workspace.id?(x(),$("span",K6,O(e.group.workspace.name),1)):Lt((x(),$("input",{key:1,ref:r,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),class:"gh-rename",type:"text",onKeydown:[c[1]||(c[1]=Mo(u=>o("confirmRename"),["enter"])),c[2]||(c[2]=Mo(u=>o("cancelRename"),["esc"]))],onBlur:c[3]||(c[3]=u=>o("cancelRename")),onClick:c[4]||(c[4]=Je(()=>{},["stop"]))},null,544)),[[wn,i.value]]),m("button",{type:"button",class:Le(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),title:C(n)("sidebar.options"),"aria-label":C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:c[5]||(c[5]=Je(u=>o("toggleWsMenu",e.group.workspace,u),["stop"]))},[...c[19]||(c[19]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,G6),m("button",{type:"button",class:"gh-add",title:C(n)("workspace.newInGroup"),"aria-label":C(n)("workspace.newInGroup"),onClick:c[6]||(c[6]=Je(u=>o("createInWorkspace",e.group.workspace.id),["stop"]))},[...c[20]||(c[20]=[m("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Y6)]),m("div",{class:"gh-path",title:e.group.workspace.root},O(e.group.workspace.shortPath||e.group.workspace.root),9,X6)],34),Lt(m("div",Z6,[(x(!0),$(Pe,null,Xe(e.group.sessions,u=>(x(),je(FC,{key:u.id,session:u,active:u.id===e.activeId,"approval-count":e.pendingBySession[u.id]?.approvals??0,"question-count":e.pendingBySession[u.id]?.questions??0,unread:e.unreadBySession[u.id]??!1,onSelect:c[10]||(c[10]=d=>o("selectSession",d)),onRename:c[11]||(c[11]=(d,f)=>o("renameSession",d,f)),onArchive:c[12]||(c[12]=d=>o("archiveSession",d)),onFork:c[13]||(c[13]=d=>o("forkSession",d))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),$("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:c[14]||(c[14]=Je(u=>o("loadMore",e.group.workspace.id),["stop"]))},O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,e.group.workspace.sessionCount-e.group.sessions.length)})),9,J6)):ie("",!0),e.group.sessions.length===0?(x(),$("div",Q6,O(C(n)("sidebar.noSessions")),1)):ie("",!0)],512),[[Bo,!e.isCollapsed(e.group.workspace.id)]])],2))}}),t5=vt(e5,[["__scopeId","data-v-4c114e7c"]]),n5={class:"side"},s5={class:"ch"},o5={class:"ch-brand"},i5={class:"ch-name"},r5={key:0,class:"ch-endpoint"},l5=["title","aria-label"],a5=["title","aria-label"],c5={class:"search"},u5=["placeholder","aria-label","onKeydown"],d5=["title","aria-label"],f5={class:"btn-wrap"},h5={key:0,class:"sessions"},p5={key:1,class:"empty"},m5={key:1,class:"sessions"},g5={key:0,class:"empty"},v5=["onDragover","onDrop"],y5=Ze({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","selectWorkspaces","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=_t(),s=!1,o="",i=e,r=t,l=te(""),a=F(()=>l.value.trim()),c=F(()=>a.value.length>0),u=F(()=>{const le=a.value.toLowerCase();return le?i.sessions.filter(Ce=>{const We=(Ce.title??"").toLowerCase(),nt=(Ce.lastPrompt??"").toLowerCase();return We.includes(le)||nt.includes(le)}):[]});function d(){l.value=""}function f(le){d(),A(le)}Ke(c,le=>{le&&r("loadAllSessions")});const p=te(new Set(f6()));function h(le){return p.value.has(le)}function g(le){const Ce=new Set(p.value);Ce.has(le)?Ce.delete(le):Ce.add(le),p.value=Ce,h6(Ce)}const S=te(null),_=te(null);function y(le){S.value=le}function b(){S.value=null,_.value=null}function v(le){const Ce=le.currentTarget.getBoundingClientRect();return le.clientY<Ce.top+Ce.height/2?"before":"after"}function w(le,Ce){S.value===null||S.value===Ce||(le.preventDefault(),le.dataTransfer&&(le.dataTransfer.dropEffect="move"),_.value={id:Ce,position:v(le)})}function N(le){const Ce=S.value,We=_.value?.id===le?_.value.position:"before";if(_.value=null,S.value=null,!Ce||Ce===le)return;const nt=A6(i.groups.map(lt=>lt.workspace.id),Ce,le,We);r("reorderWorkspaces",nt)}const E=te(new Set);function k(le,Ce){if(Ce.shiftKey){Ce.stopPropagation();const We=new Set(E.value);We.has(le)?We.delete(le):We.add(le),E.value=We,r("selectWorkspaces",Array.from(We));return}E.value=new Set,r("selectWorkspaces",[]),g(le)}function A(le){E.value=new Set,r("selectWorkspaces",[]),r("select",le)}const I=te(null),P=te(""),M=te(null);function L(){return M}function R(le,Ce){I.value=le,P.value=Ce,mt().then(()=>M.value?.focus())}function B(){const le=I.value,Ce=P.value.trim();le&&Ce&&r("renameWorkspace",le,Ce),I.value=null}function U(){I.value=null}function K(le){P.value=le}const V=te(!1),se=te(null),Y=te({}),G=te(null);function ee(le){G.value&&!G.value.contains(le.target)&&ae()}function Se(le,Ce){if(Ce.shiftKey){Ce.stopPropagation();const We=new Set(E.value);We.has(le.id)?We.delete(le.id):We.add(le.id),E.value=We,r("selectWorkspaces",Array.from(We));return}Ce.preventDefault(),Ce.stopPropagation(),se.value=le,Y.value={top:`${Ce.clientY}px`,left:`${Ce.clientX}px`},V.value=!0,document.addEventListener("mousedown",ee,!0)}function ae(){V.value=!1,document.removeEventListener("mousedown",ee,!0),se.value=null,J()}function Ie(){se.value&&ks(se.value.root),ae()}function de(){se.value&&R(se.value.id,se.value.name),ae()}function we(){const le=se.value;le&&ye(le.id)&&(r("deleteWorkspace",le.id),ae())}const me=te(null);let $e;function J(){clearTimeout($e),me.value=null}function ye(le){return me.value===le?(J(),!0):(clearTimeout($e),me.value=le,$e=setTimeout(()=>{me.value=null},2500),!1)}const _e=te(null),W=te(null),Z=te({}),fe=te(null);function oe(le){const Ce=le.target;Ce.closest(".gh-more")||Ce.closest(".ws-menu")||H()}async function he(le,Ce){if(_e.value===le.id){H();return}const We=Ce.currentTarget;W.value=le,_e.value=le.id,document.addEventListener("mousedown",oe),document.addEventListener("scroll",H,!0),window.addEventListener("resize",H),await mt();const nt=fe.value,lt=We.getBoundingClientRect(),kt=4,Ct=8,ut=nt?.offsetHeight??0,Et=nt?.offsetWidth??0;let on=lt.bottom+kt;on+ut>window.innerHeight-Ct&&(on=Math.max(Ct,lt.top-ut-kt));let Tn=lt.right-Et;Tn<Ct&&(Tn=Ct),Z.value={top:`${Math.round(on)}px`,left:`${Math.round(Tn)}px`}}function H(){_e.value=null,W.value=null,J(),document.removeEventListener("mousedown",oe),document.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}function X(le){ks(le.root),H()}function ce(le){R(le.id,le.name),H()}function ke(le){ye(le.id)&&(r("deleteWorkspace",le.id),H())}qs(()=>{document.removeEventListener("mousedown",ee,!0),document.removeEventListener("mousedown",oe),document.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H),clearTimeout($e)});const Me=te(null);let Ne;function re(){const le=Me.value;le&&(le.classList.remove("blink-now"),le.getBoundingClientRect(),le.classList.add("blink-now"),clearTimeout(Ne),Ne=setTimeout(()=>le.classList.remove("blink-now"),300))}return(le,Ce)=>(x(),$("aside",n5,[m("div",{class:"col",style:Bt({width:e.colWidth+"px"})},[m("div",s5,[m("div",o5,[(x(),$("svg",{ref_key:"logoRef",ref:Me,class:Le(["ch-logo",{"is-dev":C(s)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:re},[...Ce[19]||(Ce[19]=[yr('<defs data-v-bdcf1ef0><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-bdcf1ef0><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-bdcf1ef0></rect><g class="ch-eyes" fill="#000" data-v-bdcf1ef0><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-bdcf1ef0></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-bdcf1ef0></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-bdcf1ef0></rect>',2)])],2)),m("span",i5,[Ce[20]||(Ce[20]=dt("Kimi Code",-1)),C(s)?(x(),$("span",r5," · "+O(C(o)),1)):ie("",!0)])]),m("button",{type:"button",class:"collapse-btn",title:C(n)("sidebar.collapseSidebar"),"aria-label":C(n)("sidebar.collapseSidebar"),onClick:Ce[0]||(Ce[0]=Je(We=>r("collapse"),["stop"]))},[...Ce[21]||(Ce[21]=[yr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-bdcf1ef0><path d="M11 6h9" data-v-bdcf1ef0></path><path d="M11 12h9" data-v-bdcf1ef0></path><path d="M11 18h9" data-v-bdcf1ef0></path><path d="M7 9l-3 3 3 3" data-v-bdcf1ef0></path></svg>',1)])],8,l5),m("button",{type:"button",class:"settings-btn",title:C(n)("settings.title"),"aria-label":C(n)("settings.title"),onClick:Ce[1]||(Ce[1]=Je(We=>r("openSettings"),["stop"]))},[...Ce[22]||(Ce[22]=[m("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"12",cy:"12",r:"3"}),m("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 15 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z"})],-1)])],8,a5)]),m("div",c5,[Ce[24]||(Ce[24]=m("svg",{class:"search-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"7",cy:"7",r:"5"}),m("path",{d:"M11 11l3 3"})],-1)),Lt(m("input",{"onUpdate:modelValue":Ce[2]||(Ce[2]=We=>l.value=We),class:"search-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),onKeydown:Mo(Je(d,["stop"]),["esc"])},null,40,u5),[[wn,l.value]]),c.value?(x(),$("button",{key:0,type:"button",class:"search-clear",title:C(n)("sidebar.searchClear"),"aria-label":C(n)("sidebar.searchClear"),onClick:Je(d,["stop"])},[...Ce[23]||(Ce[23]=[m("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,d5)):ie("",!0)]),m("div",f5,[m("button",{class:"btn-new-chat",onClick:Ce[3]||(Ce[3]=Je(We=>r("create"),["stop"]))},[Ce[25]||(Ce[25]=m("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),m("span",null,O(C(n)("sidebar.newChat")),1)]),ie("",!0)]),c.value?(x(),$("div",h5,[u.value.length>0?(x(!0),$(Pe,{key:0},Xe(u.value,We=>(x(),je(FC,{key:We.id,session:We,active:We.id===e.activeId,"approval-count":e.pendingBySession[We.id]?.approvals??0,"question-count":e.pendingBySession[We.id]?.questions??0,unread:e.unreadBySession[We.id]??!1,onSelect:Ce[5]||(Ce[5]=nt=>f(nt)),onRename:Ce[6]||(Ce[6]=(nt,lt)=>r("rename",nt,lt)),onArchive:Ce[7]||(Ce[7]=nt=>r("archive",nt)),onFork:Ce[8]||(Ce[8]=nt=>r("fork",nt))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(x(),$("div",p5,O(C(n)("sidebar.searchNoResults")),1))])):(x(),$("div",m5,[e.groups.length===0?(x(),$("div",g5,O(C(n)("workspace.noWorkspace")),1)):(x(!0),$(Pe,{key:1},Xe(e.groups,We=>(x(),$("div",{key:We.workspace.id,class:Le(["ws-drop-target",{"drop-before":_.value?.id===We.workspace.id&&_.value.position==="before","drop-after":_.value?.id===We.workspace.id&&_.value.position==="after"}]),onDragover:nt=>w(nt,We.workspace.id),onDrop:nt=>N(We.workspace.id)},[gt(t5,{group:We,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"selected-ids":E.value,"renaming-id":I.value,"rename-value":P.value,"rename-input-ref":L(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":_e.value,dragging:S.value===We.workspace.id,"is-collapsed":h,onGroupClick:k,onGroupContextmenu:Se,onToggleWsMenu:he,onCreateInWorkspace:Ce[9]||(Ce[9]=nt=>r("createInWorkspace",nt)),onSelectSession:A,onRenameSession:Ce[10]||(Ce[10]=(nt,lt)=>r("rename",nt,lt)),onArchiveSession:Ce[11]||(Ce[11]=nt=>r("archive",nt)),onForkSession:Ce[12]||(Ce[12]=nt=>r("fork",nt)),onLoadMore:Ce[13]||(Ce[13]=nt=>r("loadMoreSessions",nt)),onConfirmRename:B,onCancelRename:U,onUpdateRenameValue:K,onWsDragstart:y,onWsDragend:b},null,8,["group","active-workspace-id","active-id","selected-ids","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,v5))),128))]))],4),V.value?(x(),$("div",{key:0,ref_key:"ghMenuRef",ref:G,class:"gh-menu",style:Bt(Y.value),onClick:Ce[14]||(Ce[14]=Je(()=>{},["stop"]))},[m("button",{type:"button",class:"ghm-item",onClick:Ie},O(C(n)("sidebar.copyPath")),1),m("button",{type:"button",class:"ghm-item",onClick:de},O(C(n)("sidebar.rename")),1),m("button",{type:"button",class:"ghm-item del",onClick:we},O(se.value&&me.value===se.value.id?C(n)("sidebar.confirm"):C(n)("sidebar.removeWorkspace")),1)],4)):ie("",!0),_e.value!==null&&W.value?(x(),$("div",{key:1,ref_key:"wsMenuRef",ref:fe,class:"ws-menu",style:Bt(Z.value),onClick:Ce[18]||(Ce[18]=Je(()=>{},["stop"]))},[m("button",{class:"ws-menu-item",onClick:Ce[15]||(Ce[15]=Je(We=>X(W.value),["stop"]))},O(C(n)("sidebar.copyPath")),1),Ce[27]||(Ce[27]=m("div",{class:"ws-menu-divider"},null,-1)),m("button",{class:"ws-menu-item",onClick:Ce[16]||(Ce[16]=Je(We=>ce(W.value),["stop"]))},O(C(n)("sidebar.rename")),1),Ce[28]||(Ce[28]=m("div",{class:"ws-menu-divider"},null,-1)),m("button",{class:"ws-menu-item del",onClick:Ce[17]||(Ce[17]=Je(We=>ke(W.value),["stop"]))},O(me.value===W.value.id?C(n)("sidebar.confirm"):C(n)("sidebar.removeWorkspace")),1)],4)):ie("",!0)]))}}),k5=vt(y5,[["__scopeId","data-v-bdcf1ef0"]]);function b5(e){try{const t=xn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function _5(e,t){try{Ln(e,String(t))}catch{}}function w5(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(tS(o),Math.max(s,Math.round(_))):n}const l=te(r(b5(t)??n)),a=te(!1);function c(_){const y=r(_);l.value=y,_5(t,y)}let u=0,d=0,f=null,p=-1;function h(_){if(!a.value)return;const y=_.clientX-u;c(d+(i?-y:y))}function g(){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",g),f.removeEventListener("pointercancel",g)}f=null,p=-1}}function S(_){_.preventDefault(),a.value=!0,u=_.clientX,d=r(l.value),f=_.currentTarget,p=_.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",g),f.addEventListener("pointercancel",g)}return qs(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:S}}const S5=["aria-label"],C5=Ze({__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}=_t(),{width:i,dragging:r,onPointerDown:l}=w5({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ke(i,a=>s("update:width",a)),Ke(r,a=>s("update:dragging",a)),(a,c)=>(x(),$("div",{class:Le(["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]=[m("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,S5))}}),Xk=vt(C5,[["__scopeId","data-v-0d454900"]]),x5={preview:"Preview"},T5={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",comingSoon:"Coming soon…"},M5={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",confirm:"Confirm",cancel:"Cancel",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID ⧉",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Show more ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchClear:"Clear search",searchNoResults:"No matching sessions"},A5={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},E5={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",confirm:"Confirm",cancel:"Cancel",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},$5={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",modelTooltip:"Click to switch model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionTooltip:"Click to cycle permission mode",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",modesTooltip:"Mode: Plan / Goal / Swarm",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},I5={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",steerNow:"Steer now ⌃S",steerTitle:"Inject into the running turn without waiting (Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking"},N5={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"},L5={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",confirm:"Confirm",cancel:"Cancel",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},O5={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},P5={title:"New session",close:"Close (Esc)",cwdLabel:"Working directory",cwdPlaceholder:"Absolute path of the working directory, e.g. /Users/you/project",recentLabel:"Recent directories",titleFieldLabel:"Title",titleFieldPlaceholder:"Optional, named automatically if left blank",create:"Create",cancel:"Cancel",footerHint:"Enter to create · Esc to close"},R5={title:"Sessions",close:"Close",searchPlaceholder:"Search sessions by title…",noWorkspace:"No workspace",emptyNone:"No sessions yet",emptyNoMatch:"No matching sessions",footerHint:"↑↓ to navigate · Enter to switch · Esc to close",justNow:"just now"},D5={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"},B5={title:"Question",step:"Q{current}/{total}",prev:"‹ Prev",next:"Next ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},F5={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",dockQueue:"Queue",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",todoTag:"todos",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",collapse:"Collapse",expand:"Expand"},H5={panelTitle:"Thinking",close:"Close"},W5={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"},U5={},j5={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},q5={searching:"Searching…",noMatch:"No matches"},z5={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",contentType:"Content type",details:"Server details",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",status:"HTTP status",timeout:"Timeout"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},V5={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},sessions:{desc:"Browse & switch sessions"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},K5={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Plan",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"}},G5={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},Y5={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},X5={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},Z5={preview:"预览"},J5={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},Q5={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",confirm:"确认",cancel:"取消",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID ⧉",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"展开更多 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchClear:"清除搜索",searchNoResults:"没有匹配的会话"},eN={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},tN={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"确定撤销?",confirm:"确定",cancel:"取消",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},nN={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",modelTooltip:"点击切换模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionTooltip:"点击循环切换审批模式",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",modesTooltip:"模式:计划 / 目标 / Swarm",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},sN={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",steerNow:"立即插入 ⌃S",steerTitle:"不等当前回合结束,把消息直接插进正在运行的任务(Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},oN={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 后重试"},iN={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",confirm:"确认",cancel:"取消",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},rN={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},lN={title:"新建会话",close:"关闭 (Esc)",cwdLabel:"工作目录",cwdPlaceholder:"工作目录绝对路径,如 /Users/you/project",recentLabel:"最近目录",titleFieldLabel:"标题",titleFieldPlaceholder:"可选,留空则自动命名",create:"新建",cancel:"取消",footerHint:"Enter 新建 · Esc 关闭"},aN={title:"会话",close:"关闭",searchPlaceholder:"按标题搜索会话…",noWorkspace:"无工作区",emptyNone:"暂无会话",emptyNoMatch:"没有匹配的会话",footerHint:"↑↓ 切换 · Enter 进入 · Esc 关闭",justNow:"刚刚"},cN={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},uN={title:"提问",step:"Q{current}/{total}",prev:"‹ 上一",next:"下一 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},dN={tag:"tasks",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",dockQueue:"队列",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",todoTag:"待办",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",collapse:"折叠",expand:"展开"},fN={panelTitle:"思考过程",close:"关闭"},hN={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},pN={},mN={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},gN={searching:"搜索中…",noMatch:"无匹配"},vN={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",contentType:"响应类型",details:"服务端详情",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",status:"HTTP 状态",timeout:"超时设置"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},yN={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},sessions:{desc:"浏览/切换会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},kN={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},bN={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},_N={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},wN={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},SN={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",themeLabel:"Theme",modernDesc:"Bubbles, conversational, softer.",kimiDesc:"Native look: calm, flat.",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},CN={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},xN={title:"Settings",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",permission:{manual:"Manual",auto:"Auto",yolo:"YOLO"},defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Telemetry",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},TN={title:"设置",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",permission:{manual:"手动",auto:"自动",yolo:"全自动"},defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"遥测",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},MN={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",confirmArchive:"Confirm archive?"},AN={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},EN={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"},$N={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},IN={en:{common:x5,app:T5,sidebar:M5,workspace:A5,conversation:E5,status:$5,composer:I5,login:N5,providers:L5,model:O5,newSession:P5,sessions:R5,approval:D5,question:B5,tasks:F5,thinking:H5,diff:W5,fileTree:U5,filePreview:j5,mention:q5,warnings:z5,commands:V5,tools:K5,layout:G5,mobile:Y5,theme:X5,onboarding:SN,settings:xN,header:MN,sideChat:EN},zh:{common:Z5,app:J5,sidebar:Q5,workspace:eN,conversation:tN,status:nN,composer:sN,login:oN,providers:iN,model:rN,newSession:lN,sessions:aN,approval:cN,question:uN,tasks:dN,thinking:fN,diff:hN,fileTree:pN,filePreview:mN,mention:gN,warnings:vN,commands:yN,tools:kN,layout:bN,mobile:_N,theme:wN,onboarding:CN,settings:TN,header:AN,sideChat:$N}},HC=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function NN(){const e=xn(At.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const $n=n6({legacy:!1,locale:NN(),fallbackLocale:"en",messages:IN});function WC(e){$n.global.locale.value=e,Ln(At.locale,e)}const ca=$n.global.t,LN={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"},ON={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function pl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return ON[t]??t}function gf(e){const t=LN[pl(e)];return t?ca(t):e}const PN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="2.5" y="1.5" width="9" height="13" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7.5" x2="11" y2="7.5"/><line x1="5" y1="10" x2="10" y2="10"/></svg>',RN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><polyline points="4,6 6.5,8 4,10"/><line x1="8" y1="10" x2="12" y2="10"/></svg>',Zk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 2.5l3 3-8 8H2.5v-3l8-8z"/><line x1="8.5" y1="4.5" x2="11.5" y2="7.5"/></svg>',DN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M3 12V4.5L8 2l5 2.5V12H3z"/><line x1="6" y1="7" x2="10" y2="7"/><line x1="8" y1="5" x2="8" y2="9"/></svg>',Jk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="6.5" cy="6.5" r="4"/><line x1="9.5" y1="9.5" x2="13.5" y2="13.5"/></svg>',BN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5C3.5 2.5 3.5 5 3.5 6.5S2.5 8 2.5 8s1 0 1 1.5S3.5 13.5 5 13.5"/><path d="M11 2.5c1.5 0 1.5 2.5 1.5 4S13.5 8 13.5 8s-1 0-1 1.5.5 4-1.5 4"/><line x1="8" y1="6" x2="8" y2="10"/><line x1="6.3" y1="6.8" x2="9.7" y2="9.2"/><line x1="9.7" y1="6.8" x2="6.3" y2="9.2"/></svg>',FN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',HN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6"/><path d="M8 2c-2 2-3 3.6-3 6s1 4 3 6"/><path d="M8 2c2 2 3 3.6 3 6s-1 4-3 6"/><line x1="2" y1="8" x2="14" y2="8"/></svg>',Qk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><polyline points="2,4.5 3.5,6 5.5,3"/><polyline points="2,11 3.5,12.5 5.5,9.5"/><line x1="8" y1="4.5" x2="14" y2="4.5"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',WN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 1L3 9h4l-1.5 6 5.5-8h-4l1.5-6z"/></svg>',UN="";function jN(e){switch(pl(e)){case"read":return PN;case"bash":return RN;case"edit":return Zk;case"multi_edit":return Zk;case"write":return DN;case"grep":return Jk;case"search":return Jk;case"glob":return BN;case"ls":return FN;case"web_fetch":return HN;case"todo":return Qk;case"task":return Qk;default:return(e??"").trim().toLowerCase().includes("skill")?WN:UN}}const UC=80;function qN(e,t=UC){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function zN(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function VN(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 qt(e){return typeof e=="string"&&e.length>0?e:void 0}function Vr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function KN(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 om(e){return qt(e.path)??qt(e.file_path)??qt(e.filePath)??qt(e.filename)}const GN=64;function Ag(e,t,n=!1){const s=(o,i=UC)=>n?o.trim():qN(o,i);try{const o=VN(t);if(!n&&zN(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(pl(e)){case"read":{const r=om(o);if(!r)return i();const l=Vr(o.offset)??Vr(o.line_start)??Vr(o.start_line),a=Vr(o.limit)??Vr(o.length),c=Vr(o.line_end)??Vr(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=om(o);return r?s(`${r} ${ca("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=om(o);return r?s(r):i()}case"bash":{const r=qt(o.command)??qt(o.cmd)??qt(o.script);return r?s(r,GN):i()}case"grep":case"search":{const r=qt(o.pattern)??qt(o.query)??qt(o.regex),l=qt(o.path)??qt(o.glob)??qt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=qt(o.pattern)??qt(o.glob)??qt(o.query),l=qt(o.path)??qt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):qt(o.path)?s(qt(o.path)):i()}case"ls":{const r=qt(o.path)??qt(o.dir)??qt(o.directory)??qt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=qt(o.url)??qt(o.uri);return r?s(KN(r)):i()}case"todo":case"task":{const r=qt(o.description)??qt(o.title)??qt(o.prompt)??qt(o.name)??qt(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(ca("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function YN(e){try{switch(pl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ca("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 ca("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ca("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const XN=1e6,eb=5e3;function tb(e){if(e==="")return[];const t=e.split(`
39
+ `);return t.at(-1)===""&&t.pop(),t}function ZN(e,t){const n=tb(e),s=tb(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>eb||i>eb||(o+1)*(i+1)>XN)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 JN(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 jC(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 qC(e){const t=pl(e.name);if(t!=="edit"&&t!=="write")return null;const n=jC(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:ZN(s,o)}return null}function QN(e){const t=jC(e);return t&&typeof t.path=="string"?t.path:void 0}function e8(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const t8=["title"],n8=["title"],s8=["src","alt"],o8=["src"],i8=["src"],r8={class:"car",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},l8=["points"],a8=["innerHTML"],c8={class:"a"},u8=["title"],d8={class:"rt"},f8=["title"],h8={key:1,class:"chip"},p8={key:2,class:"spin",role:"status","aria-label":"running"},m8={key:4,class:"tm"},g8={key:0,class:"bb"},v8={key:0,class:"bb-summary"},y8={key:1,class:"bb-empty"},k8=!1,b8=Ze({__name:"ToolCall",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=F(()=>n.tool.status==="running"&&/^bash$/i.test(n.tool.name)),i=F(()=>!!n.tool.output&&n.tool.output.length>0),r=F(()=>i.value||o.value),l=te(n.tool.defaultExpanded===!0&&r.value),a=F(()=>{const M=pl(n.tool.name);return M==="edit"||M==="write"});function c(){if(a.value&&n.toolDiffPanel){s("openToolDiff",n.tool.id);return}r.value&&(l.value=!l.value)}Ke(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const u=()=>n.tool.status==="error"?"✕":"✓",d=()=>gf(n.tool.name),f=()=>jN(n.tool.name),p=()=>Ag(n.tool.name,n.tool.arg),h=()=>Ag(n.tool.name,n.tool.arg,!0),g=()=>{const M=y.value;if(M&&n.tool.status!=="error"){const{added:L,removed:R}=JN(M);if(L||R)return`+${L} −${R}`}return YN({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status})},S=()=>n.tool.status==="error",_=F(()=>n.tool.status==="ok"?n.tool.media:void 0),y=F(()=>qC(n.tool)),b=F(()=>n.tool.name==="ExitPlanMode"),v=F(()=>b.value?n.tool.planPath:void 0),w=F(()=>{const M=v.value;return M?M.split(/[\\/]+/).pop()||M:""});function N(){v.value&&s("openFile",{path:v.value})}const E=F(()=>k8);function k(M){return M.split(/[\\/]+/).pop()||M}function A(M){return M<1024?`${M} B`:M<1024*1024?`${(M/1024).toFixed(1)} KB`:`${(M/1024/1024).toFixed(1)} MB`}const I=F(()=>{const M=_.value;if(!M)return"";const L=[M.path?k(M.path):gf(n.tool.name)];return M.mimeType&&L.push(M.mimeType),M.bytes!==void 0&&L.push(A(M.bytes)),M.dimensions&&L.push(M.dimensions),L.join(" · ")});function P(){const M=_.value;M?.kind==="image"&&s("openMedia",M)}return(M,L)=>_.value?(x(),$("div",{key:0,class:Le(["media-tool",{mob:e.mobile}])},[m("div",{class:"media-title",title:_.value.path||I.value},O(I.value),9,t8),_.value.kind==="image"?(x(),$("button",{key:0,type:"button",class:"media-image-button",title:_.value.path||I.value,onClick:P},[m("img",{class:"media-image",src:_.value.url,alt:_.value.path?k(_.value.path):I.value,loading:"lazy"},null,8,s8)],8,n8)):_.value.kind==="video"?(x(),$("video",{key:1,class:"media-video",src:_.value.url,controls:"",preload:"metadata"},null,8,o8)):(x(),$("audio",{key:2,class:"media-audio",src:_.value.url,controls:""},null,8,i8))],2)):(x(),$("div",{key:1,class:Le(["box",{open:l.value,err:S(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[m("div",{class:"bh",onClick:c},[(x(),$("svg",r8,[m("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,l8)])),f()?(x(),$("span",{key:0,class:"gl",innerHTML:f(),"aria-hidden":"true"},null,8,a8)):ie("",!0),m("span",c8,O(d()),1),l.value?ie("",!0):(x(),$("span",{key:1,class:"p",title:p()},O(p()),9,u8)),m("span",d8,[E.value?(x(),$("button",{key:0,class:"plan-link",type:"button",title:v.value,onClick:Je(N,["stop"])},"📄 "+O(w.value),9,f8)):ie("",!0),g()?(x(),$("span",h8,O(g()),1)):ie("",!0),e.tool.status==="running"?(x(),$("span",p8)):(x(),$("span",{key:3,class:Le(e.tool.status==="ok"?"ok":"er")},O(u()),3)),e.tool.timing&&e.tool.name!=="bash"?(x(),$("span",m8,O(e.tool.timing),1)):ie("",!0)])]),l.value?(x(),$("div",g8,[h()?(x(),$("div",v8,O(h()),1)):ie("",!0),i.value?ie("",!0):(x(),$("div",y8,"Waiting for output…")),(x(!0),$(Pe,null,Xe(e.tool.output??[],(R,B)=>(x(),$("div",{key:B},O(R),1))),128))])):ie("",!0)],2))}}),sd=vt(b8,[["__scopeId","data-v-4b9fd75b"]]);var _8=Object.create,rv=Object.defineProperty,w8=Object.getOwnPropertyDescriptor,zC=Object.getOwnPropertyNames,S8=Object.getPrototypeOf,C8=Object.prototype.hasOwnProperty,VC=(e,t)=>function(){return t||(0,e[zC(e)[0]])((t={exports:{}}).exports,t),t.exports},KC=e=>{let t={};for(var n in e)rv(t,n,{get:e[n],enumerable:!0});return t},x8=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=zC(t),i=0,r=o.length,l;i<r;i++)l=o[i],!C8.call(e,l)&&l!==n&&rv(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=w8(t,l))||s.enumerable});return e},GC=(e,t,n)=>(n=e!=null?_8(S8(e)):{},x8(rv(n,"default",{value:e,enumerable:!0}),e));function T8(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 M8(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function A8(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 E8(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
40
+ `:`<hr class="footnotes-sep">
41
+ `)+`<section class="footnotes">
42
+ <ol class="footnotes-list">
43
+ `}function $8(){return`</ol>
44
+ </section>
45
+ `}function I8(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 N8(){return`</li>
46
+ `}function L8(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 O8(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=A8,e.renderer.rules.footnote_block_open=E8,e.renderer.rules.footnote_block_close=$8,e.renderer.rules.footnote_open=I8,e.renderer.rules.footnote_close=N8,e.renderer.rules.footnote_anchor=L8,e.renderer.rules.footnote_caption=M8,e.renderer.rules.footnote_anchor_name=T8;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 g=new l.Token("footnote_reference_open","",1);g.meta={label:h},g.level=l.level++,l.tokens.push(g);const S=l.bMarks[a],_=l.tShift[a],y=l.sCount[a],b=l.parentType,v=p,w=l.sCount[a]+p-(l.bMarks[a]+l.tShift[a]);let N=w;for(;p<f;){const k=l.src.charCodeAt(p);if(n(k))k===9?N+=4-N%4:N++;else break;p++}l.tShift[a]=p-v,l.sCount[a]=N-w,l.bMarks[a]=v,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=b,l.blkIndent-=4,l.tShift[a]=_,l.sCount[a]=y,l.bMarks[a]=S;const E=new l.Token("footnote_reference_close","",-1);return E.level=--l.level,l.tokens.push(E),!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 g=l.push("footnote_ref","",0);g.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 g=l.push("footnote_ref","",0);g.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,g=p.length;h<g;h++){const S=new l.Token("footnote_open","",1);if(S.meta={id:h,label:p[h].label},l.tokens.push(S),p[h].tokens){a=[];const b=new l.Token("paragraph_open","p",1);b.block=!0,a.push(b);const v=new l.Token("inline","",0);v.children=p[h].tokens,v.content=p[h].content,a.push(v);const w=new l.Token("paragraph_close","p",-1);w.block=!0,a.push(w)}else p[h].label&&(a=f[`:${p[h].label}`]);a&&(l.tokens=l.tokens.concat(a));let _;l.tokens[l.tokens.length-1].type==="paragraph_close"?_=l.tokens.pop():_=null;const y=p[h].count>0?p[h].count:1;for(let b=0;b<y;b++){const v=new l.Token("footnote_anchor","",0);v.meta={id:h,subId:b,label:p[h].label},l.tokens.push(v)}_&&l.tokens.push(_),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function P8(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 R8(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 D8=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function B8(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(D8,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function F8(e){e.inline.ruler.after("emphasis","sub",B8)}const H8=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function W8(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(H8,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function U8(e){e.inline.ruler.after("emphasis","sup",W8)}var j8=VC({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,S){S=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},S),g.core.ruler.after("inline","github-task-lists",function(_){for(var y=_.tokens,b=0,v=2;v<y.length;v++)o(y,v)&&(i(y[v],b,S,_.Token),b+=1,n(y[v-2],"class",S.liClass),n(y[s(y,v-2)],"class",S.ulClass))})};function n(g,S,_){var y=g.attrIndex(S),b=[S,_];y<0?g.attrPush(b):g.attrs[y]=b}function s(g,S){for(var _=g[S].level-1,y=S-1;y>=0;y--)if(g[y].level===_)return y;return-1}function o(g,S){return d(g[S])&&f(g[S-1])&&p(g[S-2])&&h(g[S])}function i(g,S,_,y){var b=_.idPrefix+S;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(b,y)),g.children.push(a(y)),g.children.unshift(r(g,b,_,y)),_.divWrap&&(g.children.unshift(c(_,y)),g.children.push(u(y)))}function r(g,S,_,y){var b=new y("checkbox_input","input",0);return b.attrs=[["type","checkbox"],["id",S]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&b.attrs.push(["checked","true"]),_.disabled===!0&&b.attrs.push(["disabled","true"]),b}function l(g,S){var _=new S("label_open","label",1);return _.attrs=[["for",g]],_}function a(g){return new g("label_close","label",-1)}function c(g,S){var _=new S("checkbox_open","div",0);return _.attrs=[["class",g.divClass]],_}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function p(g){return g.type==="list_item_open"}function h(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),q8=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))),z8=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),im;const V8=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]]),K8=(im=String.fromCodePoint)!==null&&im!==void 0?im: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 G8(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=V8.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 Y8=32;var cr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(cr||(cr={}));function Eg(e){return e>=ts.ZERO&&e<=ts.NINE}function X8(e){return e>=ts.UPPER_A&&e<=ts.UPPER_F||e>=ts.LOWER_A&&e<=ts.LOWER_F}function Z8(e){return e>=ts.UPPER_A&&e<=ts.UPPER_Z||e>=ts.LOWER_A&&e<=ts.LOWER_Z||Eg(e)}function J8(e){return e===ts.EQUALS||Z8(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 rr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(rr||(rr={}));var Q8=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=rr.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)|Y8)===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(Eg(s)||X8(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(Eg(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===rr.Strict)return 0;return this.emitCodePoint(G8(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&cr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=eL(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===rr.Attribute&&(o===0||J8(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&cr.VALUE_LENGTH)>>14,o!==0){if(i===ts.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==rr.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]&cr.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]&~cr.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!==rr.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 YC(e){let t="";const n=new Q8(e,s=>t+=K8(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 eL(e,t,n,s){const o=(t&cr.BRANCH_LENGTH)>>7,i=t&cr.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 tL=YC(q8);YC(z8);function lv(e,t=rr.Legacy){return tL(e,t)}var nL=GC(j8());const nb={};function sL(e){let t=nb[e];if(t)return t;t=nb[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 mh(e,t){typeof t!="string"&&(t=mh.defaultChars);const n=sL(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})}mh.defaultChars=";/?:@&=+$,#";mh.componentChars="";var $g=mh;const sb={};function oL(e){let t=sb[e];if(t)return t;t=sb[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 gh(e,t,n){typeof t!="string"&&(n=t,t=gh.defaultChars),typeof n>"u"&&(n=!0);const s=oL(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}gh.defaultChars=";/?:@&=+$,-_.!~*'()#";gh.componentChars="-_.!~*'()";var XC=gh;function av(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 vf(){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 iL=/^([a-z0-9.+-]+:)/i,rL=/:[0-9]*$/,lL=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,aL=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
47
+ `," "]),cL=["'"].concat(aL),ob=["%","/","?",";","#"].concat(cL),ib=["/","?","#"],uL=255,rb=/^[+a-z0-9A-Z_-]{0,63}$/,dL=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,lb={javascript:!0,"javascript:":!0},ab={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function fL(e,t){if(e&&e instanceof vf)return e;const n=new vf;return n.parse(e,t),n}vf.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=lL.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=iL.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&&lb[r])&&(i=i.substr(2),this.slashes=!0)),!lb[r]&&(o||r&&!ab[r])){let c=-1;for(let h=0;h<ib.length;h++)s=i.indexOf(ib[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<ob.length;h++)s=i.indexOf(ob[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 g=0,S=h.length;g<S;g++){const _=h[g];if(_&&!_.match(rb)){let y="";for(let b=0,v=_.length;b<v;b++)_.charCodeAt(b)>127?y+="x":y+=_[b];if(!y.match(rb)){const b=h.slice(0,g),v=h.slice(g+1),w=_.match(dL);w&&(b.push(w[1]),v.unshift(w[2])),v.length&&(i=v.join(".")+i),this.hostname=b.join(".");break}}}}this.hostname.length>uL&&(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),ab[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};vf.prototype.parseHost=function(e){let t=rL.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 cv=fL,ZC=KC({decode:()=>$g,encode:()=>XC,format:()=>av,parse:()=>cv}),JC=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,QC=/[\0-\x1F\x7F-\x9F]/,hL=/[\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]/,ex=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,pL=/[\$\+<->\^`\|~\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]/,tx=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,mL=KC({Any:()=>JC,Cc:()=>QC,Cf:()=>hL,P:()=>ex,S:()=>pL,Z:()=>tx}),gL=Object.defineProperty,nx=e=>{let t={};for(var n in e)gL(t,n,{get:e[n],enumerable:!0});return t},vL=nx({arrayReplaceAt:()=>CL,assign:()=>wL,countLines:()=>An,escapeHtml:()=>LL,escapeRE:()=>PL,fromCodePoint:()=>Yc,has:()=>_L,isMdAsciiPunct:()=>bf,isPunctChar:()=>kf,isPunctCode:()=>Ig,isSpace:()=>SL,isString:()=>kL,isValidEntityCode:()=>yh,isWhiteSpace:()=>Gc,lib:()=>RL,mdurl:()=>ZC,normalizeReference:()=>vh,ucmicro:()=>yf,unescapeAll:()=>Xc,unescapeMd:()=>AL});const yf=mL;function yL(e){return Object.prototype.toString.call(e)}function kL(e){return yL(e)==="[object String]"}const bL=Object.prototype.hasOwnProperty;function _L(e,t){return bL.call(e,t)}function wL(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 SL(e){return e===9||e===32}function Gc(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 kf(e){return yf.P.test(e)||yf.S.test(e)}const cb=new Map;function Ig(e){if(bf(e))return!0;const t=cb.get(e);if(t!==void 0)return t;const n=kf(String.fromCharCode(e));return cb.set(e,n),n}function bf(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function vh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function CL(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function yh(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Yc(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 sx=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,xL=new RegExp(`${sx.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),TL=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function ML(e,t){if(t.charCodeAt(0)===35&&TL.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return yh(s)?Yc(s):e}const n=lv(e);return n!==e?n:e}function AL(e){return e.includes("\\")?e.replace(sx,"$1"):e}function Xc(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(xL,(t,n,s)=>n||ML(t,s))}const EL=/[&<>"]/,$L=/[&<>"]/g,IL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function NL(e){return IL[e]}function LL(e){return EL.test(e)?e.replace($L,NL):e}const OL=/[.?*+^$[\]\\(){}|-]/g;function PL(e){return e.replace(OL,"\\$&")}const RL={mdurl:ZC,ucmicro:yf};function An(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
48
+ `,n+1))!==-1;)t++;return t}const DL=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,BL=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,FL=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,uv=["references","footnotes","abbreviations","abbr","abbrs"],dv=Symbol.for("markdown-it-ts.global-state"),fv=Object.prototype.hasOwnProperty;function ub(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Fo(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function hr(e){if(Array.isArray(e))return e.map(t=>hr(t));if(Fo(e)){const t={};for(const n of Object.keys(e))t[n]=hr(e[n]);return t}return e}function _f(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Fo(e)?Object.keys(e):[]}function Ng(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(!Ng(e[n],t[n]))return!1;return!0}if(Fo(e)||Fo(t)){if(!Fo(e)||!Fo(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(!fv.call(t,o)||!Ng(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function ox(e,t){if(Array.isArray(e))return e[Number(t)];if(Fo(e))return e[t]}function HL(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=hr(t[n]);return e}if(Fo(e)&&Fo(t)){for(const n of Object.keys(e))fv.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=hr(t[n]);return e}return hr(t)}function WL(e,t,n){const s=n.ownedKeys??[],o=e[t];if(Fo(o)||Array.isArray(o)){const i=new Set(_f(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=hr(ox(n.value,r)):delete o[r];!n.existed&&_f(o).length===0&&delete e[t];return}n.existed?e[t]=hr(n.value):delete e[t]}function hv(e){const t=e[dv];return ub(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&ub(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function UL(e,t){Object.defineProperty(e,dv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function ps(e){return e?DL.test(e)?"footnote-definition":BL.test(e)?"abbreviation-definition":FL.test(e)?"reference-definition":null:null}function fu(e){return hv(e)?.reason??null}function ua(e,t,n){if(fu(e)&&Pi(e),!t)return n();pv(e,t);try{const s=n();return mv(e),s}catch(s){throw Pi(e),s}}function pv(e,t){try{Pi(e);const n={};for(const s of uv)n[s]=fv.call(e,s)?{existed:!0,value:hr(e[s])}:{existed:!1};UL(e,{reason:t,snapshot:n})}catch{}}function mv(e){const t=hv(e);if(t)for(const n of uv){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!Fo(o)&&!Array.isArray(o))continue;const i=new Set(_f(s.existed?s.value:void 0));s.ownedKeys=_f(o).filter(r=>i.has(r)?!Ng(o[r],ox(s.value,r)):!0)}}function Pi(e){const t=hv(e);if(t){for(const n of uv){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){WL(e,n,s);continue}s.existed?e[n]=HL(e[n],s.value):delete e[n]}delete e[dv]}}const Lg=Symbol.for("markdown-it-ts.diagnostics");function kh(e,t){if(e)try{const n=e[Lg];if(n&&typeof n=="object")return n;if(!t)return;const s={};return Object.defineProperty(e,Lg,{value:s,enumerable:!1,configurable:!0,writable:!0}),s}catch{return}}function bi(e){return kh(e,!1)}function jL(e){if(e)try{delete e[Lg]}catch{}}function Qs(e){jL(e)}function is(e,t){const n=kh(e,!0);n&&(n.strategy=t)}function rm(e,t){const n=kh(e,!0);n&&(n.chunk=t)}function ix(e,t){const n=kh(e,!0);n&&(n.unbounded=t)}function qL(e){const t={};e=e||{},t.src_Any=JC.source,t.src_Cc=QC.source,t.src_Z=tx.source,t.src_P=ex.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 Og(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function bh(e){return Object.prototype.toString.call(e)}function zL(e){return bh(e)==="[object String]"}function VL(e){return bh(e)==="[object Object]"}function KL(e){return bh(e)==="[object RegExp]"}function db(e){return bh(e)==="[object Function]"}function GL(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const rx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function YL(e){return Object.keys(e||{}).reduce(function(t,n){return t||rx.hasOwnProperty(n)},!1)}const XL={"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}}},ZL="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]",JL="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function QL(e){e.__index__=-1,e.__text_cache__=""}function eO(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function fb(){return function(e,t){t.normalize(e)}}function wf(e){const t=e.re=qL(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(ZL),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,VL(a)){KL(a.validate)?c.validate=eO(a.validate):db(a.validate)?c.validate=a.validate:i(l,a),db(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=fb();return}if(zL(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:fb()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(GL).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"),QL(e)}function tO(e,t){const n=e.__index__,s=e.__last_index__,o=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=o,this.text=o,this.url=o}function Pg(e,t){const n=new tO(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function uo(e,t){if(!(this instanceof uo))return new uo(e,t);t||YL(e)&&(t=e,e={}),this.__opts__=Og({},rx,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Og({},XL,e),this.__compiled__={},this.__tlds__=JL,this.__tlds_replaced__=!1,this.re={},wf(this)}uo.prototype.add=function(t,n){return this.__schemas__[t]=n,wf(this),this};uo.prototype.set=function(t){return this.__opts__=Og(this.__opts__,t),this};uo.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,o,i,r,l,a,c,u;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],a.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(r=s.index+s[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(r=o.index+o[1].length,l=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=l))),this.__index__>=0};uo.prototype.pretest=function(t){return this.re.pretest.test(t)};uo.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};uo.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Pg(this,s)),s=this.__last_index__);let o=s?t.slice(s):t;for(;this.test(o);)n.push(Pg(this,s)),o=o.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};uo.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);return s?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s,Pg(this,0)):null};uo.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(),wf(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,wf(this),this)};uo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};uo.prototype.onCompile=function(){};var lx=uo,nO=VC({"../../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"},g=35,S=Math.floor,_=String.fromCharCode;function y(B){throw new RangeError(h[B])}function b(B,U){const K=[];let V=B.length;for(;V--;)K[V]=U(B[V]);return K}function v(B,U){const K=B.split("@");let V="";K.length>1&&(V=K[0]+"@",B=K[1]),B=B.replace(p,".");const se=b(B.split("."),U).join(".");return V+se}function w(B){const U=[];let K=0;const V=B.length;for(;K<V;){const se=B.charCodeAt(K++);if(se>=55296&&se<=56319&&K<V){const Y=B.charCodeAt(K++);(Y&64512)==56320?U.push(((se&1023)<<10)+(Y&1023)+65536):(U.push(se),K--)}else U.push(se)}return U}const N=B=>String.fromCodePoint(...B),E=function(B){return B>=48&&B<58?26+(B-48):B>=65&&B<91?B-65:B>=97&&B<123?B-97:36},k=function(B,U){return B+22+75*(B<26)-((U!=0)<<5)},A=function(B,U,K){let V=0;for(B=K?S(B/700):B>>1,B+=S(B/U);B>g*26>>1;V+=36)B=S(B/g);return S(V+(g+1)*B/(B+38))},I=function(B){const U=[],K=B.length;let V=0,se=128,Y=72,G=B.lastIndexOf("-");G<0&&(G=0);for(let ee=0;ee<G;++ee)B.charCodeAt(ee)>=128&&y("not-basic"),U.push(B.charCodeAt(ee));for(let ee=G>0?G+1:0;ee<K;){const Se=V;for(let Ie=1,de=36;;de+=36){ee>=K&&y("invalid-input");const we=E(B.charCodeAt(ee++));we>=36&&y("invalid-input"),we>S((2147483647-V)/Ie)&&y("overflow"),V+=we*Ie;const me=de<=Y?1:de>=Y+26?26:de-Y;if(we<me)break;const $e=36-me;Ie>S(2147483647/$e)&&y("overflow"),Ie*=$e}const ae=U.length+1;Y=A(V-Se,ae,Se==0),S(V/ae)>2147483647-se&&y("overflow"),se+=S(V/ae),V%=ae,U.splice(V++,0,se)}return String.fromCodePoint(...U)},P=function(B){const U=[];B=w(B);const K=B.length;let V=128,se=0,Y=72;for(const Se of B)Se<128&&U.push(_(Se));const G=U.length;let ee=G;for(G&&U.push("-");ee<K;){let Se=2147483647;for(const Ie of B)Ie>=V&&Ie<Se&&(Se=Ie);const ae=ee+1;Se-V>S((2147483647-se)/ae)&&y("overflow"),se+=(Se-V)*ae,V=Se;for(const Ie of B)if(Ie<V&&++se>2147483647&&y("overflow"),Ie===V){let de=se;for(let we=36;;we+=36){const me=we<=Y?1:we>=Y+26?26:we-Y;if(de<me)break;const $e=de-me,J=36-me;U.push(_(k(me+$e%J,0))),de=S($e/J)}U.push(_(k(de,0))),Y=A(se,ae,ee===G),se=0,++ee}++se,++V}return U.join("")},R={version:"2.3.1",ucs2:{decode:w,encode:N},decode:I,encode:P,toASCII:function(B){return v(B,function(U){return f.test(U)?"xn--"+P(U):U})},toUnicode:function(B){return v(B,function(U){return d.test(U)?I(U.slice(4).toLowerCase()):U})}};t.exports=R})}),ax=GC(nO()),as=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}};function gv(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=Xc(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=Xc(e.slice(t,o)),i.pos=o,i.ok=!0),i}var cx=gv;const Ad=-2;function sO(e,t,n){let s=t+1;for(;s<n;){const o=e.charCodeAt(s);if(o===93)return s;if(o===92){s+=2;continue}if(o===96||o===60||o===33&&s+1<n&&e.charCodeAt(s+1)===91||o===91)return Ad;s++}return-1}function vv(e,t,n){let s=1,o=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.__mdtsLinkLabelNoCloseFrom;if(typeof u=="number"&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.__mdtsLinkLabelNoCloseFrom=t+1,-1;const f=sO(l,t,a);if(f!==Ad)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 Sf=vv;function yv(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+=Xc(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+=Xc(e.slice(t,i)),r}var ux=yv;function _h(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function kv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function oO(e,t,n){const s=_h(e,t),o=[t,n];s<0?kv(e,o):e.attrs[s]=o}function iO(e,t){const n=_h(e,t);return n>=0?e.attrs[n][1]:null}function rO(e,t,n){const s=_h(e,t);s<0?kv(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var lO=nx({attrGet:()=>iO,attrIndex:()=>_h,attrJoin:()=>rO,attrPush:()=>kv,attrSet:()=>oO,parseLinkDestination:()=>gv,parseLinkLabel:()=>vv,parseLinkTitle:()=>yv});function aO(e){return e.includes("\r")||e.includes("\0")}function dx(e){return typeof e=="string"?e:e.toString()}function cO(e){if(e.inlineMode){const t=new as("inline","",0);t.content=dx(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 uO=/^([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])?)*)$/,dO=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function fO(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(dO.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(uO.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 hO=fO;function pO(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(`
49
+ `)&&(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 mO=pO;function hb(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 gO(e){const t=e.tokens_meta,n=e.tokens_meta.length;hb(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&hb(t[s].delimiters)}var vO=gO;function yO(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 pb(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 kO(e){const t=e.tokens_meta,n=e.tokens_meta.length;pb(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&pb(e,t[s].delimiters)}const mb={tokenize:yO,postProcess:kO};function fx(e){return lv(e)}function bv(e){return e>=48&&e<=57}function bO(e){const t=e|32;return bv(e)||t>=97&&t<=102}function hx(e){const t=e|32;return t>=97&&t<=122}function _O(e){return hx(e)||bv(e)}function wO(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?bO(l):bv(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function SO(e,t,n){let s=t+1;if(s>=n||!hx(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&_O(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 fx(o)!==o?o:null}function CO(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=wO(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=yh(i)?Yc(i):Yc(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=SO(e.src,n,s);if(o){const i=fx(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 xO=CO;const px=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Rg=new Array(128),mx=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Rg[e]=`\\${t}`,mx[e]=px[e]?t:Rg[e]}function gb(e,t,n){e.pending&&e.pushPending();const s=new as("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 TO(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):(gb(e,mx[i],Rg[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 gb(e,i<256&&px[i]?r:l,l),e.pos=n+1,!0}var MO=TO;function AO(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 EO=AO;const gx=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,vx="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",$O=new RegExp(`^(?:${gx}|${vx}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),IO=new RegExp(`^(?:${gx}|${vx})`);function yx(e){return e===32||e===9||e===10||e===12||e===13}function NO(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||yx(t)}function LO(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(!yx(n))return!1}return!1}function OO(e){const t=e|32;return t>=97&&t<=122}function PO(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&&!OO(i))return!1;const r=o.slice(s).match($O);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,NO(l)&&e.linkLevel++,LO(l)&&e.linkLevel--}return e.pos+=l.length,!0}var RO=PO;function DO(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=Sf(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=cx(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=ux(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=Sf(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[vh(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(p,h);const g=[];e.md.inline.parse(s,e.md,e.env,g);const S=e.push("image","img",0);S.attrs=[["src",u],["alt",""]],S.children=g,S.content=s,a&&S.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var BO=DO;function FO(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=Sf(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=cx(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=ux(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=Sf(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[vh(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=p;const g=e.push("link_open","a",1),S=[["href",r]];g.attrs=S,l&&S.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=d,!0}var HO=FO;function kx(e){const t=e|32;return t>=97&&t<=122}function WO(e){return e>=48&&e<=57}function UO(e){return kx(e)||WO(e)||e===43||e===45||e===46}function jO(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&UO(e.charCodeAt(t));)t--;return t++,t>=e.length||!kx(e.charCodeAt(t))?null:e.slice(t)}function qO(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 zO(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=jO(e.pending);if(!o)return!1;const i=qO(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 VO(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 KO=VO;function GO(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 vb(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 YO(e){const t=e.delimiters;vb(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&vb(e,n[s].delimiters)}const yb={tokenize:GO,postProcess:YO};function kb(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 XO(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||kb(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!kb(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var ZO=XO;function _v(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function JO(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 QO(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 bx(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:_v(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function da(e,t,n,s,o,i){const r=bx(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=QO(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=_v()}function eP(e){const t=bx(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=JO(o.samples)}return t.completedAt=_v(),t}var bb=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}},_x=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;maxNesting;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.maxNesting=t.options.maxNesting}pushPending(){const e=new as("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 as(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 as(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=Gc(l),u=Gc(a),d=Ig(l),f=Ig(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}}};_x.prototype.Token=as;function tP(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 wx(e){for(let t=0;t<e.length;t++)if(tP(e.charCodeAt(t)))return!1;return!0}var nP=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new bb,this.ruler2=new bb,this.ruler.push("text",ZO),this.ruler.push("linkify",zO),this.ruler.push("newline",KO),this.ruler.push("escape",MO),this.ruler.push("backticks",mO),this.ruler.push("strikethrough",yb.tokenize),this.ruler.push("emphasis",mb.tokenize),this.ruler.push("link",HO),this.ruler.push("image",BO),this.ruler.push("autolink",hO),this.ruler.push("html_inline",RO),this.ruler.push("entity",xO),this.ruler2.push("balance_pairs",vO),this.ruler2.push("strikethrough",yb.postProcess),this.ruler2.push("emphasis",mb.postProcess),this.ruler2.push("fragments_join",EO),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(da(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(da(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()&&wx(e)){const a=new as("text","",0);a.content=e,s.push(a);return}const o=new _x(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();da(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 sP(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&&wx(i.content)){const r=new as("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const oP=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,iP=/[0-9a-z]/i;function rP(e){return/^<a[>\s]/i.test(e)}function lP(e){return/^<\/a\s*>/i.test(e)}function aP(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(!oP.test(s)||!iP.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 cP(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"&&(rP(l.content)&&i>0&&i--,lP(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=>aP(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],g=e.md.normalizeLink(h.url);if(!e.md.validateLink(g))continue;let S=h.text;h.schema?h.schema==="mailto:"&&!/^mailto:/i.test(S)?S=e.md.normalizeLinkText(`mailto:${S}`).replace(/^mailto:/,""):S=e.md.normalizeLinkText(S):S=e.md.normalizeLinkText(`http://${S}`).replace(/^http:\/\//,"");const _=h.index;if(_>f){const w=new as("text","",0);w.content=a.slice(f,_),w.level=d,u.push(w)}const y=new as("link_open","a",1);y.attrs=[["href",g]],y.level=d++,y.markup="linkify",y.info="auto",u.push(y);const b=new as("text","",0);b.content=S,b.level=d,u.push(b);const v=new as("link_close","a",-1);v.level=--d,v.markup="linkify",v.info="auto",u.push(v),f=h.lastIndex}if(f!==0){if(f<a.length){const p=new as("text","",0);p.content=a.slice(f),p.level=d,u.push(p)}o.splice(r,1,...u)}}}}const uP=/\r\n?|\n/g,dP=/\0/g;function fP(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(uP,`
50
+ `)),s&&(o=o.replace(dP,"�")),e.src=o}const Sx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,hP=/\((?:c|tm|r)\)/i,pP=/\((c|tm|r)\)/gi,mP={c:"©",r:"®",tm:"™"};function gP(e,t){return mP[t.toLowerCase()]}function vP(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(pP,gP)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function yP(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&Sx.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 kP(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(""):"");hP.test(s)&&vP(n.children||[]),Sx.test(s)&&yP(n.children||[])}}var bP=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 _P=/['"]/,_b=/['"]/g,wb="’";function od(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function wP(e,t){let n;const s=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){_b.lastIndex=c;const d=_b.exec(a);if(!d)break;let f=!0,p=!0;c=d.index+1;const h=d[0]==="'";let g=32;if(d.index-1>=0)g=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){g=e[n].content.charCodeAt(e[n].content.length-1);break}let S=32;if(c<u)S=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){S=e[n].content.charCodeAt(0);break}const _=bf(g)||kf(String.fromCharCode(g)),y=bf(S)||kf(String.fromCharCode(S)),b=Gc(g),v=Gc(S);if(v?f=!1:y&&(b||_||(f=!1)),b?p=!1:_&&(v||y||(p=!1)),S===34&&d[0]==='"'&&g>=48&&g<=57&&(p=f=!1),f&&p&&(f=_,p=y),!f&&!p){h&&(r.content=od(r.content,d.index,wb));continue}if(p)for(n=s.length-1;n>=0;n--){let w=s[n];if(s[n].level<l)break;if(w.single===h&&s[n].level===l){w=s[n];let N,E;h?(N=o[2]||"‘",E=o[3]||"’"):(N=o[0]||"“",E=o[1]||"”"),r.content=od(r.content,d.index,E),e[w.token].content=od(e[w.token].content,w.pos,N),c+=E.length-1,w.token===i&&(c+=N.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=od(r.content,d.index,wb))}}}function SP(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("");!_P.test(s)||!n.children||wP(n.children,e)}}function CP(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 xP=/^(?:vbscript|javascript|file|data):/,TP=/^data:image\/(?:gif|png|jpeg|webp);/,Cx=["http:","https:","mailto:"];function xx(e){const t=e.trim().toLowerCase();return xP.test(t)?TP.test(t):!0}function Tx(e){const t=cv(e,!0);if(t.hostname&&(!t.protocol||Cx.includes(t.protocol)))try{t.hostname=ax.default.toASCII(t.hostname)}catch{}return XC(av(t))}function Mx(e){const t=cv(e,!0);if(t.hostname&&(!t.protocol||Cx.includes(t.protocol)))try{t.hostname=ax.default.toUnicode(t.hostname)}catch{}return $g(av(t),`${$g.defaultChars}%`)}function MP(e){switch(e){case 9:case 32:return!0}return!1}function AP(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=[],g=[],S=[],_=e.md.block.ruler.getRulesForState(e,"blockquote"),y=e.parentType;e.parentType="blockquote";let b=!1,v;for(v=t;v<n;v++){const A=a[v]<e.blkIndent;if(u=i[v]+l[v],d=r[v],u>=d)break;if(o.charCodeAt(u++)===62&&!A){let P=a[v]+1,M,L;o.charCodeAt(u)===32?(u++,P++,L=!1,M=!0):o.charCodeAt(u)===9?(M=!0,(c[v]+P)%4===3?(u++,P++,L=!1):L=!0):M=!1;let R=P;for(p.push(i[v]),i[v]=u;u<d;){const B=o.charCodeAt(u);if(MP(B))B===9?R+=4-(R+c[v]+(L?1:0))%4:R++;else break;u++}b=u>=d,h.push(c[v]),c[v]=a[v]+1+(M?1:0),g.push(a[v]),a[v]=R-P,S.push(l[v]),l[v]=u-i[v];continue}if(b)break;let I=!1;for(let P=0,M=_.length;P<M;P++)if(_[P](e,v,n,!0)){I=!0;break}if(I){e.lineMax=v,e.blkIndent!==0&&(p.push(i[v]),h.push(c[v]),S.push(l[v]),g.push(a[v]),a[v]-=e.blkIndent);break}p.push(i[v]),h.push(c[v]),S.push(l[v]),g.push(a[v]),a[v]=-1}const w=e.blkIndent;e.blkIndent=0;const N=e.push("blockquote_open","blockquote",1);N.markup=">";const E=[t,0];N.map=E,e.md.block.tokenize(e,t,v);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=f,e.parentType=y,E[1]=e.line;for(let A=0;A<S.length;A++)i[A+t]=p[A],l[A+t]=S[A],a[A+t]=g[A],c[A+t]=h[A];return e.blkIndent=w,!0}function EP(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)}
51
+ `,i.map=[t,e.line],!0}function $P(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 Sb=["","h1","h2","h3","h4","h5","h6"],Cb=["","#","##","###","####","#####","######"];function xb(e){switch(e){case 9:case 32:return!0}return!1}function IP(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&&!xb(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&xb(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const p=e.push("heading_open",Sb[d],1);p.markup=Cb[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 g=e.push("heading_close",Sb[d],-1);return g.markup=Cb[d],!0}function NP(e){switch(e){case 9:case 32:return!0}return!1}function LP(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&&!NP(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 Dl=[[/^<(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(`${IO.source}\\s*$`),/^$/,!1]];function OP(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<Dl.length&&!Dl[l][0].test(r);l++);if(l===Dl.length)return!1;if(s)return Dl[l][2];let a=t+1;if(!Dl[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),Dl[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 PP(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function Ax(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function Ex(e,t,n){if(t>=n)return!1;const s=e.charCodeAt(t);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:PP(e,t,n)}const Tb=["","h1","h2"];function RP(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=Ax(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 v=i[h]+r[h],w=l[h];if(v>=w)break;if(a[h]-c>3)continue;if(a[h]>=c&&(p=o.charCodeAt(v),p===45||p===61)){let E=v+1,k=E;for(;E<w&&o.charCodeAt(E)===p;)E++;for(k=E;E<w;){const A=o.charCodeAt(E);if(A!==9&&A!==32)break;E++}if(E>=w){f=p===61?1:2;break}if(k-v>1)continue}if(a[h]<0||u&&!Ex(o,v,w))continue;let N=!1;for(let E=0,k=s.length;E<k;E++)if(s[E](e,h,n,!0)){N=!0;break}if(N)break}if(!f)return!1;let g;if(h===t+1){const v=i[t]+r[t];let w=l[t];for(;w>v;){const N=o.charCodeAt(w-1);if(N!==9&&N!==32)break;w--}g=o.slice(v,w)}else g=e.getLines(t,h,c,!1).trim();e.line=h+1;const S=p===61?"=":"-",_=e.push("heading_open",Tb[f],1);_.markup=S,_.map=[t,e.line];const y=e.push("inline","",0);y.content=g,y.map=[t,e.line-1],y.children=[];const b=e.push("heading_close",Tb[f],-1);return b.markup=S,e.parentType=d,!0}function $x(e){switch(e){case 9:case 32:return!0}return!1}function Mb(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&&!$x(i.charCodeAt(l))?-1:l}function Ab(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),!$x(c))?-1:a}function DP(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 BP=["0","1","2","3","4","5","6","7","8","9"];function FP(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 HP(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,g=e.tShift,S=e.eMarks,_=e.sCount,y=e.bsCount,b=h[l]+g[l];if(b>=S[l])return!1;const v=p.charCodeAt(b);if(v>=48&&v<=57){if(f=Ab(e,l),f<0||(u=!0,r=b,d=DP(e,l,f),c&&d!==1))return!1}else if(v===42||v===45||v===43){if(f=Mb(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=S[l])return!1;if(s)return!0;const w=p.charCodeAt(f-1),N=String.fromCharCode(w);if(u){const M=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(M.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const E=[l,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=N;let k=!1;const A=e.tokens.length-1,I=e.md.block.ruler.getRulesForState(e,"list"),P=e.parentType;for(e.parentType="list";l<n;){i=f,o=S[l];const M=_[l]+f-(h[l]+g[l]);let L=M;for(;i<o;){const ae=p.charCodeAt(i);if(ae===9)L+=4-(L+y[l])%4;else if(ae===32)L++;else break;i++}const R=i;let B;R>=o?B=1:B=L-M,B>4&&(B=1);const U=M+B,K=e.push("list_item_open","li",1);K.markup=N;const V=[l,0];K.map=V,u&&(K.info=f-r-1===1?BP[p.charCodeAt(r)-48]:p.slice(r,f-1));const se=e.tight,Y=e.tShift[l],G=e.sCount[l],ee=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=U,e.tight=!0,e.tShift[l]=R-h[l],e.sCount[l]=L,R>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||k)&&(a=!1),k=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ee,e.tShift[l]=Y,e.sCount[l]=G,e.tight=se,e.push("list_item_close","li",-1).markup=N,l=e.line,V[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let Se=!1;for(let ae=0,Ie=I.length;ae<Ie;ae++)if(I[ae](e,l,n,!0)){Se=!0;break}if(Se)break;if(u){if(f=Ab(e,l),f<0)break;r=h[l]+g[l]}else if(f=Mb(e,l),f<0)break;if(w!==p.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=N:e.push("bullet_list_close","ul",-1).markup=N,E[1]=l,e.line=l,e.parentType=P,a&&FP(e,A),!0}function Eb(e){return e===9||e===32}function WP(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=Ax(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 b=r[f]+l[f],v=a[f];if(b<v){const w=i.charCodeAt(b);if(w===42||w===45||w===43){if(b+1>=v||Eb(i.charCodeAt(b+1)))break}else if(w>=48&&w<=57&&b+1<v){let N=b+1;for(;;){if(N>=v){N=-1;break}const E=i.charCodeAt(N++);if(E>=48&&E<=57){if(N-b>=10){N=-1;break}continue}if((E===41||E===46)&&(N>=v||Eb(i.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const S=r[f]+l[f],_=a[f];if(d&&!Ex(i,S,_))continue;let y=!1;for(let b=0,v=s.length;b<v;b++)if(s[b](e,f,n,!0)){y=!0;break}if(y)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 g=e.push("inline","",0);return g.content=p,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function id(e){switch(e){case 9:case 32:return!0}return!1}function UP(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(b){const v=e.lineMax;if(b>=v||e.isEmpty(b))return null;let w=!1;if(e.sCount[b]-e.blkIndent>3&&(w=!0),e.sCount[b]<0&&(w=!0),!w){const k=e.parentType;e.parentType="reference";let A=!1;for(let I=0,P=l.length;I<P;I++)if(l[I](e,b,v,!0)){A=!0;break}if(e.parentType=k,A)return null}const N=e.bMarks[b]+e.tShift[b],E=e.eMarks[b];return e.src.slice(N,E+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const b=c.charCodeAt(o);if(b===91)return!1;if(b===93){u=o;break}else if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(b===92&&(o++,o<i&&c.charCodeAt(o)===10)){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const b=c.charCodeAt(o);if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(!id(b))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,g=o;for(;o<i;o++){const b=c.charCodeAt(o);if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(!id(b))break}let S=e.md.helpers.parseLinkTitle(c,o,i);for(;S.can_continue;){const b=a(r);if(b===null)break;c+=b,o=i,i=c.length,r++,S=e.md.helpers.parseLinkTitle(c,o,i,S)}let _;for(o<i&&g!==o&&S.ok?(_=S.str,o=S.pos):(_="",o=p,r=h);o<i&&id(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&_)for(_="",o=p,r=h;o<i&&id(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const y=vh(c.slice(1,u));return y?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[y]>"u"&&(e.env.references[y]={title:_,href:f}),e.line=r),!0):!1}function lm(e){switch(e){case 9:case 32:return!0}return!1}const jP=65536;function am(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function qP(e,t){for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function $b(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 zP(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&&!lm(l)||r===45&&lm(l)||!qP(e,t))return!1;for(;i<e.eMarks[o];){const v=e.src.charCodeAt(i);if(v!==124&&v!==45&&v!==58&&!lm(v))return!1;i++}let a=am(e,t+1),c=a.split("|");const u=[];for(let v=0;v<c.length;v++){const w=c[v].trim();if(!w){if(v===0||v===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(w))return!1;w.charCodeAt(w.length-1)===58?u.push(w.charCodeAt(0)===58?"center":"right"):w.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=am(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=$b(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),g=[t,0];h.map=g;const S=e.push("thead_open","thead",1);S.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let v=0;v<c.length;v++){const w=e.push("th_open","th",1);u[v]&&(w.attrs=[["style",`text-align:${u[v]}`]]);const N=e.push("inline","",0);N.content=c[v].trim(),N.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,b=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let v=!1;for(let N=0,E=p.length;N<E;N++)if(p[N](e,o,n,!0)){v=!0;break}if(v||(a=am(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=$b(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),b+=d-c.length,b>jP))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=y=[t+2,0]}const w=e.push("tr_open","tr",1);w.map=[o,o+1];for(let N=0;N<d;N++){const E=e.push("td_open","td",1);u[N]&&(E.attrs=[["style",`text-align:${u[N]}`]]);const k=e.push("inline","",0);k.content=c[N]?c[N].trim():"",k.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=o),e.push("table_close","table",-1),g[1]=o,e.parentType=f,e.line=o,!0}var VP=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 da(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};function Ib(e){switch(e){case 9:case 32:return!0}return!1}var Ix=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1;for(let c=0,u=o.length;c<u;c++){const d=o.charCodeAt(c);if(!a)if(Ib(d)){i++,d===9?r+=4-r%4:r++;continue}else a=!0;(d===10||c===u-1)&&(d!==10&&c++,this.bMarks.push(l),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),a=!1,i=0,r=0,l=c+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const o=new as(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new as(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 g=this.src,S=this.bsCount,_=this.tShift;for(;f<p&&h<n;){const y=g.charCodeAt(f);if(y===9||y===32)y===9?h+=4-(h+S[u])%4:h++;else if(f-d<_[u])h++;else break;f++}return h>n?new Array(h-n+1).join(" ")+g.slice(f,p):g.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,g;for(d+1<t||s?g=l[d]+1:g=l[d];h<g&&f<n;){const S=i.charCodeAt(h);if(Ib(S))S===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,g):o[u]=i.slice(h,g)}return o.join("")}};Ix.prototype.Token=as;const rd=[["table",zP,["paragraph","reference"]],["code",EP],["fence",$P,["paragraph","reference","blockquote","list"]],["blockquote",AP,["paragraph","reference","blockquote","list"]],["hr",LP,["paragraph","reference","blockquote","list"]],["list",HP,["paragraph","reference","blockquote"]],["reference",UP],["html_block",OP,["paragraph","reference","blockquote"]],["heading",IP,["paragraph","reference","blockquote"]],["lheading",RP],["paragraph",WP]];var KP=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new VP;for(let e=0;e<rd.length;e++)this.ruler.push(rd[e][0],rd[e][1],{alt:(rd[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 g=0;g<o;g++)if(h=s[g](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 g=0;g<o;g++){const S=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();h=f[g].fn(e,u,n,!1);const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(da(e.env,"block",f[g].name,_-S,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 Ix(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}},Nx=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}};Nx.prototype.Token=as;const Nb=[["normalize",fP],["block",cO],["inline",sP],["linkify",cP],["replacements",kP],["smartquotes",SP],["text_join",CP]],GP={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},YP={parseLinkLabel:vv,parseLinkDestination:gv,parseLinkTitle:yv};function XP(){return{...GP}}function ZP(){return{...YP}}var JP=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new KP,this.inline=new nP,this.ruler=new bP;for(let e=0;e<Nb.length;e++){const[t,n]=Nb[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:XP(),helpers:ZP(),normalizeLink:Tx,normalizeLinkText:Mx,validateLink:xx,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new lx),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 Nx(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();da(e.env,"core",t[n].name,o-s,!0,!1)}eP(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&aO(e))return this.parse(dx(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 QP={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Cf(e,t,n={},s){Qs(n);const o={...QP,...s||{}},i=ps(t);if(o.fallbackOnGlobalState!==!1&&i)return rm(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ua(n,i,()=>e.core.parse(t,n,e).tokens);let r=Ed(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=sR(r,o.maxChunks)),$d(t,r))return rm(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ua(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return rm(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),ua(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&&tR(f,l),nR(a,f),l+=u.lineCount}return a})}function Ed(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(`
52
+ `,f),h=p;p===-1?(p=e.length,h=e.length):h=p+1;const g=oR(e,f,p);if(t.fenceAware){let y=f;for(;y<p;){const v=e.charCodeAt(y);if(v===32||v===9)y++;else break}const b=e[y];if(b==="`"||b==="~"){let v=y;for(;v<p&&e[v]===b;)v++;const w=v-y;w>=3&&(u?u.marker===b&&w>=u.length&&(u=null):u={marker:b,length:w})}}const S=h-f;o+=S,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=S);const _=g;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(_)d(h);else{const y=Math.max(10,Math.floor(t.maxChunkLines*.5)),b=Math.max(t.maxChunkChars,8e3);(a>=y||c>=b)&&d(h)}f=h}return n&&d(e.length),s}function $d(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!eR(e,t[o].end))return!0;return!1}function eR(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 tR(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 nR(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function sR(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 oR(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 Lx=4e6,Ox=8e4,iR=1e4,rR=200,lR=1e4,aR=200;function Px(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function cR(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 Xi(e){return e.length===0?0:An(e)+(e.charCodeAt(e.length-1)===10?0:1)}function uR(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 dR(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
53
+ `,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 fR(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 uR(e,n+1,e.length-1)?!dR(e,t):!1}function hR(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??lR:e.options.fullChunkSizeChars??iR),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??aR:e.options.fullChunkSizeLines??rR);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 hu=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=Xi(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=Ed(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if($d(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,Xi(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!fR(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Xi(this.pending)),null;const n=Ed(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Xi(this.pending)),null;const s=$d(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Xi(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=Ed(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=$d(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Xi(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:Xi(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Xi(this.pending);return hR(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(fu(e)&&Pi(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=ps(t);n&&(pv(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&&cR(r,a),this.options.retainTokens!==!1&&Px(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&&mv(t),n}catch(s){throw this.markedGlobalStateReason&&(Pi(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){ix(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 pR(e,t,n={},s={}){Qs(n);const o=new hu(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function mR(e,t,n={},s={}){Qs(n);const o=new hu(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function gR(e,t,n,s={},o={}){Qs(s);const i=new hu(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 vR(e,t,n,s={},o={}){Qs(s);const i=new hu(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 Rx(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??Lx,o=e.options.autoUnboundedThresholdLines??Ox;return t>=s||n>=o}function Dx(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Lx))return"yes";const s=e.options.autoUnboundedThresholdLines??Ox;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function Sc(e,t,n={},s={}){Qs(n);const o=ps(t);if(fu(n)&&Pi(n),s.fallbackOnGlobalState!==!1&&o)return ix(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:An(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),ua(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new hu(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){Px(i,l)}});if(o&&pv(n,o),r.feed(t),r.flushForce(n),o&&(mv(n),s.fallbackOnGlobalState===!1)){const l=bi(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const fa=(e,t,n)=>e<t?t:e>n?n:e;function Bx(e){return e.experimental?{...e,...e.experimental}:e}const Lb=[{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"}],Ob=[{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 Fx(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function yR(e,t=Math.max(0,e/40|0),n={}){const s=Bx(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<Lb.length;l++){const a=Lb[l];if(e<=a.max){if(a.strategy!=="adaptive")return Fx(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:fa(Math.ceil(e/i),8e3,64e3),maxChunkLines:fa(Math.ceil(t/i),150,700),maxChunks:fa(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 Pb(e,t=Math.max(0,e/40|0),n={}){const s=Bx(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<Ob.length;l++){const a=Ob[l];if(e<=a.max){if(a.strategy!=="adaptive")return Fx(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:fa(Math.ceil(e/i),8e3,64e3),maxChunkLines:fa(Math.ceil(t/i),150,700),maxChunks:fa(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 kR={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"]}}},bR={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},_R={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};const wR=/[&<>"]/,Rb=/[&<>"]/g,SR=/&/g,CR=/[<>"]/g,xR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function cm(e){return xR[e]||e}function pn(e){if(e.length===0)return"";if(e.length<32)return wR.test(e)?e.replace(Rb,cm):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(SR,"&amp;"):t?e.replace(Rb,cm):e.replace(CR,cm)}const TR=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),MR=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Hx(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(TR,(t,n,s)=>{if(n)return n;if(MR.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return yh(i)?Yc(i):"�"}const o=lv(t);return o!==t?o:t})}function wh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Id(e,t){if(wh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const Db=e=>wh(e)?e:Promise.resolve(e);function Cc(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 pn(e)}}function br(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Cc(t[0])}="${pn(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Cc(o[0])}="${pn(o[1])}"`}return n}function Wx(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 xc(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
54
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${pn(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
55
+ `;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${br(r)}>${t}</code></pre>
56
+ `}return`<pre><code${br(e.attrs)}>${t}</code></pre>
57
+ `}function xf(e){return!e.attrs||e.attrs.length===0?`<code>${pn(e.content)}</code>`:`<code${br(e.attrs)}>${pn(e.content)}</code>`}function Dg(e){const t=pn(e.content);return e.attrs?`<pre${br(e.attrs)}><code>${t}</code></pre>
58
+ `:`<pre><code>${t}</code></pre>
59
+ `}function AR(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="${pn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${pn(n[0][1])}">`}return null}function Bb(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Cc(t[0][0])}="${pn(t[0][1])}">`:t.length===2?`<a ${Cc(t[0][0])}="${pn(t[0][1])}" ${Cc(t[1][0])}="${pn(t[1][1])}">`:`<a${br(t)}>`}function ER(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 Fb(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 Tf(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+br(n);return s===0&&t&&(i+=" /"),`${i}>`}const $R={langPrefix:"language-",xhtmlOut:!1,breaks:!1},ld=Object.prototype.hasOwnProperty,cn={code_inline(e,t){return xf(e[t])},code_block(e,t){return Dg(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?Hx(i.info).trim():"",{langName:l,langAttrs:a}=Wx(r),c=n.highlight,u=pn(i.content);if(!c)return xc(i,u,r,l,n);const d=c(i.content,l,a);return wh(d)?d.then(f=>xc(i,f||u,r,l,n)):xc(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]],Tf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
60
+ `:`<br>
61
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
62
+ `:`<br>
63
+ `:`
64
+ `},text(e,t){return pn(e[t].content)},text_special(e,t){return pn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Hb(e,t,n){const s=e.info?Hx(e.info).trim():"",{langName:o,langAttrs:i}=Wx(s),r=t.highlight,l=pn(e.content);if(!r)return xc(e,l,s,o,t);const a=r(e.content,o,i);if(wh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return xc(e,a||l,s,o,t)}function ad(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===cn.text)return l.content.length===0?"":pn(l.content);break;case"text_special":if(o.text_special===cn.text_special)return l.content.length===0?"":pn(l.content);break;case"softbreak":if(o.softbreak===cn.softbreak)return r;break;case"hardbreak":if(o.hardbreak===cn.hardbreak)return i;break;case"html_inline":if(o.html_inline===cn.html_inline)return l.content;break;case"code_inline":if(o.code_inline===cn.code_inline)return xf(l);break}const a=o[l.type];if(!a)return Tf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Id(c,l.type)}var IR=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...cn}}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="",g=!1,S="";for(let _=0;_<e.length;_++){const y=e[_],b=y.type,v=_>0&&e[_-1].hidden?`
65
+ `:"";if(b==="list_item_open"&&(!y.attrs||y.attrs.length===0)&&_+3<e.length){const E=e[_+1],k=e[_+2],A=e[_+3];if(E.type==="paragraph_open"&&E.hidden&&k.type==="inline"&&A.type==="paragraph_close"&&A.hidden){S+=`${v}<li>${this.renderInlineTokens(k.children||[],s,o)}`,_+=3;continue}}if(_+2<e.length){const E=e[_+1],k=e[_+2];if(E.type==="inline"&&k.nesting===-1&&k.tag===y.tag&&!k.hidden){const A=AR(y,v);if(A!==null){S+=`${A+this.renderInlineTokens(E.children||[],s,o)}</${y.tag}>
66
+ `,_+=2;continue}}}if(b==="inline"){const E=y.children||[];if(E.length===1){g||(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 />
67
+ `:`<br>
68
+ `,h=s.breaks?p:`
69
+ `,g=!0);const k=E[0];switch(k.type){case"text":if(l===cn.text){S+=pn(k.content);continue}break;case"text_special":if(a===cn.text_special){S+=pn(k.content);continue}break;case"softbreak":if(c===cn.softbreak){S+=h;continue}break;case"hardbreak":if(u===cn.hardbreak){S+=p;continue}break;case"html_inline":if(d===cn.html_inline){S+=k.content;continue}break;case"code_inline":if(f===cn.code_inline){S+=xf(k);continue}break}}S+=this.renderInlineTokens(E,s,o);continue}const w=i[b];if(!w){const E=y.attrs;if(!y.hidden){if(!E||E.length===0)switch(b){case"hr":S+=r?`<hr />
70
+ `:`<hr>
71
+ `;continue;case"heading_open":S+=`<${y.tag}>`;continue;case"heading_close":S+=`</${y.tag}>
72
+ `;continue;case"paragraph_open":S+=`${v}<p>`;continue;case"paragraph_close":S+=`</p>
73
+ `;continue;case"list_item_open":{const k=e[_+1];S+=v+(k&&(k.type==="inline"||k.hidden||k.nesting===-1&&k.tag==="li")?"<li>":`<li>
74
+ `);continue}case"list_item_close":S+=`</li>
75
+ `;continue;case"bullet_list_open":S+=`${v}<ul>
76
+ `;continue;case"bullet_list_close":S+=`</ul>
77
+ `;continue;case"blockquote_open":S+=v+(e[_+1]&&e[_+1].nesting===-1&&e[_+1].tag==="blockquote"?"<blockquote>":`<blockquote>
78
+ `);continue;case"blockquote_close":S+=`</blockquote>
79
+ `;continue;case"ordered_list_open":S+=`${v}<ol>
80
+ `;continue;case"ordered_list_close":S+=`</ol>
81
+ `;continue;case"table_open":S+=`${v}<table>
82
+ `;continue;case"table_close":S+=`</table>
83
+ `;continue;case"thead_open":S+=`${v}<thead>
84
+ `;continue;case"thead_close":S+=`</thead>
85
+ `;continue;case"tbody_open":S+=`${v}<tbody>
86
+ `;continue;case"tbody_close":S+=`</tbody>
87
+ `;continue;case"tr_open":S+=`${v}<tr>
88
+ `;continue;case"tr_close":S+=`</tr>
89
+ `;continue;case"td_open":S+=`${v}<td>`;continue;case"td_close":S+=`</td>
90
+ `;continue;case"th_open":S+=`${v}<th>`;continue;case"th_close":S+=`</th>
91
+ `;continue}else if(E.length===1){const k=E[0];if(b==="ordered_list_open"&&k[0]==="start"){S+=`${v}<ol start="${pn(k[1])}">
92
+ `;continue}if(b==="td_open"&&k[0]==="style"){S+=`${v}<td style="${pn(k[1])}">`;continue}if(b==="th_open"&&k[0]==="style"){S+=`${v}<th style="${pn(k[1])}">`;continue}}}S+=this.renderToken(e,_,s);continue}if(b==="code_block"&&w===cn.code_block){S+=Dg(y);continue}if(b==="fence"&&w===cn.fence){S+=Hb(y,s);continue}if(b==="html_block"&&w===cn.html_block){S+=y.content;continue}const N=w(e,_,s,o,this);typeof N=="string"?S+=N:S+=Id(N,y.type)}return S}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await Db(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 br(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?`
93
+ `:"",u=a?`>
94
+ `:">";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+br(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(ld.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),ld.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(ld.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(ld.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...$R,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===cn.code_block)return Dg(t);if(i==="html_block"&&o.html_block===cn.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):Tf(t,r.xhtmlOut===!0);if(i==="fence"&&a===cn.fence)return Hb(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Id(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,g=s.strong_close,S=t.xhtmlOut===!0,_=S?`<br />
95
+ `:`<br>
96
+ `,y=t.breaks?_:`
97
+ `;if(e.length===1)return ad(e,t,n,this,s,_,y);let b="";for(let v=0;v<e.length;v++){const w=e[v];if(w.type==="link_open"&&!u&&!d&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="link_close"&&ER(k)){const A=`${Bb(w)+ad([k],t,n,this,s,_,y)}</a>`;if(r===cn.softbreak&&v+3<e.length&&e[v+3].type==="softbreak"){b+=A+y,v+=3;continue}b+=A,v+=2;continue}}if(w.type==="link_open"&&!u&&!d&&v+1<e.length&&e[v+1].type==="link_close"){b+=`${Bb(w)}</a>`,v+=1;continue}if(w.type==="em_open"&&!f&&!p&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="em_close"&&Fb(k)){b+=`<em>${ad([k],t,n,this,s,_,y)}</em>`,v+=2;continue}}if(w.type==="strong_open"&&!h&&!g&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="strong_close"&&Fb(k)){b+=`<strong>${ad([k],t,n,this,s,_,y)}</strong>`,v+=2;continue}}switch(w.type){case"text":if(o===cn.text){const k=w.content.length===0?"":pn(w.content);if(a===cn.html_inline&&v+1<e.length&&e[v+1].type==="html_inline"){for(b+=k+e[++v].content;v+1<e.length&&e[v+1].type==="html_inline";)b+=e[++v].content;continue}b+=k;continue}break;case"text_special":if(i===cn.text_special){w.content.length!==0&&(b+=pn(w.content));continue}break;case"softbreak":if(r===cn.softbreak){b+=y;continue}break;case"hardbreak":if(l===cn.hardbreak){b+=_;continue}break;case"html_inline":if(a===cn.html_inline){for(b+=w.content;v+1<e.length&&e[v+1].type==="html_inline";)b+=e[++v].content;continue}break;case"code_inline":if(c===cn.code_inline){b+=xf(w);continue}break}const N=s[w.type];if(!N){b+=w.block?this.renderToken(e,v,t):Tf(w,S);continue}const E=N(e,v,t,n,this);typeof E=="string"?b+=E:b+=Id(E,w.type)}return b}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 Db(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+=`
98
+ `;break}}return s}},NR=IR;const LR=[];function Wb(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var OR=class{core;cache=null;stats=Wb();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=Wb(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Qs(s??o?.env),!o||s&&s!==o.env){const M=s??{},L=!!n.__explicitStreamChunkFallbackSetting,R=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,B=!!n.options?.streamChunkedFallback,U=!L&&R,K=B||U,V=n.options?.streamChunkAdaptive!==!1,se=n.options?.streamChunkTargetChunks??8,Y=n.options?.streamChunkSizeChars,G=n.options?.streamChunkSizeLines,ee=n.options?.streamChunkMaxChunks,Se=!!n.__explicitStreamChunkConfig,ae=n.options?.autoTuneChunks!==!1,Ie=n.options?.streamChunkFenceAware??!0,de=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,we=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let me,$e=e.length>=de;if(!$e&&we!==void 0&&(me=An(e),$e=me>=we),$e){const ye=this.parseFullDocument(e,M,n,me,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(M,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!bi(M)?.unbounded}),ye.tokens}else if(K){const ye=(H,X,ce)=>H<X?X:H>ce?ce:H;me===void 0&&(me=An(e));const _e=ae&&!Se?Pb(e.length,me,n.options):null,W=_e?.maxChunkChars??(V?ye(Math.ceil(e.length/se),8e3,64e3):Y??1e4),Z=_e?.maxChunkLines??(V?ye(Math.ceil(me/se),150,700):G??200),fe=_e?.maxChunks??(V?ye(Math.ceil(e.length/64e3),se,32):ee),oe=e.length>0&&e.charCodeAt(e.length-1)===10,he=U&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&_e?.strategy!=="plain";if((B||he)&&(e.length>=W*2||me>=Z*2)&&oe){const H=Cf(n,e,M,{maxChunkChars:W,maxChunkLines:Z,fenceAware:_e?.fenceAware??Ie,maxChunks:fe});return this.cache={src:e,tokens:H,env:M,lineCount:me,lastSegment:void 0,globalStateReason:ps(e)},this.updateCacheLineCount(this.cache,me),this.recordChunkedParseResult(M,B?"explicit-initial-large-doc":"default-initial-large-doc"),H}}const J=this.parseFullDocument(e,M,n,me);return me=J.lineCount,this.cache={src:e,tokens:J.tokens,env:M,lineCount:me,lastSegment:void 0,globalStateReason:ps(e)},this.updateCacheLineCount(this.cache,me),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(M,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!bi(M)?.unbounded}),J.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",is(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;let i=o.globalStateReason;i===void 0&&(i=ps(o.src),o.globalStateReason=i);const r=ps(e),l=i||r;if(l){const M=s??o.env;Pi(M);const L=this.parseFullDocument(e,M,n),R=L.tokens,B=L.lineCount;return this.cache={src:e,tokens:R,env:M,lineCount:B,lastSegment:void 0,globalStateReason:r},this.updateCacheLineCount(this.cache,B),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(M,{area:"stream",path:"stream-full",reason:`global-state:${l}`,unbounded:!!bi(M)?.unbounded}),R}const a=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<a&&e.length<a*1.5&&!e.startsWith(o.src)){const M=s??o.env,L=this.parseFullDocument(e,M,n),R=L.tokens,B=L.lineCount;return this.cache={src:e,tokens:R,env:M,lineCount:B,lastSegment:void 0,globalStateReason:ps(e)},this.updateCacheLineCount(this.cache,B),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(M,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!bi(M)?.unbounded}),R}const c=this.getAppendedSegment(o.src,e);if(c&&!this.shouldPreferTailReparseForAppend(o)){let V=function(Ie){const de=Ie.length;let we=0;for(;we<=de;){let me=Ie.indexOf(`
99
+ `,we);me===-1&&(me=de);const $e=me<de;let J=we,ye=0;for(;J<me;){const _e=Ie.charCodeAt(J);if(_e===32){if(ye++,J++,ye>=4)return!0;continue}if(_e===9){if(ye+=4-ye%4,J++,ye>=4)return!0;continue}break}if(J<me){const _e=Ie.charCodeAt(J);switch(_e){case 35:{let W=J;for(;W<me&&Ie.charCodeAt(W)===35;)W++;const Z=W-J;if(Z>0&&Z<=6){if(W<me){const fe=Ie.charCodeAt(W);if(fe===32||fe===9||fe===13)return!0}else if(W===me&&$e)return!0}break}case 62:{const W=J+1;if(W<me){const Z=Ie.charCodeAt(W);if(Z===32||Z===9||Z===13)return!0}else if(W===me&&$e)return!0;break}case 45:case 42:case 43:{const W=J+1;if(W<me){const Z=Ie.charCodeAt(W);if(Z===32||Z===9||Z===13)return!0}else if(W===me&&$e)return!0;break}case 96:case 126:{let W=J;for(;W<me&&Ie.charCodeAt(W)===_e;)W++;if(W-J>=3)return!0;break}default:if(_e>=48&&_e<=57){let W=J+1;for(;W<me;){const Z=Ie.charCodeAt(W);if(Z<48||Z>57)break;W++}if(W<me&&Ie.charCodeAt(W)===46){const Z=W+1;if(Z<me){const fe=Ie.charCodeAt(Z);if(fe===32||fe===9||fe===13)return!0}else if(Z===me&&$e)return!0}}break}}if(me===de)break;we=me+1}return!1};const M=o.lineCount??An(o.src);let L=3;c.length>5e3?L=8:c.length>1e3?L=6:c.length>200&&(L=4),L=Math.min(L,M);let R=null;const B=n.options?.streamContextParseStrategy??"chars",U=n.options?.streamContextParseMinChars??200,K=n.options?.streamContextParseMinLines??2;let se=null;const Y=()=>(se===null&&(se=An(c)),se),G=this.canDirectlyParseAppend(o),ee=G&&this.shouldUseUnboundedAppend(e,o,c);let Se=!1;if(!G)switch(B){case"lines":Se=Y()>=K;break;case"constructs":if(c.length>=U){Se=!0;break}if(V(c)){Se=!0;break}Se=Y()>=K;break;case"chars":default:Se=c.length>=U}if(L>0&&Se){const Ie=this.getTailLines(o.src,L)+c;try{const de=this.core.parse(Ie,o.env,n).tokens,we=de.findIndex(me=>me.map&&typeof me.map[1]=="number"&&me.map[1]>L);if(we!==-1){const me=de.slice(we),$e=M-L;$e!==0&&this.shiftTokenLines(me,$e),R={tokens:me}}}catch{R=null}}else R=null;if(!R){const Ie=M;if(ee)R={tokens:Sc(n,c,o.env,{mode:"stream"})},Ie>0&&this.shiftTokenLines(R.tokens,Ie);else{const de=this.core.parse(c,o.env,n);Ie>0&&this.shiftTokenLines(de.tokens,Ie),R=de}}if(o.tokens.length>0&&R.tokens.length>0){const Ie=o.tokens[o.tokens.length-1],de=R.tokens[0];try{Ie.type==="inline"&&de.type==="inline"&&(de.children&&de.children.length>0&&(Ie.children||(Ie.children=[]),this.appendTokens(Ie.children,de.children)),Ie.content=(Ie.content||"")+(de.content||""),R.tokens.shift())}catch{}}const ae=o.tokens.length;if(R.tokens.length>0){let me=function(_e,W){if(!_e&&!W)return!0;if(!_e||!W||_e.length!==W.length)return!1;for(let Z=0;Z<_e.length;Z++)if(_e[Z][0]!==W[Z][0]||_e[Z][1]!==W[Z][1])return!1;return!0},$e=function(_e,W){if(!_e&&!W)return!0;if(!_e||!W||_e.length!==W.length)return!1;for(let Z=0;Z<_e.length;Z++)if(!J(_e[Z],W[Z]))return!1;return!0},J=function(_e,W){if(!_e||!W||_e.type!==W.type)return!1;const Z=_e.map,fe=W.map;return!!Z!=!!fe||Z&&fe&&(Z[0]!==fe[0]||Z[1]!==fe[1])||_e.tag!==W.tag||_e.nesting!==W.nesting||_e.markup!==W.markup||_e.info!==W.info||_e.block!==W.block||_e.hidden!==W.hidden||!me(_e.attrs,W.attrs)||!$e(_e.children,W.children)?!1:(_e.type==="inline",(_e.content||"")===(W.content||""))};const Ie=o.tokens,de=R.tokens,we=Math.min(Ie.length,de.length);let ye=0;for(let _e=we;_e>0;_e--){let W=!0;for(let Z=0;Z<_e;Z++){const fe=Ie[Ie.length-_e+Z],oe=de[Z];if(!J(fe,oe)){W=!1;break}}if(W){ye=_e;break}}ye>0&&de.splice(0,ye),de.length>0&&this.appendTokens(o.tokens,de)}if(o.src=e,o.globalStateReason=ps(e),o.lineCount=M+(se??An(c)),o.tokens.length>ae){const Ie=this.getLastSegment(o.tokens.slice(ae),e);Ie?o.lastSegment={tokenStart:ae+Ie.tokenStart,tokenEnd:ae+Ie.tokenEnd,lineStart:Ie.lineStart,lineEnd:Ie.lineEnd,srcOffset:Ie.srcOffset}:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ee&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",is(o.env,{area:"stream",path:ee?"stream-unbounded-append":"stream-append",reason:ee?"large-delta":"safe-append",unbounded:ee}),o.tokens}const u=s??o.env,d=this.tryTailSegmentReparse(e,o,u,n);if(d)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",is(u,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),d;const f=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,h=!!n.options?.streamChunkedFallback,g=!f&&!c&&p,S=h||g,_=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,b=n.options?.streamChunkSizeChars,v=n.options?.streamChunkSizeLines,w=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,E=n.options?.autoTuneChunks!==!1,k=n.options?.streamChunkFenceAware??!0;let A=c&&o.lineCount!==void 0?o.lineCount+An(c):void 0;if(S){A===void 0&&(A=An(e));const M=(se,Y,G)=>se<Y?Y:se>G?G:se,L=E&&!N?Pb(e.length,A,n.options):null,R=L?.maxChunkChars??(_?M(Math.ceil(e.length/y),8e3,64e3):b??1e4),B=L?.maxChunkLines??(_?M(Math.ceil(A/y),150,700):v??200),U=L?.maxChunks??(_?M(Math.ceil(e.length/64e3),y,32):w),K=e.length>0&&e.charCodeAt(e.length-1)===10,V=g&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&L?.strategy!=="plain";if((h||V)&&(e.length>=R*2||A>=B*2)&&K){const se=Cf(n,e,u,{maxChunkChars:R,maxChunkLines:B,fenceAware:L?.fenceAware??k,maxChunks:U});return this.cache={src:e,tokens:se,env:u,lineCount:A,lastSegment:void 0,globalStateReason:ps(e)},this.updateCacheLineCount(this.cache,A),this.recordChunkedParseResult(u,h?"explicit-fallback-large-doc":"default-fallback-large-doc"),se}}const I=this.parseFullDocument(e,u,n,A),P=I.tokens;return A=I.lineCount,this.cache={src:e,tokens:P,env:u,lineCount:A,lastSegment:void 0,globalStateReason:ps(e)},this.updateCacheLineCount(this.cache,A),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",is(u,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!bi(u)?.unbounded}),P}recordChunkedParseResult(e,t){const n=bi(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",is(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!bi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",is(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=ps(e);fu(t)&&Pi(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?Dx(n,e.length,s):"no";if(r==="yes"){const a=Sc(n,e,t);return is(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?An(e):0)}}let l=s;if(r==="need-lines"&&(l=An(e),Rx(n,e.length,l))){const a=Sc(n,e,t);return is(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?An(e):0),{tokens:ua(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:An(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t){if(!t.startsWith(e)||!e.endsWith(`
100
+ `))return null;const n=t.slice(e.length);if(!n)return null;const s=n.length;if(n.charCodeAt(s-1)!==10)return null;let o=0,i=-1;for(let l=0;l<s&&!(n.charCodeAt(l)===10&&(i===-1&&(i=l),o++,o>=2));l++);if(o<2)return null;const r=(i===-1?n:n.slice(0,i)).trim();if(r.length===0)return null;if(/^[-=]+$/.test(r)){const l=e.slice(0,-1),a=l.lastIndexOf(`
101
+ `);if(l.slice(a+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(n)?null:n}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=ps(e),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=An(e),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
102
+ `,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??LR}getStats(){return{...this.stats}}appendTokens(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}updateCacheLineCount(e,t){e.lineCount=t??An(e.src),e.lastSegment=void 0}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t){if(e.length===0)return null;let n=Number.POSITIVE_INFINITY,s=-1,o=0;for(let i=e.length-1;i>=0;i--){const r=e[i];if(r.map&&(r.map[0]<n&&(n=r.map[0]),r.map[1]>s&&(s=r.map[1])),r.nesting<0){o+=-r.nesting;continue}if(r.nesting>0){if(o-=r.nesting,r.level===0&&o<=0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}continue}if(r.level===0&&o===0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}}return null}getLineStartOffset(e,t){if(t<=0)return 0;let n=t,s=-1;for(;n>0;){if(s=e.indexOf(`
103
+ `,s+1),s===-1)return e.length;n--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??An(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);return(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=ps(e),t.lineCount=An(e),r.map&&(r.map[1]=this.getDocLineCount(e)),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:this.getDocLineCount(e),srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const 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 g=o.lineEnd-2;g!==0&&this.shiftTokenLines(h,g);const S=p.tbodyCloseIndex>=0?p.tbodyCloseIndex:p.tableCloseIndex;t.tokens.splice(S,0,...h),t.src=e,t.env=n,t.globalStateReason=ps(e),t.lineCount=An(e);const _=this.getDocLineCount(e);if(r.map&&(r.map[1]=_),p.tbodyOpenIndex>=0){const y=t.tokens[p.tbodyOpenIndex];y?.map&&(y.map[1]=_)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
104
+ `);if(t<0)return null;const n=e.indexOf(`
105
+ `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e){const t=An(e);return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;const n=[...e];for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}};const Ub={default:bR,zero:_R,commonmark:kR};function PR(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function RR(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 jb(e){return e.experimental?{...e,...e.experimental}:e}function wo(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function qb(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(wo(t,o)||wo(e,o))return!0}return!1}function zb(e,t,n){return wo(t,n)||wo(e,n)}function Vb(e,t){const n=bi(e)?.chunk;if(n?.fallback){is(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}is(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function DR(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=Ub[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=jb(n),typeof n.quotes=="string"){const w=n.quotes;w.length>=4?n.quotes=[w[0],w[1],w[2],w[3]]:n.quotes=["“","”","‘","’"]}let r=qb(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=qb(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=zb(i?.options,o,"fullChunkedFallback"),c=zb(i?.options,o,"streamChunkedFallback"),u=!1,d=null;const f=new JP;let p=null;const h=()=>(p||(p=new NR(n)),p);let g=null;const S=()=>(g||(g=new OR(f)),g);let _=null;const y=()=>(_||(_=new lx),_),b=w=>!u&&!!d&&!RR(w,d),v={core:f,block:f.block,inline:f.inline,get linkify(){const w=y();return Object.defineProperty(this,"linkify",{value:w,writable:!0,configurable:!0}),w},get renderer(){const w=h();return Object.defineProperty(this,"renderer",{value:w,writable:!0,configurable:!0}),w},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return b(this)},set(w){const N=jb(w);return this.options={...this.options,...N},(wo(w,"fullChunkSizeChars")||wo(w,"fullChunkSizeLines")||wo(w,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(wo(w,"streamChunkSizeChars")||wo(w,"streamChunkSizeLines")||wo(w,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),wo(w,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),wo(w,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(N),typeof N.stream=="boolean"&&(this.stream.enabled=N.stream,g&&(g.reset(),g.resetStats())),this},configure(w){const N=typeof w=="string"?Ub[w]:w;if(!N)throw new Error("Wrong `markdown-it` preset, can't be empty");if(N.options&&this.set(N.options),N.components){const E=N.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(w,N){const E=Array.isArray(w)?w:[w],k=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],A=new Set;for(const I of k){if(!I)continue;const P=I.enable(E,!0);for(let M=0;M<P.length;M++)A.add(P[M])}if(!N){const I=E.filter(P=>!A.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(w,N){const E=Array.isArray(w)?w:[w],k=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],A=new Set;for(const I of k){if(!I)continue;const P=I.disable(E,!0);for(let M=0;M<P.length;M++)A.add(P[M])}if(!N){const I=E.filter(P=>!A.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(w,...N){const E=typeof w=="function"?w:w&&typeof w.default=="function"?w.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const k=[this,...N],A=w;return u=!0,E.apply(A,k),this},render(w,N={}){const E=this.parse(w,N);return h().render(E,this.options,N)},async renderAsync(w,N={}){const E=this.parse(w,N);return h().renderAsync(E,this.options,N)},renderIterable(w,N={}){const E=this.parseIterable(w,N);return h().render(E,this.options,N)},async renderAsyncIterable(w,N={}){const E=await this.parseAsyncIterable(w,N);return h().renderAsync(E,this.options,N)},renderInline(w,N={}){const E=this.parseInline(w,N);return h().render(E,this.options,N)},validateLink:xx,normalizeLink:Tx,normalizeLinkText:Mx,utils:vL,helpers:{...lO},parse(w,N={}){if(typeof w!="string")throw new TypeError("Input data should be a String");Qs(N);let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const A=Dx(this,w.length);if(A==="yes"){const I=Sc(this,w,N);return is(N,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),I}A==="need-lines"&&(E=An(w))}if(!this.stream.enabled){const A=w.length,I=E??An(w),P=this.options.autoTuneChunks!==!1,M=r,L=!a&&b(this),R=!!this.options.fullChunkedFallback,B=L&&A>=2e5,U=P&&!M?yR(A,I,this.options):null;if((R||B)&&(R?A>=(this.options.fullChunkThresholdChars??2e4)||I>=(this.options.fullChunkThresholdLines??400):B)){if(U&&U.strategy!=="plain"){const K=Cf(this,w,N,{maxChunkChars:U.maxChunkChars,maxChunkLines:U.maxChunkLines,fenceAware:U.fenceAware,maxChunks:U.maxChunks});return Vb(N,R?"explicit-full-chunk":"default-large-string"),K}if(R){const K=(de,we,me)=>de<we?we:de>me?me:de,V=this.options.fullChunkAdaptive!==!1,se=this.options.fullChunkTargetChunks??8,Y=K(Math.ceil(A/se),8e3,64e3),G=K(Math.ceil(I/se),150,700),ee=V?Y:this.options.fullChunkSizeChars??1e4,Se=V?G:this.options.fullChunkSizeLines??200,ae=V?K(Math.ceil(A/64e3),se,32):this.options.fullChunkMaxChunks,Ie=Cf(this,w,N,{maxChunkChars:ee,maxChunkLines:Se,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:ae});return Vb(N,"explicit-full-chunk"),Ie}}if(E!==void 0&&b(this)&&Rx(this,A,I)){const K=Sc(this,w,N);return is(N,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const k=ps(w);return is(N,{area:"parse",path:"plain",reason:"default-plain"}),ua(N,k,()=>f.parse(w,N,this).tokens)},parseIterable(w,N={}){return Qs(N),pR(this,w,N)},parseAsyncIterable(w,N={}){return Qs(N),mR(this,w,N)},parseIterableToSink(w,N,E={}){return Qs(E),gR(this,w,N,E)},parseAsyncIterableToSink(w,N,E={}){return Qs(E),vR(this,w,N,E)},parseInline(w,N={}){if(typeof w!="string")throw new TypeError("Input data should be a String");Qs(N),fu(N)&&Pi(N);const E=f.createState(w,N,this);return E.inlineMode=!0,f.process(E),E.tokens}};if(v.stream={enabled:!!n.stream,parse(w,N){return v.stream.enabled?S().parse(w,N,v):v.parse(w,N??{})},reset(){S().reset()},peek(){return g?g.peek():[]},stats(){return g?g.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){g&&g.resetStats()}},i?.components){const w=i.components;w.core?.rules&&v.core.ruler.enableOnly(w.core.rules),w.block?.rules&&v.block.ruler.enableOnly(w.block.rules),w.inline?.rules&&v.inline.ruler.enableOnly(w.inline.rules),w.inline2?.rules&&v.inline.ruler2.enableOnly(w.inline2.rules)}return d=PR(v),v}var BR=DR;function FR(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,p,h,g,S){return f[p].nesting===1&&f[p].attrJoin("class",t),S.renderToken(f,p,h,g,S)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(f,p,h,g){let S,_=!1,y=f.bMarks[p]+f.tShift[p],b=f.eMarks[p];if(l!==f.src.charCodeAt(y))return!1;for(S=y+1;S<=b&&r[(S-y)%a]===f.src[S];S++);const v=Math.floor((S-y)/a);if(v<i)return!1;S-=(S-y)%a;const w=f.src.slice(y,S),N=f.src.slice(S,b);if(!c(N,w))return!1;if(g)return!0;let E=p;for(;E++,!(E>=h||(y=f.bMarks[E]+f.tShift[E],b=f.eMarks[E],y<b&&f.sCount[E]<f.blkIndent));)if(l===f.src.charCodeAt(y)&&!(f.sCount[E]-f.blkIndent>=4)){for(S=y+1;S<=b&&r[(S-y)%a]===f.src[S];S++);if(!(Math.floor((S-y)/a)<v)&&(S-=(S-y)%a,S=f.skipSpaces(S),!(S<b))){_=!0;break}}const k=f.parentType,A=f.lineMax;f.parentType="container",f.lineMax=E;const I=f.push("container_"+t+"_open","div",1);I.markup=w,I.block=!0,I.info=N,I.map=[p,E],f.md.block.tokenize(f,p+1,E);const P=f.push("container_"+t+"_close","div",-1);return P.markup=f.src.slice(y,S),P.block=!0,f.parentType=k,f.lineMax=A,f.line=E+(_?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 HR(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let S=0;S<a.length;S++){const _=a[S];if(_==="\\"){S++;continue}if(!u&&_==="'"){c=!c;continue}if(!c&&_==='"'){u=!u;continue}if(!c&&!u&&_===":"){d=S;break}}if(d===-1)return null;const 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 g;if(!p)g="";else if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{g=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=p}else/^-?\d+(?:\.\d+)?$/.test(p)?g=Number(p):p==="true"||p==="false"?g=p==="true":p==="null"?g=null:g=p;l[h]=g}return l}function WR(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(FR,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
106
+ `}})}),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("{"),g=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,g?.startsWith("{")){let w=0,N=-1;for(let E=0;E<g.length;E++)if(g[E]==="{"?w++:g[E]==="}"&&w--,w===0){N=E+1;break}N>0&&(p=g.slice(0,N))}p||(f=d||void 0)}if(o)return!0;const S=!!i.env.__markstreamFinal;let _=n+1,y=!1;for(;_<=s;){const w=i.bMarks[_]+i.tShift[_],N=i.eMarks[_];if(i.src.slice(w,N).trim()===":::"){y=!0;break}_++}y||(_=s);const b=i.push("vmr_container_open","div",1);if(b.attrSet("class",`vmr-container vmr-container-${u}`),b.meta={...b.meta??{},unclosed:!y&&!S},f&&b.attrSet("data-args",f),p)try{const w=JSON.parse(p);for(const[N,E]of Object.entries(w)){const k=E!=null&&typeof E=="object";b.attrSet(`data-${N}`,k?JSON.stringify(E):String(E))}}catch{const w=HR(p);if(w)for(const[N,E]of Object.entries(w)){const k=E!=null&&typeof E=="object";b.attrSet(`data-${N}`,k?JSON.stringify(E):String(E))}else b.attrSet("data-attrs",p)}const v=[];for(let w=n+1;w<_;w++){const N=i.bMarks[w]+i.tShift[w],E=i.eMarks[w];v.push(i.src.slice(N,E))}if(v.some(w=>w.trim().length>0)){let w=v.join(`
107
+ `);w.endsWith(`
108
+ `)||(w+=`
109
+ `),w.endsWith(`
110
+
111
+ `)||(w+=`
112
+ `);const N=i.tokens[i.tokens.length-1];N&&(N.raw=w);const E=[];i.md.block.parse(w,i.md,i.env,E),i.tokens.push(...E)}return y&&i.push("vmr_container_close","div",-1),i.line=y?_+1:_,!0},{alt:["paragraph","reference","blockquote","list"]})}const Ux=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],UR=["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"],jx=["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"],jR=["svg","g","path"],qR=["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"],zR=["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"],VR=["action","data","href","src","srcset","poster","xlink:href","formaction"],KR=["script"],GR=["pre","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title"],ml=new Set(Ux),YR=new Set(jx),Zc=new Set([...Ux,...UR,...jx,...jR]),qx=new Set([...Zc,...qR]),XR=new Set(zR),ZR=new Set(VR),pu=new Set(KR),zx=new Set(GR);function Vx(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 JR={amp:"&",bsol:"\\",colon:":",newline:`
113
+ `,sol:"/",tab:" "};function Kx(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 JR[String(o??"").toLowerCase()]??t})}const cd=new Set(["http","https","mailto","tel"]),sc=new Set(["http","https"]);function Gx(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function QR(e,t){return t==="href"||t==="xlink:href"?cd:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?sc:cd}function ha(e,t={}){const n=Vx(Kx(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=Gx(n);return i?!QR(s,o).has(i):!1}function e7(e){const t=Kx(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Gx(Vx(t).toLowerCase());return n==="http"||n==="https"}function t7(e,t={}){const n=String(e??"").trim();return n?ha(n,t)?"":n:""}function Kb(e){return t7(e,{tagName:"img",attrName:"src"})}function oo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Sn(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function Sh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const n7=/^[a-z][a-z0-9_-]*$/;function Gb(e){return n7.test(String(e??"").trim().toLowerCase())}function No(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Gb(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)?"":Gb(o)?o:""}function Ma(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=No(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function s7(...e){const t=new Set,n=[];for(const s of e)for(const o of Ma(s))t.has(o)||(t.add(o),n.push(o));return n}function o7(e){const t=Ma(e);return{key:t.join(","),tags:t}}function Yx(e){return No(e)}function i7(e,t){const n=String(e??""),s=No(t);if(!s)return!1;const o=oo(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 Xx(e,t){const n=No(t);return!!n&&!Zc.has(n)&&!i7(e,n)}function r7(e,t){const n=String(e??""),s=No(t);if(!s)return n;const o=oo(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 Zx=ml,l7=Zc,Jx=new Set(YR);Jx.delete("details");const a7=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,c7=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Bg=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,u7=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Mf(e){return(e.match(Bg)?.[1]??"").toLowerCase()}function wv(e){return/^\s*<\s*\//.test(e)}function Sv(e,t){return Zx.has(t)||/\/\s*>\s*$/.test(e)}function d7(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=Mf(i);if(r===t){if(wv(i)){if(n===0)return s;n--;continue}Sv(i,r)||n++}}return-1}function f7(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=Mf(o);if(i===t){if(wv(o)){n>0&&n--;continue}Sv(o,i)||n++}}return n}function Yb(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${oo(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 h7(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${oo(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 Af(e){const t=e;return String(t.raw??t.content??t.markup??"")}function p7(e){const t=e;return t.meta||(t.meta={}),t.meta}function um(e,t,n){const s=p7(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function m7(e,t){if(!t.size)return;const n=Array.from(t,p=>new RegExp(String.raw`<\s*${oo(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(`
114
+ `),o=!1)},a=p=>{r(p)},c=p=>{for(let g=0;g<s.length;g++)s[g].raw+=p,g<s.length-1&&(s[g].inner+=p);const h=s.pop();um(h.token,h.raw,h.inner)},u=p=>{const h=s[s.length-1]?.tag;if(!h)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${oo(h)}\s*>`,"i");return p.match(g)?.[0]??null},d=p=>!!u(p),f=(p,h,g)=>{const S=g??(p.type==="html_inline"?Mf(h):"");if(!(S&&t.has(S))){r(h);return}const _=wv(h),y=!_&&Sv(h,S);if(_){if(!s.length||s[s.length-1].tag!==S){r(h);return}c(h);return}if(r(h),y){um(p,h,"");return}s.push({tag:S,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 g=0,S=!0;for(const _ of p.children){const y=Af(_),b=_.type==="html_inline"?Mf(y):"",v=b&&t.has(b);let w=y;if(S&&h&&y&&(s.length||v)){const N=h.indexOf(y,g);if(N!==-1)a(h.slice(g,N)),w=h.slice(N,N+y.length),g=N+y.length;else{if(s.length&&!v)continue;S=!1}}f(_,w,b)}S&&h&&g<h.length&&s.length&&a(h.slice(g)),o=s.length>0;continue}if(s.length&&typeof p.content=="string"){const h=Af(p),g=p.type==="html_block"?u(h):null;if(g){c(`${o?`
115
+ `:""}${g}`),o=s.length>0;continue}if(!p.content)continue;l(),r(p.content),o=!0}}for(const p of s)um(p.token,p.raw,p.inner)}function g7(e){return/^\s*<\s*[!?]/.test(e)}function v7(e){const t=new Set(l7);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 Xb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function y7(e,t){let n=null;for(const i of e.matchAll(a7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Xb(l,t)&&Sn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(c7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Xb(l,t)&&Sn(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 k7(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function b7(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(k7(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(Bg);if(!p){i("<",c),u=d+1;continue}const h=Sn(f);if(h===-1){i("<",c),u=d+1;continue}const g=f.slice(0,h+1),S=(p[1]??"").toLowerCase();t.has(S)?n.push({type:"html_inline",tag:"",content:g,raw:g}):i(g,c),u=d+g.length}}function l(a,c){if(!a)return;const u=y7(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+=Af(a),o=s.buffer;const c=Sn(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=Af(a),u=(c.match(Bg)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Sn(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 _7=["a","span","strong","em","b","i","u"];function w7(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const p=No(f);p&&n.add(p)}const s=f=>{const p=f,h=new Set(n),g=Array.isArray(p.env?.__markstreamCustomHtmlTags)?p.env.__markstreamCustomHtmlTags:[];for(const b of g){const v=No(String(b??""));v&&h.add(v)}const S=v7(Array.from(h)),_=new Set(_7);for(const b of h)_.add(b);return{autoCloseInlineTagSet:_,commonHtmlTags:S,customTagSet:h,shouldMergeHtmlBlockTag:b=>h.has(b)||!S.has(b)||Jx.has(b)}},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 g=h.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const S={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return p==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},S,{type:"paragraph_close",tag:"p",nesting:-1}]:p==="text"?[{type:"text",content:g,raw:g}]:[S]},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:g}=s(f);for(const S of p){const _=S;if(_.type!=="inline"||!Array.isArray(_.children))continue;const y=String(_.content??""),b=_.children.length?_.children:y.includes("<")?[{type:"text",content:y,raw:y}]:null;if(b)try{const v=b7(b,h);if(_.children=v.children,v.pendingBuffer){const w=y.lastIndexOf(v.pendingBuffer);if(w!==-1){const N=y.slice(0,w);_.content=N,typeof _.raw=="string"&&(_.raw=N)}}}catch(v){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",v)}}m7(p,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const p=f.tokens??[],{autoCloseInlineTagSet:h,customTagSet:g,shouldMergeHtmlBlockTag:S}=s(f),_=[];for(let y=0;y<p.length;y++){const b=p[y];if(_.length>0){const[w,N]=_[_.length-1];if(y!==N){if(b.type==="paragraph_open"||b.type==="paragraph_close"){p.splice(y,1),y--;continue}const E=String(b.content??b.raw??"");if(E){const k=p[N],A=`${String(k.content||"")}
116
+ ${E}`,I=Sn(A),P=I===-1?null:Yb(A,w,I+1);if(P){const M=A.slice(0,P.end),L=A.slice(P.end);k.content=M,k.loading=!1,p.splice(y,1),_.pop();const R=d(k,L)?[]:c(L,u(p,y,"paragraph"));R.length&&p.splice(y,0,...R),y--;continue}k.content=A,k.loading!==!1&&(k.loading=!0)}p.splice(y,1),y--;continue}}const v=o(b);if(v){if(g7(v))continue;const w=(v.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(v);if(!w||!S(w))continue;if(i(b,v),!N)w&&!new RegExp(`^\\s*<\\s*${w}\\b[^>]*\\/\\s*>`,"i").test(v)&&h7(v,w)>0&&_.push([w,y]);else if(_.length>0&&w&&_[_.length-1][0]===w){const[,E]=_[_.length-1],k=p[E];k.content=`${String(k.content||"")}
117
+ ${v}`,k.loading=!1,_.pop(),p.splice(y,1),y--}continue}else if(_.length>0){if(b.type==="paragraph_open"||b.type==="paragraph_close"){p.splice(y,1),y--;continue}const w=b.content||"",N=new RegExp(`<\\s*\\/\\s*${_[_.length-1][0]}\\s*>`,"i").test(w);if(w){const[,E]=_[_.length-1],k=p[E];k.content=`${k.content||""}
118
+ ${w}`,k.loading!==!1&&(k.loading=!N)}N&&_.pop(),p.splice(y,1),y--}else continue}if(g.size>0){const y=new Map,b=new Map,v=E=>{let k=y.get(E);return k||(k=new RegExp(`<\\s*${E}\\b`,"i"),y.set(E,k)),k},w=E=>{let k=b.get(E);return k||(k=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),b.set(E,k)),k},N=[];for(let E=0;E<p.length;E++){const k=p[E],A=String(k.content??"");if(N.length>0){const P=N[N.length-1],M=p[P.index],L=k.type==="html_block"?w(P.tag).exec(A):null;if(L){const U=L.index+L[0].length,K=A.slice(0,U),V=A.slice(U);M.content=`${String(M.content??"")}
119
+ ${K}`,Array.isArray(M.children)&&M.children.push({type:"html_inline",content:`</${P.tag}>`,raw:`</${P.tag}>`}),N.pop();const se=d(M,V)?[]:c(V,u(p,E,"paragraph"));se.length?p.splice(E,1,...se):(p.splice(E,1),E--);continue}if(k.type!=="inline")continue;const R=Array.isArray(k.children)?k.children:[],B=d7(R,P.tag);if(B!==-1){const U=R.slice(0,B+1),K=R.slice(B+1),V=U.map(se=>String(se?.content??se?.raw??"")).join("");if(M.content=`${String(M.content??"")}
120
+ ${V}`,Array.isArray(M.children)&&M.children.push(...U),K.length){const se=K.map(Y=>String(Y.content??Y.raw??"")).join("");if(se.trim()){const Y=se.replace(/^\s+/,"");if(d(M,se))p.splice(E,1),E--;else if(Y.startsWith("<"))p.splice(E,1,{type:"html_block",content:Y});else{const G=c(se,u(p,E,"paragraph"));p.splice(E,1,...G)}}else p.splice(E,1),E--}else p.splice(E,1),E--;N.pop();continue}M.content=`${String(M.content??"")}
121
+ ${A}`,Array.isArray(M.children)&&M.children.push(...R),p.splice(E,1),E--;continue}if(k.type!=="inline")continue;const I=Array.isArray(k.children)?k.children:[];for(const P of g)if((I.length?f7(I,P):v(P).test(A)&&!w(P).test(A)?1:0)>0){N.push({tag:P,index:E});break}}}{let y=0;for(let b=0;b<p.length;b++){const v=p[b];if(v.type==="paragraph_open"){y++;continue}v.type==="paragraph_close"&&(y>0?y--:(p.splice(b,1),b--))}}for(let y=0;y<p.length;y++){const b=p[y];if(b.type==="html_block"){const k=(b.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(k.startsWith("!")||k.startsWith("?")){b.loading=!1;continue}if(g.has(k)){const B=String(b.content??""),U=Sn(B),K=U===-1?null:Yb(B,k,U+1);b.loading=K?!1:b.loading!==void 0?b.loading:!0;const V=K?.start??-1,se=K?K.end-K.start:0;if(V!==-1){const Y=B.slice(0,V+se);let G="";U!==-1&&U<V&&(G=B.slice(U+1,V)),b.children=[{type:k,content:G,raw:Y,attrs:[],tag:k,loading:!1}],b.content=Y,b.raw=Y;const ee=c(B.slice(V+se)||"","text");ee.length&&p.splice(y+1,0,...ee)}else b.children=[{type:k,content:"",raw:B,attrs:[],tag:k,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(k))continue;b.type="inline";const A=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let I;for(;(I=A.exec(b.content||""))!==null;)I[1],I[2]||I[3]||I[4];const P=String(b.content??""),M=new RegExp(`<\\/\\s*${k}\\s*>`,"i").exec(P),L=M?M.index:-1,R=M?M[0].length:0;if(L!==-1){const B=P.slice(0,L+R),U=(P.slice(L+R)||"").replace(/^\s+/,"");b.children=[{type:"html_block",content:B,tag:k,loading:!1}],b.content=B,b.raw=B,U&&p.splice(y+1,0,U.startsWith("<")?{type:"html_block",content:U}:{type:"text",content:U,raw:U})}else b.children=[{type:"html_block",content:b.content,tag:k,loading:!0}];continue}if(!b||b.type!=="inline")continue;if(b.children.length===2&&b.children[0].type==="html_inline"){const k=(b.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),A=b.children[1],I=String(A?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(A?.type==="html_inline"&&I===k)continue;h.has(k)?(b.children[0].loading=!0,b.children[0].tag=k,b.children.push({type:"html_inline",tag:k,loading:!0,content:`</${k}>`})):b.children=[{type:"html_block",loading:!0,tag:k,content:String(b.children[0]?.content??"")+String(b.children[1]?.content??"")}];continue}else if(b.children.length===3&&b.children[0].type==="html_inline"&&b.children[2].type==="html_inline"){const k=(b.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(h.has(k))continue;b.children=[{type:"html_block",loading:!1,tag:k,content:b.children.map(A=>A.content).join("")}];continue}if(!b.content?.startsWith("<")||b.children?.length!==1)continue;const v=String(b.content),w=b,N=w.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(v)&&(w.children.length=0);continue}const E=String(N.content??v).match(u7)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(v)||Zx.has(E)){w.children=[{type:"html_inline",content:v}];continue}w.children.length=0}}})}function S7(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 C7(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&&!S7(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 Qx=/\.([a-z0-9]{1,15})$/i,x7=/[_()[\]{}<>]/u,T7=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,M7=/[?#@]/u,A7=/[\\/]/u,E7=/^[\p{L}\p{N}./\\-]+$/u,$7=/^[A-Za-z0-9-]{1,63}$/u,I7=/^xn--[a-z0-9-]{2,59}$/i,N7=/^(?:[A-Z]{1,6}|\d{1,8})$/u,L7=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,O7=/文件名\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,P7=/文件名\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,R7=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,D7=new Set(["ai","md","py","rs","sh","zip"]),eT=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),B7=new Set([...eT,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),F7=new Set(["com","dev","io","page","site"]),H7=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),W7=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 Jc(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function dm(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Jc(n)?n:void 0}function Zb(e,t){if(!Jc(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 Jb(e){const t=mu(e);return Jc(t)?t:void 0}function U7(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Qb(e,t){if(!Jc(t))return;const n=String(e??"").trim().split(/\s+/u).map(U7).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>Ef(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>Ef(o,{marketTicker:!0}))&&(s.marketTicker=!0),Jc(s)?s:void 0}function Mr(e,t=!1){let n;return{options(s){return t||s==null?Zb(e,n):Zb(e,dm(Jb(s),Qb(s,n)))},remember(s){const o=Jb(s);n=t?dm(n,o):dm(o,Qb(s,n))},reset(){n=void 0}}}function e_(e){return $7.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function j7(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return e_(n)||I7.test(n)?t.every(e_):!1}function tT(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function q7(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function z7(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function nT(e,t,n){const s=q7(t);return tT(e)&&z7(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function mu(e){const t=String(e??"");return{explicitFilename:O7.test(t),filename:P7.test(t),marketTicker:R7.test(t)}}function V7(e){return j7(e.split(/[\\/]/)[0]??"")}function K7(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function G7(e){if(x7.test(e)||!E7.test(e))return!0;if(A7.test(e))return!V7(e);const t=e.replace(Qx,"");return tT(t)?!0:t.split(".").filter(Boolean).some(K7)}function Y7(e,t,n){if(!(n?B7:eT).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?L7:N7).test(s)}function Ef(e,t={}){if(!e||T7.test(e)||M7.test(e))return!1;const n=e.match(Qx);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return Y7(e,s,t.marketTicker===!0)?!0:W7.has(s)?!D7.has(s)||t.filename?!0:G7(e):!!(t.explicitFilename&&F7.has(s)||t.filename&&H7.has(s))}const t_=["!"];function Os(e){return{type:"text",content:e,raw:e}}function Kr(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 Gr(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 Zi(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 X7(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Os(t))}}function n_(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 Z7(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function J7(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 Q7(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 eD(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=tD(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function tD(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=mu(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=Q7(e,s,i),l=Z7(o);if(o.markup==="linkify"&&r&&!nT(r,l,t)&&Ef(r,n)){e.splice(s,i-s+1,Os(r));continue}const a=n_(l,t_);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=n_(u.content,t_);if(d===-1)continue;const f=u.content[d],p=u.content.slice(0,d);let h=u.content.slice(d);for(let _=c+1;_<i;_++){const y=e[_];y?.type==="text"&&typeof y.content=="string"&&(h+=y.content)}u.content=p,u.raw=p;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let S=l;if(a!==-1)S=l.slice(0,a);else if(h){const _=encodeURI(h);if(_&&l.endsWith(_))S=l.slice(0,l.length-_.length);else{const y=f?encodeURI(f):"",b=y?l.indexOf(y):-1;b!==-1&&(S=l.slice(0,b))}}S!==l&&J7(o,S),h&&e.splice(i+1,0,Os(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(Os(r));const c=i[1],u=l[1].length;Kr(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(Zi(c,d,!e[s+4]?.content?.startsWith(")"))),Gr(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(Os(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(Os(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=""),Kr(a,f),a.push(Zi(c,p,!e[s+4]?.content?.startsWith(")"))),Gr(a,f),e[s+4]?.type==="text"){const h=e[s+4].content?.replace(/^\)/,"");h&&a.push(Os(h)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===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(Zi(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(Os(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=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(Zi(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(Os(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(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;Kr(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 g=d?d[1].length:e[s-3].markup.length,S=e[h];if(g===1&&S.type==="em_close")break;if(g===2&&S.type==="strong_close")break;if(g===3&&(S.type==="em_close"||S.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;Gr(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(Os(l)),Kr(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(Zi(a,c,u)),Gr(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(Os(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(Os(r)),Kr(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(Zi(l,a,c)),Gr(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(Os(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(Os(r)),Kr(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(Zi(a,c,d)),Gr(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=[];Kr(a,2),a.push(Zi(r,l,!1)),Gr(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;X7(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function nD(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=sD(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function sD(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 oD(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=iD(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function iD(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 g=e[h];let S=u+1;for(;S<e.length&&e[S].type==="text"&&e[S].content==="";)S++;const _=e[S];p==="__"&&(g?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.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 g=e[h];let S=u+1;for(;S<e.length&&e[S].type==="text"&&e[S].content==="";)S++;const _=e[S];p==="_"&&(g?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.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=rD(l),l}function rD(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=lD(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 lD(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 aD(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=pD(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 s_(){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 o_(){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 i_(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 sT(e,t){if(!e.startsWith("|")||e.includes(`
122
+ `)||!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 fm(e){return sT(e)!==null}function oT(e){return/^:?-+:?$/.test(e.trim())}function cD(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(oT)}function uD(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function dD(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(oT)&&uD(n)}function fD(e){return e==="|"||e==="|:"}function hD(e){const t=sT(e);return t!==null&&t.every(n=>!n.includes(":"))}function pD(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(`
123
+ `)[0]??"",[a="",c="",...u]=r.split(`
124
+ `),d=!t&&!r.includes(`
125
+ `)&&/\r?\n$/.test(n)&&fm(r);if(!t&&(r.includes(`
126
+ `)&&u.length===0&&fm(a)&&dD(c)||d)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>i_(h)),p=[...s_(),...f,...o_()];s.splice(o-1,3,...p)}else if(r.includes(`
127
+ `)&&u.length===0&&fm(a)&&cD(c)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>i_(h)),p=[...s_(),...f,...o_()];s.splice(o-1,3,...p)}else r.includes(`
128
+ `)&&u.length===0&&hD(a)&&fD(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function mD(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 gD=mD;const vD=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],$f=vD.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),yD=/\\[a-z]+/i,iT="(?:\\\\|\\u0008)",kD=new RegExp(String.raw`${iT}(?:${$f})\s*\{[^}]+\}`,"i"),bD=new RegExp(String.raw`(?:${iT})?(?:${$f})\s*\{`,"i"),_D=/\\(?:text|frac|left|right|times)/,wD=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,SD=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,CD=/[A-Z]+\s*\([^)]+\)/i,xD=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,TD=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,MD=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,AD={"\b":"\\b","\v":"\\v","\f":"\\f"};function ED(e){let t="";for(const n of e)t+=AD[n]??n;return t}function Zl(e){if(!e)return!1;const t=ED(e),n=t.trim();if(MD.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=yD.test(t),o=kD.test(t),i=bD.test(t),r=_D.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=wD.test(t)&&!SD.test(t),c=CD.test(t),u=xD.test(n),d=TD.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 rT="__markstreamMathPluginApplied",Fg=80,lT=2e4,r_=lT+4096;function aT(e){return!!e[rT]}function $D(e){e[rT]=!0}const cT=["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"],ID=["cdot","mathbf{","partial","mu_{"],uT=cT.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),dT="[ \r\b\f\v]",ND=new RegExp(`([^\\\\])(${ID.map(e=>e).join("|")})+`,"g"),LD=/span\{([^}]+)\}/,OD=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,PD=/(^|[^\\])\\\r?\n/g,RD=/(^|[^\\])\\$/g,DD=new RegExp(`(${dT})|(${uT})\\b`,"g"),l_=new Map,a_=new Map;function BD(e){if(!e)return DD;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=l_.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${dT})|(${o})\\b`,"g");return l_.set(n,i),i}function FD(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=a_.get(s);if(o)return o;const i=e?[$f,uT].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),$f].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return a_.set(s,r),r}const c_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function u_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function d_(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 Ji(e,t){const n=t?.commands??cT,s=t?.escapeExclamation??!0,o=t?.commands==null,i=BD(o?void 0:n);let r=e.replace(i,(c,u,d,f,p)=>{if(u!==void 0&&c_[u]!==void 0)return`\\${c_[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=FD(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(LD,"span\\{$1\\}").replace(OD,"\\operatorname{span}\\{$1\\}"),l=l.replace(PD,`$1\\\\
129
+ `),l=l.replace(RD,"$1\\\\"),l=l.replace(ND,"$1\\$2"),l}function f_(e){const t=e.trim();return!(!Zl(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 fT(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 If(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function HD(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 gu(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Hg(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(gu(e,s)){n=s+1;continue}return s}return-1}function hm(e,t){let n=t;for(;n<e.length;){const s=Hg(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 fc(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(!gu(e,o))return o;s=o+Math.max(1,t.length)}return-1}function h_(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=If(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}gu(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Cv(e,t,n){const s=eu(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!eu(s.slice(0,o)).trim()||gu(s,o))return-1;const i=fT(s);if(If(i,o))return-1;const r=h_(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>h_(s,n,0,o,i))return-1;return o}function Qc(e){return e===" "||e===" "}function eu(e){let t=e.length;for(;t>0&&Qc(e[t-1]);)t--;return e.slice(0,t)}function p_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
130
+ `&&t++;return t}function m_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function WD(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(!Qc(o))return!1}return n>=3}function UD(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 jD(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(UD)}function qD(e){let t=0;if(!m_(e[t]))return!1;for(;m_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Qc(e[t+1])}function hT(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&&Qc(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Qc(t[1])||qD(t)||WD(t)||jD(t))}function g_(e,t){return e?t?`${e}
131
+ ${t}`:e:t}function Wg(e){const t=String(e??"").trim();return t?Zl(t):!1}function v_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function pT(e){if(e.length<=r_)return{source:e,lineOffset:0};let t=e.length-r_;const n=e.indexOf(`
132
+ `,t);return n===-1?{source:"",lineOffset:p_(e)}:(t=n+1,{source:e.slice(t),lineOffset:p_(e.slice(0,t))})}function mT(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=pT(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-Fg-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=eu(s[r]);if(l&&!hT(l)){for(const[a,c]of i)if(Cv(l,a,c)!==-1)return!0}}return!1}function zD(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=pT(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-Fg-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=eu(o[l]);for(const[c,u]of r){const d=Cv(a,c,u);if(d===-1)continue;let f="",p=!1;for(let h=l+1;h<o.length;h++){if(h-l>Fg){p=!0;break}const g=o[h],S=fc(g,u);if(S!==-1){const _=g_(f,g.slice(0,S));if(!Wg(_)){p=!0;break}const y=g.slice(S+u.length),b=y.trim()?`suffix:${v_(y)}`:"nosuffix";return["closed",c,s+l,d,s+h,S,v_(_),b].join(":")}if(hT(g)){p=!0;break}if(f=g_(f,g),f.length>lT){p=!0;break}}if(!p&&Wg(f))return["pending",c,s+l,d].join(":")}}return null}function pm(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function VD(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 mm(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function KD(e,t){$D(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=(y,b)=>{let v=b;for(;v<y.length&&(y[v]===" "||y[v]===" ");)v++;if(v===b||!(y[v]===`
133
+ `||y[v]==="\r"&&y[v+1]===`
134
+ `))return b;const w=y.slice(b,v),N=a.push("text","",0);return N.content=w,v};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let y=a.pos+1;for(;a.src[y]==="$";)y++;const b=y-a.pos,v=a.src[y];if(b>=3&&(!v||/\s/.test(v))){const w=a.push("text","",0);return w.content=a.src.slice(a.pos,y),a.pos=y,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(a.pending??""),h=Math.max(0,a.pos-p.length);let g=h,S=h;const _=h;for(const[y,b]of f){const v=a.src,w=fT(v),N=HD(v,u);let E=!1;y==="$$"&&g!==_&&(g=_);let k=-1,A=-1,I=0;const P=M=>{if((M==="undefined"||M==null)&&(M=""),M==="\\"){a.pos=a.pos+M.length,g=a.pos;return}if(M==="\\)"||M==="\\("){const B=a.push("text_special","",0);B.content=M==="\\)"?")":"(",B.markup=M,a.pos=a.pos+M.length,g=a.pos;return}if(!M)return;if(y==="$$"&&M.includes("$")){let B=0;for(;B<M.length;){const U=Hg(M,B);if(U===-1){const de=M.slice(B);if(de){const we=a.push("text","",0);we.content=de,a.pos=a.pos+de.length,g=a.pos}break}if(U>0&&M[U-1]==="$"||U+1<M.length&&M[U+1]==="$"){const de=M.slice(B,U+1);if(de){const we=a.push("text","",0);we.content=de,a.pos=a.pos+de.length,g=a.pos}B=U+1;continue}const K=M.slice(B,U);if(K){const de=a.push("text","",0);de.content=K,a.pos=a.pos+K.length,g=a.pos}const V=hm(M,U+1);if(V===-1){const de=M.slice(U),we=a.push("text","",0);we.content=de,a.pos=a.pos+de.length,g=a.pos;break}const se=M.slice(U+1,V),Y=se.includes("`"),G=!se||!se.trim(),ee=M[V+1],Se=pm(se,ee),ae=mm(se);if(!Y&&!G&&!Se&&!ae){const de=a.push("math_inline","math",0);de.content=Ji(se,t),de.markup="$",de.raw=`$${se}$`,de.loading=!1,a.pos=a.pos+(V-U+1),g=a.pos,B=V+1;continue}const Ie=a.push("text","",0);Ie.content="$",a.pos=a.pos+1,g=a.pos,B=U+1}return}const L=M.indexOf("![");if(L!==-1){if(L>0){const K=M.slice(0,L),V=a.push("text","",0);V.content=K,a.pos=a.pos+K.length,g=a.pos}const B=M.slice(L).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,K,V]=B,se=V.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),Y=se?se[1]:V,G=se&&se[2]?se[2]:null,ee=a.push("image","img",0);ee.attrs=[["src",Y],["alt",K]],G&&ee.attrs.push(["title",G]),ee.content=K,ee.children=[{type:"text",content:K,tag:""}],a.pos=a.pos+B[0].length,g=a.pos;const Se=M.slice(L+B[0].length);Se&&P(Se);return}const U=a.push("text","",0);U.content=M,a.pos=a.pos+M.length,g=a.pos;return}const R=a.push("text","",0);R.content=M,a.pos=a.pos+M.length,g=a.pos};for(;!(g>=v.length);){const M=v.indexOf(y,g);if(M===-1)break;if(gu(v,M)){g=M+Math.max(1,y.length);continue}const L=If(w,M);if(L){g=L[1];continue}const R=If(N,M);if(R){g=R[1];continue}if(M===k&&g===A){if(I++,I>2){g=M+Math.max(1,y.length);continue}}else I=0,k=M,A=g;if(y==="("&&M>0){let Se=M-1;for(;Se>=0&&v[Se]===" ";)Se--;if(Se>=0&&v[Se]==="]"){g=M+y.length;continue}}if(y==="$"&&M>0&&v[M-1]==="$"){g=M+1;continue}if(y==="$"&&M<v.length-1&&v[M+1]==="$"){g=M+2;continue}const B=y==="$"?hm(v,M+y.length):gD(v,M+y.length,y,b);if(B===-1){const Se=v.slice(M+y.length);if(Se.includes(y)){g=v.indexOf(y,M+y.length);continue}if(B===-1){const ae=y==="$"&&VD(Se);if(u&&!c&&!ae&&Zl(Se)&&!Se.includes("`")){if(g=M+y.length,E=!0,!l){a.pending="";const Ie=S?v.slice(S,g):v.slice(0,g),de=u_(Ie)%2===1;if(S)P(v.slice(S,g));else{let we=v.slice(0,g);we.endsWith(y)&&(we=we.slice(0,we.length-y.length)),P(we)}if(de){const we=d_(Ie)?.marker??"**",me=a.push("strong_open","",0);me.markup=we;const $e=a.push("math_inline","math",0);$e.content=Ji(Se,t),$e.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",$e.raw=`${y}${Se}${b}`,$e.loading=!0,me.content=Se,a.push("strong_close","",0)}else{const we=a.push("math_inline","math",0);we.content=Ji(Se,t),we.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",we.raw=`${y}${Se}${b}`,we.loading=!0}a.pos=v.length}g=v.length,S=g}break}}const U=v.slice(M+y.length,B),K=U.includes("`"),V=!U||!U.trim(),se=y==="$",Y=v[B+b.length],G=se&&pm(U,Y),ee=se&&mm(U);if(c?K||V||G||ee:K||V||G||ee||!se&&!Zl(U)){g=B+b.length;const Se=v.slice(a.pos,g);a.pending||(P(Se),S=g);continue}if(E=!0,!l){const Se=v.slice(a.pos-(a.pending??"").length,M);let ae=v.slice(0,g)?v.slice(S,M):Se;const Ie=u_(ae)%2===1;M!==a.pos&&Ie&&(ae=a.pending+v.slice(a.pos,M));const de=Ie?d_(ae):null,we=de?.marker??"**";if(a.pending!==ae)if(a.pending="",Ie)if(de){const me=ae.slice(de.index+we.length);P(ae.slice(0,de.index));const $e=a.push("strong_open","",0);$e.markup=we;const J=a.push("text","",0);J.content=me,a.push("strong_close","",0)}else P(ae);else P(ae);if(Ie){const me=a.push("strong_open","",0);me.markup=we;const $e=a.push("math_inline","math",0);$e.content=Ji(U,t),$e.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",$e.raw=`${y}${U}${b}`,$e.loading=!1;const J=v.slice(B+b.length).startsWith(we);return J&&a.push("strong_close","",0),a.pos=d(v,B+b.length),g=a.pos,S=g,J||a.push("strong_close","",0),!0}else{const me=a.push("math_inline","math",0);me.content=Ji(U,t),me.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",me.raw=`${y}${U}${b}`,me.loading=!1}}return g=d(v,B+b.length),S=g,a.pos=g,!0}if(E){if(l)a.pos=g;else{if(y==="$$"&&g<v.length&&v.slice(g).includes("$")){let M=g;for(;!(M>=v.length);){const L=Hg(v,M);if(L===-1)break;if(L+1<v.length&&v[L+1]==="$"){M=L+2;continue}if(L>0&&v[L-1]==="$"){M=L+1;continue}const R=hm(v,L+1);if(R===-1)break;const B=v.slice(L+1,R),U=B.includes("`"),K=!B||!B.trim(),V=v[R+1],se=pm(B,V),Y=mm(B);if(!U&&!K&&!se&&!Y){const G=v.slice(g,L);G&&P(G);const ee=a.push("math_inline","math",0);ee.content=Ji(B,t),ee.markup="$",ee.raw=`$${B}$`,ee.loading=!1,g=R+1,M=R+1}else P("$"),M=L+1}M<v.length&&P(v.slice(M))}else g<v.length&&P(v.slice(g));a.pos=v.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 g=u.src.slice(h,u.eMarks[l]).trim(),S=!1,_="",y="",b=!1,v="",w=!1;for(const[G,ee]of p)if(g.startsWith(G))if(G.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){S=!0,_=G,y=ee;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){S=!0,_=G,y=ee;break}continue}else{const Se=u.tokens[u.tokens.length-1];if(Se&&Se.type==="list_item_open"&&Se.mark==="-"&&g.slice(G.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const ae=g.indexOf("]");if(g.slice(ae).trim()!=="]")continue;const Ie=g.slice(G.length,ae);if(G==="["?f_(Ie):Zl(Ie)){S=!0,_=G,y=ee;break}continue}}else{S=!0,_=G,y=ee;break}else if((G==="$$"||G==="\\[")&&g.endsWith(G)&&l+1<a){const Se=Cv(g,G,ee);if(Se===-1)continue;v=eu(g.slice(0,Se)),w=!0;const ae=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(ae,u.eMarks[l+1]).trim(),b=!0,S=!0,_=G,y=ee;break}if(!S)return!1;if(c&&!w)return!0;const N=g.indexOf(_),E=N+_.length,k=!f&&_==="["?g.indexOf("\\]",E):-1,A=k>=0?"\\]":y,I=k>=0?k:fc(g,y,E);if(!b&&I>_.length){const G=g.slice(N+_.length,I),ee=u.push("math_block","math",0);ee.content=Ji(G),ee.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",ee.map=[l,l+1],ee.raw=`${_}${G}${A}`,ee.block=!0,ee.loading=!1,u.line=l+1;const Se=g.slice(I+A.length);return Se.trim()&&n(u,Se,l),!0}let P=l,M="",L=!1,R="",B=l;const U=b?g:g===_?"":g.slice(_.length),K=!f&&_==="\\["?"]":"",V=fc(U,y);if(V!==-1){const G=V;M=U.slice(0,G),R=U.slice(G+y.length),B=b?l+1:l,L=!0,P=B}else for(U&&!b&&(M=U),P=l+1;P<a;P++){const G=u.bMarks[P]+u.tShift[P],ee=u.eMarks[P],Se=u.src.slice(G,ee),ae=Se.trim();if(!f&&_==="["&&ae==="\\]"){y="\\]",L=!0;break}if(K&&Se.trim()===K){y=K,L=!0;break}if(ae===y){L=!0;break}else if(!f&&_==="["&&Se.includes("\\]")){L=!0;const Ie=Se.indexOf("\\]");y="\\]";const de=Se.slice(0,Ie);de&&(M+=(M?`
135
+ `:"")+de),R=Se.slice(Ie+y.length),B=P;break}else if(fc(Se,y)!==-1){L=!0;const Ie=fc(Se,y),de=Se.slice(0,Ie);de&&(M+=(M?`
136
+ `:"")+de),R=Se.slice(Ie+y.length),B=P;break}M+=(M?`
137
+ `:"")+Se}if((!d||f)&&!L)return!1;const se=/^\s*!\[/.test(M);if(!(w?!se&&Wg(M):_==="$$"?!se:_==="["?f_(M):Zl(M)))return!1;if(c)return!0;v&&n(u,v,l);const Y=u.push("math_block","math",0);return Y.content=Ji(M),Y.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",Y.raw=`${_}${M}${M.startsWith(`
138
+ `)?`
139
+ `:""}${y}`,Y.map=[l,P+1],Y.block=!0,Y.loading=!L,u.line=P+1,R.trim()&&n(u,R,B),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,c)};e.inline.ruler.before("escape","math",s),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function GD(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 YD(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=new BR({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return(e.enableMath??!0)&&KD(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&WR(o),e.enableFixIndentedCodeBlock!==!1&&C7(o),eD(o),oD(o),nD(o),aD(o),GD(o),w7(o,{customHtmlTags:e.customHtmlTags}),o}function ll(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=>ll(n))),t}function XD(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function ZD(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 JD(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function ud(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(...Cn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const y_=/\r?\n[ \t]*`+\s*$/,gT=["diff ","index ","--- ","+++ ","@@ "],QD=/\r?\n/;function eB(e){const t=String(e??"");return t?gT.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function k_(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function tB(e,t){const n=[],s=[],o=[],i=[],r=e.split(QD),l=/\r?\n$/.test(e),a=r.some(p=>p.startsWith("diff ")||p.startsWith("--- ")||p.startsWith("+++ ")||p.startsWith("@@ ")),c=p=>{const h=p;if(!gT.some(g=>h.startsWith(g)))if(h.startsWith("-")){const g=h.slice(1);o.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(h.startsWith("+")){const g=h.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{k_(n,s,o,i);const g=a&&h.startsWith(" ")?h.slice(1):h;n.push(g),s.push(g)}},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&&eB(h)||c(h)}(t||o.length>0||i.length>0)&&k_(n,s,o,i);const d=n.join(`
140
+ `),f=s.join(`
141
+ `);return{original:t&&l&&d?`${d}
142
+ `:d,updated:t&&l&&f?`${f}
143
+ `:f}}function xv(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(y_.test(a)&&(a=a.replace(y_,"")),r){const{original:c,updated:u}=tB(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 nB(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function sB(){return{type:"hardbreak",raw:`\\
144
+ `}}function oB(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(...Cn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let gm=null;const vm=new WeakMap;function b_(){return gm||(gm={customTagSet:null,allowedTagSet:Th()}),gm}function vT(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function yT(e){return/^<\s*\//.test(e)}function kT(e,t){return/\/\s*>\s*$/.test(t)||ml.has(e)}function iB(e){if(!e||e.length===0)return b_();const t=vm.get(e);if(t)return t;const n=e.map(No).filter(Boolean);if(!n.length){const o=b_();return vm.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:Th({customHtmlTags:e})};return vm.set(e,s),s}function bT(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function rB(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function Nf(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 lB(e,t,n){const s=e.slice();return Nf(s,"href")||s.push(["href",t]),n!=null&&!Nf(s,"title")&&s.push(["title",n]),s}function Ug(e){return e.map(bT).join("")}function Nd(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:Nd(s.children)});continue}t.push(s)}return t}function aB(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=vT(r),a=yT(r),c=kT(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function ym(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?aB(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:Ug(s),innerTokens:o,nextIndex:i}}function cB(e,t,n,s,o,i,r){const l=String(e.content??""),a=vT(l),{customTagSet:c,allowedTagSet:u}=iB(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!ym(t,n,a).closed){const w=bT(e);return[{type:"text",content:w,raw:w},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=yT(l),f=kT(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const w=ym(t,n,a),N=Sh(l),E=w.innerTokens,k=String(Nf(N,"href")??""),A=Nf(N,"title"),I=A==null?null:String(A),P=lB(N,k,I),M=Nd(E.length?s(E,o,i,r):[]),L=E.length?Ug(E):k||"";return!M.length&&L&&M.push({type:"text",content:L,raw:L}),[{type:"link",href:k,title:I,text:L,attrs:P,children:M,loading:!w.closed,raw:w.html||l},w.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const p=ym(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Nd(p.innerTokens.length?s(p.innerTokens,o,i,r):[]),raw:p.html},p.nextIndex];const h=Nd(p.innerTokens.length?s(p.innerTokens,o,i,r):[]);let g=p.html||l,S=!p.closed,_=!1;if(!p.closed){const w=`</${a}>`;g.toLowerCase().includes(w.toLowerCase())||(g+=w),_=!0,S=!0}const y=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=b.exec(l))!==null;){const w=v[1],N=v[2]||v[3]||v[4]||"";y.push([w,N])}if(c?.has(a)){const w=rB(e);return[{type:a,tag:a,attrs:y,content:w?w.inner:p.innerTokens.length?Ug(p.innerTokens):"",children:p.innerTokens.length?s(p.innerTokens,o,i,r):[],raw:w?.raw??g,loading:e.loading||S,autoClosed:_},p.nextIndex]}return[{type:"html_inline",tag:a,attrs:y,content:g,children:h,raw:g,loading:S,autoClosed:_},p.nextIndex]}function _T(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=>_T(t)).join(""):String(e.content??"")}function uB(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>_T(t)).join("")}function __(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=uB(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 dB(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function fB(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(...Cn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function hB(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 Lf(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 pB(e,t,n){const s=e.slice();return Lf(s,"href")||s.push(["href",t]),n!=null&&!Lf(s,"title")&&s.push(["title",n]),s}function dd(e,t,n){const s=e[t],o=hB(s.attrs),i=String(Lf(o,"href")??""),r=Lf(o,"title"),l=r==null?null:String(r),a=pB(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(S=>S.type==="strong_open")){const S=String(p.content??""),_=String(p.raw??S),y=ll(p);y.content=S.slice(0,-2),y.raw=_.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=y}const h=Cn(f,void 0,void 0,n),g=h.map(S=>{const _=S;return"content"in S?String(_.content??""):String(_.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:h,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function w_(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 mB(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function S_(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(...Cn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const gB=/\\([\\()[\]`$|*_\-!])/g;function vB(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(gB,"$1")===t))return n}function oc(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(...Cn(l,vB(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function yB(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(...Cn(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 kB(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(...Cn(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 bB(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const _B=/[^~]*~{2,}[^~]+/,wB=/\*\*/,SB=/[[_*^~]/,CB=/\\([\\()[\]`$|*_\-!])/g,Tv=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),xB=/\s/u,TB=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,MB=/\p{P}/u,AB=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,EB=/:\/\//;function $B(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 wT(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&&Tv.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function _r(e){return!!e&&xB.test(e)}function wr(e){return!!e&&(TB.test(e)||MB.test(e))}function IB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||_r(s)?!1:!(wr(s)&&n&&!_r(n)&&!wr(n))}function NB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||_r(n)?!1:!(wr(n)&&s&&!_r(s)&&!wr(s))}function LB(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?wT(e,s):t.indexOf("*",s);if(i===-1)break;if(NB(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function OB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||_r(s)?!1:!(wr(s)&&n&&!_r(n)&&!wr(n))}function PB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||_r(n)?!1:!(wr(n)&&s&&!_r(s)&&!wr(s))}function RB(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(PB(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function DB(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&&Tv.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function BB(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&Tv.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function FB(e,t,n){const s=BB(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 HB=/[\p{L}\p{N}]/u,WB=/^[\p{L}\p{N}]+$/u;function jg(e){return e?HB.test(e):!1}function ST(e){return e?WB.test(e):!1}function Tc(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:jg(s)&&jg(o)}}function UB(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=Tc(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(!ST(e.slice(s.end,o.start)))return o.end}return-1}function jB(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function qB(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=Tc(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function zB(e){return e?AB.test(e)||EB.test(e):!1}function VB(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Cn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=mu(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 g(J,ye){const _e=e.length===1?t:String(ye.content??""),W=[],Z=UB(J);if(Z!==-1){w(J.slice(0,Z),J.slice(0,Z));const oe=J.slice(Z);return oe&&(I({type:"text",content:oe,raw:oe}),u--),u++,!0}if(_B.test(J)){const oe=J.indexOf("~~");oe!==-1&&W.push({type:"strikethrough",index:oe})}if(wB.test(J)){const oe=J.indexOf("**");oe!==-1&&W.push({type:"strong",index:oe})}if(/[^*]*\*[^*]+/.test(J)){const oe=_e?wT(_e,0):J.indexOf("*");if(_e&&oe===-1)return!1;oe!==-1&&W.push({type:"emphasis",index:oe})}W.sort((oe,he)=>oe.index!==he.index?oe.index-he.index:oe.type===he.type?0:oe.type==="strong"?-1:he.type==="strong"?1:0);const fe=W[0];if(!fe)return!1;if(fe.type==="strikethrough"){const oe=fe.index,he=oe>-1?J.slice(0,oe):"";if(he&&w(he,he),oe===-1)return u++,!0;const H=J.indexOf("~~",oe+2),X=H===-1?J.slice(oe+2):J.slice(oe+2,H),ce=H===-1?"":J.slice(H+2),{node:ke}=S_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:X,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return h(),v(ke),ce&&(I({type:"text",content:ce,raw:ce}),u--),u++,!0}if(fe.type==="strong"){const oe=fe.index,he=oe>-1?J.slice(0,oe):"";if(he&&w(he,he),oe===-1)return u++,!0;if(t&&oe===0){let Ne=!1,re=0;for(;re<J.length&&J[re]==="*";)re++;if(t.startsWith("\\*")&&(Ne=!0),Ne){let le=0,Ce=0;for(;Ce<t.length&&le<re;)if(t[Ce]==="\\"&&Ce+1<t.length&&t[Ce+1]==="*")le+=1,Ce+=2;else{if(t[Ce]==="*")break;Ce++}if(le>=2)return w(J,J),u++,!0}}if(t&&(J.match(/\*/g)||[]).length>$B(t))return w(J.slice(he.length),J.slice(he.length)),u++,!0;const H=Tc(J,oe);if(H.len>=3){const Ne=qB(J,oe+H.len);if(Ne!==-1){const re=J.slice(oe+H.len,Ne);if(jB(re)){const{node:le}=oc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re,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(),v(le);const Ce=J.slice(Ne+3);return Ce&&(I({type:"text",content:Ce,raw:Ce}),u--),u++,!0}}}if(!OB(J,oe)){const Ne=J.slice(oe,oe+H.len);w(Ne,Ne);const re=J.slice(oe+H.len);return re&&(I({type:"text",content:re,raw:re}),u--),u++,!0}const X=RB(J,oe+2);let ce="",ke="";if(X.index!==-1){ce=J.slice(oe+2,X.index),ke=J.slice(X.index+2);const Ne=X.index,re=Tc(J,Ne);if(H.intraword&&re.intraword&&!ST(ce)||!ce&&H.len>=4&&H.intraword)return w(J.slice(he.length),J.slice(he.length)),u++,!0}else{if(d||X.sawInvalidClose||H.intraword)return w(J.slice(he.length),J.slice(he.length)),u++,!0;ce=J.slice(oe+2),ke=""}if(!ce&&/^\*+$/.test(ke))return w(J,J),u++,!0;const{node:Me}=oc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ce,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return h(),v(Me),ke&&(I({type:"text",content:ke,raw:ke}),u--),u++,!0}if(fe.type==="emphasis"){let oe=fe.index;oe===-1&&(oe=0);const he=J.slice(0,oe);if(he&&w(he,he),!IB(J,oe)){w(J[oe],J[oe]);const Ne=J.slice(oe+1);return Ne&&(I({type:"text",content:Ne,raw:Ne}),u--),u++,!0}const H=Tc(J,oe),X=LB(_e,J,oe+1),ce=X.index,ke=e[u+1];if(s?.final&&ke?.type==="em_open"&&ce!==-1&&J.slice(oe+1,ce).trim()!==J.slice(oe+1,ce)||ce===-1&&(X.sawInvalidClose||s?.final||H.intraword||!jg(J[oe+1])))return w(J.slice(oe),J.slice(oe)),u++,!0;const{node:Me}=ud([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ce>-1?J.slice(oe+1,ce):J.slice(oe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(h(),v(Me),ce!==-1&&ce<J.length-1){const Ne=J.slice(ce+1);Ne&&(I({type:"text",content:Ne,raw:Ne}),u--)}return u++,!0}return!1}function S(J,ye){if(!J.includes("`"))return!1;const W=(ke=>{for(let Me=0;Me<ke.length;Me++){if(ke[Me]!=="`")continue;let Ne=0;for(let re=Me-1;re>=0&&ke[re]==="\\";re--)Ne++;if(Ne%2===0)return Me}return-1})(J);if(W===-1)return!1;let Z=1;for(let ke=W+1;ke<J.length&&J[ke]==="`";ke++)Z++;const fe="`".repeat(Z),oe=W+Z,he=J.indexOf(fe,oe);if(he===-1){if(Z===1){const Me=J.slice(0,W),Ne=J.slice(W+1);return Me&&(g(Me,ye)?u--:w(Me,Me)),y({type:"inline_code",code:Ne,raw:String(Ne)}),u++,!0}let ke=J;for(let Me=u+1;Me<e.length;Me++)ke+=String((e[Me].content??"")+(e[Me].markup??""));return u=e.length-1,w(ke,ke),u++,!0}h();const H=J.slice(0,W),X=J.slice(W+Z,he),ce=J.slice(he+Z);return H&&(g(H,ye)?u--:w(H,H)),y({type:"inline_code",code:X,raw:String(X??"")}),ce&&(I({type:"text",content:ce,raw:ce}),u--),u++,!0}function _(J){const ye=l?.__markdownIt;if(!ye||e.length<=1||!e.some(fe=>fe?.type==="math_inline")||!SB.test(J))return null;const _e=ye.parseInline(J,{__markstreamFinal:!!s?.final});if(!Array.isArray(_e)||_e.length===0)return null;const W=(_e.find(fe=>fe?.type==="inline")?.children??[]).filter(fe=>!(fe?.type==="text"&&String(fe.content??"")===""));if(!W.length||!W.some(fe=>fe?.type!=="text")||W.length===1&&W[0]?.type==="text"&&String(W[0].content??"")===J)return null;const Z=Cn(W,J,n,s);return Z.length?Z:null}function y(J){h(),a.push(J)}function b(J){h();const ye=ll(J);a.push(ye)}function v(J){y(J)}function w(J,ye){c?(c.content+=J,c.raw+=ye??J):(c={type:"text",content:String(J??""),raw:String(ye??J??"")},a.push(c))}function N(J,ye){if(!J)return;const _e=Cn([{...ye,type:"text",content:J,raw:J}],J,n,s);if(_e.length===1&&_e[0]?.type==="text"){const W=_e[0];w(String(W.content??""),String(W.raw??W.content??""));return}for(const W of _e)v(W)}function E(J,ye){return String(J.markup??"").startsWith(ye)}function k(J){return J.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 A(J,ye){let _e=J;const W=String(ye.content??"");return _e.endsWith("\\")&&!E(ye,"\\\\")&&!W.endsWith("\\\\")&&(_e=_e.slice(0,-1)),_e.endsWith("(")&&!E(ye,"\\(")&&!W.endsWith("\\(")&&(_e=_e.slice(0,-1)),/\*+$/.test(_e)&&!E(ye,"\\*")&&!W.endsWith("\\*")&&(_e=_e.replace(/\*+$/,"")),_e}for(;u<e.length;){const J=e[u];I(J)}function I(J){switch(J.type){case"text":M(J);break;case"softbreak":c?(c.content+=`
145
+ `,c.raw+=`
146
+ `):(c={type:"text",content:`
147
+ `,raw:`
148
+ `},a.push(c)),u++;break;case"code_inline":v(dB(J)),u++;break;case"html_inline":{const[ye,_e]=cB(J,e,u,Cn,t,n,s);v(ye),u=_e;break}case"link_open":L(J);break;case"image":Se(J)||(h(),v(__(J)),u++);break;case"strong_open":{h();const{node:ye,nextIndex:_e}=oc(e,u,J.content,s);v(ye),u=_e;break}case"em_open":{h();const{node:ye,nextIndex:_e}=ud(e,u,s);v(ye),u=_e;break}case"s_open":{h();const{node:ye,nextIndex:_e}=S_(e,u,s);v(ye),u=_e;break}case"mark_open":{h();const{node:ye,nextIndex:_e}=oB(e,u,s);v(ye),u=_e;break}case"ins_open":{h();const{node:ye,nextIndex:_e}=fB(e,u,s);v(ye),u=_e;break}case"sub_open":{h();const{node:ye,nextIndex:_e}=yB(e,u,s);v(ye),u=_e;break}case"sup_open":{h();const{node:ye,nextIndex:_e}=kB(e,u,s);v(ye),u=_e;break}case"sub":h(),v({type:"subscript",children:[{type:"text",content:String(J.content??""),raw:String(J.content??"")}],raw:`~${String(J.content??"")}~`}),u++;break;case"sup":h(),v({type:"superscript",children:[{type:"text",content:String(J.content??""),raw:String(J.content??"")}],raw:`^${String(J.content??"")}^`}),u++;break;case"emoji":{h();const ye=e[u-1];ye?.type==="text"&&/\|:-+/.test(String(ye.content??""))?w("",""):v(JD(J)),u++;break}case"checkbox":h(),v(XD(J)),u++;break;case"checkbox_input":h(),v(ZD(J)),u++;break;case"footnote_ref":h(),v(nB(J)),u++;break;case"footnote_anchor":{h();const ye=J.meta??{};y({type:"footnote_anchor",id:String(ye.label??J.content??""),raw:String(J.content??"")}),u++;break}case"hardbreak":h(),v(sB()),u++;break;case"fence":h(),v(xv(e[u])),u++;break;case"math_inline":h(),!J.content&&J.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(v(w_({...J,content:e[u+1].content})),u+=2):v(w_(J)),u++;break;case"reference":B(J);break;case"text_special":w(String(J.content??""),String(J.content??"")),u++;break;default:{const ye=J;if(J.type==="link"&&ye.href!=null&&s?.validateLink&&!s.validateLink(String(ye.href))){h();const _e=String(ye.text??"");w(_e,_e),u++}else ae(J)||K(J)||se(J)||U(J)||b(J),u++;break}}}function P(J,ye,_e,W){const Z=bB({...ye,content:J});if(c){c.content+=A(Z.content,ye),c.raw+=Z.raw;return}const fe=_e?.tag==="br"&&e[u-2]?.content==="[";W||(Z.content=A(Z.content,ye)),c=Z,c.center=fe,a.push(c)}function M(J){const ye=String(J.content??""),_e=e.length===1&&ye.includes("\\")&&typeof t=="string"?String(t):"";let W=_e?DB(_e):ye.replace(CB,"$1");if(J.content==="<"||W==="1"&&e[u-1]?.tag==="br"){u++;return}const Z=W.indexOf("$");Z!==-1&&Z===W.lastIndexOf("$")&&W.endsWith("$")&&(W=W.slice(0,-1)),W.endsWith("undefined")&&!t?.endsWith("undefined")&&(W=W.slice(0,-9));let fe=a.length,oe="";for(let ce=a.length-1;ce>=0;ce--){const ke=a[ce];if(ke.type!=="text")break;fe=ce,oe=String(ke.content??"")+oe}fe<a.length&&(W.startsWith(oe)?(c=null,a.length=fe):c=a[a.length-1]);const he=e[u+1];if((W==="`"||W==="|"||W==="$")&&!E(J,`\\${W}`)||/^\*+$/.test(W)&&!E(J,"\\*")){u++;return}if(!he&&/[^\]]\s*\(\s*$/.test(W)&&(W=W.replace(/\(\s*$/,"")),!W){u++;return}if(ee(W)||Ie(W))return;if(!(W.includes("*")||W.includes("_")||W.includes("~")||W.includes("`")||W.includes("[")||W.includes("!")||W.includes("$")||W.includes("|")||W.includes("("))){P(W,J,e[u-1],he),u++;return}if($e(W))return;const H=e[u-1];if(W==="["&&!he?.markup?.includes("*")&&!E(J,"\\[")||W==="]"&&!H?.markup?.includes("*")&&!E(J,"\\]")){u++;return}if(S(ye,J)||me(W)||(e[u+1]?.type!=="link_open"||k(W))&&we(W,J))return;const X=_(ye);if(X){h();for(const ce of X)v(ce);u++;return}g(W,J)||(P(W,J,H,he),u++)}function L(J){if(R(J))return;if(de()){const{node:he,nextIndex:H}=dd(e,u,s),X=String(he.text||he.href||"");w(X,X),u=H;return}h();const{node:ye,nextIndex:_e}=dd(e,u,s);u=_e;const W=ye.text||ye.href||"";if(J.markup==="linkify"&&!nT(W,ye.href,t)&&Ef(W,l?.__linkifyDemotionContext)){w(W,W);return}const Z=ye.children.length===1&&ye.children[0]?.type==="text";if(ye.loading&&t&&ye.text===ye.href&&Z){const he=VB(t,ye.href);he&&(ye.text=he,ye.children=[{type:"text",content:he,raw:he}],ye.raw=`[${he}](${ye.href}${ye.title?` "${ye.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(ye.href)){w(ye.text,ye.text);return}const fe=J.attrs?.find(([he])=>he==="href")?.[1],oe=String(fe??"");if(t&&oe){const he=t.indexOf("](");if(he!==-1){const H=t.indexOf(")",he+2);H===-1?ye.loading=!0:ye.loading&&t.slice(he+2,H).includes(oe)&&(ye.loading=!1)}}U(ye)||y(ye)}function R(J){if(J.markup!=="linkify")return!1;const{node:ye,nextIndex:_e}=dd(e,u,s);return V(ye,_e)?(u=_e,!0):!1}function B(J){h(),v(mB(J)),u++}function U(J){if(J.type!=="link")return!1;const ye=a[a.length-1];if(!ye||ye.type!=="text")return!1;const _e=String(ye.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!_e)return!1;const W=J,Z=String(W.href??""),fe=String(W.text??""),oe=String(_e[2]??""),he=Z.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Z||!(fe===Z||fe===he||zB(fe)))return!1;const H=String(_e[1]??"");return H?(ye.content=H,ye.raw=H):a.pop(),y({...J,text:oe,children:[{type:"text",content:oe,raw:oe}],raw:`[${oe}](${Z}${W.title?` "${W.title}"`:""})`}),!0}function K(J){if(J.type!=="link")return!1;const ye=J,_e=String(ye.href??"");return _e?V({href:_e,title:ye.title==null||ye.title===""?null:String(ye.title),loading:!!ye.loading},u+1):!1}function V(J,ye){const _e=a[a.length-1];if(_e?.type!=="image"||_e.src||!_e.loading||!String(_e.raw??"").endsWith("]("))return!1;const W=e[ye],Z=String(W?.content??"");if(W?.type!=="text"||!Z.startsWith(")"))return!1;a.pop(),c=null;const fe=String(_e.alt??"");y({type:"image",src:J.href,alt:fe,title:J.title,raw:`![${fe}](${J.href}${J.title?` "${J.title}"`:""})`,loading:!!J.loading});const oe=Z.slice(1),he=ll(W);return he.content=oe,he.raw=oe,p()[ye]=he,!0}function se(J){if(J.type!=="link")return!1;const ye=a[a.length-1],_e=e[u-1];if(!ye||ye.type!=="text"||_e?.type!=="text")return!1;const W=String(ye.content??""),Z=String(_e.content??"");if(!W.endsWith("!")||!Z.endsWith("!")||E(_e,"\\!"))return!1;const fe=W.slice(0,-1);fe?(ye.content=fe,ye.raw=fe,c=ye):(a.pop(),c=null);const oe=J,he=String(oe.text??oe.children?.map(ce=>String(ce?.content??ce?.raw??"")).join("")??""),H=String(oe.href??""),X=oe.title==null||oe.title===""?null:String(oe.title);return y({type:"image",src:H,alt:he,title:X,raw:`![${he}](${H}${X?` "${X}"`:""})`,loading:!!oe.loading}),!0}function Y(J,ye="",_e=null){const W=String(J.alt??J.raw??"");return{type:"link",href:ye,title:_e,text:W,children:[J],raw:`[${W}](${ye}${_e?` "${_e}"`:""})`,loading:!0}}function G(J){const ye=J.startsWith("![")?J:`![${J}`,_e=ye.slice(2),W=_e.indexOf("](");return{type:"image",src:"",alt:W===-1?_e.replace(/\]$/,""):_e.slice(0,W),title:null,raw:ye,loading:!0}}function ee(J){const ye=J.indexOf("[![");if(ye===-1||typeof t=="string"&&e.length===1&&FB(t,ye,"["))return!1;const _e=J.slice(0,ye);return _e&&w(_e,_e),y(Y(G(J.slice(ye+1)))),u++,!0}function Se(J){if(s?.final)return!1;const ye=e[u-1];if(ye?.type!=="text"||!String(ye.content??"").endsWith("[")||E(ye,"\\["))return!1;const _e=a[a.length-1];if(_e?.type==="text"&&_e.content.endsWith("[")){const W=_e.content.slice(0,-1);W?(_e.content=W,_e.raw=W,c=_e):(a.pop(),c=null)}return y(Y(__(J))),u++,!0}function ae(J){if(J.type!=="link")return!1;const ye=J,_e=String(ye.raw??""),W=String(ye.text??"");if(!_e.startsWith("[![")&&!W.startsWith("!["))return!1;const Z=ye.title==null||ye.title===""?null:String(ye.title);return y(Y({type:"image",src:String(ye.href??""),alt:W.replace(/^!\[/,"").replace(/\]$/,""),title:Z,raw:_e.startsWith("[![")?_e.slice(1):_e,loading:!0})),!0}function Ie(J){if(!J.startsWith("]("))return!1;const ye=e[u-2];if(ye?.type==="text"&&String(ye.content??"").endsWith("[")&&E(ye,"\\["))return!1;const _e=a[a.length-1];if(_e?.type!=="image"&&_e?.type!=="link")return!1;const W=_e,Z=_e?.type==="link"&&Array.isArray(W.children)&&W.children.length===1&&W.children[0]?.type==="image"?a.pop():null,fe=Z?Z.children[0]:a.pop();if(!fe||fe.type!=="image")return!1;const oe=e[u+1];let he=String(Z?.href??""),H=Z?.title==null?null:String(Z.title),X=!0;if(oe?.type==="link_open"){const{node:ke,nextIndex:Me}=dd(e,u+1,s);he=ke.href,H=ke.title,X=!0,u=Me}else{if(he=J.slice(2),he.includes('"')){const ke=he.split('"');he=String(ke[0]??"").trim(),H=ke[1]==null?null:String(ke[1]).trim()}u++}const ce=Y(fe,he,H);return ce.loading=X,y(ce),!0}function de(){const J=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&J?.type==="text"&&String(J.content??"").endsWith("[")&&E(J,"\\[")}function we(J,ye){const _e=J.indexOf("[");if(_e===-1)return!1;let W=J.slice(0,_e);const Z=J.indexOf("](",_e);if(Z!==-1){const fe=e[u+2];let oe=J.slice(_e+1,Z);if(oe.includes("[")){const Ne=oe.indexOf("[");W+=J.slice(0,_e+Ne+1);const re=_e+Ne+1;oe=J.slice(re+1,Z)}const he=e[u+1];if(J.endsWith("](")&&he?.type==="link_open"&&fe){const Ne=e[u+4];let re=4,le=!0;if(Ne?.type==="text"){const We=String(Ne.content??"");if(We.startsWith(")")){le=!1;const nt=We.slice(1);if(nt){const lt=ll(Ne);lt.content=nt,lt.raw=nt,p()[u+4]=lt}else re++}else We==="."&&re++}N(W,ye);const Ce=String(fe.content??"");return s?.validateLink&&!s.validateLink(Ce)?w(oe,oe):y({type:"link",href:Ce,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:le}),u+=re,!0}const H=J.indexOf(")",Z),X=H!==-1?J.slice(Z+2,H):"",ce=H===-1;let ke=W.match(/\*+$/);if(ke&&(W=W.replace(/\*+$/,"")),N(W,ye),ke||(ke=oe.match(/^\*+/)),!d&&ke){const Ne=ke[0].length;oe=oe.replace(/^\*+/,"").replace(/\*+$/,"");const re=[];if(Ne===1?re.push({type:"em_open",tag:"em",nesting:1}):Ne===2?re.push({type:"strong_open",tag:"strong",nesting:1}):Ne===3&&(re.push({type:"strong_open",tag:"strong",nesting:1}),re.push({type:"em_open",tag:"em",nesting:1})),re.push({type:"link",href:X,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:ce}),Ne===1){re.push({type:"em_close",tag:"em",nesting:-1});const{node:le}=ud(re,0,s);v(le)}else if(Ne===2){re.push({type:"strong_close",tag:"strong",nesting:-1});const{node:le}=oc(re,0,void 0,s);v(le)}else if(Ne===3){re.push({type:"em_close",tag:"em",nesting:-1}),re.push({type:"strong_close",tag:"strong",nesting:-1});const{node:le}=oc(re,0,void 0,s);v(le)}else{const{node:le}=ud(re,0,s);v(le)}}else s?.validateLink&&!s.validateLink(X)?w(oe,oe):y({type:"link",href:X,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:ce});const Me=H!==-1?J.slice(H+1):"";return Me&&(I({type:"text",content:Me,raw:Me}),u--),u++,!0}return!1}function me(J){const ye=J.indexOf("![");if(ye===-1)return!1;const _e=J.slice(0,ye);return _e&&!c?c={type:"text",content:_e,raw:_e}:_e&&c&&(c.content+=_e),c&&(a.push(c),c=null),y(G(J.slice(ye))),u++,!0}function $e(J){if(!(J?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ye=J.slice(1).match(/[^\s\]]/);if(ye===null)return u++,!0;if(ye&&/x/i.test(ye[0])){const _e=ye[0]==="x"||ye[0]==="X";return y({type:"checkbox_input",checked:_e,raw:_e?"[x]":"[ ]"}),u++,!0}return!1}return a}function KB(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 GB(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 YB(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Aa(e,t,n){const s=e[t],o=[],i=Mr(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=YB(c)?ll(c):c,d=e[a-1];u!==c&&(GB(u),KB(u));const f=String(u.content??"");l.push({type:"paragraph",children:Cn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=Ea(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]=Aa(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=Av(e,a,i.options(),Mv);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(`
149
+ `)},r+1]}function XB(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Mr(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:Cn(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]=Aa(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Ea(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Ch(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
150
+ ${r.map(c=>c.raw).join(`
151
+ `)}
152
+ :::`},a+1]}const ZB=new Set(["warning","info","note","tip","danger","caution"]);function JB(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 ZB.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function QB(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=JB(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=Mr(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 g=f.length-1;g>=0;g--){const S=f[g];if(S.type==="text"&&/:+/.test(S.content)){p=g;break}}const h={type:"paragraph",children:Cn((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]=Aa(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Ea(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Ch(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
153
+ ${l.map(d=>d.raw).join(`
154
+ `)}
155
+ :::`},c+1]}const eF=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function tF(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=eF.exec(String(s.info??""));return o?XB(e,t,o,n):null}const Mv={parseContainer:(e,t,n)=>QB(e,t,n),matchAdmonition:tF};function Ea(e,t,n){const s=[],o=Mr(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:Cn(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]=Aa(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=Ea(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=Av(e,i,o.options(),Mv);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(`
156
+ `)},i+1]}function nF(e){if(e.info?.startsWith("diff"))return xv(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 sF(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=Mr(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=Cn(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:Cn(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(`
157
+ `)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
158
+ `)},o+1]}function oF(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=Mr(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:Cn(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(`
159
+ `)}`},l+1]}function iF(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:Cn(a.children||[],c,void 0,n),raw:c}}function rF(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=Sn(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=Sn(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 CT(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=Sn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=ml.has(n),l=Sh(o),a=(s===-1?-1:rF(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
160
+ </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function lF(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 aF(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 xT(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function TT(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return xT(n)?n:void 0}function cF(e,t,n){const s=TT(mu(t),n);if(!xT(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 uF(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??""),g=aF(e[c].attrs),S=a.length,_=!f&&!r,y=_?o?.cells[S]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Cn(p.children||[],h,void 0,cF(n,y,_?u:void 0)),raw:h,align:g}),_&&(u=TT(u,mu(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(`
161
+ `)},s+1]}function dF(){return{type:"thematic_break",raw:"---"}}let km=null;const bm=new WeakMap;function C_(){return km||(km={allowedTagSet:Th(),customTagSet:null}),km}function fF(e){if(!e||e.length===0)return C_();const t=bm.get(e);if(t)return t;const n=e.map(No).filter(Boolean);if(!n.length){const o=C_();return bm.set(e,o),o}const s={allowedTagSet:Th({customHtmlTags:e}),customTagSet:new Set(n)};return bm.set(e,s),s}function hF(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 g=h.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(p.startsWith("data-")){const g=p.slice(5);try{r[g]=JSON.parse(h)}catch{r[g]=h}}}const l=[],a=Mr(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:Cn(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]=Aa(e,c,a.options());l.push(p),a.remember(p.raw),c=h}else if(e[c].type==="blockquote_open"){const[p,h]=Ea(e,c,a.options());l.push(p),a.remember(p.raw),c=h}else{const p=Ch(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+=`
162
+ `,l.length>0&&(f+=s.raw??l.map(p=>p.raw).join(`
163
+ `),f+=`
164
+ `),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 pF(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function mF(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function gF(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${oo(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${oo(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=Sn(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=Sn(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 vF(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=Sn(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 g=e.slice(h);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(g)},p=h=>{const g=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),end:e.length};if(p(h)){const g=e.indexOf(">",h);if(g===-1)return null;if(u--,u===0){const S=g+1;return{raw:e.slice(r,S),end:S}}d=g+1;continue}if(f(h)){const g=Sn(e.slice(h));if(g===-1)return null;u++,d=h+g+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 yF(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]===`
165
+ `&&(s++,s===n))return o+1;return e.length}function Ch(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[iF(e,t,n),t+3];case"code_block":return[nF(s),t+1];case"fence":return[xv(s),t+1];case"math_block":return[lF(s),t+1];case"html_block":{const o=CT(s),i=o.tag?fF(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)?yF(l,Number(s.map?.[0]??0)):0,u=vF(l,r,Math.max(qg(a),qg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=Sn(d),p=f!==-1?d.slice(0,f+1):d,h=f!==-1&&/\/\s*>\s*$/.test(p),g=f===-1?null:gF(d,r,f+1),S=g?.start??-1;let _="";f!==-1&&(S!==-1&&f<S?_=d.slice(f+1,S):_=d.slice(f+1)),S===-1&&(_=mF(_,r));const y=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=b.exec(p))!==null;){const N=v[1];if(!N||N.toLowerCase()===r)continue;const E=v[2]||v[3]||v[4]||"";y.push([N,E])}const w=!n?.final&&!h&&g==null;return[{type:r,tag:r,content:pF(_),raw:String(u?.raw??o.raw??d),loading:w,attrs:y.length?y:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=uF(e,t,n);return[o,i]}case"dl_open":{const[o,i]=sF(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=oF(e,t,n);return[o,i]}case"hr":return[dF(),t+1]}return null}function Av(e,t,n,s){const o=Ch(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 hF(e,t,n)}return null}function kF(){return{type:"hardbreak",raw:`\\
166
+ `}}function bF(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:Cn(s.children||[],o,void 0,n),raw:o}}const x_=new WeakMap,xh=new WeakMap,_F=["$$","\\["];function wa(){return typeof performance<"u"?performance.now():Date.now()}function Ev(e,t,n){e&&(e[t]=(e[t]??0)+n)}function MT(e){return e.__timing}function _m(e,t,n){return t&&Ev(t,"parseMarkdownToStructureTotalMs",wa()-n),e}function T_(e,t,n){if(!n)return O_(e,t);const s=wa(),o=O_(e,t);return Ev(n,"processTokensMs",wa()-s),o}function wF(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Ma(t);return n.length?new Set(n):null}function SF(e,t){const n=e;let s=x_.get(n);s||(s=new Map,x_.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 CF(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function fd(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]=Jr(o.value,n))}}function Jr(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(Jr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Jr(l,t),Jr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Jr(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),fd(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),fd(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),fd(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!CF(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),fd(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Jr(i[r],t);return o}function AT(e,t=!0){if(!t)return ll(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=>AT(a,t)):t&&r&&typeof r=="object"&&(l=Jr(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function M_(e,t=!0){return e.map(n=>AT(n,t))}function ET(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 xF(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 TF(e){xh.delete(e)}function MF(e,t,n){xh.set(e,{source:t,key:n,pendingCandidate:n===null&&mT(t)})}function AF(e){return e.endsWith("$")||e.endsWith("\\")}function EF(e){const t=Math.max(e.lastIndexOf(`
167
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return _F.some(s=>n.endsWith(s))}function $F(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||EF(e)&&/[\r\n]/.test(t)):!1}function IF(e,t){if(!aT(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=xh.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&&!$F(o.source,l)&&!AF(t)){o.source=t;return}}const i=zD(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),MF(e,t,i)}function NF(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function LF(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 wm(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&&LF(e,t)}function A_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function OF(e){for(let t=0;t+5<e.length;t++)if(A_(e,t)&&A_(e,t+3)&&wm(e[t],e[t+3])&&wm(e[t+1],e[t+4])&&wm(e[t+2],e[t+5]))return!0;return!1}function PF(e,t,n){return aT(e)&&mT(t)&&OF(n)}function RF(e){const t=xh.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function E_(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!ET(e,s)||(IF(e,t),RF(e)))return e.parse(t,n);const o=e.stream.parse(t,SF(e,n));if(PF(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!NF(s))return o;const i=MT(s);if(!i)return M_(o,!0);const r=wa(),l=M_(o,!0);return Ev(i,"tokenCloneMs",wa()-r),l}function Th(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Zc;const n=new Set(Zc);for(const s of Ma(t))s&&n.add(s);return n}function DF(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 $_(e){return{type:"paragraph",children:e,raw:e.map(DF).join("")}}function I_(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=wF(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($_(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push($_(c)),a}function BF(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 Mc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function FF(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*${oo(t)}\s*>\s*$`,"i").test(n)}function $v(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${oo(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=Sn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(ml.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 g=e.slice(h);return new RegExp(String.raw`^<\s*${oo(s)}(?=\s|>|/)`,"i").test(g)},p=h=>{const g=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${oo(s)}(?=\s|>)`,"i").test(g)};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 g=Sn(e.slice(h));if(g===-1)return null;u--;const S=h+g+1;if(u===0)return{raw:e.slice(r,S),start:r,end:S,closed:!0};d=S;continue}if(f(h)){const g=Sn(e.slice(h));if(g===-1)return null;const S=e.slice(h,h+g+1);/\/\s*>$/.test(S)||u++,d=h+g+1;continue}d=h+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function HF(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]===`
168
+ `){n++;continue}return-1}return s===t.length?n:-1}function WF(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
169
+ </${t}>`}function N_(e){return e.replace(/\r\n/g,`
170
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function UF(e,t,n){return n?e.includes(n,t)?!0:N_(e.slice(Math.max(0,t))).includes(N_(n)):!1}function jF(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
171
+ `&&n++,n):e[n]===`
172
+ `?n+1:t}function L_(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 qF(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Iv(e,t){const n=new RegExp(String.raw`<\s*\/\s*${oo(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function $T(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const zF=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),VF=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function KF(e){return/\n\s*\n/.test(e)||VF.test(e)}function GF(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>zF.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(!KF(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function YF(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"||zx.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=Sn(l);if(a===-1)return o;const c=Iv(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=Ac(u,t,$T(n,s));return GF(u,d)?{...o,children:d}:o})}function Ac(e,t,n){return e.trim()?NT(e,t,{...n,__disableStreamParse:!0}):[]}function XF(e,t,n){const s=Ac(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function ZF(e,t,n){const s=CT({content:e}),o=Sn(e),i=Iv(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=XF(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function JF(e,t,n){const s=Sn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=$v(o,"summary",0);if(!i)return Ac(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...Ac(r,t,n),ZF(i.raw,t,n),...Ac(l,t,n)]}function IT(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=Mc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!L_(c)){r.push(c);continue}const f=String(c.raw??Mc(c)??""),p=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(p===-1){r.push(c);continue}let h=1,g=-1;for(let se=a+1;se<e.length;se++){const Y=e[se];if(L_(Y)){h++;continue}if(qF(Y)&&(h--,h===0)){g=se;break}}const S=$v(t,"details",p),_=g===-1&&S?.closed===!0,y=_?(()=>{const se=Iv(f,"details");return se!==-1?f.slice(0,se):f})():f,[b]=IT(_?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,s,o,p+f.length),v=JF(y,n,$T(s,o)),w=g===-1?"</details>":String(e[g].raw??Mc(e[g])??"</details>"),N=_||g!==-1&&S?.closed===!0,E=w.replace(/[\t\r\n ]+$/,""),k=N?(()=>{const se=(S?.raw??"").lastIndexOf(E);return se===-1?t.length:p+se})():t.length,A=Sn(f),I=_&&A!==-1?p+A+1:p+f.length,P=t.slice(I,k===-1?t.length:k),M=n.parse(P,{__markstreamFinal:o}),L=n.renderer.render(M,n.options,{__markstreamFinal:o}),R=k+E.length,B=N?Math.max(k+w.length,jF(t,R)):t.length,U=N?t.slice(k,B):w,K=N?t.slice(p,B):t.slice(p),V=_&&A!==-1?f.slice(0,A+1):f;if(r.push({...c,tag:"details",attrs:Sh(f.slice(0,A+1)),raw:K,content:`${V}${L}${U}`,children:[...v,...b],loading:!o&&!N}),l=N?B:t.length,g===-1&&!_)break;g!==-1&&(a=g)}return[r,l]}function QF(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=Mc(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=$v(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),p=WF(u.raw,c,u.closed),h=!t&&!u.closed,g=d!==p||f!==u.raw||!!r.loading!==h,S=Sn(u.raw),_=S===-1?"":u.raw.slice(0,S+1),y=_?Sh(_):[];if(r.content=p,r.raw=u.raw,r.loading=h,r.attrs=y.length?y:void 0,!g)continue;let b=HF(u.raw,f);b===-1&&(b=0);const v=i+1;for(;v<s.length;){if(u.closed&&FF(s[v],c)){s.splice(v,1);continue}const w=Mc(s[v]);if(!w)break;const N=u.raw.indexOf(w,b);if(N===-1){if(UF(n,u.end,w))break;s.splice(v,1);continue}b=N+w.length,s.splice(v,1)}}return s}function e9(e){const t=l=>l===" "||l===" "||l===`
173
+ `||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=g=>{const S=g.charCodeAt(0);return S>=65&&S<=90||S>=97&&S<=122},u=g=>{const S=g.charCodeAt(0);return S>=48&&S<=57},d=g=>g==="!"||c(g),f=g=>c(g)||u(g)||g===":"||g==="-",p=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",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 g=l[a];if(g==='"'||g==="'"){for(a++;a<l.length&&l[a]!==g;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const S=l[a];if(t(S)||S==="<"||S===">"||S==='"'||S==="'"||S==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const f=y=>y===" "||y===" ",p=y=>{let b=0;for(;b<y.length&&f(y[b]);)b++;const v=y[b];if(v!=="`"&&v!=="~")return null;let w=b;for(;w<y.length&&y[w]===v;)w++;const N=w-b;return N<3?null:{markerChar:v,markerLen:N,rest:y.slice(w)}},h=y=>{let b=0;for(;b<y.length&&f(y[b]);)b++;let v=!1;for(;b<y.length&&y[b]===">";)for(v=!0,b++;b<y.length&&f(y[b]);)b++;return v?y.slice(b):null},g=y=>{const b=p(y);if(b)return b;const v=h(y);return v==null?null:p(v)};let S=0;const _=l.split(/\r?\n/);for(const y of _){const b=S,v=S+y.length;if(a<b)break;const w=g(y);if(w){const N=w.markerChar,E=w.markerLen;c?N===u&&E>=d&&/^\s*$/.test(w.rest)&&(c=!1,u="",d=0):(c=!0,u=N,d=E)}if(a<=v)break;S=v+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===`
174
+ `||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]===`
175
+ `||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function t9(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 g=h.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||h==="_"||h==="-"||h===":"},i=h=>{if(!h)return!1;if(h[0]===" ")return!0;let g=0;for(let S=0;S<h.length;S++){const _=h[S];if(_===" "){if(g++,g>=4)return!0;continue}if(_===" ")return!0;break}return!1},r=h=>{let g=!1,S=!1;for(let _=0;_<h.length;_++){const y=h[_];if(y==="\\"){_++;continue}if(!S&&y==="'"){g=!g;continue}if(!g&&y==='"'){S=!S;continue}if(!g&&!S&&y===">")return _}return-1},l=h=>{let g=0;for(;g<h.length&&s(h[g]);)g++;const S=h[g];if(S!=="`"&&S!=="~")return null;let _=g;for(;_<h.length&&h[_]===S;)_++;const y=_-g;return y<3?null:{markerChar:S,markerLen:y,rest:h.slice(_)}},a=(h,g)=>{if(i(h))return-1;const S=h.replace(/^[ \t]+/,"");if(!S||S.startsWith(">")||S.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(S))return-1;let _=!1,y=0;for(;y<h.length;){const b=h[y];if(b!=="<"){s(b)||(_=!0),y++;continue}const v=r(h.slice(y));if(v===-1){_=!0,y++;continue}const w=h.slice(y,y+v+1);let N=1;for(;N<w.length&&s(w[N]);)N++;if(N>=w.length){_=!0,y++;continue}const E=w[N];if(E==="!"||E==="?"){_=!0,y+=v+1;continue}if(E==="/"){_=!0,y+=v+1;continue}const k=N;for(;N<w.length&&o(w[N]);)N++;if(N===k){_=!0,y++;continue}const A=w.slice(k,N).toLowerCase(),I=w[N];if(I&&I!==" "&&I!==" "&&I!==">"&&I!=="/"){_=!0,y++;continue}const P=new RegExp(String.raw`<\s*\/\s*${A}\s*>`,"i"),M=/\/\s*>$/.test(w),L=P.test(h.slice(y+v+1)),R=P.test(e.slice(g+y+v+1)),B=/[\r\n]/.test(e.slice(g+y+v+1));if(_&&n.has(A)&&!M&&!L&&(R||B))return y;_=!0,y+=v+1}return-1};let c=!1,u="",d=0,f="",p=0;for(;p<e.length;){const h=e.indexOf(`
176
+ `,p),g=h!==-1,S=g&&h>p&&e[h-1]==="\r",_=g?S?h-1:h:e.length,y=e.slice(p,_),b=g?S?`\r
177
+ `:`
178
+ `:"",v=l(y);let w=y;if(!c&&!v){const N=a(y,p);if(N!==-1){const E=b||`
179
+ `;w=`${y.slice(0,N).replace(/[ \t]+$/,"")}${E}${E}${y.slice(N).replace(/^[ \t]+/,"")}`}}f+=w,f+=b,v&&(c?v.markerChar===u&&v.markerLen>=d&&/^\s*$/.test(v.rest)&&(c=!1,u="",d=0):(c=!0,u=v.markerChar,d=v.markerLen)),p=g?h+1:e.length}return f}function n9(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 g=d[h];if(g==="\\"){h++;continue}if(!p&&g==="'"){f=!f;continue}if(!f&&g==='"'){p=!p;continue}if(!f&&!p&&g===">")return h}return-1},l=(d,f,p)=>{const h=p.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let S=g+1;for(;S<d.length&&s(d[S]);)S++;if(S>=d.length||d[S]!=="/"){g=d.indexOf("<",g+1);continue}for(S++;S<d.length&&s(d[S]);)S++;if(S+h.length>d.length){g=d.indexOf("<",g+1);continue}let _=!0;for(let b=0;b<h.length;b++){const v=d[S+b];if((v>="A"&&v<="Z"?String.fromCharCode(v.charCodeAt(0)+32):v)!==h[b]){_=!1;break}}if(!_){g=d.indexOf("<",g+1);continue}let y=S+h.length;if(y<d.length&&o(d[y])){g=d.indexOf("<",g+1);continue}for(;y<d.length&&s(d[y]);)y++;if(y<d.length&&d[y]===">")return!0;g=d.indexOf("<",g+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 g=r(d.slice(f));if(g===-1)return d;const S=f+g;if(l(d,S+1,h))return d;const _=i(d.slice(S+1));return _?`${d.slice(0,S+1)}
180
+ ${_}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
181
+ `,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
182
+ `:`
183
+ `,u=d+1}return c}function s9(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,g=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++;g=p}return h?{prefix:f.slice(0,g),content:f.slice(g)}:null},i=f=>{let p=0;for(;p<f.length&&s(f[p]);)p++;const h=f[p];if(h!=="`"&&h!=="~")return null;let g=p;for(;g<f.length&&f[g]===h;)g++;const S=g-p;return S<3?null:{markerChar:h,markerLen:S,rest:f.slice(g)}},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(`
184
+ `,d),p=f!==-1,h=p&&f>d&&e[f-1]==="\r",g=p?h?f-1:f:e.length,S=e.slice(d,g),_=p?h?`\r
185
+ `:`
186
+ `:"",y=o(S),b=y?.prefix??"",v=y?.content??S,w=i(v);w&&(l?w.markerChar===a&&w.markerLen>=c&&/^\s*$/.test(w.rest)&&(l=!1,a="",c=0):(l=!0,a=w.markerChar,c=w.markerLen));let N=v;if(!l&&N.includes("</"))for(const E of r)N=N.replace(E,(k,A,I,P)=>{if(P.replace(/^[\t ]+/,"").startsWith("|"))return k;const M=P.slice(0,I).replace(/^[\t ]+/,"");if(M.length>0){const L=A.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=M.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!L||!R||L!==R)return k}return`${A}
187
+
188
+ `});if(b){const E=b+N.split(`
189
+ `).join(`
190
+ ${b}`);u+=E}else u+=N;u+=_,d=p?f+1:e.length}return u}function o9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(M=>String(M??"").toLowerCase()));if(!n.size)return e;const s=M=>M===" "||M===" ",o=M=>{if(!M)return!1;if(M[0]===" ")return!0;let L=0;for(let R=0;R<M.length;R++){const B=M[R];if(B===" "){if(L++,L>=4)return!0;continue}if(B===" ")return!0;break}return!1},i=M=>{const L=M.charCodeAt(0);return L>=65&&L<=90||L>=97&&L<=122||L>=48&&L<=57||M==="_"||M==="-"||M===":"},r=M=>{let L=0;for(;L<M.length&&s(M[L]);)L++;return M.slice(L)},l=M=>{let L=0,R=!1,B=0;for(;L<M.length;){for(;L<M.length&&s(M[L]);)L++;if(L>=M.length||M[L]!==">")break;for(R=!0,L++;L<M.length&&s(M[L]);)L++;B=L}if(!R)return null;const U=M.slice(0,B);return{prefix:U,key:U.replace(/[ \t]+$/,""),content:M.slice(B)}},a=M=>r(M).startsWith("<"),c=M=>{for(let L=0;L<M.length;L++){const R=M[L];if(R!==" "&&R!==" ")return!1}return!0},u=M=>{if(o(M))return"";const L=r(M);if(!L.startsWith("<"))return"";let R=1;for(;R<L.length&&s(L[R]);)R++;if(R>=L.length||L[R]==="/"||L[R]==="!"||L[R]==="?")return"";const B=R;for(;R<L.length&&i(L[R]);)R++;if(R===B)return"";const U=L.slice(B,R).toLowerCase();if(!n.has(U))return"";const K=L[R];return K&&K!==" "&&K!==" "&&K!==">"&&K!=="/"?"":U},d=M=>{if(o(M))return null;const L=r(M);if(!L.startsWith("<"))return null;let R=1;for(;R<L.length&&s(L[R]);)R++;if(R>=L.length)return null;const B=L[R]==="/";if(B)for(R++;R<L.length&&s(L[R]);)R++;const U=L[R];if(!U||U==="!"||U==="?")return null;const K=R;for(;R<L.length&&i(L[R]);)R++;if(R===K)return null;const V=L.slice(K,R).toLowerCase();if(!n.has(V))return null;const se=L[R];if(se&&se!==" "&&se!==" "&&se!==">"&&se!=="/")return null;if(B)return{type:"close",name:V};if(/\/\s*>\s*$/.test(L))return{type:"open",name:V,complete:!0};const Y=L.indexOf(">",R);if(Y!==-1){const G=L.slice(Y+1);if(new RegExp(`<\\s*\\/\\s*${V}\\s*>`,"i").test(G))return{type:"open",name:V,complete:!0}}return{type:"open",name:V,complete:!1}},f=M=>{if(o(M))return null;const L=r(M).replace(/[ \t]+$/,"");if(!L.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(L))return null;const R=L.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const B=L.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!B?.[1]||!B[2])return null;const U=B[1].toLowerCase();return U===B[2].toLowerCase()?U:null};let p=!1,h="",g=0;const S=M=>{let L=0;for(;L<M.length&&s(M[L]);)L++;const R=M[L];if(R!=="`"&&R!=="~")return null;let B=L;for(;B<M.length&&M[B]===R;)B++;const U=B-L;return U<3?null:{markerChar:R,markerLen:U,rest:M.slice(B)}},_=M=>S(M),y=M=>{const L=r(M);return L?o(M)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(L):!1},b=(M,L,R)=>{let B=M,U=0;for(;B<e.length;){const K=e.indexOf(`
191
+ `,B),V=K!==-1,se=V&&K>B&&e[K-1]==="\r",Y=V?se?K-1:K:e.length,G=e.slice(B,Y),ee=l(G),Se=ee?.key??"";if(U>0&&L&&Se!==L)break;const ae=ee?.content??G,Ie=d(ae);if(Ie?.name===R){if(Ie.type==="open")Ie.complete||U++;else if(U>0&&(U--,U===0))return!1}else if(U>0&&(c(ae)||y(ae)))return!0;if(V)B=K+1;else break}return!1};let v="",w=0,N=!0,E=!1,k=!1,A=`
192
+ `;const I=[];let P="";for(;w<e.length;){const M=e.indexOf(`
193
+ `,w),L=M!==-1,R=L&&M>w&&e[M-1]==="\r",B=L?R?M-1:M:e.length,U=e.slice(w,B),K=L?R?`\r
194
+ `:`
195
+ `:"",V=l(U),se=V?.key??"",Y=V?.content??U,G=_(Y);G&&(p?G.markerChar===h&&G.markerLen>=g&&/^\s*$/.test(G.rest)&&(p=!1,h="",g=0):(p=!0,h=G.markerChar,g=G.markerLen));const ee=I.length>0;if(!p&&!ee){const ae=u(Y),Ie=!!ae&&!N&&E&&k&&b(w,se,ae);ae&&!N&&(!E||Ie)&&(se&&P&&se===P?v+=`${se}${A}`:se||(v+=A))}if(v+=U,v+=K,K&&(A=K),!p){const ae=d(Y);if(ae){if(ae.type==="open")ae.complete||I.push(ae.name);else for(let Ie=I.length-1;Ie>=0;Ie--)if(I[Ie]===ae.name){I.length=Ie;break}}}const Se=c(Y);N=Se,E=!Se&&a(Y),k=!Se&&!!f(Y),P=se,w=L?M+1:e.length}return v}function NT(e,t,n={}){const s=MT(n),o=s?wa():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(xF(t,n)&&(t.stream.reset(),TF(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,S=>S.startsWith(`
196
+ `)?`
197
+ `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,S=>S.startsWith(`
198
+ `)?`
199
+ `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,S=>S.startsWith(`
200
+ `)?`
201
+ `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
202
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,S=>S.startsWith(`
203
+ `)?`
204
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(S,_,y)=>`${_}${y.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,S=>S.startsWith(`
205
+ `)?`
206
+ `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
207
+ `))),n.customHtmlTags?.length&&r.includes("<")){const S=Ma(n.customHtmlTags);if(S.length&&(r=t9(r,S),r=n9(r,S),r=o9(r,S),r=s9(r,S),r.includes("</")))for(const _ of S){const y=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${_}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(y,"$1$2$2")}}i||(r=e9(r));const l=BF(r);if(l){const S=n.preTransformTokens,_=n.postTransformTokens;if(ET(t,n)||typeof S=="function"||typeof _=="function"){const y=E_(t,r,{__markstreamFinal:i},n),b=typeof S=="function"&&S(y)||y;typeof _=="function"&&_(b)}return _m(l,s,o)}const a=E_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return _m([],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 g=T_(d,h,s);if(u&&typeof u=="function"){const S=u(d);if(Array.isArray(S)){const _=S[0],y=_?.type;_&&typeof y=="string"?g=T_(S,void 0,s):g=S}}if(g=QF(g,i,r),g=IT(g,r,t,n,i)[0],g=YF(g,t,n,i),i){const S=new WeakSet,_=y=>{if(!y||typeof y!="object"||S.has(y))return;if(S.add(y),Array.isArray(y)){for(const v of y)_(v);return}const b=y;b.type==="html_block"&&b.loading===!0&&(b.loading=!1);for(const v of Object.values(b))_(v)};_(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),_m(g,s,o)}function O_(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=Mr(t);let o=0;for(;o<e.length;){const i=Av(e,o,s.options(),Mv);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=bF(e,o,s.options(l)),c=I_(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]=Aa(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=Ea(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(kF()),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=Cn(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=I_(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const i9=new Set([...pu,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),r9=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"]),P_=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function R_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l9(e){return typeof e=="string"?e:e==null?"":String(e)}function LT(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function lr(e){return l9(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function OT(e){return lr(e).replace(/`/g,"&#96;")}function Mh(e){return String(e??"").trim().toLowerCase()}function Nv(e,t="safe"){const n=Mh(e);return n?t==="escape"?!0:t==="trusted"?pu.has(n):!r9.has(n):!1}function PT(e,t="safe"){const n=Mh(e);return n?t==="escape"?!0:t==="trusted"?pu.has(n):i9.has(n):!1}function D_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${OT(s)}"`).join("")}function a9(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||ha(o,{tagName:t,attrName:"srcset"})})}function RT(e,t,n,s){return XR.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?a9(t,s):!!(ZR.has(e)&&t&&ha(t,{tagName:s,attrName:e}))}function Qr(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function DT(e,t,n,s=!1){if(t!=="safe"||Mh(n)!=="a")return e;const o=Qr(e,"href");if(s&&(!o||!e[o])){const a=Qr(e,"target"),c=Qr(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Qr(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Qr(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 B_(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!LT(r)||RT(l,i,t,n)||(s[r]=i)}return DT(s,t,n,!!Qr(e,"href"))}function BT(e,t){const n=e.toLowerCase();return qx.has(n)?!1:R_(t,n)||R_(t,e)}function Lv(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!LT(r)||RT(l,i,t,n)||(s[r]=i)}return DT(s,t,n,!!Qr(e,"href"))}function Of(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 zg(e,t="safe",n){const s=Lv(Of(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function c9(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 u9(e){const t={};for(const[n,s]of Object.entries(e))t[n]=c9(s,n);return t}function F_(e){return e.trim().length>0}function d9(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);F_(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);F_(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],g=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=g)}}t.push({type:l||ml.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function f9(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],g=p[2]??p[3]??p[4]??"";h&&!h.endsWith("/")&&(d[h]=g)}}t.push({type:l||ml.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function h9(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${lr(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${lr(s)}`:` ${lr(s)}="${OT(o)}"`).join("");return e.type==="self_closing"?`&lt;${lr(t)}${n} /&gt;`:`&lt;${lr(t)}${n}&gt;`}function p9(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;P_.lastIndex=0;let n;for(;(n=P_.exec(e))!==null;)if(BT(n[1],t))return!0;return!1}function pa(e,t="safe"){if(!e)return"";if(t==="escape")return lr(e);const n=f9(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(lr(r.content??""));continue}const l=Mh(r.tagName);if(!l)continue;if(PT(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"&&Nv(l,t)){o.push(h9(r));continue}if(r.type==="self_closing"){o.push(`<${l}${D_(B_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${D_(B_(r.attrs??{},t,l))}>`),ml.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 m9=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],H_="http://www.w3.org/2000/svg",g9=new Set(["script","style","iframe","object","embed","link","meta"]),v9=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"]),y9=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),k9=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),b9=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function _9(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function w9(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function S9(e){const t=e.nodeName.toLowerCase();return t==="use"?_9(e):t==="image"?w9(e):t==="text"||t==="tspan"?!!e.textContent?.trim():b9.has(t)}function C9(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 x9(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")?ha(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ha(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":ha(i,{tagName:s,attrName:o})?"":i:""}function T9(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 FT(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 HT(e){const t=FT(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=T9(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function W_(e){const t=FT(e);return m9.some(n=>n.test(t))||HT(t)}function M9(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 hd(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function WT(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(!g9.has(s)){if(s==="br"){t.push(`
208
+ `);return}for(const o of Array.from(n.childNodes))WT(o,t)}}function A9(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];WT(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=hd(t.getAttribute("width")),i=hd(t.getAttribute("height")),r=hd(t.getAttribute("x")),l=hd(t.getAttribute("y")),a=e.ownerDocument.createElementNS(H_,"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(H_,"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 E9(e){A9(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!v9.has(s)){n.remove();continue}if(s==="style"&&W_(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&&W_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(y9.has(r)&&i.value){const l=x9(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(k9.has(r)&&i.value&&HT(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=C9(i.value);l!==i.value&&n.setAttribute(i.name,l)}}M9(n)}}function spe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return E9(n),$9(n)?null:n}catch{return null}}function $9(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){S9(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 U_=[];function Sm(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function I9(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function N9(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function j_(e=`editor-${Date.now()}`,t={}){const n=YD(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,...g]=p;typeof h=="function"&&n.use(h,...g)}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(U_.length)for(const f of U_)if(Array.isArray(f)){const[p,...h]=f;typeof p=="function"&&n.use(p,...h)}else typeof f=="function"&&n.use(f);n.use(F8),n.use(U8),n.use(R8);const i=nL,r=i.default??i;n.use(r),n.use(P8),n.use(O8),n.core.ruler.after("block","mark_fence_closed",f=>{const p=f,h=p.src,g=!!p.env?.__markstreamFinal,S=h.split(/\r?\n/);for(const _ of p.tokens){if(_.type!=="fence"||!_.map||!_.markup)continue;const y=_.map[0],b=_.map[1],v=_.markup,w=v[0],N=v.length,E=S[Math.max(0,b-1)]??"";let k=0;for(;k<E.length&&(E[k]===" "||E[k]===" ");)k++;let A=0;for(;k+A<E.length&&E[k+A]===w;)A++;let I=k+A;for(;I<E.length&&(E[I]===" "||E[I]===" ");)I++;const P=g?!0:b>y+1&&A>=N&&I===E.length,M=_;M.meta=M.meta??{},M.meta.unclosed=!P,M.meta.closed=!!P}});const l=(f,p)=>{const h=f,g=h.pos;if(h.src[g]!=="~")return!1;const S=h.src[g-1],_=h.src[g+1];if(/\d/.test(S)&&/\d/.test(_)){if(!p){const y=h.push("text","",0);y.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],g=String(h.info??"").trim(),S=String(h.content??""),_=btoa(unescape(encodeURIComponent(S))),y=I9(g),b=Sm(y),v=N9(`editor-${e}-${p}-${y}`),w=Sm(o("common.copy"));return`<div class="code-block" data-code="${_}" data-lang="${b}" id="${v}">
209
+ <div class="code-header">
210
+ <span class="code-lang">${Sm(y.toUpperCase())}</span>
211
+ <button class="copy-button" data-code="${_}">${w}</button>
212
+ </div>
213
+ <div class="code-editor"></div>
214
+ </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 g=a.exec(h.src.slice(h.pos));if(!g)return!1;const S=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(S))return!1;const _=h.src.slice(h.pos+g[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))return!1;if(!p){const y=g[1],b=h.push("reference","span",0);b.content=y,b.markup=g[0],b.raw=g[0]}return h.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,p)=>{const g=String(f[p].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}const L9="modulepreload",O9=function(e){return"/"+e},q_={},no=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=O9(c),c in q_)return;q_[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":L9,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)})};function P9({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 UT({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}:P9({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const z_=new WeakMap;function R9(e){let t=z_.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},z_.set(e,t)),t}function V_(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 Ov(e){return!!(e.themes?.length||e.langs?.length)}function jT(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function D9(e,t){return!t?.length||e.registeredAllLangs?!0:jT(e.registeredLangs,t)}function Cm(e,t){return Ov(t)&&jT(e.registeredThemes,t.themes)&&D9(e,t.langs)}function B9(e,t){if(!Ov(t))return t;const n=V_(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:V_(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const F9={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 H9(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function qT(e){const t=H9(e);return F9[t]??t}function zT(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>qT(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function VT(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 W9(e){return VT(e)?.join("\0")??""}function KT(e,t){const n=VT(e),s=zT(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Pf(e,t){return`${W9(e)}\0\0${zT(t)?.join("\0")??""}`}function ope(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=KT(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Pf(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function ipe(e,t={},n){if(!e)return"ready";const s=KT(t.themes,t.langs),o=Pf(s.themes,s.langs),i=n&&n===o?n:o,r=R9(e);if(r.completed.has(i))return"ready";if(Cm(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)||Cm(r,s))return r.completed.add(i),"ready";const c=B9(r,s),u=Pf(c.themes,c.langs);return r.completed.has(u)||Cm(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(Ov(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 Bl(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function K_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var U9=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=G_();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=G_();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,g=h>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,S=V9(h/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(S-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),y=z9(this.source.slice(this.visible.length),_,this.segmenter);y.text&&(this.visible+=y.text,this.charBudget=Math.max(0,this.charBudget-y.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=Bl(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Bl(s,1e3,1)),this.normalizedTargetLatencyMs=Bl(o,900,1),this.normalizedCatchUpLatencyMs=Bl(i,350,1),this.normalizedCatchUpThreshold=K_(r,600),this.normalizedStartDelayMs=K_(a,80),this.maxCommitFps=Math.trunc(Bl(l,30,1)),this.maxCharsPerCommit=Math.trunc(Bl(c,80,1)),this.flushOnFinish=u,this.segmenter=q9(),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 j9(e={},t){const n=new U9(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 q9(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function z9(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 G_(){return typeof performance<"u"?performance.now():Date.now()}function V9(e,t,n){return Math.min(n,Math.max(t,e))}var K9=(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 Vg=Symbol.for("markstream-vue:node-lifecycle"),Y_='<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>',X_='<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>',G9={id:"material",core:{"":X_,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:X_,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:Y_,csharp:Y_,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:()=>no(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Kg=new Map;let Z_="material";const Jl=new Map,J_=new Map;let Gg=null;function Y9(e){Kg.set(e.id,e)}function X9(e){return K9(this,null,function*(){var t,n,s;if(Jl.has(e.id))return(t=Jl.get(e.id))!=null?t:null;let o=J_.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Jl.set(e.id,i),Gg?.(),i)).catch(()=>(Jl.set(e.id,null),null)),J_.set(e.id,o)),o})}const Z9=hl(0);Gg=()=>{Z9.value++},Y9(G9);const J9={"":"",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 Pv(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=J9[n])!=null?t:n}function rpe(e){const t=Pv(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function lpe(e){return(function(s){const o=Kg.get(Z_);if(!o)return;const i=o.core[s];if(i)return i;const r=Jl.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Jl.has(o.id)&&X9(o)})(Pv(e))||((n=(t=Kg.get(Z_))==null?void 0:t.fallback)!=null?n:"");var t,n}const ape={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 GT=!1;function cpe(){return GT}function upe(){GT=!0}var Ah=(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 eo=null,Ld=!1,Eh=Dv;function $h(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Rv(){try{const e=globalThis;return $h(e?.katex)}catch{return null}}function Dv(){return Ah(null,null,function*(){const e=Rv();if(e)return e;const t=yield no(()=>import("./katex-HP8lGamR.js"),[]);try{yield no(()=>import("./mhchem-KEf2LMH_.js"),__vite__mapDeps([0,1]))}catch{}return $h(t)})}function Q9(e){Eh=e,eo=null,Ld=!1}function eH(e){Q9(Dv)}function YT(){return typeof Eh=="function"}function dpe(){var e;const t=Eh;if(!t||t===Dv)return null;if(eo)return eo;const n=Rv();if(n)return eo=n,eo;try{const s=t();return s&&typeof s?.then!="function"?(eo=(e=$h(s))!=null?e:s,eo):null}catch{return null}}function Bv(){return Ah(this,null,function*(){var e;const t=Rv();if(t)return eo=t,eo;if(eo)return eo;if(Ld)return null;const n=Eh;if(!n)return Ld=!0,null;try{const s=yield n();if(s)return eo=(e=$h(s))!=null?e:s,eo}catch{}return Ld=!0,null})}function XT(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Fl=null;const ZT=new Map,hc=new Map;let JT=5;const nl=new Set;function tH(){if(ZT.size<JT&&nl.size){const e=Array.from(nl);nl.clear();for(const t of e)try{t()}catch{}}}function nH(e,t=!0,n=2e3,s){return Ah(this,null,function*(){performance.now();const o=XT(e);if(!YT()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Fl)return Promise.reject(Fl);const i=`${t?"d":"i"}:${o}`,r=hc.get(i);return r?Promise.resolve(r):(Fl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Fl.name="WorkerInitError",Fl.code="WORKER_INIT_ERROR",Promise.reject(Fl))})}function fpe(e,t=!0,n){const s=`${t?"d":"i"}:${XT(e)}`;if(hc.set(s,n),hc.size>200){const o=hc.keys().next().value;hc.delete(o)}}const sH="WORKER_BUSY";function oH(e=2e3,t){return ZT.size<JT?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),nl.delete(r),n())};if(nl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,nl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>tH()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),nl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const ic={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function hpe(e){return Ah(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!YT()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=s.timeout)!=null?o:ic.timeout,c=(i=s.waitTimeout)!=null?i:ic.waitTimeout,u=(r=s.backoffMs)!=null?r:ic.backoffMs,d=(l=s.maxRetries)!=null?l:ic.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):ic.maxRetries,p=s.signal;let h=0;for(;;){if(p?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield nH(t,n,a,p)}catch(g){if(g?.code!==sH||h>=f)throw g;if(h++,yield oH(c,p).catch(()=>{}),p?.aborted){const S=new Error("Aborted");throw S.name="AbortError",S}u>0&&(yield new Promise(S=>globalThis.setTimeout(S,u*h)))}}})}function Ql(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function iH(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 Yg(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=iH(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 Xg(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 QT(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Zg(e,t=360,n=500){return QT(e,t,n)}function Jg(e,t=360,n=500){return QT(e,t,n)}var rH=Object.defineProperty,lH=Object.defineProperties,aH=Object.getOwnPropertyDescriptors,Q_=Object.getOwnPropertySymbols,cH=Object.prototype.hasOwnProperty,uH=Object.prototype.propertyIsEnumerable,ew=(e,t,n)=>t in e?rH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qe=(e,t)=>{for(var n in t||(t={}))cH.call(t,n)&&ew(e,n,t[n]);if(Q_)for(var n of Q_(t))uH.call(t,n)&&ew(e,n,t[n]);return e},St=(e,t)=>lH(e,aH(t)),_n=(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 dH="__global__",xm="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Qg=(()=>{const e=globalThis;if(e[xm])return e[xm];const t={scopedCustomComponents:{},revision:hl(0)};return e[xm]=t,t})(),tw=Qg.revision,fH=Symbol("markstreamCustomComponents"),hH=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 vu(e){return hH.has(String(e).trim().toLowerCase())}function pH(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Tm(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([No(n),No(pH(n))]))!o||vu(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function zn(e){const t=Rt(fH,null);return F(()=>{var n;return tw.value,(function(s,o={}){return tw.value,Qe(Qe(Qe({},Tm(Qg.scopedCustomComponents[dH]||{})),Tm(o)),Tm((function(i){return i&&Qg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const mH=["aria-label"],gH={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"},vH={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"},Jt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},io=Jt(Ze({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),$("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),$("svg",vH,[...n[1]||(n[1]=[m("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),m("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),$("svg",gH,[...n[0]||(n[0]=[m("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,mH))}),[["__scopeId","data-v-be21ab83"]]);io.install=e=>{e.component(io.__name,io)};const yH={class:"emoji-node"},Fs=Jt(Ze({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),$("span",yH,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const kH=["id"],bH=["title"],ro=Jt(Ze({__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)=>(x(),$("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[m("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,bH)],8,kH))}}),[["__scopeId","data-v-c1463a29"]]);ro.install=e=>{e.component(ro.__name,ro)};const eM=(()=>{try{return!1}catch{}return!1})();function Mm(e){eM&&console.warn(e)}function nw(e,t="safe",n){return Lv(e,t,n)}function tM(e){return u9(e)}function Am(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function Fv(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=zg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Am(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Am(r.value)]):Object.entries(o).map(([r,l])=>[r,Am(l)]):null,t,n);var o;if(!s)return;const i=tM(Of(s));return Object.keys(i).length>0?i:void 0}function sw(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 rc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Em(e,t,n,s,o,i,r=!1){const l=(function(d,f){return BT(d,f)})(e,s);if(pu.has(e.toLowerCase())||!l&&PT(e,i))return null;if(!l&&Nv(e,i))return r?[sw(e,t,!0)]:[sw(e,t),...n,`</${e}>`];const a=Lv(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=tM(a);return Xt(d,St(Qe({},f),{key:u}),n.length>0?n:void 0)}return Xt(e,St(Qe({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function nM(e,t){return p9(e,t)}function Rf(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=Em(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);rc(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(),g=Em(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?rc(c[c.length-1].children,g):rc(u,g),h.tagName.toLowerCase()!==f&&c.length>p&&Mm(`Auto-closing unclosed tag: <${h.tagName}>`)}else Mm(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Em(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?rc(c[c.length-1].children,f):rc(u,f),Mm(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(d9(e),t,n)}catch(o){return s=o,eM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const _H=["innerHTML"],lo=Jt(Ze({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Rt("markstreamHtmlPolicy",void 0),s=F(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=zn(()=>t.customId),i=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=F(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:pa(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Rf(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!nM(l,o.value))return{mode:"html",content:pa(l,s.value)};const a=Rf(l,o.value,s.value);return a===null?{mode:"html",content:pa(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),$("span",{key:0,class:Le(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[gt(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),$("span",{key:1,class:Le(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(x(),$("span",{key:2,class:Le(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,_H))}}),[["__scopeId","data-v-d17f12b0"]]);lo.install=e=>{e.component(lo.__name,lo)};const wH={class:"inline-code"},SH={key:0},bs=Jt(Ze({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=uu(),s=Rt("markstreamFade",void 0),o=Rt("markstreamTextStreamState",void 0),i=Rt("markstreamStreamVersion",void 0),r=F(()=>{const y=n.fade;return y===""||y===!0||y==="true"||y!==!1&&y!=="false"&&void 0}),l=F(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=F(()=>{var y;return String((y=t.node.code)!=null?y:"")}),c=F(()=>!l.value),u=F(()=>{var y;const b=(y=n["index-key"])!=null?y:n.indexKey;return b==null||b===""?"":String(b)}),d=te(t.node.code),f=te("");let p=i?.value;const h=te(0);function g(){return d.value+f.value}function S(){f.value&&(d.value=g(),f.value="")}Ke([()=>t.node.code,u,l,()=>i?.value],([y,b,v,w])=>{const N=String(y??""),E=u.value,k=w!==p;p=w;const A=UT({nextContent:N,persistedContent:E?o?.get(E):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=A.settledContent,f.value=A.streamedDelta,A.appended&&(h.value+=1),E&&o?.set(E,N)},{immediate:!0}),Ke(l,y=>{var b;y||(b=g(),d.value=b,f.value="")});const _=F(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(y,b)=>(x(),$("code",wH,[c.value?(x(),$(Pe,{key:0},[dt(O(a.value),1)],64)):(x(),$(Pe,{key:1},[d.value?(x(),$("span",SH,O(d.value),1)):ie("",!0),f.value?(x(),$("span",{key:1,class:Le(["inline-code-stream-delta",[_.value]]),onAnimationend:S},O(f.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);bs.install=e=>{e.component(bs.__name,bs)};const e1=te(!1),ow=te(""),iw=te("top"),Ec=te(null),$c=te(null),t1=te(null),n1=te(null),rw=te(null);let Od=null,Pd=null,s1=0;function sM(){Od&&(clearTimeout(Od),Od=null),Pd&&(clearTimeout(Pd),Pd=null)}let pd=!1,md=null,lw=!1;function CH(e,t,n="top",s=!1,o,i){if(!e)return;const r=++s1;sM();const l=()=>_n(null,null,function*(){var a,c;if(yield(function(){return _n(this,null,function*(){if(!pd&&!lw&&typeof document<"u"){md!=null||(md=_n(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([no(()=>import("./vue.runtime.esm-bundler-HPT0I7TD.js"),[]),no(()=>import("./Tooltip-BkDnpjpB.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var h;return d(f,{visible:e1.value,"anchor-el":Ec.value,content:ow.value,placement:iw.value,id:$c.value,originX:t1.value,originY:n1.value,isDark:(h=rw.value)!=null?h:void 0})}}).mount(p),pd=!0}));try{yield md}catch(u){pd=!1,md=null,lw=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),pd&&r===s1){$c.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ec.value=e,ow.value=t,iw.value=n,t1.value=(a=o?.x)!=null?a:null,n1.value=(c=o?.y)!=null?c:null,rw.value=typeof i=="boolean"?i:null,e1.value=!0;try{e.setAttribute("aria-describedby",$c.value)}catch{}}});s?l():Od=setTimeout(l,80)}function xH(e=!1){s1+=1,sM();const t=()=>{if(Ec.value&&$c.value)try{Ec.value.removeAttribute("aria-describedby")}catch{}e1.value=!1,Ec.value=null,$c.value=null,t1.value=null,n1.value=null};e?t():Pd=setTimeout(t,120)}const o1={"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..."},i1=e=>{var t;return(t=o1[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 aw(e){return{t(t){if(e.te&&o1[t]&&!e.te(t))return i1(t);const n=e.t(t);return n===t&&o1[t]?i1(t):n}}}function TH(){const e=(function(){var t,n;try{const s=us(),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 aw(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return aw({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:i1}}function MH(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 AH=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],EH={key:1,class:"image-placeholder"},$H={key:1,class:"image-node__raw-text"},IH={key:0,class:"image-shimmer-overlay"},NH={key:1,class:"image-node__raw-text"},LH={key:2,class:"image-error"},pr=Jt(Ze({__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=te(!1),i=te(!1),r=te(""),l=te("primary"),a=te(null),c=uu(),u=Rt(Vg,null);let d="",f=null;const p=F(()=>Kb(n.node.src)),h=F(()=>Kb(n.fallbackSrc)),g=F(()=>r.value),S=F(()=>!n.lazy),_=F(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),y=F(()=>l.value==="failed"),b=F(()=>!S.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),v=F(()=>MH(n,c));function w(R=v.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function N(R=v.value){R&&mt(()=>{w(R)})}function E(){f&&(clearTimeout(f),f=null)}function k(){const R=v.value;R&&d!==R&&(d&&u?.markSettled(d),E(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(N(R),A())},8e3)))}function A(){return _n(this,null,function*(){const R=d;R&&(E(),d="",yield mt(),w(R),u?.markSettled(R))})}function I(){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 N();l.value="failed",i.value=!0,s("error",r.value),N()}function P(){o.value=!0,i.value=!1,s("load",g.value),N()}function M(R){R.preventDefault(),o.value&&!i.value&&s("click",[R,g.value])}const{t:L}=TH();return Ke([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}),Ke([_,o,i,g,()=>n.lazy],([R,B,U,K,V])=>R&&K&&!U?B?(A(),void N()):V?(k(),void N()):void(B||U||k()):(A(),void N()),{flush:"post",immediate:!0}),qs(()=>{(function(){const R=d;R&&(E(),d="",u?.markSettled(R))})()}),(R,B)=>{var U,K,V,se,Y;return x(),$("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(x(),$("img",{key:0,src:g.value,alt:String((K=(U=n.node.alt)!=null?U:n.node.title)!=null?K:""),title:String((se=(V=n.node.title)!=null?V:n.node.alt)!=null?se:""),class:Le(["image-node__img",{"is-loading":!S.value&&!o.value,"is-loaded":S.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:S.value?"high":void 0,decoding:S.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(Y=n.node.alt)!=null?Y:C(L)("image.preview"),onError:I,onLoad:P,onClick:M},null,42,AH)):ie("",!0),e.node.loading&&!i.value?(x(),$("span",EH,[n.usePlaceholder?ia(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[0]||(B[0]=m("span",{class:"image-shimmer"},null,-1))],!0):(x(),$("span",$H,O(e.node.raw),1))])):ie("",!0),gt(Oi,{name:"shimmer-fade"},{default:In(()=>[b.value&&!e.node.loading?(x(),$("span",IH,[n.usePlaceholder?ia(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[1]||(B[1]=m("span",{class:"image-shimmer"},null,-1))],!0):(x(),$("span",NH,O(e.node.raw),1))])):ie("",!0)]),_:3}),y.value?(x(),$("span",LH,[ia(R.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[2]||(B[2]=m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[m("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)),m("span",null,O(C(L)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);pr.install=e=>{e.component(pr.__name,pr)};const OH={key:2},ri=Ze({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=zn(()=>t.customId),s=Rt("markstreamHtmlPolicy",void 0),o=Rt("markstreamNestedRendererProps",void 0),i=F(()=>{var h;return(h=s?.value)!=null?h:"safe"}),r=F(()=>{var h,g;const S=(h=o?.value)!=null?h:{};return St(Qe({},S),{customId:(g=t.customId)!=null?g:S.customId,htmlPolicy:i.value})}),l=si({loader:()=>Promise.resolve().then(()=>Vv),suspensible:!1}),a=F(()=>t.components[String(t.node.type)]),c=F(()=>!!(a.value&&n.value[t.node.type]&&!vu(String(t.node.type)))),u=F(()=>c.value?Fv(t.node,i.value):void 0),d=F(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=F(()=>{var h;return String((h=t.node.content)!=null?h:"")}),p=F(()=>{var h,g;return String((g=(h=t.node.content)!=null?h:t.node.raw)!=null?g:"")});return(h,g)=>a.value&&c.value?(x(),je(vs(a.value),en({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:In(()=>[d.value?(x(),je(C(l),en({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(x(),je(C(l),en({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),je(vs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),$("span",OH,O(p.value),1)):ie("",!0)}}),PH=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],RH={key:0,translate:"no",class:"markstream-pre__diff-code"},DH={class:"markstream-pre__diff-number","aria-hidden":"true"},BH={class:"markstream-pre__diff-content"},FH={class:"markstream-pre__diff-content-inner"},HH={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},WH=["textContent"],Zs=Ze({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=F(()=>{var M,L,R;const B=String((L=(M=t.node)==null?void 0:M.language)!=null?L:"");return String((R=String(B).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=F(()=>`language-${n.value}`),o=F(()=>{var M,L,R,B,U;return((M=t.node)==null?void 0:M.diff)===!0?String((R=(L=t.node)==null?void 0:L.code)!=null?R:""):(function(K,V){const se=String(K??"");return V?se:se.replace(/\r\n$|\n$|\r$/,"")})((B=t.node)==null?void 0:B.code,((U=t.node)==null?void 0:U.loading)===!0)}),i=F(()=>o.value.split(/\r\n|\n|\r/)),r=F(()=>Array.from({length:Math.max(1,i.value.length)},(M,L)=>L+1)),l=F(()=>{var M;return t.showLineNumbers===!0&&((M=t.node)==null?void 0:M.diff)===!0}),a=F(()=>l.value&&t.diffInline===!0),c=F(()=>{const M=Number(t.reservedHeightPx);if(!Number.isFinite(M)||M<=0)return;const L=`${Math.ceil(M)}px`;return{height:L,minHeight:L,maxHeight:L,overflow:"auto"}});function u(M){return String(M??"").trim().length===0}function d(M,L="context",R={}){const B=u(M);return{code:M,kind:B&&L!=="hunk"&&!R.preserveBlankKind?"context":L,empty:B}}function f(M){const L=String(M??"");return L?L.split(/\r\n|\n|\r/):[]}function p(M,L){return!u(M[L])||L<M.length-1}function h(M){return M.startsWith("-")&&!M.startsWith("---")}function g(M){return M.startsWith("+")&&!M.startsWith("+++")}function S(M,L){const R=f(M),B=f(L),U=(function(ee,Se){const ae=ee.length,Ie=Se.length;if((ae+1)*(Ie+1)>15e5)return null;const de=Ie+1,we=new Uint32Array((ae+1)*(Ie+1));for(let ye=1;ye<=ae;ye++)for(let _e=1;_e<=Ie;_e++){const W=ye*de+_e;if(ee[ye-1]===Se[_e-1])we[W]=we[(ye-1)*de+(_e-1)]+1;else{const Z=we[(ye-1)*de+_e],fe=we[ye*de+(_e-1)];we[W]=Z>=fe?Z:fe}}const me=[];let $e=ae,J=Ie;for(;$e>0&&J>0;)ee[$e-1]===Se[J-1]?(me.push({originalIndex:$e-1,modifiedIndex:J-1}),$e--,J--):we[($e-1)*de+J]>=we[$e*de+(J-1)]?$e--:J--;return me.reverse(),me})(R,B);if(U){const ee=[];let Se=0,ae=0;for(const Ie of U){for(;Se<Ie.originalIndex;)ee.push(St(Qe({},d(R[Se],"removed",{preserveBlankKind:p(R,Se)})),{key:`inline-removed-source-${Se}`,number:""})),Se++;for(;ae<Ie.modifiedIndex;)ee.push(St(Qe({},d(B[ae],"added",{preserveBlankKind:p(B,ae)})),{key:`inline-added-source-${ae}`,number:ae+1})),ae++;ee.push(St(Qe({},d(B[Ie.modifiedIndex])),{key:`inline-context-source-${Ie.originalIndex}-${Ie.modifiedIndex}`,number:Ie.modifiedIndex+1})),Se=Ie.originalIndex+1,ae=Ie.modifiedIndex+1}for(;Se<R.length;)ee.push(St(Qe({},d(R[Se],"removed",{preserveBlankKind:p(R,Se)})),{key:`inline-removed-source-${Se}`,number:""})),Se++;for(;ae<B.length;)ee.push(St(Qe({},d(B[ae],"added",{preserveBlankKind:p(B,ae)})),{key:`inline-added-source-${ae}`,number:ae+1})),ae++;return ee}const K=[];let V=0,se=R.length-1,Y=B.length-1;for(;V<=se&&V<=Y&&R[V]===B[V];)K.push(St(Qe({},d(B[V])),{key:`inline-prefix-${V}`,number:V+1})),V++;const G=[];for(;se>=V&&Y>=V&&R[se]===B[Y];)G.unshift(St(Qe({},d(B[Y])),{key:`inline-suffix-${Y}`,number:Y+1})),se--,Y--;for(let ee=V;ee<=se;ee++)K.push(St(Qe({},d(R[ee],"removed",{preserveBlankKind:p(R,ee)})),{key:`inline-removed-source-${ee}`,number:""}));for(let ee=V;ee<=Y;ee++)K.push(St(Qe({},d(B[ee],"added",{preserveBlankKind:p(B,ee)})),{key:`inline-added-source-${ee}`,number:ee+1}));return K.concat(G)}const _=F(()=>{var M,L,R,B;const U=(function(Y){const G=Y.some(Se=>h(Se)),ee=Y.some(Se=>g(Se));return G&&ee||(function(){var Se,ae,Ie,de;if(n.value==="diff")return!0;const we=(de=(Ie=String((ae=(Se=t.node)==null?void 0:Se.raw)!=null?ae:"").split(/\r?\n/,1)[0])==null?void 0:Ie.trim())!=null?de:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(we)})()&&(G||ee)})(i.value),K=(function(){var Y,G;return((Y=t.node)==null?void 0:Y.originalCode)!=null||((G=t.node)==null?void 0:G.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:U?(function(Y){const G=[];let ee=1;for(const[Se,ae]of Y.entries())if(ae.startsWith("@@"))G.push(St(Qe({},d(ae,"hunk")),{key:`inline-hunk-${Se}`,number:""}));else if(h(ae))G.push(St(Qe({},d(ae.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Se}`,number:""}));else if(g(ae))G.push(St(Qe({},d(ae.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${Se}`,number:ee++}));else{const Ie=ae.startsWith(" ")?ae.slice(1):ae;G.push(St(Qe({},d(Ie)),{key:`inline-context-${Se}`,number:ee})),ee++}return G})(i.value):S((M=t.node)==null?void 0:M.originalCode,(L=t.node)==null?void 0:L.updatedCode)}];if(!U&&K){const Y=f((R=t.node)==null?void 0:R.originalCode),G=f((B=t.node)==null?void 0:B.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:Y.map((ee,Se)=>{const ae=G[Se]===ee?"context":"removed";return St(Qe({},d(ee,ae,{preserveBlankKind:p(Y,Se)})),{key:`original-${Se}`,number:Se+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:G.map((ee,Se)=>{const ae=Y[Se]===ee?"context":"added";return St(Qe({},d(ee,ae,{preserveBlankKind:p(G,Se)})),{key:`modified-${Se}`,number:Se+1})})}]}const V=[],se=[];for(const Y of i.value)if(Y.startsWith("@@"))V.push(d(Y,"hunk")),se.push(d(Y,"hunk"));else if(Y.startsWith("-")&&!Y.startsWith("---"))V.push(d(Y.slice(1),"removed",{preserveBlankKind:!0}));else if(Y.startsWith("+")&&!Y.startsWith("+++"))se.push(d(Y.slice(1),"added",{preserveBlankKind:!0}));else{const G=Y.startsWith(" ")?Y.slice(1):Y;V.push(d(G)),se.push(d(G))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:V.map((Y,G)=>St(Qe({},Y),{key:`original-${G}`,number:G+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:se.map((Y,G)=>St(Qe({},Y),{key:`modified-${G}`,number:G+1}))}]}),y=F(()=>{const M=n.value;return M?`Code block: ${M}`:"Code block"}),b=te(null),v=te([]);let w=null,N=null;function E(M){const L=Number.parseFloat(String(M??""));return Number.isFinite(L)&&L>0?L:0}function k(M,L){var R;if(!M)return L;const B=M.querySelector(".markstream-pre__diff-content"),U=B?.getBoundingClientRect(),K=(R=U?.height)!=null?R:0;return Math.max(L,Math.ceil(K))}function A(){typeof window<"u"&&(w!=null&&window.cancelAnimationFrame(w),w=window.requestAnimationFrame(()=>{(function(){var M,L;w=null;const R=b.value;if(!R||!l.value)return void(v.value.length&&(v.value=[]));const B=(function(ee){const Se=window.getComputedStyle(ee),ae=E(Se.getPropertyValue("--markstream-pre-diff-line-height"));if(ae>0)return ae;const Ie=E(Se.lineHeight);return Ie>0?Ie:18})(R),U=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),K=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),V=Math.max(U.length,K.length),se=[];for(let ee=0;ee<V;ee++){const Se=k((M=U[ee])!=null?M:null,B),ae=k((L=K[ee])!=null?L:null,B),Ie=Math.max(B,Se,ae);se.push({rowHeight:Ie,originalHeight:Se,modifiedHeight:ae})}var Y,G;Y=v.value,G=se,Y.length===G.length&&Y.every((ee,Se)=>{const ae=G[Se];return ae&&Math.abs(ee.rowHeight-ae.rowHeight)<=.5&&Math.abs(ee.originalHeight-ae.originalHeight)<=.5&&Math.abs(ee.modifiedHeight-ae.modifiedHeight)<=.5})||(v.value=se)})()}))}function I(M){N?.disconnect(),N=null,M&&l.value&&typeof ResizeObserver<"u"&&(N=new ResizeObserver(()=>{A()}),N.observe(M))}function P(M,L){const R=v.value[M];if(!R)return;const B=L==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(B)}px`}}return Ke(b,M=>{I(M),mt(()=>A())},{flush:"post"}),Ke([l,_],()=>{I(b.value),mt(()=>A())},{flush:"post",immediate:!0}),qs(()=>{w!=null&&(window.cancelAnimationFrame(w),w=null),N?.disconnect(),N=null}),(M,L)=>(x(),$("pre",{ref_key:"preRef",ref:b,style:Bt(c.value),class:Le([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":y.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(x(),$("code",RH,[(x(!0),$(Pe,null,Xe(_.value,R=>(x(),$("span",{key:R.key,class:Le(["markstream-pre__diff-pane",R.className])},[(x(!0),$(Pe,null,Xe(R.lines,(B,U)=>(x(),$("span",{key:B.key,class:Le(["markstream-pre__diff-line",[`markstream-pre__diff-line--${B.kind}`,{"markstream-pre__diff-line--empty":B.empty}]]),style:Bt(P(U,R.key))},[L[0]||(L[0]=m("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),m("span",DH,O(B.number),1),m("span",BH,[m("span",FH,O(B.code),1)])],6))),128))],2))),128))])):(x(),$(Pe,{key:1},[t.showLineNumbers?(x(),$("span",HH,[(x(!0),$(Pe,null,Xe(r.value,R=>(x(),$("span",{key:R,class:"markstream-pre__line-number"},O(R),1))),128))])):ie("",!0),m("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,WH)],64))],14,PH))}});Zs.install=e=>{e.component(Zs.__name,Zs)};const $m=hl(!1);let cw=null;const UH={key:0},Nn=Jt(Ze({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(cw||(cw=Bv().then(_=>{$m.value=!!_}).catch(()=>{$m.value=!1})),Kd($m)),s=uu(),o=Rt("markstreamFade",void 0),i=Rt("markstreamTextStreamState",void 0),r=Rt("markstreamStreamVersion",void 0),l=F(()=>{const _=s.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=F(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=F(()=>{var _;const y=(_=s["index-key"])!=null?_:s.indexKey;return y==null||y===""?"":String(y)}),u=te(t.node.content),d=te("");let f=r?.value;const p=te(0);function h(){return u.value+d.value}function g(){d.value&&(u.value=h(),d.value="")}Ke([()=>t.node.content,c,a,()=>r?.value],([_,y,b,v])=>{const w=String(_??""),N=c.value,E=v!==f;f=v;const k=UT({nextContent:w,persistedContent:N?i?.get(N):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:E});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(p.value+=1),N&&i?.set(N,w)},{immediate:!0}),Ke(a,_=>{var y;_||(y=h(),u.value=y,d.value="")});const S=F(()=>p.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,y)=>(x(),$("span",{class:Le([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(x(),$("span",UH,O(u.value),1)):ie("",!0),d.value?(x(),$("span",{key:1,class:Le(["text-node-stream-delta",[S.value]]),onAnimationend:g},O(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Nn.install=e=>{e.component(Nn.__name,Nn)};const oM=Ze({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return Xt(Zs,St(Qe({},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"}))}}}),Im=si({loader:()=>_n(null,null,function*(){try{return(yield no(()=>import("./CodeBlockNode-CaV-jku-.js"),__vite__mapDeps([2,3,4]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),Zs}}),loadingComponent:oM,delay:0,suspensible:!1}),Uo=si(()=>_n(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return Xt(Nn,St(Qe({},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 Bv())return(yield no(()=>import("./index6-DktmVOWV.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return Xt(Nn,St(Qe({},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:""}$`}}))}})),iM=si(()=>_n(null,null,function*(){try{if(yield Bv())return(yield no(()=>import("./index5-BHU3YSPN.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return Xt(Nn,St(Qe({},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:""}$$`}}))}})),Ms=Jt(Ze({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),$("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"]]);Ms.install=e=>{e.component(Ms.__name,Ms)};const jH={class:"superscript-node"},Hs=Jt(Ze({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=zn(()=>t.customId),s=F(()=>Qe({text:Nn,inline_code:bs,link:$s,html_inline:lo,strong:As,emphasis:Is,footnote_reference:ro,strikethrough:Es,highlight:ao,insert:Us,subscript:Ws,emoji:Fs,math_inline:Uo,reference:Ms},n.value));return(o,i)=>(x(),$("sup",jH,[(x(!0),$(Pe,null,Xe(e.node.children,(r,l)=>(x(),je(C(ri),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Hs.install=e=>{e.component(Hs.__name,Hs)};const qH={class:"subscript-node"},Ws=Jt(Ze({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=zn(()=>t.customId),s=F(()=>Qe({text:Nn,inline_code:bs,link:$s,html_inline:lo,strong:As,emphasis:Is,footnote_reference:ro,strikethrough:Es,highlight:ao,insert:Us,superscript:Hs,emoji:Fs,math_inline:Uo,reference:Ms},n.value));return(o,i)=>(x(),$("sub",qH,[(x(!0),$(Pe,null,Xe(e.node.children,(r,l)=>(x(),je(C(ri),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Ws.install=e=>{e.component(Ws.__name,Ws)};const zH={class:"strong-node"},As=Jt(Ze({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=zn(()=>t.customId),s=F(()=>Qe({text:Nn,inline_code:bs,link:$s,html_inline:lo,emphasis:Is,strikethrough:Es,highlight:ao,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:ro,math_inline:Uo,reference:Ms},n.value));return(o,i)=>(x(),$("strong",zH,[(x(!0),$(Pe,null,Xe(e.node.children,(r,l)=>(x(),je(C(ri),{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"]]);As.install=e=>{e.component(As.__name,As)};const VH={class:"strikethrough-node"},Es=Jt(Ze({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=zn(()=>t.customId),s=F(()=>Qe({text:Nn,inline_code:bs,link:$s,html_inline:lo,strong:As,emphasis:Is,highlight:ao,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:ro,math_inline:Uo,reference:Ms},n.value));return(o,i)=>(x(),$("del",VH,[(x(!0),$(Pe,null,Xe(e.node.children,(r,l)=>(x(),je(C(ri),{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"]]);Es.install=e=>{e.component(Es.__name,Es)};const KH=["href","title","aria-label","aria-hidden","target","rel"],GH=["aria-hidden"],YH={class:"link-text-wrapper relative inline-flex"},XH={class:"leading-[normal] link-text"},$s=Jt(Ze({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Rt("markstreamShowTooltips",void 0),s=F(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),o=F(()=>{var _,y,b,v,w;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(_=t.animationOpacity)!=null?_:.35,k=Math.max(.12,Math.min(.5*E,E)),A={"--underline-height":`${(y=t.underlineHeight)!=null?y:2}px`,"--underline-bottom":N,"--underline-opacity":String(E),"--underline-rest-opacity":String(k),"--underline-duration":`${(b=t.animationDuration)!=null?b:1.6}s`,"--underline-timing":(v=t.animationTiming)!=null?v:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(w=t.animationIteration)!=null?w:"infinite"};return t.color&&(A["--link-color"]=t.color),A}),i=zn(()=>t.customId),r=F(()=>Qe({text:Nn,strong:As,strikethrough:Es,emphasis:Is,image:pr,html_inline:lo,inline_code:bs},i.value)),l=uu(),a=F(()=>{var _,y;const b=(_=t.node)==null?void 0:_.attrs;if(!b||typeof b!="object")return{};const v={};if(Array.isArray(b))for(const w of b)Array.isArray(w)&&w[0]&&(v[String(w[0])]=String((y=w[1])!=null?y:""));else for(const[w,N]of Object.entries(b))w&&N!=null&&N!==!1&&(v[w]=N===!0?"":String(N));return nw(v,"safe","a")}),c=F(()=>Qe(Qe({},l),a.value)),u=F(()=>{var _,y;return nw({href:String((y=(_=t.node)==null?void 0:_.href)!=null?y:"")},"safe","a").href}),d=F(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(e7(u.value)?"_blank":void 0)}),f=F(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),p=F(()=>{if(!u.value)return;const _=c.value.rel,y=new Set((typeof _=="string"?_:String(_??"")).split(/\s+/).filter(Boolean)),b=new Set(Array.from(y).filter(v=>v.toLowerCase()!=="opener"));return f.value&&(b.add("noopener"),b.add("noreferrer")),b.size>0?Array.from(b).join(" "):void 0}),h=F(()=>{const _=Qe({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function g(){s.value&&xH()}const S=F(()=>{var _,y;const b=(_=t.node)==null?void 0:_.title;return typeof b=="string"&&b.trim().length>0?b:String((y=u.value)!=null?y:"")});return(_,y)=>{var b,v;return e.node.loading?(x(),$("span",en({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[m("span",YH,[m("span",XH,[gt(C(Nn),{class:"leading-[normal] link-text",node:{type:"text",content:String((b=e.node.text)!=null?b:""),raw:String((v=e.node.text)!=null?v:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),y[1]||(y[1]=m("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,GH)):(x(),$("a",en({key:0,class:"link-node",href:u.value,title:s.value?"":S.value,"aria-label":`Link: ${S.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},h.value,{style:o.value,onMouseenter:y[0]||(y[0]=w=>(function(N){var E,k,A,I;if(!s.value)return;const P=N,M=P?.clientX!=null&&P?.clientY!=null?{x:P.clientX,y:P.clientY}:void 0,L=((E=t.node)==null?void 0:E.title)||((k=u.value)!=null&&k.includes("xn--")&&((I=(A=t.node)==null?void 0:A.text)!=null&&I.includes("://"))?t.node.text:u.value)||"";CH(N.currentTarget,L,"top",!1,M)})(w)),onMouseleave:g}),[(x(!0),$(Pe,null,Xe(e.node.children,(w,N)=>(x(),je(C(ri),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:w,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,KH))}}}),[["__scopeId","data-v-367e6ca4"]]);$s.install=e=>{e.component($s.__name,$s)};const ZH={class:"insert-node"},Us=Jt(Ze({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=zn(()=>t.customId),s=F(()=>Qe({text:Nn,inline_code:bs,link:$s,html_inline:lo,strong:As,emphasis:Is,strikethrough:Es,highlight:ao,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:ro,math_inline:Uo,reference:Ms},n.value));return(o,i)=>(x(),$("ins",ZH,[(x(!0),$(Pe,null,Xe(e.node.children,(r,l)=>(x(),je(C(ri),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Us.install=e=>{e.component(Us.__name,Us)};const JH={class:"highlight-node"},ao=Jt(Ze({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=zn(()=>t.customId),s=F(()=>Qe({text:Nn,inline_code:bs,link:$s,html_inline:lo,strong:As,emphasis:Is,strikethrough:Es,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:ro,math_inline:Uo,reference:Ms},n.value));return(o,i)=>(x(),$("mark",JH,[(x(!0),$(Pe,null,Xe(e.node.children,(r,l)=>(x(),je(C(ri),{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"]]);ao.install=e=>{e.component(ao.__name,ao)};const QH={class:"emphasis-node"},Is=Jt(Ze({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=zn(()=>t.customId),s=F(()=>Qe({text:Nn,inline_code:bs,link:$s,html_inline:lo,strong:As,strikethrough:Es,highlight:ao,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,footnote_reference:ro,math_inline:Uo,reference:Ms},n.value));return(o,i)=>(x(),$("em",QH,[(x(!0),$(Pe,null,Xe(e.node.children,(r,l)=>(x(),je(C(ri),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Is.install=e=>{e.component(Is.__name,Is)};const eW={class:"hard-break"},mr=Jt(Ze({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),$("br",eW))}),[["__scopeId","data-v-50c58f70"]]);mr.install=e=>{e.component(mr.__name,mr)};const tu=Ze({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=ar({checkbox:io,checkbox_input:io,emoji:Fs,emphasis:Is,hardbreak:mr,highlight:ao,inline_code:bs,insert:Us,link:$s,reference:Ms,strikethrough:Es,strong:As,subscript:Ws,superscript:Hs,text:Nn}),s=zn(()=>t.customId),o=F(()=>{const i=s.value;return Object.keys(i).length>0?Qe(Qe({},n),i):n});return(i,r)=>(x(!0),$(Pe,null,Xe(e.nodes,(l,a)=>(x(),je(C(ri),{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 r1(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(r1)}function Df(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(r1))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(r1)?o:null}function Sa(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 tW=["cite"],nW={key:0,dir:"auto",class:"paragraph-node"},sW=["custom-id"],Rd=Jt(Ze({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=zn(()=>t.customId),s=F(()=>!!n.value.paragraph),o=F(()=>!!n.value.text),i=F(()=>Df(t.node.children,!s.value)),r=F(()=>t.fade!==!1||o.value?null:Sa(i.value));return gn("markstreamShowTooltips",F(()=>t.showTooltips)),gn("markstreamFade",F(()=>t.fade)),(l,a)=>(x(),$("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),$("p",nW,[r.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,sW)):(x(),je(C(tu),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),je(C(js),{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,tW))}}),[["__scopeId","data-v-abfecebc"]]);Rd.install=e=>{e.component(Rd.__name,Rd)};const oW={class:"definition-list"},iW={class:"definition-term"},rW={class:"definition-desc"},Dd=Jt(Ze({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),$("dl",oW,[(x(!0),$(Pe,null,Xe(t.node.items,(o,i)=>(x(),$(Pe,{key:i},[m("dt",iW,[gt(C(js),{"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"])]),m("dd",rW,[gt(C(js),{"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"]]);Dd.install=e=>{e.component(Dd.__name,Dd)};const lW=["href","title"],Ic=Jt(Ze({__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)=>(x(),$("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,lW))}}),[["__scopeId","data-v-e1eb37b6"]]);Ic.install=e=>{e.component(Ic.__name,Ic)};const aW=["id"],cW={class:"flex-1"},Bd=Ze({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),$("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[m("div",cW,[gt(C(js),{"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,aW))}});Bd.install=e=>{e.component(Bd.__name,Bd)};const uW=["custom-id"],l1=Jt(Ze({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=zn(()=>t.customId),s=Rt("markstreamFade",void 0),o=F(()=>s?.value!==!1||n.value.text?null:Sa(t.node.children)),i=F(()=>Qe({text:Nn,inline_code:bs,link:$s,image:pr,strong:As,emphasis:Is,strikethrough:Es,highlight:ao,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,checkbox:io,checkbox_input:io,footnote_reference:ro,hardbreak:mr,math_inline:Uo,reference:Ms},n.value));return(r,l)=>(x(),je(vs(`h${e.node.level}`),en({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:In(()=>[o.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,uW)):(x(!0),$(Pe,{key:1},Xe(e.node.children,(a,c)=>(x(),je(C(ri),{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"]]),Bf=l1;Bf.install=e=>{e.component(l1.__name,l1)};const dW={key:0,dir:"auto",class:"paragraph-node"},fW=["custom-id"],hW={dir:"auto",class:"paragraph-node"},pW=["custom-id"],ma=Jt(Ze({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=F(()=>{var p;return(p=t.node)!=null?p:t.item}),s=zn(()=>t.customId),o=F(()=>!!s.value.paragraph),i=F(()=>!!s.value.text),r=F(()=>{var p;return Df((p=n.value)==null?void 0:p.children,!o.value)}),l=F(()=>{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 g=h[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const S=h.slice(1);if(!S.every(y=>y?.type==="list"))return null;const _=Df([g]);return _?{paragraphChildren:_,nestedLists:S}:null});function a(){return t.fade===!1&&!i.value}const c=F(()=>a()?Sa(r.value):null),u=F(()=>{var p;return a()?Sa((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),f=F(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return gn("markstreamShowTooltips",F(()=>t.showTooltips)),gn("markstreamFade",F(()=>t.fade)),(p,h)=>{var g,S;return x(),$("li",en({class:"list-item",dir:"auto"},f.value),[r.value?(x(),$("p",dW,[c.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,fW)):(x(),je(C(tu),{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?(x(),$(Pe,{key:1},[m("p",hW,[u.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,pW)):(x(),je(C(tu),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),$(Pe,null,Xe(l.value.nestedLists,(_,y)=>(x(),je(C(js),{key:y,nodes:[_],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${y}`,"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]=b=>p.$emit("copy",b))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),je(C(js),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(S=(g=n.value)==null?void 0:g.children)!=null?S:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=_=>p.$emit("copy",_))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);ma.install=e=>{e.component(ma.__name,ma)};const ga=Jt(Ze({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=zn(()=>e.customId),n=F(()=>t.value.list_item||ma);return(s,o)=>(x(),je(vs(e.node.ordered?"ol":"ul"),{class:Le(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:In(()=>[(x(!0),$(Pe,null,Xe(e.node.items,(i,r)=>{var l;return x(),je(vs(n.value),en({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"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"]]);ga.install=e=>{e.component(ga.__name,ga)};const rM=Symbol("ViewportPriority");function mW(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?te(t):t,r=o?(n=window.requestIdleCallback)!=null?n:_=>window.setTimeout(()=>_({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:_=>window.clearTimeout(_):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||(function(){if(f!=null){try{l?.(f)}catch{}f=null}})()}}function h(_){const y=u.get(_);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(_)}catch{}u.delete(_),d.delete(_),p()}}function g(){r&&f==null&&d.size&&(f=r(()=>{f=null;const _=d.values().next().value;_&&(d.delete(_),h(_),d.size&&g())},{timeout:1200}))}const S=(_,y)=>{const b=te(!1);let v,w=!1;const N=new Promise(A=>{v=()=>{w||(w=!0,A())}}),E=()=>{try{a?.unobserve(_)}catch{}u.delete(_),d.delete(_),p()};if(!o||!i.value)return b.value=!0,v(),{isVisible:b,whenVisible:N,destroy:E};const k=(function(A,I){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const P=(function(R,B){var U,K,V;return{root:(U=e?.(R??null))!=null?U:null,rootMargin:(K=B?.rootMargin)!=null?K:"300px",threshold:(V=B?.threshold)!=null?V:0}})(A,I);if(a&&(L=P,(M=c)&&M.root===L.root&&M.rootMargin===L.rootMargin&&M.threshold===L.threshold))return a;var M,L;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(R=>{for(const B of R)(B.isIntersecting||B.intersectionRatio>0)&&h(B.target)},{root:P.root,rootMargin:P.rootMargin,threshold:P.threshold}),c=P;for(const R of u.keys())a.observe(R);return a})(_,y);return k?(u.set(_,{resolve:v,visible:b}),k.observe(_),d.add(_),g(),{isVisible:b,whenVisible:N,destroy:E}):(b.value=!0,v(),{isVisible:b,whenVisible:N,destroy:E})};return gn(rM,S),S}function gW(){var e,t;const n=Rt(rM,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=()=>{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=te(!1);let h,g=!1;const S=new Promise(b=>{h=()=>{g||(g=!0,b())}}),_=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},y=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(b=>{for(const v of b)(v.isIntersecting||v.intersectionRatio>0)&&u(v.target)},{root:null,rootMargin:"300px",threshold:0}),o));return y?(s.set(f,{resolve:h,visible:p}),y.observe(f),i.add(f),d(),{isVisible:p,whenVisible:S,destroy:_}):(p.value=!0,h(),{isVisible:p,whenVisible:S,destroy:_})}}const vW={key:2,class:"html-block-node__raw"},yW=["innerHTML"],kW={key:1,class:"html-block-node__placeholder"},Nc=Jt(Ze({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Rt("markstreamHtmlPolicy",void 0),s=Rt("markstreamNestedRendererProps",void 0),o=F(()=>{var N,E;return(E=(N=t.htmlPolicy)!=null?N:n?.value)!=null?E:"safe"}),i=F(()=>{var N,E;const k=(N=s?.value)!=null?N:{};return St(Qe({},k),{customId:(E=t.customId)!=null?E:k.customId,htmlPolicy:o.value})}),r=si({loader:()=>Promise.resolve().then(()=>Vv),suspensible:!1}),l=F(()=>{const N=zg(t.node.attrs,o.value);if(!N)return;const E=Of(N);return Object.keys(E).length>0?E:void 0}),a=F(()=>{const N=String(t.node.tag||"").trim(),E=zg(t.node.attrs,o.value,N);if(!E)return;const k=Of(E);return Object.keys(k).length>0?k:void 0}),c=zn(()=>t.customId),u=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=te(null),f=te(typeof window>"u"),p=te(t.node.content),h=F(()=>Array.isArray(t.node.children)?t.node.children:[]),g=F(()=>String(t.node.tag||"div")),S=F(()=>{const N=g.value.trim().toLowerCase();return zx.has(N)||Nv(N,o.value)}),_=F(()=>h.value.length>0&&!!t.node.tag&&!S.value),y=F(()=>{var N,E,k;if(_.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(N=p.value)!=null?N:""};const A=(E=p.value)!=null?E:t.node.content;if(!A)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:pa(A,o.value)};if(t.node.loading){const P=Rf(A,c.value,o.value);return P===null?{mode:"text",content:(k=t.node.raw)!=null?k:A}:{mode:"dynamic",nodes:P}}if(!nM(A,c.value))return{mode:"html",content:pa(A,o.value)};const I=Rf(A,c.value,o.value);return I===null?{mode:"html",content:pa(A,o.value)}:{mode:"dynamic",nodes:I}}),b=gW(),v=te(null),w=!!t.node.loading;return typeof window<"u"?(Ke(d,N=>{var E,k;if((k=(E=v.value)==null?void 0:E.destroy)==null||k.call(E),v.value=null,!w)return f.value=!0,void(p.value=t.node.content);if(!N)return void(f.value=!1);const A=b(N,{rootMargin:"400px"});v.value=A,f.value=A.isVisible.value,A.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ke(()=>t.node.content,N=>{w&&!f.value||(p.value=N)})):f.value=!0,qs(()=>{var N,E;(E=(N=v.value)==null?void 0:N.destroy)==null||E.call(N),v.value=null}),(N,E)=>(x(),je(vs(_.value?g.value:"div"),en({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:In(()=>[f.value?(x(),$(Pe,{key:0},[y.value.mode==="structured"?(x(),je(C(r),en({key:0},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):y.value.mode==="dynamic"?(x(),je(C(u),{key:1,nodes:y.value.nodes},null,8,["nodes"])):y.value.mode==="text"?(x(),$("pre",vW,O(y.value.content),1)):(x(),$("div",en({key:3},l.value,{innerHTML:y.value.content}),null,16,yW))],64)):(x(),$("div",kW,[ia(N.$slots,"placeholder",{node:e.node},()=>[E[0]||(E[0]=m("span",{class:"html-block-node__placeholder-bar"},null,-1)),E[1]||(E[1]=m("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),E[2]||(E[2]=m("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Nc.install=e=>{e.component(Nc.__name,Nc)};const bW={dir:"auto",class:"paragraph-node"},_W=["custom-id"],al=Jt(Ze({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=zn(()=>t.customId),s=Rt("markstreamHtmlPolicy",void 0),o=Rt("markstreamFade",void 0),i=Rt("markstreamParseOptions",void 0),r=Rt("markstreamCustomMarkdownIt",void 0),l=Rt("markstreamNestedRendererProps",void 0),a=F(()=>{var k;return(k=s?.value)!=null?k:"safe"}),c=F(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=F(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=F(()=>{var k,A;return(A=t.customHtmlTags)!=null?A:(k=l?.value)==null?void 0:k.customHtmlTags}),f=F(()=>{var k,A;const I=(k=l?.value)!=null?k:{};return St(Qe({},I),{customId:(A=t.customId)!=null?A:I.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=si({loader:()=>Promise.resolve().then(()=>Vv),suspensible:!1});function h(k){var A;return k.type==="text"&&String((A=k.content)!=null?A:"").trim()===""}const g=F(()=>t.node.children.filter(k=>!h(k))),S=F(()=>g.value.length>0&&g.value.every(k=>k.type==="image"||(function(A){var I;const P=(function(M){return M.type==="link"&&Array.isArray(M.children)?M.children.filter(L=>!h(L)):[]})(A);return P.length===1&&((I=P[0])==null?void 0:I.type)==="image"})(k))),_=F(()=>new Set(Ma(d.value))),y=F(()=>{if(!S.value||g.value.length<=1)return t.node.children;const k=[];for(let A=0;A<t.node.children.length;A++){const I=t.node.children[A];if(!h(I)){k.push(I);continue}const P=k.length>0,M=t.node.children.slice(A+1).some(L=>!h(L));P&&M&&k.push(St(Qe({},I),{content:" ",raw:" "}))}return k}),b=F(()=>o?.value===!1&&!n.value.text),v=F(()=>b.value?Sa(y.value):null);function w(k,A){return{node:k,"index-key":`${t.indexKey}-${A}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=F(()=>Qe({inline_code:bs,image:pr,link:$s,hardbreak:mr,emphasis:Is,strong:As,strikethrough:Es,highlight:ao,insert:Us,subscript:Ws,superscript:Hs,html_inline:lo,html_block:Nc,emoji:Fs,checkbox:io,math_inline:Uo,checkbox_input:io,reference:Ms,footnote_anchor:Ic,footnote_reference:ro,text:Nn},n.value)),E=F(()=>y.value.map((k,A)=>{var I;const P=(function(M){var L,R,B,U;if(M.type==="html_block"||M.type==="html_inline"){const K=String((L=M.tag)!=null?L:"").trim().toLowerCase()||Yx(M.content);if(K&&!_.value.has(K)&&Xx((R=M.content)!=null?R:M.raw,K)){const V=String((U=(B=M.content)!=null?B:M.raw)!=null?U:"");return{child:{type:"text",content:V,raw:V},component:Nn,isCustomComponent:!1}}}return{child:M,component:N.value[M.type],isCustomComponent:!!(n.value[M.type]&&!vu(String(M.type)))}})(k);return St(Qe({},P),{index:A,key:`${t.indexKey||"paragraph"}-${A}`,customAttrs:P.isCustomComponent?Fv(P.child,a.value):void 0,hasSlotChildren:Array.isArray(P.child.children)&&P.child.children.length>0,slotContent:String((I=P.child.content)!=null?I:""),originalChild:k})}));return(k,A)=>(x(),$("p",bW,[v.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(v.value),9,_W)):(x(!0),$(Pe,{key:1},Xe(E.value,I=>{return x(),$(Pe,{key:I.key},[S.value&&h(I.originalChild)?(x(),$(Pe,{key:0},[dt(O((P=I.originalChild,String((M=P.content)!=null?M:""))),1)],64)):I.isCustomComponent?(x(),je(vs(I.component),en({key:1,ref_for:!0},I.customAttrs,{node:I.child,loading:I.child.loading,"index-key":I.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:In(()=>[I.hasSlotChildren?(x(),je(C(p),en({key:0,ref_for:!0},f.value,{nodes:I.child.children,"index-key":I.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):I.slotContent?(x(),je(C(p),en({key:1,ref_for:!0},f.value,{content:I.slotContent,final:!I.child.loading,"index-key":`${I.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),je(vs(I.component),en({key:2,ref_for:!0},w(I.child,I.index)),null,16))],64);var P,M}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);al.install=e=>{e.component(al.__name,al)};const wW={class:"table-node-wrapper"},SW=["aria-busy"],CW={key:0},xW=["custom-id"],TW=["aria-label","onPointerdown"],MW=["custom-id"],AW={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Lc=Jt(Ze({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=F(()=>{var _;return(_=t.node.loading)!=null&&_}),s=F(()=>{var _;return(_=t.node.rows)!=null?_:[]}),o=te(null),i=te([]);let r=null;const l=F(()=>t.node.header.cells.length),a=F(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=F(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);gn("markstreamShowTooltips",F(()=>t.showTooltips)),gn("markstreamFade",F(()=>t.fade));const u=zn(()=>t.customId),d=F(()=>!!u.value.text),f=F(()=>!!u.value.paragraph),p=new WeakMap;function h(_){const y=t.fade===!1&&!d.value,b=!f.value,v=p.get(_);if(v?.children===_.children&&v.textFastPath===y&&v.paragraphFastPath===b)return v.info;const w=Df(_.children,b,!0),N={simpleChildren:w,plainText:w&&y?Sa(w):null};return p.set(_,{children:_.children,textFastPath:y,paragraphFastPath:b,info:N}),N}function g(_){if(!r)return;_.preventDefault();const y=r.startWidth+r.nextStartWidth,b=Math.min(48,Math.floor(y/2)),v=Math.max(b,Math.min(y-b,Math.round(r.startWidth+_.clientX-r.startX))),w=[...r.widths];w[r.index]=v,w[r.index+1]=y-v,i.value=w}function S(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),r=null)}return Ke(l,()=>{S(),i.value=[]}),qs(S),(_,y)=>(x(),$("div",wW,[m("table",{ref_key:"tableRef",ref:o,class:Le(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),$("colgroup",CW,[(x(!0),$(Pe,null,Xe(e.node.header.cells,(b,v)=>(x(),$("col",{key:v,style:Bt(c.value[v])},null,4))),128))])):ie("",!0),m("thead",null,[m("tr",null,[(x(!0),$(Pe,null,Xe(e.node.header.cells,(b,v)=>(x(),$("th",{key:v,dir:"auto",class:Le([b.align==="right"?"text-right":b.align==="center"?"text-center":"text-left"])},[h(b).plainText!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(h(b).plainText),9,xW)):h(b).simpleChildren?(x(),je(C(tu),{key:1,nodes:h(b).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${v}`},null,8,["nodes","custom-id","index-key"])):(x(),je(C(js),{key:2,nodes:b.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:y[0]||(y[0]=w=>_.$emit("copy",w))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),v<e.node.header.cells.length-1?(x(),$("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${v+1} and ${v+2}`,onPointerdown:w=>(function(N,E){if(E.button!==0)return;const k=(function(){var P;const M=(P=o.value)==null?void 0:P.querySelectorAll("thead th");return Array.from(M??[],L=>Math.round(L.getBoundingClientRect().width))})(),A=k[N],I=k[N+1];A&&I&&(E.preventDefault(),r={index:N,startX:E.clientX,startWidth:A,nextStartWidth:I,widths:k},i.value=k,window.addEventListener("pointermove",g),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S))})(v,w)},null,40,TW)):ie("",!0)],2))),128))])]),m("tbody",null,[(x(!0),$(Pe,null,Xe(s.value,(b,v)=>(x(),$("tr",{key:v},[(x(!0),$(Pe,null,Xe(b.cells,(w,N)=>(x(),$("td",{key:N,class:Le([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(w).plainText!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(h(w).plainText),9,MW)):h(w).simpleChildren?(x(),je(C(tu),{key:1,nodes:h(w).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${v}-${N}`},null,8,["nodes","custom-id","index-key"])):(x(),je(C(js),{key:2,nodes:w.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:y[1]||(y[1]=E=>_.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,SW),gt(Oi,{name:"table-node-fade"},{default:In(()=>[n.value?(x(),$("div",AW,[ia(_.$slots,"loading",{isLoading:n.value},()=>[y[2]||(y[2]=m("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),y[3]||(y[3]=m("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Lc.install=e=>{e.component(Lc.__name,Lc)};const EW={class:"hr-node"},Fd=Jt({},[["render",function(e,t){return x(),$("hr",EW)}],["__scopeId","data-v-39b2349c"]]);Fd.install=e=>{e.component(Fd.__name,Fd)};const $W={class:"unknown-node"},a1=Ze({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),$("div",$W,O(e.node.raw),1))}),Hd=Jt(Ze({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=F(()=>`vmr-container vmr-container-${t.node.name}`),s=zn(()=>t.customId),o=F(()=>Qe({text:Nn,paragraph:al,heading:Bf,inline_code:bs,link:$s,image:pr,strong:As,emphasis:Is,strikethrough:Es,insert:Us,subscript:Ws,superscript:Hs,checkbox:io,checkbox_input:io,hardbreak:mr,math_inline:Uo,reference:Ms,list:ga,math_block:iM,table:Lc},s.value));return(i,r)=>(x(),$("div",en({class:n.value},e.node.attrs),[(x(!0),$(Pe,null,Xe(e.node.children,(l,a)=>{return x(),je(vs((c=l.type,o.value[c]||a1)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Hd.install=e=>{e.component(Hd.__name,Hd)};const IW=["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"],uw=[[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 NW(e){if(e<=255)return IW[e];let t=0,n=uw.length-1;for(;t<=n;){const s=t+n>>1,o=uw[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const LW=/[ \t\n\r\f]+/g,OW=/[\t\n\r\f]| {2,}|^ | $/;let Nm=null;const PW=new RegExp("\\p{Script=Arabic}","u"),Ih=new RegExp("\\p{M}","u"),lM=new RegExp("\\p{Nd}","u");function dw(e){return PW.test(e)}function fw(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 Ai(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(fw(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(fw(n))return!0}}return!1}const RW=new Set([" "," ","⁠","\uFEFF"]);function DW(e){return Ai(e)}function c1(e){return!(function(t){const n=Ff(t);return n!==null&&(Hv.has(n)||dl.has(n))})(e)&&!(function(t){const n=Ff(t);return n!==null&&RW.has(n)})(e)}const Hv=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Nh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Wv=new Set(["'","’"]),dl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),BW=new Set([":",".","،","؛"]),FW=new Set(["၏"]),HW=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function WW(e){if(Uv(e))return!0;let t=!1;for(const n of e)if(dl.has(n))t=!0;else if(!t||!Ih.test(n))return!1;return t}function UW(e){for(const t of e)if(!Hv.has(t)&&!dl.has(t))return!1;return e.length>0}function jW(e){if(Uv(e))return!0;for(const t of e)if(!Nh.has(t)&&!Wv.has(t)&&!Ih.test(t))return!1;return e.length>0}function Uv(e){let t=!1;for(const n of e)if(n!=="\\"&&!Ih.test(n)){if(!(Nh.has(n)||dl.has(n)||Wv.has(n)))return!1;t=!0}return t}function aM(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 Ff(e){if(e.length===0)return null;const t=aM(e,e.length);return e.slice(t)}function qW(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Ih.test(s))n--;else{if(!Nh.has(s)&&!Wv.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function zW(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function hw(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 pw(e,t){return e&&t!==null&&BW.has(t)}function VW(e){const t=Ff(e);return t!==null&&FW.has(t)}function KW(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 u1(e){let t=e.length;for(;t>0;){const n=aM(e,t),s=e.slice(n,t);if(HW.has(s))return!0;if(!dl.has(s))return!1;t=n}return!1}function GW(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
215
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const YW=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function So(e){return e.length===1?e[0]:e.join("")}function XW(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),So(n)}function ZW(e,t,n,s){if(!YW.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=GW(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:So(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:So(r),isWordLike:a,kind:i,start:l}),o}function Lm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const JW=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function QW(e,t){const n=e.texts[t];return!!n.startsWith("www.")||JW.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function eU(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const tU=new Set([":","-","/","×",",",".","+","–","—"]),mw=/^[A-Za-z0-9_]+[,:;]*$/,gw=/[,:;]+$/;function vw(e){for(const t of e)if(lM.test(t))return!0;return!1}function Wd(e){if(e.length===0)return!1;for(const t of e)if(!lM.test(t)&&!tU.has(t))return!1;return!0}function yw(e,t,n){var s,o,i;const r=(Nm===null&&(Nm=new Intl.Segmenter(void 0,{granularity:"word"})),Nm);let l=0;const a=[],c=[],u=[],d=[],f=[],p=[],h=[],g=[],S=[],_=[],y=[],b=[];for(const k of r.segment(e))for(const A of ZW(k.segment,(s=k.isWordLike)!=null&&s,k.index,n)){let I=function(){p[V]!==null&&(c[V]=[hw(a,p,h,V)],p[V]=null),c[V].push(A.text),u[V]=u[V]||A.isWordLike,g[V]=g[V]||L,S[V]=S[V]||R,_[V]=U,y[V]=K,b[V]=pw(S[V],B)};const P=A.kind==="text",M=zW(A.text,A.isWordLike,A.kind),L=Ai(A.text),R=dw(A.text),B=Ff(A.text),U=u1(A.text),K=VW(A.text),V=l-1;t.carryCJKAfterClosingQuote&&P&&l>0&&d[V]==="text"&&L&&g[V]&&_[V]||P&&l>0&&d[V]==="text"&&UW(A.text)&&g[V]||P&&l>0&&d[V]==="text"&&y[V]?I():P&&l>0&&d[V]==="text"&&A.isWordLike&&R&&b[V]?(I(),u[V]=!0):M!==null&&l>0&&d[V]==="text"&&p[V]===M?h[V]=((o=h[V])!=null?o:1)+1:P&&!A.isWordLike&&l>0&&d[V]==="text"&&(WW(A.text)||A.text==="-"&&u[V])?I():(a[l]=A.text,c[l]=[A.text],u[l]=A.isWordLike,d[l]=A.kind,f[l]=A.start,p[l]=M,h[l]=M===null?0:1,g[l]=L,S[l]=R,_[l]=U,y[l]=K,b[l]=pw(R,B),l++)}for(let k=0;k<l;k++)p[k]===null?a[k]=So(c[k]):a[k]=hw(a,p,h,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&Uv(a[k])&&d[k-1]==="text"&&(a[k-1]+=a[k],u[k-1]=u[k-1]||u[k],a[k]="");const v=Array.from({length:l},()=>null);let w=-1;for(let k=l-1;k>=0;k--){const A=a[k];if(A.length!==0){if(d[k]==="text"&&!u[k]&&jW(A)&&w>=0&&d[w]==="text"){const I=(i=v[w])!=null?i:[];I.push(A),v[w]=I,f[w]=f[k],a[k]="";continue}w=k}}for(let k=0;k<l;k++){const A=v[k];A!=null&&(a[k]=XW(A,a[k]))}let N=0;for(let k=0;k<l;k++){const A=a[k];A.length!==0&&(N!==k&&(a[N]=A,u[N]=u[k],d[N]=d[k],f[N]=f[k]),N++)}a.length=N,u.length=N,d.length=N,f.length=N;const E=(function(k){const A=k.texts.slice(),I=k.isWordLike.slice(),P=k.kinds.slice(),M=k.starts.slice();for(let L=0;L<A.length-1;L++){if(P[L]!=="text"||P[L+1]!=="text"||!Ai(A[L])||!Ai(A[L+1]))continue;const R=qW(A[L]);R!==null&&(A[L]=R.head,A[L+1]=R.tail+A[L+1],M[L+1]=M[L]+R.head.length)}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];for(let L=0;L<k.len;L++){const R=k.texts[L],B=k.kinds[L],U=k.isWordLike[L];if(B==="text"&&U&&mw.test(R)){const K=[R];let V=gw.test(R),se=L+1;for(;V&&se<k.len&&k.kinds[se]==="text"&&k.isWordLike[se]&&mw.test(k.texts[se]);){const Y=k.texts[se];K.push(Y),V=gw.test(Y),se++}A.push(So(K)),I.push(!0),P.push("text"),M.push(k.starts[L]),L=se-1;continue}A.push(R),I.push(U),P.push(B),M.push(k.starts[L])}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];for(let L=0;L<k.len;L++){const R=k.texts[L];if(k.kinds[L]==="text"&&R.includes("-")){const B=R.split("-");let U=B.length>1;for(let K=0;K<B.length;K++){const V=B[K];if(!U)break;V.length!==0&&vw(V)&&Wd(V)||(U=!1)}if(U){let K=0;for(let V=0;V<B.length;V++){const se=B[V],Y=V<B.length-1?`${se}-`:se;A.push(Y),I.push(!0),P.push("text"),M.push(k.starts[L]+K),K+=Y.length}continue}}A.push(R),I.push(k.isWordLike[L]),P.push(k.kinds[L]),M.push(k.starts[L])}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];for(let L=0;L<k.len;L++){const R=k.texts[L],B=k.kinds[L];if(B==="text"&&Wd(R)&&vw(R)){const U=[R];let K=L+1;for(;K<k.len&&k.kinds[K]==="text"&&Wd(k.texts[K]);)U.push(k.texts[K]),K++;A.push(So(U)),I.push(!0),P.push("text"),M.push(k.starts[L]),L=K-1;continue}A.push(R),I.push(k.isWordLike[L]),P.push(B),M.push(k.starts[L])}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];for(let L=0;L<k.len;L++){const R=k.texts[L];if(A.push(R),I.push(k.isWordLike[L]),P.push(k.kinds[L]),M.push(k.starts[L]),!eU(R))continue;const B=L+1;if(B>=k.len||Lm(k.kinds[B]))continue;const U=[],K=k.starts[B];let V=B;for(;V<k.len&&!Lm(k.kinds[V]);)U.push(k.texts[V]),V++;U.length>0&&(A.push(So(U)),I.push(!0),P.push("text"),M.push(K),L=V-1)}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=k.texts.slice(),I=k.isWordLike.slice(),P=k.kinds.slice(),M=k.starts.slice();for(let R=0;R<k.len;R++){if(P[R]!=="text"||!QW(k,R))continue;const B=[A[R]];let U=R+1;for(;U<k.len&&!Lm(P[U]);){B.push(A[U]),I[R]=!0;const K=A[U].includes("?");if(P[U]="text",A[U]="",U++,K)break}A[R]=So(B)}let L=0;for(let R=0;R<A.length;R++){const B=A[R];B.length!==0&&(L!==R&&(A[L]=B,I[L]=I[R],P[L]=P[R],M[L]=M[R]),L++)}return A.length=L,I.length=L,P.length=L,M.length=L,{len:L,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];let L=0;for(;L<k.len;){const R=[k.texts[L]];let B=k.isWordLike[L],U=k.kinds[L],K=k.starts[L];if(U==="glue"){const V=[R[0]],se=K;for(L++;L<k.len&&k.kinds[L]==="glue";)V.push(k.texts[L]),L++;const Y=So(V);if(!(L<k.len&&k.kinds[L]==="text")){A.push(Y),I.push(!1),P.push("glue"),M.push(se);continue}R[0]=Y,R.push(k.texts[L]),B=k.isWordLike[L],U="text",K=se,L++}else L++;if(U==="text")for(;L<k.len&&k.kinds[L]==="glue";){const V=[];for(;L<k.len&&k.kinds[L]==="glue";)V.push(k.texts[L]),L++;const se=So(V);L<k.len&&k.kinds[L]==="text"?(R.push(se,k.texts[L]),B=B||k.isWordLike[L],L++):R.push(se)}A.push(So(R)),I.push(B),P.push(U),M.push(K)}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})({len:N,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let k=0;k<E.len-1;k++){const A=KW(E.texts[k]);A!==null&&(E.kinds[k]!=="space"&&E.kinds[k]!=="preserved-space"||E.kinds[k+1]!=="text"||!dw(E.texts[k+1])||(E.texts[k]=A.space,E.isWordLike[k]=!1,E.kinds[k]=E.kinds[k]==="preserved-space"?"preserved-space":"space",E.texts[k+1]=A.marks+E.texts[k+1],E.starts[k+1]=E.starts[k]+A.space.length))}return E}function nU(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 Hl=null;const kw=new Map;let Wl=null;const sU=new RegExp("\\p{Emoji_Presentation}","u"),oU=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Om=null;const bw=new Map;function d1(){if(Hl!==null)return Hl;if(typeof OffscreenCanvas<"u")return Hl=new OffscreenCanvas(1,1).getContext("2d"),Hl;if(typeof document<"u")return Hl=document.createElement("canvas").getContext("2d"),Hl;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Qi(e,t){let n=t.get(e);return n===void 0&&(n={width:d1().measureText(e).width,containsCJK:Ai(e)},t.set(e,n)),n}function Lh(){if(Wl!==null)return Wl;if(typeof navigator>"u")return Wl={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Wl;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 Wl={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Wl}function cM(){return Om===null&&(Om=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Om}function iU(e){return sU.test(e)||e.includes("️")}function Yr(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=cM();for(const a of l.segment(i))iU(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function rU(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 lU(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function _w(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Lh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,p=0;function h(v=u,w=d,N=a){l++,a=0,c=!1,f=-1,p=0}function g(v,w){c=!0,u=v+1,d=0,a=w}function S(v,w,N){c=!0,u=v,d=w+1,a=N}function _(v,w){c?(a+=w,u=v+1,d=0):g(v,w)}function y(v,w){const N=i[v];for(let E=w;E<N.length;E++){const k=N[E];c?a+k>r?(h(),S(v,E,k)):(a+=k,u=v,d=E+1):S(v,E,k)}c&&u===v&&d===N.length&&(u=v+1,d=0)}let b=0;for(;b<s.length&&(c||(b=rU(e,b),!(b>=s.length)));){const v=s[b],w=o[b],N=w==="space"||w==="preserved-space"||w==="tab"||w==="zero-width-break"||w==="soft-hyphen";if(c)if(a+v>r){if(N){_(b,v),h(b+1,0,a-v),b++;continue}if(f>=0){if(u>f||u===f&&d>0){h();continue}h(f,0,p);continue}if(v>t&&i[b]!==null){h(),y(b,0),b++;continue}h()}else _(b,v),N&&(f=b+1,p=a-v),b++;else v>t&&i[b]!==null?y(b,0):g(b,v),N&&(f=b+1,p=a-v),b++}return c&&h(),l}let Pm=null;function aU(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=u1(d),l=Nh.has(d)}function u(d,f){s.push(d),i=i||f;const p=u1(d);r=d.length===1&&dl.has(d)&&r||p,l=!1}for(const d of(Pm===null&&(Pm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Pm).segment(e)){const f=d.segment,p=Ai(f);s.length!==0?l||Hv.has(f)||dl.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 cU(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Ai(e[0].text),i=c1(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=Ai(a.text),u=c1(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 uU(e,t,n,s){const o=Lh(),{cache:i,emojiCorrection:r}=(function(E,k){d1().font=E;const A=(function(M){let L=kw.get(M);return L||(L=new Map,kw.set(M,L)),L})(E),I=(function(M){const L=M.match(/(\d+(?:\.\d+)?)\s*px/);return L?parseFloat(L[1]):16})(E),P=k?(function(M,L){let R=bw.get(M);if(R!==void 0)return R;const B=d1();B.font=M;const U=B.measureText("😀").width;if(R=0,U>L+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=M,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const V=K.getBoundingClientRect().width;document.body.removeChild(K),U-V>.5&&(R=U-V)}return bw.set(M,R),R})(E,I):0;return{cache:A,fontSize:I,emojiCorrection:P}})(t,(l=e.normalized,oU.test(l)));var l;const a=Yr("-",Qi("-",i),r),c=8*Yr(" ",Qi(" ",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 g=null,S=[],_=n?[]:null,y=Array.from({length:e.len});function b(E,k,A,I,P,M,L){P!=="text"&&P!=="space"&&P!=="zero-width-break"&&(h=!1),u.push(k),d.push(A),f.push(I),p.push(P),S.push(L),_!==null&&_.push(E)}function v(E,k,A,I,P){const M=Qi(E,i),L=Yr(E,M,r),R=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:L,B=k==="space"||k==="zero-width-break"?0:L;if(P&&I&&E.length>1){let U="sum-graphemes";Wd(E)?U="pair-context":o.preferPrefixWidthsForBreakableRuns&&(U="segment-prefixes");const K=(function(V,se,Y,G,ee){if(se.breakableFitAdvances!==void 0)return se.breakableFitAdvances;const Se=cM(),ae=[];for(const me of Se.segment(V))ae.push(me.segment);if(ae.length<=1)return se.breakableFitAdvances=null,se.breakableFitAdvances;if(ee==="sum-graphemes"){const me=[];for(const $e of ae){const J=Qi($e,Y);me.push(Yr($e,J,G))}return se.breakableFitAdvances=me,se.breakableFitAdvances}if(ee==="pair-context"||ae.length>96){const me=[];let $e=null,J=0;for(const ye of ae){const _e=Yr(ye,Qi(ye,Y),G);if($e===null)me.push(_e);else{const W=$e+ye,Z=Qi(W,Y);me.push(Yr(W,Z,G)-J)}$e=ye,J=_e}return se.breakableFitAdvances=me,se.breakableFitAdvances}const Ie=[];let de="",we=0;for(const me of ae){de+=me;const $e=Yr(de,Qi(de,Y),G);Ie.push($e-we),we=$e}return se.breakableFitAdvances=Ie,se.breakableFitAdvances})(E,M,i,r,U);return void b(E,L,R,B,k,A,K)}b(E,L,R,B,k,A,null)}for(let E=0;E<e.len;E++){y[E]=u.length;const k=e.texts[E],A=e.isWordLike[E],I=e.kinds[E],P=e.starts[E];if(I==="soft-hyphen"){b(k,0,a,a,I,P,null);continue}if(I==="hard-break"){b(k,0,0,0,I,P,null);continue}if(I==="tab"){b(k,0,0,0,I,P,null);continue}const M=Qi(k,i);if(I==="text"&&M.containsCJK){const L=aU(k,o),R=s==="keep-all"?cU(L):L;for(let B=0;B<R.length;B++){const U=R[B];v(U.text,"text",P+U.start,A,s==="keep-all"||!Ai(U.text))}continue}v(k,I,P,A,!0)}const w=(function(E,k,A){const I=[];for(let P=0;P<E.length;P++){const M=E[P],L=M.startSegmentIndex<k.length?k[M.startSegmentIndex]:A,R=M.endSegmentIndex<k.length?k[M.endSegmentIndex]:A,B=M.consumedEndSegmentIndex<k.length?k[M.consumedEndSegmentIndex]:A;I.push({startSegmentIndex:L,endSegmentIndex:R,consumedEndSegmentIndex:B})}return I})(e.chunks,y,u.length),N=g===null?null:(function(E,k){const A=(function(P){const M=P.length;if(M===0)return null;const L=new Array(M);let R=!1;for(let Y=0;Y<M;){const G=P.charCodeAt(Y);let ee=G,Se=1;if(G>=55296&&G<=56319&&Y+1<M){const Ie=P.charCodeAt(Y+1);Ie>=56320&&Ie<=57343&&(ee=Ie-56320+(G-55296<<10)+65536,Se=2)}const ae=NW(ee);ae!=="R"&&ae!=="AL"&&ae!=="AN"||(R=!0);for(let Ie=0;Ie<Se;Ie++)L[Y+Ie]=ae;Y+=Se}if(!R)return null;let B=0;for(let Y=0;Y<M;Y++){const G=L[Y];if(G==="L"){B=0;break}if(G==="R"||G==="AL"){B=1;break}}const U=new Int8Array(M);for(let Y=0;Y<M;Y++)U[Y]=B;const K=1&B?"R":"L",V=K;let se=V;for(let Y=0;Y<M;Y++)L[Y]==="NSM"?L[Y]=se:se=L[Y];se=V;for(let Y=0;Y<M;Y++){const G=L[Y];G==="EN"?L[Y]=se==="AL"?"AN":"EN":G!=="R"&&G!=="L"&&G!=="AL"||(se=G)}for(let Y=0;Y<M;Y++)L[Y]==="AL"&&(L[Y]="R");for(let Y=1;Y<M-1;Y++)L[Y]==="ES"&&L[Y-1]==="EN"&&L[Y+1]==="EN"&&(L[Y]="EN"),L[Y]!=="CS"||L[Y-1]!=="EN"&&L[Y-1]!=="AN"||L[Y+1]!==L[Y-1]||(L[Y]=L[Y-1]);for(let Y=0;Y<M;Y++){if(L[Y]!=="EN")continue;let G;for(G=Y-1;G>=0&&L[G]==="ET";G--)L[G]="EN";for(G=Y+1;G<M&&L[G]==="ET";G++)L[G]="EN"}for(let Y=0;Y<M;Y++){const G=L[Y];G!=="WS"&&G!=="ES"&&G!=="ET"&&G!=="CS"||(L[Y]="ON")}se=V;for(let Y=0;Y<M;Y++){const G=L[Y];G==="EN"?L[Y]=se==="L"?"L":"EN":G!=="R"&&G!=="L"||(se=G)}for(let Y=0;Y<M;Y++){if(L[Y]!=="ON")continue;let G=Y+1;for(;G<M&&L[G]==="ON";)G++;const ee=(Y>0?L[Y-1]:V)!=="L"?"R":"L";if(ee===((G<M?L[G]:V)!=="L"?"R":"L"))for(let Se=Y;Se<G;Se++)L[Se]=ee;Y=G-1}for(let Y=0;Y<M;Y++)L[Y]==="ON"&&(L[Y]=K);for(let Y=0;Y<M;Y++){const G=L[Y];1&U[Y]?G!=="L"&&G!=="AN"&&G!=="EN"||U[Y]++:G==="R"?U[Y]++:G!=="AN"&&G!=="EN"||(U[Y]+=2)}return U})(E);if(A===null)return null;const I=new Int8Array(k.length);for(let P=0;P<k.length;P++)I[P]=A[k[P]];return I})(e.normalized,g);return _!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:N,breakableFitAdvances:S,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:w,segments:_}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:h,segLevels:N,breakableFitAdvances:S,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:w}}function dU(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return uU((function(c,u,d="normal",f="normal"){const p=(function(S){const _=S??"normal";return _==="pre-wrap"?{mode:_,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:_,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),h=p.mode==="pre-wrap"?(function(S){return/[\r\f]/.test(S)?S.replace(/\r\n/g,`
216
+ `).replace(/[\r\f]/g,`
217
+ `):S.replace(/\r\n/g,`
218
+ `)})(c):(function(S){if(!OW.test(S))return S;let _=S.replace(LW," ");return _.charCodeAt(0)===32&&(_=_.slice(1)),_.length>0&&_.charCodeAt(_.length-1)===32&&(_=_.slice(0,-1)),_})(c);if(h.length===0)return{normalized:h,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=f==="keep-all"?(function(S){if(S.len<=1)return S;const _=[],y=[],b=[],v=[];let w=null,N=!1,E=0,k=!1,A=!1;function I(){w!==null&&(_.push(So(w)),y.push(N),b.push("text"),v.push(E),w=null)}for(let P=0;P<S.len;P++){const M=S.texts[P],L=S.kinds[P],R=S.isWordLike[P],B=S.starts[P];if(L==="text"){const U=DW(M),K=c1(M);if(w!==null&&k&&A){w.push(M),N=N||R,k=k||U,A=K;continue}I(),w=[M],N=R,E=B,k=U,A=K;continue}I(),_.push(M),y.push(R),b.push(L),v.push(B)}return I(),{len:_.length,texts:_,isWordLike:y,kinds:b,starts:v}})(yw(h,u,p)):yw(h,u,p);return Qe({normalized:h,chunks:nU(g,p)},g)})(s,Lh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Rm="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Gn=(()=>{const e=globalThis;if(e[Rm])return e[Rm];const t={configs:{},controllers:{},revision:hl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Rm]=t,t})();let lc=null;const ww=Gn.revision;function Sw(e){var t;return e&&(t=Gn.configs[e])!=null?t:null}function Cw(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function fU(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Dm(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!fU(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+=`
219
+ `)}return o.length>0?o:null}function Bm(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(lc!=null)return lc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return lc=!!((i=r.getContext)!=null&&i.call(r,"2d")),lc}catch{return lc=!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=Gn.blockEstimateCache.get(r);if(l)return Gn.blockEstimateCache.delete(r),Gn.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,g){const S=`${g}\0${h}\0${p}`,_=Gn.preparedCache.get(S);if(_)return Gn.preparedCache.delete(S),Gn.preparedCache.set(S,_),_.prepared;const y=dU(p,h,{whiteSpace:g});for(Gn.preparedCache.set(S,{prepared:y});Gn.preparedCache.size>240;){const b=Gn.preparedCache.keys().next().value;if(!b)break;Gn.preparedCache.delete(b)}return y})(e,n.font,a),u=(function(p,h,g){const S=(function(_,y){return _.simpleLineWalkFastPath?_w(_,y):(function(b,v){if(b.simpleLineWalkFastPath)return _w(b,v);const{widths:w,lineEndFitAdvances:N,lineEndPaintAdvances:E,kinds:k,breakableFitAdvances:A,discretionaryHyphenWidth:I,tabStopAdvance:P,chunks:M}=b;if(w.length===0||M.length===0)return 0;const L=Lh(),R=L.lineFitEpsilon,B=v+R;let U=0,K=0,V=!1,se=0,Y=0,G=-1,ee=0,Se=0,ae=null;function Ie(){G=-1,ee=0,Se=0,ae=null}function de(Z=se,fe=Y,oe=K){U++,K=0,V=!1,Ie()}function we(Z,fe){V=!0,se=Z+1,Y=0,K=fe}function me(Z,fe,oe){V=!0,se=Z,Y=fe+1,K=oe}function $e(Z,fe){V?(K+=fe,se=Z+1,Y=0):we(Z,fe)}function J(Z,fe,oe,he){if(!fe)return;const H=Z==="tab"?0:N[oe],X=Z==="tab"?he:E[oe];G=oe+1,ee=K-he+H,Se=K-he+X,ae=Z}function ye(Z,fe){const oe=A[Z];for(let he=fe;he<oe.length;he++){const H=oe[he];V?K+H>B?(de(),me(Z,he,H)):(K+=H,se=Z,Y=he+1):me(Z,he,H)}V&&se===Z&&Y===oe.length&&(se=Z+1,Y=0)}function _e(Z){if(ae!=="soft-hyphen")return!1;const fe=A[Z];if(fe==null)return!1;const{fitCount:oe,fittedWidth:he}=(function(H,X,ce,ke,Me){let Ne=0,re=X;for(;Ne<H.length;){const le=re+H[Ne];if((Ne+1<H.length?le+Me:le)>ce+ke)break;re=le,Ne++}return{fitCount:Ne,fittedWidth:re}})(fe,K,v,R,I);return oe!==0&&(K=he,se=Z,Y=oe,Ie(),oe===fe.length?(se=Z+1,Y=0,!0):(de(Z,oe,he+I),ye(Z,oe),!0))}function W(Z){U++,Ie()}for(let Z=0;Z<M.length;Z++){const fe=M[Z];if(fe.startSegmentIndex===fe.endSegmentIndex){W();continue}V=!1,K=0,fe.startSegmentIndex,se=fe.startSegmentIndex,Y=0,Ie();let oe=fe.startSegmentIndex;for(;oe<fe.endSegmentIndex;){const he=k[oe],H=he==="space"||he==="preserved-space"||he==="tab"||he==="zero-width-break"||he==="soft-hyphen",X=he==="tab"?lU(K,P):w[oe];if(he!=="soft-hyphen")if(V){if(K+X>B){const ce=K+(he==="tab"?0:N[oe]),ke=K+(he==="tab"?X:E[oe]);if(ae==="soft-hyphen"&&L.preferEarlySoftHyphenBreak&&ee<=B){de(G,0,Se);continue}if(ae==="soft-hyphen"&&_e(oe)){oe++;continue}if(H&&ce<=B){$e(oe,X),de(oe+1,0,ke),oe++;continue}if(G>=0&&ee<=B){if(se>G||se===G&&Y>0){de();continue}const Me=G;de(Me,0,Se),oe=Me;continue}if(X>v&&A[oe]!==null){de(),ye(oe,0),oe++;continue}de();continue}$e(oe,X),J(he,H,oe,X),oe++}else X>v&&A[oe]!==null?ye(oe,0):we(oe,X),J(he,H,oe,X),oe++;else V&&(se=oe+1,Y=0,G=oe+1,ee=K+I,Se=K+I,ae=he),oe++}if(V){const he=G===fe.consumedEndSegmentIndex?Se:K;de(fe.consumedEndSegmentIndex,0,he)}}return U})(_,y)})(p,h);return{lineCount:S,height:S*g}})(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(Gn.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Gn.blockEstimateCache.size>4e3;){const p=Gn.blockEstimateCache.keys().next().value;if(!p)break;Gn.blockEstimateCache.delete(p)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function uM(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Dm(e.children);return i&&n.paragraph?Bm(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Dm(e.children),l=n.headings[i];return r&&l?Bm(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=Dm((o=i[0])==null?void 0:o.children);return r?Bm(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=uM(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 gd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function hU(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(gd(String((d=u.originalCode)!=null?d:"")),gd(String((f=u.updatedCode)!=null?f:"")),gd(String((p=u.code)!=null?p:""))):gd((function(h,g){const S=String(h??"");return g?S:S.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 g=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*g)})(u,r),f=(function(p,h){var g,S;if(!h)return 0;const _=typeof((g=p?.padding)==null?void 0:g.top)=="number"?p.padding.top:10,y=typeof((S=p?.padding)==null?void 0:S.bottom)=="number"?p.padding.bottom:22;return Math.max(0,_)+Math.max(0,y)})(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 pU(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Fm(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=Cw(s.lineHeight,1.5*Cw(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:pU(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const mU=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function xw(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))mU.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const gU=!1;function ppe(){return gU}function Tw(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 dM=Symbol("MarkstreamMathBlockMinHeightCache");function mpe(){return Rt(dM,null)}const vU=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],yU=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],kU=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),fM=["raw","content","code","originalCode","updatedCode"],Mw=new WeakMap,Aw=new WeakMap;let bU=1;function Ro(){return typeof performance<"u"?performance.now():Date.now()}function Ew(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function To(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=Mw.get(t);return n||(n=bU++,Mw.set(t,n)),String(n)}function $w(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:To(t),customMarkdownIt:To(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:To(e.validateLink),preTransformTokens:To(e.preTransformTokens),postTransformTokens:To(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function Iw(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
220
+ `,t-1)+1;return e.slice(n,t).trim()}function Nw(e){const t=hM(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function hM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function pM(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 jv(e){const t=String(e??"");return`${t.length}:${pM(t)}`}function f1(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?jv(r):`${r.length}:${pM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${To(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:${To(s)}`;const i=To(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>f1(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}:${f1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Hf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function mM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Hf(s)?Sr(s,t,n+1):mM(s,t,n+1)).join(",")}`:Hf(e)?Sr(e,t,n):f1(e,t,n)}function _U(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!fM.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${jv(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${To(o)}`:kU.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${mM(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${To(o)}`:""}).filter(Boolean).join(";")}function wU(e){return fM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${jv(n)}`:""}).filter(Boolean).join(";")}function Sr(e,t=new WeakMap,n=0){const s=Aw.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}:${To(o)}`;const r=To(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=>Sr(h,c,u+1)).join("|"):"";return[a.type,wU(d),_U(d,c,u),f.length,p].join(":")})(e,t,n);return Aw.set(o,l),l}function gM(e,t){return Sr(e)===Sr(t)}function qv(e,t,n){const s=Ro(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ro()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function Lw(e,t,n){return qv(t,n,()=>Sr(e))}function vM(e,t,n){return Lw(e,n,"stabilizeSignatureMs")===Lw(t,n,"stabilizeSignatureMs")}function Hm(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function Ow(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function SU(e,t){return e.length===t.length&&e===t}function zv(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"||!SU(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(!Hf(d)||!Hf(f))return null;const p=zv(d,f,n+1);if(p==null)return null;if(!p)return!1}return!0}function CU(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=zv(e,t);return n??gM(e,t)}function xU(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return qv(n,"stabilizeSignatureMs",()=>{s=zv(e,t)}),s??vM(e,t,n)}function TU(e,t){const n={};for(const s of vU){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function MU(e,t){var n;const s=j_(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:F(()=>!1),r=te(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,p=0,h=Ro();function g(){l&&(clearTimeout(l),l=void 0)}function S(){g();const A=t.renderContent.value;r.value!==A&&(r.value=A),h=Ro()}Ke([t.renderContent,t.effectiveFinal,i],([A,I,P])=>{r.value!==A&&(!P||I||(function(M,L){if(!M&&L||L.length<=80||L.length<M.length||!L.startsWith(M))return!0;const R=L.slice(M.length);return!!R&&(!!Nw(Iw(L))||!(!R.includes(`
221
+
222
+ `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
223
+ `)&&!(function(B){const U=Iw(B);if(Nw(U))return!1;const K=hM(U);return K.length>=2&&K.some(V=>V.trim())})(L))})(r.value,A)?S():(function(){if(p+=1,l)return;const M=Math.max(0,(function(L){const R=L.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(Ro()-h));M<=0?S():l=setTimeout(S,M)})())},{flush:"sync",immediate:!0}),$1(g);const _=F(()=>{var A,I,P,M;return s7(e.customHtmlTags,(A=e.parseOptions)==null?void 0:A.customHtmlTags,(M=(P=(I=t.customComponentsMap)==null?void 0:I.value)!=null?P:{},Object.entries(M).map(([L,R])=>{const B=No(L);return R==null||!B||vu(B)||qx.has(B)||pu.has(B)?"":B}).filter(Boolean)))}),y=F(()=>{const{key:A,tags:I}=o7(_.value);if(!A)return s;const P=o.get(A);if(P)return P;const M=j_(t.instanceMsgId,{customHtmlTags:I});return o.set(A,M),M}),b=F(()=>{const A=y.value;return e.customMarkdownIt?e.customMarkdownIt(A):A}),v=F(()=>{var A,I;const P=(A=e.parseOptions)!=null?A:{},M=t.effectiveFinal.value,L=_.value,R=M!=null,B=L.length>0;return R||B||P.streamParse==null?Qe(Qe(St(Qe({},P),{streamParse:(I=P.streamParse)==null||I}),R?{final:M}:{}),B?{customHtmlTags:L}:{}):P}),w=F(()=>{var A;return new Set(((A=v.value.customHtmlTags)!=null?A:[]).map(I=>String(I).trim().toLowerCase()).filter(Boolean))}),N=F(()=>$w(v.value,b.value,e.customMarkdownIt,{includeFinal:!0})),E=F(()=>$w(v.value,b.value,e.customMarkdownIt,{includeFinal:!1}));Ke([N,E],([A,I],[P,M])=>{P&&(A===P&&I===M||(S(),I!==M&&(a=[],d="")))},{flush:"sync"});const k=F(()=>{var A,I,P,M,L,R,B,U;if((A=e.nodes)!=null&&A.length)return a=[],d="",ar(e.nodes.slice());const K=r.value;if(!K)return a=[],d="",[];const V=t.debugPerformanceEnabled.value,se=V?Ro():0,Y=b.value,G=N.value,ee=E.value;c&&G!==c&&(function(fe){var oe,he;(he=(oe=fe.stream)==null?void 0:oe.reset)==null||he.call(oe)})(Y),u&&ee!==u&&(a=[],d="");const Se=a.length>0&&K.startsWith(d)&&ee===u,ae=V?Ew(Y):null,Ie=V?{}:void 0,de=Ie?St(Qe({},v.value),{__timing:Ie}):v.value,we=NT(K,Y,de),me=V?Ro():0,$e=V?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let J,ye=V?Hm(we.length):void 0,_e=0,W=0;if(Se){const fe=V?Ro():0;if($e){const oe=(function(he,H,X){if(!H.length)return{nodes:he,metrics:Hm(he.length)};const ce=(function(Ne,re,le){const Ce=Math.min(Ne.length,re.length);for(let We=0;We<Ce;We++)if(!xU(re[We],Ne[We],le))return We;return Ne.length===re.length?-1:Ce})(he,H,X);if(ce<0)return{nodes:H,metrics:{reusedNodeCount:he.length,dirtyStartIndex:ce,stablePrefixNodeCount:he.length,dirtyTailNodeCount:0}};const ke=he.slice();let Me=ce;for(let Ne=0;Ne<ce;Ne++)ke[Ne]=H[Ne];for(let Ne=ce;Ne<he.length;Ne++){const re=H[Ne],le=he[Ne];re&&vM(re,le,X)&&(ke[Ne]=re,Me+=1)}return{nodes:ke,metrics:{reusedNodeCount:Me,dirtyStartIndex:ce,stablePrefixNodeCount:ce,dirtyTailNodeCount:Ow(ce,he,H)}}})(we,a,$e);J=oe.nodes,ye=oe.metrics}else{const oe=(function(he,H){if(!H.length)return{nodes:he,metrics:Hm(he.length)};const X=(function(Me,Ne){const re=Math.min(Me.length,Ne.length);for(let le=0;le<re;le++)if(!CU(Ne[le],Me[le]))return le;return Me.length===Ne.length?-1:re})(he,H);if(X<0)return{nodes:H,metrics:{reusedNodeCount:he.length,dirtyStartIndex:X,stablePrefixNodeCount:he.length,dirtyTailNodeCount:0}};const ce=he.slice();let ke=X;for(let Me=0;Me<X;Me++)ce[Me]=H[Me];for(let Me=X;Me<he.length;Me++){const Ne=H[Me],re=he[Me];Ne&&gM(Ne,re)&&(ce[Me]=Ne,ke+=1)}return{nodes:ce,metrics:{reusedNodeCount:ke,dirtyStartIndex:X,stablePrefixNodeCount:X,dirtyTailNodeCount:Ow(X,he,H)}}})(we,a);J=oe.nodes,ye=oe.metrics}_e=V?Ro()-fe:0,W=ye?.dirtyStartIndex==null||ye.dirtyStartIndex<0?J.length:ye.dirtyStartIndex}else J=we;$e?(function(fe,oe,he=0){for(let H=Math.max(0,he);H<fe.length;H++)qv(oe,"primeSignatureMs",()=>Sr(fe[H]))})(J,$e,W):(function(fe,oe=0){for(let he=Math.max(0,oe);he<fe.length;he++)Sr(fe[he])})(J,W);const Z=V?Ro()-me:0;if(f+=1,d=K,c=G,u=ee,a=J,V){const fe=Ew(Y),oe=typeof fe?.total=="number"&&fe.total>((I=ae?.total)!=null?I:0);t.logPerf(oe?"parse(stream)":"parse(sync)",Qe(Qe(Qe({rendererId:t.instanceMsgId,ms:Math.round(Ro()-se),nodes:J.length,contentLength:K.length,parseCommitCount:f,parseCoalescedCount:p,nodeReuseMs:Z,signatureMs:(P=$e?.signatureMs)!=null?P:0,stabilizeSignatureMs:(M=$e?.stabilizeSignatureMs)!=null?M:0,primeSignatureMs:(L=$e?.primeSignatureMs)!=null?L:0,signatureCallCount:(R=$e?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(B=$e?.stabilizeSignatureCallCount)!=null?B:0,primeSignatureCallCount:(U=$e?.primeSignatureCallCount)!=null?U:0,stabilizeMs:_e},ye??{}),Ie?Object.fromEntries(yU.map(he=>{var H;return[he,(H=Ie[he])!=null?H:0]})):{}),fe?{streamMode:fe.lastMode,streamDelta:TU(fe,ae),streamStats:fe}:{}))}return ar(J)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:w,mdBase:y,mdInstance:b,mergedParseOptions:v,parsedNodes:k}}function AU(e){const{isClient:t}=e,n=te(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((g=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!g)return;var h,g;const S=n.value,_=S.has(f);if(p){if(_)return;const b=new Set(S);return b.add(f),void(n.value=b)}if(!_)return;const y=new Set(S);y.delete(f),n.value=y})(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 EU(e={}){const t=te(""),n=te(""),s=te(!1),o=j9(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=F(()=>Math.max(0,t.value.length-n.value.length)),a=F(()=>l.value===0),c=F(()=>s.value&&a.value);return E1()&&$1(()=>{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 Pw=/auto|scroll|overlay/i;function $U(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return Pw.test(t)||Pw.test(n)}function IU(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 NU=Ze({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,s;return Jg((s=Ql(e.estimatedPreviewHeightPx))!=null?s:Xg(String((n=e.node.code)!=null?n:"")))});return()=>Xt("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Xt("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Xt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Xt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Xt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Xt("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Xt("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Xt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Xt("div",{class:"absolute inset-0"},[Xt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),LU=Ze({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,s;return Zg((s=Ql(e.estimatedPreviewHeightPx))!=null?s:Yg(String((n=e.node.code)!=null?n:"")))});return()=>Xt("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Xt("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Xt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Xt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Xt("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Xt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Xt("span",{class:"action-icon block"})])))]):null,Xt("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Xt("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}),OU=["data-custom-id"],PU={class:"m-0 p-0"},RU=["data-probe"],DU=["data-node-index","data-node-type"],yM=Jt(Ze(St(Qe({},{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=us(),r=Rt("markstreamNestedRendererProps",void 0);function l(T){var D,j;const q=s[T];return(function(Q){const ve=i?.vnode.props;return!!ve&&(Object.prototype.hasOwnProperty.call(ve,Q)||Object.prototype.hasOwnProperty.call(ve,String(Q).replace(/[A-Z]/g,be=>`-${be.toLowerCase()}`)))})(T)?q:(j=(D=r?.value)==null?void 0:D[T])!=null?j:q}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=F(()=>{return(T=l("mode"))==="chat"||T==="minimal"||T==="docs"?T:"docs";var T}),u=F(()=>{const T=l("renderCodeBlocksAsPre"),D=l("codeRenderer");return T===!0?"pre":D==="pre"||D==="shiki"||D==="monaco"?D:T===!1||c.value==="docs"?"monaco":"pre"}),d=F(()=>a[c.value]),f=F(()=>{var T;return(T=l("showTooltips"))!=null?T:d.value.showTooltips}),p=F(()=>{var T;return(T=l("fade"))!=null?T:d.value.fade}),h=F(()=>{var T;return(T=l("batchRendering"))!=null?T:d.value.batchRendering}),g=F(()=>{var T;return(T=l("initialRenderBatchSize"))!=null?T:d.value.initialRenderBatchSize}),S=F(()=>{var T;return(T=l("renderBatchSize"))!=null?T:d.value.renderBatchSize}),_=F(()=>{var T;return(T=l("renderBatchDelay"))!=null?T:d.value.renderBatchDelay}),y=F(()=>{var T;return(T=l("renderBatchBudgetMs"))!=null?T:d.value.renderBatchBudgetMs}),b=F(()=>{var T;return(T=l("renderBatchIdleTimeoutMs"))!=null?T:d.value.renderBatchIdleTimeoutMs}),v=F(()=>{var T;return(T=l("deferNodesUntilVisible"))!=null?T:d.value.deferNodesUntilVisible}),w=F(()=>{var T;return(T=l("maxLiveNodes"))!=null?T:d.value.maxLiveNodes}),N=F(()=>{var T;return(T=l("liveNodeBuffer"))!=null?T:d.value.liveNodeBuffer}),E=F(()=>{var T;return(T=l("nodeVirtual"))!=null?T:d.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return p.value},get batchRendering(){return h.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return S.value},get renderBatchDelay(){return _.value},get renderBatchBudgetMs(){return y.value},get renderBatchIdleTimeoutMs(){return b.value},get deferNodesUntilVisible(){return v.value},get maxLiveNodes(){return w.value},get liveNodeBuffer(){return N.value},get nodeVirtual(){return E.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function A(T){o("height-change",T)}function I(T){o("virtual-state-change",T)}function P(T){o("anchor-change",T)}const M=te(),L=te(null),R=te(null),B=te(null),U=to({1:null,2:null,3:null,4:null,5:null,6:null}),K=te(!1),V=new Map,se=te(0),Y=te(0),G=te({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ee(){var T,D;if(((T=s.virtualScroll)==null?void 0:T.enabled)!==!0)return null;const j=(D=s.virtualScroll)==null?void 0:D.scrollRoot;return Se(typeof j=="function"?j():j)}function Se(T){return T?typeof HTMLElement<"u"&&T instanceof HTMLElement?T:typeof T=="object"&&"value"in T?Se(T.value):typeof T=="object"&&"$el"in T?Se(T.$el):null:null}const{isClient:ae,renderAsFragment:Ie,debugPerformanceEnabled:de,resolvedShowTooltips:we,resolvedHtmlPolicy:me,inheritedSmoothStreaming:$e,ownsTypewriterCursor:J}=(function(T){const D=typeof window<"u",j=uu(),q=Rt("markstreamHtmlPolicy",void 0),Q=Rt("markstreamTypewriterCursor",void 0),ve=Rt("markstreamSmoothStreaming",void 0),be=F(()=>T.renderAsFragment===!0),xe=F(()=>!!(T.debugPerformance&&D&&typeof console<"u")),Re=F(()=>{var De;if(typeof T.showTooltips=="boolean")return T.showTooltips;const Ee=(De=j.showTooltips)!=null?De:j["show-tooltips"];return Ee===""||Ee===!0||Ee==="true"||Ee!==!1&&Ee!=="false"&&void 0}),Ae=F(()=>{var De,Ee;return(Ee=(De=T.htmlPolicy)!=null?De:q?.value)!=null?Ee:"safe"}),Fe=F(()=>Q?.value!==!0);return{isClient:D,renderAsFragment:be,debugPerformanceEnabled:xe,resolvedShowTooltips:Re,resolvedHtmlPolicy:Ae,inheritedSmoothStreaming:ve,inheritedTypewriterCursor:Q,ownsTypewriterCursor:Fe}})(k),{resolveViewportRoot:ye,resolveScrollContainer:_e,isReverseFlexScrollRoot:W,getNormalizedScrollTop:Z,getOffsetTopWithinRoot:fe}=(function(T,D){function j(){var xe,Re;return(Re=(xe=D.scrollRoot)==null?void 0:xe.call(D))!=null?Re:null}function q(xe){if(typeof window>"u")return null;const Re=j();if(Re)return Re;const Ae=xe??T.value;if(!Ae)return null;const Fe=Ae.ownerDocument||document,De=Fe.scrollingElement||Fe.documentElement;let Ee=Ae;for(;Ee&&Ee!==Fe.body&&Ee!==De;){if($U(window.getComputedStyle(Ee))&&IU(Ee))return Ee;Ee=Ee.parentElement}return null}function Q(xe){if(!D.isClient)return!1;try{const Re=window.getComputedStyle(xe);return!!(Re.display||"").toLowerCase().includes("flex")&&(Re.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ve(xe,Re,Ae){var Fe,De;if(Ae)return be(Re);const Ee=xe.scrollTop;if(!Q(xe))return Ee;const Be=Ee<0?-Ee:Ee;return Math.max(0,((Fe=xe.scrollHeight)!=null?Fe:0)-((De=xe.clientHeight)!=null?De:0))-Be}function be(xe){var Re,Ae,Fe,De,Ee;const Be=Number((Re=xe.scrollingElement)==null?void 0:Re.scrollTop),ze=Number((Fe=(Ae=xe.documentElement)==null?void 0:Ae.scrollTop)!=null?Fe:0),Ve=Number((Ee=(De=xe.body)==null?void 0:De.scrollTop)!=null?Ee:0);return Math.max(0,Number.isFinite(Be)?Be:0,Number.isFinite(ze)?ze:0,Number.isFinite(Ve)?Ve:0)}return{resolveViewportRoot:q,resolveScrollContainer:function(xe){var Re,Ae,Fe,De;const Ee=j();if(Ee)return Ee;const Be=q((Re=xe??T.value)!=null?Re:null);if(Be)return Be;const ze=(De=(Fe=xe?.ownerDocument)!=null?Fe:(Ae=T.value)==null?void 0:Ae.ownerDocument)!=null?De:typeof document<"u"?document:null;return ze?.scrollingElement||ze?.documentElement||null},isReverseFlexScrollRoot:Q,getNormalizedScrollTop:ve,getOffsetTopWithinRoot:function(xe,Re){const Ae=Re.ownerDocument||xe.ownerDocument||document;if((function(Be,ze){return Be===ze.documentElement||Be===ze.body||Be===ze.scrollingElement})(Re,Ae))return xe.getBoundingClientRect().top+be(Ae);const Fe=Re.getBoundingClientRect(),De=xe.getBoundingClientRect(),Ee=ve(Re,Ae,!1);return De.top-Fe.top+Ee}}})(M,{isClient:ae,scrollRoot:ee});gn("markstreamShowTooltips",we),gn("markstreamHtmlPolicy",me),gn("markstreamTypewriter",F(()=>k.typewriter!==!1)),gn("markstreamFade",F(()=>k.fade!==!1)),gn("markstreamTypewriterCursor",F(()=>!0)),gn("markstreamTextStreamState",V),gn("markstreamStreamVersion",se),gn("markstreamParseOptions",F(()=>k.parseOptions)),gn("markstreamCustomMarkdownIt",F(()=>k.customMarkdownIt));const{smoothStreamingEnabled:oe,renderContent:he,effectiveFinal:H}=(function(T,D){const j=EU(T.smoothStreamingOptions),q=F(()=>{var Ae,Fe,De;return T.smoothStreaming!==!1&&!((Ae=T.nodes)!=null&&Ae.length)&&(T.smoothStreaming===!0||!((Fe=D.inheritedSmoothStreaming)!=null&&Fe.value))&&(T.smoothStreaming===!0||T.typewriter===!0||((De=T.maxLiveNodes)!=null?De:0)<=0)}),Q=te(!D.isClient||T.smoothStreaming===!0);Zt(()=>{Q.value=!0});const ve=F(()=>Q.value&&q.value),be=F(()=>{var Ae;return ve.value?j.visible.value:(Ae=T.content)!=null?Ae:""}),xe=F(()=>{var Ae,Fe;const De=(Ae=T.parseOptions)!=null?Ae:{};return(Fe=T.final)!=null?Fe:De.final}),Re=F(()=>{const Ae=xe.value;return ve.value&&Ae!=null?!!Ae&&j.caughtUp.value:Ae});return Ke([()=>T.content,()=>T.nodes,ve,xe],([Ae,Fe,De,Ee])=>{if(Fe?.length)return void j.reset("");const Be=Ae??"";if(!De)return j.reset(Be),void(Ee&&j.finish({flush:!0}));const ze=j.source.value;Be?Be===ze||(Be.startsWith(ze)?j.enqueue(Be.slice(ze.length)):j.reset(Be)):j.reset(""),Ee&&j.finish()},{immediate:!0}),{smoothStream:j,smoothStreamingEligible:q,smoothStreamingEnabled:ve,renderContent:be,requestedFinal:xe,effectiveFinal:Re}})(k,{isClient:ae,inheritedSmoothStreaming:$e});gn("markstreamSmoothStreaming",oe);const X=te(!1);let ce="",ke=!1,Me=null;function Ne(){ae&&Me!=null&&(window.clearTimeout(Me),Me=null)}function re(){X.value=!1,Ne()}function le(T,D){if(!de.value)return;const j=(function(){if(!de.value)return null;const q=kt(Ce),Q=kt(We),ve=Math.max(lt,Q);if(q<=0&&ve<=0)return null;const be={total:q,maxPerFrame:ve,byLabel:(xe=Ce,Object.fromEntries(Array.from(xe.entries()).sort((Re,Ae)=>Ae[1]-Re[1]||Re[0].localeCompare(Ae[0]))))};var xe;return Ce.clear(),We.clear(),lt=0,be})();console.info(`[markstream-vue][perf] ${T}`,j?St(Qe({},D),{layoutReads:j}):D)}Ke([he,()=>s.nodes,H],([T,D,j])=>{const q=T??"";return D?.length||j===!0?(re(),ce=q,void(ke=!0)):ke?(ce&&q.length>ce.length&&q.startsWith(ce)?(X.value=!0,ae&&(Ne(),Me=window.setTimeout(()=>{var Q;Me=null,H.value===!0||(Q=s.nodes)!=null&&Q.length||(El(),X.value=!1,fi())},1200))):(q.length<ce.length||!q.startsWith(ce))&&re(),void(ce=q)):(ce=q,void(ke=!0))},{flush:"sync",immediate:!0});const Ce=new Map,We=new Map;let nt=!1,lt=0;function kt(T){let D=0;for(const j of T.values())D+=j;return D}function Ct(){lt=Math.max(lt,kt(We)),We.clear(),nt=!1}function ut(T,D){return(function(j){var q,Q;de.value&&(Ce.set(j,((q=Ce.get(j))!=null?q:0)+1),We.set(j,((Q=We.get(j))!=null?Q:0)+1),nt||(nt=!0,ae&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ct):typeof queueMicrotask!="function"?setTimeout(Ct,0):queueMicrotask(Ct)))})(T),D()}const Et=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,on=(function(T){const D=new Map;return{scope:T,cache:D,clear:()=>D.clear()}})(Et),Tn=F(()=>`${Et}:${se.value}`);gn(dM,on);const $t=zn(()=>k.customId),{effectiveCustomHtmlTagsSet:On,mergedParseOptions:un,parsedNodes:tt}=MU(k,{instanceMsgId:Et,renderContent:he,effectiveFinal:H,smoothStreamingEnabled:oe,debugPerformanceEnabled:de,customComponentsMap:$t,logPerf:le});Ke(tt,()=>{on.clear(),se.value+=1},{immediate:!0});const Vn=F(()=>({customId:k.customId,customHtmlTags:un.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:me.value,viewportPriority:k.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:k.codeBlockDarkTheme,codeBlockLightTheme:k.codeBlockLightTheme,codeBlockMonacoOptions:k.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:k.codeBlockMinWidth,codeBlockMaxWidth:k.codeBlockMaxWidth,codeBlockProps:k.codeBlockProps,mermaidProps:k.mermaidProps,d2Props:k.d2Props,infographicProps:k.infographicProps,showTooltips:we.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));gn("markstreamNestedRendererProps",Vn);const Lo=F(()=>tt.value),_s=F(()=>tt.value.length),Pn=te(null),rn=te(null),yn=te(null),Rn=te(null),Mn=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),ds=!Mn&&k.customId?Sw(k.customId):null,Dn=F(()=>ds?(ww.value,Sw(k.customId)):null),ns=F(()=>{var T;return!!(ae&&!Ie.value&&k.customId&&!Mn&&((T=Dn.value)!=null&&T.enabled))}),Ge=F(()=>{var T;return!!(!Ie.value&&((T=s.virtualScroll)!=null&&T.enabled))}),Ue=te(!1);Zt(()=>{Ue.value=!0});const qe=F(()=>!!(ae&&Ge.value));gn("markstreamHostScrollManaged",qe);const wt=F(()=>!!(Ue.value&&qe.value)),Qt=F(()=>ns.value||qe.value),Ns=F(()=>ns.value||wt.value),zs=F(()=>{var T;return Qt.value&&((T=Dn.value)==null?void 0:T.textEstimation)!==!1}),Ar=F(()=>{var T;return Qt.value&&((T=Dn.value)==null?void 0:T.codeBlockEstimation)!==!1});function ws(){const T=Y.value||ut("getMeasuredContainerWidth.clientWidth",()=>{var D;return((D=M.value)==null?void 0:D.clientWidth)||0});return Number.isFinite(T)&&T>0?T:0}const ai=F(()=>{const T=ws();return T>0?Math.max(1,Math.round(T)):640}),Oe=F(()=>{var T;return Math.max(1,(T=k.maxLiveNodes)!=null?T:320)}),ge=F(()=>{var T;return!Ie.value&&k.nodeVirtual!==!1&&!(((T=k.maxLiveNodes)!=null?T:0)<=0)&&(k.nodeVirtual===!0?tt.value.length>0:tt.value.length>Oe.value)}),He=F(()=>ge.value||ns.value||qe.value),jt=F(()=>k.viewportPriority!==!1&&!K.value),Kt=mW(T=>{var D;return ye((D=T??M.value)!=null?D:null)},jt),{requestFrame:It,cancelFrame:Ot,hasIdleCallback:fo,isTestEnv:ho}=(function(T){const D=T.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,j=T.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,q=T.isClient&&typeof window.requestIdleCallback=="function",Q=(function(){var ve;if(typeof globalThis>"u"||!("process"in globalThis))return;const be=(ve=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:ve.value;return be?.env})();return{requestFrame:D,cancelFrame:j,hasIdleCallback:q,isTestEnv:Q?.NODE_ENV==="test"}})({isClient:ae}),{resolvedBatchSize:Di,resolvedInitialBatch:jo,batchingEnabled:Bi,incrementalRenderingActive:qo,renderedCount:Zn,previousRenderContext:Fi,adaptiveBatchSize:vl,previousBatchConfig:Er}=(function(T,D){var j;const q=F(()=>{var De;const Ee=Math.trunc((De=T.renderBatchSize)!=null?De:80);return Number.isFinite(Ee)?Math.max(0,Ee):0}),Q=F(()=>{var De;const Ee=Math.trunc((De=T.initialRenderBatchSize)!=null?De:q.value);return Number.isFinite(Ee)?Math.max(0,Ee):q.value}),ve=F(()=>!D.renderAsFragment.value&&T.batchRendering!==!1&&q.value>0&&D.isClient&&!D.isTestEnv),be=te(0),xe=te({key:T.indexKey,total:0}),Re=te(Math.max(1,q.value||1)),Ae=F(()=>{var De;return ve.value&&((De=T.maxLiveNodes)!=null?De:0)<=0}),Fe=te({batchSize:q.value,initial:Q.value,delay:(j=T.renderBatchDelay)!=null?j:16,enabled:Ae.value});return{resolvedBatchSize:q,resolvedInitialBatch:Q,batchingEnabled:ve,incrementalRenderingActive:Ae,renderedCount:be,previousRenderContext:xe,adaptiveBatchSize:Re,previousBatchConfig:Fe}})(k,{isClient:ae,isTestEnv:ho,renderAsFragment:Ie}),ue=new Map,pe=new Map,z=new WeakMap;let ne=null;const Ye=new WeakMap,et=new Map,xt=te(0),hn=F(()=>(xt.value,Array.from(ue.entries()).sort((T,D)=>T[0]-D[0]))),Bn=te(null),kn=te(null);let ln=null,an=0,bn=null;const{activeRestoreAnchor:po,getRelativeScrollTopWithinContainer:$r,setRelativeScrollTopWithinContainer:Ir,resolveAnchorOffset:yl,clearRestoreReconcile:ci,scheduleRestoreReconcile:Nr,captureRestoreAnchor:r0,restoreAnchor:l0,getAnchorDrift:x3}=(function(T){const{isClient:D,containerRef:j,parsedNodeCount:q,requestFrame:Q,cancelFrame:ve,resolveScrollContainer:be,getNormalizedScrollTop:xe,getOffsetTopWithinRoot:Re,isReverseFlexScrollRoot:Ae,estimateIndexForOffset:Fe,estimateHeightRange:De,getFallbackNodeHeight:Ee,clamp:Be}=T,ze=te(null);let Ve=null,ft=[];function st(){const yt=be(),Mt=j.value;if(!yt||!Mt)return null;const Tt=yt.ownerDocument||Mt.ownerDocument||document;if(yt===Tt.documentElement||yt===Tt.body||yt===Tt.scrollingElement){const Gt=Mt.getBoundingClientRect();return Math.max(0,-Gt.top)}return Math.max(0,xe(yt,Tt,!1)-Re(Mt,yt))}function ot(yt){var Mt;const Tt=be(),Gt=j.value;if(!Tt||!Gt)return;const Ys=Math.max(0,yt),Ss=Tt.ownerDocument||Gt.ownerDocument||document,Oo=Ss.defaultView||(typeof window<"u"?window:null);if(Tt===Ss.documentElement||Tt===Ss.body||Tt===Ss.scrollingElement){const zi=xe(Tt,Ss,!0)+Gt.getBoundingClientRect().top;return void((Mt=Oo?.scrollTo)==null||Mt.call(Oo,0,Math.max(0,zi+Ys)))}Tw(Tt,Ss,Re(Gt,Tt)+Ys,{isReverseFlexScrollRoot:zi=>{var Vi;return(Vi=Ae?.(zi))!=null&&Vi},getNormalizedScrollTop:xe})}function pt(yt){const Mt=q.value,Tt=Be(yt.nodeIndex,0,Math.max(0,Mt-1));return De(0,Tt)+Math.max(0,yt.offsetWithinNodePx)}function ht(){if(Ve!=null&&(ve?.(Ve),Ve=null),D)for(const yt of ft)window.clearTimeout(yt);ft=[]}function Ht(yt){const Mt=pt(yt),Tt=st();Tt!=null&&Math.abs(Tt-Mt)<=.5||ot(Mt)}return{activeRestoreAnchor:ze,getRelativeScrollTopWithinContainer:st,setRelativeScrollTopWithinContainer:ot,resolveAnchorOffset:pt,clearRestoreReconcile:ht,applyRestoreAnchor:Ht,scheduleRestoreReconcile:function(){ze.value&&D&&Ve==null&&(Ve=Q?Q(()=>{Ve=null,ze.value&&Ht(ze.value)}):null,Ve==null&&ze.value&&Ht(ze.value))},captureRestoreAnchor:function(){const yt=st(),Mt=q.value;if(yt==null||Mt<=0)return null;const Tt=Be(Fe(yt+1),0,Mt-1),Gt=De(0,Tt),Ys=Ee(Tt);return{nodeIndex:Tt,offsetWithinNodePx:Be(yt-Gt,0,Math.max(0,Ys-1))}},restoreAnchor:function(yt){const Mt=q.value;if(ze.value={nodeIndex:Be(yt.nodeIndex,0,Math.max(0,Mt-1)),offsetWithinNodePx:Math.max(0,yt.offsetWithinNodePx)},ht(),Ht(ze.value),D)for(const Tt of[0,120,280,480])ft.push(window.setTimeout(()=>{ze.value&&Ht(ze.value)},Tt))},getAnchorDrift:function(yt){const Mt=st();return Mt==null?null:Mt-pt(yt)}}})({isClient:ae,containerRef:M,parsedNodeCount:_s,requestFrame:It,cancelFrame:Ot,resolveScrollContainer:()=>Bn.value||_e(),getNormalizedScrollTop:Z,getOffsetTopWithinRoot:fe,isReverseFlexScrollRoot:W,estimateIndexForOffset:$p,estimateHeightRange:qi,getFallbackNodeHeight:Eu,clamp:os}),{nodeHeights:mo,heightStats:go,heightTreeSize:Na,heightSumTree:Vh,heightKnownTree:Kh,averageNodeHeight:zo,resetHeightMeasurements:T3,pruneHeightMeasurements:M3,rebuildHeightTrees:bu,recordNodeHeight:A3,removeNodeHeights:E3,exportHeightCache:$3,importHeightCache:I3,fenwickRangeSum:_u}=(function(T={}){const D=to({}),j=to({total:0,count:0}),q=te(0),Q=te([]),ve=te([]);function be(){for(const Ee of Object.keys(D))delete D[Number(Ee)];j.total=0,j.count=0,q.value=0,Q.value=[],ve.value=[]}function xe(Ee,Be,ze){for(let Ve=Be+1;Ve<Ee.length;Ve+=Ve&-Ve)Ee[Ve]+=ze}function Re(Ee,Be){let ze=0;for(let Ve=Be+1;Ve>0;Ve-=Ve&-Ve)ze+=Ee[Ve];return ze}function Ae(Ee){q.value=Ee;const Be=new Array(Ee+1).fill(0),ze=new Array(Ee+1).fill(0);for(const[Ve,ft]of Object.entries(D)){const st=Number(Ve),ot=Number(ft);!Number.isFinite(st)||st<0||st>=Ee||!Number.isFinite(ot)||ot<=0||(xe(Be,st,ot),xe(ze,st,1))}Q.value=Be,ve.value=ze}function Fe(Ee){if(!Number.isInteger(Ee)||Ee<0)return!1;const Be=D[Ee];if(!Number.isFinite(Be)||Be<=0)return!1;if(delete D[Ee],j.total=Math.max(0,j.total-Be),j.count=Math.max(0,j.count-1),q.value>Ee){const ze=Q.value,Ve=ve.value;ze.length&&Ve.length&&(xe(ze,Ee,-Be),xe(Ve,Ee,-1))}return!0}const De=F(()=>j.count>0?Math.max(12,j.total/j.count):32);return{nodeHeights:D,heightStats:j,heightTreeSize:q,heightSumTree:Q,heightKnownTree:ve,averageNodeHeight:De,resetHeightMeasurements:be,pruneHeightMeasurements:function(Ee){if(Ee<=0)return void be();let Be=0,ze=0;for(const[Ve,ft]of Object.entries(D)){const st=Number(Ve),ot=Number(ft);!Number.isFinite(st)||st<0||st>=Ee||!Number.isFinite(ot)||ot<=0?delete D[st]:(Be+=ot,ze++)}j.total=Be,j.count=ze},rebuildHeightTrees:Ae,recordNodeHeight:function(Ee,Be,ze={}){(function(Ve,ft,st={}){var ot;if(!Number.isFinite(ft)||ft<=0)return!1;const pt=D[Ve];if(pt&&(st.allowShrink===!1&&ft<pt||Math.abs(ft-pt)<=1))return!1;if(D[Ve]=ft,pt?j.total+=ft-pt:(j.total+=ft,j.count++),q.value>Ve){const ht=Q.value,Ht=ve.value;if(ht.length&&Ht.length)if(pt){const yt=ft-pt;yt!==0&&xe(ht,Ve,yt)}else xe(ht,Ve,ft),xe(Ht,Ve,1)}st.notify!==!1&&((ot=T.onHeightRecorded)==null||ot.call(T))})(Ee,Be,St(Qe({},ze),{notify:!0}))},removeNodeHeight:function(Ee,Be={}){var ze;const Ve=Fe(Ee);return Ve&&Be.notify!==!1&&((ze=T.onHeightRecorded)==null||ze.call(T)),Ve},removeNodeHeights:function(Ee,Be={}){var ze;let Ve=0;for(const ft of Ee)Fe(Number(ft))&&Ve++;return Ve>0&&Be.notify!==!1&&((ze=T.onHeightRecorded)==null||ze.call(T)),Ve},exportHeightCache:function(){return Object.entries(D).map(([Ee,Be])=>({index:Number(Ee),height:Number(Be)})).filter(Ee=>Number.isFinite(Ee.index)&&Ee.index>=0&&Number.isFinite(Ee.height)&&Ee.height>0).sort((Ee,Be)=>Ee.index-Be.index)},importHeightCache:function(Ee,Be={}){var ze;if(!Array.isArray(Ee))return;const Ve=q.value;let ft=!1;if(Be.mode!=="merge"){const st=Object.keys(D);if(st.length>0){for(const ot of st)delete D[Number(ot)];ft=!0}}for(const st of Ee){const ot=Number(st.index),pt=Number(st.height);if(!Number.isInteger(ot)||ot<0||Ve>0&&ot>=Ve||!Number.isFinite(pt)||pt<=0)continue;const ht=D[ot];ht&&Math.abs(ht-pt)<=1||(D[ot]=pt,ft=!0)}ft&&((function(){let st=0,ot=0;const pt=q.value;for(const[ht,Ht]of Object.entries(D)){const yt=Number(ht),Mt=Number(Ht);!Number.isFinite(yt)||yt<0||pt>0&&yt>=pt||!Number.isFinite(Mt)||Mt<=0?delete D[yt]:(st+=Mt,ot++)}j.total=st,j.count=ot})(),Ve>0&&Ae(Ve),(ze=T.onHeightRecorded)==null||ze.call(T))},fenwickRangeSum:function(Ee,Be,ze){if(ze<=Be)return 0;const Ve=Re(Ee,ze-1);return Be<=0?Ve:Ve-Re(Ee,Be-1)}}})({onHeightRecorded:()=>{yo(),qe.value&&Ga(),po.value&&Nr(),kn.value&&Tl(),dn("node-resize")}});function wu(){T3(),et.clear()}function a0(T){!Number.isInteger(T)||T<0||T>=tt.value.length||et.set(T,Da(T))}function c0(T,D,j={}){const q=mo[T];A3(T,D,j);const Q=mo[T];Q&&Q>0?a0(T):q&&et.delete(T)}function u0(T,D){const j=ut("getNodeLayoutHeight.slot.offsetHeight",()=>{var q,Q;return(Q=(q=ue.get(T))==null?void 0:q.offsetHeight)!=null?Q:0});return j>0?j:ut("getNodeLayoutHeight.content.offsetHeight",()=>D.offsetHeight)}function d0(T,D={}){I3(T,D),_p()}const Hi=F(()=>{var T;return!Ie.value&&k.deferNodesUntilVisible!==!1&&!(((T=k.maxLiveNodes)!=null?T:0)<=0)&&!ge.value&&!(tt.value.length>900)&&jt.value}),f0=F(()=>!!Kt&&(Hi.value||ge.value)),h0=F(()=>ge.value||qe.value),{liveNodeBufferResolved:La,focusIndex:vo,liveRange:ss,updateLiveRange:Lr}=(function(T,D){const{parsedNodeCount:j,virtualizationEnabled:q,maxLiveNodesResolved:Q,clamp:ve}=D,be=F(()=>{var Ae;return Math.max(0,(Ae=T.liveNodeBuffer)!=null?Ae:60)}),xe=te(0),Re=to({start:0,end:0});return{liveNodeBufferResolved:be,focusIndex:xe,liveRange:Re,updateLiveRange:function(){const Ae=j.value;if(!q.value||Ae===0)return Re.start=0,void(Re.end=Ae);const Fe=Math.min(Q.value,Ae),De=be.value,Ee=ve(xe.value-De,0,Math.max(0,Ae-Fe));Re.start=Ee,Re.end=Math.min(Ae,Ee+Fe)}}})(k,{parsedNodeCount:_s,virtualizationEnabled:ge,maxLiveNodesResolved:Oe,clamp:os}),Vo=new Map,Or=new Map,Wi=new Map,Su=[],ui=new Map,Ui=new Set,p0=te(0);let Gh=!1;const m0=F(()=>(p0.value,Ui.size)),Vs=new Map,Ko=new Map,g0=te(0),Yh=F(()=>{g0.value;let T=0;for(const D of Vs.values())T+=Math.max(0,D);return T});let Ks=null,Xh=!0,v0=[0],y0="";function yo(){Xh=!0}const Cu=F(()=>{if(!ge.value)return tt.value.length;const T=La.value,D=Math.max(ss.end+T,jo.value),j=Math.min(tt.value.length,D);return Math.max(Zn.value,j)});function xu(){Gh||(Gh=!0,queueMicrotask(()=>{Gh=!1,p0.value+=1}))}function k0(T,D,j="node-resize"){if(!ae||typeof window>"u")return null;const q=window.setTimeout(()=>{Ui.delete(q)&&xu();try{D()}finally{dn(j)}},Math.max(0,T));return Ui.add(q),xu(),q}function Tu(T){ae&&T!=null&&(Ui.delete(T)&&xu(),window.clearTimeout(T))}function b0(){if(ae&&typeof window<"u")for(const T of Ui)window.clearTimeout(T);Ui.size&&(Ui.clear(),xu()),Su.length=0,Wi.clear()}function N3(T){var D,j;return(j=(D=Rn.value)==null?void 0:D[T])!=null?j:null}const{cancelScheduledFocusSync:Zh,scheduleFocusSync:Go}=(function(T){const{isClient:D,containerRef:j,virtualizationEnabled:q,requestFrame:Q,cancelFrame:ve,syncFocusToScroll:be}=T;let xe=null;function Re(){var Fe,De,Ee;return(Ee=(De=(Fe=j.value)==null?void 0:Fe.ownerDocument)==null?void 0:De.defaultView)!=null?Ee:typeof window<"u"?window:null}function Ae(){if(!xe)return;const Fe=Re();xe.viaTimeout?Fe?Fe.clearTimeout(xe.id):clearTimeout(xe.id):ve?.(xe.id),xe=null}return{cancelScheduledFocusSync:Ae,scheduleFocusSync:function(Fe={}){if(!q.value)return;if(!D)return void be(!0);if(Fe.immediate)return Ae(),void be(!0);if(xe)return;const De=()=>{xe=null,be()};if(Q)return void(xe={id:Q(De),viaTimeout:!1});const Ee=Re();xe={id:Ee?Ee.setTimeout(De,16):setTimeout(De,16),viaTimeout:!0}}}})({isClient:ae,containerRef:M,virtualizationEnabled:ge,requestFrame:It,cancelFrame:Ot,syncFocusToScroll:function(T=!1){var D;if(!ge.value)return;const j=Bn.value||_e();if(!j)return;const q=j.ownerDocument||((D=M.value)==null?void 0:D.ownerDocument)||document,Q=q?.defaultView||(typeof window<"u"?window:null),ve=j===q?.documentElement||j===q?.body,be=tt.value.length;if(!ve&&be>0&&W(j)){const ze=ut("syncFocusToScroll.clientHeight",()=>j.clientHeight||0),Ve=ut("syncFocusToScroll.scrollTop",()=>j.scrollTop),ft=Ve<0?-Ve:Ve,st=(function(pt){var ht,Ht;const yt=tt.value;if(!yt.length)return 0;if(pt<=0)return Math.max(0,yt.length-1);if(Qt.value){const Tt=(ht=np()[yt.length])!=null?ht:0;return A0(Math.max(0,Tt-pt))}if(Na.value===yt.length){const Tt=qi(0,yt.length);return $p(Math.max(0,Tt-pt))}let Mt=pt;for(let Tt=yt.length-1;Tt>=0;Tt--){const Gt=(Ht=mo[Tt])!=null?Ht:zo.value;if(Mt<=Gt)return Tt;Mt-=Gt}return 0})(Math.max(0,ft)+.5*Math.max(0,ze)),ot=os(st,0,Math.max(0,be-1));return void((T||Math.abs(ot-vo.value)>1)&&(vo.value=ot,Lr()))}const xe=ve?null:ut("syncFocusToScroll.root.getBoundingClientRect",()=>j.getBoundingClientRect()),Re=ve?0:xe.top,Ae=ve?ut("syncFocusToScroll.viewport.clientHeight",()=>{var ze,Ve;return(Ve=(ze=Q?.innerHeight)!=null?ze:j.clientHeight)!=null?Ve:0}):xe.bottom,Fe=hn.value;let De=null,Ee=null;for(const[ze,Ve]of Fe){if(!Ve)continue;const ft=ut("syncFocusToScroll.slot.getBoundingClientRect",()=>Ve.getBoundingClientRect());ft.bottom<=Re||ft.top>=Ae||(De==null&&(De=ze),Ee=ze)}if(De==null||Ee==null){const ze=M.value;if(!ze)return;const Ve=ve?{top:0}:ut("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>j.getBoundingClientRect()),ft=ut("syncFocusToScroll.fallback.scrollTop",()=>Z(j,q,ve)),st=ve?(()=>{const ht=ut("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>ze.getBoundingClientRect()),Ht=(ve?0:Ve.top)-ht.top;return Math.max(0,Ht)})():(()=>{const ht=fe(ze,j);return Math.max(0,ft-ht)})(),ot=ve?ut("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var ht,Ht,yt,Mt;return(Mt=(yt=(Ht=Q?.innerHeight)!=null?Ht:(ht=q?.documentElement)==null?void 0:ht.clientHeight)!=null?yt:j.clientHeight)!=null?Mt:0}):ut("syncFocusToScroll.fallback.root.clientHeight",()=>j.clientHeight),pt=$p(st+.5*Math.max(0,ot));return vo.value=os(pt,0,Math.max(0,tt.value.length-1)),void Lr()}const Be=Math.round((De+Ee)/2);!T&&Math.abs(Be-vo.value)<=1||(vo.value=os(Be,0,Math.max(0,tt.value.length-1)),Lr())}}),{visibleNodeIndices:Jh,nodeVisibilityHandles:kl,nodeVisibilityWatchStops:Mu,nodeVisibilityFallbackTimers:_0,clearVisibilityFallback:Au,markNodeVisible:ji,cleanupNodeVisibility:L3,destroyNodeVisibilityState:Qh}=AU({isClient:ae,shouldTrackVisibleNodeIndices:()=>Hi.value,shouldCleanupNodeVisibility:()=>ge.value,onNodeMarkedVisible:T=>{ge.value?Go():vo.value=os(T,0,Math.max(0,tt.value.length-1))},onNodeVisibilityCleaned:T=>{ue.delete(T)&&X0()}}),{cleanupScrollListener:w0,setupScrollListener:O3}=(function(T){const{isClient:D,virtualizationEnabled:j,listenerEnabled:q,scrollRootElement:Q,resolveScrollContainer:ve,scheduleFocusSync:be,onScroll:xe}=T;let Re=null,Ae=null;function Fe(){Re&&(Re(),Re=null),Ae=null,Q.value=null}function De(Ee){const Be=T.getScrollTop?T.getScrollTop(Ee):Ee.scrollTop;return Math.max(0,Number.isFinite(Be)?Math.abs(Be):0)}return{cleanupScrollListener:Fe,setupScrollListener:function(){if(!D)return;if(!((Ee=q?.value)!=null?Ee:j.value))return void Fe();var Ee;const Be=ve();if(!Be)return void Fe();if(Q.value===Be&&Re)return;Fe(),Ae=De(Be);const ze=()=>{if(xe?.(),j.value){const Ve=(function(ft){const st=De(ft),ot=Ae;Ae=st;const pt=Math.max(480,.75*(ft.clientHeight||0));return ot==null?st>pt?{immediate:!0}:void 0:Math.abs(st-ot)>pt?{immediate:!0}:void 0})(Be);Ve?be(Ve):be()}};Be.addEventListener("scroll",ze,{passive:!0}),Q.value=Be,Re=()=>{Be.removeEventListener("scroll",ze)}}}})({isClient:ae,virtualizationEnabled:ge,listenerEnabled:h0,scrollRootElement:Bn,resolveScrollContainer:_e,scheduleFocusSync:Go,onScroll:function(){const T=kn.value;if(!T)return;const D=Ra();if(!D||(function(q){if(Ua()>=an)return bn=null,!1;const Q=bn;if(Q==null)return!0;const ve=Math.abs(q.scrollTop-Q)<=2;return ve||(bn=null),ve})(D))return;const j=D0(D);j!=null?(j<-32||Math.abs(Math.max(0,j)-Math.max(0,T.distanceFromBottomPx))>32)&&xl("restore"):xl("restore")},getScrollTop:T=>{var D;const j=T.ownerDocument||((D=M.value)==null?void 0:D.ownerDocument)||document,q=T===j.documentElement||T===j.body||T===j.scrollingElement;return ut("scrollListener.getScrollTop",()=>Z(T,j,q))}});function os(T,D,j){return Math.min(Math.max(T,D),j)}function ep(T){return T?.firstElementChild}function S0(T,D){var j;return T?(j=T.matches)!=null&&j.call(T,D)?T:T.querySelector(D):null}function C0(){if(!Qt.value)return void(Y.value=0);const T=ut("updateExperimentContainerWidth.clientWidth",()=>{var D,j;return(j=(D=M.value)==null?void 0:D.clientWidth)!=null?j:0});Y.value=T>0?T:0}let Oa=null;function tp(){Oa?.disconnect(),Oa=null}const x0=si({loader:()=>_n(null,null,function*(){return(yield no(()=>import("./index8-oLPFpvcC.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:oM,delay:0,suspensible:!1});function T0(T){return T===x0}const M0=F(()=>u.value==="pre"?Zs:u.value==="shiki"?x0:Im),Pr=F(()=>{const T=tt.value;if(!T.length||!Qt.value)return T.map(()=>null);const D=Y.value||ut("estimatedNodeHeights.clientWidth",()=>{var j;return((j=M.value)==null?void 0:j.clientWidth)||0});return!Number.isFinite(D)||D<=0?T.map(()=>null):T.map((j,q)=>{const Q=mo[q],ve=typeof Q=="number"&&Q>0;if(zs.value&&!ve){const xe=uM(j,D,G.value);if(xe)return xe}if(Ar.value&&j.type==="code_block"){const xe=(function(Re){if(Re.type!=="code_block")return null;const Ae=cy(Re,Ru(Re));return T0(Ae)?"markdown":Ae===Zs?"pre":Ae===M0.value||Ae===Im?"monaco":null})(j);if(xe==="monaco"||xe==="markdown"||xe==="pre")return hU(j,{rendererKind:xe,monacoOptions:k.codeBlockMonacoOptions,showHeader:((be=k.codeBlockProps)==null?void 0:be.showHeader)!==!1})}var be;return null})});function Eu(T){var D;const j=mo[T];if(Number.isFinite(j)&&j>0)return j;const q=(D=Pr.value[T])==null?void 0:D.height;return Number.isFinite(q)&&q>0?q:Math.max(zo.value,(function(Q){var ve,be,xe,Re,Ae,Fe,De,Ee,Be,ze,Ve,ft,st;const ot=tt.value[Q];if(!ot||typeof ot!="object")return 32;const pt=String((ve=ot.type)!=null?ve:""),ht=ws()||640;switch(pt){case"heading":return 44;case"paragraph":return bl(String((xe=(be=ot.raw)!=null?be:ot.content)!=null?xe:""),ht,34);case"list":{const Ht=Array.isArray(ot.items)?ot.items.length:1;return Math.max(48,30*Ht+12)}case"list_item":return bl(String((Ae=(Re=ot.raw)!=null?Re:ot.content)!=null?Ae:""),ht,34);case"blockquote":return bl(String((De=(Fe=ot.raw)!=null?Fe:ot.content)!=null?De:""),ht,56);case"table":{const Ht=Array.isArray(ot.rows)?ot.rows.length:Array.isArray(ot.children)?ot.children.length:3;return Math.max(120,38*Ht+48)}case"code_block":return bl(String((Be=(Ee=ot.code)!=null?Ee:ot.raw)!=null?Be:""),ht,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return bl(String((Ve=(ze=ot.raw)!=null?ze:ot.content)!=null?Ve:""),ht,96);case"thematic_break":return 24;default:return bl(String((st=(ft=ot.raw)!=null?ft:ot.content)!=null?st:""),ht,40)}})(T))}function bl(T,D,j,q=22){const Q=String(T??"");if(!Q)return j;const ve=Math.max(18,Math.floor(Math.max(320,D)/8)),be=Q.split(/\r?\n/).length,xe=Math.ceil(Q.length/ve),Re=Math.max(1,be,xe);return Math.max(j,Math.ceil(Re*q+12))}function Pa(T){const D=Number(T);return!Number.isFinite(D)||D<=0?-1:Math.round(D/32)}function np(){var T,D;const j=tt.value.length,q=Pa(Y.value||ut("getFallbackHeightPrefix.clientWidth",()=>{var xe;return((xe=M.value)==null?void 0:xe.clientWidth)||0})),Q=((T=s.virtualScroll)==null?void 0:T.measurementKey)==null?"":String(s.virtualScroll.measurementKey),ve=[j,go.count,Math.round(go.total),Math.round(100*zo.value),Q,q,Qt.value?1:0,ww.value,se.value].join(":");if(!Xh&&y0===ve)return v0;const be=new Array(j+1);be[0]=0;for(let xe=0;xe<j;xe++)be[xe+1]=be[xe]+(Qt.value?Eu(xe):(D=mo[xe])!=null?D:zo.value);return v0=be,y0=ve,Xh=!1,be}function A0(T){var D,j;const q=tt.value.length;if(q<=0||T<=0)return 0;const Q=np();if(T>=((D=Q[q])!=null?D:0))return q-1;let ve=0,be=q-1,xe=q-1;for(;ve<=be;){const Re=ve+be>>1;((j=Q[Re+1])!=null?j:0)>=T?(xe=Re,be=Re-1):ve=Re+1}return xe}function qi(T,D){var j,q;if(T>=D)return 0;if(Qt.value)return(function(be,xe){var Re,Ae;const Fe=tt.value.length,De=os(Math.trunc(be),0,Fe),Ee=os(Math.trunc(xe),De,Fe);if(De>=Ee)return 0;const Be=np();return((Re=Be[Ee])!=null?Re:0)-((Ae=Be[De])!=null?Ae:0)})(T,D);if(Na.value!==tt.value.length){let be=0;for(let xe=T;xe<D;xe++)be+=(j=mo[xe])!=null?j:zo.value;return be}const Q=Vh.value,ve=Kh.value;if(!Q.length||!ve.length){let be=0;for(let xe=T;xe<D;xe++)be+=(q=mo[xe])!=null?q:zo.value;return be}return _u(Q,T,D)+(D-T-_u(ve,T,D))*zo.value}Ke(()=>tt.value.length,T=>{yo(),T<=0?wu():(T<Na.value&&M3(T),T!==Na.value&&bu(T))},{immediate:!0});const P3=F(()=>{if(!ge.value)return tt.value.map((q,Q)=>({node:q,index:Q}));const T=tt.value.length,D=os(ss.start,0,T),j=os(ss.end,D,T);return tt.value.slice(D,j).map((q,Q)=>({node:q,index:D+Q}))}),sp=F(()=>ge.value?qi(0,Math.min(ss.start,tt.value.length)):0),op=F(()=>{if(!ge.value)return 0;const T=tt.value.length;return qi(Math.min(ss.end,T),T)});function E0(){if(!Qt.value)return 0;let T=0;const D=Pr.value;for(let j=0;j<D.length;j++){if(!D[j])continue;const q=mo[j];Number.isFinite(q)&&q>0||T++}return T}function $0(){const T=tt.value.length;return{totalNodes:T,measuredCount:go.count,estimatedCount:E0(),averageNodeHeight:zo.value,topSpacerHeight:sp.value,bottomSpacerHeight:op.value,estimatedTotalHeight:qi(0,T),width:Rr()}}function R3(){const T=tt.value,D=$0();return St(Qe({},D),{probe:{paragraphReady:!!G.value.paragraph,listItemReady:!!G.value.listItem,listWrapperOverhead:G.value.listWrapperOverhead,headingReadyLevels:Object.entries(G.value.headings).filter(([,j])=>!!j).map(([j])=>Number(j))},nodes:T.map((j,q)=>{var Q,ve,be,xe,Re,Ae,Fe,De,Ee;return{index:q,type:j.type,estimateKind:(ve=(Q=Pr.value[q])==null?void 0:Q.kind)!=null?ve:null,rendererKind:(xe=(be=Pr.value[q])==null?void 0:be.rendererKind)!=null?xe:null,estimatedHeight:(Ae=(Re=Pr.value[q])==null?void 0:Re.height)!=null?Ae:null,estimatedContentHeight:(De=(Fe=Pr.value[q])==null?void 0:Fe.contentHeight)!=null?De:null,measuredHeight:(Ee=mo[q])!=null?Ee:null}})})}function ip(){return s.indexKey!=null?String(s.indexKey):Ge.value?`virtual-${mn()}`:"markdown-renderer"}function I0(T){const D=String(T),j=`${ip()}-`;if(!D.startsWith(j))return null;const q=D.slice(j.length).match(/^(\d+)(?:$|-)/);if(!q)return null;const Q=Number(q[1]);return!Number.isInteger(Q)||Q<0||Q>=tt.value.length?null:Q}function mn(){var T,D,j;const q=(T=s.virtualScroll)==null?void 0:T.sessionKey;return String(q!=null&&q!==""?q:(j=(D=s.indexKey)!=null?D:k.customId)!=null?j:Et)}function Kn(){var T;const D=(T=s.virtualScroll)==null?void 0:T.threadKey;return D==null||D===""?void 0:String(D)}function rp(T){var D;return(T??"")===((D=Kn())!=null?D:"")}function D3(){var T;const D=(T=s.virtualScroll)==null?void 0:T.measurementKey;return D==null?"":String(D)}function B3(){var T,D;const j=u.value,q=j==="monaco"?k.codeBlockMonacoOptions:void 0,Q=k.codeBlockProps,ve=j==="shiki";return[k.isDark?"dark":"light",j==="monaco"?"code-rich":j==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",Jn(k.codeBlockMinWidth),Jn(k.codeBlockMaxWidth),...ve?[Pf((T=Q?.themes)!=null?T:k.themes,(D=Q?.langs)!=null?D:k.langs)]:[],Jn(q?.fontSize),Jn(q?.lineHeight),Jn(q?.fontFamily),Jn(q?.tabSize),Jn(q?.MAX_HEIGHT),Jn(q?.wordWrap),Jn(q?.wrappingIndent),Jn(q?.padding),Jn(Q?.showHeader),Jn(Q?.showCopyButton),Jn(Q?.showExpandButton),Jn(Q?.showPreviewButton),Jn(Q?.showCollapseButton),Jn(Q?.showFontSizeButtons)].join("\0")}function di(){return[D3(),B3()].join("\0")}function Rr(){return ws()}const $u=F(()=>Pa(Rr())),Gs=F(()=>[di(),$u.value].join("\0")),F3=F(()=>{var T;return Ge.value?["virtual",(T=Kn())!=null?T:"",mn(),Gs.value].join("\0"):s.indexKey});function _l(){g0.value+=1}function lp(T){return!(!T||!Number.isInteger(T.index)||T.index<0||T.index>=tt.value.length||T.sessionKey!==mn()||T.threadKey!==Kn()||T.layoutEpochKey!==Gs.value)}function N0(T){const D=String(T),j=Ko.get(D);return j?lp(j)?j.index:null:I0(D)}function L0(T="async-node"){(Vs.size||Ko.size)&&(Vs.clear(),Ko.clear(),_l(),dn(T))}const wl=Rt(Vg,null),ap={reportHeight(T,D){if(!qe.value)return;const j=N0(T);if(j==null)return;const q=Vo.get(j);if(!q)return;const Q=Number(D),ve=u0(j,q);c0(j,Number.isFinite(Q)&&Q>0?Math.max(Q,ve||0):ve)},markPending(T){if(!qe.value)return;const D=I0(T);D!=null&&(function(j,q){var Q;const ve=Ko.get(j);if(ve&&lp(ve))return Vs.set(j,Math.max(0,(Q=Vs.get(j))!=null?Q:0)+1),_l(),void dn("async-node");Vs.set(j,1),Ko.set(j,(function(be){return{index:be,sessionKey:mn(),threadKey:Kn(),layoutEpochKey:Gs.value}})(q)),_l(),dn("async-node")})(String(T),D)},markSettled(T){if(!qe.value)return;const D=String(T),j=N0(T);(j!=null||(function(q){return Vs.has(String(q))})(D))&&(function(q){var Q;const ve=(Q=Vs.get(q))!=null?Q:0;return!(ve<=0||(ve<=1?(Vs.delete(q),Ko.delete(q)):Vs.set(q,ve-1),_l(),ve===1&&dn("async-node"),0))})(D)&&j!=null&&fi()}};function H3(){let T=0;for(const D of Vo.values())T+=ut("getVisibleDomHeight.offsetHeight",()=>{var j;return(j=D?.offsetHeight)!=null?j:0});return Math.ceil(Math.max(0,T))}gn(Vg,{reportHeight(T,D){ap.reportHeight(T,D),wl?.reportHeight(T,D)},markPending(T){ap.markPending(T),wl?.markPending(T)},markSettled(T){ap.markSettled(T),wl?.markSettled(T)}});let cp,up=null,Sl=null;function Iu(T){return T!==!1&&T!=null&&T!==""}function O0(){return ge.value?(function(){if(!ge.value)return!0;const T=tt.value.length,D=os(ss.start,0,T),j=os(ss.end,D,T);if(D>=j)return!0;for(let q=D;q<j;q++)if(!ue.has(q)||Ip(q)&&!Vo.has(q))return!1;return!0})():Zn.value>=Cu.value}function dp(){return H.value===!0&&!X.value&&Yh.value===0&&Ui.size===0&&ui.size===0&&Ks==null&&O0()}function P0(){var T,D;if(((T=s.virtualScroll)==null?void 0:T.settleMode)!=="manual"||up===mn()&&cp===Kn())return!0;const j=(D=s.virtualScroll)==null?void 0:D.settledToken;return!!Iu(j)&&Sl===Ya(j)}function fp(){return dp()&&P0()}function W3(T,D){return D.totalNodes<=0?T==="final"?"final":"estimate":D.measuredCount>=D.totalNodes?T==="final"?"final":"measured":D.measuredCount>0||D.estimatedCount>0?"mixed":"estimate"}function Dr(T="manual",D){const j=$0(),q=(function(Q){return Q||(H.value!==!0?tt.value.length>0?"streaming":"estimating":!O0()||ui.size>0||Ks!=null?"measuring":fp()?"settled":"settling")})(D);return{sessionKey:mn(),threadKey:Kn(),phase:q,nodeCount:j.totalNodes,liveRange:{start:ss.start,end:ss.end},renderedCount:Zn.value,measuredCount:j.measuredCount,estimatedCount:j.estimatedCount,averageNodeHeight:j.averageNodeHeight,topSpacerHeight:j.topSpacerHeight,bottomSpacerHeight:j.bottomSpacerHeight,visibleDomHeight:H3(),totalHeight:R0(),width:j.width,final:H.value===!0,stable:fp(),confidence:W3(q,j),reason:T}}function Ra(){const T=Bn.value||_e(),D=M.value;if(!T||!D)return null;const j=T.ownerDocument||D.ownerDocument||document,q=T===j.documentElement||T===j.body||T===j.scrollingElement,Q=ut("getScrollBox.scrollTop",()=>Z(T,j,q)),ve=ut("getScrollBox.scrollHeight",()=>{var xe,Re,Ae,Fe,De;return q?Math.max((Re=(xe=j.documentElement)==null?void 0:xe.scrollHeight)!=null?Re:0,(Fe=(Ae=j.body)==null?void 0:Ae.scrollHeight)!=null?Fe:0,(De=T.scrollHeight)!=null?De:0):T.scrollHeight}),be=ut("getScrollBox.clientHeight",()=>{var xe;return q?((xe=j.documentElement)==null?void 0:xe.clientHeight)||T.clientHeight||0:T.clientHeight});return{root:T,doc:j,isViewportRoot:q,scrollTop:Q,scrollHeight:ve,clientHeight:be}}function R0(){const T=tt.value.length,D=Math.max(0,qi(0,T)),j=ut("getRendererLogicalHeight.offsetHeight",()=>{var Q,ve;return(ve=(Q=M.value)==null?void 0:Q.offsetHeight)!=null?ve:0}),q=Math.max(0,j>0?j:ut("getRendererLogicalHeight.scrollHeight",()=>{var Q,ve;return(ve=(Q=M.value)==null?void 0:Q.scrollHeight)!=null?ve:0}));return T<=0?Math.ceil(j):ge.value?D>0?Math.max(1,Math.ceil(D),(function(){let Q=sp.value+op.value;for(const ve of ue.values())ve&&(Q+=Math.max(0,ut("getVirtualizedDomLogicalHeight.offsetHeight",()=>ve.offsetHeight||0)));return Math.ceil(Math.max(0,Q))})(),(function(Q,ve){return Q<=0||ve<=0?0:ve<=Q+Math.max(512,.05*Q)?Math.ceil(ve):0})(D,q)):Math.max(1,Math.ceil(q)):qe.value?D>0||go.count>0||E0()>0?(qo.value&&Zn.value,Math.max(1,Math.ceil(q),Math.ceil(D))):Math.ceil(q):Math.max(1,Math.ceil(q),Math.ceil(D))}function D0(T){const D=M.value;if(!D)return null;const j=ut("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>D.getBoundingClientRect());return(function(Q){return Q.isViewportRoot?Q.clientHeight:ut("getViewportBottomInRoot.getBoundingClientRect",()=>Q.root.getBoundingClientRect().bottom)})(T)-j.bottom}function U3(T={}){const D=T.requireViewport!==!1,j=(function(ve=64){const be=Ra(),xe=M.value;if(!be||!xe)return!1;const Re=(function(Fe){if(Fe.isViewportRoot)return{top:0,bottom:Fe.clientHeight};const De=ut("getVirtualViewportRect.getBoundingClientRect",()=>Fe.root.getBoundingClientRect());return{top:De.top,bottom:De.bottom}})(be),Ae=ut("isRendererNearVirtualViewport.getBoundingClientRect",()=>xe.getBoundingClientRect());return Ae.bottom>=Re.top-ve&&Ae.top<=Re.bottom+ve})();if(D&&!j)return null;const q=(function(){const ve=Ra(),be=M.value;if(!ve||!be||Math.max(0,ve.scrollHeight-ve.scrollTop-ve.clientHeight)>64)return null;const xe=D0(ve);return xe==null?null:xe>=-8&&xe<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,xe)}:null})();if(q)return{anchor:q,captured:!0};const Q=r0();if(Q)return{anchor:{type:"node",nodeIndex:Q.nodeIndex,offsetWithinNodePx:Q.offsetWithinNodePx},captured:j};if(T.allowFallback===!0){const ve=(function(){const be=tt.value.length;return be<=0?null:{type:"node",nodeIndex:os(vo.value,0,Math.max(0,be-1)),offsetWithinNodePx:0}})();return ve?{anchor:ve,captured:!1}:null}return null}function hp(T){let D=2166136261;for(let j=0;j<T.length;j++)D^=T.charCodeAt(j),D=Math.imul(D,16777619);return(D>>>0).toString(36)}function j3(T,D){let j=T;for(let q=0;q<D.length;q++)j^=D.charCodeAt(q),j=Math.imul(j,16777619);return j^=31,j=Math.imul(j,16777619),j}const q3=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Nu(T,D=new WeakSet,j=0){if(T==null||typeof T=="number"||typeof T=="boolean")return String(T);if(typeof T=="string")return`s:${(function(q){const Q=q.length>8192?`${q.slice(0,8192)}...${q.length}`:q;return`${q.length}:${hp(Q)}`})(T)}`;if(typeof T=="function")return"fn";if(typeof T!="object")return typeof T;if(D.has(T))return"cycle";if(j>=6)return"max-depth";D.add(T);try{if(Array.isArray(T)){if(T.length<=160){const Ae=[];for(let Fe=0;Fe<T.length;Fe++)Ae.push(Nu(T[Fe],D,j+1));return`a:${T.length}:${Ae.join(",")}`}const ve=[],be=[],xe=Math.max(0,T.length-32);let Re=2166136261;for(let Ae=0;Ae<T.length;Ae++){const Fe=Nu(T[Ae],D,j+1);Re=j3(Re,Fe),Ae<32&&ve.push(Fe),Ae>=xe&&be.push(Fe)}return[`a:${T.length}`,`h=${ve.join(",")}`,`t=${be.join(",")}`,`all=${(Re>>>0).toString(36)}`].join(":")}const q=T,Q=Object.keys(q).filter(ve=>{const be=q[ve];return ve!=="parent"&&ve!=="el"&&ve!=="component"&&(be==null||typeof be=="string"||typeof be=="number"||typeof be=="boolean"||q3.has(ve))}).sort();return`o:${Q.length}:${Q.map(ve=>`${ve}=${Nu(q[ve],D,j+1)}`).join(";")}`}finally{D.delete(T)}}let B0=-1,pp="";function Da(T){const D=tt.value[T];return D?hp(Nu(D)):""}function mp(){const T=se.value;if(B0===T)return pp;let D=2166136261;for(let j=0;j<tt.value.length;j++){const q=Da(j);for(let Q=0;Q<q.length;Q++)D^=q.charCodeAt(Q),D=Math.imul(D,16777619)}return pp=(D>>>0).toString(36),B0=T,pp}function Cl(T,D={}){var j;const q=D.includeHeightCache===!0,Q=(j=D.includeContentHash)!=null?j:q,ve=q?(function(xe){const Re=(function(){var Ve,ft;const st=Number((ft=(Ve=s.virtualScroll)==null?void 0:Ve.heightCacheLimit)!=null?ft:5e3);return!Number.isFinite(st)||st<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(st))})();if(!Number.isFinite(Re)||xe.length<=Re)return xe;const Ae=new Map,Fe=Ve=>{!Ve||Ae.size>=Re||Ae.set(Ve.index,Ve)},De=tt.value.length,Ee=os(ss.start-2*La.value,0,De),Be=os(ss.end+2*La.value,Ee,De);for(const Ve of xe)Ve.index>=Ee&&Ve.index<Be&&Fe(Ve);const ze=Math.max(1,Math.ceil(xe.length/Re));for(let Ve=0;Ve<xe.length&&Ae.size<Re;Ve+=ze)Fe(xe[Ve]);for(let Ve=xe.length-1;Ve>=0&&Ae.size<Re;Ve-=ze)Fe(xe[Ve]);return Array.from(Ae.values()).sort((Ve,ft)=>Ve.index-ft.index).slice(0,Re)})($3().map(xe=>{var Re;const Ae=tt.value[xe.index];return Ae?St(Qe({},xe),{nodeType:String((Re=Ae.type)!=null?Re:""),signature:Da(xe.index)}):null}).filter(xe=>!!xe)):[],be=U3({allowFallback:D.allowAnchorFallback===!0,requireViewport:D.requireViewport});return be||ve.length||D.includeEmptyState===!0?St(Qe({sessionKey:T.sessionKey,threadKey:T.threadKey},be?{anchor:be.anchor,anchorCaptured:be.captured}:{anchorCaptured:!1}),{metrics:T,width:T.width,contentHash:Q?mp():void 0,measurementKey:di()||void 0,heightCache:ve.length?ve:void 0}):null}function gp(T){var D,j;const q=Ra();if(!q)return;const Q=(function(xe){const Re=M.value;if(!Re)return null;const Ae=fe(Re,xe.root),Fe=tt.value.length,De=ut("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Re.offsetHeight||0),Ee=Math.max(0,De>0?De:Fe>0?ut("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Re.scrollHeight||0):0),Be=R0();return Ae+Math.max(Ee,Be)})(q);if(Q==null)return;const ve=Math.max(0,T.distanceFromBottomPx),be=Math.max(0,Q-q.clientHeight-ve);(function(xe){an=Ua()+120,bn=xe})(be),q.isViewportRoot?(j=(D=q.doc.defaultView)==null?void 0:D.scrollTo)==null||j.call(D,0,be):Tw(q.root,q.doc,be,{isReverseFlexScrollRoot:W,getNormalizedScrollTop:Z})}const vp=[];function F0(){if(ae)for(ln!=null&&(Ot?.(ln),ln=null);vp.length;){const T=vp.pop();T!=null&&window.clearTimeout(T)}}function xl(T){const D=!!kn.value;kn.value=null,an=0,bn=null,F0(),D&&T&&dn(T)}function Tl(){if(!kn.value||!ae||ln!=null)return;const T=()=>{ln=null;const D=kn.value;D&&gp(D)};ln=It?It(T):null,ln==null&&T()}function H0(T,D={}){const j=tt.value.length;return j<=0?[]:T.filter(q=>!(!Number.isInteger(q.index)||q.index<0||q.index>=j)&&!(!Number.isFinite(q.height)||q.height<=0)&&!(D.requireSignature&&!q.signature)&&!(D.requireCompatibilityMetadata&&!q.nodeType&&!q.signature)&&(function(Q){var ve;const be=tt.value[Q.index];return!(!be||Q.nodeType&&Q.nodeType!==String((ve=be.type)!=null?ve:"")||Q.signature&&Q.signature!==Da(Q.index))})(q))}function W0(T){const D=Pa(Rr()),j=Pa(T);return D!==-1&&j!==-1&&D===j}function yp(T){var D;const j=Number(T?.width);if(Number.isFinite(j)&&j>0)return j;const q=Number((D=T?.metrics)==null?void 0:D.width);return Number.isFinite(q)&&q>0?q:null}function U0(T){var D;return T.sessionKey===mn()&&!!rp(T.threadKey)&&((D=T.measurementKey)!=null?D:"")===di()&&!!W0(yp(T))&&!!(function(j){const q=j.heightCache;return!!q?.length&&(j0(j)?q.some(Q=>!!(Q.nodeType||Q.signature)):q.some(Q=>!!Q.signature))})(T)}function j0(T){return!!(T.contentHash&&T.contentHash===mp())}function z3(T){return!j0(T)}let Br=null,Fr=null,Lu=null,Ba=null,Fa=null;function kp(T){var D;const j=T.map(Q=>{var ve,be;return[Q.index,Math.round(10*Q.height),(ve=Q.nodeType)!=null?ve:"",(be=Q.signature)!=null?be:""].join("")}).join(""),q=Pa(Rr());return[(D=Kn())!=null?D:"",mn(),di(),tt.value.length,q,T.length,hp(j)].join(":")}function q0(T=(D=>(D=s.virtualScroll)==null?void 0:D.heightCache)()){if(!qe.value||!T?.length||tt.value.length<=0||!W0((D=s.virtualScroll)==null?void 0:D.heightCacheWidth))return!1;var D;const j=H0(T,{requireSignature:!0});if(!j.length)return!1;const q=kp(j);return q===Br?(Fr="standalone",!0):(d0(j,{mode:"merge"}),yo(),Br=q,Fr="standalone",qa(),dn("restore"),!0)}function bp(T,D={}){var j,q,Q;if(!qe.value||!T||T.sessionKey!==mn()||!rp(T.threadKey)||tt.value.length<=0)return!1;const ve=!!((j=T.heightCache)!=null&&j.length)&&!Ou(),be=!T.anchor||T.anchorCaptured===!1&&D.allowUncapturedAnchor!==!0?null:T.anchor,xe=D.restoreAnchor===!0&&!!be&&!Ou()&&Number(yp(T))>0;let Re=!1;if((q=T.heightCache)!=null&&q.length&&U0(T)){const Fe=H0(T.heightCache,{requireCompatibilityMetadata:!T.contentHash,requireSignature:z3(T)});Fe.length&&(d0(Fe,{mode:"merge"}),yo(),Br=kp(Fe),Fr="restore",qa(),Re=!0)}if(ve||xe)return!1;if(!D.restoreAnchor||!be)return Re&&dn("restore"),!0;const Ae=(function(Fe,De){var Ee;const Be=Fe.anchor,ze=Be?Be.type==="bottom"?`bottom:${Math.round(Be.distanceFromBottomPx)}`:`node:${Be.nodeIndex}:${Math.round(Be.offsetWithinNodePx)}`:"none";return[(Ee=Kn())!=null?Ee:"",mn(),di(),$u.value,De,ze].join(":")})(T,(Q=D.restoreToken)!=null?Q:"imperative");return Lu===Ae?(Re&&dn("restore"),!0):(Lu=Ae,(function(Fe){const De=()=>{if(Fe.type==="node")return xl(),void l0({nodeIndex:Fe.nodeIndex,offsetWithinNodePx:Fe.offsetWithinNodePx});if(ci(),po.value=null,kn.value=Fe,F0(),gp(Fe),ae)for(const Ee of[0,120,280,480])vp.push(window.setTimeout(()=>{const Be=kn.value;Be&&gp(Be)},Ee))};(function(Ee){if(!ge.value)return!1;const Be=tt.value.length;return!(Be<=0||(vo.value=Ee.type==="node"?os(Ee.nodeIndex,0,Be-1):Be-1,Lr(),0))})(Fe)?mt(De):De()})(be),dn("restore"),!0)}function Ou(){const T=Rr();return Number.isFinite(T)&&T>0}function z0(T){var D;return T.sessionKey===mn()&&!!rp(T.threadKey)&&(tt.value.length<=0||!(!((D=T.heightCache)!=null&&D.length)||Ou())||!(!(T.anchor&&Number(yp(T))>0)||Ou()))}function _p(){et.clear();for(const T of Object.keys(mo)){const D=Number(T);Number.isInteger(D)&&D>=0&&D<tt.value.length&&a0(D)}}function Ha(){Ks!=null&&(Ot?.(Ks),Ks=null),Np()}function V0(){return!ae||ho?Promise.resolve():new Promise(T=>{let D=!1,j=null;const q=()=>{D||(D=!0,j!=null&&window.clearTimeout(j),T())};if(It)return It(q),void(j=window.setTimeout(q,50));j=window.setTimeout(q,0)})}function wp(T,D=Kn(),j=Gs.value){return mn()===T&&Kn()===D&&Gs.value===j}function Sp(){return _n(this,arguments,function*(T={}){var D,j,q,Q,ve;const be=mn(),xe=Kn(),Re=Gs.value,Ae=(D=T.frames)!=null?D:2,Fe=(j=T.timeoutMs)!=null?j:120,De=(q=T.reason)!=null?q:"manual",Ee=T.expectedSettledTokenKey,Be=T.flushPendingTimers===!0,ze=Dr(De),Ve=()=>St(Qe({},ze),{phase:ze.final?"settling":ze.phase,stable:!1,confidence:ze.confidence==="final"?"mixed":ze.confidence,reason:De}),ft=()=>wp(be,xe,Re)&&(Ee==null||ja()===Ee);for(let ht=0;ht<Ae;ht++){if(yield mt(),!ft()||(yield V0(),!ft()))return Ve();fi(),Ha()}if(yield(function(ht){return!ae||ht<=0?Promise.resolve():new Promise(Ht=>window.setTimeout(Ht,ht))})(Fe),!ft()||(Be&&b0(),fi(),Ha(),!ft()))return Ve();const st=dp();st&&(up=be,cp=xe,((Q=s.virtualScroll)==null?void 0:Q.settleMode)==="manual"&&Ee!=null&&Iu((ve=s.virtualScroll)==null?void 0:ve.settledToken)&&ja()===Ee&&(Sl=Ya(s.virtualScroll.settledToken)));const ot=ft()&&st&&P0(),pt=Dr(De,ot?"final":void 0);return Ap(pt,!0),pt})}let Cp="content",Hr=null,Wr=null,xp=0,Wa=null,Ml=null,Tp=null,Mp=null;function Ua(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function K0(T){var D,j;const q=Wa;if(!q)return!0;const Q=(j=(D=s.virtualScroll)==null?void 0:D.heightDiffThresholdPx)!=null?j:1;return Math.abs(T.totalHeight-q.totalHeight)>Q||T.sessionKey!==q.sessionKey||T.phase!==q.phase||T.stable!==q.stable||T.final!==q.final||T.threadKey!==q.threadKey||T.nodeCount!==q.nodeCount||T.measuredCount!==q.measuredCount||T.width!==q.width}function Jn(T){if(T==null)return"";if(typeof T=="string"||typeof T=="number"||typeof T=="boolean")return String(T);try{return JSON.stringify(T)}catch{return String(T)}}function ja(T=(D=>(D=s.virtualScroll)==null?void 0:D.settledToken)()){return Jn(T)}function G0(T,D){var j,q;return[T,D.sessionKey,(j=D.threadKey)!=null?j:"",di(),mp(),Jn((q=s.virtualScroll)==null?void 0:q.settledToken),Math.round(D.totalHeight),Math.round(D.width)].join("\0")}function qa(){Tp=null,Mp=null,Ml=null}function V3(T){const D=T.heightCache;return D?.length?kp(D):""}function za(T){var D,j,q;const Q=T.metrics,ve=T.anchor?(be=T.anchor).type==="bottom"?`bottom:${Math.round(be.distanceFromBottomPx)}`:`node:${be.nodeIndex}:${Math.round(be.offsetWithinNodePx)}`:"none";var be;return[T.sessionKey,(D=T.threadKey)!=null?D:"",(j=T.measurementKey)!=null?j:di(),(q=T.contentHash)!=null?q:"",V3(T),ve,T.anchorCaptured?1:0,Q.liveRange.start,Q.liveRange.end,Q.renderedCount,Q.nodeCount,Math.round(Q.totalHeight),Math.round(Q.width),Q.phase,Q.stable?1:0].join("\0")}function Ap(T,D=!1){if(!qe.value||(function(be=!1){return!be&&Ge.value&&!wt.value})(D))return;const j=D||K0(T),q=(function(be,xe=!1){return xe||be.stable||be.phase==="final"?{state:Cl(be,{includeHeightCache:!0})}:{state:Cl(be)}})(T,D),Q=q.state,ve=!!(Q&&(j||(function(be,xe=!1){return!!xe||za(be)!==Ml})(Q,D)));if(j&&(A(T),Wa=T,xp=Ua()),Q&&ve&&(I(Q),Q.anchor&&P(Q.anchor),Ml=za(Q)),T.stable){const be=G0("settled",T);if(be!==Tp){Tp=be;const xe=Cl(T,{includeHeightCache:!0});xe&&(I(xe),Ml=za(xe)),(function(Re){o("render-settled",Re)})(T)}}if(T.phase==="final"){const be=G0("final",T);if(be!==Mp){Mp=be;const xe=Cl(T,{includeHeightCache:!0});xe&&(I(xe),Ml=za(xe)),(function(Re){o("render-final",Re)})(T)}}}function Ep(){Hr!=null&&(Ot?.(Hr),Hr=null),Wr!=null&&ae&&(window.clearTimeout(Wr),Wr=null)}function Y0(){Hr=null,Wr=null,(function(T){if(ui.size>0||Ks!=null)return!0;switch(T){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Cp)&&(fi(),Ha()),Ap(Dr(Cp))}function dn(T){var D,j;if(!qe.value||(Cp=T,Hr!=null||Wr!=null))return;const q=Math.max(0,(j=(D=s.virtualScroll)==null?void 0:D.emitIntervalMs)!=null?j:32),Q=Math.max(0,q-(Ua()-xp)),ve=()=>{Wr=null,Hr=It?It(Y0):null,Hr==null&&Y0()};ae&&Q>0?Wr=window.setTimeout(ve,Q):ve()}function $p(T){var D;if(T<=0)return 0;const j=tt.value;if(Qt.value)return A0(T);if(Na.value===j.length&&Vh.value.length&&Kh.value.length){const Q=zo.value,ve=Vh.value,be=Kh.value,xe=De=>De<=0?0:_u(ve,0,De)+(De-_u(be,0,De))*Q;let Re=0,Ae=j.length-1,Fe=j.length-1;for(;Re<=Ae;){const De=Re+Ae>>1;xe(De+1)>=T?(Fe=De,Ae=De-1):Re=De+1}return Fe}let q=T;for(let Q=0;Q<j.length;Q++){const ve=(D=mo[Q])!=null?D:zo.value;if(q<=ve)return Q;q-=ve}return Math.max(0,j.length-1)}function X0(){xt.value+=1}function Ip(T){return!(qo.value&&T>=Zn.value)&&(!Hi.value||T<jo.value||Jh.value.has(T))}function Al(T){const D=Mu.get(T);D&&(D(),Mu.delete(T));const j=kl.get(T);j&&(j.destroy(),kl.delete(T)),Au(T)}function Z0(T,D){let j=!1;if(D){const ve=ue.get(T);ue.set(T,D),ve!==D&&(j=!0)}else ue.delete(T)&&(j=!0);if(j&&X0(),D||Au(T),!f0.value||!Kt||!ge.value&&Hi.value&&!K.value&&kl.size>=640&&(K.value||(K.value=!0,Qh()),!f0.value||!Kt))return Al(T),void(D&&ji(T,!0));if(T<jo.value&&!ge.value||Jh.value.has(T))return Al(T),void ji(T,!0);if(!D)return void Al(T);Al(T);const q=Kt(D,{rootMargin:"400px"});if(!q)return;kl.set(T,q),ji(T,q.isVisible.value),Hi.value&&(function(ve){if(!ae||!Hi.value)return;Au(ve);const be=ve%17*23,xe=window.setTimeout(()=>{if(_0.delete(ve),!Hi.value||Jh.value.has(ve))return;const Re=ue.get(ve);if(!Re)return;const Ae=_e(Re),Fe=Re.ownerDocument||document,De=Fe.defaultView||window,Ee=!Ae||Ae===Fe.documentElement||Ae===Fe.body,Be=!Ee&&Ae?ut("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ae.getBoundingClientRect()):null,ze=Ee?0:Be.top,Ve=Ee?ut("nodeVisibilityFallback.clientHeight",()=>{var st,ot;return(ot=(st=De.innerHeight)!=null?st:Ae?.clientHeight)!=null?ot:0}):Be.bottom,ft=ut("nodeVisibilityFallback.node.getBoundingClientRect",()=>Re.getBoundingClientRect());ft.bottom>=ze-500&&ft.top<=Ve+500&&ji(ve,!0)},1800+be);_0.set(ve,xe)})(T);let Q=null;Q=Ke(()=>q.isVisible.value,ve=>{if(ve){Au(T),ji(T,!0),Q?.(),Mu.delete(T),kl.get(T)===q&&kl.delete(T);try{q.destroy()}catch{}}},{immediate:!0}),Mu.set(T,Q),ge.value&&Go()}function Np(){Ks=null;for(const[T,D]of ui)ui.delete(T),Vo.get(T)===D.el&&Or.get(T)===D.version&&c0(T,D.height,{allowShrink:D.allowShrink})}function El(){Ks!=null&&(Ot?.(Ks),Ks=null),ui.clear()}function Pu(T,D){(function(j,q,Q){var ve;if(!Number.isFinite(Q)||Q<=0||Vo.get(j)!==q)return;const be=Or.get(j);if(be==null)return;const xe=tt.value[j],Re=X.value&&H.value!==!0&&!((ve=s.nodes)!=null&&ve.length)&&j>=tt.value.length-2,Ae=!(xe?.loading===!0||Re),Fe=ui.get(j),De=Fe?Fe.allowShrink&&Ae:Ae,Ee=Fe&&!De?Math.max(Fe.height,Q):Q;ui.set(j,{height:Ee,allowShrink:De,version:be,el:q}),Ks==null&&(Ks=It?It(Np):null,Ks==null&&Np())})(T,D,u0(T,D))}function fi(){for(const[T,D]of Vo)D&&Pu(T,D)}function J0(){ne?.disconnect(),ne=null,pe.clear()}function Lp(){for(;Su.length;)Tu(Su.pop())}Ke(wt,T=>{T&&dn("content")},{flush:"post"}),t({getVirtualMetrics:Dr,captureVirtualState:function(T={}){var D;return Cl(Dr("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:T.allowFallbackAnchor===!0,requireViewport:T.requireViewport===!0,includeEmptyState:(D=T.includeEmptyState)==null||D})},restoreVirtualState:function(T,D={}){const j=D.restoreAnchor===!0,q=D.restoreToken==null?"imperative":String(D.restoreToken);Ba=T,Fa={restoreAnchor:j,restoreToken:q,allowUncapturedAnchor:D.allowUncapturedAnchor===!0},!bp(T,{restoreAnchor:j,restoreToken:q,allowUncapturedAnchor:D.allowUncapturedAnchor===!0})&&z0(T)||(Ba=null,Fa=null)},forceMeasure:function(T="manual"){return _n(this,null,function*(){yield mt(),yield V0(),fi(),Ha(),yield mt();const D=Dr(T);return Ap(D,!0),D})},settle:Sp,scrollToNode:function(T,D="start"){xl(),ci();const j=tt.value.length;if(j<=0)return;const q=os(T,0,j-1),Q=()=>{var ve;const be=yl({nodeIndex:q,offsetWithinNodePx:0}),xe=Eu(q),Re=Ra(),Ae=(ve=Re?.clientHeight)!=null?ve:0,Fe=$r();let De=be;if(D==="center")De=be-Ae/2+xe/2;else if(D==="end")De=be-Ae+xe;else if(D==="nearest"&&Fe!=null){if(be>=Fe&&be+xe<=Fe+Ae)return;De=be<Fe?be:be-Ae+xe}Ir(Math.max(0,De)),Go({immediate:!0}),ge.value&&(vo.value=q,Lr())};if(ge.value)return vo.value=q,Lr(),void mt(Q);Q()}}),Ke(()=>He.value,T=>{if(!T){J0();for(const D of Wi.values())for(const j of D)Tu(j);Wi.clear(),Or.clear(),Lp(),El()}},{immediate:!0}),Ke(H,T=>{T&&(function(){if(ae&&H.value&&Vo.size){Lp();for(const D of[80,240,640]){const j=k0(D,()=>{for(const[q,Q]of Vo)Q&&Pu(q,Q)},"final");j!=null&&Su.push(j)}}})(),dn(T?"final":"content")}),Ke([()=>tt.value.length,()=>Zn.value],()=>{kn.value&&Tl(),dn("content")},{flush:"post",immediate:!0}),Ke([()=>ss.start,()=>ss.end],()=>{dn("batch")},{flush:"post"});const{cleanupBatchScheduler:K3}=(function(T){const{props:D,isClient:j,isTestEnv:q,parsedNodesIdentity:Q,parsedNodeCount:ve,desiredRenderedCount:be,datasetKey:xe,batchingEnabled:Re,incrementalRenderingActive:Ae,resolvedBatchSize:Fe,resolvedInitialBatch:De,renderedCount:Ee,adaptiveBatchSize:Be,previousRenderContext:ze,previousBatchConfig:Ve,requestFrame:ft,cancelFrame:st,hasIdleCallback:ot,cleanupNodeVisibility:pt,onDatasetKeyChanged:ht,onDatasetChanged:Ht}=T;let yt=null,Mt=null,Tt=!1,Gt=null,Ys=null,Ss=0,Oo=!1,zi=!1;const Vi=new Set,jr=new Set;function gy(){if(j){yt!=null&&(st?.(yt),yt=null),Mt!=null&&(window.clearTimeout(Mt),Mt=null),Ys!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Ys),Ys=null),Ss+=1;for(const fs of Vi)st?.(fs);Vi.clear();for(const fs of jr)window.clearTimeout(fs);jr.clear(),Tt=!1,Gt=null,Oo=!1,zi=!1}}function Uu(){return typeof performance<"u"?performance.now():Date.now()}function vy(fs){(function(hi){var Ki;if(!Ae.value)return;const pi=Math.max(2,(Ki=D.renderBatchBudgetMs)!=null?Ki:6),mi=Math.max(1,Fe.value||1),Po=Math.max(1,Math.floor(mi/4));hi>1.2*pi?Be.value=Math.max(Po,Math.floor(.7*Be.value)):hi<.5*pi&&Be.value<mi&&(Be.value=Math.min(mi,Math.ceil(1.2*Be.value)))})(fs),Oo=!1;const Ls=zi||Ee.value<be.value;zi=!1,Ls&&by()}function yy(fs,Ls={}){var hi,Ki;if(!Ae.value)return;const pi=be.value;if(Ee.value>=pi)return;const mi=Math.max(1,fs),Po=()=>{const Nl=Uu();let Ll=0;yt=null,Mt=null,Ys=null,Tt=!1;const Ol=Gt??mi;Gt=null;const Wp=Uu();Ee.value=Math.min(pi,Ee.value+Ol),pt(Ee.value),Ll=Uu()-Wp,(function(Up,_y){if(!j)return void vy(_y);Oo=!0;const wy=++Ss;mt().then(()=>{var Sy;if(wy!==Ss)return;const hA=Uu(),pA=Math.max(_y,hA-Up),Cy=()=>{wy===Ss&&vy(pA)};if(ft){let Ty=!1,gi=null;const My=()=>{Ty||(Ty=!0,Cy())},ju=ft(()=>{Vi.delete(ju),gi!=null&&(window.clearTimeout(gi),jr.delete(gi),gi=null),My()});return Vi.add(ju),gi=window.setTimeout(()=>{gi!=null&&jr.delete(gi),gi=null,st?.(ju),Vi.delete(ju),My()},Math.max(32,(Sy=D.renderBatchIdleTimeoutMs)!=null?Sy:120)),void jr.add(gi)}const xy=window.setTimeout(()=>{jr.delete(xy),Cy()},0);jr.add(xy)})})(Nl,Ll)};if(!j||Ls.immediate)return void Po();const Gi=Math.max(0,(hi=D.renderBatchDelay)!=null?hi:16);if(Gt=Gt!=null?Math.max(Gt,mi):mi,!Tt){if(Tt=!0,!q&&ot&&window.requestIdleCallback){const Nl=Math.max(0,(Ki=D.renderBatchIdleTimeoutMs)!=null?Ki:120);return void(Ys=window.requestIdleCallback(()=>Po(),{timeout:Nl}))}ft&&!q?yt=ft(()=>{Gi!==0?Mt=window.setTimeout(()=>Po(),Gi):Po()}):Mt=window.setTimeout(()=>Po(),Gi)}}function ky(fs,Ls={}){Oo?zi=!0:fs==null?by():yy(fs,Ls)}function by(){Ae.value&&yy(Re.value?Math.max(1,Math.round(Be.value)):Math.max(1,Fe.value))}return Ke([Q,ve,xe,Ae,Fe,De,()=>D.renderBatchDelay],()=>{var fs;const Ls=ve.value,hi=ze.value,Ki=xe.value,pi=!Object.is(Ki,hi.key),mi=Ls!==hi.total,Po=pi||mi;ze.value={key:Ki,total:Ls};const Gi=Ve.value,Nl=(fs=D.renderBatchDelay)!=null?fs:16,Ll=Gi.batchSize!==Fe.value||Gi.initial!==De.value||Gi.delay!==Nl||Gi.enabled!==Ae.value;Ve.value={batchSize:Fe.value,initial:De.value,delay:Nl,enabled:Ae.value},pi&&ht(Ls),(Po||Ll||!Ae.value)&&gy(),(Po||Ll)&&(Be.value=Math.max(1,Fe.value||1)),Po&&Ht();const Ol=be.value;if(!Ls)return Ee.value=0,void pt(0);if(!Ae.value)return Ee.value=Ol,void pt(Ee.value);const Wp=pi||hi.total===0;Ee.value=Wp||Ll?Math.min(Ol,De.value):Math.min(Ee.value,Ol);const Up=Math.max(1,De.value||Fe.value||Ls);Ee.value<Ol?ky(Up,{immediate:!j}):pt(Ee.value)},{immediate:!0}),Ke(be,(fs,Ls)=>{Ae.value&&(typeof Ls=="number"&&fs<=Ls||fs>Ee.value&&ky())}),{cleanupBatchScheduler:gy}})({props:k,isClient:ae,isTestEnv:ho,parsedNodesIdentity:Lo,parsedNodeCount:_s,desiredRenderedCount:Cu,datasetKey:F3,batchingEnabled:Bi,incrementalRenderingActive:qo,resolvedBatchSize:Di,resolvedInitialBatch:jo,renderedCount:Zn,adaptiveBatchSize:vl,previousRenderContext:Fi,previousBatchConfig:Er,requestFrame:It,cancelFrame:Ot,hasIdleCallback:fo,cleanupNodeVisibility:L3,onDatasetKeyChanged:T=>{El(),wu(),yo(),qa(),T>0&&bu(T)},onDatasetChanged:()=>{ge.value&&Go({immediate:!0})}});Ke([h0,ge,()=>M.value,()=>ee()],([T,D])=>{if(!T)return w0(),void Zh();O3(),D?Go({immediate:!0}):Zh()},{flush:"post",immediate:!0}),Ke([()=>tt.value.length,()=>ge.value],T=>_n(null,[T],function*([D,j]){j&&D&&ae&&(yield mt(),Go({immediate:!0}))}),{flush:"post"}),Ke(Qt,T=>{T&&(function(){var D;if(Pn.value&&rn.value&&yn.value&&((D=Rn.value)!=null&&D[1]))return;const j=ar({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),q=ar({type:"list_item",children:[j],raw:"- Probe paragraph text"}),Q=ar({type:"list",ordered:!1,items:[q],raw:"- Probe paragraph text"});Pn.value=j,rn.value=q,yn.value=Q;const ve={1:null,2:null,3:null,4:null,5:null,6:null};for(let be=1;be<=6;be++)ve[be]=ar({type:"heading",level:be,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(be)} Probe heading`});Rn.value=ve})()},{immediate:!0}),Ke([()=>M.value,Qt],()=>{if(!Qt.value)return tp(),void(Y.value=0);C0(),tp(),Qt.value&&M.value&&typeof ResizeObserver<"u"&&(Oa=new ResizeObserver(()=>{C0(),po.value&&Nr(),kn.value&&Tl(),dn("resize")}),Oa.observe(M.value))},{immediate:!0}),Ke([Qt,ai,Gs],()=>_n(null,null,function*(){if(!Qt.value)return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void yo();yield mt(),(function(){if(!Qt.value||typeof window>"u")return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void yo();const T={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},D=S0(ep(L.value),".paragraph-node");T.paragraph=Fm(L.value,D,"pre-wrap");const j=ep(R.value),q=j?.querySelector(".paragraph-node");T.listItem=Fm(R.value,q,"pre-wrap");const Q=ut("readSimpleTextProbeProfile.list.offsetHeight",()=>{var be,xe;return(xe=(be=B.value)==null?void 0:be.offsetHeight)!=null?xe:0}),ve=ut("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var be,xe;return(xe=(be=R.value)==null?void 0:be.offsetHeight)!=null?xe:0});T.listWrapperOverhead=Math.max(0,Q-ve);for(let be=1;be<=6;be++){const xe=S0(ep(U[be]),`h${be}`);T.headings[be]=Fm(U[be],xe,"pre-wrap")}G.value=T,yo()})()}),{flush:"post",immediate:!0}),Ke(()=>tt.value.length,()=>{ge.value&&Go({immediate:!0})}),Ke([Qt,Y],()=>{yo(),ge.value&&Go({immediate:!0}),po.value&&Nr(),kn.value&&Tl(),dn("resize")},{immediate:!1}),Ke(()=>Hi.value,T=>{if(T)for(const[D,j]of ue)Z0(D,j);else{Qh();for(const[D,j]of ue)j&&ji(D,!0)}},{immediate:!1}),Ke([()=>k.viewportPriority,()=>tt.value.length],([T,D])=>{T!==!1?K.value&&D<=200&&(K.value=!1):K.value=!1}),Ke(()=>Zn.value,()=>{ge.value&&Go({immediate:!0})}),Ke([vo,Oe,La,()=>tt.value.length,ge],()=>{Lr()},{immediate:!0});let Va=null,Ka=!1,$l=null;function Ga(){Va=null,up=null,cp=void 0,Sl=null,qa()}function Op(){El(),wu(),yo(),et.clear();const T=tt.value.length;T>0&&bu(T),_p()}function Pp(){Ep(),b0(),Wa=null,Br=null,Fr=null,Lu=null,Ba=null,Fa=null,Ka=!1,Ga(),L0("restore"),ci(),xl()}function Ya(T){var D;return[(D=Kn())!=null?D:"",mn(),di(),$u.value,ja(T),tt.value.length,Math.round(qi(0,tt.value.length)),Math.round(Rr()),go.count,Math.round(go.total)].join(":")}function Q0(){return _n(this,null,function*(){var T,D,j,q;const Q=(T=s.virtualScroll)==null?void 0:T.settledToken,ve=ja(Q),be=mn(),xe=Kn(),Re=Gs.value;if(qe.value&&((D=s.virtualScroll)==null?void 0:D.settleMode)==="manual"&&Iu(Q))if(dp()){if(Ya(Q)!==Sl&&!Ka){Ka=!0;try{const Ae=yield Sp({reason:"manual",expectedSettledTokenKey:ve}),Fe=ja()===ve;wp(be,xe,Re)&&Ae.sessionKey===be&&Ae.threadKey===xe&&Fe&&Ae.stable&&Ae.phase==="final"&&(Sl=Ya((j=s.virtualScroll)==null?void 0:j.settledToken))}finally{Ka=!1,yield mt();const Ae=(q=s.virtualScroll)==null?void 0:q.settledToken,Fe=Iu(Ae)?Ya(Ae):"";wp(be,xe,Re)&&Fe&&Sl!==Fe&&Q0()}}}else dn("manual")})}Ke(qe,(T,D)=>{if(T!==D){if(!T)return Pp(),void Ep();Pp(),Op(),$l=Gs.value,dn("content")}},{flush:"post"}),Ke([qe,Gs],([T,D])=>{T?$l!=null?$l!==D&&($l=D,(function(j="resize"){El(),wu(),yo(),et.clear();const q=tt.value.length;q>0&&bu(q),_p(),Br=null,Fr=null,Lu=null,Wa=null,Ka=!1,Ga(),q0(),mt(()=>{fi(),po.value&&Nr(),kn.value&&Tl(),dn(j)})})("resize")):$l=D:$l=null},{flush:"post",immediate:!0}),Ke([qe,()=>mn(),()=>Kn()],([T])=>{T&&(Pp(),Op(),L0("content"),dn("content"))}),Ke([qe,()=>mn(),()=>Kn(),Gs,()=>tt.value.length],([T])=>{T&&(function(D="async-node"){let j=!1;for(const[q,Q]of Array.from(Ko.entries()))lp(Q)||(Ko.delete(q),Vs.delete(q),j=!0);j&&(_l(),dn(D))})("async-node")},{flush:"post"}),Ke([qe,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.sessionKey},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>s.indexKey,()=>se.value],([T])=>{T&&(qa(),(function(D="content"){if(!qe.value)return;const j=[],q=tt.value.length;for(const Q of Array.from(et.keys())){if(Q>=q){j.push(Q);continue}const ve=Da(Q),be=et.get(Q);be!=null&&be!==ve&&j.push(Q),et.set(Q,ve)}for(const Q of Array.from(et.keys()))Q>=q&&et.delete(Q);j.length&&((function(Q,ve={}){const be=Array.from(Q,Number);E3(be,ve)>0&&(function(Re){for(const Ae of Re)et.delete(Ae)})(be)})(j,{notify:!1}),yo(),Ga(),po.value&&Nr(),kn.value&&Tl(),dn(D))})("content"))},{flush:"post",immediate:!0}),Ke([qe,()=>tt.value.length,()=>mn(),()=>Kn()],([T,D,j,q],[Q,ve,be,xe])=>{T&&Q&&j===be&&q===xe&&D!==ve&&Ga()},{flush:"post"}),Ke([qe,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.heightCache},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.heightCacheWidth},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>tt.value.length,()=>mn(),Y],()=>{q0()},{flush:"post",immediate:!0}),Ke([qe,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreAnchor},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>tt.value.length,()=>mn(),Y],T=>_n(null,[T],function*([D,j]){if(!D||!j)return;yield mt();const q=(function(){var Q;const ve=(Q=s.virtualScroll)==null?void 0:Q.restoreAnchor;return ve==null||ve===!1?null:ve===!0?"true":String(ve)})();bp(j,{restoreAnchor:q!=null,restoreToken:q??void 0})}),{flush:"post",immediate:!0}),Ke([qe,Y,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey}],([T])=>{var D;if(!T)return;const j=(D=s.virtualScroll)==null?void 0:D.restoreState;j&&Br&&Fr==="restore"&&(U0(j)||(Op(),Br=null,Fr=null,dn("resize")))},{flush:"post"}),Ke([qe,()=>tt.value.length,()=>mn(),Y],T=>_n(null,[T],function*([D]){var j;const q=Ba,Q=Fa;D&&q&&(yield mt(),!bp(q,{restoreAnchor:Q?.restoreAnchor===!0,restoreToken:(j=Q?.restoreToken)!=null?j:"imperative",allowUncapturedAnchor:Q?.allowUncapturedAnchor===!0})&&z0(q)||(Ba=null,Fa=null))}),{flush:"post",immediate:!0}),Ke([qe,H,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settleMode},()=>mn(),()=>Kn(),Gs,Yh,m0,()=>Zn.value,Cu,()=>go.count,()=>go.total],([T,D,j])=>{if(!T||D!==!0||j==="manual"||!fp())return;const q=(function(){var Q;const ve=tt.value.length;return[(Q=Kn())!=null?Q:"",mn(),di(),$u.value,ve,Math.round(qi(0,ve)),Math.round(Rr()),go.count,Math.round(go.total)].join(":")})();Va!==q&&(Va=q,Sp({reason:"final"}).then(Q=>{Q.stable||Va!==q||(Va=null)}))},{flush:"post",immediate:!0}),Ke([qe,H,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settleMode},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settledToken},()=>mn(),()=>Kn(),Gs,Yh,m0,()=>Zn.value,Cu,()=>tt.value.length,()=>go.count,()=>go.total],()=>{Q0()},{flush:"post",immediate:!0}),Ke([()=>tt.value.length,ge,Oe,La,()=>ss.start,()=>ss.end],([T,D,j,q,Q,ve])=>{de.value&&le("virtualization",{nodes:T,virtualization:D,maxLiveNodes:j,buffer:q,focusIndex:vo.value,scroll:D?(()=>{const be=Bn.value||_e();return be?{reverse:W(be),scrollTop:Math.round(be.scrollTop),scrollTopAbs:Math.round(Math.abs(be.scrollTop)),scrollHeight:Math.round(be.scrollHeight),clientHeight:Math.round(be.clientHeight)}:null})():null,liveRange:{start:Q,end:ve},rendered:Zn.value})}),Ke([()=>k.customId],([T],D,j)=>{if(!T||Mn)return;const q=(function(Q,ve){return Q?(Gn.controllers[Q]=ve,()=>{Gn.controllers[Q]===ve&&delete Gn.controllers[Q]}):()=>{}})(T,{captureRestoreAnchor:r0,restoreAnchor:l0,getAnchorDrift:x3,getReport:R3});j(()=>{q()})},{immediate:!0}),qs(()=>{(function(){if(qe.value)try{fi(),Ha();const T=Dr("manual");K0(T)&&(A(T),Wa=T,xp=Ua());const D=Cl(T,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});D&&(I(D),D.anchor&&P(D.anchor),Ml=za(D))}catch{}})(),K3(),Qh(),Ne(),J0();for(const T of Wi.values())for(const D of T)Tu(D);Wi.clear(),Or.clear(),et.clear(),Lp(),El(),tp(),ci(),xl(),Ep(),w0(),Zh()});const G3=si({loader:()=>_n(null,null,function*(){try{return(yield no(()=>import("./index11-BZ-VpLJZ.js"),__vite__mapDeps([6,3]))).default}catch(T){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".',T),Zs}}),loadingComponent:LU,delay:0}),Y3=si({loader:()=>_n(null,null,function*(){try{return(yield no(()=>import("./index10-D-oYkFkv.js"),[])).default}catch(T){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.',T),Zs}}),loadingComponent:NU,delay:0}),X3=si(()=>_n(null,null,function*(){try{return(yield no(()=>import("./index7-5thVZydO.js"),[])).default}catch(T){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".',T),Zs}})),ey={text:Nn,paragraph:al,heading:Bf,code_block:Im,list:ga,list_item:ma,blockquote:Rd,table:Lc,definition_list:Dd,footnote:Bd,footnote_reference:ro,footnote_anchor:Ic,admonition:Ud,vmr_container:Hd,hardbreak:mr,link:$s,image:pr,thematic_break:Fd,math_inline:Uo,math_block:iM,strong:As,emphasis:Is,strikethrough:Es,highlight:ao,insert:Us,subscript:Ws,superscript:Hs,emoji:Fs,checkbox:io,checkbox_input:io,inline_code:bs,html_inline:lo,reference:Ms,html_block:Nc},Z3=F(()=>ip()),ty=F(()=>xw(k.codeBlockProps)),J3=F(()=>xw(k.codeBlockProps,{omit:["langs"]})),ny=F(()=>Qe(Qe({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,monacoOptions:k.codeBlockMonacoOptions,themes:k.themes,langs:u.value==="shiki"?k.langs:void 0,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof we.value=="boolean"?{showTooltips:we.value}:{}),J3.value)),sy=F(()=>Qe(St(Qe({},ny.value),{langs:k.langs}),ty.value));function oy(T){return typeof T=="boolean"?T:void 0}const Q3=F(()=>{const T=k.codeBlockProps||{},D={},j=oy(T.showLineNumbers);j!==void 0&&(D.showLineNumbers=j);const q=oy(T.diffInline);q!==void 0&&(D.diffInline=q);const Q=(function(ve){const be=Number(ve);return Number.isFinite(be)&&be>0?be:void 0})(T.reservedHeightPx);return Q!==void 0&&(D.reservedHeightPx=Q),D}),eA=F(()=>Qe(Qe({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof we.value=="boolean"?{showTooltips:we.value}:{}),ty.value)),tA=F(()=>Qe({},k.mermaidProps||{})),iy=F(()=>Qe({},k.d2Props||{})),nA=F(()=>Qe({},k.infographicProps||{})),Xa=F(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:un.value.customHtmlTags})),sA=F(()=>Qe(Qe({},Xa.value),typeof we.value=="boolean"?{showTooltip:we.value}:{})),oA=F(()=>Qe(Qe({},Xa.value),typeof we.value=="boolean"?{showTooltips:we.value}:{})),iA=F(()=>Qe(Qe({},Xa.value),typeof we.value=="boolean"?{showTooltips:we.value}:{})),rA=F(()=>Qe(Qe({},Xa.value),typeof we.value=="boolean"?{showTooltips:we.value}:{}));function lA(T){return Array.isArray(T.children)&&T.children.length>0}const Rp=F(()=>P3.value.map(T=>{var D,j,q,Q,ve,be,xe,Re;let Ae=(function(st){var ot,pt,ht,Ht,yt,Mt,Tt;if(st.type!=="code_block")return st;const Gt=st,Ys=[String((ot=Gt.language)!=null?ot:""),String((pt=Gt.loading)!=null?pt:""),String((ht=Gt.diff)!=null?ht:""),String((Ht=Gt.code)!=null?Ht:""),String((yt=Gt.originalCode)!=null?yt:""),String((Mt=Gt.updatedCode)!=null?Mt:""),String((Tt=Gt.raw)!=null?Tt:"")].join("\0"),Ss=Ye.get(Gt);if(Ss&&Ss.signature===Ys)return Ss.node;const Oo=Qe({},Gt);return Ye.set(Gt,{signature:Ys,node:Oo}),Oo})(T.node);const Fe=Ru(Ae);let De=cy(Ae,Fe);if((Ae.type==="html_block"||Ae.type==="html_inline")&&De===ey[Ae.type]){const st=Ae,ot=String((D=st.tag)!=null?D:"").trim().toLowerCase()||Yx(st.content);if(ot){const pt=$t.value[ot];if(On.value.has(ot)&&pt)De=pt,Ae=St(Qe({},st),{type:ot,tag:ot,content:r7(st.content,ot)});else if(Xx((j=st.content)!=null?j:st.raw,ot)){const ht=String((Q=(q=st.content)!=null?q:st.raw)!=null?Q:"");Ae.type==="html_inline"?(De=Nn,Ae={type:"text",content:ht,raw:ht}):(De=al,Ae={type:"paragraph",children:[{type:"text",content:ht,raw:ht}],raw:ht})}}}const Ee=Ae.type==="code_block"&&u.value==="pre"&&De===Zs&&!Dp($t.value,Fe);let Be=Qe({},(function(st,ot,pt){const ht=ot??Ru(st);if(st.type==="code_block"){const Ht=ht?Dp($t.value,ht):void 0;if(pt&&u.value==="pre"&&!Ht&&pt===Zs)return Q3.value;if(pt&&ht&&pt===Ht)return ht==="mermaid"?ly(st):ht==="infographic"?ay(st):ht==="d2"||ht==="d2lang"?iy.value:sy.value;if(pt&&pt===$t.value.code_block)return sy.value;if(T0(pt))return eA.value}return ht==="mermaid"?ly(st):ht==="infographic"?ay(st):ht==="d2"||ht==="d2lang"?iy.value:st.type==="link"?sA.value:st.type==="list"?oA.value:st.type==="blockquote"?iA.value:st.type==="table"?rA.value:st.type==="code_block"?ny.value:Xa.value})(Ae,Fe,De));const ze=Pr.value[T.index];Ae.type==="code_block"&&ze?.kind==="code-block"&&(Be=St(Qe({},Be),Ee?{reservedHeightPx:(ve=ze.height)!=null?ve:ze.contentHeight}:{estimatedHeightPx:ze.height,estimatedContentHeightPx:ze.contentHeight})),Ee||Ae.type!=="code_block"||Fe!=="mermaid"||Ql(Be.estimatedPreviewHeightPx)!=null||(Be=St(Qe({},Be),{estimatedPreviewHeightPx:Zg(Yg(String((be=Ae.code)!=null?be:"")))})),Ee||Ae.type!=="code_block"||Fe!=="infographic"||Ql(Be.estimatedPreviewHeightPx)!=null||(Be=St(Qe({},Be),{estimatedPreviewHeightPx:Jg(Xg(String((xe=Ae.code)!=null?xe:"")))})),Ae.type==="math_block"&&(Be=St(Qe({},Be),{cacheScope:Tn.value}));const Ve=(function(st,ot){const pt=String(st.type);return!vu(pt)&&$t.value[pt]===ot})(Ae,De),ft=Ve?Fv(Ae,me.value):void 0;return St(Qe({},T),{node:Ae,component:De,bindings:Be,customBindings:Qe(Qe({},ft??{}),Be),rendersCustomNode:Ve,hasSlotChildren:lA(Ae),slotContent:String((Re=Ae.content)!=null?Re:""),isCodeBlock:Ae.type==="code_block",indexKey:`${Z3.value}-${T.index}`})}));function Ru(T){var D;return T?.type==="code_block"?String((D=T.language)!=null?D:"").trim().toLowerCase():""}function Dp(T,D){const j=D.trim().toLowerCase();if(j)for(const q of[j,Pv(j),qT(j)]){const Q=q&&T[q];if(Q)return Q}}function ry(T,D,j,q){var Q,ve;const be=Qe({},T.value);return Ql(be.estimatedPreviewHeightPx)==null&&(be.estimatedPreviewHeightPx=q(j(String((Q=D?.code)!=null?Q:"")),void 0,be.maxHeight==="none"?null:(ve=Ql(be.maxHeight))!=null?ve:void 0)),be}function ly(T){return ry(tA,T,Yg,Zg)}function ay(T){return ry(nA,T,Xg,Jg)}function cy(T,D){if(!T)return a1;const j=$t.value,q=j[String(T.type)];if(T.type==="code_block"){const Q=D??Ru(T),ve=Q?Dp(j,Q):void 0;return ve||(u.value==="pre"?j.code_block||Zs:Q==="mermaid"?j.mermaid||G3:Q==="infographic"?j.infographic||Y3:Q==="d2"||Q==="d2lang"?j.d2||X3:q||j.code_block||M0.value)}return q||ey[String(T.type)]||a1}function Bp(T){o("click",T)}function aA(T){var D;(D=T.target)!=null&&D.closest("[data-node-index]")&&o("mouseover",T)}function cA(T){var D;(D=T.target)!=null&&D.closest("[data-node-index]")&&o("mouseout",T)}function uy(T){o("mouseover",T)}function dy(T){o("mouseout",T)}const Ur=te(null),Yo=te(!1);let Za,Il=null,Fp=0,Du=0,Bu=0;const fy=["code_block","admonition","table","math_block","html_block","image","thematic_break"],uA=new Set(fy),hy=[".typewriter-cursor",".height-estimation-probes",...fy.map(T=>`[data-node-type="${T}"]`),"script","style"].join(",");function py(T){if(!T||typeof T!="object")return!1;const D=T.type;return typeof D=="string"&&uA.has(D)}function Fu(T){var D,j;if(!T||typeof T!="object")return 0;const q=T,Q=(j=(D=q.raw)!=null?D:q.content)!=null?j:q.code;if(typeof Q=="string")return Q.length;const ve=q.children;if(Array.isArray(ve))return ve.reduce((xe,Re)=>xe+Fu(Re),0);const be=q.items;return Array.isArray(be)?be.reduce((xe,Re)=>xe+Fu(Re),0):0}function Hu(){Za&&(clearTimeout(Za),Za=void 0)}function my(){Fp+=1,Il!=null&&(Ot?.(Il),Il=null)}function Wu(){my(),Ur.value&&(Ur.value.style.visibility="hidden")}function dA(T){var D;if(T.nodeType!==Node.TEXT_NODE||!((D=T.textContent)!=null?D:"").trim())return!1;const j=T.parentElement;return!!j&&!j.closest(hy)}function fA(T){let D=T.lastChild;for(;D;){if(dA(D))return D;if(D.nodeType===Node.ELEMENT_NODE){const j=D;if(!j.matches(hy)&&j.lastChild){D=j.lastChild;continue}}for(;D&&D!==T&&!D.previousSibling;)D=D.parentNode;if(!D||D===T)break;D=D.previousSibling}return null}function Hp(){if(!ae||!Yo.value||Il!=null)return;const T=Fp,D=()=>{Il=null,T===Fp&&(function(){var j,q;if(!(ae&&Yo.value&&M.value&&Ur.value))return;const Q=M.value,ve=Ur.value;ve.style.visibility="hidden";const be=(function(){const De=Rp.value;for(let Ee=De.length-1;Ee>=0;Ee--){const Be=De[Ee];if(!Be||py(Be.node)||!Ip(Be.index))continue;const ze=ue.get(Be.index);if(!ze)continue;const Ve=fA(ze);if(Ve)return Ve}return null})();if(!be)return;let xe=0,Re=0,Ae=20,Fe=!1;if(be?.textContent){const De=be.textContent.length,Ee=document.createRange();Ee.setStart(be,Math.max(0,De-1)),Ee.setEnd(be,De);const Be=typeof Ee.getClientRects=="function"?Ee.getClientRects():void 0,ze=(q=Be?.[Be.length-1])!=null?q:(j=be.parentElement)==null?void 0:j.getBoundingClientRect();if(ze){const Ve=ut("typewriterCursor.root.getBoundingClientRect",()=>Q.getBoundingClientRect());xe=ze.right-Ve.left+Q.scrollLeft,Re=ze.top-Ve.top+Q.scrollTop,Ae=ze.height||Ae,Fe=!0}Ee.detach()}Fe&&(ve.style.transform=`translate(${Math.max(0,xe)}px, ${Math.max(0,Re)}px)`,ve.style.height=`${Ae}px`,ve.style.visibility="visible")})()};It?Il=It(D):D()}return Ke([he,()=>s.content,()=>s.nodes,()=>k.typewriter,H],()=>_n(null,null,function*(){var T,D;if(!ae||Ie.value||!J.value)return;if(H.value)return Yo.value=!1,Hu(),void Wu();if((T=s.nodes)!=null&&T.length)return Yo.value=!1,Hu(),Wu(),Du=((D=s.content)!=null?D:"").length,void(Bu=he.value.length);const j=(function(){var xe,Re;return(xe=s.nodes)!=null&&xe.length?s.nodes.reduce((Ae,Fe)=>Ae+Fu(Fe),0):((Re=s.content)!=null?Re:"").length})(),q=(function(){var xe;return(xe=s.nodes)!=null&&xe.length?s.nodes.reduce((Re,Ae)=>Re+Fu(Ae),0):he.value.length})(),Q=!py(tt.value[tt.value.length-1]),ve=j>Du,be=q>Bu;if(k.typewriter===!1||!Q||!ve&&!be)return k.typewriter!==!1&&Q||(Yo.value=!1,Wu()),Du=j,void(Bu=q);Du=j,Bu=q,Yo.value=!0,Ur.value&&(Ur.value.style.visibility="hidden"),Hu(),yield mt(),Hp(),Za=setTimeout(()=>{Za=void 0,Yo.value=!1},3e3)}),{flush:"post",immediate:!0}),Ke(Yo,T=>_n(null,null,function*(){T?(yield mt(),Hp()):Wu()}),{flush:"post"}),Ke([()=>Zn.value,()=>ss.start,()=>ss.end],()=>_n(null,null,function*(){ae&&!Ie.value&&J.value&&Yo.value&&(yield mt(),Hp())}),{flush:"post"}),qs(()=>{Hu(),my(),on.clear()}),(T,D)=>{const j=FE("NodeRenderer",!0);return C(Ie)?(x(!0),$(Pe,{key:0},Xe(Rp.value,q=>(x(),$(Pe,{key:q.index},[q.rendersCustomNode?(x(),je(vs(q.component),en({key:0,ref_for:!0},q.customBindings,{node:q.node,loading:q.node.loading,"index-key":q.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onClick:Bp,onMouseover:uy,onMouseout:dy,onCopy:D[0]||(D[0]=Q=>o("copy",Q)),onHandleArtifactClick:D[1]||(D[1]=Q=>o("handleArtifactClick",Q))}),{default:In(()=>[q.hasSlotChildren?(x(),je(j,en({key:0,ref_for:!0},Vn.value,{nodes:q.node.children,"index-key":q.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):q.slotContent?(x(),je(j,en({key:1,ref_for:!0},Vn.value,{content:q.slotContent,final:!q.node.loading,"index-key":`${q.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),je(vs(q.component),en({key:1,node:q.node,loading:q.node.loading,"index-key":q.indexKey},{ref_for:!0},q.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onClick:Bp,onMouseover:uy,onMouseout:dy,onCopy:D[2]||(D[2]=Q=>o("copy",Q)),onHandleArtifactClick:D[3]||(D[3]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),$("div",{key:1,ref_key:"containerRef",ref:M,class:Le(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:ge.value},{"virtual-scroll-coordinated":wt.value}]]),"data-custom-id":k.customId,onClick:Bp,onMouseover:aA,onMouseout:cA},[Ns.value||ge.value?(x(),$(Pe,{key:0},[Ns.value?(x(),$("div",{key:0,class:"height-estimation-probes",style:Bt({width:`${ai.value}px`}),"aria-hidden":"true"},[m("div",{ref_key:"paragraphProbeWrapperRef",ref:L,class:"node-content","data-probe":"paragraph"},[gt(C(al),{node:Pn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),m("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[m("ul",PU,[gt(C(ma),{node:rn.value,"index-key":"probe-list-item"},null,8,["node"])])],512),m("div",{ref_key:"listProbeWrapperRef",ref:B,class:"node-content","data-probe":"list"},[gt(C(ga),{node:yn.value,"index-key":"probe-list"},null,8,["node"])],512),(x(),$(Pe,null,Xe(6,q=>m("div",{key:`probe-heading-${q}`,ref_for:!0,ref:Q=>(function(ve,be){ve<1||ve>6||(U[ve]=be)})(q,Q),class:"node-content","data-probe":`heading-${q}`},[gt(C(Bf),{node:N3(q),"index-key":`probe-heading-${q}`},null,8,["node","index-key"])],8,RU)),64))],4)):ie("",!0),ge.value?(x(),$("div",{key:1,class:"node-spacer",style:Bt({height:`${sp.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(x(!0),$(Pe,null,Xe(Rp.value,q=>(x(),$("div",{key:q.index,ref_for:!0,ref:Q=>Z0(q.index,Q),class:"node-slot","data-node-index":q.index,"data-node-type":q.node.type},[Ip(q.index)?(x(),$("div",{key:0,ref_for:!0,ref:Q=>(function(ve,be){var xe;be||(function(De){const Ee=`${ip()}-${De}`;let Be=!1;for(const ze of Array.from(Vs.keys())){const Ve=Ko.get(ze);(Ve?.index===De||ze===Ee||ze.startsWith(`${Ee}-`))&&(Vs.delete(ze),Ko.delete(ze),Be=!0)}Be&&(_l(),dn("async-node"))})(ve),ui.delete(ve),(function(De){var Ee;const Be=((Ee=Or.get(De))!=null?Ee:0)+1;Or.set(De,Be)})(ve);const Re=Wi.get(ve);if(Re){for(const De of Re)Tu(De);Wi.delete(ve)}if((function(De){const Ee=pe.get(De);Ee&&(ne?.unobserve(Ee),z.delete(Ee),pe.delete(De))})(ve),!be||!He.value)return Vo.delete(ve),void Or.delete(ve);Vo.set(ve,be);const Ae=()=>{Pu(ve,be)};queueMicrotask(Ae);const Fe=(ne||typeof ResizeObserver>"u"||(ne=new ResizeObserver(De=>{if(De.length)for(const Ee of De){const Be=z.get(Ee.target),ze=pe.get(Be??-1);Be!=null&&ze&&Pu(Be,ze)}else fi()})),ne);if(Fe&&(pe.set(ve,be),z.set(be,ve),Fe.observe(be)),typeof window<"u"){const De=((xe=tt.value[ve])==null?void 0:xe.type)==="code_block"?[16,80,240,800]:H.value?[80]:[];if(De.length){const Ee=De.map(Be=>k0(Be,Ae,"node-resize")).filter(Be=>Be!=null);Ee.length&&Wi.set(ve,Ee)}}})(q.index,Q),class:"node-content"},[q.isCodeBlock?q.rendersCustomNode?(x(),je(vs(q.component),en({key:1,ref_for:!0},q.customBindings,{node:q.node,loading:q.node.loading,"index-key":q.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:D[8]||(D[8]=Q=>o("copy",Q)),onHandleArtifactClick:D[9]||(D[9]=Q=>o("handleArtifactClick",Q))}),{default:In(()=>[q.hasSlotChildren?(x(),je(j,en({key:0,ref_for:!0},Vn.value,{nodes:q.node.children,"index-key":q.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):q.slotContent?(x(),je(j,en({key:1,ref_for:!0},Vn.value,{content:q.slotContent,final:!q.node.loading,"index-key":`${q.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),je(vs(q.component),en({key:2,node:q.node,loading:q.node.loading,"index-key":q.indexKey},{ref_for:!0},q.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:D[10]||(D[10]=Q=>o("copy",Q)),onHandleArtifactClick:D[11]||(D[11]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),je(Oi,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:In(()=>[q.rendersCustomNode?(x(),je(vs(q.component),en({key:0,ref_for:!0},q.customBindings,{node:q.node,loading:q.node.loading,"index-key":q.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:D[4]||(D[4]=Q=>o("copy",Q)),onHandleArtifactClick:D[5]||(D[5]=Q=>o("handleArtifactClick",Q))}),{default:In(()=>[q.hasSlotChildren?(x(),je(j,en({key:0,ref_for:!0},Vn.value,{nodes:q.node.children,"index-key":q.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):q.slotContent?(x(),je(j,en({key:1,ref_for:!0},Vn.value,{content:q.slotContent,final:!q.node.loading,"index-key":`${q.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),je(vs(q.component),en({key:1,node:q.node,loading:q.node.loading,"index-key":q.indexKey},{ref_for:!0},q.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:D[6]||(D[6]=Q=>o("copy",Q)),onHandleArtifactClick:D[7]||(D[7]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),$("div",{key:1,class:"node-placeholder",style:Bt({height:`${Eu(q.index)}px`})},null,4))],8,DU))),128)),Yo.value?(x(),$("span",{key:1,ref_key:"typewriterCursorRef",ref:Ur,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),ge.value?(x(),$("div",{key:2,class:"node-spacer",style:Bt({height:`${op.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,OU))}}})),[["__scopeId","data-v-6eca2e33"]]),js=yM;js.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",js.__name,js.name].filter(n=>!!n));for(const n of t)e.component(n,yM)};const Vv=Object.freeze(Object.defineProperty({__proto__:null,default:js},Symbol.toStringTag,{value:"Module"})),BU={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"},FU={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"},HU={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"},WU={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"},UU={class:"admonition-title"},jU=["aria-expanded","aria-controls"],qU=["id"],Ud=Jt(Ze({__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=F(()=>{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=te(!!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)=>(x(),$("div",{class:Le(["admonition",[`admonition-${s.node.kind}`]])},[m("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(x(),$("svg",BU,[...u[1]||(u[1]=[m("circle",{cx:"12",cy:"12",r:"10"},null,-1),m("path",{d:"M12 16v-4"},null,-1),m("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(x(),$("svg",FU,[...u[2]||(u[2]=[m("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),m("path",{d:"M9 18h6"},null,-1),m("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(x(),$("svg",HU,[...u[3]||(u[3]=[m("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),m("path",{d:"M12 9v4"},null,-1),m("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(x(),$("svg",WU,[...u[4]||(u[4]=[m("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),m("path",{d:"M12 8v4"},null,-1),m("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),m("span",UU,O(i.value),1),s.node.collapsible?(x(),$("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),$("svg",{style:Bt({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]=[m("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,jU)):ie("",!0)]),Lt(m("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[gt(C(js),{"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,qU),[[Bo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Ud.install=e=>{e.component(Ud.__name,Ud)};const kM=()=>no(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let vd=null,zU=kM;function gpe(){return _n(this,null,function*(){if(vd)return vd;const e=zU;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===kM?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(vd=(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),vd):null})}function vpe(){return!1}function ype(){return _n(this,null,function*(){return null})}const yd=te(!1);let Rw=!1;function Wm(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function VU(){return!Rw&&typeof window<"u"&&typeof document<"u"&&(Rw=!0,yd.value=Wm(),new MutationObserver(()=>{yd.value=Wm()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{yd.value=Wm()})),yd}const bM=["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"],KU=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),h1=[...bM].sort((e,t)=>t.length-e.length).join("|"),Um=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${h1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${h1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),_M=/[),.;!?,。;!?)]+$/;function GU(e){const t=e.toLowerCase();return bM.some(n=>t.endsWith(`.${n}`))}function YU(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${h1}))["']`,"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 XU(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(_M,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=KU.has(i),a=GU(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 ZU(e,t={}){const n=[];Um.lastIndex=0;let s;for(;(s=Um.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(_M,""),u=a.length-c.length;a=c;const d=XU(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&&(Um.lastIndex-=u)}return n}const JU=12e4,QU=6e4,ej=32,tj=3e4,Dw=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function nj(e){let t=0,n=0,s=0;Dw.lastIndex=0;let o;for(;(o=Dw.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=JU||n>=QU||t>=ej||s>=tj?"pre":"shiki",codeFenceCount:t,codeChars:n}}const sj={key:1,class:"diff-wrap"},oj={class:"diff-bar"},ij=["title","onClick"],rj={class:"diff-pre"},lj="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Bw="github-light",Fw="github-dark",aj=Ze({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){eH();function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=_t(),s=Rt("resolveImage"),o=te(null),i=e,r=F(()=>!i.streaming),l=F(()=>YU(i.text??"")),a=F(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:nj(i.text??"")),c=VU(),u=F(()=>!i.streaming),d=to(new Map),f=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function g(R){return!/^(https?:|data:|blob:)/i.test(R)}function S(R){if(!s)return;const B=[];for(const U of[p,h]){U.lastIndex=0;let K;for(;(K=U.exec(R))!==null;)B.push(K[2]??"")}for(const U of B)!U||!g(U)||d.has(U)||f.has(U)||(f.add(U),s(U).then(K=>{d.set(U,K!==U?K:"")}).catch(()=>{d.set(U,"")}).finally(()=>{f.delete(U)}))}function _(R){if(!s)return R;const B=U=>{if(!g(U))return null;const K=d.get(U);return K===void 0?lj:K===""?null:K};return R.replace(p,(U,K,V,se)=>{const Y=B(V);return Y===null?U:`${K}${Y}${se}`}).replace(h,(U,K,V,se)=>{const Y=B(V);return Y===null?U:`${K}${Y}${se}`})}Ke(()=>i.text,R=>S(R??""),{immediate:!0});function y(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),B=[];let U=R.nextNode();for(;U;){const K=U,V=K.parentElement;V&&!V.closest("a, pre, .md-file-link")&&K.data.trim().length>0&&B.push(K),U=R.nextNode()}for(const K of B){const V=ZU(K.data,{aliases:l.value});if(V.length===0||!K.parentNode)continue;const se=document.createDocumentFragment();let Y=0;for(const G of V){G.start>Y&&se.append(document.createTextNode(K.data.slice(Y,G.start)));const ee=document.createElement("button");ee.type="button",ee.className="md-file-link",ee.textContent=G.text,ee.title=G.line?`${G.path}:${G.line}`:G.path,ee.addEventListener("click",Se=>{Se.preventDefault(),Se.stopPropagation(),i.openFile?.({path:G.path,line:G.line})}),se.append(ee),Y=G.end}Y<K.data.length&&se.append(document.createTextNode(K.data.slice(Y))),K.parentNode.replaceChild(se,K)}}function b(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function v(R){let B=R.length;for(const U of["#","?"]){const K=R.indexOf(U);K!==-1&&K<B&&(B=K)}return R.slice(0,B)}function w(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const B of R){if(B.dataset.mdLinkHandled==="true")continue;const U=B.getAttribute("href")??"";b(U)&&(B.dataset.mdLinkHandled="true",B.addEventListener("click",K=>{K.preventDefault(),K.stopPropagation(),i.openFile?.({path:v(U)})}))}}function N(){mt().then(()=>{y(),w()})}Ke(()=>i.text,N),Ke(()=>i.streaming,N);let E=null;Zt(()=>{N(),o.value&&(E=new MutationObserver(N),E.observe(o.value,{childList:!0,subtree:!0}))}),Ft(()=>{E?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},A=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,I=F(()=>{const R=_(i.text??""),B=[];let U=0;A.lastIndex=0;let K;for(;(K=A.exec(R))!==null;){const se=K[1]??"",Y=R.slice(U,K.index)+(se||"");Y.trim()&&B.push({kind:"md",text:Y}),B.push({kind:"diff",code:K[2]??""}),U=A.lastIndex}const V=R.slice(U);return(V.trim()||B.length===0)&&B.push({kind:"md",text:V}),B});function P(R){return R.split(`
224
+ `).map(B=>/^\+(?!\+\+)/.test(B)?{cls:"diff-add",text:B}:/^-(?!--)/.test(B)?{cls:"diff-del",text:B}:B.startsWith("@@")?{cls:"diff-hunk",text:B}:{cls:"diff-ctx",text:B})}const M=te(null);function L(R,B){ks(R).then(U=>{U&&(M.value=B,setTimeout(()=>{M.value=null},1400))})}return(R,B)=>(x(),$("div",{ref_key:"mdRef",ref:o,class:"md"},[(x(!0),$(Pe,null,Xe(I.value,(U,K)=>(x(),$(Pe,{key:K},[U.kind==="md"?(x(),je(C(js),{key:0,content:U.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":Bw,"code-block-dark-theme":Fw,themes:[Bw,Fw],"code-block-props":k,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(x(),$("div",sj,[m("div",oj,[B[0]||(B[0]=m("span",{class:"diff-lang"},"diff",-1)),m("button",{class:"diff-copy",title:C(n)("filePreview.copyCode"),onClick:V=>L(U.code,K)},O(M.value===K?"✓":"⧉"),9,ij)]),m("pre",rj,[m("code",null,[(x(!0),$(Pe,null,Xe(P(U.code),(V,se)=>(x(),$("span",{key:se,class:Le(V.cls)},O(V.text),3))),128))])])]))],64))),128))],512))}}),nu=vt(aj,[["__scopeId","data-v-84213e3a"]]),cj={class:"tc-anim"},uj={class:"prev-anim"},dj={class:"prev"},fj=Ze({__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=F(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=F(()=>n.foldable&&o.value.length>1),r=F(()=>n.streaming||!i.value),l=F(()=>o.value.pop()??""),a=te(null);return Zt(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ke(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||mt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),$("div",{class:Le(["think",{mob:e.mobile}])},[i.value?(x(),$("div",{key:0,class:Le(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[m("div",cj,[m("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),m("div",uj,[m("span",dj,O(l.value),1)])],2)):(x(),$("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),Hw=vt(fj,[["__scopeId","data-v-42c6573c"]]),hj={class:"activity-notice",role:"status"},pj={class:"an-moon","aria-hidden":"true"},mj={class:"an-label"},gj=120,vj=Ze({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=te(0);let s=null;return Zt(()=>{s=setInterval(()=>{n.value=(n.value+1)%t.length},gj)}),Ft(()=>{s&&(clearInterval(s),s=null)}),(o,i)=>(x(),$("div",hj,[m("span",pj,O(t[n.value]),1),m("span",mj,O(e.label),1)]))}}),Ww=vt(vj,[["__scopeId","data-v-dfa53d2b"]]),yj=["disabled"],kj={class:"agent-main"},bj={class:"agent-title-row"},_j={class:"agent-name"},wj={key:0,class:"agent-type"},Sj={class:"agent-phase"},Cj={key:0,class:"agent-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},xj=Ze({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=F(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=F(()=>o.value.at(-1)),r=F(()=>n.member.phase==="queued"||n.member.phase==="working"||n.member.phase==="suspended"),l=F(()=>!!(n.member.summary||n.member.suspendedReason||n.member.prompt||o.value.length>0));function a(u){switch(u){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(){l.value&&s("open",n.member.id)}return(u,d)=>(x(),$("div",{class:Le(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[m("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=m("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),m("span",kj,[m("span",bj,[m("span",_j,O(e.member.name),1),e.member.subagentType?(x(),$("span",wj,O(e.member.subagentType),1)):ie("",!0),r.value?(x(),$("span",{key:1,class:Le(["agent-live",{empty:!i.value}])},O(i.value),3)):ie("",!0)])]),m("span",Sj,O(a(e.member.phase)),1),l.value?(x(),$("svg",Cj,[...d[0]||(d[0]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])])):ie("",!0)],8,yj)],2))}}),p1=vt(xj,[["__scopeId","data-v-bb535d33"]]),Tj={class:"agent-group"},Mj={class:"group-count"},Aj={key:0,class:"group-live"},Ej={key:0,class:"group-body"},$j=Ze({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=te(!0),i=F(()=>n.members.filter(l=>l.phase==="completed"||l.phase==="failed").length),r=F(()=>n.members.filter(l=>l.phase==="queued"||l.phase==="working"||l.phase==="suspended").length);return(l,a)=>(x(),$("section",Tj,[m("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>o.value=!o.value)},[a[3]||(a[3]=m("span",{class:"group-title"},"Agents",-1)),m("span",Mj,O(i.value)+"/"+O(e.members.length),1),r.value>0?(x(),$("span",Aj,O(r.value)+" running",1)):ie("",!0),(x(),$("svg",{class:Le(["group-chevron",{open:o.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...a[2]||(a[2]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),o.value?(x(),$("div",Ej,[(x(!0),$(Pe,null,Xe(e.members,c=>(x(),je(p1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>s("open",u))},null,8,["member"]))),128))])):ie("",!0)]))}}),Uw=vt($j,[["__scopeId","data-v-17ab3c41"]]),Ij=["aria-label"],Nj=120,Lj=60,Oj=Ze({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*Nj}ms`,"--moon-frame-fast-delay":`${s*Lj}ms`}}return(s,o)=>(x(),$("span",{class:Le(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(x(),$(Pe,null,Xe(t,(i,r)=>m("span",{key:i,class:"moon-frame",style:Bt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Ij))}}),m1=vt(Oj,[["__scopeId","data-v-e7ccbb9a"]]);function Pj(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}}function jw(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function qw(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 Oh(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 Rj(e){return!(e.tool.status==="ok"&&e.tool.media)}function zw(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function Vw(e){const t=Oh(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(Rj(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}):i.kind==="agent"?n.push({kind:"agent",member:i.member,sourceIndex:r}):n.push({kind:"agentGroup",members:i.members,sourceIndex:r})}),o(),n}function Dj(e){return Oh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
225
+
226
+ `)}function Bj(e){const t=[];for(const n of Oh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
227
+ > ${n.thinking.split(`
228
+ `).join(`
229
+ > `)}`);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(`
230
+ `);t.push(`\`\`\`
231
+ [${n.tool.name}]
232
+ ${s}
233
+ \`\`\``)}else n.kind==="agent"?t.push(`**Agent** ${n.member.name} (${n.member.phase})`):n.kind==="agentGroup"&&t.push(`**Agents**
234
+
235
+ ${n.members.map(s=>`- ${s.name}: ${s.phase}`).join(`
236
+ `)}`);return t.join(`
237
+
238
+ `)}function g1(e){return e.tool.id||`tool-${e.sourceIndex}`}function Kw(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?g1({tool:e.tool,sourceIndex:e.sourceIndex}):e.kind==="agent"?`agent-${e.member.id}-${e.sourceIndex}`:e.kind==="agentGroup"?`agent-group-${e.members[0]?.id??e.sourceIndex}`:`${e.kind}-${e.sourceIndex}`}const Fj={key:0,class:"chat"},Hj={key:0,class:"chat-loading"},Wj={class:"chat-loading-text"},Uj={key:1,class:"chat-empty"},jj={key:1,class:"top-sentinel-text"},qj=["data-turn-id"],zj={key:0,class:"u-imgs"},Vj=["src"],Kj=["src","alt"],Gj={key:1,class:"skill-act"},Yj={class:"skill-act-head"},Xj={key:0,class:"skill-act-args"},Zj={key:2,class:"u-text"},Jj={key:0,class:"u-meta"},Qj=["data-tooltip","onClick"],eq={class:"u-edit-text"},tq=["onClick"],nq=["data-tooltip","onClick"],sq={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},oq={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},iq=["onClick"],rq=["data-turn-id"],lq=["onClick"],aq={class:"cd-view"},cq={key:1,class:"cd-label"},uq=["data-turn-id"],dq={key:1,class:"msg"},fq={key:2,class:"tool-stack"},hq={key:0,class:"a-msg-ft"},pq=["title"],mq=["onClick"],gq={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},vq={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},yq={class:"a-cpbtn-text"},kq={key:4,class:"sending-placeholder"},bq={key:1,class:"term"},_q={key:0,class:"chat-loading"},wq={class:"chat-loading-text"},Sq={key:1,class:"chat-empty"},Cq={key:1,class:"top-sentinel-text"},xq=["data-turn-id"],Tq=["onClick"],Mq={class:"cd-view"},Aq={key:1,class:"cd-label"},Eq=["data-turn-id"],$q={class:"no"},Iq={class:"tx"},Nq={class:"role-row"},Lq=["onClick"],Oq={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Pq={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Rq={class:"cpbtn-text"},Dq=["title"],Bq={key:0,class:"u-text"},Fq={key:0,class:"skill-act"},Hq={class:"skill-act-head"},Wq={key:0,class:"skill-act-args"},Uq={key:2,class:"tool-stack"},jq=["data-tooltip","onClick"],qq={class:"u-edit-text"},zq=["onClick"],Vq={key:4,class:"ln sending-line"},Kq={class:"tx"},Gq=Ze({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},bubble:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages"],setup(e,{expose:t,emit:n}){const{t:s}=_t();Ft(()=>{U!==null&&(clearTimeout(U),U=null),A!==null&&(clearTimeout(A),A=null),y!==null&&(clearTimeout(y),y=null)});const o=e,i=F(()=>o.bubble||o.mobile),r=te(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Y=>{Y[0]?.isIntersecting&&o.hasMoreMessages&&!o.loadingMore&&!o.loadingMoreError&&!o.sessionLoading&&!o.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}Zt(a),Ft(()=>{l?.disconnect(),l=null}),Ke(()=>[o.hasMoreMessages,o.loadingMore,o.loadingMoreError],()=>{mt().then(a)});const c=F(()=>{if(!o.running||o.turns.length===0)return null;const Y=o.turns.at(-1);return Y.role==="assistant"?Y.id:null}),u=F(()=>o.sending||o.running),d=n,f=F(()=>{for(let Y=o.turns.length-1;Y>=0;Y--)if(o.turns[Y].role==="user")return o.turns[Y].id;return null});function p(Y){return Y.role==="user"&&Y.id===f.value&&!o.running&&!o.sending&&!Y.skillActivation}function h(Y){const G=Y.compaction,ee=G?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof G?.tokensBefore=="number"&&typeof G?.tokensAfter=="number"?ee+s("conversation.compactedTokens",{before:jw(G.tokensBefore),after:jw(G.tokensAfter)}):ee}const g=te(null),S=te(null),_=te(null);let y=null;const b=te(new Set);function v(Y){return b.value.has(Y)}function w(Y){const G=new Set(b.value);G.has(Y)?G.delete(Y):G.add(Y),b.value=G}function N(Y,G){if(v(G)){const ee=new Date(Y);if(Number.isNaN(ee.getTime()))return Y;const Se=ae=>String(ae).padStart(2,"0");return`${ee.getFullYear()}-${Se(ee.getMonth()+1)}-${Se(ee.getDate())} ${Se(ee.getHours())}:${Se(ee.getMinutes())}`}return Pj(Y,s("conversation.yesterday"))}function E(Y){_.value===null&&(S.value=null,_.value=Y.id,y=setTimeout(()=>{y=null,d("editMessage",Y.text),_.value=null},240))}const k=te(!1);let A=null;function I(){if(o.turns.length===0)return;const Y=[];for(const ee of o.turns){if(ee.role==="compaction")continue;const Se=ee.role==="user"?"User":"Assistant",ae=Bj(ee);ae.trim()&&Y.push(`**${Se}**
239
+
240
+ ${ae}`)}const G=Y.join(`
241
+
242
+ ---
243
+
244
+ `);ks(G).then(ee=>{ee&&(k.value=!0,d("copyConversationCopied"),A!==null&&clearTimeout(A),A=setTimeout(()=>{A=null,k.value=!1},2e3))}).catch(()=>{})}function P(Y){const G=[];for(let ee=Y;ee>=0;ee--){const Se=o.turns[ee];if(!Se||Se.role!=="assistant")break;G.unshift(Se)}return G}function M(Y){return P(Y).map(G=>Dj(G)).filter(Boolean).join(`
245
+
246
+ `)}function L(){for(let Y=o.turns.length-1;Y>=0;Y-=1)if(o.turns[Y]?.role==="assistant")return M(Y);return""}function R(){const Y=L();Y.trim()&&ks(Y).then(G=>{G&&(k.value=!0,d("copyConversationCopied"),A!==null&&clearTimeout(A),A=setTimeout(()=>{A=null,k.value=!1},2e3))}).catch(()=>{})}t({copyConversation:I,copyFinalSummary:R});function B(Y){const G=o.turns[Y];if(!G||G.role!=="assistant")return!1;const ee=o.turns[Y+1];return!ee||ee.role!=="assistant"}let U=null;function K(Y){const G=o.turns[Y];if(!G)return;const ee=M(Y);ee.trim()&&ks(ee).then(Se=>{Se&&(g.value=G.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,g.value=null},1400))}).catch(()=>{})}function V(Y){const G=Y.text;G.trim()&&ks(G).then(ee=>{ee&&(g.value=Y.id,U!==null&&clearTimeout(U),U=setTimeout(()=>{U=null,g.value=null},1400))}).catch(()=>{})}function se(Y,G){return Y.id!==c.value?!1:G.sourceIndex===Oh(Y).length-1}return(Y,G)=>i.value?(x(),$("div",Fj,[e.sessionLoading?(x(),$("div",Hj,[G[18]||(G[18]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),m("span",Wj,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),$("div",Uj)):ie("",!0),e.hasMoreMessages||e.loadingMore?(x(),$("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Le(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),$("span",jj,[G[19]||(G[19]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),dt(" "+O(C(s)("conversation.loadingOlder")),1)])):(x(),$("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[0]||(G[0]=ee=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):ie("",!0),(x(!0),$(Pe,null,Xe(e.turns,(ee,Se)=>(x(),$(Pe,{key:ee.id},[ee.role==="user"?(x(),$(Pe,{key:0},[m("div",{class:Le(["u-bub turn-anchor",{undoing:_.value===ee.id}]),"data-turn-id":ee.id},[ee.images&&ee.images.length>0?(x(),$("div",zj,[(x(!0),$(Pe,null,Xe(ee.images,(ae,Ie)=>(x(),$(Pe,{key:Ie},[ae.kind==="video"?(x(),$("video",{key:0,class:"u-img",src:ae.url,controls:"",playsinline:"",preload:"metadata"},null,8,Vj)):(x(),$("img",{key:1,class:"u-img",src:ae.url,alt:ae.alt||"",loading:"lazy"},null,8,Kj))],64))),128))])):ie("",!0),ee.skillActivation?(x(),$("div",Gj,[m("div",Yj,[G[20]||(G[20]=m("span",{class:"skill-act-arrow"},"▶",-1)),m("span",null,O(C(s)("conversation.activatedSkill",{name:ee.skillActivation.name})),1)]),ee.skillActivation.args?(x(),$("div",Xj,O(ee.skillActivation.args),1)):ie("",!0)])):(x(),$("div",Zj,O(ee.text),1))],10,qj),ee.createdAt||p(ee)?(x(),$("div",Jj,[p(ee)?(x(),$("div",{key:0,class:Le(["u-edit-wrap",{undoing:_.value===ee.id}])},[S.value!==ee.id?(x(),$("button",{key:0,type:"button",class:"u-edit","data-tooltip":C(s)("conversation.undoTooltip"),onClick:ae=>S.value=ee.id},[m("span",eq,O(C(s)("conversation.undo")),1),G[21]||(G[21]=m("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),m("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,Qj)):(x(),$("div",{key:1,class:"u-edit-confirm",onClick:G[2]||(G[2]=Je(()=>{},["stop"]))},[m("span",null,O(C(s)("conversation.undoConfirm")),1),m("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Je(ae=>E(ee),["stop"])},O(C(s)("conversation.confirm")),9,tq),m("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[1]||(G[1]=Je(ae=>S.value=null,["stop"]))},O(C(s)("conversation.cancel")),1)]))],2)):ie("",!0),ee.text.trim().length>0?(x(),$("button",{key:1,type:"button",class:"u-copy","data-tooltip":C(s)("filePreview.copy"),onClick:Je(ae=>V(ee),["stop"])},[g.value!==ee.id?(x(),$("svg",sq,[...G[22]||(G[22]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(x(),$("svg",oq,[...G[23]||(G[23]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])]))],8,nq)):ie("",!0),ee.createdAt?(x(),$("button",{key:2,type:"button",class:"u-time",onClick:Je(ae=>w(ee.id),["stop"])},O(N(ee.createdAt,ee.id)),9,iq)):ie("",!0)])):ie("",!0)],64)):ee.role==="compaction"?(x(),$("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":ee.id,role:"separator"},[G[24]||(G[24]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ee.text?(x(),$("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ae=>d("openCompaction",{turnId:ee.id})},[m("span",null,O(h(ee)),1),m("span",aq,O(C(s)("conversation.viewSummary")),1)],8,lq)):(x(),$("span",cq,O(h(ee)),1)),G[25]||(G[25]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,rq)):(x(),$("div",{key:2,class:"a-msg turn-anchor","data-turn-id":ee.id},[(x(!0),$(Pe,null,Xe(C(Vw)(ee),(ae,Ie)=>(x(),$(Pe,{key:C(Kw)(ae,Ie)},[ae.kind==="thinking"?(x(),je(Hw,{key:0,text:ae.thinking,mobile:i.value,streaming:se(ee,ae),onOpen:de=>d("openThinking",{turnId:ee.id,blockIndex:ae.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):ae.kind==="text"&&ae.text?(x(),$("div",dq,[gt(nu,{text:ae.text,streaming:se(ee,ae),"open-file":de=>d("openFile",de)},null,8,["text","streaming","open-file"])])):ae.kind==="tool-stack"?(x(),$("div",fq,[(x(!0),$(Pe,null,Xe(ae.tools,(de,we)=>(x(),je(sd,{key:C(g1)(de),tool:de.tool,mobile:i.value,"stack-position":C(zw)(we,ae.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[3]||(G[3]=me=>d("openMedia",me)),onOpenFile:G[4]||(G[4]=me=>d("openFile",me)),onOpenToolDiff:G[5]||(G[5]=me=>d("openToolDiff",me))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])):ae.kind==="agent"?(x(),je(p1,{key:3,member:ae.member,onOpen:de=>d("openAgent",{turnId:ee.id,blockIndex:ae.sourceIndex,memberId:de})},null,8,["member","onOpen"])):ae.kind==="agentGroup"?(x(),je(Uw,{key:4,members:ae.members,onOpen:de=>d("openAgent",{turnId:ee.id,blockIndex:ae.sourceIndex,memberId:de})},null,8,["members","onOpen"])):ae.kind==="tool"?(x(),je(sd,{key:5,tool:ae.tool,mobile:i.value,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[6]||(G[6]=de=>d("openMedia",de)),onOpenFile:G[7]||(G[7]=de=>d("openFile",de)),onOpenToolDiff:G[8]||(G[8]=de=>d("openToolDiff",de))},null,8,["tool","mobile","tool-diff-panel"])):ie("",!0)],64))),128)),ee.id!==c.value&&B(Se)&&(M(Se).trim().length>0||ee.durationMs!==void 0)?(x(),$("div",hq,[ee.durationMs!==void 0?(x(),$("span",{key:0,class:"a-duration",title:`${ee.durationMs} ms`},O(C(qw)(ee.durationMs)),9,pq)):ie("",!0),M(Se).trim().length>0?(x(),$("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:ae=>K(Se)},[g.value!==ee.id?(x(),$("svg",gq,[...G[26]||(G[26]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(x(),$("svg",vq,[...G[27]||(G[27]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),m("span",yq,O(C(s)("filePreview.copy")),1)],8,mq)):ie("",!0)])):ie("",!0)],8,uq))],64))),128)),e.compaction?(x(),je(Ww,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(x(),$("div",kq,[gt(m1,{fast:e.fastMoon},null,8,["fast"])])):ie("",!0)])):(x(),$("div",bq,[e.sessionLoading?(x(),$("div",_q,[G[28]||(G[28]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),m("span",wq,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),$("div",Sq)):ie("",!0),e.hasMoreMessages||e.loadingMore?(x(),$("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Le(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),$("span",Cq,[G[29]||(G[29]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),dt(" "+O(C(s)("conversation.loadingOlder")),1)])):(x(),$("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[9]||(G[9]=ee=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):ie("",!0),(x(!0),$(Pe,null,Xe(e.turns,(ee,Se)=>(x(),$(Pe,{key:ee.id},[ee.role==="compaction"?(x(),$("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":ee.id,role:"separator"},[G[30]||(G[30]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ee.text?(x(),$("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ae=>d("openCompaction",{turnId:ee.id})},[m("span",null,O(h(ee)),1),m("span",Mq,O(C(s)("conversation.viewSummary")),1)],8,Tq)):(x(),$("span",Aq,O(h(ee)),1)),G[31]||(G[31]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,xq)):(x(),$("div",{key:1,class:Le(["ln turn-anchor",[ee.role==="user"?"userline":"ai",{undoing:_.value===ee.id}]]),"data-turn-id":ee.id},[m("span",$q,O(ee.no),1),m("div",Iq,[m("div",Nq,[ee.role==="user"?(x(),$(Pe,{key:0},[G[32]||(G[32]=m("span",{class:"pr"},"user@kimi",-1)),G[33]||(G[33]=m("span",{class:"who"}," $ ",-1))],64)):(x(),$(Pe,{key:1},[G[34]||(G[34]=m("span",{class:"pr"},"kimi",-1)),G[35]||(G[35]=m("span",{class:"who"}," > ",-1))],64)),ee.id!==c.value&&B(Se)&&M(Se).trim().length>0?(x(),$("button",{key:2,class:"cpbtn",onClick:ae=>K(Se),tabindex:"-1"},[g.value!==ee.id?(x(),$("svg",Oq,[...G[36]||(G[36]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(x(),$("svg",Pq,[...G[37]||(G[37]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),m("span",Rq,O(C(s)("filePreview.copy")),1)],8,Lq)):ie("",!0),ee.durationMs!==void 0&&ee.role==="assistant"?(x(),$("span",{key:3,class:"turn-duration",title:`${ee.durationMs} ms`},O(C(qw)(ee.durationMs)),9,Dq)):ie("",!0)]),ee.role==="user"?(x(),$("div",Bq,[ee.skillActivation?(x(),$("div",Fq,[m("div",Hq,[G[38]||(G[38]=m("span",{class:"skill-act-arrow"},"▶",-1)),m("span",null,O(C(s)("conversation.activatedSkill",{name:ee.skillActivation.name})),1)]),ee.skillActivation.args?(x(),$("div",Wq,O(ee.skillActivation.args),1)):ie("",!0)])):(x(),$(Pe,{key:1},[dt(O(ee.text),1)],64))])):(x(!0),$(Pe,{key:1},Xe(C(Vw)(ee),(ae,Ie)=>(x(),$(Pe,{key:C(Kw)(ae,Ie)},[ae.kind==="thinking"?(x(),je(Hw,{key:0,text:ae.thinking,streaming:se(ee,ae),onOpen:de=>d("openThinking",{turnId:ee.id,blockIndex:ae.sourceIndex})},null,8,["text","streaming","onOpen"])):ae.kind==="text"&&ae.text?(x(),je(nu,{key:1,text:ae.text,streaming:se(ee,ae),"open-file":de=>d("openFile",de)},null,8,["text","streaming","open-file"])):ae.kind==="tool-stack"?(x(),$("div",Uq,[(x(!0),$(Pe,null,Xe(ae.tools,(de,we)=>(x(),je(sd,{key:C(g1)(de),tool:de.tool,"stack-position":C(zw)(we,ae.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[10]||(G[10]=me=>d("openMedia",me)),onOpenFile:G[11]||(G[11]=me=>d("openFile",me)),onOpenToolDiff:G[12]||(G[12]=me=>d("openToolDiff",me))},null,8,["tool","stack-position","tool-diff-panel"]))),128))])):ae.kind==="agent"?(x(),je(p1,{key:3,member:ae.member,onOpen:de=>d("openAgent",{turnId:ee.id,blockIndex:ae.sourceIndex,memberId:de})},null,8,["member","onOpen"])):ae.kind==="agentGroup"?(x(),je(Uw,{key:4,members:ae.members,onOpen:de=>d("openAgent",{turnId:ee.id,blockIndex:ae.sourceIndex,memberId:de})},null,8,["members","onOpen"])):ae.kind==="tool"?(x(),je(sd,{key:5,tool:ae.tool,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[13]||(G[13]=de=>d("openMedia",de)),onOpenFile:G[14]||(G[14]=de=>d("openFile",de)),onOpenToolDiff:G[15]||(G[15]=de=>d("openToolDiff",de))},null,8,["tool","tool-diff-panel"])):ie("",!0)],64))),128))]),ee.role==="user"&&p(ee)?(x(),$("div",{key:0,class:Le(["u-edit-wrap ln-edit-wrap",{undoing:_.value===ee.id}])},[S.value!==ee.id?(x(),$("button",{key:0,type:"button",class:"u-edit","data-tooltip":C(s)("conversation.undoTooltip"),onClick:ae=>S.value=ee.id},[G[39]||(G[39]=m("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),m("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),m("span",qq,O(C(s)("conversation.undo")),1)],8,jq)):(x(),$("div",{key:1,class:"u-edit-confirm",onClick:G[17]||(G[17]=Je(()=>{},["stop"]))},[m("span",null,O(C(s)("conversation.undoConfirm")),1),m("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Je(ae=>E(ee),["stop"])},O(C(s)("conversation.confirm")),9,zq),m("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[16]||(G[16]=Je(ae=>S.value=null,["stop"]))},O(C(s)("conversation.cancel")),1)]))],2)):ie("",!0)],10,Eq))],64))),128)),e.compaction?(x(),je(Ww,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(x(),$("div",Vq,[G[41]||(G[41]=m("span",{class:"no"},"—",-1)),m("div",Kq,[G[40]||(G[40]=m("div",{class:"role-row"},[m("span",{class:"pr"},"kimi"),m("span",{class:"who"}," > ")],-1)),gt(m1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):ie("",!0)]))}}),wM=vt(Gq,[["__scopeId","data-v-4ea264b2"]]),Yq={class:"chat-header"},Xq={class:"ch-id"},Zq={key:0,class:"ch-ws"},Jq={key:1,class:"ch-sep"},Qq=["onKeydown"],ez=["title"],tz=["title","aria-label","aria-expanded"],nz=["title"],sz=["title"],oz={key:0,class:"ch-pill ch-sync-pill"},iz={key:0,class:"ch-ahead"},rz={key:1,class:"ch-behind"},lz={key:1,class:"ch-pill ch-diff-pill"},az={key:0,class:"ch-add"},cz={key:1,class:"ch-del"},uz=["title"],dz=Ze({__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}=_t(),s=e,o=t,i=F(()=>s.ahead??0),r=F(()=>s.behind??0),l=F(()=>s.gitDiffStats?.totalAdditions??0),a=F(()=>s.gitDiffStats?.totalDeletions??0),c=F(()=>l.value>0||a.value>0),u=te(!1),d=te(null),f=te(null),p=te({});function h(K){const V=K.target;f.value?.contains(V)||d.value?.contains(V)||_()}function g(){_()}async function S(K){if(K.stopPropagation(),u.value){_();return}u.value=!0,document.addEventListener("mousedown",h),document.addEventListener("scroll",g,!0),window.addEventListener("resize",g),await mt();const V=d.value,se=f.value;if(!V||!se)return;const Y=V.getBoundingClientRect(),G=4,ee=8,Se=se.offsetWidth,ae=se.offsetHeight;let Ie=Y.bottom+G;Ie+ae>window.innerHeight-ee&&(Ie=Math.max(ee,Y.top-ae-G));let de=Y.left;de+Se>window.innerWidth-ee&&(de=Math.max(ee,Y.right-Se)),p.value={top:`${Math.round(Ie)}px`,left:`${Math.round(de)}px`}}function _(){u.value=!1,B(),document.removeEventListener("mousedown",h),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}Ft(()=>{document.removeEventListener("mousedown",h),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)});function y(){o("copyAll"),_()}function b(){o("copyFinalSummary"),_()}const v=te(!1);function w(){s.sessionId&&ks(s.sessionId).then(K=>{K&&(v.value=!0,setTimeout(()=>{v.value=!1},1200))})}const N=te(!1),E=te(""),k=te(null);async function A(){if(_(),!!s.sessionId){N.value=!0,E.value=s.sessionTitle??"",await mt();try{k.value?.focus(),k.value?.select()}catch{}}}function I(){const K=E.value.trim();K&&s.sessionId&&K!==(s.sessionTitle??"").trim()&&o("renameSession",s.sessionId,K),N.value=!1}function P(){N.value=!1}function M(){s.sessionId&&(_(),o("forkSession",s.sessionId))}const L=te(!1);let R;function B(){clearTimeout(R),L.value=!1}function U(){if(s.sessionId){if(L.value){o("archiveSession",s.sessionId),_();return}L.value=!0,R=setTimeout(()=>{L.value=!1},2500)}}return(K,V)=>(x(),$("header",Yq,[m("div",Xq,[e.workspaceName?(x(),$("span",Zq,O(e.workspaceName),1)):ie("",!0),e.workspaceName&&e.sessionTitle?(x(),$("span",Jq,"/")):ie("",!0),N.value?Lt((x(),$("input",{key:2,ref_key:"renameInputRef",ref:k,"onUpdate:modelValue":V[0]||(V[0]=se=>E.value=se),class:"ch-rename",type:"text",onKeydown:[Mo(Je(I,["stop"]),["enter"]),Mo(Je(P,["stop"]),["esc"])],onBlur:I,onClick:V[1]||(V[1]=Je(()=>{},["stop"]))},null,40,Qq)),[[wn,E.value]]):e.sessionTitle?(x(),$("span",{key:3,class:"ch-ses",title:e.sessionTitle},O(e.sessionTitle),9,ez)):ie("",!0)]),m("button",{ref_key:"kebabRef",ref:d,type:"button",class:Le(["ch-act ch-act-more",{open:u.value}]),title:C(n)("header.options"),"aria-label":C(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:V[2]||(V[2]=Je(se=>S(se),["stop"]))},[...V[6]||(V[6]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"3",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,tz),u.value?(x(),$("div",{key:0,ref_key:"menuRef",ref:f,class:"ch-menu",style:Bt(p.value),onClick:V[3]||(V[3]=Je(()=>{},["stop"]))},[m("button",{type:"button",class:"chm-item",onClick:Je(y,["stop"])},O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1),m("button",{type:"button",class:"chm-item",onClick:Je(b,["stop"])},O(C(n)("header.copyFinalSummary")),1),e.sessionId?(x(),$(Pe,{key:0},[V[7]||(V[7]=m("div",{class:"chm-divider"},null,-1)),m("button",{type:"button",class:"chm-item",onClick:Je(w,["stop"])},[m("span",null,O(v.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),m("button",{type:"button",class:"chm-item",onClick:Je(A,["stop"])},O(C(n)("header.renameSession")),1),m("button",{type:"button",class:"chm-item",onClick:Je(M,["stop"])},O(C(n)("header.forkSession")),1),m("button",{type:"button",class:"chm-item del",onClick:Je(U,["stop"])},O(L.value?C(n)("header.confirmArchive"):C(n)("header.archiveSession")),1)],64)):ie("",!0)],4)):ie("",!0),V[9]||(V[9]=m("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),$("button",{key:1,type:"button",class:"ch-git",title:C(n)("header.gitTooltip"),onClick:V[4]||(V[4]=se=>o("openChanges"))},[m("span",{class:Le(["ch-branch",{"ch-detached":!e.branch}]),title:e.branch||C(n)("header.detached")},O(e.branch||C(n)("header.detached")),11,sz),i.value>0||r.value>0?(x(),$("span",oz,[i.value>0?(x(),$("span",iz,"↑"+O(i.value),1)):ie("",!0),r.value>0?(x(),$("span",rz,"↓"+O(r.value),1)):ie("",!0)])):ie("",!0),c.value?(x(),$("span",lz,[l.value>0?(x(),$("span",az,"+"+O(l.value),1)):ie("",!0),a.value>0?(x(),$("span",cz,"-"+O(a.value),1)):ie("",!0)])):ie("",!0)],8,nz)):ie("",!0),e.pr?(x(),$("button",{key:2,type:"button",class:Le(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:C(n)("header.openPr"),onClick:V[5]||(V[5]=se=>e.pr&&o("openPr",e.pr.url))},[V[8]||(V[8]=yr('<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-7eb81c61><circle cx="5" cy="6" r="3" data-v-7eb81c61></circle><path d="M5 9v12" data-v-7eb81c61></path><circle cx="19" cy="18" r="3" data-v-7eb81c61></circle><path d="m15 9-3-3 3-3" data-v-7eb81c61></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-7eb81c61></path></svg>',1)),m("span",null,"PR #"+O(e.pr.number)+" · "+O(e.pr.state),1)],10,uz)):ie("",!0)]))}}),fz=vt(dz,[["__scopeId","data-v-7eb81c61"]]),hz={key:0,class:"slash-menu",role:"listbox"},pz=["aria-selected","onMouseenter","onMousedown"],mz={class:"slash-name"},gz={class:"slash-desc"},vz=Ze({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te([]);return Ke(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),$("div",hz,[(x(!0),$(Pe,null,Xe(e.items,(a,c)=>(x(),$("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Le(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:Je(u=>o("select",a),["prevent"])},[m("span",mz,O(a.name),1),m("span",gz,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,pz))),128))])):ie("",!0)}}),yz=vt(vz,[["__scopeId","data-v-738976e5"]]),kz={class:"mention-menu",role:"listbox"},bz={key:0,class:"mention-state dim"},_z={key:1,class:"mention-state dim"},wz=["aria-selected","onMouseenter","onMousedown"],Sz=["innerHTML"],Cz={class:"mention-name"},xz={class:"mention-path"},Tz='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',Mz='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><polyline points="5.5,5 2.5,8 5.5,11"/><polyline points="10.5,5 13.5,8 10.5,11"/></svg>',Az='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><line x1="6" y1="8" x2="11" y2="8"/><line x1="6" y1="10.5" x2="11" y2="10.5"/></svg>',Ez='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="3" width="12" height="10" rx="1"/><circle cx="5.5" cy="6.5" r="1.1"/><path d="M3 12l3.5-3.5L9 11l2-2 3 3"/></svg>',Gw='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><polyline points="9,1.5 9,4.5 12,4.5"/></svg>',$z=Ze({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),r=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),l=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function a(c){const u=c.path;if(u.endsWith("/"))return Tz;const d=c.name||u.split("/").pop()||u,f=d.lastIndexOf("."),p=f>0?d.slice(f+1).toLowerCase():"";return p?i.has(p)?Mz:r.has(p)?Az:l.has(p)?Ez:Gw:Gw}return(c,u)=>(x(),$("div",kz,[n.loading?(x(),$("div",bz,O(C(o)("mention.searching")),1)):n.items.length===0?(x(),$("div",_z,O(C(o)("mention.noMatch")),1)):(x(!0),$(Pe,{key:2},Xe(n.items,(d,f)=>(x(),$("div",{key:d.path,class:Le(["mention-item",{active:f===n.activeIndex}]),role:"option","aria-selected":f===n.activeIndex,onMouseenter:p=>s("hover",f),onMousedown:Je(p=>s("select",d),["prevent"])},[m("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,Sz),m("span",Cz,O(d.name),1),m("span",xz,O(d.path),1)],42,wz))),128))]))}}),Iz=vt($z,[["__scopeId","data-v-86e06bbf"]]),SM=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/sessions",desc:"commands.sessions.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/provider",desc:"commands.provider.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function Nz(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}function CM(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...SM,...t]}function Lz(e,t=SM){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 xM(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 Yw(e,t){switch(xM(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Xw=200;function Oz(){const e=nv(At.inputHistory);return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}function Pz(e){const{text:t,textareaRef:n,autosize:s}=e,o=te(Oz());let i=-1,r="";function l(g){const S=g.trim();if(i=-1,!S||o.value.at(-1)===S)return;const _=[...o.value,S];o.value=_.length>Xw?_.slice(-Xw):_,sv(At.inputHistory,o.value)}function a(){const g=n.value;if(!g)return!1;const S=g.selectionStart??0;return g.value.lastIndexOf(`
247
+ `,S-1)===-1}function c(g){t.value=g,mt(()=>{const S=n.value;if(!S)return;s();const _=g.length;S.setSelectionRange(_,_)})}function u(){if(o.value.length!==0){if(i===-1)r=t.value,i=o.value.length-1;else if(i>0)i-=1;else return;c(o.value[i])}}function d(){i!==-1&&(i<o.value.length-1?(i+=1,c(o.value[i])):(i=-1,c(r)))}function f(){i=-1}function p(){return i!==-1}function h(){return o.value.length>0}return{push:l,caretAtFirstLine:a,recallOlder:u,recallNewer:d,resetBrowsing:f,isBrowsing:p,hasHistory:h}}function Rz(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r}=e,l=te(!1),a=te([]),c=te(0);function u(){const f=t.value;f.startsWith("/")&&!f.includes(" ")?(a.value=Lz(f,CM(o())),c.value=0,l.value=a.value.length>0):l.value=!1}function d(f){if(l.value=!1,f.acceptsInput){t.value=`${f.name} `,mt(()=>{const p=n.value;if(!p)return;const h=t.value.length;p.setSelectionRange(h,h),p.focus(),s()});return}t.value="",r(f.name),i(f.name)}return{open:l,items:a,active:c,update:u,select:d}}function Dz(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=te(!1),r=te([]),l=te(0),a=te(!1);let c=null;function u(){const p=t.value,h=n.value?.selectionStart??p.length;let g=h-1;for(;g>=0&&!/\s/.test(p[g]);)g--;g++;const S=p.slice(g,h);return S.startsWith("@")?{token:S.slice(1),start:g,end:h}:null}function d(){const p=u(),h=o();if(!p||!h){i.value=!1;return}const g=p.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await h(g)}catch{r.value=[]}finally{a.value=!1}},200)}function f(p){const h=u();if(!h)return;const g=t.value;t.value=g.slice(0,h.start)+p.path+g.slice(h.end),i.value=!1,mt(()=>{const S=n.value;if(!S)return;const _=h.start+p.path.length;S.setSelectionRange(_,_),S.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Bz(e){const{sessionId:t}=e;function n(a){return xn(Gk(a))??""}function s(a,c){const u=Gk(a);c?Ln(u,c):Kc(u)}const o=te(n(t())),i=te(null);function r(){const a=i.value;a&&a.style.removeProperty("height")}Ke(o,a=>{mt(r),s(t(),a)}),Ke(t,(a,c)=>{a!==c&&(s(c,o.value),o.value=n(a),mt(r))});function l(a){o.value=a,mt(()=>{const c=i.value;if(!c)return;c.focus();const u=a.length;c.setSelectionRange(u,u),r()})}return{text:o,textareaRef:i,autosize:r,loadForEdit:l}}function Fz(e){const{uploadImage:t}=e,n=te([]),s=te(null),o=te(null),i=te(!1);let r=0;function l(){return`att_${++r}`}function a(w){try{URL.revokeObjectURL(w.previewUrl)}catch{}}function c(w){return w.startsWith("image/")?"image":w.startsWith("video/")?"video":null}async function u(w){const N=t();if(!N)return;const E=w.map(k=>({file:k,kind:c(k.type)})).filter(k=>k.kind!==null);if(E.length!==0)for(const{file:k,kind:A}of E){const I=l(),P=URL.createObjectURL(k),M={localId:I,name:k.name,kind:A,previewUrl:P,uploading:!0};n.value=[...n.value,M],N(k,k.name).then(L=>{n.value=n.value.map(R=>R.localId===I?{...R,uploading:!1,fileId:L?.fileId,error:L===null}:R)}).catch(()=>{n.value=n.value.map(L=>L.localId===I?{...L,uploading:!1,error:!0}:L)})}}function d(w){const N=n.value.find(E=>E.localId===w);s.value?.localId===w&&(s.value=null),N&&a(N),n.value=n.value.filter(E=>E.localId!==w)}function f(w){s.value=w}function p(){s.value=null}function h(){o.value?.click()}function g(w){const N=w.target,E=Array.from(N.files??[]);u(E),N.value=""}function S(w){if(!t())return;const N=w.clipboardData;if(!N)return;const E=[],k=new Set,A=(I,P)=>{const M=`${I.size}:${I.type}:${P}`;if(k.has(M))return;k.add(M);const L=I.type.split("/")[1]??"png",R=P.includes(".")?P:`paste-${Date.now()}.${L}`;E.push(I instanceof File?I:new File([I],R,{type:I.type}))};for(const I of Array.from(N.items))if(I.kind==="file"&&c(I.type)){const P=I.getAsFile();P&&A(P,P.name||`paste-${Date.now()}.${I.type.split("/")[1]??"png"}`)}for(const I of Array.from(N.files))c(I.type)&&A(I,I.name);E.length!==0&&(w.preventDefault(),u(E))}function _(w){!t()||!Array.from(w.dataTransfer?.items??[]).some(E=>E.kind==="file")||(w.preventDefault(),i.value=!0)}function y(){i.value=!1}function b(w){if(i.value=!1,!t())return;w.preventDefault();const N=Array.from(w.dataTransfer?.files??[]);u(N)}function v(){for(const w of n.value)a(w);n.value=[]}return Zt(()=>{document.addEventListener("paste",S)}),Ft(()=>{document.removeEventListener("paste",S);for(const w of n.value)a(w);s.value=null}),{attachments:n,previewAttachment:s,fileInputRef:o,isDragOver:i,removeAttachment:d,openAttachmentPreview:f,closeAttachmentPreview:p,openFilePicker:h,handleFileInputChange:g,handleDragOver:_,handleDragLeave:y,handleDrop:b,clearAfterSubmit:v}}const Hz={key:0,class:"att-strip"},Wz=["title","onClick"],Uz=["src"],jz=["src","alt"],qz={key:2,class:"att-video-badge","aria-hidden":"true"},zz={class:"att-name"},Vz=["aria-label"],Kz=["title"],Gz=["title","onClick"],Yz={class:"att-lightbox-card"},Xz=["title"],Zz=["src"],Jz=["src","alt"],Qz={class:"att-lightbox-name"},eV={class:"composer-card"},tV={class:"cin-wrap"},nV={class:"input-row"},sV=["placeholder"],oV=["aria-label","title"],iV={class:"toolbar-left"},rV=["title"],lV=["title","onKeydown"],aV=["onClick"],cV={class:"pd-check"},uV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},dV={class:"pd-info"},fV={class:"pd-desc"},hV=["title"],pV={class:"mode-label"},mV={key:0,class:"mode-tag"},gV={key:1,class:"mode-tag"},vV={key:2,class:"mode-tag"},yV={class:"mode-row-name"},kV={class:"mode-row-name"},bV={class:"mode-row-name"},_V={key:0,class:"mode-row-actions"},wV={class:"toolbar-right"},SV=["title"],CV={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},xV=["stroke-dasharray","stroke-dashoffset"],TV={class:"ctx-num"},MV=["title","onKeydown"],AV={key:0,class:"think-suffix"},EV={key:0,class:"md-section"},$V=["onClick"],IV={class:"md-check"},NV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},LV={class:"md-name"},OV={class:"md-provider"},PV={key:1,class:"md-divider"},RV={key:2,class:"md-section"},DV=["onClick"],BV={class:"md-check"},FV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},HV={class:"md-name"},WV={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},UV={key:3,class:"md-divider"},jV=["disabled"],qV={class:"md-check"},zV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},VV={class:"md-name"},KV={key:0,class:"md-note"},GV={key:1,class:"md-note"},YV={class:"md-name"},XV=Ze({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=F(()=>s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=_t(),{text:l,textareaRef:a,autosize:c,loadForEdit:u}=Bz({sessionId:()=>s.sessionId}),d=Pz({text:l,textareaRef:a,autosize:c}),{open:f,items:p,active:h,update:g,select:S}=Rz({text:l,textareaRef:a,autosize:c,skills:()=>s.skills,emitCommand:Ge=>i("command",Ge),historyPush:Ge=>d.push(Ge)}),{open:_,items:y,active:b,loading:v,update:w,select:N}=Dz({text:l,textareaRef:a,autosize:c,searchFiles:()=>s.searchFiles});function E(){d.resetBrowsing(),g(),w()}const{attachments:k,previewAttachment:A,fileInputRef:I,isDragOver:P,removeAttachment:M,openAttachmentPreview:L,closeAttachmentPreview:R,openFilePicker:B,handleFileInputChange:U,handleDragOver:K,handleDragLeave:V,handleDrop:se,clearAfterSubmit:Y}=Fz({uploadImage:()=>s.uploadImage});Zt(()=>{l.value&&mt(c)}),Ft(()=>{document.removeEventListener("mousedown",tt),Ie()}),t({loadForEdit:u});function G(){const Ge=l.value.trim();if(k.value.some(wt=>wt.uploading))return;const Ue=k.value.filter(wt=>!wt.uploading&&!wt.error&&wt.fileId);if(!Ge&&Ue.length===0)return;if(d.push(Ge),Ge){const wt=Nz(Ge),Qt=wt?CM(s.skills).some(Ns=>Ns.name===wt.cmd):!1;if(wt&&Qt){l.value="",f.value=!1,i("command",wt.arg?`${wt.cmd} ${wt.arg}`:wt.cmd);return}}const qe={text:Ge,attachments:Ue.map(wt=>({fileId:wt.fileId,kind:wt.kind}))};A.value=null,Y(),l.value="",f.value=!1,_.value=!1,i("submit",qe)}function ee(){if(!s.running||k.value.some(wt=>wt.uploading))return;const Ge=l.value.trim(),Ue=k.value.filter(wt=>!wt.uploading&&!wt.error&&wt.fileId);if(!Ge&&Ue.length===0&&s.queued.length===0)return;const qe={text:Ge,attachments:Ue.map(wt=>({fileId:wt.fileId,kind:wt.kind}))};Y(),d.push(Ge),l.value="",f.value=!1,_.value=!1,i("steer",qe)}let Se=!1,ae=null;function Ie(){ae!==null&&(clearTimeout(ae),ae=null)}function de(){Ie(),Se=!0}function we(){Ie(),ae=setTimeout(()=>{ae=null,Se=!1},0)}function me(Ge){return Se||Ge.isComposing||Ge.keyCode===229}function $e(Ge){if(!me(Ge)){if(Ge.key==="Escape"){if(_e.value){Ge.preventDefault(),oe();return}if(W.value){Ge.preventDefault(),H();return}}if(f.value){if(Ge.key==="ArrowDown"){Ge.preventDefault(),h.value=(h.value+1)%p.value.length;return}if(Ge.key==="ArrowUp"){Ge.preventDefault(),h.value=(h.value-1+p.value.length)%p.value.length;return}if(Ge.key==="Enter"||Ge.key==="Tab"){Ge.preventDefault();const Ue=p.value[h.value];Ue&&S(Ue);return}if(Ge.key==="Escape"){Ge.preventDefault(),f.value=!1;return}}if(_.value&&!v.value){if(Ge.key==="ArrowDown"){Ge.preventDefault(),b.value=(b.value+1)%Math.max(1,y.value.length);return}if(Ge.key==="ArrowUp"){Ge.preventDefault(),b.value=(b.value-1+Math.max(1,y.value.length))%Math.max(1,y.value.length);return}if(Ge.key==="Enter"||Ge.key==="Tab"){Ge.preventDefault();const Ue=y.value[b.value];Ue&&N(Ue);return}if(Ge.key==="Escape"){Ge.preventDefault(),_.value=!1;return}}if(Ge.key==="s"&&(Ge.ctrlKey||Ge.metaKey)&&!Ge.shiftKey&&!Ge.altKey){s.running&&(Ge.preventDefault(),ee());return}if(!f.value&&!_.value&&!Ge.shiftKey&&!Ge.altKey&&!Ge.metaKey&&!Ge.ctrlKey){const Ue=d.isBrowsing();if(Ge.key==="ArrowUp"&&d.hasHistory()&&(Ue||d.caretAtFirstLine())){Ge.preventDefault(),d.recallOlder();return}if(Ge.key==="ArrowDown"&&Ue){Ge.preventDefault(),d.recallNewer();return}}Ge.key==="Enter"&&!Ge.shiftKey&&(Ge.preventDefault(),G())}}const J=F(()=>s.running?r("composer.interrupt"):r("composer.send")),ye=F(()=>!!s.uploadImage),_e=te(!1),W=te(!1),Z=te(null);function fe(){_e.value=!_e.value,_e.value?(W.value=!1,document.addEventListener("click",X,!0)):document.removeEventListener("click",X,!0)}function oe(){_e.value=!1,W.value||document.removeEventListener("click",X,!0)}function he(){W.value=!W.value,W.value?(_e.value=!1,document.addEventListener("click",X,!0)):document.removeEventListener("click",X,!0)}function H(){W.value=!1,_e.value||document.removeEventListener("click",X,!0)}function X(Ge){Z.value&&!Z.value.contains(Ge.target)&&(oe(),H())}Ft(()=>{document.removeEventListener("click",X,!0)});const ce=Ge=>`${Math.round(Ge/1e3)}k`,ke=F(()=>{const Ge=s.status?.ctxMax??0;return Ge<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Ge*100)))}),Me=F(()=>{const Ge=(s.status?.ctxUsed??0).toLocaleString(),Ue=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ge,max:Ue,pct:ke.value})}),Ne=F(()=>ke.value>=80),re=F(()=>{const Ge=s.status?.modelId??s.status?.model??"";return s.models?.find(Ue=>Ue.id===Ge||Ue.model===Ge||Ue.displayName===s.status?.model)}),le=F(()=>xM(re.value)),Ce=F(()=>le.value==="toggle"),We=F(()=>le.value==="always-on"?!0:le.value==="unsupported"?!1:(s.thinking??"off")!=="off");function nt(){Ce.value&&i("setThinking",We.value?"off":"high")}const lt=F(()=>s.planMode===!0),kt=F(()=>s.swarmMode===!0),Ct=F(()=>s.activationBadges?.goal!==null),ut=F(()=>Ct.value||s.goalMode===!0),Et=te(!1),on=te(null),Tn=te(null),$t=te({}),On=F(()=>lt.value||kt.value||ut.value);function un(){Et.value=!1,document.removeEventListener("mousedown",tt)}function tt(Ge){const Ue=Ge.target;on.value?.contains(Ue)||Tn.value?.contains(Ue)||un()}function Vn(){if(Et.value){un();return}const Ge=on.value?.getBoundingClientRect();Ge&&($t.value={left:`${Math.round(Ge.left)}px`,bottom:`${Math.round(window.innerHeight-Ge.top+8)}px`}),Et.value=!0,setTimeout(()=>document.addEventListener("mousedown",tt),0)}const Lo=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--warn)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--err)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function _s(Ge){i("setPermission",Ge),H()}const Pn=F(()=>Lo.find(Ge=>Ge.mode===s.status?.permission)),rn=F(()=>Pn.value?r(Pn.value.labelKey):""),yn=F(()=>re.value?.provider??""),Rn=F(()=>!yn.value||!s.models?.length?[]:s.models.filter(Ge=>Ge.provider===yn.value)),Mn=F(()=>new Set(s.starredIds??[]));function ds(Ge){return Mn.value.has(Ge)}const Dn=F(()=>s.models?.length?s.models.filter(Ge=>ds(Ge.id)&&Ge.provider!==yn.value):[]);function ns(Ge){i("selectModel",Ge),oe()}return(Ge,Ue)=>(x(),$("div",{class:Le(["composer",{"drag-over":C(P)}]),onDragover:Ue[18]||(Ue[18]=(...qe)=>C(K)&&C(K)(...qe)),onDragleave:Ue[19]||(Ue[19]=(...qe)=>C(V)&&C(V)(...qe)),onDrop:Ue[20]||(Ue[20]=(...qe)=>C(se)&&C(se)(...qe))},[C(k).length>0?(x(),$("div",Hz,[(x(!0),$(Pe,null,Xe(C(k),qe=>(x(),$("div",{key:qe.localId,class:Le(["att-chip",{"att-error":qe.error}])},[m("button",{type:"button",class:"att-preview",title:C(r)("composer.previewAttachment",{name:qe.name}),onClick:wt=>C(L)(qe)},[qe.kind==="video"?(x(),$("video",{key:0,class:"att-thumb",src:qe.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,Uz)):(x(),$("img",{key:1,class:"att-thumb",src:qe.previewUrl,alt:qe.name},null,8,jz)),qe.kind==="video"?(x(),$("span",qz,[...Ue[21]||(Ue[21]=[m("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[m("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):ie("",!0)],8,Wz),m("span",zz,O(qe.name),1),qe.uploading?(x(),$("span",{key:0,class:"att-spinner","aria-label":C(r)("composer.uploading")},[...Ue[22]||(Ue[22]=[m("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),m("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,Vz)):qe.error?(x(),$("span",{key:1,class:"att-err-icon",title:C(r)("composer.uploadFailed")},[...Ue[23]||(Ue[23]=[m("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("circle",{cx:"6",cy:"6",r:"5"}),m("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),m("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,Kz)):ie("",!0),m("button",{class:"att-rm",title:C(r)("composer.removeNamed",{name:qe.name}),onClick:wt=>C(M)(qe.localId)},[...Ue[24]||(Ue[24]=[m("svg",{viewBox:"0 0 12 12",width:"9",height:"9",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,Gz)],2))),128))])):ie("",!0),C(A)?(x(),$("div",{key:1,class:"att-lightbox",onClick:Ue[1]||(Ue[1]=Je((...qe)=>C(R)&&C(R)(...qe),["self"]))},[m("div",Yz,[m("button",{type:"button",class:"att-lightbox-close",title:C(r)("model.close"),onClick:Ue[0]||(Ue[0]=(...qe)=>C(R)&&C(R)(...qe))},"✕",8,Xz),C(A).kind==="video"?(x(),$("video",{key:0,class:"att-lightbox-media",src:C(A).previewUrl,controls:"",playsinline:""},null,8,Zz)):(x(),$("img",{key:1,class:"att-lightbox-media",src:C(A).previewUrl,alt:C(A).name},null,8,Jz)),m("div",Qz,O(C(A).name),1)])])):ie("",!0),m("div",eV,[m("div",tV,[C(f)?(x(),je(yz,{key:0,items:C(p),"active-index":C(h),onSelect:C(S),onHover:Ue[2]||(Ue[2]=qe=>h.value=qe)},null,8,["items","active-index","onSelect"])):ie("",!0),C(_)?(x(),je(Iz,{key:1,items:C(y),"active-index":C(b),loading:C(v),onSelect:C(N),onHover:Ue[3]||(Ue[3]=qe=>b.value=qe)},null,8,["items","active-index","loading","onSelect"])):ie("",!0),m("div",nV,[Lt(m("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":Ue[4]||(Ue[4]=qe=>Fn(l)?l.value=qe:null),class:"ph",placeholder:o.value,rows:"1",onKeydown:$e,onCompositionstart:de,onCompositionend:we,onInput:E},null,40,sV),[[wn,C(l)]]),m("button",{class:Le(["send",{aborting:e.running}]),"aria-label":J.value,title:e.running?C(r)("composer.interruptTitle"):J.value,onClick:Ue[5]||(Ue[5]=qe=>e.running?i("interrupt"):G())},[(x(),$("svg",{class:Le(["send-icon",{hidden:e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...Ue[25]||(Ue[25]=[m("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(x(),$("svg",{class:Le(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...Ue[26]||(Ue[26]=[m("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,oV)])]),ye.value?(x(),$("input",{key:0,ref_key:"fileInputRef",ref:I,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:Ue[6]||(Ue[6]=(...qe)=>C(U)&&C(U)(...qe))},null,544)):ie("",!0),m("div",{ref_key:"toolbarRef",ref:Z,class:"toolbar"},[m("div",iV,[ye.value?(x(),$("button",{key:0,class:"attach-btn",title:C(r)("composer.attachImage"),type:"button",onClick:Ue[7]||(Ue[7]=(...qe)=>C(B)&&C(B)(...qe))},[...Ue[27]||(Ue[27]=[m("svg",{class:"attach-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,rV)):ie("",!0),e.status?(x(),$("span",{key:1,class:Le(["perm-pill",["perm-"+e.status.permission,{open:W.value}]]),role:"button",tabindex:"0",title:C(r)("status.permissionTooltip"),onClick:Je(he,["stop"]),onKeydown:[Mo(he,["enter"]),Mo(Je(he,["prevent"]),["space"])]},O(rn.value),43,lV)):ie("",!0),W.value&&e.status?(x(),$("div",{key:2,class:"perm-dropdown",role:"menu",onClick:Ue[8]||(Ue[8]=Je(()=>{},["stop"]))},[(x(),$(Pe,null,Xe(Lo,qe=>m("button",{key:qe.mode,class:Le(["pd-row",{"is-current":qe.mode===e.status.permission}]),role:"menuitem",onClick:wt=>_s(qe.mode)},[m("span",cV,[qe.mode===e.status.permission?(x(),$("svg",uV,[...Ue[28]||(Ue[28]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",dV,[m("span",{class:"pd-name",style:Bt({color:qe.color})},O(C(r)(qe.labelKey)),5),m("span",fV,O(C(r)(qe.descKey)),1)])],10,aV)),64))])):ie("",!0),e.status?(x(),$("div",{key:3,ref_key:"modesRef",ref:on,class:"modes"},[m("button",{type:"button",class:Le(["mode-pill",{on:On.value}]),title:C(r)("status.modesTooltip"),onClick:Je(Vn,["stop"])},[m("span",pV,O(C(r)("status.modesLabel")),1),lt.value?(x(),$("span",mV,O(C(r)("status.planLabel")),1)):ie("",!0),kt.value?(x(),$("span",gV,O(C(r)("status.swarmLabel")),1)):ie("",!0),ut.value?(x(),$("span",vV,O(C(r)("status.goalLabel")),1)):ie("",!0)],10,hV),Et.value?(x(),$("div",{key:0,ref_key:"modesMenuRef",ref:Tn,class:"modes-menu",style:Bt($t.value)},[m("button",{type:"button",class:Le(["mode-row",{on:lt.value}]),onClick:Ue[9]||(Ue[9]=qe=>i("togglePlan"))},[m("span",yV,O(C(r)("status.planLabel")),1),m("span",{class:Le(["mode-switch",{on:lt.value}])},[...Ue[29]||(Ue[29]=[m("span",{class:"mode-knob"},null,-1)])],2)],2),m("button",{type:"button",class:Le(["mode-row",{on:kt.value}]),onClick:Ue[10]||(Ue[10]=qe=>i("toggleSwarm"))},[m("span",kV,O(C(r)("status.swarmLabel")),1),m("span",{class:Le(["mode-switch",{on:kt.value}])},[...Ue[30]||(Ue[30]=[m("span",{class:"mode-knob"},null,-1)])],2)],2),m("div",{class:Le(["mode-row mode-row-goal",{on:Ct.value||s.goalMode}])},[m("button",{type:"button",class:"mode-row-main",onClick:Ue[11]||(Ue[11]=qe=>Ct.value?i("controlGoal","cancel"):i("toggleGoal"))},[m("span",bV,O(C(r)("status.goalLabel")),1),Ct.value?ie("",!0):(x(),$("span",{key:0,class:Le(["mode-switch",{on:s.goalMode}])},[...Ue[31]||(Ue[31]=[m("span",{class:"mode-knob"},null,-1)])],2))]),Ct.value?(x(),$("div",_V,[m("button",{type:"button",class:"mode-row-action",onClick:Ue[12]||(Ue[12]=qe=>i("controlGoal","pause"))},O(C(r)("status.goalPause")),1),m("button",{type:"button",class:"mode-row-action",onClick:Ue[13]||(Ue[13]=qe=>i("controlGoal","resume"))},O(C(r)("status.goalResume")),1)])):ie("",!0)],2)],4)):ie("",!0)],512)):ie("",!0)]),m("div",wV,[Ne.value?(x(),$("button",{key:0,class:"compact-chip",onClick:Ue[14]||(Ue[14]=Je(qe=>i("compact"),["stop"]))},"/compact")):ie("",!0),e.status&&!e.hideContext?(x(),$("span",{key:1,class:"ctx-group",title:Me.value},[(x(),$("svg",CV,[Ue[32]||(Ue[32]=m("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),m("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${2*Math.PI*7}`,"stroke-dashoffset":`${2*Math.PI*7*(1-ke.value/100)}`},null,8,xV)])),m("span",TV,O(ce(e.status.ctxUsed))+"/"+O(ce(e.status.ctxMax)),1)],8,SV)):ie("",!0),e.status?(x(),$("span",{key:2,class:Le(["model-pill",{open:_e.value}]),role:"button",tabindex:"0",title:C(r)("status.modelTooltip"),onClick:Je(fe,["stop"]),onKeydown:[Mo(fe,["enter"]),Mo(Je(fe,["prevent"]),["space"])]},[m("b",null,O(e.status.model),1),We.value?(x(),$("span",AV,O(C(r)("composer.thinkingSuffix")),1)):ie("",!0),Ue[33]||(Ue[33]=m("svg",{class:"cv",viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 6l4 4 4-4"})],-1))],42,MV)):ie("",!0)]),_e.value&&e.status?(x(),$("div",{key:0,class:"model-dropdown",role:"menu",onClick:Ue[17]||(Ue[17]=Je(()=>{},["stop"]))},[Dn.value.length>0?(x(),$("div",EV,O(C(r)("status.starredModels")),1)):ie("",!0),(x(!0),$(Pe,null,Xe(Dn.value,qe=>(x(),$("button",{key:qe.id,class:Le(["md-row",{"is-current":qe.id===e.status.modelId}]),role:"menuitem",onClick:wt=>ns(qe.id)},[m("span",IV,[qe.id===e.status.model||qe.model===e.status.model||qe.displayName===e.status.model?(x(),$("svg",NV,[...Ue[34]||(Ue[34]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",LV,O(qe.displayName??qe.model),1),m("span",OV,O(qe.provider),1),Ue[35]||(Ue[35]=m("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[m("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})],-1))],10,$V))),128)),Dn.value.length>0?(x(),$("div",PV)):ie("",!0),Rn.value.length>0?(x(),$("div",RV,O(yn.value),1)):ie("",!0),(x(!0),$(Pe,null,Xe(Rn.value,qe=>(x(),$("button",{key:qe.id,class:Le(["md-row",{"is-current":qe.id===e.status.modelId}]),role:"menuitem",onClick:wt=>ns(qe.id)},[m("span",BV,[qe.id===e.status.model||qe.model===e.status.model||qe.displayName===e.status.model?(x(),$("svg",FV,[...Ue[36]||(Ue[36]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",HV,O(qe.displayName??qe.model),1),ds(qe.id)?(x(),$("svg",WV,[...Ue[37]||(Ue[37]=[m("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):ie("",!0)],10,DV))),128)),Rn.value.length>0?(x(),$("div",UV)):ie("",!0),m("button",{class:Le(["md-row md-row-toggle",{"is-on":We.value,"is-disabled":!Ce.value}]),role:"menuitem",disabled:!Ce.value,onClick:Ue[15]||(Ue[15]=qe=>nt())},[m("span",qV,[We.value?(x(),$("svg",zV,[...Ue[38]||(Ue[38]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",VV,O(C(r)("status.thinkingLabel")),1),le.value==="always-on"?(x(),$("span",KV,O(C(r)("status.planOn")),1)):le.value==="unsupported"?(x(),$("span",GV,O(C(r)("status.modeNotSupported")),1)):ie("",!0)],10,jV),Ue[39]||(Ue[39]=m("div",{class:"md-divider"},null,-1)),m("button",{class:"md-row md-row-more",role:"menuitem",onClick:Ue[16]||(Ue[16]=qe=>{oe(),i("pickModel")})},[m("span",YV,O(C(r)("status.moreModels")),1)])])):ie("",!0)],512)])],34))}}),TM=vt(XV,[["__scopeId","data-v-09837c89"]]),ZV=["id"],JV={class:"swarm-head"},QV={class:"swarm-count"},eK={class:"swarm-grid"},tK={class:"member-top"},nK={class:"member-name"},sK={class:"member-phase"},oK={class:"member-mid"},iK={class:"member-bar"},rK={key:0,class:"member-type"},lK={key:0,class:"member-bottom"},aK=Ze({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=F(()=>t.group.members.length),s=F(()=>t.group.counts.completed+t.group.counts.failed);function o(l){switch(l){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function i(l){switch(l.phase){case"queued":return"......";case"working":return":::...";case"suspended":return"::....";case"completed":return"::::::";case"failed":return"!!...."}}function r(l){return l.outputLines?.map(a=>a.trimEnd()).filter(Boolean).at(-1)}return(l,a)=>(x(),$("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[m("header",JV,[a[0]||(a[0]=m("div",{class:"swarm-title"},[m("span",{class:"swarm-mark","aria-hidden":"true"}),m("span",null,"Swarm")],-1)),m("div",QV,O(s.value)+"/"+O(n.value),1)]),m("div",eK,[(x(!0),$(Pe,null,Xe(e.group.members,c=>(x(),$("article",{key:c.id,class:Le(["swarm-member",`phase-${c.phase}`])},[m("div",tK,[m("span",nK,O(c.name),1),m("span",sK,O(o(c.phase)),1)]),m("div",oK,[m("span",iK,O(i(c)),1),c.subagentType?(x(),$("span",rK,O(c.subagentType),1)):ie("",!0)]),c.suspendedReason||r(c)||c.summary?(x(),$("div",lK,O(c.suspendedReason||r(c)||c.summary),1)):ie("",!0)],2))),128))])],8,ZV))}}),cK=vt(aK,[["__scopeId","data-v-2cfb7bcf"]]),uK={class:"goal-progress","aria-hidden":"true"},dK={key:0,class:"goal-body"},fK={class:"goal-full"},hK={key:0,class:"goal-criterion"},pK={class:"goal-stats"},mK={key:0},gK={class:"goal-actions"},vK=Ze({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=te(!1);Ke(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=F(()=>{const a=n.goal.budget.tokenBudget;return!a||a<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/a*100)))});function l(a){const c=Math.max(0,Math.round(a/1e3)),u=Math.floor(c/60),d=c%60;return u<=0?`${d}s`:u<60?`${u}m ${d}s`:`${Math.floor(u/60)}h ${u%60}m`}return(a,c)=>(x(),$("section",{class:Le(["goal-strip",{expanded:i.value}])},[m("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=m("span",{class:"goal-kicker"},"Goal",-1)),m("span",{class:Le(["goal-objective",{"expanded-hidden":i.value}])},O(e.goal.objective),3),m("span",{class:Le(["goal-status",`status-${e.goal.status}`])},O(e.goal.status),3),m("span",uK,[m("span",{class:"goal-progress-fill",style:Bt({width:`${r.value}%`})},null,4)]),(x(),$("svg",{class:Le(["goal-chevron",{open:i.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...c[4]||(c[4]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(x(),$("div",dK,[m("div",fK,O(e.goal.objective),1),e.goal.completionCriterion?(x(),$("div",hK,[c[6]||(c[6]=m("span",null,"Done when",-1)),m("p",null,O(e.goal.completionCriterion),1)])):ie("",!0),m("div",pK,[m("span",null,O(e.goal.turnsUsed)+" turns",1),m("span",null,O(e.goal.tokensUsed.toLocaleString())+" tokens",1),m("span",null,O(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),$("span",mK,O(r.value)+"% token budget",1)):ie("",!0)]),m("div",gK,[e.goal.status!=="paused"?(x(),$("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Je(u=>s("controlGoal","pause"),["stop"]))},O(C(o)("status.goalPause")),1)):ie("",!0),e.goal.status==="paused"?(x(),$("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Je(u=>s("controlGoal","resume"),["stop"]))},O(C(o)("status.goalResume")),1)):ie("",!0),m("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Je(u=>s("controlGoal","cancel"),["stop"]))},O(C(o)("status.goalCancel")),1)])])):ie("",!0)],2))}}),yK=vt(vK,[["__scopeId","data-v-dcbae4b7"]]),kK={class:"qh"},bK={class:"qtitle"},_K={class:"qstep"},wK=["disabled"],SK=["disabled"],CK={key:1,class:"qmin-peek"},xK=["title","aria-label"],TK={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},MK={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},AK={key:0,class:"qbody"},EK={key:0,class:"qheader-chip"},$K={class:"qtext"},IK={class:"qopts"},NK=["onClick"],LK={class:"qopt-key"},OK={class:"qopt-glyph"},PK={key:0,class:"chk"},RK={key:1,class:"rad"},DK={class:"qopt-text"},BK={class:"qopt-label"},FK={key:0,class:"qopt-desc"},HK={class:"qopt-glyph"},WK={key:0,class:"chk"},UK={key:1,class:"rad"},jK={class:"qopt-label"},qK=["placeholder"],zK={key:1,class:"qfooter"},VK=["disabled"],KK=Ze({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=_t(),o=t,i=te(0),r=te(!1),l=F(()=>n.question.questions[i.value]),a=F(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}const d=te({});function f(k){return k.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${k.label} ${k.description??""}`.toLowerCase())}function p(){const k={...d.value};let A=!1;for(const I of n.question.questions){if(k[I.id])continue;const P=I.options.filter(f);P.length!==0&&(k[I.id]=I.multiSelect?{kind:"multi",optionIds:P.map(M=>M.id)}:{kind:"single",optionId:P[0].id},A=!0)}A&&(d.value=k)}Ke(()=>n.question.questionId,()=>{i.value=0,r.value=!1,d.value={},S.value={}}),Ke(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),p()},{immediate:!0,deep:!0});function h(k,A){const I=d.value[k];if(I&&I.kind==="single"&&I.optionId===A){const P={...d.value};delete P[k],d.value=P}else d.value={...d.value,[k]:{kind:"single",optionId:A}}}function g(k,A){const I=d.value[k],P=I&&(I.kind==="multi"||I.kind==="multiWithOther")?I.kind==="multi"?[...I.optionIds]:[...I.optionIds]:[],M=P.indexOf(A);M>=0?P.splice(M,1):P.push(A);const L=d.value[k],R=L&&L.kind==="multiWithOther"?L.otherText:"";R?d.value={...d.value,[k]:{kind:"multiWithOther",optionIds:P,otherText:R}}:d.value={...d.value,[k]:{kind:"multi",optionIds:P}}}const S=te({});function _(k){const A=n.question.questions.find(P=>P.id===k),I=S.value[k]??"";if(A.multiSelect){const P=d.value[k],M=P&&(P.kind==="multi"||P.kind==="multiWithOther")?P.kind==="multi"?[...P.optionIds]:[...P.optionIds]:[];d.value={...d.value,[k]:{kind:"multiWithOther",optionIds:M,otherText:I}}}else d.value={...d.value,[k]:{kind:"other",text:I}}}function y(k,A){const I=d.value[k];return I?I.kind==="single"?I.optionId===A:I.kind==="multi"||I.kind==="multiWithOther"?I.optionIds.includes(A):!1:!1}function b(k){const A=d.value[k];return!!(A&&(A.kind==="other"||A.kind==="multiWithOther"))}function v(){return n.question.questions.every(k=>{const A=d.value[k.id];return A?A.kind==="multi"?A.optionIds.length>0:A.kind==="multiWithOther"?A.optionIds.length>0||A.otherText.trim().length>0:A.kind==="other"?A.text.trim().length>0:!0:!1})}function w(){if(!v())return;const k={answers:d.value,method:"click"};o("answer",n.question.questionId,k)}function N(){o("dismiss",n.question.questionId)}function E(k){const A=(document.activeElement?.tagName??"").toLowerCase();if(A==="input"||A==="textarea"||r.value&&k.key!=="Escape")return;if(k.key==="Escape"){k.preventDefault(),N();return}if(k.key==="Enter"){k.preventDefault(),w();return}const I=parseInt(k.key,10);if(!isNaN(I)&&I>=1&&I<=9){k.preventDefault();const P=l.value,M=I-1,L=P.options[M];L&&(P.multiSelect?g(P.id,L.id):h(P.id,L.id))}}return Zt(()=>document.addEventListener("keydown",E)),Ft(()=>document.removeEventListener("keydown",E)),(k,A)=>(x(),$("div",{class:Le(["qcard",{minimized:r.value}])},[m("div",kK,[m("span",bK,O(C(s)("question.title")),1),a.value>1&&!r.value?(x(),$(Pe,{key:0},[m("span",_K,O(C(s)("question.step",{current:i.value+1,total:a.value})),1),m("button",{class:"qnav",disabled:i.value===0,onClick:c},O(C(s)("question.prev")),9,wK),m("button",{class:"qnav",disabled:i.value===a.value-1,onClick:u},O(C(s)("question.next")),9,SK)],64)):ie("",!0),r.value?(x(),$("span",CK,O(l.value.question),1)):ie("",!0),m("button",{class:"qmin",title:r.value?C(s)("question.expand"):C(s)("question.minimize"),"aria-label":r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:A[0]||(A[0]=I=>r.value=!r.value)},[r.value?(x(),$("svg",TK,[...A[4]||(A[4]=[m("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(x(),$("svg",MK,[...A[5]||(A[5]=[m("path",{d:"M3 8h10"},null,-1)])]))],8,xK)]),r.value?ie("",!0):(x(),$("div",AK,[l.value.header?(x(),$("div",EK,O(l.value.header),1)):ie("",!0),m("div",$K,O(l.value.question),1),l.value.body?(x(),je(nu,{key:1,text:l.value.body,class:"qmdbody"},null,8,["text"])):ie("",!0),m("div",IK,[(x(!0),$(Pe,null,Xe(l.value.options,(I,P)=>(x(),$("label",{key:I.id,class:Le(["qopt",{selected:y(l.value.id,I.id)}]),onClick:Je(M=>l.value.multiSelect?g(l.value.id,I.id):h(l.value.id,I.id),["prevent"])},[m("span",LK,O(P+1),1),m("span",OK,[l.value.multiSelect?(x(),$("span",PK,O(y(l.value.id,I.id)?"■":"□"),1)):(x(),$("span",RK,O(y(l.value.id,I.id)?"●":"○"),1))]),m("span",DK,[m("span",BK,O(I.label),1),I.description?(x(),$("span",FK,O(I.description),1)):ie("",!0)])],10,NK))),128)),l.value.allowOther?(x(),$("label",{key:0,class:Le(["qopt",{selected:b(l.value.id)}]),onClick:Je(()=>{},["prevent"])},[A[6]||(A[6]=m("span",{class:"qopt-key"},null,-1)),m("span",HK,[l.value.multiSelect?(x(),$("span",WK,O(b(l.value.id)?"■":"□"),1)):(x(),$("span",UK,O(b(l.value.id)?"●":"○"),1))]),m("span",jK,O(l.value.otherLabel??C(s)("question.otherDefault")),1),Lt(m("input",{"onUpdate:modelValue":A[1]||(A[1]=I=>S.value[l.value.id]=I),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:A[2]||(A[2]=I=>_(l.value.id)),onFocus:A[3]||(A[3]=I=>_(l.value.id))},null,40,qK),[[wn,S.value[l.value.id]]])],2)):ie("",!0)])])),r.value?ie("",!0):(x(),$("div",zK,[m("button",{class:"qbtn pri",disabled:!v(),onClick:w},O(C(s)("question.submit")),9,VK),m("button",{class:"qbtn",onClick:N},O(C(s)("question.dismiss")),1)]))],2))}}),GK=vt(KK,[["__scopeId","data-v-0ac38c4b"]]),YK={class:"ah"},XK={class:"akind"},ZK={class:"apath"},JK={key:0,class:"abadge"},QK={key:1,class:"aw"},eG=["title","aria-label"],tG={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},nG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},sG=["title"],oG={key:1,class:"diff"},iG={class:"dg"},rG={class:"dc"},lG={key:2,class:"body-shell"},aG={class:"shell-cmd"},cG={key:0,class:"shell-cwd"},uG={key:1,class:"shell-danger"},dG={key:3,class:"body-file"},fG={class:"file-bar"},hG={class:"file-lang"},pG={class:"file-content"},mG={class:"file-ln"},gG={class:"file-text"},vG={key:4,class:"body-chip"},yG={class:"chip-label"},kG={class:"chip-value"},bG={key:0,class:"chip-detail"},_G={key:5,class:"body-chip"},wG={key:0,class:"chip-label"},SG={class:"chip-value"},CG={key:6,class:"body-chip"},xG={class:"chip-label"},TG={class:"chip-value"},MG={key:0,class:"chip-detail"},AG={key:7,class:"body-chip"},EG={class:"chip-label"},$G={class:"chip-value"},IG={key:0,class:"chip-detail"},NG={key:8,class:"body-todo"},LG={class:"todo-glyph"},OG={key:9,class:"body-plan"},PG={key:10,class:"body-generic"},RG={class:"gen-text"},DG={key:11,class:"feedback-wrap"},BG=["placeholder"],FG={class:"feedback-hint"},HG={key:12,class:"plan-actions"},WG=["title","onClick"],UG={class:"k"},jG={key:0,class:"k"},qG={key:0,class:"k"},zG={key:13,class:"abtn"},VG=Ze({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=F(()=>{const k=n.block;return k.kind!=="plan_review"?null:{plan:k.plan,path:k.path,options:k.options??[]}}),r=te(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const k=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${k}`)}const c=te(!1),u=te(""),d=te(null);function f(){c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0)}function p(){const k=u.value.trim();i.value?s("decide",{decision:"rejected",selectedLabel:"Revise",feedback:k||void 0}):s("decide",{decision:"rejected",feedback:k||void 0}),c.value=!1,u.value=""}function h(){c.value=!1,u.value=""}function g(k){k.key==="Enter"&&!k.shiftKey?(k.preventDefault(),p()):k.key==="Escape"&&(k.preventDefault(),h())}function S(){s("decide",{decision:"approved"})}function _(){s("decide",{decision:"approved",scope:"session"})}function y(){s("decide",{decision:"rejected"})}function b(){s("decide",{decision:"approved"})}function v(k){s("decide",{decision:"approved",selectedLabel:k})}function w(){f()}function N(){s("decide",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(k){const A=(document.activeElement?.tagName??"").toLowerCase();if(A==="input"||A==="textarea"||r.value)return;const I=i.value;if(I){if(I.options.length===0){k.key==="1"?(k.preventDefault(),b()):k.key==="2"?(k.preventDefault(),w()):k.key==="3"&&(k.preventDefault(),N());return}k.key==="1"&&I.options[0]?(k.preventDefault(),v(I.options[0].label)):k.key==="2"&&I.options[1]?(k.preventDefault(),v(I.options[1].label)):k.key==="3"&&I.options[2]&&(k.preventDefault(),v(I.options[2].label));return}k.key==="1"?(k.preventDefault(),S()):k.key==="2"?(k.preventDefault(),_()):k.key==="3"?(k.preventDefault(),y()):k.key==="4"&&(k.preventDefault(),f())}return Zt(()=>document.addEventListener("keydown",E)),Ft(()=>document.removeEventListener("keydown",E)),(k,A)=>(x(),$("div",{class:Le(["appr",{minimized:r.value}])},[m("div",YK,[m("span",XK,O(a()),1),m("span",ZK,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),$(Pe,{key:0},[dt(O(e.block.path),1)],64)):e.block.kind==="shell"?(x(),$(Pe,{key:1},[dt(O(e.block.command),1)],64)):e.block.kind==="url"?(x(),$(Pe,{key:2},[dt(O(e.block.url),1)],64)):e.block.kind==="search"?(x(),$(Pe,{key:3},[dt(O(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),$(Pe,{key:4},[dt(O(e.block.name),1)],64)):e.block.kind==="generic"?(x(),$(Pe,{key:5},[dt(O(e.block.summary),1)],64)):ie("",!0)]),e.agentName&&!r.value?(x(),$("span",JK,O(C(o)("approval.subagentBadge",{name:e.agentName})),1)):ie("",!0),r.value?ie("",!0):(x(),$("span",QK,O(C(o)("approval.required")),1)),m("button",{class:"amin",title:r.value?C(o)("question.expand"):C(o)("question.minimize"),"aria-label":r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:A[0]||(A[0]=I=>r.value=!r.value)},[r.value?(x(),$("svg",tG,[...A[2]||(A[2]=[m("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(x(),$("svg",nG,[...A[3]||(A[3]=[m("path",{d:"M3 8h10"},null,-1)])]))],8,eG)]),r.value?ie("",!0):(x(),$(Pe,{key:0},[e.block.kind==="plan_review"&&e.block.path?(x(),$("div",{key:0,class:"ah-path",title:e.block.path},O(e.block.path),9,sG)):ie("",!0),e.block.kind==="diff"?(x(),$("div",oG,[(x(!0),$(Pe,null,Xe(e.block.diff,(I,P)=>(x(),$("div",{key:P,class:Le(["dl",I.kind==="add"?"add":I.kind==="rem"?"del":""])},[m("span",iG,O(I.gutter),1),m("span",rG,O(I.text),1)],2))),128))])):e.block.kind==="shell"?(x(),$("div",lG,[m("div",aG,[A[4]||(A[4]=m("span",{class:"shell-dollar"},"$",-1)),dt(" "+O(e.block.command),1)]),e.block.cwd?(x(),$("div",cG,"cwd: "+O(e.block.cwd),1)):ie("",!0),e.block.danger?(x(),$("div",uG,O(C(o)("approval.danger",{detail:e.block.danger})),1)):ie("",!0)])):e.block.kind==="file"?(x(),$("div",dG,[m("div",fG,[m("span",hG,O(e.block.language??""),1)]),m("div",pG,[(x(!0),$(Pe,null,Xe(e.block.content.split(`
248
+ `),(I,P)=>(x(),$("div",{key:P,class:"file-line"},[m("span",mG,O(P+1),1),m("span",gG,O(I),1)]))),128))])])):e.block.kind==="fileop"?(x(),$("div",vG,[m("span",yG,O(e.block.op),1),m("span",kG,O(e.block.path),1),e.block.detail?(x(),$("span",bG,O(e.block.detail),1)):ie("",!0)])):e.block.kind==="url"?(x(),$("div",_G,[e.block.method?(x(),$("span",wG,O(e.block.method),1)):ie("",!0),m("span",SG,O(e.block.url),1)])):e.block.kind==="search"?(x(),$("div",CG,[m("span",xG,O(C(o)("approval.searchQueryLabel")),1),m("span",TG,O(e.block.query),1),e.block.scope?(x(),$("span",MG,O(C(o)("approval.searchScope",{scope:e.block.scope})),1)):ie("",!0)])):e.block.kind==="invocation"?(x(),$("div",AG,[m("span",EG,O(e.block.kind2),1),m("span",$G,O(e.block.name),1),e.block.description?(x(),$("span",IG,O(e.block.description),1)):ie("",!0)])):e.block.kind==="todo"?(x(),$("div",NG,[(x(!0),$(Pe,null,Xe(e.block.items,(I,P)=>(x(),$("div",{key:P,class:"todo-item"},[m("span",LG,O(I.status==="done"||I.status==="completed"?"✓":"○"),1),m("span",{class:Le(["todo-title",{"todo-done":I.status==="done"||I.status==="completed"}])},O(I.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),$("div",OG,[gt(nu,{text:e.block.plan},null,8,["text"])])):(x(),$("div",PG,[m("span",RG,O(e.block.summary),1)])),c.value?(x(),$("div",DG,[Lt(m("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":A[1]||(A[1]=I=>u.value=I),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:g},null,40,BG),[[wn,u.value]]),m("div",FG,O(C(o)("approval.feedbackHint")),1)])):ie("",!0),i.value?(x(),$("div",HG,[i.value.options.length>0?(x(!0),$(Pe,{key:0},Xe(i.value.options,(I,P)=>(x(),$("div",{key:P,class:"kbtn pri",title:I.description,onClick:M=>v(I.label)},[dt(O(I.label),1),m("span",UG,"["+O(P+1)+"]",1)],8,WG))),128)):(x(),$("div",{key:1,class:"kbtn pri",onClick:b},[dt(O(C(o)("approval.approvePlan")),1),A[5]||(A[5]=m("span",{class:"k"},"[1]",-1))])),m("div",{class:"kbtn",onClick:w},[dt(O(C(o)("approval.revise")),1),i.value.options.length===0?(x(),$("span",jG,"[2]")):ie("",!0)]),m("div",{class:"kbtn danger",onClick:N},[dt(O(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),$("span",qG,"[3]")):ie("",!0)])])):(x(),$("div",zG,[m("div",{class:"kbtn pri",onClick:S},[dt(O(C(o)("approval.approve")),1),A[6]||(A[6]=m("span",{class:"k"},"[1]",-1))]),m("div",{class:"kbtn",onClick:_},[dt(O(C(o)("approval.approveSession")),1),A[7]||(A[7]=m("span",{class:"k"},"[2]",-1))]),m("div",{class:"kbtn",onClick:y},[dt(O(C(o)("approval.reject")),1),A[8]||(A[8]=m("span",{class:"k"},"[3]",-1))]),m("div",{class:"kbtn",onClick:f},[dt(O(C(o)("approval.feedback")),1),A[9]||(A[9]=m("span",{class:"k"},"[4]",-1))])]))],64))],2))}}),KG=vt(VG,[["__scopeId","data-v-341cf3fd"]]),GG={class:"taskspane"},YG={class:"tp-head"},XG={class:"tp-title"},ZG={class:"tp-count"},JG={class:"tp-list"},QG={key:0,class:"tp-empty"},eY=["role","onClick"],tY={class:"tp-name"},nY={class:"tp-kind"},sY={class:"tp-time"},oY=["onClick"],iY={key:0,class:"tp-detail"},rY={key:0,class:"tp-codebox"},lY=["onClick"],aY={class:"tp-pre"},cY={class:"tp-cmd"},uY={key:1,class:"tp-codebox"},dY=["onClick"],fY={class:"tp-pre"},hY=Ze({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:s}=_t(),o=to(new Set),i=to(new Set),r=to(new Set);function l(h){return!!(h.output&&h.output.length>0||h.meta)}function a(h){l(h)&&(o.has(h.id)?o.delete(h.id):o.add(h.id))}function c(h){switch(h){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(h){switch(h){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(h,g,S){await ks(h)&&(S.add(g),setTimeout(()=>S.delete(g),1500))}async function f(h){h.meta&&await d(h.meta,h.id,i)}async function p(h){const g=h.output?.join(`
249
+ `)??"";g&&await d(g,h.id,r)}return(h,g)=>(x(),$("div",GG,[m("div",YG,[m("span",XG,O(C(s)("tasks.tag")),1),m("span",ZG,O(e.tasks.length),1)]),m("div",JG,[e.tasks.length===0?(x(),$("div",QG,O(C(s)("tasks.emptyTasks")),1)):(x(!0),$(Pe,{key:1},Xe(e.tasks,S=>(x(),$("div",{key:S.id,class:Le(["tp-row",{done:S.state==="done",fail:S.state==="fail",expandable:l(S)}])},[m("div",{class:"tp-main",role:l(S)?"button":void 0,onClick:_=>a(S)},[m("span",{class:Le(["tp-glyph",u(S.state)])},O(c(S.state)),3),m("span",tY,O(S.name),1),m("span",nY,O(S.kind),1),m("span",sY,O(S.timing),1),S.state==="run"?(x(),$("button",{key:0,class:"tp-stop",onClick:Je(_=>n("cancel",S.id),["stop"])},O(C(s)("tasks.stop")),9,oY)):ie("",!0),l(S)?(x(),$("svg",{key:1,class:Le(["tp-chevron",{open:o.has(S.id)}]),viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...g[0]||(g[0]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):ie("",!0)],8,eY),o.has(S.id)&&l(S)?(x(),$("div",iY,[S.meta?(x(),$("div",rY,[m("button",{class:Le(["tp-copy",{copied:i.has(S.id)}]),onClick:Je(_=>f(S),["stop"])},O(i.has(S.id)?"已复制":"复制"),11,lY),m("pre",aY,[m("code",null,[m("span",cY,O(S.meta),1)])])])):ie("",!0),S.output&&S.output.length>0?(x(),$("div",uY,[m("button",{class:Le(["tp-copy",{copied:r.has(S.id)}]),onClick:Je(_=>p(S),["stop"])},O(r.has(S.id)?"已复制":"复制"),11,dY),m("pre",fY,[m("code",null,[g[1]||(g[1]=dt(`
250
+ `,-1)),(x(!0),$(Pe,null,Xe(S.output,(_,y)=>(x(),$("span",{key:y,class:"tp-line"},O(_),1))),128)),g[2]||(g[2]=dt(`
251
+ `,-1))])])])):ie("",!0)])):ie("",!0)],2))),128))])]))}}),Zw=vt(hY,[["__scopeId","data-v-bdbdc201"]]),pY={class:"tc-title"},mY={key:0,class:"tc-count"},gY={key:0,class:"tc-list"},vY={key:0,class:"tc-empty"},yY={class:"tc-name"},kY=Ze({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=_t(),s=te(!1),o=F(()=>!t.inline),i=F(()=>t.inline||!s.value);function r(){o.value&&(s.value=!s.value)}const l=F(()=>t.todos.filter(c=>c.status==="done").length);function a(c){return c==="done"?"done":c==="in_progress"?"in_progress":"pending"}return(c,u)=>(x(),$("div",{class:Le(["todo-card",{"tab-mode":e.inline}])},[(x(),je(vs(o.value?"button":"div"),{class:Le(["tc-head",{static:!o.value}]),type:o.value?"button":void 0,onClick:r},{default:In(()=>[u[1]||(u[1]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[m("polyline",{points:"2,4.5 3.5,6 5.5,3"}),m("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),m("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),m("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),m("span",pY,O(C(n)("tasks.todoTag")),1),e.todos.length>0?(x(),$("span",mY,O(l.value)+"/"+O(e.todos.length),1)):ie("",!0),o.value&&e.todos.length>0?(x(),$("svg",{key:1,class:Le(["tc-chev",{open:!s.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...u[0]||(u[0]=[m("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):ie("",!0)]),_:1},8,["class","type"])),i.value?(x(),$("div",gY,[e.todos.length===0?(x(),$("div",vY,O(C(n)("tasks.emptyTodo")),1)):ie("",!0),(x(!0),$(Pe,null,Xe(e.todos,(d,f)=>(x(),$("div",{key:f,class:Le(["tc-row",`s-${d.status}`])},[m("span",{class:Le(["tc-glyph",`g-${a(d.status)}`])},null,2),m("span",yY,O(d.title),1)],2))),128))])):ie("",!0)],2))}}),bY=vt(kY,[["__scopeId","data-v-26afda08"]]),_Y={key:0,class:"queue-head"},wY={class:"queue-label"},SY=["title"],CY={class:"queue-list"},xY=["disabled","title","onClick"],TY={key:0,class:"queue-img",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},MY=["title","onClick"],AY=Ze({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:s}=_t();function o(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(x(),$("div",{class:Le(["queue-pane",{"tab-mode":e.inline}])},[e.inline?ie("",!0):(x(),$("div",_Y,[m("span",wY,O(C(s)("composer.queueLabel"))+" · "+O(e.queued.length),1),e.running?(x(),$("button",{key:0,class:"queue-steer",type:"button",title:C(s)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},O(C(s)("composer.steerNow")),9,SY)):ie("",!0)])),m("div",CY,[(x(!0),$(Pe,null,Xe(e.queued,(l,a)=>(x(),$("div",{key:a,class:"queue-item"},[m("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?C(s)("composer.queuedHasImage",{n:l.attachmentCount}):C(s)("composer.editQueued"),onClick:c=>o(a,l)},[l.attachmentCount>0?(x(),$("svg",TY,[...r[1]||(r[1]=[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),m("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),m("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):ie("",!0),m("span",{class:Le(["queue-text-inner",{placeholder:!l.text}])},O(l.text||C(s)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,xY),m("button",{class:"queue-rm",title:C(s)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[m("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,MY)]))),128))])],2))}}),EY=vt(AY,[["__scopeId","data-v-b5832f1f"]]),$Y={class:"dock-work-head"},IY={key:0,class:"dock-work-tab static"},NY={key:1,class:"dock-work-tab static"},LY={key:2,class:"dock-work-tab static"},OY={key:3,class:"dock-work-tab static"},PY=["title"],RY={class:"dock-work-body"},DY=["aria-pressed"],BY={class:"dw-count"},FY=["aria-pressed"],HY={class:"dw-count"},WY=["aria-pressed"],UY={class:"dw-count"},jY=["aria-pressed"],qY={class:"dw-count"},zY=Ze({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},pendingApproval:{},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=_t(),r=te(null),l=te(null),a=te(null);function c(f){r.value?.loadForEdit(f)}function u(f){const p=s.queued?.[f]?.text??"";p&&c(p),o("editQueued",f)}function d(f){if(!s.dockPanel)return;const p=f.target;p&&(l.value?.contains(p)||a.value?.contains(p)||o("close-dock-panel"))}return Ke(()=>s.dockPanel,f=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),f&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),Ft(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c}),(f,p)=>(x(),$("div",{class:Le(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:p[31]||(p[31]=Je(()=>{},["stop"]))},[gt(Oi,{name:"dock-panel"},{default:In(()=>[e.dockPanel?(x(),$("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:p[5]||(p[5]=Je(()=>{},["stop"]))},[m("div",$Y,[e.dockPanel==="bash"?(x(),$("span",IY,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),$("span",NY,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),$("span",LY,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):e.dockPanel==="queue"?(x(),$("span",OY,O(C(i)("tasks.dockQueue"))+" · "+O(e.queued?.length??0),1)):ie("",!0),e.dockPanel==="queue"&&e.running?(x(),$("button",{key:4,type:"button",class:"dock-queue-steer",title:C(i)("composer.steerTitle"),onClick:p[0]||(p[0]=h=>o("steer",{text:"",attachments:[]}))},O(C(i)("composer.steerNow")),9,PY)):ie("",!0)]),m("div",RY,[e.dockPanel==="bash"?(x(),je(Zw,{key:0,tasks:e.bashTasks,onCancel:p[1]||(p[1]=h=>o("cancelTask",h))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),je(Zw,{key:1,tasks:e.subagentTasks,onCancel:p[2]||(p[2]=h=>o("cancelTask",h))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),je(bY,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(x(),je(EY,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:p[3]||(p[3]=h=>o("steer",{text:"",attachments:[]})),onUnqueue:p[4]||(p[4]=h=>o("unqueue",h)),onEditQueued:u},null,8,["queued","running"]))])],512)):ie("",!0)]),_:1}),e.goal?(x(),je(yK,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:p[6]||(p[6]=h=>o("controlGoal",h))},null,8,["goal","force-expanded"])):ie("",!0),e.hasDockWork?(x(),$("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),$("button",{key:0,type:"button",class:Le(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:p[7]||(p[7]=h=>o("toggle-dock-panel","bash"))},[p[34]||(p[34]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("circle",{cx:"8",cy:"8",r:"5.5"}),m("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),m("span",null,O(C(i)("tasks.dockBash")),1),m("span",BY,[p[32]||(p[32]=dt("(",-1)),m("b",null,O(e.bashTasks.length),1),p[33]||(p[33]=dt(")",-1))])],10,DY)):ie("",!0),e.subagentTasks.length>0?(x(),$("button",{key:1,type:"button",class:Le(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:p[8]||(p[8]=h=>o("toggle-dock-panel","subagent"))},[p[37]||(p[37]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),m("span",null,O(C(i)("tasks.dockSubagent")),1),m("span",HY,[p[35]||(p[35]=dt("(",-1)),m("b",null,O(e.subagentTasks.length),1),p[36]||(p[36]=dt(")",-1))])],10,FY)):ie("",!0),(e.todos?.length??0)>0?(x(),$("button",{key:2,type:"button",class:Le(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:p[9]||(p[9]=h=>o("toggle-dock-panel","todos"))},[p[40]||(p[40]=yr('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-53db4e07><path d="M3 4.5l1.5 1.5L7 3.5" data-v-53db4e07></path><path d="M8.5 5h4" data-v-53db4e07></path><path d="M3 11l1.5 1.5L7 10" data-v-53db4e07></path><path d="M8.5 11.5h4" data-v-53db4e07></path></svg>',1)),m("span",null,O(C(i)("tasks.dockTodos")),1),m("span",UY,[p[38]||(p[38]=dt("(",-1)),m("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),p[39]||(p[39]=dt(")",-1))])],10,WY)):ie("",!0),(e.queued?.length??0)>0?(x(),$("button",{key:3,type:"button",class:Le(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:p[10]||(p[10]=h=>o("toggle-dock-panel","queue"))},[p[43]||(p[43]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("path",{d:"M2 4l6 4 6-4"}),m("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),m("span",null,O(C(i)("tasks.dockQueue")),1),m("span",qY,[p[41]||(p[41]=dt("(",-1)),m("b",null,O(e.queued?.length??0),1),p[42]||(p[42]=dt(")",-1))])],10,jY)):ie("",!0)],512)):ie("",!0),e.pendingQuestion?(x(),je(GK,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:p[11]||(p[11]=(h,g)=>o("answer",h,g)),onDismiss:p[12]||(p[12]=h=>o("dismiss",h))},null,8,["question"])):e.pendingApproval?(x(),je(KG,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:p[13]||(p[13]=h=>o("approval",e.pendingApproval.approvalId,h))},null,8,["block","agent-name"])):(x(),je(TM,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:p[14]||(p[14]=h=>o("submit",h)),onSteer:p[15]||(p[15]=h=>o("steer",h)),onCommand:p[16]||(p[16]=h=>o("command",h)),onInterrupt:p[17]||(p[17]=h=>o("interrupt")),onSetPermission:p[18]||(p[18]=h=>o("setPermission",h)),onSetThinking:p[19]||(p[19]=h=>o("setThinking",h)),onTogglePlan:p[20]||(p[20]=h=>o("togglePlan")),onToggleSwarm:p[21]||(p[21]=h=>o("toggleSwarm")),onToggleGoal:p[22]||(p[22]=h=>o("toggleGoal")),onOpenBtw:p[23]||(p[23]=h=>o("openBtw")),onCreateGoal:p[24]||(p[24]=h=>o("createGoal",h)),onControlGoal:p[25]||(p[25]=h=>o("controlGoal",h)),onFocusGoal:p[26]||(p[26]=h=>o("focusGoal")),onFocusSwarm:p[27]||(p[27]=h=>o("focusSwarm")),onCompact:p[28]||(p[28]=h=>o("compact")),onPickModel:p[29]||(p[29]=h=>o("pickModel")),onSelectModel:p[30]||(p[30]=h=>o("selectModel",h))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),VY=vt(zY,[["__scopeId","data-v-53db4e07"]]),KY=["aria-label"],GY={class:"toc-track"},YY=["aria-label","onMouseenter","onClick"],XY={class:"toc-no"},ZY=Ze({__name:"ConversationToc",props:{items:{},metrics:{},activeTurnId:{},viewport:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=F(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1),r=te({visible:!1,text:"",top:0});function l(c,u){const d=u.currentTarget;d&&(r.value={visible:!0,text:c,top:d.offsetTop})}function a(){r.value.visible=!1}return(c,u)=>i.value?(x(),$("nav",{key:0,class:"conversation-toc","aria-label":C(o)("conversation.toc")},[m("div",GY,[(x(!0),$(Pe,null,Xe(e.items,(d,f)=>(x(),$("button",{key:d.id,type:"button",class:Le(["toc-bubble",[d.role,{active:e.activeTurnId===d.id}]]),style:Bt({height:e.metrics[f]?.height+"px"}),"aria-label":`#${d.no} ${d.title}`,onMouseenter:p=>l(d.title,p),onMouseleave:a,onClick:p=>s("select",d.id)},[m("span",XY,O(d.no),1)],46,YY))),128)),e.viewport?(x(),$("div",{key:0,class:"toc-viewport",style:Bt({top:e.viewport.top+"px",height:e.viewport.height+"px"})},null,4)):ie("",!0)]),gt(Oi,{name:"toc-tip"},{default:In(()=>[Lt(m("div",{class:"toc-tooltip",style:Bt({top:r.value.top+"px"})},O(r.value.text),5),[[Bo,r.value.visible]])]),_:1})],8,KY)):ie("",!0)}}),JY=vt(ZY,[["__scopeId","data-v-dc54da9a"]]),QY=5;function eX(e,t,n,s=QY){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 tX={class:"chat-layout"},nX={class:"empty-hint"},sX={class:"empty-hint-title"},oX={class:"empty-hint-text"},iX={key:0,class:"ws-pick"},rX=["title"],lX={class:"ws-pick-name"},aX={key:1,class:"ws-pick-menu"},cX=["onClick"],uX={class:"ws-pick-item-name"},dX={class:"ws-pick-item-path"},fX={key:0,class:"swarm-stack"},hX=["aria-label"],pX={key:0,class:"abort-toast",role:"status","aria-live":"polite"},mX={class:"abort-toast-text"},kd=10,gX=56,vX=420,Jw=80,yX=1e3,kX=3e3,bX=Ze({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},modern:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},betaToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=te(!1),r=te(!1),l=F(()=>s.workspaces?.find(ge=>ge.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=F(()=>(s.workspaces?.length??0)>0),c=F(()=>eX(s.workspaces??[],s.activeWorkspaceId,r.value)),u=F(()=>(s.workspaces?.length??0)-c.value.length);Ke(i,Oe=>{Oe||(r.value=!1)});const d=F(()=>s.swarms?.filter(Oe=>Oe.members.some(ge=>ge.phase!=="completed"&&ge.phase!=="failed"))??[]);function f(Oe){i.value=!1,Oe!==s.activeWorkspaceId&&o("selectWorkspace",Oe)}const{t:p}=_t();Kc(At.contentAlign);const h=te(null),g=te(null),S=te(null),_=te(!1),y=te(0);let b=null;function v(Oe){(S.value??g.value)?.loadForEdit(Oe)}function w(){_.value=!0,b!==null&&clearTimeout(b),b=setTimeout(()=>{b=null,_.value=!1},2e3)}function N(){y.value++}function E(){mt(()=>{$e.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const k=F(()=>s.mobile===!0||s.modern===!0),A=F(()=>s.tasks.filter(Oe=>Oe.kind!=="subagent")),I=F(()=>s.tasks.filter(Oe=>Oe.kind==="subagent")),P=F(()=>A.value.filter(Oe=>Oe.state==="run").length),M=F(()=>I.value.filter(Oe=>Oe.state==="run").length),L=F(()=>(s.todos??[]).filter(Oe=>Oe.status==="done").length),R=F(()=>s.tasks.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),B=te(null),U=F(()=>s.gitInfo?s.changes?.length??0:0);function K(Oe){B.value=B.value===Oe?null:Oe}function V(){B.value=null}Ke(R,Oe=>{Oe||V()});function se(Oe){if(Oe.role==="compaction")return p("conversation.compactedPlain");if(Oe.role==="user"){if(Oe.skillActivation)return`/${Oe.skillActivation.name}`;const He=Oe.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const ge=(Oe.text||Oe.thinking||"").trim().replaceAll(/\s+/g," ");return ge.length>0?ge:(Oe.tools?.length??0)>0?`${Oe.tools.length} tools`:"kimi"}const Y=F(()=>s.turns.map((Oe,ge)=>({id:Oe.id,role:Oe.role,no:Oe.no||ge+1,title:se(Oe)})));function G(Oe){return Oe.role==="compaction"?20:Oe.role==="user"?(Oe.text?.length??0)+(Oe.skillActivation?20:0):(Oe.text?.length??0)+(Oe.thinking?.length??0)+(Oe.tools?.reduce((ge,He)=>ge+He.name.length+(He.arg?.length??0)+(He.output?.join("").length??0),0)??0)}const ee=F(()=>{const Oe=Y.value,ge=Oe.map(jt=>{const Kt=s.turns.find(It=>It.id===jt.id);return Kt?G(Kt):kd}),He=ge.reduce((jt,Kt)=>jt+Kt,0)||Oe.length*kd;return Oe.map((jt,Kt)=>{const It=ge[Kt]??kd,Ot=He>0?It/He:0,fo=Math.max(kd,Math.min(gX,Ot*vX));return{id:jt.id,height:Math.round(fo)}})}),Se=F(()=>ee.value.reduce((Oe,ge)=>Oe+ge.height,0)+(Y.value.length-1)*4),ae=te(null),Ie=te(null);function de(){const Oe=$e.value;if(!Oe)return;const ge=Oe.querySelectorAll(".turn-anchor[data-turn-id]");if(ge.length===0)return;const He=Oe.getBoundingClientRect(),jt=He.height/2;let Kt=null,It=1/0;ge.forEach(Bi=>{const qo=Bi.getBoundingClientRect(),Zn=qo.top-He.top,Fi=Math.abs(Zn+qo.height/2-jt);Fi<It&&(It=Fi,Kt=Bi.dataset.turnId??null)}),ae.value=Kt;const Ot=Oe.scrollHeight-Oe.clientHeight,fo=Ot>0?Oe.scrollTop/Ot:0,ho=Se.value,Di=fo*ho,jo=Oe.scrollHeight>0?Oe.clientHeight/Oe.scrollHeight*ho:ho;Ie.value={top:Math.max(0,Di),height:Math.max(8,Math.min(jo,ho-Di))}}const we=F(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),me=F(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),$e=te(null),J=te(null),ye=te(0),_e=te(0),W=F(()=>({"--panes-scrollbar-width":`${ye.value}px`}));function Z(Oe){return Oe instanceof HTMLElement?Oe:Oe&&"$el"in Oe&&Oe.$el instanceof HTMLElement?Oe.$el:null}function fe(){const Oe=$e.value;ye.value=Oe?Math.max(0,Oe.offsetWidth-Oe.clientWidth):0,_e.value=J.value?.offsetHeight??0}function oe(Oe){const ge=Z(Oe);$e.value=ge,ge&&qe()}function he(Oe){const ge=Z(Oe);J.value=ge??null,Oe&&"loadForEdit"in Oe&&typeof Oe.loadForEdit=="function"?S.value={loadForEdit:Oe.loadForEdit.bind(Oe)}:S.value=null,Ue()}const H=te(!0),X=te(!1);function ce(){const Oe=$e.value;return Oe?Oe.scrollHeight-Oe.scrollTop-Oe.clientHeight:0}let ke=0,Me=0,Ne=0,re=0,le=0;function Ce(){return Date.now()<Me}function We(){const Oe=$e.value;if(!Oe)return;const ge=Oe.scrollTop;if(performance.now()-Ne<100){ke=ge;return}const He=ce();if(Ce()){H.value=!0,X.value=!1,ke=ge;return}ge<ke-1&&He>1?H.value=!1:He<=Jw&&ge>ke+1&&(H.value=!0,X.value=!1),ke=ge,de()}function nt(Oe=!1){const ge=$e.value;ge&&(Oe&&typeof ge.scrollTo=="function"?(Ne=performance.now(),ge.scrollTo({top:ge.scrollHeight,behavior:"smooth"})):ge.scrollTop=ge.scrollHeight,ke=ge.scrollTop,H.value=!0,X.value=!1)}function lt(Oe,ge){const He=Oe.querySelectorAll(".turn-anchor");for(const jt of He)if(jt.offsetTop>=ge){const Kt=jt.dataset.turnId;if(Kt)return{id:Kt,top:jt.offsetTop}}return null}async function kt(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Oe=s.sessionId,ge=$e.value,He=ge?.scrollTop??0,jt=ge?.scrollHeight??0,Kt=ge?lt(ge,He):null;Dn.value=!0;try{await s.loadOlderMessages(Oe),await mt()}finally{Dn.value=!1}if(s.sessionId!==Oe)return;const It=$e.value;if(!It)return;let Ot=0;if(Kt){const fo=It.querySelector(`.turn-anchor[data-turn-id="${Ct(Kt.id)}"]`);fo&&(Ot=fo.offsetTop-Kt.top)}Ot===0&&(Ot=It.scrollHeight-jt),It.scrollTop=He+Ot}function Ct(Oe){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Oe):Oe.replaceAll(/["\\]/g,"\\$&")}function ut(Oe){const ge=$e.value;if(!ge)return;const He=ge.querySelector(`.turn-anchor[data-turn-id="${Ct(Oe)}"]`);He&&(H.value=!1,X.value=ce()>Jw,He.scrollIntoView({behavior:"smooth",block:"center"}))}function Et(){const Oe=$e.value;if(!Oe)return"none";const ge=Oe.firstElementChild,He=ge instanceof HTMLElement?ge.offsetHeight:0,jt=J.value?.offsetHeight??0;return`${Oe.scrollHeight}:${Oe.clientHeight}:${He}:${jt}`}function on(Oe){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Oe):setTimeout(Oe,16)}function Tn(Oe){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Oe):clearTimeout(Oe)}function $t(Oe=36){if(!H.value&&!Ce())return;const ge=++le;let He="",jt=0,Kt=0;re&&(Tn(re),re=0);const It=()=>{if(re=0,ge!==le||!H.value&&!Ce())return;nt(!1);const Ot=Et();jt=Ot===He?jt+1:0,He=Ot,Kt++,jt<3&&Kt<Oe&&(re=on(It))};re=on(It)}function On(Oe,ge){return Oe!==void 0&&Oe.length>0&&ge.length>=Oe.length&&Oe.firstId!==ge.firstId&&Oe.lastId===ge.lastId&&Oe.lastTextLen===ge.lastTextLen&&Oe.lastThinkingLen===ge.lastThinkingLen&&Oe.lastToolsLen===ge.lastToolsLen&&Oe.approvalIds===ge.approvalIds}const un=F(()=>{const Oe=(s.approvals??[]).map(It=>It.approvalId).join(","),ge=s.turns,He=ge.at(-1),jt=He?.thinking?.length??0,Kt=He?.tools?.reduce((It,Ot)=>It+Ot.name.length+(Ot.arg?.length??0)+(Ot.output?.join("").length??0),0)??0;return{length:ge.length,firstId:ge[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:jt,lastToolsLen:Kt,approvalIds:Oe}});Ke(un,async(Oe,ge)=>{if(Dn.value&&On(ge,Oe)){de();return}await mt(),H.value||Ce()?nt(!1):X.value=!0,de()}),Ke(J,()=>{Ue()}),Ke(()=>s.mobile,async()=>{await mt(),fe()}),Ke(()=>s.fileReloadKey,async()=>{H.value=!0,ke=0,await mt(),$t(),de()}),Ke(()=>s.sessionLoading,async(Oe,ge)=>{Oe||!ge||(H.value=!0,await mt(),$t(),de())}),Ke(()=>s.running,async(Oe,ge)=>{Oe||!ge||!H.value&&!Ce()||(await mt(),$t(48),de())});function tt(){H.value=!0,X.value=!1,Me=Date.now()+yX,mt(()=>{nt(!1),$t(16)})}function Vn(Oe){tt(),o("submit",Oe)}function Lo(Oe,ge){tt(),o("answer",Oe,ge)}function _s(Oe,ge){!Oe||!ge||o("approval",Oe,ge)}let Pn=null,rn=null,yn=null,Rn=null,Mn=0,ds=!1;const Dn=te(!1);function ns(Oe){if(Dn.value||(ds=ds||Oe,Mn))return;Mn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:He=>setTimeout(He,16))(()=>{Mn=0;const He=ds;ds=!1,H.value||Ce()?nt(!1):He&&(X.value=!0)})}function Ge(){if(!rn)return;const Oe=$e.value?.firstElementChild??null;Oe!==yn&&(yn&&rn.unobserve(yn),yn=Oe,Oe&&rn.observe(Oe))}function Ue(){if(!rn)return;const Oe=J.value;Oe!==Rn&&(Rn&&rn.unobserve(Rn),Rn=Oe,Oe&&rn.observe(Oe))}function qe(){const Oe=$e.value;fe(),Pn&&(Pn.disconnect(),Oe&&Pn.observe(Oe,{childList:!0,subtree:!0,characterData:!0})),rn&&(rn.disconnect(),yn=null,Rn=null,Oe&&rn.observe(Oe),Ge(),Ue())}function wt(){Ge(),ns(!0)}function Qt(){typeof document>"u"||document.visibilityState==="visible"&&H.value&&$t()}const Ns=te(!1);let zs=null;function Ar(){Ns.value=!0,zs!==null&&clearTimeout(zs),zs=setTimeout(()=>{Ns.value=!1},kX)}function ws(){Ar(),o("interrupt")}function ai(Oe){Oe.key==="Escape"&&(s.running||s.sending)&&(Oe.preventDefault(),ws())}return Zt(()=>{mt(()=>{typeof MutationObserver=="function"&&(Pn=new MutationObserver(wt)),typeof ResizeObserver=="function"&&(rn=new ResizeObserver(()=>{fe(),ns(!1)})),qe(),$t(48),de(),typeof document<"u"&&(document.addEventListener("visibilitychange",Qt),document.addEventListener("keydown",ai))})}),Ft(()=>{Pn&&Pn.disconnect(),rn&&rn.disconnect(),Mn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Mn),re&&Tn(re),zs!==null&&clearTimeout(zs),b!==null&&(clearTimeout(b),b=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Qt),document.removeEventListener("keydown",ai))}),t({loadComposerForEdit:v}),(Oe,ge)=>(x(),$("section",{class:Le(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),je(fz,{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":U.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:_.value,onOpenChanges:ge[0]||(ge[0]=He=>o("openChanges")),onCopyAll:ge[1]||(ge[1]=He=>h.value?.copyConversation()),onCopyFinalSummary:ge[2]||(ge[2]=He=>h.value?.copyFinalSummary()),onOpenPr:ge[3]||(ge[3]=He=>e.pr&&o("openPr",e.pr.url)),onRenameSession:ge[4]||(ge[4]=(He,jt)=>o("renameSession",He,jt)),onForkSession:ge[5]||(ge[5]=He=>o("forkSession",He)),onArchiveSession:ge[6]||(ge[6]=He=>o("archiveSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ie("",!0),e.betaToc?(x(),je(JY,{key:1,items:Y.value,metrics:ee.value,"active-turn-id":ae.value,viewport:Ie.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:ut},null,8,["items","metrics","active-turn-id","viewport","mobile","session-loading"])):ie("",!0),m("div",tX,[m("div",{ref:oe,class:"panes chat-scroll",onScrollPassive:We},[m("div",{class:Le(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),$(Pe,{key:0},[ge[59]||(ge[59]=m("div",{class:"empty-spacer"},null,-1)),m("div",nX,[m("span",sX,O(C(p)("composer.emptyConversationTitle")),1),m("span",oX,O(C(p)("composer.emptyConversation")),1),a.value?(x(),$("div",iX,[m("button",{type:"button",class:"ws-pick-btn",title:C(p)("conversation.switchWorkspace"),onClick:ge[7]||(ge[7]=Je(He=>i.value=!i.value,["stop"]))},[ge[55]||(ge[55]=m("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"})],-1)),m("span",lX,O(l.value),1),(x(),$("svg",{class:Le(["ws-pick-chev",{open:i.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ge[54]||(ge[54]=[m("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,rX),i.value?(x(),$("div",{key:0,class:"ws-pick-backdrop",onClick:ge[8]||(ge[8]=He=>i.value=!1)})):ie("",!0),i.value?(x(),$("div",aX,[(x(!0),$(Pe,null,Xe(c.value,He=>(x(),$("button",{key:He.id,type:"button",class:Le(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:Je(jt=>f(He.id),["stop"])},[m("span",uX,O(He.name),1),m("span",dX,O(He.shortPath),1)],10,cX))),128)),u.value>0?(x(),$("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:ge[9]||(ge[9]=Je(He=>r.value=!r.value,["stop"]))},[m("span",null,O(C(p)("conversation.moreWorkspaces",{count:u.value})),1)])):ie("",!0),ge[57]||(ge[57]=m("div",{class:"ws-pick-divider"},null,-1)),m("button",{type:"button",class:"ws-pick-action",onClick:ge[10]||(ge[10]=Je(He=>{i.value=!1,o("addWorkspace")},["stop"]))},[ge[56]||(ge[56]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)),m("span",null,O(C(p)("conversation.addWorkspace")),1)])])):ie("",!0)])):(x(),$("button",{key:1,type:"button",class:"empty-add-workspace",onClick:ge[11]||(ge[11]=He=>o("addWorkspace"))},[ge[58]||(ge[58]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"}),m("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),m("span",null,O(C(p)("conversation.addWorkspace")),1)]))]),gt(TM,{ref_key:"emptyComposerRef",ref:g,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Vn,onSteer:ge[12]||(ge[12]=He=>o("steer",He)),onCommand:ge[13]||(ge[13]=He=>o("command",He)),onInterrupt:ws,onUnqueue:ge[14]||(ge[14]=He=>o("unqueue",He)),onEditQueued:ge[15]||(ge[15]=He=>o("editQueued",He)),onSetPermission:ge[16]||(ge[16]=He=>o("setPermission",He)),onSetThinking:ge[17]||(ge[17]=He=>o("setThinking",He)),onTogglePlan:ge[18]||(ge[18]=He=>o("togglePlan")),onToggleSwarm:ge[19]||(ge[19]=He=>o("toggleSwarm")),onToggleGoal:ge[20]||(ge[20]=He=>o("toggleGoal")),onOpenBtw:ge[21]||(ge[21]=He=>o("command","/btw")),onCreateGoal:ge[22]||(ge[22]=He=>o("createGoal",He)),onControlGoal:ge[23]||(ge[23]=He=>o("controlGoal",He)),onFocusGoal:N,onFocusSwarm:E,onCompact:ge[24]||(ge[24]=He=>o("compact")),onPickModel:ge[25]||(ge[25]=He=>o("pickModel")),onSelectModel:ge[26]||(ge[26]=He=>o("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),ge[60]||(ge[60]=m("div",{class:"empty-spacer"},null,-1))],64)):(x(),$(Pe,{key:1},[(x(),je(wM,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:k.value,mobile:e.mobile,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":H.value,"tool-diff-panel":!0,onOpenFile:ge[27]||(ge[27]=He=>o("openFile",He)),onOpenMedia:ge[28]||(ge[28]=He=>o("openMedia",He)),onCopyConversationCopied:w,onOpenThinking:ge[29]||(ge[29]=He=>o("openThinking",He)),onOpenCompaction:ge[30]||(ge[30]=He=>o("openCompaction",He)),onOpenAgent:ge[31]||(ge[31]=He=>o("openAgent",He)),onOpenToolDiff:ge[32]||(ge[32]=He=>o("openToolDiff",He)),onEditMessage:ge[33]||(ge[33]=He=>o("editMessage",He)),onLoadOlderMessages:kt},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following"])),d.value.length>0?(x(),$("div",fX,[(x(!0),$(Pe,null,Xe(d.value,He=>(x(),je(cK,{key:He.id,group:He},null,8,["group"]))),128))])):ie("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ie("",!0):(x(),je(VY,{key:0,ref:he,style:Bt(W.value),"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":y.value,"dock-panel":B.value,"bash-tasks":A.value,"subagent-tasks":I.value,"bash-running":P.value,"subagent-running":M.value,"todo-done-count":L.value,"has-dock-work":R.value,todos:e.todos,"pending-question":we.value,"pending-approval":me.value,mobile:e.mobile,onToggleDockPanel:ge[34]||(ge[34]=He=>K(He)),onCloseDockPanel:ge[35]||(ge[35]=He=>V()),onAnswer:Lo,onDismiss:ge[36]||(ge[36]=He=>o("dismiss",He)),onApproval:_s,onCancelTask:ge[37]||(ge[37]=He=>o("cancelTask",He)),onControlGoal:ge[38]||(ge[38]=He=>o("controlGoal",He)),onSubmit:Vn,onSteer:ge[39]||(ge[39]=He=>o("steer",He)),onCommand:ge[40]||(ge[40]=He=>o("command",He)),onInterrupt:ws,onUnqueue:ge[41]||(ge[41]=He=>o("unqueue",He)),onEditQueued:ge[42]||(ge[42]=He=>o("editQueued",He)),onSetPermission:ge[43]||(ge[43]=He=>o("setPermission",He)),onSetThinking:ge[44]||(ge[44]=He=>o("setThinking",He)),onTogglePlan:ge[45]||(ge[45]=He=>o("togglePlan")),onToggleSwarm:ge[46]||(ge[46]=He=>o("toggleSwarm")),onToggleGoal:ge[47]||(ge[47]=He=>o("toggleGoal")),onOpenBtw:ge[48]||(ge[48]=He=>o("command","/btw")),onCreateGoal:ge[49]||(ge[49]=He=>o("createGoal",He)),onFocusGoal:N,onFocusSwarm:E,onCompact:ge[50]||(ge[50]=He=>o("compact")),onPickModel:ge[51]||(ge[51]=He=>o("pickModel")),onSelectModel:ge[52]||(ge[52]=He=>o("selectModel",He))},null,8,["style","session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","pending-approval","mobile"]))]),gt(Oi,{name:"pill"},{default:In(()=>[X.value?(x(),$("button",{key:0,class:"newmsg-pill",style:Bt({bottom:`${_e.value+12}px`}),"aria-label":C(p)("conversation.jumpToLatestAria"),onClick:ge[53]||(ge[53]=He=>nt(!0))},[ge[61]||(ge[61]=m("svg",{class:"pill-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("polyline",{points:"4,6 8,10 12,6"})],-1)),dt(" "+O(C(p)("conversation.newMessages")),1)],12,hX)):ie("",!0)]),_:1}),gt(Oi,{name:"abort-toast"},{default:In(()=>[Ns.value?(x(),$("div",pX,[m("span",mX,O(C(p)("conversation.manuallyAborted")),1)])):ie("",!0)]),_:1})],2))}}),_X=vt(bX,[["__scopeId","data-v-8a13c4fa"]]),wX={key:0,class:"fp-empty fp-error"},SX={key:1,class:"fp-empty"},CX={key:2,class:"fp-loading"},xX={class:"fp-header"},TX={class:"fp-title"},MX=["title"],AX={class:"fp-meta"},EX={key:0,class:"fp-lines"},$X={class:"fp-size"},IX=["aria-label"],NX=["aria-label"],LX=["aria-label"],OX={key:3,class:"fp-search"},PX=["placeholder"],RX={key:0,class:"fp-search-count"},DX=["disabled","title"],BX=["disabled","title"],FX=["title"],HX={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},WX={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},UX=["title"],jX=["title"],qX=["href","title"],zX=["title"],VX={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},KX={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},GX=["title","aria-label"],YX={key:1,class:"fp-code"},XX={class:"fp-line-table"},ZX=["data-line"],JX={class:"fp-gutter"},QX=["innerHTML"],eZ={key:1,class:"fp-body fp-code"},tZ={class:"fp-line-table"},nZ=["data-line"],sZ={class:"fp-gutter"},oZ=["innerHTML"],iZ={key:2,class:"fp-body"},rZ=["srcdoc","title"],lZ={key:1,class:"fp-code"},aZ={class:"fp-line-table"},cZ=["data-line"],uZ={class:"fp-gutter"},dZ=["innerHTML"],fZ={key:3,class:"fp-body fp-pdf-wrap"},hZ=["src","title"],pZ={key:1,class:"fp-binary-card"},mZ={class:"fp-binary-label"},gZ={key:4,class:"fp-body fp-table-wrap"},vZ={class:"fp-table"},yZ=["data-line"],kZ={key:5,class:"fp-body fp-image-wrap"},bZ=["src","alt"],_Z={key:1,class:"fp-binary-card"},wZ={class:"fp-binary-label"},SZ={key:6,class:"fp-body fp-code"},CZ={class:"fp-line-table"},xZ=["data-line"],TZ={class:"fp-gutter"},MZ=["innerHTML"],AZ={key:7,class:"fp-body fp-binary-wrap"},EZ={class:"fp-binary-card"},$Z={class:"fp-binary-label"},IZ=Ze({__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}=_t();function s(de,we){const me=we?we.split("/").filter(Boolean):[];for(const $e of de.split("/"))$e===""||$e==="."||($e===".."?me.pop():me.push($e));return me.join("/")}const o=Rt("resolveImage",async de=>de),i=F(()=>{const de=c.file?.path??"",we=de.lastIndexOf("/");return we>0?de.slice(0,we):""});function r(de){if(/^(https?:|data:|blob:)/i.test(de)||de.startsWith("/"))return de;const we=i.value;return we?s(de,we):de}async function l(de){const we=r(de);return o?o(we):we}gn("resolveImage",l);function a(de){let we=de.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(we)||we.startsWith("/"))return de;for(const $e of["#","?"]){const J=we.indexOf($e);J!==-1&&(we=we.slice(0,J))}const me=i.value;return{...de,path:s(we,me)}}const c=e,u=t;function d(de){c.openFile?.(a(de))}const f=te(null),p=F(()=>{const de=c.file;if(!de)return"binary";const we=de.mime??"",me=de.languageId??"",$e=de.path.toLowerCase();return we==="text/markdown"||me==="markdown"||me==="md"||$e.endsWith(".mdx")?"markdown":we==="application/json"||me==="json"?"json":we==="text/html"||me==="html"||$e.endsWith(".html")||$e.endsWith(".htm")?"html":we==="application/pdf"||$e.endsWith(".pdf")?"pdf":we==="text/csv"||me==="csv"||$e.endsWith(".csv")?"csv":we.startsWith("image/")?"image":de.isBinary?"binary":we.startsWith("text/")||me!==""?"text":"binary"});function h(de){const we=atob(de),me=Uint8Array.from(we,$e=>$e.charCodeAt(0));return new TextDecoder().decode(me)}const g=F(()=>{const de=c.file;if(!de)return"";if(de.encoding==="base64")try{return h(de.content)}catch{return de.content}return de.content}),S=F(()=>{if(p.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),_=F(()=>c.file?(p.value==="json"?S.value:g.value).split(`
252
+ `):[]),y=F(()=>c.file?p.value==="json"?S.value:g.value:""),b=te(""),v=te(0),w=F(()=>{const de=b.value.trim().toLowerCase();if(!de)return[];const we=[];return _.value.forEach((me,$e)=>{me.toLowerCase().includes(de)&&we.push($e+1)}),we});Ke(b,()=>{v.value=0});function N(de,we=!1){de&&mt(()=>{const me=f.value?.querySelector(".fp-body"),$e=me?.querySelector(`[data-line="${de}"]`);if(!me||!$e)return;we&&(me.scrollTop=0);const J=me.getBoundingClientRect(),ye=$e.getBoundingClientRect(),_e=ye.top-J.top+me.scrollTop;me.scrollTop=_e-me.clientHeight/2+ye.height/2})}Ke(()=>[c.file?.path,c.line],()=>N(c.line,!0),{immediate:!0});function E(de){const we=w.value;we.length!==0&&(v.value=(v.value+de+we.length)%we.length,N(we[v.value]))}function k(de){const we=w.value;return{target:c.line===de,hit:we.includes(de),active:we[v.value]===de}}function A(de){return de<1024?`${de} B`:de<1024*1024?`${(de/1024).toFixed(1)} KB`:`${(de/(1024*1024)).toFixed(1)} MB`}const I=te(!1),P=te(!1);function M(){c.file&&ks(y.value).then(de=>{de&&(I.value=!0,setTimeout(()=>{I.value=!1},1400))})}function L(){c.file&&ks(c.file.path).then(de=>{de&&(P.value=!0,setTimeout(()=>{P.value=!1},1400))})}const R=te("preview"),B=te("preview"),U=te("fit");Ke(p,de=>{R.value=de==="html"?"preview":"source",B.value="preview",U.value="fit"});const K=F(()=>{const de=c.file;return!de||p.value!=="image"?null:de.sourceUrl?de.sourceUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:de.mime==="image/svg+xml"?`data:${de.mime};charset=utf-8,${encodeURIComponent(de.content)}`:null}),V=F(()=>{const de=c.file;return!de||p.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:de.encoding==="base64"?`data:${de.mime};base64,${de.content}`:null}),se=F(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,g.value].join(""):"");function Y(de){const we=[];let me="",$e=!1;for(let J=0;J<de.length;J++){const ye=de[J];ye==='"'&&de[J+1]==='"'?(me+='"',J++):ye==='"'?$e=!$e:ye===","&&!$e?(we.push(me),me=""):me+=ye}return we.push(me),we}const G=F(()=>_.value.slice(0,200).map(Y));function ee(de){return de.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function Se(){const de=c.file;if(!de)return"";const we=de.languageId?.toLowerCase();return we||(de.path.split(".").pop()?.toLowerCase()??"")}function ae(de){const we=Se();let me=ee(de);return p.value==="json"||we==="json"||we==="jsonc"?(me=me.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),me=me.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),me=me.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),me=me.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),me):p.value==="html"||we==="html"||we==="xml"||we==="svg"?(me=me.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),me=me.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),me=me.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),me):(me=me.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>'),me=me.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),me=me.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),me)}function Ie(de,we=55){return!de||de.length<=we?de:"…"+de.slice(de.length-we+1)}return(de,we)=>(x(),$("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),$("div",wX,[m("span",null,O(e.error),1),e.closable?(x(),$("button",{key:0,type:"button",class:"fp-action",onClick:we[0]||(we[0]=me=>u("close"))},O(C(n)("filePreview.close")),1)):ie("",!0)])):!e.file&&!e.loading?(x(),$("div",SX,O(C(n)("filePreview.empty")),1)):e.loading?(x(),$("div",CX,[we[13]||(we[13]=m("span",{class:"spinner"},null,-1)),m("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(x(),$(Pe,{key:3},[m("div",xX,[m("span",TX,O(C(n)("common.preview")),1),m("span",{class:"fp-path",title:e.file.path},O(Ie(e.file.path)),9,MX),m("span",AX,[e.file.lineCount?(x(),$("span",EX,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ie("",!0),m("span",$X,O(A(e.file.size)),1)]),p.value==="html"?(x(),$("div",{key:0,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.htmlMode")},[m("button",{type:"button",class:Le(["fp-seg-btn",{on:R.value==="preview"}]),onClick:we[1]||(we[1]=me=>R.value="preview")},O(C(n)("filePreview.preview")),3),m("button",{type:"button",class:Le(["fp-seg-btn",{on:R.value==="source"}]),onClick:we[2]||(we[2]=me=>R.value="source")},O(C(n)("filePreview.source")),3)],8,IX)):ie("",!0),p.value==="markdown"?(x(),$("div",{key:1,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.markdownMode")},[m("button",{type:"button",class:Le(["fp-seg-btn",{on:B.value==="preview"}]),onClick:we[3]||(we[3]=me=>B.value="preview")},O(C(n)("filePreview.preview")),3),m("button",{type:"button",class:Le(["fp-seg-btn",{on:B.value==="source"}]),onClick:we[4]||(we[4]=me=>B.value="source")},O(C(n)("filePreview.source")),3)],8,NX)):ie("",!0),p.value==="image"?(x(),$("div",{key:2,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.imageFit")},[m("button",{type:"button",class:Le(["fp-seg-btn",{on:U.value==="fit"}]),onClick:we[5]||(we[5]=me=>U.value="fit")},O(C(n)("filePreview.fit")),3),m("button",{type:"button",class:Le(["fp-seg-btn",{on:U.value==="actual"}]),onClick:we[6]||(we[6]=me=>U.value="actual")},O(C(n)("filePreview.actual")),3)],8,LX)):ie("",!0),p.value==="text"||p.value==="json"||p.value==="html"||p.value==="csv"?(x(),$("div",OX,[Lt(m("input",{"onUpdate:modelValue":we[7]||(we[7]=me=>b.value=me),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,PX),[[wn,b.value]]),b.value.trim()?(x(),$("span",RX,O(w.value.length),1)):ie("",!0),m("button",{type:"button",class:"fp-icon-btn",disabled:w.value.length===0,title:C(n)("filePreview.prevMatch"),onClick:we[8]||(we[8]=me=>E(-1))},"↑",8,DX),m("button",{type:"button",class:"fp-icon-btn",disabled:w.value.length===0,title:C(n)("filePreview.nextMatch"),onClick:we[9]||(we[9]=me=>E(1))},"↓",8,BX)])):ie("",!0),m("button",{type:"button",class:Le(["fp-action fp-act-icon",{copied:P.value}]),title:P.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:L},[P.value?(x(),$("svg",WX,[...we[15]||(we[15]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(x(),$("svg",HX,[...we[14]||(we[14]=[m("path",{d:"M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.2l-1 1"},null,-1),m("path",{d:"M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.2l1-1"},null,-1)])]))],10,FX),e.externalActions?(x(),$("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:C(n)("filePreview.openInEditor"),onClick:we[10]||(we[10]=me=>u("openExternal"))},[...we[16]||(we[16]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M12 8.7V12a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12V5.5A1.5 1.5 0 0 1 4 4h3.3"}),m("path",{d:"M9.5 2.5h4v4"}),m("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,UX)):ie("",!0),e.externalActions?(x(),$("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:C(n)("filePreview.reveal"),onClick:we[11]||(we[11]=me=>u("reveal"))},[...we[17]||(we[17]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M1.5 4.5A1.5 1.5 0 0 1 3 3h3l1.5 1.5H13A1.5 1.5 0 0 1 14.5 6v6A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12z"})],-1)])],8,jX)):ie("",!0),e.downloadUrl?(x(),$("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:C(n)("filePreview.download")},[...we[18]||(we[18]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 2v8"}),m("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),m("path",{d:"M2.5 13.5h11"})],-1)])],8,qX)):ie("",!0),!e.file.isBinary&&p.value!=="image"?(x(),$("button",{key:7,type:"button",class:Le(["fp-action fp-act-icon",{copied:I.value}]),title:I.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:M},[I.value?(x(),$("svg",KX,[...we[20]||(we[20]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(x(),$("svg",VX,[...we[19]||(we[19]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,zX)):ie("",!0),e.closable?(x(),$("button",{key:8,type:"button",class:"fp-close",title:C(n)("filePreview.close"),"aria-label":C(n)("filePreview.close"),onClick:we[12]||(we[12]=me=>u("close"))}," × ",8,GX)):ie("",!0)]),p.value==="markdown"?(x(),$("div",{key:0,class:Le(["fp-body",{"fp-markdown":B.value==="preview"}])},[B.value==="preview"?(x(),je(nu,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),$("div",YX,[m("div",XX,[(x(!0),$(Pe,null,Xe(_.value,(me,$e)=>(x(),$("div",{key:$e,class:Le(["fp-line-row",k($e+1)]),"data-line":$e+1},[m("span",JX,O($e+1),1),m("span",{class:"fp-line-text",innerHTML:ae(me)},null,8,QX)],10,ZX))),128))])]))],2)):p.value==="json"?(x(),$("div",eZ,[m("div",tZ,[(x(!0),$(Pe,null,Xe(_.value,(me,$e)=>(x(),$("div",{key:$e,class:Le(["fp-line-row",k($e+1)]),"data-line":$e+1},[m("span",sZ,O($e+1),1),m("span",{class:"fp-line-text",innerHTML:ae(me)},null,8,oZ)],10,nZ))),128))])])):p.value==="html"?(x(),$("div",iZ,[R.value==="preview"?(x(),$("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:se.value,title:e.file.path},null,8,rZ)):(x(),$("div",lZ,[m("div",aZ,[(x(!0),$(Pe,null,Xe(_.value,(me,$e)=>(x(),$("div",{key:$e,class:Le(["fp-line-row",k($e+1)]),"data-line":$e+1},[m("span",uZ,O($e+1),1),m("span",{class:"fp-line-text",innerHTML:ae(me)},null,8,dZ)],10,cZ))),128))])]))])):p.value==="pdf"?(x(),$("div",fZ,[V.value?(x(),$("iframe",{key:0,class:"fp-pdf-frame",src:V.value,title:e.file.path},null,8,hZ)):(x(),$("div",pZ,[m("span",mZ,O(C(n)("filePreview.pdfNoPreview")),1)]))])):p.value==="csv"?(x(),$("div",gZ,[m("table",vZ,[m("tbody",null,[(x(!0),$(Pe,null,Xe(G.value,(me,$e)=>(x(),$("tr",{key:$e,class:Le(k($e+1)),"data-line":$e+1},[m("th",null,O($e+1),1),(x(!0),$(Pe,null,Xe(me,(J,ye)=>(x(),$("td",{key:ye},O(J),1))),128))],10,yZ))),128))])])])):p.value==="image"?(x(),$("div",kZ,[K.value?(x(),$("img",{key:0,src:K.value,alt:e.file.path,class:Le(["fp-image",{actual:U.value==="actual"}])},null,10,bZ)):(x(),$("div",_Z,[we[21]||(we[21]=m("span",{class:"fp-binary-icon"},[m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[m("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),m("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),m("span",wZ,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:A(e.file.size)})),1)]))])):p.value==="text"?(x(),$("div",SZ,[m("div",CZ,[(x(!0),$(Pe,null,Xe(_.value,(me,$e)=>(x(),$("div",{key:$e,class:Le(["fp-line-row",k($e+1)]),"data-line":$e+1},[m("span",TZ,O($e+1),1),m("span",{class:"fp-line-text",innerHTML:ae(me)},null,8,MZ)],10,xZ))),128))])])):(x(),$("div",AZ,[m("div",EZ,[we[22]||(we[22]=m("span",{class:"fp-binary-icon"},[m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[m("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),m("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),m("span",$Z,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:A(e.file.size)})),1)])]))],64)):ie("",!0)],512))}}),NZ=vt(IZ,[["__scopeId","data-v-93380983"]]),LZ={class:"tp"},OZ={class:"tp-header"},PZ={class:"tp-title"},RZ={class:"tp-sub"},DZ=["title","aria-label"],BZ=Ze({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=te(null);return Ke(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||mt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),$("div",LZ,[m("div",OZ,[m("span",PZ,O(C(o)("common.preview")),1),m("span",RZ,O(e.subtitle??C(o)("thinking.panelTitle")),1),m("button",{type:"button",class:"tp-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:l[0]||(l[0]=a=>s("close"))},[...l[1]||(l[1]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,DZ)]),m("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),Qw=vt(BZ,[["__scopeId","data-v-2f5e8c0f"]]),FZ={class:"ap"},HZ={class:"ap-header"},WZ={class:"ap-title"},UZ={class:"ap-sub"},jZ=["title","aria-label"],qZ={key:0,class:"ap-type"},zZ={key:1,class:"ap-reason"},VZ={key:2,class:"ap-field"},KZ={class:"ap-field-body"},GZ={key:3,class:"ap-field"},YZ={class:"ap-field-body ap-progress"},XZ={key:0,class:"ap-call"},ZZ={key:1,class:"ap-output"},JZ=["onClick"],QZ={key:4,class:"ap-field"},eJ={class:"ap-field-body"},tJ=8,e2=5,t2=2,nJ=Ze({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=F(()=>(n.member.outputLines??[]).map(h=>h.trimEnd()).filter(h=>h.length>0));function r(h){const g=[];let S=null,_=0;for(const y of h)y.startsWith("Calling ")?(S={key:`g${_++}`,call:y,output:[]},g.push(S)):S?S.output.push(y):(S={key:`g${_++}`,call:"",output:[y]},g.push(S));return g}const l=F(()=>r(i.value)),a=te(new Set);function c(h){return a.value.has(h)}function u(h){const g=new Set(a.value);g.has(h)?g.delete(h):g.add(h),a.value=g}function d(h){return h.output.length-e2-t2}function f(h){switch(h){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=te(null);return Ke(()=>i.value.length,()=>{const h=p.value;!h||!(h.scrollHeight-h.scrollTop-h.clientHeight<24)||mt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(h,g)=>(x(),$("div",FZ,[m("div",HZ,[m("span",WZ,O(C(o)("common.preview")),1),m("span",UZ,O(e.member.name),1),m("span",{class:Le(["ap-phase",`phase-${e.member.phase}`])},O(f(e.member.phase)),3),m("button",{type:"button",class:"ap-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:g[0]||(g[0]=S=>s("close"))},[...g[1]||(g[1]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,jZ)]),m("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(x(),$("div",qZ,O(e.member.subagentType),1)):ie("",!0),e.member.suspendedReason?(x(),$("div",zZ,O(e.member.suspendedReason),1)):ie("",!0),e.member.prompt?(x(),$("div",VZ,[g[2]||(g[2]=m("span",{class:"ap-field-label"},"Task",-1)),m("div",KZ,O(e.member.prompt),1)])):ie("",!0),l.value.length>0?(x(),$("div",GZ,[g[4]||(g[4]=m("span",{class:"ap-field-label"},"Progress",-1)),m("div",YZ,[(x(!0),$(Pe,null,Xe(l.value,S=>(x(),$("div",{key:S.key,class:"ap-group"},[S.call?(x(),$("div",XZ,[g[3]||(g[3]=m("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),dt(" "+O(S.call),1)])):ie("",!0),S.output.length>0?(x(),$("div",ZZ,[S.output.length<=tJ||c(S.key)?(x(!0),$(Pe,{key:0},Xe(S.output,(_,y)=>(x(),$("div",{key:y,class:"ap-out-line"},O(_),1))),128)):(x(),$(Pe,{key:1},[(x(!0),$(Pe,null,Xe(S.output.slice(0,e2),(_,y)=>(x(),$("div",{key:y,class:"ap-out-line"},O(_),1))),128)),m("button",{type:"button",class:"ap-fold",onClick:_=>u(S.key)}," … ("+O(d(S))+" more) ",9,JZ),(x(!0),$(Pe,null,Xe(S.output.slice(-t2),(_,y)=>(x(),$("div",{key:"t"+y,class:"ap-out-line"},O(_),1))),128))],64))])):ie("",!0)]))),128))])])):ie("",!0),e.member.summary?(x(),$("div",QZ,[g[5]||(g[5]=m("span",{class:"ap-field-label"},"Result",-1)),m("div",eJ,O(e.member.summary),1)])):ie("",!0)],512)]))}}),sJ=vt(nJ,[["__scopeId","data-v-66bf53d2"]]),oJ={class:"diff-lines"},iJ={key:0,class:"hunk-text"},rJ={class:"dl-gutter old"},lJ={class:"dl-gutter new"},aJ={class:"dl-sign"},cJ={class:"dl-text"},uJ=Ze({__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)=>(x(),$("div",oJ,[(x(!0),$(Pe,null,Xe(e.lines,(r,l)=>(x(),$("div",{key:l,class:Le(["dl",s(r)])},[r.type==="hunk"?(x(),$("span",iJ,O(r.text),1)):(x(),$(Pe,{key:1},[m("span",rJ,O(t(r)),1),m("span",lJ,O(n(r)),1),m("span",aJ,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),m("span",cJ,O(r.text),1)],64))],2))),128))]))}}),MM=vt(uJ,[["__scopeId","data-v-b73eaacc"]]),dJ={class:"tdp"},fJ={class:"tdp-header"},hJ={class:"tdp-title"},pJ=["title"],mJ=["title","aria-label"],gJ={class:"tdp-body"},vJ={key:1,class:"tdp-output"},yJ={key:2,class:"tdp-empty"},kJ=Ze({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=_t();return(o,i)=>(x(),$("div",dJ,[m("div",fJ,[m("span",hJ,O(e.target.title),1),e.target.path?(x(),$("span",{key:0,class:"tdp-sub",title:e.target.path},O(e.target.path),9,pJ)):ie("",!0),m("button",{type:"button",class:"tdp-close",title:C(s)("thinking.close"),"aria-label":C(s)("thinking.close"),onClick:i[0]||(i[0]=r=>n("close"))},[...i[1]||(i[1]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,mJ)]),m("div",gJ,[e.target.lines&&e.target.lines.length>0?(x(),je(MM,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),$("div",vJ,[(x(!0),$(Pe,null,Xe(e.target.output,(r,l)=>(x(),$("div",{key:l},O(r),1))),128))])):(x(),$("div",yJ,O(C(s)("diff.noDiff")),1))])]))}}),bJ=vt(kJ,[["__scopeId","data-v-9d022f5b"]]),_J={class:"sc"},wJ={class:"sc-header"},SJ={class:"sc-title"},CJ=["title"],xJ=["title","aria-label"],TJ={key:0,class:"sc-empty"},MJ={key:2,class:"sc-loading","aria-hidden":"true"},AJ={class:"sc-composer"},EJ=["placeholder"],$J=["disabled","title"],IJ=Ze({__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}=_t(),i=F(()=>n.turns.find(y=>y.role==="user")?.text?.trim()??""),r=F(()=>n.title?.trim()||o("sideChat.title")),l=F(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=te(""),c=te(null),u=te(null);function d(){const _=a.value.trim();_&&(s("send",_),a.value="",mt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const _=u.value;_&&(_.scrollTop=_.scrollHeight)}const p=F(()=>{const _=n.turns;if(_.length===0)return"0";const y=_.at(-1),b=y.thinking?.length??0,v=y.tools?.reduce((w,N)=>w+N.name.length+(N.arg?.length??0)+(N.output?.join("").length??0),0)??0;return`${_.length}:${y.text.length}:${b}:${v}`});Ke(p,async()=>{!n.running&&!n.sending||(await mt(),f())});const h=F(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(_){_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&(_.preventDefault(),d())}function S(){const _=c.value;_&&(_.style.height="auto",_.style.height=`${Math.min(_.scrollHeight,160)}px`)}return(_,y)=>(x(),$("div",_J,[m("div",wJ,[m("span",SJ,O(r.value),1),m("span",{class:"sc-subtitle",title:l.value},O(l.value),9,CJ),m("button",{type:"button",class:"sc-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:y[0]||(y[0]=b=>s("close"))},[...y[2]||(y[2]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,xJ)]),m("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),$("div",TJ,O(C(o)("sideChat.empty")),1)):(x(),je(wM,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),h.value?(x(),$("div",MJ,[gt(m1)])):ie("",!0)],512),m("div",AJ,[Lt(m("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":y[1]||(y[1]=b=>a.value=b),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:S,onKeydown:g},null,40,EJ),[[wn,a.value]]),m("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:C(o)("sideChat.send"),onClick:d},[...y[3]||(y[3]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M2 8h10"}),m("path",{d:"M8 4l4 4-4 4"})],-1)])],8,$J)])]))}}),NJ=vt(IJ,[["__scopeId","data-v-5d7c220f"]]),LJ={class:"changes-pane"},OJ={class:"dv-panel-head"},PJ={class:"dv-title"},RJ=["title"],DJ=["title","aria-label"],BJ={class:"diff-head"},FJ=["title"],HJ={class:"back-label"},WJ={key:0,class:"empty-state"},UJ={key:1,class:"dv-lines-wrap"},jJ={key:2,class:"empty-state"},qJ={class:"dv-panel-head"},zJ={class:"dv-title"},VJ={class:"dv-change-count"},KJ=["aria-label"],GJ=["aria-pressed"],YJ=["aria-pressed"],XJ=["title","aria-label"],ZJ={class:"ch-head"},JJ={class:"br-label"},QJ={class:"br-name"},eQ={key:0,class:"sync-info"},tQ=["title"],nQ=["title"],sQ={key:1,class:"empty-head"},oQ={key:0,class:"ch-list"},iQ=["title","onClick"],rQ={class:"fpath"},lQ={key:1,class:"ch-list ch-tree"},aQ={class:"tree-list"},cQ=["onClick"],uQ={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},dQ=["d"],fQ={class:"tree-name"},hQ=["title","onClick"],pQ={class:"tree-name"},mQ={key:2,class:"empty-state"},gQ={key:3,class:"empty-state"},vQ=Ze({__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}=_t(),s=e,o=t;function i(M){const L=M.toLowerCase();return L==="modified"?"modified":L==="added"?"added":L==="deleted"?"deleted":L==="renamed"?"renamed":L==="untracked"?"untracked":L==="conflicted"?"conflicted":L==="ignored"?"ignored":L==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(M){return r[i(M)]??"?"}function a(M,L=60){return M.length<=L?M:"…"+M.slice(M.length-L+1)}const c=F(()=>s.gitInfo!==null),u=F(()=>s.changes.length>0),d=F(()=>(s.selectedDiffPath??null)!==null),f=F(()=>s.mode==="detail"||s.mode==="full"&&d.value),p=F(()=>s.fileDiff??[]),h=F(()=>s.fileDiffLoading===!0);function g(M){o("open",M)}function S(){o("back")}function _(){o("close")}const y=te("list");function b(M){y.value=M}function v(M){const L={children:[]},R=[...M].sort((B,U)=>B.path.localeCompare(U.path));for(const B of R){const U=B.path.split("/");let K=L;for(let V=0;V<U.length;V++){const se=U[V],Y=V===U.length-1,G=U.slice(0,V+1).join("/");let ee=K.children.find(Se=>Se.name===se&&Se.kind===(Y?"file":"folder"));ee||(ee={name:se,path:G,kind:Y?"file":"folder",status:Y?B.status:void 0,children:[]},K.children.push(ee)),K=ee}}return L.children}const w=F(()=>v(s.changes)),N=te(new Set);function E(M){return!N.value.has(M)}const k=F(()=>{const M=[];function L(R,B){for(const U of R)M.push({node:U,depth:B}),U.kind==="folder"&&E(U.path)&&L(U.children,B+1)}return L(w.value,0),M});function A(M){const L=new Set(N.value);L.has(M.path)?L.delete(M.path):L.add(M.path),N.value=L}const I=M=>"M1.5 3.5h3l1.5 2h7a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z";function P(M){return`${16+M*16}px`}return(M,L)=>(x(),$("div",LJ,[f.value?(x(),$(Pe,{key:0},[m("div",OJ,[m("span",PJ,O(C(n)("diff.title")),1),m("span",{class:"dv-path",title:e.selectedDiffPath??""},O(a(e.selectedDiffPath??"",50)),9,RJ),e.closable?(x(),$("button",{key:0,type:"button",class:"dv-close",title:C(n)("diff.close"),"aria-label":C(n)("diff.close"),onClick:_},[...L[2]||(L[2]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,DJ)):ie("",!0)]),m("div",BJ,[e.hideBack?ie("",!0):(x(),$("button",{key:0,class:"back-btn",type:"button",onClick:S,title:C(n)("diff.back")},[L[3]||(L[3]=m("span",{"aria-hidden":"true"},"←",-1)),m("span",HJ,O(C(n)("diff.back")),1)],8,FJ))]),h.value?(x(),$("div",WJ,O(C(n)("diff.loading")),1)):p.value.length>0?(x(),$("div",UJ,[gt(MM,{lines:p.value},null,8,["lines"])])):(x(),$("div",jJ,O(C(n)("diff.noDiff")),1))],64)):(x(),$(Pe,{key:1},[m("div",qJ,[m("span",zJ,O(C(n)("diff.title")),1),m("span",VJ,O(C(n)("diff.changeCount",{count:e.changes.length})),1),m("div",{class:"dv-toggle",role:"group","aria-label":C(n)("diff.list")+" / "+C(n)("diff.tree")},[m("button",{type:"button",class:Le(["dv-toggle-btn",{active:y.value==="list"}]),"aria-pressed":y.value==="list",onClick:L[0]||(L[0]=R=>b("list"))},O(C(n)("diff.list")),11,GJ),m("button",{type:"button",class:Le(["dv-toggle-btn",{active:y.value==="tree"}]),"aria-pressed":y.value==="tree",onClick:L[1]||(L[1]=R=>b("tree"))},O(C(n)("diff.tree")),11,YJ)],8,KJ),e.closable?(x(),$("button",{key:0,type:"button",class:"dv-close",title:C(n)("diff.close"),"aria-label":C(n)("diff.close"),onClick:_},[...L[4]||(L[4]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,XJ)):ie("",!0)]),m("div",ZJ,[c.value?(x(),$(Pe,{key:0},[m("span",JJ,O(C(n)("diff.branch")),1),m("span",QJ,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),$("span",eQ,[e.gitInfo.ahead>0?(x(),$("span",{key:0,class:"ahead",title:C(n)("diff.aheadTitle")},"↑"+O(e.gitInfo.ahead),9,tQ)):ie("",!0),e.gitInfo.behind>0?(x(),$("span",{key:1,class:"behind",title:C(n)("diff.behindTitle")},"↓"+O(e.gitInfo.behind),9,nQ)):ie("",!0)])):ie("",!0)],64)):(x(),$("span",sQ,O(C(n)("diff.empty")),1))]),u.value&&y.value==="list"?(x(),$("div",oQ,[(x(!0),$(Pe,null,Xe(e.changes,R=>(x(),$("button",{key:R.path,type:"button",class:"ch-row",title:R.path,onClick:B=>g(R.path)},[m("span",{class:Le(["badge",i(R.status)])},O(l(R.status)),3),m("span",rQ,O(a(R.path)),1)],8,iQ))),128))])):u.value&&y.value==="tree"?(x(),$("div",lQ,[m("ul",aQ,[(x(!0),$(Pe,null,Xe(k.value,({node:R,depth:B})=>(x(),$("li",{key:R.path,class:"tree-node"},[R.kind==="folder"?(x(),$("button",{key:0,type:"button",class:"tree-row tree-folder",style:Bt({paddingLeft:P(B)}),onClick:U=>A(R)},[(x(),$("svg",uQ,[m("path",{d:I(E(R.path))},null,8,dQ)])),m("span",fQ,O(R.name),1)],12,cQ)):(x(),$("button",{key:1,type:"button",class:"tree-row tree-file",style:Bt({paddingLeft:P(B)}),title:R.path,onClick:U=>g(R.path)},[m("span",{class:Le(["badge",i(R.status)])},O(l(R.status)),3),m("span",pQ,O(R.name),1)],12,hQ))]))),128))])])):c.value?(x(),$("div",mQ,O(C(n)("diff.clean")),1)):(x(),$("div",gQ,O(C(n)("diff.empty")),1))],64))]))}}),yQ=vt(vQ,[["__scopeId","data-v-bb3f7593"]]);function Ph(e,t){let n=null;Zt(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,mt(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),qs(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const kQ=["aria-label"],bQ={class:"dh"},_Q={class:"dtitle"},wQ=["title"],SQ={class:"search-wrap"},CQ=["placeholder"],xQ=["aria-label"],TQ=["aria-selected","onClick"],MQ={key:1,class:"loading-state"},AQ={key:2,class:"unavail-state"},EQ={key:3,class:"model-list"},$Q=["aria-selected","onClick","onMouseenter"],IQ={class:"check"},NQ={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},LQ={class:"model-main"},OQ={class:"model-name"},PQ={class:"model-id"},RQ={class:"model-provider"},DQ={class:"model-ctx"},BQ={key:0,class:"caps"},FQ=["title","onClick"],HQ={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},WQ=["fill"],UQ={key:0,class:"empty"},jQ={class:"footer-hint"},qQ=Ze({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F(()=>new Set(s.starredIds??[]));function r(b){return i.value.has(b)}const l=te(""),a=te(null),c=te(null),u=te("all");Ph(c,a);const d=F(()=>{const b=new Set,v=[{id:"all",label:n("model.allTab")}];for(const w of s.models)b.has(w.provider)||(b.add(w.provider),v.push({id:w.provider,label:w.provider}));return v}),f=F(()=>{const b=l.value.toLowerCase().trim(),v=s.models.filter(w=>{if(u.value!=="all"&&w.provider!==u.value)return!1;const N=(w.displayName??w.model).toLowerCase().includes(b),E=w.provider.toLowerCase().includes(b),k=w.id.toLowerCase().includes(b);return!b||N||E||k});return u.value!=="all"?v:v.sort((w,N)=>{const E=r(w.id)?1:0;return(r(N.id)?1:0)-E})}),p=F(()=>f.value),h=te(0);Ke([l,u],()=>{h.value=0}),Ke(d,b=>{b.some(v=>v.id===u.value)||(u.value="all")}),Ke(p,b=>{h.value=Math.min(h.value,Math.max(b.length-1,0))});function g(b){if(b.key==="Escape"){o("close");return}if(b.key==="ArrowDown")b.preventDefault(),h.value=Math.min(h.value+1,p.value.length-1);else if(b.key==="ArrowUp")b.preventDefault(),h.value=Math.max(h.value-1,0);else if(b.key==="Enter"){const v=p.value[h.value];v&&o("select",v.id)}}Zt(()=>{document.addEventListener("keydown",g)}),Ft(()=>{document.removeEventListener("keydown",g)});function S(b){o("select",b)}function _(b){return p.value.indexOf(b)}function y(b){u.value=b}return(b,v)=>(x(),$("div",{class:"backdrop",onClick:v[3]||(v[3]=Je(w=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("model.dialogLabel")},[m("div",bQ,[m("span",_Q,O(C(n)("model.title")),1),m("button",{class:"close-btn",title:C(n)("model.close"),onClick:v[0]||(v[0]=w=>o("close"))},"✕",8,wQ)]),m("div",SQ,[Lt(m("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":v[1]||(v[1]=w=>l.value=w),class:"search-input",type:"text",placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,CQ),[[wn,l.value]])]),d.value.length>1?(x(),$("div",{key:0,class:"tab-strip",role:"tablist","aria-label":C(n)("model.providerTabs")},[(x(!0),$(Pe,null,Xe(d.value,w=>(x(),$("button",{key:w.id,type:"button",class:Le(["tab-btn",{on:w.id===u.value}]),role:"tab","aria-selected":w.id===u.value,onClick:N=>y(w.id)},O(w.label),11,TQ))),128))],8,xQ)):ie("",!0),e.loading?(x(),$("div",MQ,[v[4]||(v[4]=m("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),m("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(x(),$("div",AQ,[v[5]||(v[5]=m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M10 2 L19 18 H1 Z"}),m("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),m("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),m("span",null,O(C(n)("model.unavailable")),1)])):(x(),$("div",EQ,[(x(!0),$(Pe,null,Xe(p.value,w=>(x(),$("div",{key:w.id,class:Le(["model-row",{"is-current":w.id===e.current,"is-selected":_(w)===h.value}]),role:"option","aria-selected":w.id===e.current,onClick:N=>S(w.id),onMouseenter:N=>h.value=_(w)},[m("span",IQ,[w.id===e.current?(x(),$("svg",NQ,[...v[6]||(v[6]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",LQ,[m("span",OQ,O(w.displayName??w.model),1),m("span",PQ,O(w.id),1)]),m("span",RQ,O(w.provider),1),m("span",DQ,O(C(n)("model.contextSuffix",{size:Math.round(w.maxContextSize/1e3)})),1),w.capabilities&&w.capabilities.length>0?(x(),$("span",BQ,O(w.capabilities.join(", ")),1)):ie("",!0),m("button",{type:"button",class:Le(["star-btn",{starred:r(w.id)}]),title:r(w.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:Je(N=>o("toggle-star",w.id),["stop"]),onMouseenter:v[2]||(v[2]=Je(()=>{},["stop"]))},[(x(),$("svg",HQ,[m("path",{fill:r(w.id)?"currentColor":"none",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,8,WQ)]))],42,FQ)],42,$Q))),128)),p.value.length===0&&!e.loading&&!e.unavailable?(x(),$("div",UQ,O(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ie("",!0)])),m("div",jQ,O(C(n)("model.footerHint")),1)],8,kQ)]))}}),zQ=vt(qQ,[["__scopeId","data-v-34f036d8"]]),VQ=["aria-label"],KQ={class:"dh"},GQ={class:"dtitle"},YQ=["title"],XQ={class:"prov-list"},ZQ={key:0,class:"state-row"},JQ={key:1,class:"state-row unavail"},QQ={key:2,class:"empty"},eee=["title"],tee={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},nee=["fill"],see={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},oee=["fill"],iee={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},ree={class:"prov-info"},lee={class:"prov-type"},aee={key:0,class:"prov-url"},cee={class:"prov-meta"},uee={key:0},dee={key:0,class:"confirm-row"},fee={class:"confirm-text"},hee={key:1,class:"prov-actions"},pee=["title","onClick"],mee=["title","onClick"],gee={key:0,class:"add-section"},vee={key:0,class:"add-btns"},yee={key:1,class:"add-form"},kee={class:"form-row"},bee={class:"flabel"},_ee=["value"],wee={class:"form-row"},See={class:"flabel"},Cee={class:"form-row"},xee={class:"flabel"},Tee=["placeholder"],Mee={class:"form-row"},Aee={class:"flabel"},Eee=["placeholder"],$ee={key:0,class:"add-error"},Iee={class:"form-btns"},Nee={class:"footer-hint"},Lee=Ze({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=_t(),s=te(null);Ph(s);const o=t,i=te(null);function r(b){i.value=b}function l(){i.value&&(o("delete",i.value),i.value=null)}function a(){i.value=null}const c=te(!1),u=to({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=te(""),f=["moonshot","anthropic","openai","custom"];function p(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function h(){c.value=!1}function g(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",o("add",{type:u.type,apiKey:u.apiKey.trim()||void 0,baseUrl:u.baseUrl.trim()||void 0,defaultModel:u.defaultModel.trim()||void 0}),c.value=!1}function S(b){if(b.key==="Escape"){if(c.value){h();return}if(i.value){a();return}o("close")}}Zt(()=>document.addEventListener("keydown",S)),Ft(()=>document.removeEventListener("keydown",S));function _(b){return b==="connected"?"var(--ok)":b==="error"?"var(--err)":"var(--faint)"}function y(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,v)=>(x(),$("div",{class:"backdrop",onClick:v[7]||(v[7]=Je(w=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("providers.dialogLabel")},[m("div",KQ,[m("span",GQ,O(C(n)("providers.title")),1),m("button",{class:"close-btn",title:C(n)("providers.close"),onClick:v[0]||(v[0]=w=>o("close"))},"✕",8,YQ)]),m("div",XQ,[e.loading?(x(),$("div",ZQ,[v[8]||(v[8]=m("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),m("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(x(),$("div",JQ,[v[9]||(v[9]=m("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),m("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),m("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),m("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),$("div",QQ,O(C(n)("providers.empty")),1)):(x(!0),$(Pe,{key:3},Xe(e.providers,w=>(x(),$("div",{key:w.id,class:"prov-row"},[m("span",{class:"status-dot",style:Bt({color:_(w.status)}),title:y(w.status)},[w.status==="connected"?(x(),$("svg",tee,[m("circle",{cx:"4",cy:"4",r:"3.5",fill:_(w.status)},null,8,nee)])):w.status==="error"?(x(),$("svg",see,[m("circle",{cx:"4",cy:"4",r:"3.5",fill:_(w.status)},null,8,oee)])):(x(),$("svg",iee,[...v[10]||(v[10]=[m("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,eee),m("div",ree,[m("span",lee,O(w.type),1),w.baseUrl?(x(),$("span",aee,O(w.baseUrl),1)):ie("",!0),m("span",cee,[m("span",{class:Le(["prov-key-state",w.hasApiKey?"has-key":"no-key"])},O(w.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),3),w.models&&w.models.length>0?(x(),$("span",uee," · "+O(C(n)("providers.modelCount",{count:w.models.length})),1)):ie("",!0)])]),i.value===w.id?(x(),$("div",dee,[m("span",fee,O(C(n)("providers.confirmDelete")),1),m("button",{class:"act-btn danger",onClick:l},O(C(n)("providers.confirm")),1),m("button",{class:"act-btn",onClick:a},O(C(n)("providers.cancel")),1)])):(x(),$("div",hee,[m("button",{class:"act-btn",title:C(n)("providers.refreshTitle",{type:w.type}),onClick:N=>o("refresh",w.id)},O(C(n)("providers.refresh")),9,pee),m("button",{class:"act-btn danger",title:C(n)("providers.deleteTitle",{type:w.type}),onClick:N=>r(w.id)},O(C(n)("providers.delete")),9,mee)]))]))),128))]),e.unavailable?ie("",!0):(x(),$("div",gee,[c.value?(x(),$("div",yee,[m("div",kee,[m("label",bee,O(C(n)("providers.fieldType")),1),Lt(m("select",{"onUpdate:modelValue":v[3]||(v[3]=w=>u.type=w),class:"finput fselect"},[(x(),$(Pe,null,Xe(f,w=>m("option",{key:w,value:w},O(w),9,_ee)),64))],512),[[uf,u.type]])]),m("div",wee,[m("label",See,O(C(n)("providers.fieldApiKey")),1),Lt(m("input",{"onUpdate:modelValue":v[4]||(v[4]=w=>u.apiKey=w),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[wn,u.apiKey]])]),m("div",Cee,[m("label",xee,O(C(n)("providers.fieldBaseUrl")),1),Lt(m("input",{"onUpdate:modelValue":v[5]||(v[5]=w=>u.baseUrl=w),class:"finput",type:"text",placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Tee),[[wn,u.baseUrl]])]),m("div",Mee,[m("label",Aee,O(C(n)("providers.fieldDefaultModel")),1),Lt(m("input",{"onUpdate:modelValue":v[6]||(v[6]=w=>u.defaultModel=w),class:"finput",type:"text",placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,Eee),[[wn,u.defaultModel]])]),d.value?(x(),$("div",$ee,O(d.value),1)):ie("",!0),m("div",Iee,[m("button",{class:"act-btn primary",onClick:g},O(C(n)("providers.add")),1),m("button",{class:"act-btn",onClick:h},O(C(n)("providers.cancel")),1)])])):(x(),$("div",vee,[m("button",{class:"add-btn-oauth",onClick:v[1]||(v[1]=w=>o("openLogin","moonshot"))},[v[11]||(v[11]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("circle",{cx:"5",cy:"3",r:"2"}),m("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),dt(" "+O(C(n)("providers.loginKimi")),1)]),m("button",{class:"add-btn-oauth",onClick:v[2]||(v[2]=w=>o("openLogin","anthropic"))},[v[12]||(v[12]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("circle",{cx:"5",cy:"3",r:"2"}),m("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),dt(" "+O(C(n)("providers.loginAnthropic")),1)]),m("button",{class:"add-btn add-btn-key",onClick:p},[v[13]||(v[13]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),m("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),dt(" "+O(C(n)("providers.enterApiKey")),1)])]))])),m("div",Nee,O(C(n)("providers.escClose")),1)],8,VQ)]))}}),Oee=vt(Lee,[["__scopeId","data-v-28ec3774"]]),Pee={class:"backdrop"},Ree=["aria-label"],Dee={class:"dh"},Bee={class:"dtitle"},Fee=["title"],Hee={key:0,class:"center-body"},Wee={class:"center-text"},Uee={key:1,class:"nb"},jee={class:"nb-lead"},qee=["href"],zee={class:"nb-or"},Vee={class:"nb-fallback"},Kee={class:"nb-fb-text"},Gee=["href"],Yee={class:"nb-code-row"},Xee={class:"nb-code"},Zee={class:"nb-status"},Jee=["aria-label"],Qee={class:"nb-status-text"},ete={class:"nb-countdown"},tte={key:2,class:"center-body"},nte={class:"center-text success-text"},ste={class:"center-hint"},ote={class:"center-body"},ite={class:"center-text err-text"},rte={class:"center-hint"},lte={class:"actions"},ate={class:"center-body"},cte={class:"center-text warn-text"},ute={class:"center-hint"},dte={class:"actions"},fte=Ze({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=_t(),s=te(null);Ph(s);const o=t,i=e,r=te("starting"),l=te(null),a=te(0),c=te(!1);let u=null,d=null;Zt(async()=>{document.addEventListener("keydown",b),await f()}),Ft(()=>{document.removeEventListener("keydown",b),g()});async function f(){g(),l.value=null,r.value="starting";const w=await i.onStartOAuthLogin();if(!w){r.value="error";return}l.value={flowId:w.flowId,verificationUri:w.verificationUri,verificationUriComplete:w.verificationUriComplete,userCode:w.userCode,expiresIn:w.expiresIn,interval:w.interval},a.value=w.expiresIn,r.value="device-code",p(),h(w.interval)}function p(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function h(w){u&&clearTimeout(u),u=setTimeout(async()=>{const N=await i.onPollOAuthLogin();N?.status==="authenticated"?(g(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):N?.status==="expired"||N?.status==="cancelled"?(g(),r.value="expired"):h(w)},w*1e3)}function g(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function S(){await f()}async function _(){!l.value||!await ks(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function y(){g(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function b(w){w.key==="Escape"&&y()}function v(w){const N=Math.floor(w/60),E=w%60;return`${N}:${String(E).padStart(2,"0")}`}return(w,N)=>(x(),$("div",Pee,[m("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("login.title")},[m("div",Dee,[m("span",Bee,O(C(n)("login.title")),1),m("button",{class:"close-btn",title:C(n)("login.close"),onClick:y},[...N[0]||(N[0]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Fee)]),r.value==="starting"?(x(),$("div",Hee,[N[1]||(N[1]=m("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),m("span",Wee,O(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(x(),$("div",Uee,[m("div",jee,O(C(n)("login.lead")),1),m("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[dt(O(C(n)("login.authorizeInBrowser"))+" ",1),N[2]||(N[2]=m("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.6"},[m("path",{d:"M6 2H2.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8"}),m("path",{d:"M9.5 1.5h3v3M12.5 1.5 7 7"})],-1))],8,qee),m("div",zee,O(C(n)("login.orDivider")),1),m("div",Vee,[m("div",Kee,[dt(O(C(n)("login.fallbackPrefix")),1),m("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(l.value.verificationUri),9,Gee),dt(O(C(n)("login.fallbackSuffix")),1)]),m("div",Yee,[m("span",Xee,O(l.value.userCode),1),m("button",{class:Le(["nb-copy",{"is-copied":c.value}]),onClick:_},[c.value?(x(),$(Pe,{key:0},[N[3]||(N[3]=m("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("polyline",{points:"1,6 4,9 11,2"})],-1)),dt(" "+O(C(n)("login.copied")),1)],64)):(x(),$(Pe,{key:1},[N[4]||(N[4]=m("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),m("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),dt(" "+O(C(n)("login.copy")),1)],64))],2)])]),m("div",Zee,[m("span",{class:"nb-spinner","aria-label":C(n)("login.waitingAuth")},[...N[5]||(N[5]=[m("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,Jee),m("span",Qee,O(C(n)("login.waitingAutoClose")),1),m("span",ete,O(v(a.value)),1)])])):r.value==="success"?(x(),$("div",tte,[N[6]||(N[6]=m("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[m("circle",{cx:"18",cy:"18",r:"15"}),m("polyline",{points:"10,18 15,24 26,12"})],-1)),m("span",nte,O(C(n)("login.success")),1),m("span",ste,O(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),$(Pe,{key:3},[m("div",ote,[N[7]||(N[7]=m("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[m("circle",{cx:"14",cy:"14",r:"12"}),m("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),m("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),m("span",ite,O(C(n)("login.expiredTitle")),1),m("span",rte,O(C(n)("login.expiredHint")),1)]),m("div",lte,[m("button",{class:"act-btn primary",onClick:S},O(C(n)("login.retry")),1),m("button",{class:"act-btn",onClick:y},O(C(n)("login.closeBtn")),1)])],64)):r.value==="error"?(x(),$(Pe,{key:4},[m("div",ate,[N[8]||(N[8]=m("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M14 3 L26 24 H2 Z"}),m("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),m("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),m("span",cte,O(C(n)("login.errorTitle")),1),m("span",ute,O(C(n)("login.errorHint")),1)]),m("div",dte,[m("button",{class:"act-btn primary",onClick:S},O(C(n)("login.retry")),1),m("button",{class:"act-btn",onClick:y},O(C(n)("login.closeBtn")),1)])],64)):ie("",!0)],8,Ree)]))}}),hte=vt(fte,[["__scopeId","data-v-98c6ec96"]]),pte=["aria-label"],mte={class:"dh"},gte={class:"dtitle"},vte=["title"],yte={class:"form-body"},kte={class:"form-row"},bte={class:"flabel",for:"ns-cwd"},_te=["placeholder"],wte={key:0,class:"recent-section"},Ste={class:"recent-label"},Cte={class:"recent-list"},xte=["title","onClick"],Tte={class:"recent-path"},Mte={class:"form-row"},Ate={class:"flabel",for:"ns-title"},Ete=["placeholder"],$te={class:"actions"},Ite=["disabled"],Nte={class:"footer-hint"},Lte=Ze({__name:"NewSessionDialog",props:{recentCwds:{}},emits:["create","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te(""),r=te("");Ke(()=>s.recentCwds,f=>{i.value===""&&f.length>0&&(i.value=f[0])},{immediate:!0});const l=F(()=>i.value.trim()),a=F(()=>l.value.length>0);function c(){if(!a.value)return;const f={cwd:l.value},p=r.value.trim();p&&(f.title=p),o("create",f)}function u(f){i.value=f}function d(f){f.key==="Escape"?o("close"):f.key==="Enter"&&!(f.target instanceof HTMLButtonElement)&&c()}return Zt(()=>document.addEventListener("keydown",d)),Ft(()=>document.removeEventListener("keydown",d)),(f,p)=>(x(),$("div",{class:"backdrop",onClick:p[4]||(p[4]=Je(h=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("newSession.title")},[m("div",mte,[m("span",gte,O(C(n)("newSession.title")),1),m("button",{class:"close-btn",title:C(n)("newSession.close"),onClick:p[0]||(p[0]=h=>o("close"))},[...p[5]||(p[5]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,vte)]),m("div",yte,[m("div",kte,[m("label",bte,O(C(n)("newSession.cwdLabel")),1),Lt(m("input",{id:"ns-cwd","onUpdate:modelValue":p[1]||(p[1]=h=>i.value=h),class:"finput",type:"text",placeholder:C(n)("newSession.cwdPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,_te),[[wn,i.value]])]),e.recentCwds.length>0?(x(),$("div",wte,[m("div",Ste,O(C(n)("newSession.recentLabel")),1),m("div",Cte,[(x(!0),$(Pe,null,Xe(e.recentCwds,h=>(x(),$("button",{key:h,class:Le(["recent-item",{"is-active":i.value===h}]),title:h,onClick:g=>u(h)},[p[6]||(p[6]=m("svg",{class:"dir-icon",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3",width:"9",height:"6.5",rx:"1"}),m("path",{d:"M1 4.5V3a1 1 0 0 1 1-1h2.5l1 1.5"})],-1)),m("span",Tte,O(h),1)],10,xte))),128))])])):ie("",!0),m("div",Mte,[m("label",Ate,O(C(n)("newSession.titleFieldLabel")),1),Lt(m("input",{id:"ns-title","onUpdate:modelValue":p[2]||(p[2]=h=>r.value=h),class:"finput",type:"text",placeholder:C(n)("newSession.titleFieldPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Ete),[[wn,r.value]])])]),m("div",$te,[m("button",{class:"act-btn primary",disabled:!a.value,onClick:c},O(C(n)("newSession.create")),9,Ite),m("button",{class:"act-btn",onClick:p[3]||(p[3]=h=>o("close"))},O(C(n)("newSession.cancel")),1)]),m("div",Nte,O(C(n)("newSession.footerHint")),1)],8,pte)]))}}),Ote=vt(Lte,[["__scopeId","data-v-80a69ecb"]]),Pte={class:"lang-switch",role:"group","aria-label":"Language"},Rte=["aria-pressed","onClick"],Dte=Ze({__name:"LanguageSwitcher",setup(e){const{locale:t}=_t();function n(s){t.value!==s&&WC(s)}return(s,o)=>(x(),$("div",Pte,[(x(!0),$(Pe,null,Xe(C(HC),i=>(x(),$("button",{key:i.code,type:"button",class:Le(["lang-opt",{on:C(t)===i.code}]),"aria-pressed":C(t)===i.code,onClick:Je(r=>n(i.code),["stop"])},O(i.label),11,Rte))),128))]))}}),AM=vt(Dte,[["__scopeId","data-v-907613b6"]]),n2=1e3,jm=16384,qm=500,zm=50,Bte=6,Fte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Hte=/^[A-Za-z0-9+/=_-]{200,}$/;let Vm=null;function li(){if(Vm!==null)return Vm;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=xn(At.debug)==="1"),Vm=e,e}const ur=[];let Wte=1;const Kv=te(0),pc=hl(!1);function Ute(){return ur}function jte(){ur.length=0,Kv.value++}function gl(e){pc.value||(ur.push({id:Wte++,ts:Date.now(),...e}),ur.length>n2&&ur.splice(0,ur.length-n2),Kv.value++)}function v1(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 Hte.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>qm?`${o.slice(0,qm)}… [+${o.length-qm} chars]`:o}if(n!=="object")return String(e);if(t>=Bte)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,zm).map(i=>v1(i,t+1));return e.length>zm&&o.push(`[+${e.length-zm} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=Fte.test(o)?"[redacted]":v1(i,t+1);return s}function $a(e){if(e===void 0)return;const t=v1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>jm)return{_truncated:`detail JSON was ${n.length} chars; first ${jm} kept`,preview:n.slice(0,jm)}}catch{return"[unserializable detail]"}return t}function s2(e){li()&&gl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:$a(e.body)}})}function o2(e){if(!li())return;const t=e.code!==0;gl({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:$a(e.data)}})}function bd(e){li()&&gl({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 Ul(e,t){li()&&gl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:$a(t)})}function qte(e){if(!li())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;gl({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:$a(e)})}function zte(e){if(!li())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);gl({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:$a(t.payload)})}const Vte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Km(e,t,n){li()&&gl({source:"client",kind:`client:${e}`,label:`${Vte[e]} ${t}`,detail:$a(n)})}let i2=!1;function Kte(){if(!(i2||!li())){i2=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Km("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;Km("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{Km(e,n.map(Gte).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Gte(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 EM(e=ur){if(typeof document>"u")return;const t=new Blob([Yte(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 Yte(e=ur){return e.map(t=>JSON.stringify(t)).join(`
253
+ `)}const Xte=["aria-label"],Zte={class:"dh"},Jte={class:"dtitle"},Qte=["title"],ene={class:"settings-layout"},tne=["aria-label"],nne=["aria-selected","aria-controls","id","onClick"],sne={class:"body"},one={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},ine={class:"sec"},rne={class:"sec-title"},lne={class:"row"},ane={class:"rlabel"},cne=["aria-label"],une=["aria-pressed"],dne=["aria-pressed"],fne={class:"row"},hne={class:"rlabel"},pne=["aria-label"],mne=["aria-pressed"],gne=["aria-pressed"],vne=["aria-pressed"],yne={class:"row"},kne={class:"rlabel"},bne={class:"num-field"},_ne=["value","aria-label"],wne={class:"row"},Sne={class:"rlabel"},Cne={class:"sec"},xne={class:"sec-title"},Tne={class:"row"},Mne={class:"rlabel"},Ane={key:0,class:"hint"},Ene=["aria-checked","disabled"],$ne={class:"sec"},Ine={class:"sec-title"},Nne={class:"row"},Lne={class:"rlabel"},One=["title"],Pne={class:"actions"},Rne={class:"sec"},Dne={class:"sec-title"},Bne={class:"row"},Fne={class:"rlabel"},Hne={class:"rvalue mono"},Wne={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},Une={class:"sec"},jne={class:"sec-head"},qne={class:"sec-title"},zne={key:0,class:"saving"},Vne={class:"row"},Kne={class:"rlabel"},Gne={class:"hint"},Yne=["value","disabled","aria-label"],Xne={key:0,value:"",disabled:""},Zne=["label"],Jne=["value"],Qne={key:1,class:"rvalue mono"},ese={class:"row"},tse={class:"rlabel"},nse={class:"hint"},sse=["aria-label"],ose=["aria-pressed","disabled","onClick"],ise={class:"row"},rse={class:"rlabel"},lse={class:"hint"},ase=["aria-checked","disabled"],cse={class:"row"},use={class:"rlabel"},dse={class:"hint"},fse=["aria-checked","disabled"],hse={class:"row"},pse={class:"rlabel"},mse={class:"hint"},gse=["aria-checked","disabled"],vse={key:0,class:"row"},yse={class:"rlabel"},kse=["aria-checked","disabled"],bse={key:1,class:"provider-list"},_se={class:"provider-main"},wse={class:"provider-id"},Sse={class:"provider-type"},Cse={class:"provider-meta"},xse={key:0,class:"provider-model"},Tse={key:1,class:"empty-config"},Mse={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},Ase={class:"sec"},Ese={class:"sec-title"},$se={class:"row"},Ise={class:"rlabel"},Nse={class:"rvalue mono"},Lse={class:"row"},Ose={class:"rlabel"},Pse={key:0,class:"hint"},Rse={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},Dse={class:"sec"},Bse={class:"sec-title"},Fse={class:"row"},Hse={class:"rlabel"},Wse={class:"hint"},Use=["aria-checked"],jse=Ze({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyPermission:{},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"experimental",labelKey:"settings.tabs.experimental"}],l=_6(),a=["manual","auto","yolo"],c=te(null);Ph(c);function u(E){E.key==="Escape"&&o("close")}Zt(()=>document.addEventListener("keydown",u)),Ft(()=>document.removeEventListener("keydown",u));function d(){EM()}const f=F(()=>{const E=new Map;for(const k of s.models??[])E.set(k.id,{id:k.id,label:k.displayName??k.model??k.id,provider:k.provider});for(const[k,A]of Object.entries(s.config?.models??{})){if(E.has(k))continue;const I=S(A);E.set(k,{id:k,label:_(k,A,I),provider:I??k})}return Array.from(E.values())}),p=F(()=>{const E=new Map;for(const k of f.value){const A=E.get(k.provider)??[];A.push(k),E.set(k.provider,A)}for(const k of E.values())k.sort((A,I)=>A.label.localeCompare(I.label));return Array.from(E.entries()).toSorted(([k],[A])=>k.localeCompare(A)).map(([k,A])=>({provider:k,options:A}))}),h=F(()=>Object.entries(s.config?.providers??{}).map(([E,k])=>({id:E,provider:k})).sort((E,k)=>E.id.localeCompare(k.id))),g=F(()=>{const E=s.config?.defaultPermissionMode;return E==="auto"||E==="yolo"||E==="manual"?E:"manual"});function S(E){if(!E||typeof E!="object")return;const k=E;return typeof k.provider=="string"?k.provider:void 0}function _(E,k,A){if(!k||typeof k!="object")return E;const I=k,P=typeof I.model=="string"?I.model:void 0,M=A??S(k);return P&&M?`${E} (${M}/${P})`:P?`${E} (${P})`:E}function y(E){return E===!0}function b(E){const k=E.target.value;!k||k===s.config?.defaultModel||o("updateConfig",{defaultModel:k})}function v(E){E!==g.value&&o("updateConfig",{defaultPermissionMode:E})}function w(E){const k=s.config?.[E];o("updateConfig",{[E]:!y(k)})}function N(E){i.value=E}return(E,k)=>(x(),$("div",{class:"backdrop",onClick:k[16]||(k[16]=Je(A=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("settings.title")},[m("div",Zte,[m("span",Jte,O(C(n)("settings.title")),1),m("button",{class:"close-btn",title:C(n)("newSession.close"),onClick:k[0]||(k[0]=A=>o("close"))},[...k[17]||(k[17]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Qte)]),m("div",ene,[m("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),$(Pe,null,Xe(r,A=>m("button",{key:A.id,type:"button",class:Le(["tab",{on:i.value===A.id}]),role:"tab","aria-selected":i.value===A.id,"aria-controls":`settings-panel-${A.id}`,id:`settings-tab-${A.id}`,onClick:I=>N(A.id)},O(C(n)(A.labelKey)),11,nne)),64))],8,tne),m("div",sne,[Lt(m("section",one,[m("section",ine,[m("h3",rne,O(C(n)("settings.appearance")),1),m("div",lne,[m("span",ane,O(C(n)("theme.label")),1),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.label")},[m("button",{type:"button",class:Le(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:k[1]||(k[1]=A=>o("setTheme","modern"))},O(C(n)("theme.modern")),11,une),m("button",{type:"button",class:Le(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:k[2]||(k[2]=A=>o("setTheme","kimi"))},O(C(n)("theme.kimi")),11,dne)],8,cne)]),m("div",fne,[m("span",hne,O(C(n)("theme.colorSchemeLabel")),1),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.colorSchemeLabel")},[m("button",{type:"button",class:Le(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:k[3]||(k[3]=A=>o("setColorScheme","light"))},O(C(n)("theme.light")),11,mne),m("button",{type:"button",class:Le(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:k[4]||(k[4]=A=>o("setColorScheme","dark"))},O(C(n)("theme.dark")),11,gne),m("button",{type:"button",class:Le(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:k[5]||(k[5]=A=>o("setColorScheme","system"))},O(C(n)("theme.system")),11,vne)],8,pne)]),m("div",yne,[m("span",kne,O(C(n)("settings.uiFontSize")),1),m("label",bne,[m("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:k[6]||(k[6]=A=>o("setUiFontSize",Number(A.target.value)))},null,40,_ne),k[18]||(k[18]=m("span",{class:"num-unit"},"px",-1))])]),m("div",wne,[m("span",Sne,O(C(n)("sidebar.language")),1),gt(AM)])]),m("section",Cne,[m("h3",xne,O(C(n)("settings.notifications")),1),m("div",Tne,[m("span",Mne,[dt(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),$("span",Ane,O(C(n)("settings.notifyDenied")),1)):ie("",!0)]),m("button",{type:"button",class:Le(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:k[7]||(k[7]=A=>o("setNotify",!e.notify))},[...k[19]||(k[19]=[m("span",{class:"knob"},null,-1)])],10,Ene)])]),m("section",$ne,[m("h3",Ine,O(C(n)("settings.account")),1),m("div",Nne,[m("span",Lne,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(x(),$("span",{key:0,class:"rvalue",title:e.accountModel},O(e.accountModel),9,One)):ie("",!0)]),m("div",Pne,[m("button",{type:"button",class:"act",onClick:k[8]||(k[8]=A=>{o("openOnboarding"),o("close")})},O(C(n)("onboarding.reopen")),1),e.authReady?(x(),$("button",{key:0,type:"button",class:"act danger",onClick:k[9]||(k[9]=A=>o("logout"))},O(C(n)("sidebar.signOut")),1)):(x(),$("button",{key:1,type:"button",class:"act signin",onClick:k[10]||(k[10]=A=>o("login"))},O(C(n)("sidebar.signIn")),1))])]),m("section",Rne,[m("h3",Dne,O(C(n)("settings.build")),1),m("div",Bne,[m("span",Fne,O(C(n)("settings.serverVersion")),1),m("span",Hne,O(e.serverVersion||"-"),1)])])],512),[[Bo,i.value==="general"]]),Lt(m("section",Wne,[m("section",Une,[m("div",jne,[m("h3",qne,O(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),$("span",zne,O(C(n)("settings.saving")),1)):ie("",!0)]),e.config?(x(),$(Pe,{key:0},[m("div",Vne,[m("span",Kne,[dt(O(C(n)("settings.defaultModel"))+" ",1),m("span",Gne,O(C(n)("settings.defaultModelHint")),1)]),p.value.length>0?(x(),$("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),onChange:b},[e.config.defaultModel?ie("",!0):(x(),$("option",Xne,O(C(n)("settings.noDefaultModel")),1)),(x(!0),$(Pe,null,Xe(p.value,A=>(x(),$("optgroup",{key:A.provider,label:A.provider},[(x(!0),$(Pe,null,Xe(A.options,I=>(x(),$("option",{key:I.id,value:I.id},O(I.label),9,Jne))),128))],8,Zne))),128))],40,Yne)):(x(),$("span",Qne,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),m("div",ese,[m("span",tse,[dt(O(C(n)("settings.defaultPermission"))+" ",1),m("span",nse,O(C(n)("settings.defaultPermissionHint")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("settings.defaultPermission")},[(x(),$(Pe,null,Xe(a,A=>m("button",{key:A,type:"button",class:Le(["opt",{on:g.value===A}]),"aria-pressed":g.value===A,disabled:e.configSaving,onClick:I=>v(A)},O(C(n)(`settings.permission.${A}`)),11,ose)),64))],8,sse)]),m("div",ise,[m("span",rse,[dt(O(C(n)("settings.defaultThinking"))+" ",1),m("span",lse,O(C(n)("settings.defaultThinkingHint")),1)]),m("button",{type:"button",class:Le(["switch",{on:y(e.config.defaultThinking)}]),role:"switch","aria-checked":y(e.config.defaultThinking),disabled:e.configSaving,onClick:k[11]||(k[11]=A=>w("defaultThinking"))},[...k[20]||(k[20]=[m("span",{class:"knob"},null,-1)])],10,ase)]),m("div",cse,[m("span",use,[dt(O(C(n)("settings.defaultPlanMode"))+" ",1),m("span",dse,O(C(n)("settings.defaultPlanModeHint")),1)]),m("button",{type:"button",class:Le(["switch",{on:y(e.config.defaultPlanMode)}]),role:"switch","aria-checked":y(e.config.defaultPlanMode),disabled:e.configSaving,onClick:k[12]||(k[12]=A=>w("defaultPlanMode"))},[...k[21]||(k[21]=[m("span",{class:"knob"},null,-1)])],10,fse)]),m("div",hse,[m("span",pse,[dt(O(C(n)("settings.mergeSkills"))+" ",1),m("span",mse,O(C(n)("settings.mergeSkillsHint")),1)]),m("button",{type:"button",class:Le(["switch",{on:y(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:k[13]||(k[13]=A=>w("mergeAllAvailableSkills"))},[...k[22]||(k[22]=[m("span",{class:"knob"},null,-1)])],10,gse)]),e.config.telemetry!==void 0?(x(),$("div",vse,[m("span",yse,O(C(n)("settings.telemetry")),1),m("button",{type:"button",class:Le(["switch",{on:y(e.config.telemetry)}]),role:"switch","aria-checked":y(e.config.telemetry),disabled:e.configSaving,onClick:k[14]||(k[14]=A=>w("telemetry"))},[...k[23]||(k[23]=[m("span",{class:"knob"},null,-1)])],10,kse)])):ie("",!0),h.value.length>0?(x(),$("div",bse,[(x(!0),$(Pe,null,Xe(h.value,({id:A,provider:I})=>(x(),$("div",{key:A,class:"provider-row"},[m("div",_se,[m("span",wse,O(A),1),m("span",Sse,O(I.type),1)]),m("div",Cse,[m("span",{class:Le(["provider-badge",I.hasApiKey?"ok":"warn"])},O(I.hasApiKey?C(n)("settings.credentialReady"):C(n)("settings.credentialMissing")),3),I.defaultModel?(x(),$("span",xse,O(I.defaultModel),1)):ie("",!0)])]))),128))])):ie("",!0)],64)):(x(),$("div",Tse,O(C(n)("settings.configUnavailable")),1))])],512),[[Bo,i.value==="agent"]]),Lt(m("section",Mse,[m("section",Ase,[m("h3",Ese,O(C(n)("settings.advanced")),1),m("div",$se,[m("span",Ise,O(C(n)("sidebar.daemon")),1),m("span",Nse,O(C(l)),1)]),m("div",Lse,[m("span",Ose,[dt(O(C(n)("settings.exportLog"))+" ",1),C(li)()?ie("",!0):(x(),$("span",Pse,O(C(n)("settings.logHint")),1))]),m("button",{type:"button",class:"act",onClick:d},O(C(n)("settings.exportLogBtn")),1)])])],512),[[Bo,i.value==="advanced"]]),Lt(m("section",Rse,[m("section",Dse,[m("h3",Bse,O(C(n)("settings.beta")),1),m("div",Fse,[m("span",Hse,[dt(O(C(n)("settings.betaToc"))+" ",1),m("span",Wse,O(C(n)("settings.betaTocHint")),1)]),m("button",{type:"button",class:Le(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:k[15]||(k[15]=A=>o("setBetaToc",!e.betaToc))},[...k[24]||(k[24]=[m("span",{class:"knob"},null,-1)])],10,Use)])])],512),[[Bo,i.value==="experimental"]])])])],8,Xte)]))}}),qse=vt(jse,[["__scopeId","data-v-2f40622b"]]),zse=["aria-label"],Vse={class:"dh"},Kse={class:"dtitle"},Gse={class:"count"},Yse=["aria-label","title"],Xse={class:"search-wrap"},Zse=["placeholder"],Jse={class:"session-list"},Qse=["aria-selected","onClick","onMouseenter"],eoe={class:"meta"},toe={class:"title"},noe={class:"sub"},soe={class:"ws"},ooe={class:"time"},ioe={key:0,class:"attn-badge"},roe={key:0,class:"empty"},loe={class:"footer-hint"},aoe=Ze({__name:"SessionsDialog",props:{sessions:{},workspaceGroups:{},attentionBySession:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F(()=>{const h={};for(const g of s.workspaceGroups)for(const S of g.sessions)h[S.id]=g.workspace.name;return h}),r=te(""),l=te(null),a=F(()=>{const h=r.value.toLowerCase().trim();return h?s.sessions.filter(g=>g.title.toLowerCase().includes(h)):s.sessions}),c=te(0);Ke(r,()=>{c.value=0});function u(h){o("select",h)}function d(h){return s.attentionBySession[h]??0}function f(h){return d(h.id)>0||h.status==="awaitingApproval"||h.status==="awaitingQuestion"?"attn":h.busy?"run":h.status==="aborted"?"aborted":"idle"}function p(h){if(h.key==="Escape"){o("close");return}if(h.key==="ArrowDown")h.preventDefault(),c.value=Math.min(c.value+1,a.value.length-1);else if(h.key==="ArrowUp")h.preventDefault(),c.value=Math.max(c.value-1,0);else if(h.key==="Enter"){const g=a.value[c.value];g&&u(g.id)}}return Zt(()=>{document.addEventListener("keydown",p),mt(()=>l.value?.focus())}),Ft(()=>{document.removeEventListener("keydown",p)}),(h,g)=>(x(),$("div",{class:"backdrop",onClick:g[2]||(g[2]=Je(S=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("sessions.title")},[m("div",Vse,[m("span",Kse,O(C(n)("sessions.title")),1),m("span",Gse,O(e.sessions.length),1),m("button",{class:"close-btn","aria-label":C(n)("sessions.close"),title:C(n)("sessions.close"),onClick:g[0]||(g[0]=S=>o("close"))},[...g[3]||(g[3]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Yse)]),m("div",Xse,[Lt(m("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":g[1]||(g[1]=S=>r.value=S),class:"search-input",type:"text",placeholder:C(n)("sessions.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Zse),[[wn,r.value]])]),m("div",Jse,[(x(!0),$(Pe,null,Xe(a.value,(S,_)=>(x(),$("div",{key:S.id,class:Le(["session-row",{"is-active":S.id===e.activeId,"is-selected":_===c.value}]),role:"option","aria-selected":S.id===e.activeId,onClick:y=>u(S.id),onMouseenter:y=>c.value=_},[m("span",{class:Le(["dot",f(S)])},null,2),m("div",eoe,[m("span",toe,O(S.title),1),m("span",noe,[m("span",soe,O(i.value[S.id]??C(n)("sessions.noWorkspace")),1),g[4]||(g[4]=m("span",{class:"sep"},"·",-1)),m("span",ooe,O(S.time),1)])]),d(S.id)>0?(x(),$("span",ioe,O(d(S.id)),1)):ie("",!0)],42,Qse))),128)),a.value.length===0?(x(),$("div",roe,O(e.sessions.length===0?C(n)("sessions.emptyNone"):C(n)("sessions.emptyNoMatch")),1)):ie("",!0)]),m("div",loe,O(C(n)("sessions.footerHint")),1)],8,zse)]))}}),coe=vt(aoe,[["__scopeId","data-v-a55eac2e"]]),uoe=["aria-label"],doe={class:"dh"},foe={class:"dtitle"},hoe=["aria-label"],poe={class:"crumbbar"},moe=["disabled","title","aria-label"],goe={class:"crumbs"},voe={key:0,class:"crumb-sep"},yoe=["onClick"],koe={key:0,class:"filterbar"},boe=["placeholder"],_oe={key:0,class:"search-spin","aria-hidden":"true"},woe={class:"folder-list"},Soe={key:0,class:"fl-loading"},Coe=["onClick"],xoe={class:"folder-name search-rel"},Toe={key:0,class:"git-tag"},Moe={key:0,class:"git-branch"},Aoe={key:0,class:"fl-empty"},Eoe={key:1,class:"fl-loading"},$oe=["onClick"],Ioe={class:"folder-name"},Noe={key:0,class:"git-tag"},Loe={key:0,class:"git-branch"},Ooe={key:0,class:"fl-empty"},Poe={class:"paste-label",for:"aw-path"},Roe=["placeholder","onKeydown"],Doe=["disabled","title"],Boe={class:"actions"},Foe=["disabled","title"],Hoe={class:"footer-hint"},Woe=600,Uoe=6,r2=150,joe=Ze({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te(!1),r=te(!1),l=te(""),a=te(null),c=te([]),u=te(""),d=te(!1),f=te([]),p=F(()=>u.value.trim().length>0);let h=0,g=null;function S(L,R){const B=L.toLowerCase(),U=R.toLowerCase();let K=0;for(let V=0;V<U.length&&K<B.length;V++)U[V]===B[K]&&K++;return K===B.length}async function _(L){const R=l.value,B=L.trim();if(!R||B===""){f.value=[],d.value=!1;return}const U=++h;d.value=!0;const K=[],V=[{path:R,depth:0}];let se=0;for(;V.length>0&&se<Woe&&K.length<r2;){if(U!==h)return;const Y=V.shift();se++;let G;try{G=await s.browseFs(Y.path)}catch{continue}if(U!==h)return;for(const ee of G.entries){if(!ee.isDir)continue;const Se=ee.path.startsWith(R)?ee.path.slice(R.length).replace(/^\/+/,""):ee.path;if(S(B,Se||ee.name)&&(K.push({path:ee.path,name:ee.name,rel:Se||ee.name,isGitRepo:ee.isGitRepo,branch:ee.branch}),K.length>=r2))break;Y.depth+1<Uoe&&V.push({path:ee.path,depth:Y.depth+1})}U===h&&(f.value=[...K])}U===h&&(d.value=!1)}Ke(u,L=>{if(g&&clearTimeout(g),L.trim()===""){h++,f.value=[],d.value=!1;return}g=setTimeout(()=>void _(L),220)});const y=te(!1),b=te(""),v=F(()=>b.value.trim()),w=F(()=>{const L=l.value;if(!L)return[];const R=L.split("/").filter(Boolean),B=[{label:"/",path:"/"}];let U="";for(const K of R)U+=`/${K}`,B.push({label:K,path:U});return B}),N=F(()=>l.value.length>0);async function E(L){i.value=!0;try{const R=await s.browseFs(L);if(!R.path){r.value=!0;return}l.value=R.path,a.value=R.parent,c.value=R.entries,u.value="",r.value=!1}catch{r.value=!0}finally{i.value=!1}}function k(L){L.isDir&&E(L.path)}function A(){a.value&&E(a.value)}function I(){N.value&&o("add",l.value)}function P(){v.value.length!==0&&o("add",v.value)}Zt(async()=>{i.value=!0;try{if(s.defaultPath&&(await E(s.defaultPath),!r.value))return;const L=await s.getFsHome();L.home?await E(L.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function M(L){L.key==="Escape"&&o("close")}return Zt(()=>document.addEventListener("keydown",M)),Ft(()=>{document.removeEventListener("keydown",M),g&&clearTimeout(g)}),(L,R)=>(x(),$("div",{class:"backdrop",onClick:R[6]||(R[6]=Je(B=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("workspace.addTitle")},[m("div",doe,[m("span",foe,O(C(n)("workspace.addTitle")),1),m("button",{class:"close-btn","aria-label":C(n)("workspace.cancel"),onClick:R[0]||(R[0]=B=>o("close"))},[...R[7]||(R[7]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,hoe)]),r.value?ie("",!0):(x(),$(Pe,{key:0},[m("div",poe,[m("button",{class:"up-btn",disabled:!a.value,title:C(n)("workspace.up"),"aria-label":C(n)("workspace.up"),onClick:A},[...R[8]||(R[8]=[m("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[m("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,moe),m("div",goe,[(x(!0),$(Pe,null,Xe(w.value,(B,U)=>(x(),$(Pe,{key:B.path},[U>1?(x(),$("span",voe,"/")):ie("",!0),m("button",{class:Le(["crumb",{last:U===w.value.length-1}]),onClick:K=>E(B.path)},O(B.label),11,yoe)],64))),128))])]),i.value?ie("",!0):(x(),$("div",koe,[R[9]||(R[9]=m("svg",{class:"filter-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"7",cy:"7",r:"4.5"}),m("path",{d:"M11 11l3 3"})],-1)),Lt(m("input",{"onUpdate:modelValue":R[1]||(R[1]=B=>u.value=B),class:"filter-input",type:"text",placeholder:C(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[2]||(R[2]=Je(()=>{},["stop"]))},null,40,boe),[[wn,u.value]]),d.value?(x(),$("span",_oe)):ie("",!0)])),m("div",woe,[i.value?(x(),$("div",Soe,O(C(n)("workspace.browsing")),1)):p.value?(x(),$(Pe,{key:1},[(x(!0),$(Pe,null,Xe(f.value,B=>(x(),$("button",{key:B.path,class:"folder-row",onClick:U=>E(B.path)},[R[10]||(R[10]=m("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),m("span",xoe,O(B.rel),1),B.isGitRepo?(x(),$("span",Toe,[dt(O(C(n)("workspace.gitTag")),1),B.branch?(x(),$("span",Moe,O(B.branch),1)):ie("",!0)])):ie("",!0)],8,Coe))),128)),!d.value&&f.value.length===0?(x(),$("div",Aoe,O(C(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&f.value.length===0?(x(),$("div",Eoe,O(C(n)("workspace.searching")),1)):ie("",!0)],64)):(x(),$(Pe,{key:2},[(x(!0),$(Pe,null,Xe(c.value,B=>(x(),$("button",{key:B.path,class:"folder-row",onClick:U=>k(B)},[R[11]||(R[11]=m("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),m("span",Ioe,O(B.name),1),B.isGitRepo?(x(),$("span",Noe,[dt(O(C(n)("workspace.gitTag")),1),B.branch?(x(),$("span",Loe,O(B.branch),1)):ie("",!0)])):ie("",!0)],8,$oe))),128)),c.value.length===0?(x(),$("div",Ooe,O(C(n)("workspace.noSubfolders")),1)):ie("",!0)],64))])],64)),m("div",{class:Le(["paste-section",{"paste-only":r.value}])},[!r.value&&!y.value?(x(),$("button",{key:0,type:"button",class:"paste-toggle",onClick:R[3]||(R[3]=B=>y.value=!0)},O(C(n)("workspace.pasteToggle")),1)):(x(),$(Pe,{key:1},[m("label",Poe,O(C(n)("workspace.pathLabel")),1),Lt(m("input",{id:"aw-path","onUpdate:modelValue":R[4]||(R[4]=B=>b.value=B),class:"paste-input",type:"text",placeholder:C(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:Mo(Je(P,["stop"]),["enter"])},null,40,Roe),[[wn,b.value]]),m("button",{class:"paste-add",disabled:v.value.length===0,title:C(n)("workspace.add"),onClick:P},[...R[12]||(R[12]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Doe)],64))],2),m("div",Boe,[r.value?ie("",!0):(x(),$("button",{key:0,class:"act-btn primary",disabled:!N.value,title:l.value,onClick:I},O(C(n)("workspace.openThisFolder")),9,Foe)),m("button",{class:"act-btn",onClick:R[5]||(R[5]=B=>o("close"))},O(C(n)("workspace.cancel")),1)]),m("div",Hoe,O(C(n)("workspace.browseHint")),1)],8,uoe)]))}}),qoe=vt(joe,[["__scopeId","data-v-da51b020"]]),zoe=["aria-label"],Voe={class:"dh"},Koe={class:"dtitle"},Goe=["title"],Yoe={class:"rows"},Xoe={class:"row"},Zoe={class:"row"},Joe={class:"row"},Qoe={class:"row"},eie={class:"row"},tie={class:"row"},nie={class:"ctx-text"},sie={key:0,class:"bar"},oie={class:"row"},iie=Ze({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),r=F(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const a=F(()=>{const h=s.status.permission;return h==="yolo"?"var(--err)":h==="auto"?"var(--warn)":"var(--ink)"}),c=F(()=>s.planMode?n("status.planOn"):n("status.planOff")),u=F(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=F(()=>typeof s.costUsd=="number"&&s.costUsd>0),f=F(()=>d.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));function p(h){h.key==="Escape"&&o("close")}return Zt(()=>document.addEventListener("keydown",p)),Ft(()=>document.removeEventListener("keydown",p)),(h,g)=>(x(),$("div",{class:"backdrop",onClick:g[1]||(g[1]=Je(S=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("status.statusPanelTitle")},[m("div",Voe,[m("span",Koe,O(C(n)("status.statusPanelTitle")),1),m("button",{class:"close-btn",title:C(n)("status.statusPanelClose"),onClick:g[0]||(g[0]=S=>o("close"))},"✕",8,Goe)]),m("dl",Yoe,[m("div",Xoe,[m("dt",null,O(C(n)("status.statusModel")),1),m("dd",null,O(e.status.model),1)]),m("div",Zoe,[m("dt",null,O(C(n)("status.statusThinking")),1),m("dd",null,O(e.thinking),1)]),m("div",Joe,[m("dt",null,O(C(n)("status.statusPermission")),1),m("dd",{style:Bt({color:a.value})},O(l(e.status.permission)),5)]),m("div",Qoe,[m("dt",null,O(C(n)("status.statusPlanMode")),1),m("dd",{class:Le({"plan-on":e.planMode})},O(c.value),3)]),m("div",eie,[m("dt",null,O(C(n)("status.statusSwarmMode")),1),m("dd",{class:Le({"swarm-on":e.swarmMode})},O(u.value),3)]),m("div",tie,[m("dt",null,O(C(n)("status.statusContext")),1),m("dd",null,[m("span",nie,O(r.value),1),e.status.ctxMax>0?(x(),$("span",sie,[m("i",{style:Bt({width:i.value+"%"})},null,4)])):ie("",!0)])]),m("div",oie,[m("dt",null,O(C(n)("status.statusCost")),1),m("dd",null,O(f.value),1)])])],8,zoe)]))}}),rie=vt(iie,[["__scopeId","data-v-230d4b38"]]),lie={key:0,class:"toasts",role:"status","aria-live":"polite"},aie=["onPointerenter","onPointerleave"],cie={class:"body"},uie={class:"title"},die={key:0,class:"msg"},fie={key:1,class:"actions"},hie=["onClick"],pie=["onClick"],mie={key:2,class:"details"},gie=["aria-label","onClick"],vie=Ze({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t();function i(k){return typeof k=="object"&&k!==null}function r(k){return i(k)?k.title:k}function l(k){return i(k)?k.message??"":""}function a(k){return i(k)?k.details:void 0}function c(k){return i(k)?k.severity==="error":k.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(k)}function u(k){return i(k)?`notice:${k.severity}:${k.title}:${k.message??""}:${JSON.stringify(k.details??[])}`:`text:${k}`}function d(k){if(!i(k))return k;const A=[k.title];k.message&&A.push(k.message);const I=k.details??[];if(I.length>0){A.push("",`${o("warnings.diagnostics")}:`);for(const P of I)A.push(`${P.label}: ${P.value}`)}return A.join(`
254
+ `)}let f=1;const p=te([]),h=new Map,g=new Map;function S(k){const A=c(k)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?A+5e3:A}function _(k,A){const I=h.get(k)??{handle:null,deadline:0,remaining:0};I.handle=setTimeout(()=>E(k),A),I.deadline=Date.now()+A,h.set(k,I)}function y(k){const A=h.get(k);A&&A.handle!==null&&clearTimeout(A.handle),h.delete(k)}function b(k){const A=h.get(k);!A||A.handle===null||(clearTimeout(A.handle),A.handle=null,A.remaining=Math.max(0,A.deadline-Date.now()))}function v(k){if(p.value.find(P=>P.id===k)?.detailsOpen)return;const I=h.get(k);!I||I.handle!==null||_(k,I.remaining)}function w(k){k.detailsOpen=!k.detailsOpen,k.detailsOpen?b(k.id):v(k.id)}async function N(k){if(!await ks(d(k.warning)))return;k.copied=!0;const I=g.get(k.id);I&&clearTimeout(I),g.set(k.id,setTimeout(()=>{k.copied=!1,g.delete(k.id)},1400))}function E(k){y(k);const A=g.get(k);A&&clearTimeout(A),g.delete(k);const I=p.value.findIndex(P=>P.id===k);I!==-1&&(p.value=p.value.filter(P=>P.id!==k),s("dismiss",I))}return Ke(()=>n.warnings,k=>{const A=[...p.value];p.value=k.map(I=>{const P=u(I),M=A.findIndex(B=>B.key===P),L=M===-1?void 0:A.splice(M,1)[0];if(L)return L.warning=I,L;const R={id:f++,key:P,warning:I,detailsOpen:!1,copied:!1};return _(R.id,S(I)),R});for(const I of A){y(I.id);const P=g.get(I.id);P&&clearTimeout(P),g.delete(I.id)}},{immediate:!0,flush:"post"}),Ft(()=>{h.forEach(k=>{k.handle!==null&&clearTimeout(k.handle)}),h.clear(),g.forEach(k=>clearTimeout(k)),g.clear()}),(k,A)=>p.value.length?(x(),$("div",lie,[(x(!0),$(Pe,null,Xe(p.value,I=>(x(),$("div",{key:I.id,class:Le(["toast",{err:c(I.warning)}]),onPointerenter:P=>b(I.id),onPointerleave:P=>v(I.id)},[A[1]||(A[1]=m("span",{class:"dot","aria-hidden":"true"},null,-1)),m("div",cie,[m("div",uie,O(r(I.warning)),1),l(I.warning)?(x(),$("div",die,O(l(I.warning)),1)):ie("",!0),a(I.warning)?.length?(x(),$("div",fie,[m("button",{class:"link",type:"button",onClick:P=>w(I)},O(I.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,hie),m("button",{class:"link",type:"button",onClick:P=>N(I)},O(I.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,pie)])):ie("",!0),I.detailsOpen&&a(I.warning)?.length?(x(),$("dl",mie,[(x(!0),$(Pe,null,Xe(a(I.warning),P=>(x(),$("div",{key:`${P.label}:${P.value}`,class:"detail-row"},[m("dt",null,O(P.label),1),m("dd",null,O(P.value),1)]))),128))])):ie("",!0)]),m("button",{class:"x",type:"button","aria-label":C(o)("warnings.dismiss"),onClick:P=>E(I.id)},[...A[0]||(A[0]=[m("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[m("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,gie)],42,aie))),128))])):ie("",!0)}}),yie=vt(vie,[["__scopeId","data-v-45432ab6"]]),kie={class:"topbar"},bie={class:"wsq"},_ie=["aria-label"],wie={class:"tb-path"},Sie={class:"ws"},Cie={class:"se"},xie={class:"tb-sub"},Tie=["aria-label"],Mie=Ze({__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}=_t(),s=e,o=t,i=F(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=F(()=>s.workspace?.name??n("workspace.noWorkspace")),l=F(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),$("div",kie,[m("span",bie,O(i.value),1),m("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[m("span",wie,[m("span",Sie,O(r.value),1),e.sessionTitle?(x(),$(Pe,{key:0},[c[2]||(c[2]=m("span",{class:"sl"},"/",-1)),m("span",Cie,O(e.sessionTitle),1)],64)):ie("",!0),c[3]||(c[3]=m("span",{class:"cv"},"⌄",-1))]),m("span",xie,[m("span",{class:Le(["rd",{on:e.running}])},null,2),m("span",null,O(l.value),1),e.branch?(x(),$(Pe,{key:0},[dt(" · "+O(e.branch),1)],64)):ie("",!0),e.sessionCount>0?(x(),$(Pe,{key:1},[dt(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ie("",!0)])],8,_ie),m("button",{type:"button",class:"tb-set","aria-label":C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},[...c[4]||(c[4]=[yr('<svg viewBox="0 0 24 24" width="21" height="21" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true" data-v-135bd6bf><line x1="4" y1="8" x2="20" y2="8" data-v-135bd6bf></line><circle cx="10" cy="8" r="2.5" fill="var(--bg)" data-v-135bd6bf></circle><line x1="4" y1="16" x2="20" y2="16" data-v-135bd6bf></line><circle cx="15" cy="16" r="2.5" fill="var(--bg)" data-v-135bd6bf></circle></svg>',1)])],8,Tie)]))}}),Aie=vt(Mie,[["__scopeId","data-v-135bd6bf"]]),Eie={key:0,class:"sheet-root"},$ie=["aria-label"],Iie=["aria-label"],Nie={key:0,class:"sheet-head"},Lie={class:"sheet-title"},Oie={class:"sheet-body"},Pie=Ze({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ke(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Ft(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),je(Oi,{name:"sheet"},{default:In(()=>[e.modelValue?(x(),$("div",Eie,[m("div",{class:"sheet-scrim",onClick:i}),m("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[m("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Iie),e.title?(x(),$("div",Nie,[m("span",Lie,O(e.title),1)])):ie("",!0),m("div",Oie,[ia(l.$slots,"default",{},void 0,!0)])],8,$ie)])):ie("",!0)]),_:3}))}}),$M=vt(Pie,[["__scopeId","data-v-aa55810a"]]),Rie={class:"mlist"},Die={key:0,class:"mempty"},Bie=["onClick"],Fie={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},Hie={class:"mgh-main"},Wie={class:"mgh-name"},Uie=["title"],jie={key:0,class:"att"},qie=["title","aria-label","onClick"],zie=["title","aria-label","onClick"],Vie=["onClick"],Kie=["onClick"],Gie={key:0,class:"mempty small"},Yie=["onClick"],Xie={class:"m"},Zie={class:"s"},Jie={key:0,class:"att"},Qie=["title","onClick"],ere=["onClick"],tre=["onClick"],nre=["disabled","onClick"],sre=Ze({__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}=_t(),s=e,o=t;function i(){o("update:modelValue",!1)}function r(I){o("select",I),i()}function l(I){o("createInWorkspace",I),i()}function a(){o("create"),i()}function c(){o("addWorkspace"),i()}const u=te(new Set);function d(I){return u.value.has(I)}function f(I){const P=new Set(u.value);P.has(I)?P.delete(I):P.add(I),u.value=P,h.value=null,v.value=null}function p(I){return s.attentionByWorkspace[I]??0}const h=te(null),g=te(null);let S;function _(I){h.value=h.value===I?null:I,v.value=null,clearTimeout(S),g.value=null}function y(I){h.value=null;const M=(typeof window<"u"?window.prompt(n("sidebar.rename"),I.title):null)?.trim();M&&o("rename",I.id,M)}function b(I){if(g.value===I){clearTimeout(S),g.value=null,h.value=null,o("archive",I);return}clearTimeout(S),g.value=I,S=setTimeout(()=>{g.value=null},2500)}const v=te(null),w=te(null);let N;function E(I){v.value=v.value===I?null:I,h.value=null,clearTimeout(N),w.value=null}function k(I){ks(I.root),v.value=null}function A(I){if(w.value===I){clearTimeout(N),w.value=null,v.value=null,o("deleteWorkspace",I);return}clearTimeout(N),w.value=I,N=setTimeout(()=>{w.value=null},2500)}return Ft(()=>{clearTimeout(S),clearTimeout(N)}),(I,P)=>(x(),je($M,{"model-value":e.modelValue,"onUpdate:modelValue":P[2]||(P[2]=M=>o("update:modelValue",M))},{default:In(()=>[m("button",{type:"button",class:"newrow",onClick:a},[P[3]||(P[3]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),dt(" "+O(C(n)("sidebar.newChat")),1)]),m("button",{type:"button",class:"newrow secondary",onClick:c},[P[4]||(P[4]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"})],-1)),dt(" "+O(C(n)("sidebar.newWorkspace")),1)]),m("div",Rie,[e.groups.length===0?(x(),$("div",Die,O(C(n)("workspace.noWorkspace")),1)):ie("",!0),(x(!0),$(Pe,null,Xe(e.groups,M=>(x(),$("div",{key:M.workspace.id,class:"mgroup"},[m("div",{class:Le(["mgh",{on:M.workspace.id===e.activeWorkspaceId}]),onClick:L=>f(M.workspace.id)},[(x(),$("svg",Fie,[d(M.workspace.id)?(x(),$(Pe,{key:0},[P[5]||(P[5]=m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),P[6]||(P[6]=m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(x(),$(Pe,{key:1},[P[7]||(P[7]=m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),P[8]||(P[8]=m("path",{d:"M1 5.5h12"},null,-1))],64))])),m("div",Hie,[m("span",Wie,O(M.workspace.name),1),m("span",{class:"mgh-path",title:M.workspace.root},O(M.workspace.branch||M.workspace.shortPath),9,Uie)]),d(M.workspace.id)&&p(M.workspace.id)>0?(x(),$("span",jie,O(p(M.workspace.id)),1)):ie("",!0),m("button",{type:"button",class:"mgh-more",title:C(n)("sidebar.options"),"aria-label":C(n)("sidebar.options"),onClick:Je(L=>E(M.workspace.id),["stop"])},[...P[9]||(P[9]=[m("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,qie),m("button",{type:"button",class:"mgh-add",title:C(n)("workspace.newInGroup"),"aria-label":C(n)("workspace.newInGroup"),onClick:Je(L=>l(M.workspace.id),["stop"])},"+",8,zie),v.value===M.workspace.id?(x(),$("div",{key:1,class:"kmenu wsmenu",onClick:P[0]||(P[0]=Je(()=>{},["stop"]))},[m("button",{class:"kitem",onClick:Je(L=>k(M.workspace),["stop"])},O(C(n)("sidebar.copyPath")),9,Vie),m("button",{class:"kitem archive",onClick:Je(L=>A(M.workspace.id),["stop"])},O(w.value===M.workspace.id?C(n)("sidebar.confirm"):C(n)("sidebar.delete")),9,Kie)])):ie("",!0)],10,Bie),Lt(m("div",null,[M.sessions.length===0?(x(),$("div",Gie,O(C(n)("sidebar.noSessions")),1)):ie("",!0),(x(!0),$(Pe,null,Xe(M.sessions,L=>(x(),$("div",{key:L.id,class:Le(["srow",{cur:L.id===e.activeId}]),onClick:R=>r(L.id)},[m("div",Xie,[m("div",{class:Le(["t",{run:L.busy,aborted:L.status==="aborted"}])},O(L.title),3),m("div",Zie,O(L.time),1)]),(e.attentionBySession[L.id]??0)>0?(x(),$("span",Jie,O(e.attentionBySession[L.id]),1)):ie("",!0),m("button",{type:"button",class:"kb",title:C(n)("sidebar.options"),onClick:Je(R=>_(L.id),["stop"])},[...P[10]||(P[10]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Qie),h.value===L.id?(x(),$("div",{key:1,class:"kmenu",onClick:P[1]||(P[1]=Je(()=>{},["stop"]))},[m("button",{class:"kitem",onClick:Je(R=>y(L),["stop"])},O(C(n)("sidebar.rename")),9,ere),m("button",{class:"kitem archive",onClick:Je(R=>b(L.id),["stop"])},O(g.value===L.id?C(n)("sidebar.archiveConfirm"):C(n)("sidebar.archive")),9,tre)])):ie("",!0)],10,Yie))),128)),M.hasMore||M.loadingMore?(x(),$("button",{key:1,type:"button",class:"mshow-more",disabled:M.loadingMore,onClick:Je(L=>o("loadMore",M.workspace.id),["stop"])},O(M.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,M.workspace.sessionCount-M.sessions.length)})),9,nre)):ie("",!0)],512),[[Bo,!d(M.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),ore=vt(sre,[["__scopeId","data-v-d8b693db"]]),ire={class:"srow-main"},rre={class:"srow-label"},lre={class:"srow-sub"},are={class:"srow-main"},cre={class:"srow-label"},ure={class:"srow-val"},dre={class:"srow-main"},fre={class:"srow-label"},hre={class:"srow-sub"},pre=["aria-checked"],mre={class:"srow-main"},gre={class:"srow-label"},vre={class:"srow-sub"},yre=["aria-checked"],kre={class:"srow-main"},bre={class:"srow-label"},_re={class:"srow read-only"},wre={class:"srow-main"},Sre={class:"srow-label"},Cre={class:"srow-sub"},xre=["aria-label"],Tre={class:"srow read-only pref"},Mre={class:"srow-main"},Are={class:"srow-label"},Ere=["aria-label"],$re=["aria-pressed"],Ire=["aria-pressed"],Nre={class:"srow read-only pref"},Lre={class:"srow-main"},Ore={class:"srow-label"},Pre=["aria-label"],Rre=["aria-pressed"],Dre=["aria-pressed"],Bre=["aria-pressed"],Fre={class:"srow read-only pref"},Hre={class:"srow-main"},Wre={class:"srow-label"},Ure={class:"srow read-only pref"},jre={class:"srow-main"},qre={class:"srow-label"},zre={class:"num-field"},Vre=["value","aria-label"],Kre={class:"srow-main"},Gre={class:"srow-label"},Yre={class:"srow-sub"},Xre=["aria-checked"],Zre={class:"srow-main"},Jre={class:"srow-label"},Qre={class:"srow-main"},ele={class:"srow-label"},tle={key:2,class:"srow read-only"},nle={class:"srow-main"},sle={class:"srow-label"},ole={class:"srow-val dim"},ile=Ze({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},theme:{default:"terminal"},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},betaToc:{type:Boolean},serverVersion:{default:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setTheme","setColorScheme","setUiFontSize","setBetaToc","login","logout"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=["manual","auto","yolo"],r=F(()=>s.thinking??"high"),l=F(()=>s.planMode===!0),a=F(()=>s.swarmMode===!0),c=F(()=>{const b=s.status.permission;return b==="yolo"?"var(--err)":b==="auto"?"var(--warn)":"var(--faint)"}),u=F(()=>{const b=s.status.permission,v=n(b==="yolo"?"mobile.permYoloSub":b==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${b} · ${v}`}),d=b=>`${Math.round(b/1e3)}k`,f=F(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),p=F(()=>s.status.ctxMax>0?`${d(s.status.ctxUsed)}/${d(s.status.ctxMax)}`:n("status.statusNone"));function h(){o("setThinking",r.value==="off"?"high":"off")}function g(){const b=i.indexOf(s.status.permission),v=i[(b+1)%i.length];o("setPermission",v)}function S(){o("pickModel"),o("update:modelValue",!1)}function _(){o("login"),o("update:modelValue",!1)}function y(){o("logout"),o("update:modelValue",!1)}return(b,v)=>(x(),je($M,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":v[9]||(v[9]=w=>o("update:modelValue",w))},{default:In(()=>[m("button",{type:"button",class:"srow",onClick:S},[m("span",ire,[m("span",rre,O(C(n)("status.statusModel")),1),m("span",lre,O(e.status.model),1)]),v[10]||(v[10]=m("span",{class:"chev"},"›",-1))]),m("button",{type:"button",class:"srow",onClick:h},[m("span",are,[m("span",cre,O(C(n)("status.statusThinking")),1)]),m("span",ure,O(r.value==="off"?C(n)("status.planOff"):C(n)("status.planOn")),1),v[11]||(v[11]=m("span",{class:"chev"},"›",-1))]),m("button",{type:"button",class:"srow",onClick:v[0]||(v[0]=w=>o("togglePlan"))},[m("span",dre,[m("span",fre,O(C(n)("status.statusPlanMode")),1),m("span",hre,O(C(n)("mobile.planModeSub")),1)]),m("span",{class:Le(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,pre)]),m("button",{type:"button",class:"srow",onClick:v[1]||(v[1]=w=>o("toggleSwarm"))},[m("span",mre,[m("span",gre,O(C(n)("status.statusSwarmMode")),1),m("span",vre,O(C(n)("mobile.swarmModeSub")),1)]),m("span",{class:Le(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,yre)]),m("button",{type:"button",class:"srow",onClick:g},[m("span",kre,[m("span",bre,O(C(n)("status.statusPermission")),1),m("span",{class:"srow-sub",style:Bt({color:c.value})},O(u.value),5)]),v[12]||(v[12]=m("span",{class:"chev"},"›",-1))]),m("div",_re,[m("span",wre,[m("span",Sre,O(C(n)("status.statusContext")),1),m("span",Cre,O(p.value),1)]),m("span",{class:"ctx-meter","aria-label":p.value},[m("i",{style:Bt({width:f.value+"%"})},null,4)],8,xre)]),m("div",Tre,[m("span",Mre,[m("span",Are,O(C(n)("theme.label")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.label")},[m("button",{type:"button",class:Le(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:v[2]||(v[2]=w=>o("setTheme","modern"))},O(C(n)("theme.modern")),11,$re),m("button",{type:"button",class:Le(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:v[3]||(v[3]=w=>o("setTheme","kimi"))},O(C(n)("theme.kimi")),11,Ire)],8,Ere)]),m("div",Nre,[m("span",Lre,[m("span",Ore,O(C(n)("theme.colorSchemeLabel")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.colorSchemeLabel")},[m("button",{type:"button",class:Le(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:v[4]||(v[4]=w=>o("setColorScheme","light"))},O(C(n)("theme.light")),11,Rre),m("button",{type:"button",class:Le(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:v[5]||(v[5]=w=>o("setColorScheme","dark"))},O(C(n)("theme.dark")),11,Dre),m("button",{type:"button",class:Le(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:v[6]||(v[6]=w=>o("setColorScheme","system"))},O(C(n)("theme.system")),11,Bre)],8,Pre)]),m("div",Fre,[m("span",Hre,[m("span",Wre,O(C(n)("sidebar.language")),1)]),gt(AM)]),m("div",Ure,[m("span",jre,[m("span",qre,O(C(n)("settings.uiFontSize")),1)]),m("label",zre,[m("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:v[7]||(v[7]=w=>o("setUiFontSize",Number(w.target.value)))},null,40,Vre),v[13]||(v[13]=m("span",{class:"num-unit"},"px",-1))])]),m("button",{type:"button",class:"srow",onClick:v[8]||(v[8]=w=>o("setBetaToc",!e.betaToc))},[m("span",Kre,[m("span",Gre,O(C(n)("settings.betaToc")),1),m("span",Yre,O(C(n)("settings.betaTocHint")),1)]),m("span",{class:Le(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,Xre)]),e.authReady?(x(),$("button",{key:0,type:"button",class:"srow acct out",onClick:y},[m("span",Zre,[m("span",Jre,O(C(n)("sidebar.signOut")),1)])])):(x(),$("button",{key:1,type:"button",class:"srow acct in",onClick:_},[m("span",Qre,[m("span",ele,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),$("div",tle,[m("span",nle,[m("span",sle,O(C(n)("settings.serverVersion")),1)]),m("span",ole,O(e.serverVersion),1)])):ie("",!0)]),_:1},8,["model-value","title"]))}}),rle=vt(ile,[["__scopeId","data-v-33721a82"]]),lle={class:"ob-backdrop"},ale=["aria-label"],cle=["aria-label"],ule={class:"ob-brand"},dle={class:"ob-title"},fle={class:"ob-sub"},hle={class:"ob-sec"},ple={class:"ob-label"},mle={class:"ob-seg",role:"group"},gle=["aria-pressed","onClick"],vle={class:"ob-sec"},yle={class:"ob-label"},kle={class:"ob-themes"},ble=["aria-pressed"],_le={class:"ob-theme-name"},wle={class:"ob-theme-desc"},Sle=["aria-pressed"],Cle={class:"ob-theme-name"},xle={class:"ob-theme-desc"},Tle=Ze({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,s=t,{t:o,locale:i}=_t();function r(c){i.value!==c&&WC(c)}const l=te(n.theme);function a(){l.value!==n.theme&&s("setTheme",l.value),s("complete")}return(c,u)=>(x(),$("div",lle,[m("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":C(o)("onboarding.title")},[m("button",{type:"button",class:"ob-close","aria-label":C(o)("onboarding.skip"),onClick:u[0]||(u[0]=d=>s("skip"))},[...u[3]||(u[3]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,cle),m("div",ule,[u[4]||(u[4]=m("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[m("defs",null,[m("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[m("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),m("g",{class:"ob-eyes",fill:"#000"},[m("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),m("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),m("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obKimiEyes)"})],-1)),m("div",null,[m("div",dle,O(C(o)("onboarding.title")),1),m("div",fle,O(C(o)("onboarding.subtitle")),1)])]),m("section",hle,[m("div",ple,O(C(o)("onboarding.languageLabel")),1),m("div",mle,[(x(!0),$(Pe,null,Xe(C(HC),d=>(x(),$("button",{key:d.code,type:"button",class:Le(["ob-seg-btn",{on:C(i)===d.code}]),"aria-pressed":C(i)===d.code,onClick:f=>r(d.code)},O(d.label),11,gle))),128))])]),m("section",vle,[m("div",yle,O(C(o)("onboarding.themeLabel")),1),m("div",kle,[m("button",{type:"button",class:Le(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=m("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[m("span",{class:"bub u"}),m("span",{class:"bub a"})],-1)),m("span",_le,O(C(o)("theme.modern")),1),m("span",wle,O(C(o)("onboarding.modernDesc")),1)],10,ble),m("button",{type:"button",class:Le(["ob-theme",{on:l.value==="kimi"}]),"aria-pressed":l.value==="kimi",onClick:u[2]||(u[2]=d=>l.value="kimi")},[u[6]||(u[6]=m("span",{class:"ob-theme-prev kimi","aria-hidden":"true"},[m("span",{class:"kb u"}),m("span",{class:"kb a"})],-1)),m("span",Cle,O(C(o)("theme.kimi")),1),m("span",xle,O(C(o)("onboarding.kimiDesc")),1)],10,Sle)])]),m("button",{type:"button",class:"ob-start",onClick:a},O(C(o)("onboarding.start")),1)],8,ale)]))}}),Mle=vt(Tle,[["__scopeId","data-v-0527a631"]]),Ale=["aria-label"],Ele={class:"gload-box"},$le={class:"gload-text"},Ile=Ze({__name:"GlobalLoading",setup(e){const{t}=_t();return(n,s)=>(x(),$("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[m("div",Ele,[s[0]||(s[0]=yr('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-d8748888><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-d8748888></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-d8748888></path></svg><div class="gload-bar" aria-hidden="true" data-v-d8748888><span class="gload-bar-fill" data-v-d8748888></span></div>',2)),m("div",$le,O(C(t)("app.connecting")),1)])],8,Ale))}}),Nle=vt(Ile,[["__scopeId","data-v-d8748888"]]),Lle={class:"kap-root"},Ole={class:"kap-head"},Ple={class:"kap-count"},Rle={class:"kap-head-actions"},Dle={class:"kap-filters"},Ble=["value"],Fle={class:"kap-check"},Hle={class:"kap-check"},Wle={class:"kap-view-toggle",role:"group"},Ule={key:0,class:"kap-empty"},jle=["onClick"],qle={class:"kap-ts"},zle={class:"kap-label"},Vle={key:0,class:"kap-detail"},Kle={class:"kap-detail-actions"},Gle=["onClick"],Yle={key:1,class:"kap-agg"},Xle={class:"mono"},Zle={class:"mono"},Jle={class:"num"},Qle={class:"num"},eae={key:0},tae={class:"mono"},nae={class:"num"},sae={class:"num"},oae={key:0},iae=Ze({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=te("all"),o=te(""),i=te(""),r=te(!1),l=te("timeline"),a=F(()=>(Kv.value,[...Ute()])),c=F(()=>{const A=new Set;for(const I of a.value)I.sessionId&&A.add(I.sessionId);return[...A].sort()});function u(A){return A.kind==="rest:error"||A.code!==void 0&&A.code!==0||A.eventType==="error"||A.eventType==="parse-error"}const d=F(()=>{const A=o.value.trim().toLowerCase();return a.value.filter(I=>!(s.value!=="all"&&I.source!==s.value||i.value&&I.sessionId!==i.value||r.value&&!u(I)||A&&!`${I.label} ${I.kind} ${I.eventType??""} ${I.sessionId??""} ${I.requestId??""}`.toLowerCase().includes(A)))}),f=F(()=>{const A=new Map;for(const I of d.value){if(I.kind!=="ws:in"&&I.kind!=="ws:out")continue;const P=I.kind==="ws:in"?"←":"→",M=`${P} ${I.eventType??"?"} @ ${I.sessionId??"-"}`,L=A.get(M)??{key:M,sessionId:I.sessionId??"-",eventType:I.eventType??"?",dir:P,count:0};L.count++,I.seq!==void 0&&(L.lastSeq=I.seq),A.set(M,L)}return[...A.values()].sort((I,P)=>P.count-I.count)}),p=F(()=>{const A=new Map;for(const I of d.value){if(I.source!=="rest"||I.kind==="rest:request")continue;const P=`${I.method??"?"} ${I.path??"?"}`,M=A.get(P)??{count:0,errors:0,totalMs:0,timed:0};M.count++,u(I)&&M.errors++,I.durationMs!==void 0&&(M.totalMs+=I.durationMs,M.timed++),A.set(P,M)}return[...A.entries()].map(([I,P])=>({key:I,count:P.count,errors:P.errors,avgMs:P.timed>0?Math.round(P.totalMs/P.timed):0})).sort((I,P)=>P.count-I.count)}),h=te(null),g=te(!0),S=te(null),_=te(null);Ke(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await mt();const A=S.value;A&&(A.scrollTop=A.scrollHeight)});function y(A){h.value=h.value===A?null:A}function b(A){const I=new Date(A),P=(M,L=2)=>String(M).padStart(L,"0");return`${P(I.getHours())}:${P(I.getMinutes())}:${P(I.getSeconds())}.${P(I.getMilliseconds(),3)}`}function v(A){return JSON.stringify(A,null,2)}async function w(A){await ks(v(A))&&(_.value=A.id,setTimeout(()=>{_.value===A.id&&(_.value=null)},1500))}function N(){EM(d.value)}function E(A){return u(A)||A.source==="client"?"b-err":A.source==="rest"?"b-rest":A.kind==="ws:lifecycle"?"b-life":A.kind==="ws:out"?"b-out":"b-in"}function k(A){return A.source==="rest"?"REST":A.source==="client"?"APP":"WS"}return(A,I)=>(x(),$("section",Lle,[m("header",Ole,[I[11]||(I[11]=m("strong",null,"KAP debug",-1)),m("span",Ple,O(d.value.length)+"/"+O(a.value.length),1),m("div",Rle,[m("button",{type:"button",class:Le({on:C(pc)}),onClick:I[0]||(I[0]=P=>pc.value=!C(pc))},O(C(pc)?"resume":"pause"),3),m("button",{type:"button",onClick:I[1]||(I[1]=P=>C(jte)())},"clear"),m("button",{type:"button",onClick:I[2]||(I[2]=P=>N())},"export jsonl"),m("button",{type:"button",title:"Close window",onClick:I[3]||(I[3]=P=>n("close"))},"✕")])]),m("div",Dle,[Lt(m("select",{"onUpdate:modelValue":I[4]||(I[4]=P=>s.value=P),"aria-label":"Source filter"},[...I[12]||(I[12]=[m("option",{value:"all"},"rest + ws + app",-1),m("option",{value:"rest"},"rest",-1),m("option",{value:"ws"},"ws",-1),m("option",{value:"client"},"app errors",-1)])],512),[[uf,s.value]]),Lt(m("select",{"onUpdate:modelValue":I[5]||(I[5]=P=>i.value=P),"aria-label":"Session filter"},[I[13]||(I[13]=m("option",{value:""},"all sessions",-1)),(x(!0),$(Pe,null,Xe(c.value,P=>(x(),$("option",{key:P,value:P},O(P),9,Ble))),128))],512),[[uf,i.value]]),Lt(m("input",{"onUpdate:modelValue":I[6]||(I[6]=P=>o.value=P),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[wn,o.value]]),m("label",Fle,[Lt(m("input",{"onUpdate:modelValue":I[7]||(I[7]=P=>r.value=P),type:"checkbox"},null,512),[[cf,r.value]]),I[14]||(I[14]=dt(" errors",-1))]),m("label",Hle,[Lt(m("input",{"onUpdate:modelValue":I[8]||(I[8]=P=>g.value=P),type:"checkbox"},null,512),[[cf,g.value]]),I[15]||(I[15]=dt(" follow",-1))]),m("div",Wle,[m("button",{type:"button",class:Le({on:l.value==="timeline"}),onClick:I[9]||(I[9]=P=>l.value="timeline")},"timeline",2),m("button",{type:"button",class:Le({on:l.value==="aggregate"}),onClick:I[10]||(I[10]=P=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),$("div",{key:0,ref_key:"listRef",ref:S,class:"kap-list"},[d.value.length===0?(x(),$("div",Ule," No trace entries yet. REST calls and WS frames will appear here. ")):ie("",!0),(x(!0),$(Pe,null,Xe(d.value,P=>(x(),$("div",{key:P.id,class:"kap-row-wrap"},[m("button",{type:"button",class:Le(["kap-row",{expanded:h.value===P.id}]),onClick:M=>y(P.id)},[m("span",qle,O(b(P.ts)),1),m("span",{class:Le(["kap-badge",E(P)])},O(k(P)),3),m("span",zle,O(P.label),1)],10,jle),h.value===P.id?(x(),$("div",Vle,[m("div",Kle,[m("button",{type:"button",onClick:M=>w(P)},O(_.value===P.id?"copied ✓":"copy json"),9,Gle)]),m("pre",null,O(v(P)),1)])):ie("",!0)]))),128))],512)):(x(),$("div",Yle,[I[20]||(I[20]=m("h4",null,"WS frames by session / type",-1)),m("table",null,[I[17]||(I[17]=m("thead",null,[m("tr",null,[m("th",null,"dir"),m("th",null,"type"),m("th",null,"session"),m("th",null,"count"),m("th",null,"last seq")])],-1)),m("tbody",null,[(x(!0),$(Pe,null,Xe(f.value,P=>(x(),$("tr",{key:P.key},[m("td",null,O(P.dir),1),m("td",Xle,O(P.eventType),1),m("td",Zle,O(P.sessionId),1),m("td",Jle,O(P.count),1),m("td",Qle,O(P.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),$("tr",eae,[...I[16]||(I[16]=[m("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ie("",!0)])]),I[21]||(I[21]=m("h4",null,"REST by endpoint",-1)),m("table",null,[I[19]||(I[19]=m("thead",null,[m("tr",null,[m("th",null,"endpoint"),m("th",null,"count"),m("th",null,"errors"),m("th",null,"avg ms")])],-1)),m("tbody",null,[(x(!0),$(Pe,null,Xe(p.value,P=>(x(),$("tr",{key:P.key},[m("td",tae,O(P.key),1),m("td",nae,O(P.count),1),m("td",{class:Le(["num",{err:P.errors>0}])},O(P.errors),3),m("td",sae,O(P.avgMs),1)]))),128)),p.value.length===0?(x(),$("tr",oae,[...I[18]||(I[18]=[m("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ie("",!0)])])]))]))}}),rae=vt(iae,[["__scopeId","data-v-79eb55ae"]]),lae=["title"],aae=Ze({__name:"DebugPanel",setup(e){const t=te(!1);let n=null,s=null,o=null;const i=["data-theme","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=df(rae,{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 Zt(()=>{c()}),qs(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),$("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,lae))}}),cae=vt(aae,[["__scopeId","data-v-0a50ee88"]]);function IM(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 y1(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 uae(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 ei(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:y1(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:IM(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 Wf(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 l2(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 Gv(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:l2(e.source)};case"video":return{type:"video",source:l2(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 k1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Gv),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function dae(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 fae(e){return{content:e.content.map(dae),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 hae(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function NM(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 pae(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function mae(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(pae),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function LM(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(mae),createdAt:e.created_at}}function gae(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 vae(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=gae(s);return{answers:t,method:e.method,note:e.note}}function b1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index}}function a2(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 er(e,t){const n=e[t];return typeof n=="string"?n:void 0}function jl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function bo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function yae(e){if(!e||typeof e!="object")return null;const t=e,n=er(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:er(t,"goalId")??er(t,"goal_id")??"goal",objective:er(t,"objective")??"",completionCriterion:er(t,"completionCriterion")??er(t,"completion_criterion"),status:n,turnsUsed:jl(t,"turnsUsed")??jl(t,"turns_used")??0,tokensUsed:jl(t,"tokensUsed")??jl(t,"tokens_used")??0,wallClockMs:jl(t,"wallClockMs")??jl(t,"wall_clock_ms")??0,terminalReason:er(t,"terminalReason")??er(t,"terminal_reason"),budget:{tokenBudget:bo(o,"tokenBudget")??bo(o,"token_budget"),remainingTokens:bo(o,"remainingTokens")??bo(o,"remaining_tokens"),turnBudget:bo(o,"turnBudget")??bo(o,"turn_budget"),remainingTurns:bo(o,"remainingTurns")??bo(o,"remaining_turns"),wallClockBudgetMs:bo(o,"wallClockBudgetMs")??bo(o,"wall_clock_budget_ms"),remainingWallClockMs:bo(o,"remainingWallClockMs")??bo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function kae(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ei(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ei(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:Wf(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Wf(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:y1(t.payload.status),previousStatus:y1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:IM(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=yae(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:k1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Gv),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:NM(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:LM(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:b1(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:_1(t.payload.config)};default:return{type:"unknown",raw:e}}}function bae(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function Gm(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 _1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultThinking:e.default_thinking,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function _ae(e){return e.session_id}function wae(e){return e.seq}const Sae="main",Cae=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 ir(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 xae(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 c2(){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 Js(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Xr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function _o(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Tae(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=Js(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=Js(t,"goalId")??Js(t,"goal_id")??"goal",r=Js(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:Js(t,"completionCriterion")??Js(t,"completion_criterion"),status:o,turnsUsed:Xr(t,"turnsUsed")??Xr(t,"turns_used")??0,tokensUsed:Xr(t,"tokensUsed")??Xr(t,"tokens_used")??0,wallClockMs:Xr(t,"wallClockMs")??Xr(t,"wall_clock_ms")??0,terminalReason:Js(t,"terminalReason")??Js(t,"terminal_reason"),budget:{tokenBudget:_o(s,"tokenBudget")??_o(s,"token_budget"),remainingTokens:_o(s,"remainingTokens")??_o(s,"remaining_tokens"),turnBudget:_o(s,"turnBudget")??_o(s,"turn_budget"),remainingTurns:_o(s,"remainingTurns")??_o(s,"remaining_turns"),wallClockBudgetMs:_o(s,"wallClockBudgetMs")??_o(s,"wall_clock_budget_ms"),remainingWallClockMs:_o(s,"remainingWallClockMs")??_o(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function mc(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 Mae(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=Js(t,"name")??Js(t,"toolName")??"tool",s=gf(Aae(n)),o=Eae(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=Js(n,"text");if(o)return Ym(o);const i=Js(n,"message");if(i)return Ym(i)}const s=Js(t,"message");if(s)return Ym(s)}return null}function Aae(e){return e.replace(/_\d+$/,"")}const u2=2e3;function Ym(e){return e.length>u2?`${e.slice(0,u2)}…`:e}function Eae(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Ag(e,n)}function $ae(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];const r=Mae(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=mc(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 _d(e){return{...e,content:e.content.map(t=>({...t}))}}function d2(e,t,n){const s={id:ir("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Iae(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 Nae(e){return Array.isArray(e)?e.map(t=>Gv(t)):[]}function f2(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 Lae(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 Oae(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 h2(e,t){e.messages.find(n=>n.id===t)}function Pae(e,t,n,s,o,i){const r={id:ir("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 Xm(e,t){return e.messages.find(n=>n.id===t)}function p2(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 Rae(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=c2(),e.set(u,d)),d}function s(u){e.set(u,c2())}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??ir("pr_");f.currentPromptId=p,f.turnPromptId.set(d.turnId,p);const h=d2(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 g of d.runningTools){const S=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:S}),f.toolStartTimes.set(g.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:p},{type:"messageCreated",message:_d(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),g=d,S=[],_=g?.agentId;if(typeof _=="string"&&_!==Sae){const y=t.has(_);if(y&&(u==="thinking.delta"||u==="assistant.delta")){const b=g?.delta??"";return b?[{type:"agentDelta",sessionId:f,agentId:_,delta:{[u==="thinking.delta"?"thinking":"text"]:b}}]:[]}if(y&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:_,reason:g?.reason}];if(Cae.has(u))return $ae(h,f,_,u,g??{},t)}switch(u){case"session.meta.updated":{const y=g?.patch?.title??g?.title,b=g?.patch?.lastPrompt,v={};typeof y=="string"&&y.length>0&&(v.title=y),typeof b=="string"&&(v.lastPrompt=b),(v.title!==void 0||v.lastPrompt!==void 0)&&S.push({type:"sessionMetaUpdated",sessionId:f,...v});break}case"prompt.submitted":{const y=g?.promptId,b=g?.userMessageId;if(!y||!b)break;const v=Nae(g?.content);if(v.length===0)break;h.currentPromptId=y;const w=Iae(h,f,y,b,v,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());S.push({type:"messageCreated",message:_d(w)});break}case"turn.started":{const y=g?.turnId,b=h.currentPromptId??ir("pr_");h.currentPromptId=b,y!==void 0&&h.turnPromptId.set(y,b),h.turnTextLen=0,h.turnThinkLen=0,S.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:b});break}case"turn.step.started":{const y=g?.turnId;let b=h.turnPromptId.get(y)??h.currentPromptId;b||(b=ir("pr_"),h.currentPromptId=b,y!==void 0&&h.turnPromptId.set(y,b));const v=d2(h,f,b);h.currentAssistantMsgId=v.id,S.push({type:"messageCreated",message:_d(v)});break}case"thinking.delta":{const y=h.currentAssistantMsgId;if(!y)break;const b=g?.delta??"";if(!b)break;p?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const v=a(h.turnThinkLen,p?.offset);if(v==="skip")break;if(v==="gap"){S.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const w=f2(h,y,"thinking",b);if(w<0)break;h.turnThinkLen+=b.length,S.push({type:"assistantDelta",sessionId:f,messageId:y,contentIndex:w,delta:{thinking:b}});break}case"assistant.delta":{const y=h.currentAssistantMsgId;if(!y)break;const b=g?.delta??"";if(!b)break;p?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const v=a(h.turnTextLen,p?.offset);if(v==="skip")break;if(v==="gap"){S.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const w=f2(h,y,"text",b);if(w<0)break;h.turnTextLen+=b.length,S.push({type:"assistantDelta",sessionId:f,messageId:y,contentIndex:w,delta:{text:b}});break}case"tool.use":case"tool.call.started":{const y=h.currentAssistantMsgId,b=g?.turnId,v=h.turnPromptId.get(b)??h.currentPromptId;if(!y||!v)break;const w=g?.toolCallId,N=g?.name??g?.toolName??"",E=g?.args??g?.input??{};Lae(h,y,w,N,E);const k=Xm(h,y);k&&k.content.length-1,h.toolStartTimes.set(w,Date.now()),k&&S.push({type:"messageUpdated",sessionId:f,messageId:y,content:k.content.map(A=>({...A})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const y=g?.toolCallId,b=Oae(g??{});y&&b&&S.push({type:"toolOutput",sessionId:f,toolCallId:y,outputChunk:b.outputChunk,stream:b.stream});break}case"tool.result":{const y=g?.turnId;let b=h.turnPromptId.get(y)??h.currentPromptId;b||(b=ir("pr_"),h.currentPromptId=b,y!==void 0&&h.turnPromptId.set(y,b));const v=g?.toolCallId,w=g?.output,N=g?.isError??!1;h.toolStartTimes.get(v)??Date.now(),h.toolStartTimes.delete(v);const E=Pae(h,f,v,w,N,b);S.push({type:"messageCreated",message:_d(E)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const y=h.currentAssistantMsgId,b=xae(g?.usage);if(h.totalInput+=b.input,h.totalOutput+=b.output,h.totalCacheRead+=b.cacheRead,h.totalCacheCreate+=b.cacheCreate,y){h2(h,y);const v=Xm(h,y);v&&S.push({type:"messageUpdated",sessionId:f,messageId:y,content:v.content.map(w=>({...w})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(h.model=g.model),g?.contextTokens!==void 0&&(h.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(h.contextLimit=g.maxContextTokens),S.push({type:"sessionUsageUpdated",sessionId:f,usage:p2(h),model:h.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0});break}case"turn.ended":{const y=h.currentAssistantMsgId,b=g?.reason??"completed",v=Xr(g??{},"durationMs");if(y){h2(h,y);const E=Xm(h,y);E&&S.push({type:"messageUpdated",sessionId:f,messageId:y,content:E.content.map(k=>({...k})),status:b==="failed"||b==="filtered"?"error":"completed",durationMs:v})}h.turnCount++;const w=p2(h);S.push({type:"sessionUsageUpdated",sessionId:f,usage:w});const N=b==="cancelled"||b==="failed"||b==="filtered"?"aborted":"idle";S.push({type:"sessionStatusChanged",sessionId:f,status:N,previousStatus:"running"}),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 b={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:ir("task_"),sessionId:f,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0};h.subagentMeta.set(b.id,b),S.push({type:"taskCreated",sessionId:f,task:b});break}case"subagent.started":{const y=mc(h,f,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});y&&S.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.suspended":{const y=mc(h,f,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});y&&S.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.completed":{const y=typeof g?.resultSummary=="string"?g.resultSummary:void 0,b=mc(h,f,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:y});b&&S.push({type:"taskCreated",sessionId:f,task:b}),S.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"completed",outputPreview:y});break}case"subagent.failed":{const y=typeof g?.error=="string"?g.error:void 0,b=mc(h,f,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:y});b&&S.push({type:"taskCreated",sessionId:f,task:b}),S.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"failed",outputPreview:y});break}case"error":{S.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message}});break}case"warning":{S.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"background.task.started":{const y=g?.info??{},b=typeof y.startedAt=="number"?new Date(y.startedAt).toISOString():void 0,v=typeof y.taskId=="string"?y.taskId:typeof y.taskId=="number"?String(y.taskId):ir("task_"),w=typeof y.description=="string"?y.description:typeof y.command=="string"?y.command:$n.global.t("tasks.defaultDescription"),N=typeof y.command=="string"?y.command:void 0;S.push({type:"taskCreated",sessionId:f,task:{id:v,sessionId:f,kind:"bash",description:w,command:N,status:"running",createdAt:b??new Date().toISOString(),startedAt:b,outputPreview:N!==void 0?`$ ${N}`:void 0}});break}case"background.task.terminated":{const y=g?.info??{},b=y.status==="failed"||typeof y.exitCode=="number"&&y.exitCode!==0;S.push({type:"taskCompleted",sessionId:f,taskId:typeof y.taskId=="string"?y.taskId:typeof y.taskId=="number"?String(y.taskId):"",status:b?"failed":"completed"});break}case"compaction.completed":{const y=g?.result??{};S.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof y.tokensBefore=="number"?y.tokensBefore:void 0,tokensAfter:typeof y.tokensAfter=="number"?y.tokensAfter:void 0,summary:typeof y.summary=="string"?y.summary:void 0}),S.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{S.push({type:"compactionStarted",sessionId:f,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{S.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const y=Tae(g?.snapshot??null);S.push({type:"goalUpdated",sessionId:f,goal:y?.status==="complete"?null:y});break}}return S}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const Dae=new Set(["server_hello","ack","ping","resync_required","error","pong"]),m2=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"]),Bae=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"]),Fae=new Set(["assistant.delta","thinking.delta"]);function Hae(e,t){if(Dae.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return Fae.has(s)?Wae(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Bae.has(s)?{route:"protocol"}:m2.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:m2.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Wae(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 w1 extends Error{code;requestId;details;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details}}class gc extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview}}function yu(e){return e instanceof w1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function OM(e){return e instanceof gc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Yv="kimi-web.server-credential",Uae="token";let su;const S1=new Set;function jae(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Uae);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 qae(){try{return globalThis.sessionStorage?.getItem(Yv)??void 0}catch{return}}function zae(){const e=jae();return e?(RM(e),!0):(su=qae(),su!==void 0)}function PM(){return su}function RM(e){su=e;try{globalThis.sessionStorage?.setItem(Yv,e)}catch{}}function Vae(){su=void 0;try{globalThis.sessionStorage?.removeItem(Yv)}catch{}}function Kae(e){return S1.add(e),()=>{S1.delete(e)}}function Gae(){Vae();for(const e of S1)try{e()}catch{}}const vc=3e4,DM="0123456789ABCDEFGHJKMNPQRSTVWXYZ",g2=500,Yae=40101;function v2(){try{return AbortSignal.timeout(vc)}catch{return}}function Xae(e,t){let n="",s=e;for(let o=0;o<t;o++)n=DM[s%32]+n,s=Math.floor(s/32);return n}function Zae(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=>DM[n%32]).join("")}function y2(){return`${Xae(Date.now(),10)}${Zae(16)}`}function Jae(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 k2(e){try{const t=await e.text();return t?t.length>g2?`${t.slice(0,g2)}...`:t:void 0}catch{return}}class Qae{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=mf(this.origin,t),o=y2(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();s2({method:"POST",path:t,url:s,requestId:o,body:Jae(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:v2()})}catch(u){throw bd({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new gc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:vc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw bd({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new gc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:vc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await k2(c)})}if(o2({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 w1({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=mf(this.origin,n);if(o){const p=new URLSearchParams;for(const[g,S]of Object.entries(o))S!==void 0&&p.set(g,String(S));const h=p.toString();h&&(r=`${r}?${h}`)}const l=y2(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();s2({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:v2()})}catch(p){throw bd({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:p}),new gc({message:`Network error calling ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:vc})}let d;const f=u.clone();try{d=await u.json()}catch(p){throw bd({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:p}),new gc({message:`Failed to parse JSON response from ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:vc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await k2(f)})}if(o2({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 w1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){const n=PM();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===Yae)&&Gae()}}const ece="kimi-code.bearer.";class tce{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Ul("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=PM(),n=t!==void 0?[`${ece}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{Ul("open")},s.onmessage=o=>{try{const i=JSON.parse(String(o.data));zte(i),this.handleFrame(i)}catch(i){Ul("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{Ul("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{Ul("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,Ul("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=wd(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(wd(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(wd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=wd(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=Hae(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)),qte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function wd(e,t){return`${e}\0${t}`}function Zm(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 b2(e){return e==="auto_compact"||e==="manual_compact"}class nce{http;config;constructor(t){this.config=t,this.http=new Qae(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[]}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?uae(t.status):void 0,include_archive:t?.includeArchive,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(ei),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 ei(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ei(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 ei(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingLevel:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(k1),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:ei(n.session),messages:n.messages.items.map(k1),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(NM),pendingQuestions:n.pending_questions.map(LM)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,fae(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 ei(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 ei(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ei)}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)}`,hae(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)}`,vae(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(b1)}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 b1(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(Zm)}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 Zm(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Zm(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(a2)])):void 0;return{items:o.items.map(a2),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 mf(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(Wf)}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 Wf(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(bae)}async listProviders(){return(await this.http.get("/providers")).items.map(Gm)}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 Gm(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 Gm(n)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return{changed:t.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.unchanged,failed:t.failed}}async getConfig(){const t=await this.http.get("/config");return _1(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return _1(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 mf(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=w6(this.config.serverHttpUrl,this.config.clientId),s=Rae(),o=new tce(n,this.config.clientId,{onWireEvent:i=>{const r=_ae(i),l=wae(i),a=kae(i);a.type==="historyCompacted"&&!b2(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"&&!b2(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}let _2;function rt(){return _2??=new nce(v6()),_2}function sce(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 oce=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function ice(e){return oce.has(e.type)}function rce(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function lce(e,t,n=rce){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 BM=["blue","mono"],FM=["light","dark","system"],HM=15,ace=12,cce=20;function uce(){const e=xn(At.accent);return e&&BM.includes(e)?e:"blue"}function dce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function fce(){const e=xn(At.colorScheme);return e&&FM.includes(e)?e:"system"}function hce(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 pce(){const e=xn(At.theme);return e==="terminal"||e==="modern"||e==="kimi"?e:"modern"}function mce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}function Xv(e){return Number.isFinite(e)?Math.min(cce,Math.max(ace,Math.round(e))):HM}function gce(){const e=xn(At.uiFontSize);return e===null?HM:Xv(Number(e))}function vce(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${Xv(e)}px`)}const Rh=te(pce()),Zv=te(fce()),Jv=te(uce()),Qv=te(gce());Ke(Rh,mce,{immediate:!0});Ke(Zv,hce,{immediate:!0});Ke(Jv,dce,{immediate:!0});Ke(Qv,vce,{immediate:!0});function WM(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(Rh.value=e,Ln(At.theme,e))}function yce(){WM(Rh.value==="modern"?"terminal":"modern")}function kce(e){FM.includes(e)&&(Zv.value=e,Ln(At.colorScheme,e))}function bce(e){BM.includes(e)&&(Jv.value=e,Ln(At.accent,e))}function _ce(e){const t=Xv(e);Qv.value=t,Ln(At.uiFontSize,String(t))}const wce=600,Sce=250,Dh=250,Cce=1e3,xce=160,Uf=te(!1);let el=[],sl=null,jf=-Dh;function Tce(){el=[],jf=-Dh,Uf.value=!1,sl!==null&&(clearTimeout(sl),sl=null)}function Mce(){Uf.value=!0,sl!==null&&clearTimeout(sl),sl=setTimeout(()=>{sl=null,el=[],jf=-Dh,Uf.value=!1},Cce)}function Ace(e){if(e<=0)return;const t=Date.now();el.push({time:t,chars:e});const n=t-wce;if(el=el.filter(l=>l.time>=n),t-jf<Dh)return;jf=t;const s=el[0]?.time??t,o=Math.max(t-s,Sce);el.reduce((l,a)=>l+a.chars,0)/o*1e3>=xce&&Mce()}function Ece(){return{theme:Rh,colorScheme:Zv,accent:Jv,uiFontSize:Qv,fastMoon:Uf,setTheme:WM,toggleTheme:yce,setColorScheme:kce,setAccent:bce,setUiFontSize:_ce,resetFastMoon:Tce,recordMoonDelta:Ace}}function $ce(){const e=xn(At.notifyOnComplete);return e===null?!0:e==="1"}const qf=te($ce()),e0=te(typeof Notification<"u"?Notification.permission:"denied");async function Ice(e){if(!e){qf.value=!1,Ln(At.notifyOnComplete,"0");return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}e0.value=t,t==="granted"&&(qf.value=!0,Ln(At.notifyOnComplete,"1"))}function Nce(e,t){if(!qf.value||typeof Notification>"u")return;const n=Notification.permission;if(n!=="denied"){if(n==="default"){Notification.requestPermission().then(s=>{e0.value=s,s==="granted"&&w2(e,t)});return}w2(e,t)}}function w2(e,t){if(t.isActiveAndVisible)return;const n=t.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(n,{body:$n.global.t("settings.notifyBody"),tag:`kimi-complete-${e}`});s.onclick=()=>{try{window.focus()}catch{}t.onClick(),s.close()}}catch{}}function Lce(){return{notifyOnComplete:qf,notifyPermission:e0,setNotifyOnComplete:Ice,maybeNotifyCompletion:Nce}}function S2(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 Oce=1e3,Pce=4096,C2=32*1024;function Rce(e,t){let n=null,s;const o=new Set;async function i(f){try{const h=await rt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:S2(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]??[],g=rt(),S=new Map;if(await Promise.all(h.map(async y=>{if((y.status==="completed"||y.status==="failed"||y.status==="cancelled")&&!o.has(y.id)&&!((y.outputLines?.length??0)>0))try{const v=await g.getTask(f,y.id,{withOutput:!0,outputBytes:C2});v.outputPreview!==void 0&&S.set(y.id,{preview:v.outputPreview,bytes:v.outputBytes})}catch{}finally{o.add(y.id)}})),S.size===0)return;const _=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:_.map(y=>{const b=S.get(y.id);return b?{...y,outputPreview:b.preview,outputBytes:b.bytes}:y})}}async function l(f){if(e.activeSessionId!==f)return;const p=rt();let h;try{h=await p.listTasks(f)}catch{return}const g=new Map;await Promise.all(h.map(async b=>{const v=b.status==="running",w=b.status==="completed"||b.status==="failed"||b.status==="cancelled";if(!(!v&&!w)&&!(w&&(o.has(b.id)||(b.outputLines?.length??0)>0)))try{const N=await p.getTask(f,b.id,{withOutput:!0,outputBytes:v?Pce:C2});N.outputPreview!==void 0&&g.set(b.id,{preview:N.outputPreview,bytes:N.outputBytes})}catch{}finally{w&&o.add(b.id)}}));const S=e.tasksBySession[f]??[],_=new Map(S.map(b=>[b.id,b])),y=h.map(b=>{const v=_.get(b.id),w=g.get(b.id);return{...b,outputLines:v?.outputLines,outputPreview:w?.preview??v?.outputPreview,outputBytes:w?.bytes??v?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:S2(y,S)}}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())},Oce))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=te(0);let d=null;return Ke(()=>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}),Ke(()=>{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,g)=>{let S;p&&f!==void 0?a(f):f!==void 0?S=setTimeout(()=>{(e.tasksBySession[f]??[]).some(y=>y.status==="running")||c()},1500):c(),g(()=>{S!==void 0&&clearTimeout(S)})},{deep:!0,immediate:!0}),{taskClock:F(()=>u.value),loadTasksForSession:i}}const UM=At.starredModels;function Dce(){try{const e=xn(UM);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Bce(e){try{Ln(UM,JSON.stringify(e))}catch{}}function Fce(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=te([]),d=te(Dce()),f=te({}),p=te([]),h=te(null);function g(U){if(!(U==null||U.length===0))return u.value.find(K=>K.id===U||K.model===U)}function S(){const U=e.activeSessionId?e.sessions.find(K=>K.id===e.activeSessionId):void 0;return g(U?.model??h.value??e.defaultModel)}function _(U){const K=Yw(S(),U);return e.thinking=K,l(K),K}async function y(U){try{const V=await rt().listSkills(U);f.value={...f.value,[U]:V}}catch{}}async function b(){try{const U=rt();u.value=await U.listModels(),_(e.thinking)}catch(U){n("loadModels",U)}}async function v(){try{const U=await rt().refreshOAuthProviderModels();for(const K of U.failed)n("refreshOAuthProviderModels",new Error(K.reason),{message:K.provider})}catch{}}async function w(){try{const U=rt();p.value=await U.listProviders()}catch(U){n("loadProviders",U)}}async function N(U){const K=e.activeSessionId,V=Yw(g(U),e.thinking),se=e.thinking;if(!K){h.value=U,_(V);return}const Y=e.sessions.find(G=>G.id===K)?.model;a(K,G=>({...G,model:U})),V!==se&&(e.thinking=V,l(V));try{await rt().updateSession(K,{model:U,thinking:V!==se?V:void 0})}catch(G){a(K,ee=>({...ee,model:Y??ee.model})),V!==se&&(e.thinking=se,l(se)),n("setModel",G,{sessionId:K});return}await s(K)}function E(U){const K=new Set(d.value);K.has(U)?K.delete(U):K.add(U),d.value=Array.from(K),Bce(d.value)}async function k(U,K){const V=e.activeSessionId;if(!V)return;const se=i.value==="idle"&&!r.has(V),Y=`msg_skill_opt_${Date.now().toString(36)}`;if(se){r.add(V),e.sendingBySession={...e.sendingBySession,[V]:!0};const G={id:Y,sessionId:V,role:"user",content:[{type:"text",text:`/${U}${K?` ${K}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:U,skillArgs:K}}};c(V,ee=>[...ee,G])}try{await rt().activateSkill(V,U,K)}catch(G){se&&(r.delete(V),e.sendingBySession={...e.sendingBySession,[V]:!1},c(V,ee=>ee.filter(Se=>Se.id!==Y))),n("activateSkill",G,{sessionId:V})}}async function A(U){try{await rt().addProvider(U),await Promise.all([w(),b()])}catch(K){n("addProvider",K)}}async function I(U){try{await rt().deleteProvider(U),await Promise.all([w(),b()])}catch(K){n("deleteProvider",K)}}async function P(U){try{const V=await rt().refreshProvider(U);p.value=p.value.map(se=>se.id===U?V:se)}catch(K){n("refreshProvider",K)}}async function M(){try{return await rt().startOAuthLogin()}catch{return null}}async function L(){try{return await rt().pollOAuthLogin()}catch{return null}}async function R(){try{await rt().cancelOAuthLogin()}catch{}}function B(U){const K=_(U);o({thinking:K})}return{models:u,starredModelIds:d,providers:p,draftModel:h,skillsBySession:f,loadSkillsForSession:y,loadModels:b,refreshOAuthProviderModels:v,loadProviders:w,setModel:N,toggleStarModel:E,activateSkill:k,addProvider:A,deleteProvider:I,refreshProvider:P,startOAuthLogin:M,pollOAuthLogin:L,cancelOAuthLogin:R,setThinking:B}}const jM="kimiWeb.compaction",Hce=/^read[_-]?media(?:file)?$/i,Wce=/^agent$/i,Uce=/^data:([^;]+);base64,(.*)$/s,jce=/^<(image|video|audio)\s+path="([^"]+)">$/,qce=/Mime type:\s*([^.\s]+)/i,zce=/Size:\s*(\d+)\s*bytes/i,Vce=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Kce(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 Gce(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 Yce(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 Xce(e,t){if(!Hce.test(e))return;const n=Gce(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=jce.exec(p);h&&(o=h[1],s=h[2]);const g=qce.exec(p);g?.[1]&&(i=g[1]);const S=zce.exec(p);S?.[1]&&(r=Number(S[1]));const _=Vce.exec(p);_?.[1]&&_[2]&&(l=`${_[1]}x${_[2]}`);continue}const f=Yce(d);f&&(a=f)}if(a===null)return;const c=Uce.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Kce(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function qM(e){if(e!=null){if(typeof e=="string")return e.split(`
255
+ `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
256
+ `));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
257
+ `)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
258
+ `)):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 Zce(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Jce(e){let t=null;if(typeof e=="string")try{const n=JSON.parse(e);n&&typeof n=="object"&&(t=n)}catch{t=null}else e&&typeof e=="object"&&(t=e);return t?{description:typeof t.description=="string"?t.description:void 0,subagentType:typeof t.subagent_type=="string"?t.subagent_type:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0}:{}}function Qce(e,t,n,s){const o=Jce(t),i=n?n.isError?"failed":"completed":s?"working":"completed",r=n?qM(n.output):void 0;return{id:e,toolCallId:e,name:o.description&&o.description.length>0?o.description:"Sub Agent",subagentType:o.subagentType,prompt:o.prompt,phase:i,status:n?n.isError?"failed":"completed":s?"running":"completed",summary:r&&r.length>0?r.join(`
259
+ `):void 0}}function eue(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function tue(e,t){const n=e.split(`
260
+ `),s=t.split(`
261
+ `),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 nue(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:tue(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 sue(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"?t?.trigger==="user-slash":!1}function oue(e){return e.metadata?.origin?.kind==="compaction_summary"}function iue(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function rue(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 zM(e,t,n,s=!0,o=[],i={}){const r=[];let l=1;const a=new Map;for(const g of t)a.set(g.toolCallId,g);const c=new Map;for(const g of o){if(g.kind!=="subagent")continue;const S=[g.parentToolCallId,g.id].filter(_=>typeof _=="string"&&_.length>0);for(const _ of S){const y=c.get(_)??[];y.push(g),c.set(_,y)}}for(const[g,S]of c.entries())c.set(g,S.toSorted(eue));const u=new Map;for(const g of e)for(const S of g.content)S.type==="toolResult"&&u.set(S.toolCallId,{output:S.output,isError:!!S.isError});let d=null;function f(g=!1){if(!d)return;const S=d;if(d=null,!g||!s)for(let _=0;_<S.tools.length;_++){const y=S.tools[_];if(y.status!=="running")continue;const b={...y,status:"ok"};S.tools[_]=b;const v=S.blocks.find(w=>w.kind==="tool"&&w.tool.id===b.id);v&&v.kind==="tool"&&(v.tool=b)}r.push({id:S.id,role:"assistant",no:l++,text:S.textParts.join(`
262
+ `),thinking:S.thinkingParts.length>0?S.thinkingParts.join(`
263
+ `):void 0,tools:S.tools.length>0?S.tools:void 0,blocks:S.blocks.length>0?S.blocks:void 0,approval:S.approval,approvalId:S.approvalId,durationMs:S.durationMs})}function p(g,S){for(const _ of S)if(_.type==="text"){if(_.text){g.textParts.push(_.text);const y=g.blocks.at(-1);y&&y.kind==="text"?y.text+=`
264
+ `+_.text:g.blocks.push({kind:"text",text:_.text})}}else if(_.type==="thinking"){if(_.thinking){g.thinkingParts.push(_.thinking);const y=g.blocks.at(-1);y&&y.kind==="thinking"?y.thinking+=`
265
+ `+_.thinking:g.blocks.push({kind:"thinking",thinking:_.thinking})}}else if(_.type==="toolUse"){const y=c.get(_.toolCallId);if(y&&y.length>0){if(y.filter(E=>E.swarmIndex!==void 0).length>1)continue;const N=y.map(Zce);N.length===1?g.blocks.push({kind:"agent",member:N[0]}):g.blocks.push({kind:"agentGroup",members:N});continue}if(Wce.test(_.toolName)){const w=Qce(_.toolCallId,_.input,u.get(_.toolCallId),s);g.blocks.push({kind:"agent",member:w});continue}const b=a.get(_.toolCallId),v={id:_.toolCallId,name:_.toolName,arg:typeof _.input=="string"?_.input:JSON.stringify(_.input),status:"running",output:_.outputLines,planPath:_.toolName==="ExitPlanMode"?i[_.toolCallId]?.path:void 0};g.tools.push(v),g.blocks.push({kind:"tool",tool:v}),b&&(g.approval=nue(b),g.approvalId=b.approvalId)}else if(_.type==="toolResult"){const y=g.tools.findIndex(b=>b.id===_.toolCallId);if(y!==-1){const b=g.tools[y],v={...b,status:_.isError?"error":"ok",output:qM(_.output),media:_.isError?void 0:Xce(b.name,_.output)};v.name==="ExitPlanMode"&&!v.planPath&&(v.planPath=rue(v.output)),g.tools[y]=v;const w=g.blocks.find(N=>N.kind==="tool"&&N.tool.id===_.toolCallId);w&&w.kind==="tool"&&(w.tool=v)}}}function h(g){if(g.type==="image"||g.type==="video"){const S=g.type,_=g.source;if(_.kind==="url")return{url:_.url,kind:S};if(_.kind==="base64")return{url:`data:${_.mediaType};base64,${_.data}`,kind:S};if(_.kind==="file"&&n)return{url:n(_.fileId),kind:S}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image"};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video"}}}for(const g of e){if(g.role==="system")continue;if(oue(g)){f();const v=g.metadata?.[jM];r.push({id:g.id,role:"compaction",no:l,text:g.content.filter(w=>w.type==="text").map(w=>w.text).join(`
266
+ `),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(g.role==="user"){if(f(),!sue(g))continue;const v=g.metadata?.origin,w=v?.kind==="skill_activation"&&v?.trigger==="user-slash",N=[],E=[];for(const k of g.content){k.type==="text"&&(w?N.push(v.skillArgs??""):N.push(k.text));const A=h(k);A&&E.push({url:A.url,kind:A.kind,alt:k.type==="file"?k.name:void 0})}r.push({id:g.id,role:"user",no:l++,text:N.join(`
267
+ `),images:E.length>0?E:void 0,skillActivation:w?{name:v.skillName,args:v.skillArgs}:void 0,createdAt:g.createdAt});continue}if(g.role==="tool"){d&&p(d,g.content);continue}const S=g.promptId;iue(d,S)?d!==null&&d.promptId===void 0&&S!==void 0&&(d.promptId=S):(f(),d={id:g.id,promptId:S,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:g.durationMs});const y=d;if(y===null)continue;const b=JSON.stringify(g.content);y.promptId!==void 0&&y.seenSigs.has(b)||(y.seenSigs.add(b),p(y,g.content))}return f(!0),r}function lue(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=te({}),l=F(()=>{const E=e.activeSessionId;if(!E)return null;const k=r.value[E];return k?{parentId:E,agentId:k.agentId}:null}),a=F(()=>l.value?.parentId??null),c=F(()=>l.value!==null),u=F(()=>{const E=l.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),d=F(()=>{const E=l.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(k=>k.id===E.agentId&&k.status==="running"):!1}),f=F(()=>{const E=l.value;if(!E)return[];const k=e.sideChatMessagesByAgent[E.agentId]??[];return zM(k,[],A=>rt().getFileUrl(A),d.value,[])});function p(E,k){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:k(e.sideChatMessagesByAgent[E]??[])}}function h(E,k){p(E,A=>[...A,k])}function g(E){p(E,k=>{const A=[...k].reverse().findIndex(P=>P.role==="user");if(A===-1)return k;const I=k.length-1-A;return k.filter((P,M)=>M!==I)})}function S(E,k){p(E,A=>{const I=[...A];for(let P=I.length-1;P>=0;P-=1){const M=I[P];if(M.role==="user")return I[P]={...M,promptId:M.promptId??k},I}return A})}function _(E,k,A){A&&p(E,I=>{const P=I.at(-1);if(P?.role==="assistant"){const M=P.content[0],L=M?.type==="text"?M.text:"";return[...I.slice(0,-1),{...P,content:[{type:"text",text:`${L}${A}`}]}]}return[...I,{id:s(),sessionId:k,role:"assistant",content:[{type:"text",text:A}],createdAt:new Date().toISOString()}]})}function y(E,k,A){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!A)return;const P=(e.sideChatMessagesByAgent[E]??[]).at(-1);(P?.role==="assistant"&&P.content[0]?.type==="text"?P.content[0].text:"").trim().length>0||_(E,k,A)}async function b(E){const k=e.activeSessionId;if(k){if(!r.value[k]){let A;try{({agentId:A}=await rt().startBtw(k))}catch(I){n("openSideChat",I,{sessionId:k});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[A]:e.sideChatMessagesByAgent[A]??[]},r.value={...r.value,[k]:{agentId:A}},o(),i()?.markSideChannelAgent(A)}E&&E.trim()&&await w(E.trim())}}function v(){const E=e.activeSessionId;if(!E)return;const{[E]:k,...A}=r.value;r.value=A}async function w(E){const k=l.value,A=E.trim();if(!k||!A)return;const I=k.parentId,P=k.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!0};const M={id:s(),sessionId:I,role:"user",content:[{type:"text",text:A}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};h(P,M);try{const L=await rt().submitPrompt(I,{content:[{type:"text",text:A}],agentId:P});S(P,L.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],L.userMessageId]}}catch(L){n("sendSideChatPrompt",L,{sessionId:I}),g(P),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!1}}}function N(E){if(!r.value[E])return;const{[E]:k,...A}=r.value;r.value=A}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:_,finishSideChatAgent:y,openSideChat:b,closeSideChat:v,sendSideChatPrompt:w,clearSideChatForSession:N}}function aue(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 cue(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
268
+ `)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&aue(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 C1="/sessions/";function x2(e){const{pathname:t}=e;if(!t.startsWith(C1))return;const n=t.slice(C1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function uue(e){return e===void 0||e.length===0?"/":`${C1}${encodeURIComponent(e)}`}const due=50,fue=40402;function hue(e,t){const{taskPoller:n,sideChat:s,modelProvider:o,pushOperationFailure:i,activity:r,inFlightPromptSessions:l,sessionsKnownEmpty:a,setSessions:c,updateSession:u,upsertSessionFront:d,appendSession:f,forgetSession:p,setActiveSessionId:h,updateSessionMessages:g,nextOptimisticMsgId:S,getEventConn:_,syncSessionFromSnapshot:y,subscribeToSessionEvents:b,hasLoadedMessages:v,refreshSessionStatus:w,persistSessionProfile:N,mergedWorkspaces:E,workspacesView:k,status:A,workspaceIdForSession:I,savePermissionToStorage:P,savePlanModeToStorage:M,saveSwarmModeToStorage:L,saveGoalModeToStorage:R,saveUnread:B,saveActiveWorkspaceToStorage:U,saveHiddenWorkspacesToStorage:K,goalErrorMessage:V,basename:se,resetFastMoon:Y,initialized:G,selectedDiffPath:ee,fileDiffLines:Se,fileDiffLoading:ae}=t;async function Ie(ue){if(e.messagesLoadingMoreBySession[ue])return;const pe=e.messagesBySession[ue];if(!pe||pe.length===0)return;const z=pe[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ue]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ue]:!1};try{const ne=await rt().listMessages(ue,{beforeId:z,pageSize:due}),Ye=[...ne.items].reverse();g(ue,et=>[...Ye,...et]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[ue]:ne.hasMore}}catch(ne){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ue]:!0},i("loadOlderMessages",ne,{sessionId:ue})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ue]:!1}}}function de(ue){n.loadTasksForSession(ue),$e(ue),w(ue),Object.prototype.hasOwnProperty.call(o.skillsBySession.value,ue)||o.loadSkillsForSession(ue)}async function we(ue){const pe=e.activeSessionId;if(pe){ee.value=ue,Se.value=[],ae.value=!0;try{const ne=await rt().getFileDiff(pe,ue);if(ee.value!==ue)return;Se.value=cue(ne.diff)}catch(z){ee.value===ue&&(Se.value=[]),console.warn("[loadFileDiff] diff unavailable for",ue,z)}finally{ee.value===ue&&(ae.value=!1)}}}function me(){ee.value=null,Se.value=[],ae.value=!1}async function $e(ue){try{const z=await rt().getGitStatus(ue);e.gitStatusBySession={...e.gitStatusBySession,[ue]:z}}catch{}}async function J(){try{const pe=await rt().getAuth();e.authReady=pe.ready,e.defaultModel=pe.defaultModel,e.managedProviderStatus=pe.managedProvider?.status??null}catch{}}async function ye(){try{const ue=rt();e.config=await ue.getConfig()}catch{}}async function _e(ue){try{const z=await rt().setConfig(ue);return e.config=z,e.defaultModel=z.defaultModel??null,!0}catch(pe){return i("setConfig",pe),!1}}const W=100,Z=10,fe=30;async function oe(){const ue=rt(),pe=[];let z;for(;;){const ne=await ue.listSessions({pageSize:W,beforeId:z});if(pe.push(...ne.items),!ne.hasMore||ne.items.length===0)break;z=ne.items[ne.items.length-1].id}return pe}async function he(){const ue=rt(),pe=e.workspaces;if(pe.length===0){const xt=await oe().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsFullyLoaded=!0,xt}const z=await Promise.all(pe.map(xt=>ue.listSessions({workspaceId:xt.id,pageSize:Z}).then(hn=>({workspaceId:xt.id,page:hn})).catch(()=>({workspaceId:xt.id,page:{items:[],hasMore:!1}})))),ne=[],Ye={},et={};for(const{workspaceId:xt,page:hn}of z)ne.push(...hn.items),Ye[xt]=hn.hasMore,et[xt]=hn.items.length>0?hn.items[hn.items.length-1].id:void 0;return e.sessionsHasMoreByWorkspace=Ye,e.sessionsCursorByWorkspace=et,e.sessionsFullyLoaded=!1,ne.sort((xt,hn)=>new Date(hn.updatedAt).getTime()-new Date(xt.updatedAt).getTime()),ne}async function H(ue){if(e.sessionsLoadingMoreByWorkspace[ue]||e.sessionsHasMoreByWorkspace[ue]===!1)return;const pe=e.sessionsCursorByWorkspace[ue];if(pe!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ue]:!0};try{const z=await rt().listSessions({workspaceId:ue,pageSize:fe,beforeId:pe}),ne=new Set(e.sessions.map(et=>et.id)),Ye=z.items.filter(et=>!ne.has(et.id));Ye.length>0&&c([...e.sessions,...Ye]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[ue]:z.items.length>0?z.items[z.items.length-1].id:pe},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[ue]:z.hasMore}}catch(z){i("loadMoreSessions",z)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ue]:!1}}}}async function X(){if(e.sessionsFullyLoaded)return;const ue=await oe().catch(()=>null);if(ue===null)return;c(ue),e.sessionsFullyLoaded=!0;const pe={};for(const z of e.workspaces)pe[z.id]=!1;e.sessionsHasMoreByWorkspace=pe}async function ce(){e.loading=!0;try{const ue=rt();await Promise.all([ue.getHealth().catch(()=>null),ue.getMeta().then(xt=>{e.serverVersion=xt.serverVersion,e.availableOpenInApps=xt.openInApps}).catch(()=>null),o.loadModels()]),await J(),await ye(),await ke();const pe=await he();c(pe);const z=pe[0],ne=e.activeWorkspaceId;!(ne!==null&&E.value.some(xt=>xt.id===ne))&&z&&Me(I(z)),On();const et=typeof window<"u"?x2(window.location):void 0;!e.activeSessionId&&et!==void 0&&(e.sessions.some(hn=>hn.id===et)||await on(et))&&await un(et,{urlMode:"replace"}),!e.activeSessionId&&pe.length>0&&await un(pe[0].id,{urlMode:"replace"})}catch(ue){i("load",ue)}finally{e.loading=!1,G.value=!0}}async function ke(){try{const ue=rt(),[pe,z]=await Promise.all([ue.listWorkspaces().catch(()=>[]),ue.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=pe,e.fsHome=z.home||null,e.recentRoots=z.recentRoots}catch{}}function Me(ue){e.activeWorkspaceId=ue,U(ue)}function Ne(ue){Me(ue);const pe=e.sessions.filter(z=>I(z)===ue);if(pe.length>0){const z=pe[0];z&&z.id!==e.activeSessionId&&un(z.id)}else h(void 0),Et(void 0,"push")}function re(ue){e.hiddenWorkspaceRoots.includes(ue.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(ne=>ne!==ue.root),K(e.hiddenWorkspaceRoots));const pe=e.workspaces.findIndex(ne=>ne.id===ue.id||ne.root===ue.root);if(pe===-1){e.workspaces=[ue,...e.workspaces];return}const z=[...e.workspaces];z[pe]=ue,e.workspaces=z}function le(ue){if(ue.type==="workspaceCreated"||ue.type==="workspaceUpdated"){re(ue.workspace);return}const pe=e.workspaces.find(ne=>ne.id===ue.workspaceId)?.root??ue.root;if(pe&&!e.hiddenWorkspaceRoots.includes(pe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,pe],K(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(ne=>ne.id!==ue.workspaceId&&ne.root!==pe),e.activeWorkspaceId===ue.workspaceId||e.activeWorkspaceId===pe){const ne=k.value[0]?.id??null;if(e.activeWorkspaceId=ne,ne)U(ne);else try{Kc(At.activeWorkspace)}catch{}h(void 0),e.sessionLoading=!1,me(),Et(void 0,"replace")}}function Ce(){h(void 0),Et(void 0,"push")}function We(ue){Me(ue),Ce(),me()}async function nt(ue){const pe=E.value.find(z=>z.id===ue);if(pe)try{const z=rt();let ne,Ye=pe.root;try{const xt=await z.addWorkspace({root:pe.root});ne=xt.id,Ye=xt.root,re(xt)}catch{}const et=await z.createSession({workspaceId:ne,cwd:Ye});return d(et),Me(et.workspaceId??ne??ue),a.add(et.id),await un(et.id),et}catch(z){i("createSessionInWorkspace",z);return}}async function lt(ue,pe,z){const ne=E.value.find(Ye=>Ye.id===ue);if(ne)try{const Ye=rt();let et,xt=ne.root;try{const ln=await Ye.addWorkspace({root:ne.root});et=ln.id,xt=ln.root,re(ln)}catch{}const hn=o.draftModel.value??void 0,Bn=await Ye.createSession({workspaceId:et,cwd:xt,model:hn});o.draftModel.value=null;const kn=hn!==void 0&&(!Bn.model||Bn.model.length===0)?{...Bn,model:hn}:Bn;d(kn),Me(Bn.workspaceId??et??ue),await un(Bn.id),await Vn(Bn.id,pe,z)}catch(Ye){i("startSessionAndSendPrompt",Ye)}}async function kt(ue){const pe=ue.trim();if(!pe)return;const z=rt();try{const ne=await z.addWorkspace({root:pe});re(ne),We(ne.id)}catch{e.workspaces.find(Ye=>Ye.root===pe)||(e.workspaces=[{id:pe,root:pe,name:se(pe),isGitRepo:!1,sessionCount:0},...e.workspaces]),We(pe)}}async function Ct(ue){try{return await rt().browseFs(ue)}catch{return{path:"",parent:null,entries:[]}}}async function ut(){try{return await rt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Et(ue,pe){if(pe==="none"||typeof window>"u"||!window.history)return;const z=uue(ue);if(window.location.pathname!==z)try{pe==="push"?window.history.pushState(null,"",z):window.history.replaceState(null,"",z)}catch{}}async function on(ue){try{const pe=await rt().getSession(ue);return e.sessions.some(z=>z.id===pe.id)||f(pe),!0}catch{return!1}}function Tn(){const ue=x2(window.location);if(ue===void 0){h(void 0);return}if(ue!==e.activeSessionId){if(e.sessions.some(pe=>pe.id===ue)){un(ue,{urlMode:"none"});return}(async()=>{if(await on(ue)){await un(ue,{urlMode:"none"});return}const pe=e.sessions[0];pe?await un(pe.id,{urlMode:"replace"}):(h(void 0),Et(void 0,"replace"))})()}}let $t=!1;function On(){$t||typeof window>"u"||($t=!0,window.addEventListener("popstate",Tn))}async function un(ue,pe){const z=v(ue),ne=!z&&a.has(ue);a.delete(ue);try{Et(ue,pe?.urlMode??"push"),e.sessionLoading=!z&&!ne,h(ue),Y(),e.unreadBySession[ue]&&(e.unreadBySession={...e.unreadBySession,[ue]:!1},B({[ue]:!1})),me();const Ye=e.sessions.find(et=>et.id===ue);if(Ye){const et=I(Ye);e.activeWorkspaceId!==et&&Me(et)}if(z)b(ue);else if(await y(ue)==="not-found")return;de(ue)}catch(Ye){i("selectSession",Ye,{sessionId:ue})}finally{e.activeSessionId===ue&&(e.sessionLoading=!1)}}async function tt(ue,pe){try{const ne=await rt().createSession({cwd:ue,title:pe?.title,model:pe?.model});d(ne),a.add(ne.id),await un(ne.id)}catch(z){i("createSession",z)}}async function Vn(ue,pe,z){l.add(ue),e.sendingBySession={...e.sendingBySession,[ue]:!0};const ne=S();try{const Ye=rt(),et=[];pe&&et.push({type:"text",text:pe});for(const ln of z??[])ln.kind==="video"?et.push({type:"video",source:{kind:"file",fileId:ln.fileId}}):et.push({type:"image",source:{kind:"file",fileId:ln.fileId}});if(et.length===0)return l.delete(ue),e.sendingBySession={...e.sendingBySession,[ue]:!1},!1;const xt={id:ne,sessionId:ue,role:"user",content:et,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(ue,ln=>[...ln,xt]);const hn=e.sessions.find(ln=>ln.id===ue),Bn=(hn?.model&&hn.model.length>0?hn.model:e.defaultModel)??void 0;if(e.goalMode&&pe)try{await Ye.updateSession(ue,{goalObjective:pe.trim()})}catch(ln){return i("createGoal",ln,{sessionId:ue}),l.delete(ue),e.sendingBySession={...e.sendingBySession,[ue]:!1},g(ue,an=>an.some(bn=>bn.id===ne)?an.filter(bn=>bn.id!==ne):an),!1}const kn=await Ye.submitPrompt(ue,{content:et,model:Bn,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});return e.goalMode&&(e.goalMode=!1,R(!1)),e.promptIdBySession={...e.promptIdBySession,[ue]:kn.promptId},g(ue,ln=>{const an=ln.findIndex(po=>po.id===ne);if(an===-1)return ln;const bn=[...ln];return bn[an]={...bn[an],promptId:bn[an].promptId??kn.promptId},bn}),_()?.bindNextPromptId(ue,kn.promptId),!0}catch(Ye){return l.delete(ue),e.sendingBySession={...e.sendingBySession,[ue]:!1},g(ue,et=>et.some(xt=>xt.id===ne)?et.filter(xt=>xt.id!==ne):et),i("sendPrompt",Ye,{sessionId:ue}),!1}}async function Lo(ue,pe){const z=e.activeSessionId;if(z){if(r.value!=="idle"||l.has(z)){rn(ue,pe);return}await Vn(z,ue,pe)}}async function _s(ue,pe){const z=e.activeSessionId;if(!z)return;const ne=e.queuedBySession[z]??[],Ye=[],et=[];for(const an of ne){const bn=an.text.trim();bn&&Ye.push(bn),an.attachments?.length&&et.push(...an.attachments)}const xt=ue.trim();if(xt&&Ye.push(xt),pe?.length&&et.push(...pe),Ye.length===0&&et.length===0)return;ne.length>0&&(e.queuedBySession={...e.queuedBySession,[z]:[]});const hn=Ye.join(`
269
+
270
+ `);if(r.value==="idle"&&!l.has(z)){await Vn(z,hn,et);return}const Bn=[];hn&&Bn.push({type:"text",text:hn});for(const an of et)an.kind==="video"?Bn.push({type:"video",source:{kind:"file",fileId:an.fileId}}):Bn.push({type:"image",source:{kind:"file",fileId:an.fileId}});const kn=S(),ln={id:kn,sessionId:z,role:"user",content:Bn,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(z,an=>[...an,ln]);try{const an=rt(),bn=e.sessions.find(Ir=>Ir.id===z),po=(bn?.model&&bn.model.length>0?bn.model:e.defaultModel)??void 0,$r=await an.submitPrompt(z,{content:Bn,model:po,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});if(g(z,Ir=>{const yl=Ir.findIndex(Nr=>Nr.id===kn);if(yl===-1)return Ir;const ci=[...Ir];return ci[yl]={...ci[yl],promptId:ci[yl].promptId??$r.promptId},ci}),$r.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[z]:$r.promptId},_()?.bindNextPromptId(z,$r.promptId);return}try{await an.steerPrompts(z,[$r.promptId])}catch{}}catch(an){g(z,bn=>bn.filter(po=>po.id!==kn)),i("steer",an,{sessionId:z})}}async function Pn(ue,pe){try{const ne=await rt().uploadFile({file:ue,name:pe});return{fileId:ne.id,name:ne.name,mediaType:ne.mediaType}}catch(z){return i("uploadImage",z),null}}function rn(ue,pe){const z=e.activeSessionId;if(!z)return;const ne=e.queuedBySession[z]??[];e.queuedBySession={...e.queuedBySession,[z]:[...ne,{text:ue,attachments:pe}]}}async function yn(){const ue=e.activeSessionId;if(!ue)return;const pe=e.sessions.find(Ye=>Ye.id===ue);let z=e.promptIdBySession[ue];if(z===void 0){const Ye=pe?.currentPromptId;Ye?.startsWith("prompt_")&&(z=Ye)}const ne=rt();if(z!==void 0)try{if((await ne.abortPrompt(ue,z)).aborted)return;const et={...e.promptIdBySession};delete et[ue],e.promptIdBySession=et}catch(Ye){if(yu(Ye)&&Ye.code===fue){const et={...e.promptIdBySession};delete et[ue],e.promptIdBySession=et}else{i("abortCurrentPrompt",Ye,{sessionId:ue});return}}try{await ne.abortSession(ue)}catch(Ye){i("abortCurrentPrompt",Ye,{sessionId:ue})}}async function Rn(ue,pe){const z=e.activeSessionId;if(z)try{const ne=rt(),Ye={decision:pe.decision,scope:pe.scope,feedback:pe.feedback,selectedLabel:pe.selectedLabel};await ne.respondApproval(z,ue,Ye);const et=e.approvalsBySession[z]??[];e.approvalsBySession={...e.approvalsBySession,[z]:et.filter(xt=>xt.approvalId!==ue)}}catch(ne){i("respondApproval",ne,{sessionId:z})}}async function Mn(ue,pe){const z=e.activeSessionId;if(z)try{await rt().respondQuestion(z,ue,pe);const Ye=e.questionsBySession[z]??[];e.questionsBySession={...e.questionsBySession,[z]:Ye.filter(et=>et.questionId!==ue)}}catch(ne){i("respondQuestion",ne,{sessionId:z})}}async function ds(ue){const pe=e.activeSessionId;if(pe)try{await rt().dismissQuestion(pe,ue);const ne=e.questionsBySession[pe]??[];e.questionsBySession={...e.questionsBySession,[pe]:ne.filter(Ye=>Ye.questionId!==ue)}}catch(z){i("dismissQuestion",z,{sessionId:pe})}}async function Dn(ue){const pe=e.activeSessionId;if(pe)try{await rt().cancelTask(pe,ue);const ne=e.tasksBySession[pe]??[];e.tasksBySession={...e.tasksBySession,[pe]:ne.map(Ye=>Ye.id===ue?{...Ye,status:"cancelled"}:Ye)}}catch(z){i("cancelTask",z,{sessionId:pe})}}function ns(ue){e.planMode=ue,M(ue),N({planMode:ue})}function Ge(){ns(!e.planMode)}function Ue(ue){e.swarmMode=ue,L(ue),N({swarmMode:ue})}function qe(){const ue=!e.swarmMode;ue&&e.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||Ue(ue)}function wt(ue){e.goalMode=ue,R(ue)}function Qt(){wt(!e.goalMode)}async function Ns(ue){const pe=ue.trim();if(!pe||e.permission==="manual"&&!confirm(`Start goal: "${pe}"? The agent will run autonomously toward this objective.`))return;const z=e.activeSessionId;if(z){try{await rt().updateSession(z,{goalObjective:pe})}catch(ne){i("createGoal",ne,{sessionId:z,message:V(ne)});return}await Lo(pe)}}function zs(ue){const pe=e.activeSessionId;pe&&Promise.resolve(rt().updateSession(pe,{goalControl:ue})).catch(z=>{i("controlGoal",z,{sessionId:pe,message:V(z)})})}function Ar(ue){e.permission=ue,P(ue),N({permissionMode:ue})}function ws(ue){const pe=[...e.warnings];pe.splice(ue,1),e.warnings=pe}async function ai(ue,pe){try{await rt().updateSession(ue,{title:pe}),u(ue,ne=>({...ne,title:pe}))}catch(z){i("renameSession",z,{sessionId:ue})}}function Oe(ue,pe){e.workspaces=e.workspaces.map(z=>z.id===ue?{...z,name:pe}:z)}async function ge(ue){const pe=e.workspaces.find(et=>et.id===ue)?.root??E.value.find(et=>et.id===ue)?.root??ue,z=e.activeSessionId?e.sessions.find(et=>et.id===e.activeSessionId):void 0,ne=e.activeWorkspaceId===ue||e.activeWorkspaceId===pe,Ye=!!(z&&(z.cwd===pe||z.workspaceId===ue||I(z)===ue));pe&&!e.hiddenWorkspaceRoots.includes(pe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,pe],K(e.hiddenWorkspaceRoots));try{await rt().deleteWorkspace(ue)}catch{}if(e.workspaces=e.workspaces.filter(et=>et.id!==ue&&et.root!==pe),ne||Ye){const et=k.value[0]?.id??null;if(e.activeWorkspaceId=et,et)U(et);else try{Kc(At.activeWorkspace)}catch{}}(ne||Ye)&&(h(void 0),e.sessionLoading=!1,me(),Et(void 0,"replace"))}async function He(ue){try{await rt().archiveSession(ue),p(ue),s.clearSideChatForSession(ue);const{[ue]:z,...ne}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=ne,e.activeSessionId===ue){const Ye=e.sessions[0];Ye?await un(Ye.id,{urlMode:"replace"}):(h(void 0),Et(void 0,"replace"))}}catch(pe){i("archiveSession",pe,{sessionId:ue})}}async function jt(){try{await rt().logout(),await J(),await ce()}catch(ue){i("logout",ue)}}function Kt(ue){const pe=e.activeSessionId;pe&&rt().compactSession(pe,ue).catch(z=>{i("compact",z,{sessionId:pe})})}async function It(ue){const pe=ue??e.activeSessionId;if(pe)try{const z=await rt().forkSession(pe);d(z),await un(z.id)}catch(z){i("fork",z,{sessionId:pe})}}async function Ot(ue=1){const pe=e.activeSessionId;if(!pe)return null;const z=(()=>{const ne=e.messagesBySession[pe]??[];for(let Ye=ne.length-1;Ye>=0;Ye--){const et=ne[Ye];if(et.role==="user"&&!(et.metadata?.origin&&et.metadata.origin.kind!=="user"))return et.content.filter(xt=>xt.type==="text").map(xt=>xt.text).join(`
271
+ `)}return null})();try{return await rt().undoSession(pe,ue),await y(pe),z}catch(ne){return i("undo",ne,{sessionId:pe}),null}}function fo(ue){const pe=e.activeSessionId;if(!pe)return;const z=e.queuedBySession[pe]??[];if(ue<0||ue>=z.length)return;const ne=[...z];ne.splice(ue,1),e.queuedBySession={...e.queuedBySession,[pe]:ne}}async function ho(ue){const pe=e.activeSessionId;if(!pe)return[];try{return(await rt().listDirectory(pe,{path:ue,includeGitStatus:!0})).items}catch{return[]}}async function Di(ue){const pe=e.activeSessionId;if(!pe)return null;try{const ne=await rt().readFile(pe,{path:ue});return{path:ne.path,content:ne.content,encoding:ne.encoding,mime:ne.mime,languageId:ne.languageId,isBinary:ne.isBinary,size:ne.size,lineCount:ne.lineCount}}catch{return null}}const jo=10485760;function Bi(ue){const pe=e.activeSessionId;return pe?rt().getFileDownloadUrl(pe,ue):null}async function qo(ue,pe){const z=e.activeSessionId;if(!z)return!1;try{return await rt().openFile(z,{path:ue,line:pe}),!0}catch(ne){return i("openFile",ne,{sessionId:z}),!1}}async function Zn(ue){const pe=e.activeSessionId;if(!pe)return;const z=A.value.cwd||".";try{await rt().openInApp(pe,ue,z)}catch(ne){i("openInApp",ne,{sessionId:pe})}}async function Fi(ue){const pe=e.activeSessionId;if(!pe)return!1;try{return await rt().revealFile(pe,{path:ue}),!0}catch(z){return i("revealFile",z,{sessionId:pe}),!1}}async function vl(ue){if(/^(https?:|data:|blob:)/i.test(ue))return ue;const pe=e.activeSessionId;if(!pe)return ue;let z=ue;if(z.startsWith("/")){const ne=e.sessions.find(Ye=>Ye.id===pe)?.cwd;if(ne&&(z===ne||z.startsWith(ne.endsWith("/")?ne:`${ne}/`))){if(z=z.slice(ne.length).replace(/^\//,""),!z)return ue}else return ue}try{const Ye=await rt().readFile(pe,{path:z,length:jo});return!Ye.isBinary||Ye.encoding!=="base64"||Ye.truncated?ue:`data:${Ye.mime};base64,${Ye.content}`}catch{return ue}}async function Er(ue){const pe=e.activeSessionId;if(!pe)return[];try{return(await rt().searchFiles(pe,{query:ue,limit:20})).items.map(Ye=>({path:Ye.path,name:Ye.name}))}catch{return[]}}return{loadFileDiff:we,clearFileDiff:me,loadGitStatus:$e,checkAuth:J,loadConfig:ye,updateConfig:_e,listAllSessionsGlobal:oe,load:ce,loadWorkspaces:ke,loadMoreSessions:H,loadAllSessions:X,selectWorkspace:Me,openWorkspace:Ne,upsertWorkspacePreserveOrder:re,applyWorkspaceEvent:le,clearActiveSession:Ce,openWorkspaceDraft:We,createSessionInWorkspace:nt,startSessionAndSendPrompt:lt,addWorkspaceByPath:kt,browseFs:Ct,getFsHome:ut,writeSessionUrl:Et,fetchSessionIntoList:on,onSessionRoutePopState:Tn,bindSessionRoute:On,selectSession:un,createSession:tt,submitPromptInternal:Vn,sendPrompt:Lo,steerPrompt:_s,uploadImage:Pn,enqueue:rn,unqueue:fo,abortCurrentPrompt:yn,respondApproval:Rn,respondQuestion:Mn,dismissQuestion:ds,cancelTask:Dn,setPlanMode:ns,togglePlanMode:Ge,setSwarmMode:Ue,toggleSwarmMode:qe,setGoalMode:wt,toggleGoalMode:Qt,createGoal:Ns,controlGoal:zs,setPermission:Ar,dismissWarning:ws,renameSession:ai,renameWorkspace:Oe,deleteWorkspace:ge,archiveSession:He,logout:jt,compact:Kt,forkSession:It,undo:Ot,listDir:ho,readFileContent:Di,getFileDownloadUrl:Bi,openWorkspaceFile:qo,openInApp:Zn,revealWorkspaceFile:Fi,resolveImageUrl:vl,searchFiles:Er,loadOlderMessages:Ie,refreshSessionSidecars:de}}const pue="kimiWeb.optimisticUserMessage";function mue(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function gue(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 vue(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 Jm(e){return e.role==="user"&&e.metadata?.[pue]===!0}function yue(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function T2(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function kue(e,t){const n=T2(e),s=T2(t);return n.text===s.text&&n.media===s.media}function bue(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(Jm(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Jm(o)&&yue(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Jm(o)&&kue(o,t))return s}return-1}function _ue(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 wue(e,t,n){const s=gue(e);switch(vue(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"},[jM]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"){const a=bue(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]=_ue(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i];l[r]={...t.task,outputLines:i[r].outputLines},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];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"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?$n.global.t("warnings.errorLabel"):$n.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 Sue(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Cue(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"||pl(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:Sue(a.status)}]:[]})}}return[]}const xue=["queued","working","suspended","completed","failed"];function Tue(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function Mue(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Aue(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:Tue(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Mue();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 Eue(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of xue)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const Xs=Ece(),jd=Lce(),VM=At.permission,KM=At.activeWorkspace,GM=At.thinking,YM=At.planMode,XM=At.swarmMode,ZM=At.goalMode,M2=40401,JM=At.onboarded,$ue=["off","low","medium","high","xhigh","max"];Kc(At.codeFont);function Iue(){try{const e=xn(VM);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Nue(e){try{Ln(VM,e)}catch{}}function Lue(){try{const e=xn(GM);if(e&&$ue.includes(e))return e}catch{}return"high"}function Oue(e){try{Ln(GM,e)}catch{}}function Pue(){try{return xn(YM)==="true"}catch{return!1}}function Rue(e){try{Ln(YM,e?"true":"false")}catch{}}function Due(){try{return xn(XM)==="true"}catch{return!1}}function Bue(e){try{Ln(XM,e?"true":"false")}catch{}}function Fue(){try{return xn(ZM)==="true"}catch{return!1}}function Hue(e){try{Ln(ZM,e?"true":"false")}catch{}}function Wue(){try{return xn(KM)}catch{return null}}const QM=At.hiddenWorkspaces;function Uue(){try{const e=xn(QM);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function jue(e){try{Ln(QM,JSON.stringify(e))}catch{}}function que(e){try{Ln(KM,e)}catch{}}function e3(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function zue(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 Te=to({...mue(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:Iue(),thinking:Lue(),planMode:Pue(),swarmMode:Due(),goalMode:Fue(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:ov(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Wue(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Uue(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsFullyLoaded:!1});function t3(e){Te.sessions=e}function Bh(e,t){Te.sessions=Te.sessions.map(n=>n.id===e?t(n):n)}function Vue(e){Te.sessions=[e,...Te.sessions.filter(t=>t.id!==e.id)]}function Kue(e){Te.sessions=[...Te.sessions,e]}function Gue(e){Te.sessions=Te.sessions.filter(t=>t.id!==e)}function n3(){const e=Te.activeSessionId;e&&Te.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Te.unreadBySession={...Te.unreadBySession,[e]:!1},iv({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===At.unread&&(Te.unreadBySession=ov(),n3())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&n3()});function t0(e){Te.activeSessionId=e}function Yue(e){Te.messagesBySession=e}function Xue(e,t){Te.messagesBySession={...Te.messagesBySession,[e]:t}}function s3(e,t){Te.messagesBySession={...Te.messagesBySession,[e]:t(Te.messagesBySession[e]??[])}}function Zue(e){const{[e]:t,...n}=Te.messagesBySession;Te.messagesBySession=n}function o3(e){ii?.unsubscribe(e),ou.flush(),Gue(e),Zue(e),delete Te.approvalsBySession[e],delete Te.questionsBySession[e],delete Te.tasksBySession[e],delete Te.goalBySession[e],delete Te.gitStatusBySession[e],delete Te.lastSeqBySession[e],delete Te.compactionBySession[e],delete Te.messagesLoadingMoreBySession[e],delete Te.messagesHasMoreBySession[e],delete Te.messagesLoadMoreErrorBySession[e],delete Wh[e],p3.delete(e),Hh.delete(e),delete Te.queuedBySession[e],delete Te.promptIdBySession[e],delete Te.sendingBySession[e]}const i3=te(null),r3=te([]),l3=te(!1),a3=te(!1);async function Fh(e){let t;try{t=await rt().getSessionStatus(e)}catch{return}Bh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Te.swarmMode=t.swarmMode,Te.planMode=t.planMode}function c3(e){const t=Te.activeSessionId;t&&Promise.resolve(rt().updateSession(t,e)).then(()=>Fh(t)).catch(()=>{})}const u3=At.betaToc;function Jue(){try{return xn(u3)==="true"}catch{return!1}}function Que(e){try{Ln(u3,e?"true":"false")}catch{}}const d3=te(Jue());function ede(e){d3.value=e,Que(e)}function tde(e){try{return xn(e)??""}catch{return""}}const f3=te(tde(JM)==="1");function nde(e){f3.value=e;try{Ln(JM,e?"1":"0")}catch{}}let ii=null,A2=0;function h3(){return A2+=1,`msg_opt_${Date.now().toString(36)}_${A2}`}const Hh=new Set;function sde(e,t,n){const s={sessions:Te.sessions,activeSessionId:Te.activeSessionId,messagesBySession:Te.messagesBySession,approvalsBySession:Te.approvalsBySession,planReviewByToolCallId:Te.planReviewByToolCallId,questionsBySession:Te.questionsBySession,tasksBySession:Te.tasksBySession,goalBySession:Te.goalBySession,lastSeqBySession:Te.lastSeqBySession,compactionBySession:Te.compactionBySession,config:Te.config,warnings:Te.warnings},o=wue(s,e,{sessionId:t,seq:n});t3(o.sessions),t0(o.activeSessionId),Yue(o.messagesBySession),Te.approvalsBySession=o.approvalsBySession,Te.planReviewByToolCallId=o.planReviewByToolCallId,Te.questionsBySession=o.questionsBySession,Te.tasksBySession=o.tasksBySession,Te.goalBySession=o.goalBySession,Te.lastSeqBySession=o.lastSeqBySession,Te.compactionBySession=o.compactionBySession,Te.config=o.config??null,Te.warnings=o.warnings,e.type==="configChanged"&&(Te.defaultModel=e.config.defaultModel??null),e.type==="sessionUsageUpdated"&&e.sessionId===Te.activeSessionId&&e.swarmMode!==void 0&&(Te.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===Te.activeSessionId&&e.planMode!==void 0&&(Te.planMode=e.planMode)}function ode(e,t){sde(e,t.sessionId,t.seq);const n=ms.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&ms.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?ms.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?ms.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&ms.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;Te.promptIdBySession[s]!==e.message.promptId&&(Te.promptIdBySession={...Te.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Te.activeSessionId&&Xs.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&gfe(e.sessionId,e.status)}const ou=lce(({appEvent:e,meta:t})=>ode(e,t),({appEvent:e})=>ice(e));function n0(){if(ii!==null||typeof WebSocket>"u")return;Te.connection="connecting",ii=rt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ct.applyWorkspaceEvent(t);return}ou({appEvent:t,meta:n})},onResync(t,n,s){ou.flush(),s!==void 0&&(Wh[t]=s),pde.request(t)},onError(t,n,s){s0({severity:"error",title:$n.global.t("warnings.wsTitle"),message:n,details:[Qn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Te.connected=t,Te.connection=t?"connected":"disconnected"}})}const Wh={},p3=new Set;function ide(e){return yu(e)&&e.code===M2?!0:typeof e=="object"&&e!==null&&e.code===M2}function Qn(e,t){if(!(t==null||t===""))return{label:$n.global.t(`warnings.details.${e}`),value:m3(t)}}function m3(e){if(e instanceof Error)return e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function rde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function lde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function ade(e,t,n){const s=[Qn("operation",e),Qn("sessionId",n)];return OM(t)?s.push(Qn("request",`${t.method} ${t.path}`),Qn("endpoint",t.url),Qn("requestId",t.requestId),Qn("phase",t.phase),Qn("timeout",`${t.timeoutMs}ms`),Qn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Qn("contentType",t.contentType),Qn("responsePreview",t.bodyPreview),Qn("cause",t.cause)):yu(t)?s.push(Qn("code",t.code),Qn("requestId",t.requestId),Qn("message",t.message),Qn("details",t.details)):s.push(Qn("errorName",rde(t)),Qn("message",lde(t)??m3(t))),s.filter(o=>o!==void 0)}function cde(e,t,n={}){const s=OM(t),o=yu(t),i=n.title??(s?$n.global.t("warnings.daemonNetworkTitle"):o?$n.global.t("warnings.daemonApiTitle"):$n.global.t("warnings.operationFailedTitle")),r=n.message??(s?$n.global.t("warnings.daemonNetworkMessage"):o?t.message:$n.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:ade(e,t,n.sessionId)}}function s0(e){Te.warnings=[...Te.warnings,e]}function Uh(e,t,n){s0(cde(e,t,n))}const ude={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function dde(e){if(!yu(e))return;const t=ude[e.code];return t?$n.global.t(t):void 0}async function fde(e){if(o3(e),Te.activeSessionId!==e)return;const t=Te.sessions[0];t?await ct.selectSession(t.id,{urlMode:"replace"}):(t0(void 0),Te.sessionLoading=!1,ct.writeSessionUrl(void 0,"replace"))}const E2=new Set;async function hde(e){if(!E2.has(e)){E2.add(e);try{const t=await rt().getSessionWarnings(e),n=$n.global.t("warnings.noteLabel");for(const s of t)s0(`${n}: ${s.message}`)}catch{}}}async function g3(e){try{const n=await rt().getSessionSnapshot(e);ou.flush(),Bh(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),Xue(e,n.messages),Te.messagesHasMoreBySession={...Te.messagesHasMoreBySession,[e]:n.hasMoreMessages},Te.approvalsBySession={...Te.approvalsBySession,[e]:n.pendingApprovals};for(const s of n.pendingApprovals){const o=s.display;o?.kind==="plan_review"&&typeof o.plan=="string"&&o.plan.length>0&&(Te.planReviewByToolCallId={...Te.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return Te.questionsBySession={...Te.questionsBySession,[e]:n.pendingQuestions},Te.lastSeqBySession={...Te.lastSeqBySession,[e]:n.asOfSeq},Wh[e]=n.epoch,n0(),ii&&(ii.seedSnapshot(e,n),ii.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),hde(e),"ok"}catch(t){return ide(t)?(await fde(e),"not-found"):(Uh("getSessionSnapshot",t,{title:$n.global.t("warnings.sessionSnapshotTitle"),message:$n.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const pde=sce(g3);function mde(e){return Object.prototype.hasOwnProperty.call(Te.messagesBySession,e)}function gde(e){if(n0(),ii){ou.flush();const t=Te.lastSeqBySession[e]??0,n=Wh[e];ii.subscribe(e,{seq:t,epoch:n})}}function jh(e){const t=Te.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=ms.sideChatTargetBySession.value[e]?.agentId,o=(Te.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Te.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function o0(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;return o<6e4?$n.global.t("sessions.justNow"):i<1?`${Math.round(o/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString($n.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const vde=3e4,iu=te(0);let Qm=null;function yde(){Qm===null&&(Qm=setInterval(()=>{iu.value=(iu.value+1)%Number.MAX_SAFE_INTEGER},vde),Qm.unref?.())}function kde(e,t){const n=e.split(`
272
+ `),s=t.split(`
273
+ `),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 bde(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:kde(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 _de(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 wde(e){const t=Te.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 Sde(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=$n.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=$n.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??wde(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s}}const Cde=F(()=>{const e=Te.sessions.find(n=>n.id===Te.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Te.workspaceName,branch:t}}),xde=F(()=>(iu.value,Te.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:o0(e.updatedAt,e.status),status:e.status,busy:jh(e.id)})))),Tde=F(()=>Te.activeSessionId??""),Mde=F(()=>{const e=Te.activeSessionId;return e?Hn.skillsBySession.value[e]??[]:[]}),Ade=F(()=>{const e=Te.activeSessionId;return e?Te.sendingBySession[e]??!1:!1}),ms=lue(Te,{pushOperationFailure:Uh,nextOptimisticMsgId:h3,connectEventsIfNeeded:n0,getEventConn:()=>ii}),qh=F(()=>{const e=Te.activeSessionId;if(!e)return[];const t=ms.sideChatTargetBySession.value[e]?.agentId;return(Te.tasksBySession[e]??[]).filter(n=>n.id!==t)}),v3=Rce(Te,qh),Ede=F(()=>{const e=Te.activeSessionId;if(!e)return[];const t=new Set(Te.sideChatUserMessageIdsBySession[e]??[]),n=(Te.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Te.approvalsBySession[e]??[];return zM(n,s,o=>rt().getFileUrl(o),zh.value!=="idle",qh.value,Te.planReviewByToolCallId)}),$de=F(()=>(v3.taskClock.value,qh.value.map(Sde))),y3=F(()=>Aue(qh.value)),Kl=F(()=>{const e=Te.activeSessionId;return e?Te.goalBySession[e]??null:null}),Ide=F(()=>{const e=Te.activeSessionId;return e?Cue(Te.messagesBySession[e]??[]):[]}),Nde=F(()=>{const e=Te.activeSessionId;return e?Te.compactionBySession[e]??null:null}),Lde=F(()=>Te.connection),Ode=F(()=>Te.loading),Pde=F(()=>Te.sessionLoading),Rde=F(()=>{const e=Te.activeSessionId;return e?Te.messagesLoadingMoreBySession[e]??!1:!1}),Dde=F(()=>{const e=Te.activeSessionId;return e?Te.messagesHasMoreBySession[e]??!1:!1}),Bde=F(()=>{const e=Te.activeSessionId;return e?Te.messagesLoadMoreErrorBySession[e]??!1:!1}),Fde=F(()=>Te.serverVersion),Hde=F(()=>Te.permission),Wde=F(()=>Te.thinking),Ude=F(()=>Te.planMode),jde=F(()=>Te.swarmMode),qde=F(()=>Te.goalMode),zde=F(()=>{const e=Eue(y3.value);return{plan:Te.planMode,goal:Kl.value&&Kl.value.status!=="complete"?{status:Kl.value.status,turnsUsed:Kl.value.turnsUsed,elapsedMs:Kl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Vde=F(()=>{const e=Te.activeSessionId;return e?(Te.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),Kde=F(()=>Te.warnings),Gde=F(()=>{const e=Te.activeSessionId;return e?(Te.questionsBySession[e]??[]).map(_de):[]}),Yde=F(()=>{const e=Te.activeSessionId;return e?(Te.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:bde(t),agentName:t.agentName})):[]}),zh=F(()=>{const e=Te.activeSessionId;return e?(Te.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Te.questionsBySession[e]??[]).length>0?"awaiting-question":jh(e)?"running":"idle":"idle"}),Hn=Fce(Te,{pushOperationFailure:Uh,refreshSessionStatus:Fh,persistSessionProfile:c3,activity:zh,inFlightPromptSessions:Hh,saveThinkingToStorage:Oue,updateSession:Bh,updateSessionMessages:s3}),zf=F(()=>{const e=Te.activeSessionId;if(!e)return null;const t=Te.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Xde=F(()=>{const e=Te.activeSessionId;return e?Te.gitStatusBySession[e]?.pullRequest??null:null}),Zde=F(()=>{const e=Te.activeSessionId;if(!e)return[];const t=Te.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),Jde=F(()=>{const e=Te.activeSessionId;if(!e)return null;const t=Te.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),k3=F(()=>{const e=Te.sessions.find(r=>r.id===Te.activeSessionId),t=zf.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Hn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Te.defaultModel)??"—",o=Hn.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Te.permission,branch:t,cwd:e?.cwd??"",isGitRepo:zf.value!==null}}),Qde=F(()=>r3.value),efe=F(()=>Te.sessions.find(t=>t.id===Te.activeSessionId)?.usage.totalCostUsd??0),tfe=F(()=>Te.authReady),nfe=F(()=>Te.defaultModel),sfe=F(()=>Te.managedProviderStatus),ofe=F(()=>Te.config),ife=F(()=>{const e=Te.activeSessionId;if(!e)return{};const t=Te.gitStatusBySession[e];return t?{...t.entries}:{}});function ku(e){return Te.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const i0=F(()=>{const e=new Set(Te.hiddenWorkspaceRoots),t=new Map;for(const a of Te.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of Te.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:e3(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of Te.sessions){const c=ku(a);n.set(c,(n.get(c)??0)+1)}const s=zf.value,o=Te.sessions.find(a=>a.id===Te.activeSessionId)?.cwd,i=Te.workspaces.filter(a=>!e.has(a.root)).map(a=>a.root),r=[...t.keys()].filter(a=>!i.includes(a));r.sort((a,c)=>a.localeCompare(c));const l=[];for(const a of[...i,...r]){const c=t.get(a),u=n.get(c.id)??n.get(c.root)??0,d=Te.sessionsHasMoreByWorkspace[c.id]===!1?u:Math.max(c.sessionCount,u);let f=c.branch;!f&&s&&o===c.root&&(f=s.branch),l.push({...c,sessionCount:d,branch:f})}return l}),Vf=te(p6());Ke(()=>[i0.value.map(e=>e.id).join("\0"),Te.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=T6(n,Vf.value);s!==null&&(Vf.value=s,BC(s))});const Ia=F(()=>{const e=i0.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:zue(t.root,Te.fsHome),branch:t.branch,sessionCount:t.sessionCount}));return M6(e,Vf.value)}),b3=F(()=>{const e=Te.activeWorkspaceId,t=Ia.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),rfe=F(()=>{const e=b3.value;return e?Ia.value.find(t=>t.id===e)??null:null}),lfe=F(()=>{iu.value;const e=new Set(Ia.value.map(t=>t.id));return Te.sessions.filter(t=>!t.parentSessionId&&e.has(ku(t))).map(t=>({id:t.id,title:t.title,time:o0(t.updatedAt,t.status),status:t.status,busy:jh(t.id),lastPrompt:t.lastPrompt}))}),afe=F(()=>{iu.value;const e=new Map;for(const t of Te.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=ku(t),s={id:t.id,title:t.title,time:o0(t.updatedAt,t.status),status:t.status,busy:jh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Ia.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Te.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Te.sessionsLoadingMoreByWorkspace[t.id]??!1}))});function cfe(e){Vf.value=e,BC(e)}const _3=F(()=>{const e={};for(const[t,n]of Object.entries(Te.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Te.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),ufe=F(()=>{const e={};for(const[t,n]of Object.entries(Te.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Te.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),dfe=F(()=>{const e={};for(const[t,n]of Object.entries(Te.unreadBySession))n&&(e[t]=!0);return e}),ffe=F(()=>{const e={},t=_3.value;for(const n of Te.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=ku(n);e[o]=(e[o]??0)+s}return e}),hfe=F(()=>Te.recentRoots),pfe=F(()=>{const e=new Set,t=[];for(const n of Te.sessions){const s=n.cwd;if(s&&!e.has(s)&&(e.add(s),t.push(s),t.length>=8))break}return t}),mfe=F(()=>Te.availableOpenInApps),ct=hue(Te,{taskPoller:v3,sideChat:ms,modelProvider:Hn,pushOperationFailure:Uh,activity:zh,inFlightPromptSessions:Hh,sessionsKnownEmpty:p3,setSessions:t3,updateSession:Bh,upsertSessionFront:Vue,appendSession:Kue,forgetSession:o3,setActiveSessionId:t0,updateSessionMessages:s3,nextOptimisticMsgId:h3,getEventConn:()=>ii,syncSessionFromSnapshot:g3,subscribeToSessionEvents:gde,hasLoadedMessages:mde,refreshSessionStatus:Fh,persistSessionProfile:c3,mergedWorkspaces:i0,workspacesView:Ia,status:k3,workspaceIdForSession:ku,savePermissionToStorage:Nue,savePlanModeToStorage:Rue,saveSwarmModeToStorage:Bue,saveGoalModeToStorage:Hue,saveUnread:iv,saveActiveWorkspaceToStorage:que,saveHiddenWorkspacesToStorage:jue,goalErrorMessage:dde,basename:e3,resetFastMoon:Xs.resetFastMoon,initialized:a3,selectedDiffPath:i3,fileDiffLines:r3,fileDiffLoading:l3});function gfe(e,t){if(Hh.delete(e),Te.sendingBySession={...Te.sendingBySession,[e]:!1},Te.promptIdBySession[e]!==void 0){const i={...Te.promptIdBySession};delete i[e],Te.promptIdBySession=i}e===Te.activeSessionId?(Xs.resetFastMoon(),ct.loadGitStatus(e),Fh(e)):t==="idle"&&(Te.unreadBySession={...Te.unreadBySession,[e]:!0},iv({[e]:!0})),jd.maybeNotifyCompletion(e,{isActiveAndVisible:e===Te.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Te.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{ct.selectSession(e)}});const n=Te.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;Te.queuedBySession={...Te.queuedBySession,[e]:o},s!==void 0&&ct.submitPromptInternal(e,s.text,s.attachments).then(i=>{if(!i){const r=Te.queuedBySession[e]??[];Te.queuedBySession={...Te.queuedBySession,[e]:[s,...r]}}})}function vfe(){return yde(),{workspace:Cde,sessions:xde,activeSessionId:Tde,workspacesView:Ia,visibleWorkspace:rfe,activeWorkspaceId:b3,sessionsForView:lfe,workspaceGroups:afe,attentionBySession:_3,pendingBySession:ufe,attentionByWorkspace:ffe,unreadBySession:dfe,recentRoots:hfe,turns:Ede,tasks:$de,todos:Ide,goal:Kl,swarms:y3,activationBadges:zde,compaction:Nde,status:k3,sessionCost:efe,fileDiff:Qde,selectedDiffPath:i3,fileDiffLoading:l3,changes:Zde,gitInfo:zf,gitDiffStats:Jde,activePullRequest:Xde,changesByPath:ife,pendingApprovals:Yde,recentCwds:pfe,availableOpenInApps:mfe,connection:Lde,loading:Ode,sessionLoading:Pde,loadingMoreMessages:Rde,hasMoreMessages:Dde,loadMoreMessagesError:Bde,serverVersion:Fde,initialized:a3,permission:Hde,thinking:Wde,planMode:Ude,swarmMode:jde,goalMode:qde,queued:Vde,warnings:Kde,questions:Gde,activity:zh,isSending:Ade,fastMoon:Xs.fastMoon,models:Hn.models,starredModelIds:Hn.starredModelIds,providers:Hn.providers,theme:Xs.theme,setTheme:Xs.setTheme,toggleTheme:Xs.toggleTheme,uiFontSize:Xs.uiFontSize,setUiFontSize:Xs.setUiFontSize,betaToc:d3,setBetaToc:ede,colorScheme:Xs.colorScheme,setColorScheme:Xs.setColorScheme,accent:Xs.accent,setAccent:Xs.setAccent,notifyOnComplete:jd.notifyOnComplete,notifyPermission:jd.notifyPermission,setNotifyOnComplete:jd.setNotifyOnComplete,onboarded:f3,setOnboarded:nde,load:ct.load,selectSession:ct.selectSession,createSession:ct.createSession,loadOlderMessages:ct.loadOlderMessages,loadWorkspaces:ct.loadWorkspaces,loadMoreSessions:ct.loadMoreSessions,loadAllSessions:ct.loadAllSessions,selectWorkspace:ct.selectWorkspace,openWorkspace:ct.openWorkspace,openWorkspaceDraft:ct.openWorkspaceDraft,createSessionInWorkspace:ct.createSessionInWorkspace,startSessionAndSendPrompt:ct.startSessionAndSendPrompt,addWorkspaceByPath:ct.addWorkspaceByPath,browseFs:ct.browseFs,getFsHome:ct.getFsHome,sendPrompt:ct.sendPrompt,steerPrompt:ct.steerPrompt,sideChatVisible:ms.sideChatVisible,sideChatSessionId:ms.sideChatSessionId,sideChatTurns:ms.sideChatTurns,sideChatRunning:ms.sideChatRunning,sideChatSending:ms.sideChatSending,openSideChat:ms.openSideChat,closeSideChat:ms.closeSideChat,sendSideChatPrompt:ms.sendSideChatPrompt,uploadImage:ct.uploadImage,abortCurrentPrompt:ct.abortCurrentPrompt,respondApproval:ct.respondApproval,respondQuestion:ct.respondQuestion,dismissQuestion:ct.dismissQuestion,cancelTask:ct.cancelTask,setPermission:ct.setPermission,setThinking:Hn.setThinking,setPlanMode:ct.setPlanMode,togglePlanMode:ct.togglePlanMode,setSwarmMode:ct.setSwarmMode,toggleSwarmMode:ct.toggleSwarmMode,setGoalMode:ct.setGoalMode,toggleGoalMode:ct.toggleGoalMode,createGoal:ct.createGoal,controlGoal:ct.controlGoal,enqueue:ct.enqueue,dismissWarning:ct.dismissWarning,renameSession:ct.renameSession,renameWorkspace:ct.renameWorkspace,deleteWorkspace:ct.deleteWorkspace,reorderWorkspaces:cfe,archiveSession:ct.archiveSession,compact:ct.compact,forkSession:ct.forkSession,undo:ct.undo,unqueue:ct.unqueue,searchFiles:ct.searchFiles,loadGitStatus:ct.loadGitStatus,loadFileDiff:ct.loadFileDiff,clearFileDiff:ct.clearFileDiff,listDir:ct.listDir,readFileContent:ct.readFileContent,getFileDownloadUrl:ct.getFileDownloadUrl,openWorkspaceFile:ct.openWorkspaceFile,openInApp:ct.openInApp,revealWorkspaceFile:ct.revealWorkspaceFile,resolveImageUrl:ct.resolveImageUrl,refreshOAuthProviderModels:Hn.refreshOAuthProviderModels,loadModels:Hn.loadModels,loadProviders:Hn.loadProviders,skills:Mde,activateSkill:Hn.activateSkill,setModel:Hn.setModel,toggleStarModel:Hn.toggleStarModel,addProvider:Hn.addProvider,deleteProvider:Hn.deleteProvider,refreshProvider:Hn.refreshProvider,authReady:tfe,defaultModel:nfe,managedProviderStatus:sfe,config:ofe,updateConfig:ct.updateConfig,checkAuth:ct.checkAuth,startOAuthLogin:Hn.startOAuthLogin,pollOAuthLogin:Hn.pollOAuthLogin,cancelOAuthLogin:Hn.cancelOAuthLogin,logout:ct.logout}}function yfe({client:e,authLogoRef:t}){const n=F(()=>e.authReady.value),s=F(()=>e.initialized.value&&!n.value),o="/login",i=te(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ke(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 Ft(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function kfe({running:e,showAuthGate:t}){const{t:n}=_t(),s=["◐","◓","◑","◒"],o=te(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}Ke(e,c=>{c?r():l()},{immediate:!0});const a=F(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});hE(()=>{typeof document<"u"&&(document.title=a.value)}),Ft(()=>{l()})}const w3=te(typeof window>"u"?0:window.innerWidth);let Sd=0,Kf=!1;function x1(){w3.value=window.innerWidth}function bfe(){Kf||typeof window>"u"||(window.addEventListener("resize",x1),Kf=!0,x1())}function _fe(){!Kf||typeof window>"u"||(window.removeEventListener("resize",x1),Kf=!1)}function S3(e,t,n){return Math.max(t,e-n)}function T1(e,t,n){return Math.min(n,Math.max(t,e))}function C3(){return Zt(()=>{Sd+=1,bfe()}),qs(()=>{Sd=Math.max(0,Sd-1),Sd===0&&_fe()}),{viewportWidth:w3}}const wfe="kimi-web.file-preview-width",Gl=320;function Sfe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=C3(),i=F(()=>Math.max(0,o.value-t.value)),r=F(()=>S3(i.value,Gl,Gl));function l(me){return T1(Math.round(me),Gl,r.value)}function a(){return l(i.value/2)}const c=F(()=>a()),u=te(c.value),d=F(()=>T1(u.value,Gl,r.value)),f=te(null),p=F(()=>{const me=f.value;if(!me)return null;const J=e.turns.value.find(ye=>ye.id===me.turnId)?.blocks?.[me.blockIndex];return J?.kind==="thinking"?J.thinking:null}),h=F(()=>p.value!==null);function g(me){const $e=f.value;if($e&&$e.turnId===me.turnId&&$e.blockIndex===me.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=me}function S(){f.value=null,n.value==="thinking"&&(n.value=null)}const _=te(null),y=F(()=>{const me=_.value;if(!me)return null;const $e=e.turns.value.find(J=>J.id===me.turnId);return $e?.role==="compaction"&&$e.text?$e.text:null}),b=F(()=>y.value!==null);function v(me){if(_.value?.turnId===me.turnId){_.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",_.value=me}function w(){_.value=null,n.value==="compaction"&&(n.value=null)}const N=te(null),E=F(()=>{const me=N.value;if(!me)return null;const J=e.turns.value.find(ye=>ye.id===me.turnId)?.blocks?.[me.blockIndex];return J?J.kind==="agent"?J.member.id===me.memberId?J.member:null:J.kind==="agentGroup"?J.members.find(ye=>ye.id===me.memberId)??null:null:null}),k=F(()=>E.value!==null);function A(me){const $e=N.value;if($e&&$e.turnId===me.turnId&&$e.memberId===me.memberId){N.value=null,n.value==="agent"&&(n.value=null);return}n.value="agent",N.value=me}function I(){N.value=null,n.value==="agent"&&(n.value=null)}const P=te(null),M=F(()=>{const me=P.value;if(!me)return null;const $e=e8(e.turns.value,me);return $e?{id:me,title:gf($e.name),path:QN($e.arg),lines:$e.status==="error"?null:qC($e),output:$e.output}:null}),L=F(()=>M.value!==null);function R(me){if(n.value==="toolDiff"&&P.value===me){B();return}n.value="toolDiff",P.value=me}function B(){P.value=null,n.value==="toolDiff"&&(n.value=null)}const U=te("list"),K=te(null);function V(){if(n.value==="diff"){se();return}n.value="diff",U.value="list",K.value=null,e.loadGitStatus(e.activeSessionId.value)}function se(){n.value==="diff"&&(n.value=null),U.value="list",K.value=null,e.clearFileDiff()}async function Y(me){U.value="detail",K.value=me,await e.loadFileDiff(me)}async function G(me){await e.openSideChat(me),n.value="btw"}function ee(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function Se(){n.value==="btw"&&(n.value=null)}const ae=F(()=>e.sideChatVisible.value),Ie=F(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||b.value)&&(n.value!=="agent"||k.value)&&(n.value!=="toolDiff"||L.value)&&(n.value!=="btw"||ae.value)),de=te(!1);function we(){return n.value==="thinking"&&h.value?(S(),!0):n.value==="compaction"&&b.value?(w(),!0):n.value==="agent"&&k.value?(I(),!0):n.value==="toolDiff"&&L.value?(B(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(se(),!0):n.value==="btw"?(ee(),!0):!1}return Ke(e.activeSessionId,()=>{s(),S(),w(),I(),B(),se(),Se()}),{PREVIEW_WIDTH_KEY:wfe,PREVIEW_MIN:Gl,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:p,thinkingVisible:h,openThinkingPanel:g,closeThinkingPanel:S,compactionPanelText:y,compactionPanelVisible:b,openCompactionPanel:v,closeCompactionPanel:w,agentPanelMember:E,agentPanelVisible:k,openAgentPanel:A,closeAgentPanel:I,toolDiffTarget:M,toolDiffVisible:L,openToolDiff:R,closeToolDiff:B,detailDiffMode:U,detailDiffPath:K,openDiffDetail:V,closeDiffDetail:se,selectDiffFile:Y,btwVisible:ae,openSideChatTab:G,closeSideChat:ee,hideSideChatPanel:Se,sidePanelVisible:Ie,panelDragging:de,closeOpenSidePanel:we}}const Cfe=At.sidebarWidth,$2=At.sidebarCollapsed,I2=270,eg=170,xfe=36,Tfe=320;function Mfe(e={}){const{viewportWidth:t}=C3(),n=te(I2),s=te(!1),o=F(()=>{const c=Tfe+(tS(e.previewOpen)?Gl:0);return S3(t.value,eg,c)}),i=F(()=>s.value?xfe:T1(n.value,eg,o.value));function r(){try{s.value=xn($2)==="true"}catch{s.value=!1}}function l(){try{Ln($2,String(s.value))}catch{}}function a(){s.value=!s.value,l()}return{SIDEBAR_WIDTH_KEY:Cfe,SIDEBAR_DEFAULT:I2,SIDEBAR_MIN:eg,sidebarMax:o,sessionColWidth:n,sidebarCollapsed:s,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function Afe({client:e,detailTarget:t}){const{t:n}=_t(),s=te(null),o=te(null),i=te(!1),r=te(null),l=te(null);let a=0;const c=F(()=>{const v=l.value;return v?e.getFileDownloadUrl(v):null}),u=F(()=>s.value!==null);function d(v){return v.length>1?v.replace(/\/+$/,""):v}function f(v){const w=[];for(const N of v.split(/[\\/]+/))if(!(!N||N===".")){if(N===".."){w.pop();continue}w.push(N)}return w.join("/")}function p(v){const w=v.trim();if(!w)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(w))return{error:n("filePreview.errors.unsupportedPath")};if(w.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const N=d(e.status.value.cwd);if(w.startsWith("/")){if(!N||w!==N&&!w.startsWith(`${N}/`))return{error:n("filePreview.errors.outsideWorkspace")};const k=w===N?"":w.slice(N.length+1);if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const A=f(k);return A?{path:A}:{error:n("filePreview.errors.isDirectory")}}if(w.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const E=f(w);return E?{path:E}:{error:n("filePreview.errors.emptyPath")}}async function h(v){const w=s.value;if(t.value==="file"&&w&&w.path===v.path&&w.line===v.line){_();return}const N=++a;t.value="file",o.value=null,r.value=null,i.value=!0,s.value=v,l.value=null;const E=p(v.path);if("error"in E){i.value=!1,r.value=E.error;return}l.value=E.path;try{const k=await e.readFileContent(E.path);if(N!==a)return;k?o.value={...k,path:k.path||E.path}:o.value={path:E.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(k){if(N!==a)return;r.value=k instanceof Error?k.message:n("filePreview.errors.loadFailed")}finally{N===a&&(i.value=!1)}}function g(v){return/^data:([^;,]+)/i.exec(v)?.[1]}function S(v){v.kind==="image"&&(t.value="file",s.value=null,l.value=null,r.value=null,i.value=!1,o.value={path:v.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:v.mimeType??g(v.url)??"image/*",sourceUrl:v.url,isBinary:!0,size:v.bytes??0})}function _(){s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function y(){const v=o.value?.path??s.value?.path;v&&e.openWorkspaceFile(v,s.value?.line)}function b(){const v=o.value?.path??s.value?.path;v&&e.revealWorkspaceFile(v)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:h,openMediaPreview:S,closeFilePreview:_,openPreviewInEditor:y,revealPreviewFile:b}}const Efe=640,$fe=`(max-width: ${Efe}px)`;function Ife(){const e=te(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia($fe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Ft(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Ft(()=>t.removeListener(n))),e}const Nfe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Lfe={class:"server-auth-card"},Ofe=["disabled"],Pfe=["disabled"],Rfe=Ze({__name:"ServerAuthDialog",setup(e){const t=te(""),n=te(null),s=te(!1);Zt(()=>{mt(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,RM(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(x(),$("div",Nfe,[m("div",Lfe,[l[1]||(l[1]=m("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required",-1)),l[2]||(l[2]=m("p",{class:"server-auth-hint"},[dt(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),m("code",null,"KIMI_CODE_PASSWORD"),dt("). ")],-1)),Lt(m("input",{ref_key:"inputRef",ref:n,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",class:"server-auth-input",autocomplete:"current-password",placeholder:"Token",disabled:s.value,onKeydown:i},null,40,Ofe),[[wn,t.value]]),m("button",{type:"button",class:"server-auth-button",disabled:!t.value||s.value,onClick:o},O(s.value?"Connecting…":"Connect"),9,Pfe)])]))}}),Dfe=vt(Rfe,[["__scopeId","data-v-fb2ac094"]]),Bfe={class:"app-shell"},Ffe={key:1,class:"auth-page"},Hfe={class:"auth-page-inner"},Wfe={class:"auth-page-copy"},Ufe={key:0,class:"sidebar-rail"},jfe=["title","aria-label"],qfe={key:3,class:"coming-soon"},zfe={class:"cs-text"},Vfe=["aria-label","aria-hidden"],Kfe=Ze({__name:"App",setup(e){const t=zae(),n=te(!t);let s=null;const o=vfe();gn("resolveImage",o.resolveImageUrl);const{t:i}=_t(),r=li(),l=Ife(),a=te(!1),c=te(!1),u=F(()=>{const pe=o.activeSessionId.value;return o.sessions.value.find(z=>z.id===pe)?.title??""}),d=F(()=>o.visibleWorkspace.value?.sessionCount??0),f=F(()=>o.activity.value!=="idle"),p=te(null),{showAuthGate:h,blinkAuthLogo:g}=yfe({client:o,authLogoRef:p});kfe({running:f,showAuthGate:h});function S(pe){return pe==="off"?"high":"off"}const _=te(!o.onboarded.value);function y(){o.setOnboarded(!0),_.value=!1}function b(){_.value=!0}Zt(()=>{o.load(),Ie(),document.addEventListener("keydown",v,!0),s=Kae(()=>{n.value=!0})}),Ft(()=>{document.removeEventListener("keydown",v,!0),s!==null&&(s(),s=null)});function v(pe){pe.key==="Escape"&&(Ge.value||On()&&(pe.stopPropagation(),pe.preventDefault()))}const w=te(null),{previewTarget:N,previewFile:E,previewLoading:k,previewError:A,previewDownloadUrl:I,previewExternalActions:P,openFilePreview:M,openMediaPreview:L,closeFilePreview:R,openPreviewInEditor:B,revealPreviewFile:U}=Afe({client:o,detailTarget:w}),K=F(()=>w.value!==null),{SIDEBAR_WIDTH_KEY:V,SIDEBAR_DEFAULT:se,SIDEBAR_MIN:Y,sidebarMax:G,sessionColWidth:ee,sidebarCollapsed:Se,sideWidth:ae,loadSidebarCollapsed:Ie,toggleSidebarCollapse:de}=Mfe({previewOpen:K}),{PREVIEW_WIDTH_KEY:we,PREVIEW_MIN:me,previewDefaultWidth:$e,previewMax:J,previewWidth:ye,previewPanelWidth:_e,thinkingPanelText:W,thinkingVisible:Z,openThinkingPanel:fe,closeThinkingPanel:oe,compactionPanelText:he,compactionPanelVisible:H,openCompactionPanel:X,closeCompactionPanel:ce,agentPanelMember:ke,openAgentPanel:Me,closeAgentPanel:Ne,toolDiffTarget:re,openToolDiff:le,closeToolDiff:Ce,detailDiffMode:We,detailDiffPath:nt,openDiffDetail:lt,closeDiffDetail:kt,selectDiffFile:Ct,btwVisible:ut,openSideChatTab:Et,closeSideChat:on,sidePanelVisible:Tn,panelDragging:$t,closeOpenSidePanel:On}=Sfe({client:o,sideWidth:ae,detailTarget:w,closeFilePreview:R}),un=te(null),tt=te([]),Vn=F(()=>tt.value.length>1);function Lo(pe){tt.value=pe}const _s=te(!1),Pn=te(!1),rn=te(!1),yn=te(!1),Rn=te(!1),Mn=te(!1),ds=te(!1),Dn=te(!1),ns=te(null),Ge=F(()=>_s.value||Pn.value||rn.value||yn.value||Rn.value||Mn.value||ds.value||Dn.value||_.value||a.value||c.value),Ue=te(!1),qe=te(!1),wt=te(!1),Qt=te(!1),Ns=te(!1);async function zs(){Ue.value=!0,qe.value=!1,_s.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{qe.value=!0}finally{Ue.value=!1}}async function Ar(){wt.value=!0,Qt.value=!1,Pn.value=!0;try{await o.loadProviders()}catch{Qt.value=!0}finally{wt.value=!1}}function ws(){rn.value=!0}async function ai(pe){_s.value=!1,await o.setModel(pe)}async function Oe(pe){await o.addProvider(pe)}async function ge(pe){await o.deleteProvider(pe)}async function He(pe){await o.refreshProvider(pe)}async function jt(pe){Ns.value=!0;try{await o.updateConfig(pe)&&await o.checkAuth()}finally{Ns.value=!1}}async function Kt(){return o.startOAuthLogin()}async function It(){return o.pollOAuthLogin()}async function Ot(){return o.cancelOAuthLogin()}async function fo(){rn.value=!1,await o.checkAuth(),await o.load()}async function ho(pe){await o.undo(1),await mt(),un.value?.loadComposerForEdit(pe)}function Di(pe){if(pe==="/compact"||pe.startsWith("/compact ")){o.compact(pe.slice(8).trim()||void 0);return}if(pe==="/swarm"||pe.startsWith("/swarm ")){const z=pe.slice(6).trim();z==="on"?o.setSwarmMode(!0):z==="off"?o.setSwarmMode(!1):z?(o.setSwarmMode(!0),o.sendPrompt(z)):o.toggleSwarmMode();return}if(pe==="/goal"||pe.startsWith("/goal ")){const z=pe.slice(5).trim();z==="pause"||z==="resume"||z==="cancel"?o.controlGoal(z):z?o.createGoal(z):o.toggleGoalMode();return}if(pe==="/btw"||pe.startsWith("/btw ")){const z=pe.slice(4).trim();!z&&o.sideChatVisible.value?on():Et(z||void 0);return}switch(pe){case"/new":case"/clear":yn.value=!0;break;case"/sessions":Rn.value=!0;break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const z=o.permission.value,ne=z==="manual"?"auto":z==="auto"?"yolo":"manual";o.setPermission(ne);break}case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(S(o.thinking.value));break;case"/help":o.dismissWarning(-1);break;case"/status":ds.value=!0;break;case"/model":zs();break;case"/provider":Ar();break;case"/login":ws();break;default:{const z=pe.indexOf(" "),ne=(z===-1?pe:pe.slice(0,z)).slice(1),Ye=z===-1?void 0:pe.slice(z+1).trim()||void 0;ne&&o.activateSkill(ne,Ye);break}}}function jo(pe){o.unqueue(pe)}function Bi(pe){o.unqueue(pe)}async function qo(pe){const z=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&z){await o.startSessionAndSendPrompt(z,pe.text,pe.attachments);return}if(!o.activeSessionId.value&&!z){ns.value=pe,Mn.value=!0;return}o.sendPrompt(pe.text,pe.attachments)}async function Zn(pe){Mn.value=!1,await o.addWorkspaceByPath(pe);const z=ns.value;ns.value=null;const ne=o.activeWorkspaceId.value;z&&ne&&await o.startSessionAndSendPrompt(ne,z.text,z.attachments)}function Fi(){ns.value=null,Mn.value=!1}function vl(){const pe=o.activeWorkspaceId.value;pe?o.openWorkspaceDraft(pe):yn.value=!0}function Er(pe){o.openWorkspaceDraft(pe)}function ue(pe){pe&&window.open(pe,"_blank","noopener")}return(pe,z)=>(x(),$("div",Bfe,[n.value?(x(),je(Dfe,{key:0})):ie("",!0),C(h)?(x(),$("section",Ffe,[m("div",Hfe,[(x(),$("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:z[0]||(z[0]=Je(()=>{},["prevent"])),onClick:z[1]||(z[1]=(...ne)=>C(g)&&C(g)(...ne))},[...z[97]||(z[97]=[yr('<defs data-v-f77bc585><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-f77bc585><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-f77bc585></rect><g class="ch-eyes" fill="#000" data-v-f77bc585><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-f77bc585></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-f77bc585></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-f77bc585></rect>',2)])],544)),m("div",Wfe,[m("h1",null,O(C(i)("app.authPageTitle")),1),m("p",null,O(C(i)("app.authPageMessage")),1)]),m("button",{type:"button",class:"auth-page-btn",onClick:ws},[z[98]||(z[98]=m("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),m("path",{d:"M9 8H2"}),m("path",{d:"M5 5l3 3-3 3"})],-1)),m("span",null,O(C(i)("app.authPageLogin")),1)])])])):(x(),$("div",{key:2,class:Le(["app",{mobile:C(l),"sidebar-collapsed":C(Se)&&!C(l)}]),style:Bt({"--side-w":C(ae)+"px","--preview-w":C(_e)+"px"})},[C(l)?(x(),je(Aie,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:C(o).status.value.branch,"session-count":d.value,onOpenSwitcher:z[17]||(z[17]=ne=>a.value=!0),onOpenSettings:z[18]||(z[18]=ne=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),$(Pe,{key:0},[Lt(gt(k5,{"col-width":C(ae),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,onSelect:z[2]||(z[2]=ne=>C(o).selectSession(ne)),onCreate:vl,onCreateInWorkspace:z[3]||(z[3]=ne=>Er(ne)),onSelectWorkspace:z[4]||(z[4]=ne=>C(o).openWorkspace(ne)),onAddWorkspace:z[5]||(z[5]=ne=>Mn.value=!0),onRename:z[6]||(z[6]=(ne,Ye)=>C(o).renameSession(ne,Ye)),onArchive:z[7]||(z[7]=ne=>C(o).archiveSession(ne)),onFork:z[8]||(z[8]=ne=>C(o).forkSession(ne)),onRenameWorkspace:z[9]||(z[9]=(ne,Ye)=>C(o).renameWorkspace(ne,Ye)),onDeleteWorkspace:z[10]||(z[10]=ne=>C(o).deleteWorkspace(ne)),onReorderWorkspaces:z[11]||(z[11]=ne=>C(o).reorderWorkspaces(ne)),onLoadMoreSessions:z[12]||(z[12]=ne=>void C(o).loadMoreSessions(ne)),onLoadAllSessions:z[13]||(z[13]=ne=>void C(o).loadAllSessions()),onSelectWorkspaces:Lo,onOpenSettings:z[14]||(z[14]=ne=>Dn.value=!0),onCollapse:C(de)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),[[Bo,!C(Se)]]),Lt(gt(Xk,{"storage-key":C(V),"default-width":C(se),min:C(Y),max:C(G),"onUpdate:width":z[15]||(z[15]=ne=>ee.value=ne)},null,8,["storage-key","default-width","min","max"]),[[Bo,!C(Se)]]),C(Se)?(x(),$("div",Ufe,[m("button",{type:"button",class:"sidebar-expand-btn",title:C(i)("sidebar.expandSidebar"),"aria-label":C(i)("sidebar.expandSidebar"),onClick:z[16]||(z[16]=(...ne)=>C(de)&&C(de)(...ne))},[...z[99]||(z[99]=[yr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-f77bc585><path d="M4 6h9" data-v-f77bc585></path><path d="M4 12h9" data-v-f77bc585></path><path d="M4 18h9" data-v-f77bc585></path><path d="M17 9l3 3-3 3" data-v-f77bc585></path></svg>',1)])],8,jfe)])):ie("",!0)],64)),Vn.value?(x(),$("div",qfe,[z[100]||(z[100]=m("span",{class:"cs-icon"},"🚧",-1)),m("span",zfe,O(C(i)("app.comingSoon")),1)])):(x(),je(_X,{key:2,ref_key:"conversationPaneRef",ref:un,mobile:C(l),modern:C(o).theme.value==="modern"||C(o).theme.value==="kimi",turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,swarms:C(o).swarms.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,running:f.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,sending:C(o).isSending.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":u.value,pr:C(o).activePullRequest.value,"beta-toc":C(o).betaToc.value,onOpenChanges:z[19]||(z[19]=ne=>C(lt)()),onSelectWorkspace:z[20]||(z[20]=ne=>Er(ne)),onAddWorkspace:z[21]||(z[21]=ne=>Mn.value=!0),onOpenPr:ue,onSubmit:z[22]||(z[22]=ne=>qo(ne)),onSteer:z[23]||(z[23]=ne=>C(o).steerPrompt(ne.text,ne.attachments)),onApproval:z[24]||(z[24]=(ne,Ye)=>C(o).respondApproval(ne,Ye)),onCancelTask:z[25]||(z[25]=ne=>C(o).cancelTask(ne)),onAnswer:z[26]||(z[26]=(ne,Ye)=>C(o).respondQuestion(ne,Ye)),onDismiss:z[27]||(z[27]=ne=>C(o).dismissQuestion(ne)),onCommand:Di,onInterrupt:z[28]||(z[28]=ne=>C(o).abortCurrentPrompt()),onUnqueue:jo,onEditQueued:Bi,onSetPermission:z[29]||(z[29]=ne=>C(o).setPermission(ne)),onSetThinking:z[30]||(z[30]=ne=>C(o).setThinking(ne)),onTogglePlan:z[31]||(z[31]=ne=>C(o).togglePlanMode()),onToggleSwarm:z[32]||(z[32]=ne=>C(o).toggleSwarmMode()),onToggleGoal:z[33]||(z[33]=ne=>C(o).toggleGoalMode()),onCreateGoal:z[34]||(z[34]=ne=>C(o).createGoal(ne)),onControlGoal:z[35]||(z[35]=ne=>C(o).controlGoal(ne)),onRefreshGitStatus:z[36]||(z[36]=ne=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:z[37]||(z[37]=(ne,Ye)=>C(o).renameSession(ne,Ye)),onForkSession:z[38]||(z[38]=ne=>C(o).forkSession(ne)),onArchiveSession:z[39]||(z[39]=ne=>C(o).archiveSession(ne)),onCompact:z[40]||(z[40]=ne=>C(o).compact()),onPickModel:z[41]||(z[41]=ne=>zs()),onSelectModel:z[42]||(z[42]=ne=>C(o).setModel(ne)),onOpenFile:z[43]||(z[43]=ne=>C(M)(ne)),onOpenMedia:z[44]||(z[44]=ne=>C(L)(ne)),onOpenThinking:z[45]||(z[45]=ne=>C(fe)(ne)),onOpenCompaction:z[46]||(z[46]=ne=>C(X)(ne)),onOpenAgent:z[47]||(z[47]=ne=>C(Me)(ne)),onOpenToolDiff:z[48]||(z[48]=ne=>C(le)(ne)),onEditMessage:ho},null,8,["mobile","modern","turns","session-id","approvals","changes","git-info","tasks","todos","goal","swarms","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","running","queued","search-files","upload-image","sending","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","beta-toc"])),C(Tn)&&!C(l)?(x(),je(Xk,{key:4,"storage-key":C(we),"default-width":C($e),min:C(me),max:C(J),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":z[49]||(z[49]=ne=>ye.value=ne),"onUpdate:dragging":z[50]||(z[50]=ne=>$t.value=ne)},null,8,["storage-key","default-width","min","max","aria-label"])):ie("",!0),!C(l)||C(Tn)?(x(),$("aside",{key:5,class:Le(["global-preview",{open:C(Tn),mobile:C(l),"no-anim":C($t)}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Tn)},[w.value==="thinking"&&C(Z)?(x(),je(Qw,{key:0,text:C(W)??"",onClose:C(oe)},null,8,["text","onClose"])):w.value==="compaction"&&C(H)?(x(),je(Qw,{key:1,text:C(he)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(ce)},null,8,["text","subtitle","onClose"])):w.value==="agent"&&C(ke)?(x(),je(sJ,{key:2,member:C(ke),onClose:C(Ne)},null,8,["member","onClose"])):w.value==="btw"&&C(ut)?(x(),je(NJ,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:z[51]||(z[51]=ne=>C(o).sendSideChatPrompt(ne)),onClose:C(on)},null,8,["turns","running","sending","onClose"])):w.value==="diff"?(x(),je(yQ,{key:4,mode:C(We),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(Ct),onBack:z[52]||(z[52]=ne=>{We.value="list",nt.value=null,C(o).clearFileDiff()}),onClose:C(kt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):w.value==="toolDiff"&&C(re)?(x(),je(bJ,{key:5,target:C(re),onClose:C(Ce)},null,8,["target","onClose"])):w.value==="file"?(x(),je(NZ,{key:6,file:C(E),loading:C(k),error:C(A),line:C(N)?.line,"download-url":C(I),closable:"","external-actions":C(P),"open-file":C(M),onClose:C(R),onOpenExternal:C(B),onReveal:C(U)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ie("",!0)],10,Vfe)):ie("",!0),_s.value?(x(),je(zQ,{key:6,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:Ue.value,unavailable:qe.value,onSelect:z[53]||(z[53]=ne=>ai(ne)),onToggleStar:z[54]||(z[54]=ne=>C(o).toggleStarModel(ne)),onClose:z[55]||(z[55]=ne=>_s.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ie("",!0),Dn.value?(x(),je(qse,{key:7,theme:C(o).theme.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-permission":C(o).notifyPermission.value,"beta-toc":C(o).betaToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":Ns.value,"server-version":C(o).serverVersion.value,onSetTheme:z[56]||(z[56]=ne=>C(o).setTheme(ne)),onSetColorScheme:z[57]||(z[57]=ne=>C(o).setColorScheme(ne)),onSetUiFontSize:z[58]||(z[58]=ne=>C(o).setUiFontSize(ne)),onSetNotify:z[59]||(z[59]=ne=>C(o).setNotifyOnComplete(ne)),onSetBetaToc:z[60]||(z[60]=ne=>C(o).setBetaToc(ne)),onUpdateConfig:z[61]||(z[61]=ne=>jt(ne)),onLogin:z[62]||(z[62]=()=>{Dn.value=!1,ws()}),onLogout:C(o).logout,onOpenOnboarding:z[63]||(z[63]=()=>{Dn.value=!1,b()}),onClose:z[64]||(z[64]=ne=>Dn.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-permission","beta-toc","config","models","config-saving","server-version","onLogout"])):ie("",!0),Pn.value?(x(),je(Oee,{key:8,providers:C(o).providers.value,loading:wt.value,unavailable:Qt.value,onAdd:z[65]||(z[65]=ne=>Oe(ne)),onRefresh:z[66]||(z[66]=ne=>He(ne)),onDelete:z[67]||(z[67]=ne=>ge(ne)),onOpenLogin:z[68]||(z[68]=()=>{Pn.value=!1,ws()}),onClose:z[69]||(z[69]=ne=>Pn.value=!1)},null,8,["providers","loading","unavailable"])):ie("",!0),yn.value?(x(),je(Ote,{key:9,"recent-cwds":C(o).recentCwds.value,onCreate:z[70]||(z[70]=({cwd:ne,title:Ye})=>{yn.value=!1,C(o).createSession(ne,{title:Ye})}),onClose:z[71]||(z[71]=ne=>yn.value=!1)},null,8,["recent-cwds"])):ie("",!0),Rn.value?(x(),je(coe,{key:10,sessions:C(o).sessions.value,"workspace-groups":C(o).workspaceGroups.value,"attention-by-session":C(o).attentionBySession.value,"active-id":C(o).activeSessionId.value,onSelect:z[72]||(z[72]=ne=>{C(o).selectSession(ne),Rn.value=!1}),onClose:z[73]||(z[73]=ne=>Rn.value=!1)},null,8,["sessions","workspace-groups","attention-by-session","active-id"])):ie("",!0),ds.value?(x(),je(rie,{key:11,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:z[74]||(z[74]=ne=>ds.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ie("",!0),Mn.value?(x(),je(qoe,{key:12,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,onAdd:z[75]||(z[75]=ne=>Zn(ne)),onClose:Fi},null,8,["browse-fs","get-fs-home","default-path"])):ie("",!0),gt(Oi,{name:"gload-fade"},{default:In(()=>[C(o).initialized.value?ie("",!0):(x(),je(Nle,{key:0}))]),_:1}),_.value&&!C(h)?(x(),je(Mle,{key:13,theme:C(o).theme.value,onSetTheme:z[76]||(z[76]=ne=>C(o).setTheme(ne)),onComplete:y,onSkip:y},null,8,["theme"])):ie("",!0),gt(yie,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(r)?(x(),je(cae,{key:14})):ie("",!0),C(l)?(x(),je(ore,{key:15,modelValue:a.value,"onUpdate:modelValue":z[77]||(z[77]=ne=>a.value=ne),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:z[78]||(z[78]=ne=>C(o).selectSession(ne)),onCreate:vl,onCreateInWorkspace:z[79]||(z[79]=ne=>Er(ne)),onAddWorkspace:z[80]||(z[80]=ne=>Mn.value=!0),onRename:z[81]||(z[81]=(ne,Ye)=>C(o).renameSession(ne,Ye)),onArchive:z[82]||(z[82]=ne=>C(o).archiveSession(ne)),onDeleteWorkspace:z[83]||(z[83]=ne=>C(o).deleteWorkspace(ne)),onLoadMore:z[84]||(z[84]=ne=>void C(o).loadMoreSessions(ne))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ie("",!0),C(l)?(x(),je(rle,{key:16,modelValue:c.value,"onUpdate:modelValue":z[85]||(z[85]=ne=>c.value=ne),status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,theme:C(o).theme.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"beta-toc":C(o).betaToc.value,"server-version":C(o).serverVersion.value,onPickModel:z[86]||(z[86]=ne=>zs()),onSetThinking:z[87]||(z[87]=ne=>C(o).setThinking(ne)),onTogglePlan:z[88]||(z[88]=ne=>C(o).togglePlanMode()),onToggleSwarm:z[89]||(z[89]=ne=>C(o).toggleSwarmMode()),onSetPermission:z[90]||(z[90]=ne=>C(o).setPermission(ne)),onSetTheme:z[91]||(z[91]=ne=>C(o).setTheme(ne)),onSetColorScheme:z[92]||(z[92]=ne=>C(o).setColorScheme(ne)),onSetUiFontSize:z[93]||(z[93]=ne=>C(o).setUiFontSize(ne)),onSetBetaToc:z[94]||(z[94]=ne=>C(o).setBetaToc(ne)),onLogin:z[95]||(z[95]=()=>{c.value=!1,ws()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):ie("",!0)],6)),rn.value?(x(),je(hte,{key:3,"on-start-o-auth-login":Kt,"on-poll-o-auth-login":It,"on-cancel-o-auth-login":Ot,onSuccess:fo,onClose:z[96]||(z[96]=ne=>rn.value=!1)})):ie("",!0)]))}}),Gfe=vt(Kfe,[["__scopeId","data-v-f77bc585"]]);Kte();df(Gfe).use($n).mount("#app");export{$A as $,_he as A,bE as B,Un as C,Yhe as D,B2 as E,Pe as F,yr as G,dt as H,gt as I,QA as J,khe as K,si as L,Ze as M,V4 as N,Che as O,xhe as P,Ahe as Q,zd as R,la as S,fhe as T,The as U,V1 as V,She as W,Zhe as X,Mhe as Y,qhe as Z,Xfe as _,hS as a,vs as a$,us as a0,E1 as a1,ohe as a2,P1 as a3,g4 as a4,Xt as a5,xa as a6,uhe as a7,tpe as a8,mhe as a9,yS as aA,IE as aB,DE as aC,Zt as aD,RE as aE,PE as aF,$1 as aG,OE as aH,Ft as aI,D1 as aJ,oE as aK,x as aL,j4 as aM,ahe as aN,gn as aO,nS as aP,lhe as aQ,Xd as aR,to as aS,Kd as aT,te as aU,Bhe as aV,l$ as aW,Xe as aX,ia as aY,FE as aZ,bhe as a_,yhe as aa,vhe as ab,ghe as ac,Hhe as ad,npe as ae,Rt as af,w4 as ag,lh as ah,dr as ai,Ni as aj,Fn as ak,Fhe as al,so as am,vr as an,ar as ao,Ihe as ap,Nhe as aq,en as ar,mt as as,M4 as at,Le as au,Yfe as av,Bt as aw,$E as ax,LE as ay,qs as az,rhe as b,MH as b$,Khe as b0,Bc as b1,nf as b2,zhe as b3,gr as b4,YA as b5,Jfe as b6,hl as b7,dE as b8,Vhe as b9,wn as bA,Bo as bB,S4 as bC,Uhe as bD,Ke as bE,hE as bF,dhe as bG,pE as bH,Ohe as bI,In as bJ,Ehe as bK,Lt as bL,Mo as bM,Whe as bN,Je as bO,che as bP,Jt as bQ,no as bR,dpe as bS,gW as bT,XT as bU,hpe as bV,sH as bW,Bv as bX,fpe as bY,Vg as bZ,mpe as b_,Zfe as ba,O as bb,Cd as bc,whe as bd,Dt as be,the as bf,ehe as bg,tS as bh,Dhe as bi,Qfe as bj,C as bk,uu as bl,Qhe as bm,Xhe as bn,G4 as bo,hhe as bp,Phe as bq,fE as br,Jhe as bs,$he as bt,phe as bu,fS as bv,cf as bw,n$ as bx,oC as by,uf as bz,jhe as c,TH as c0,Pv as c1,xH as c2,ape as c3,Z9 as c4,lpe as c5,Pf as c6,CH as c7,ope as c8,ppe as c9,qT as ca,ipe as cb,vpe as cc,Jg as cd,Ql as ce,Xg as cf,ype as cg,gpe as ch,upe as ci,Zs as cj,rpe as ck,cpe as cl,iH as cm,Zg as cn,Yg as co,spe as cp,Rhe as d,fr as e,nhe as f,Oi as g,epe as h,she as i,ihe as j,Io as k,lu as l,Xn as m,Qf as n,Li as o,Ghe as p,F as q,df as r,je as s,ie as t,$ as u,m as v,l4 as w,Lhe as x,r4 as y,a$ as z};